/* HYUNWOO V31.79: 오늘의 복습 B-1 대시보드
   - 최종 승인 시안의 화이트/그레이/네이비/민트 구성
   - v31.72 톱니바퀴 SVG 유지
   - 전용 OX 플레이어에는 영향 없음 */

:root {
  --review-navy: #0d1b38;
  --review-navy-soft: #17294d;
  --review-teal: #10b7a4;
  --review-bg: #f7f8fb;
  --review-card: #ffffff;
  --review-line: #dbe2ec;
  --review-line-soft: #e9edf3;
  --review-muted: #73819a;
  --review-muted-light: #aab4c5;
}

body.review-dashboard-active:not(.dedicated-ox-player) {
  min-height: 100vh !important;
  display: flex !important;
  justify-content: center !important;
  padding: max(12px, env(safe-area-inset-top, 0px)) 14px calc(22px + env(safe-area-inset-bottom, 0px)) !important;
  background: var(--review-bg) !important;
  color: var(--review-navy) !important;
}

body.review-dashboard-active:not(.dedicated-ox-player) #appRoot {
  width: 100% !important;
  max-width: 430px !important;
  gap: 0 !important;
  padding: 0 !important;
  margin: 0 auto !important;
}

body.review-dashboard-active:not(.dedicated-ox-player) #appRoot > .topbar,
body.review-dashboard-active:not(.dedicated-ox-player) #appRoot > .bottom-tabbar,
body.review-dashboard-active:not(.dedicated-ox-player) #appRoot > .study-feature-nav,
body.review-dashboard-active:not(.dedicated-ox-player) #appRoot > .footer {
  display: none !important;
}

body.review-dashboard-active:not(.dedicated-ox-player) #appRoot [data-study-home] {
  display: none !important;
}

body.review-dashboard-active:not(.dedicated-ox-player) #appRoot [data-feature-panel="review"] {
  width: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

body.review-dashboard-active:not(.dedicated-ox-player) #appRoot [data-feature-panel="review"] > .card-inner {
  width: 100% !important;
  min-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  display: block !important;
}

body.review-dashboard-active:not(.dedicated-ox-player) #appRoot .review-dashboard-shell.review-mode-grid {
  width: 100% !important;
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}

.review-dashboard-header {
  min-height: 60px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 10px;
  padding: 0 2px 2px;
}

.review-dashboard-heading {
  min-width: 0;
  padding-top: 1px;
}

.review-dashboard-heading h2 {
  margin: 0;
  color: var(--review-navy);
  font-size: 25px;
  font-weight: 950;
  line-height: 1.08;
  letter-spacing: -0.055em;
  word-break: keep-all;
}

.review-dashboard-heading p {
  margin: 5px 0 0;
  color: var(--review-muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.review-dashboard-back,
.review-dashboard-settings {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--review-navy);
  box-shadow: none;
  cursor: pointer;
}

.review-dashboard-back {
  justify-self: start;
}

.review-dashboard-settings {
  justify-self: end;
}

.review-dashboard-back svg {
  width: 24px;
  height: 24px;
}

.review-dashboard-settings .settings-gear-svg {
  width: 18px;
  height: 18px;
  display: block;
  overflow: visible;
}

.review-dashboard-back:active,
.review-dashboard-settings:active {
  transform: scale(0.95);
  background: rgba(226, 232, 240, 0.62);
}

.review-dashboard-section,
.review-next-card {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--review-line);
  border-radius: 20px;
  background: var(--review-card);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.98) inset;
}

.review-dashboard-section {
  padding: 15px 16px;
}

.review-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.review-section-head h3,
.review-goal-title-row h3 {
  margin: 0;
  color: var(--review-navy);
  font-size: 17px;
  font-weight: 950;
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.review-section-head > span {
  color: #52617b;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.review-week-card {
  padding-bottom: 14px;
}

.review-week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
  margin-top: 13px;
}

.review-week-day {
  min-width: 0;
  min-height: 70px;
  display: grid;
  grid-template-rows: 16px 21px 19px;
  justify-items: center;
  align-content: center;
  gap: 4px;
  padding: 4px 1px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: var(--review-navy);
}

.review-week-day.is-today {
  border-color: var(--review-teal);
  background: #f5fffd;
  box-shadow: 0 0 0 1px rgba(16, 183, 164, 0.06) inset;
}

.review-week-weekday {
  color: #53617a;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.review-week-date {
  color: var(--review-navy);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.review-week-state {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  border: 1.5px solid #cbd4e2;
  border-radius: 999px;
  background: #ffffff;
  color: #ffffff;
}

.review-week-day.is-complete .review-week-state {
  border-color: var(--review-teal);
  background: var(--review-teal);
}

.review-week-state svg {
  width: 10px;
  height: 10px;
  display: block;
}

.review-week-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 8px;
  color: #71809a;
  font-size: 12px;
  font-weight: 750;
}

.review-week-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.review-week-legend i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #d9e0eb;
}

.review-week-legend i.is-complete {
  background: var(--review-teal);
}

.review-goal-card {
  padding: 14px;
}

.review-goal-title-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 1px 1px 9px;
}

.review-goal-icon {
  width: 27px;
  height: 27px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  background: #f1f4f8;
  color: #6b7890;
  flex: 0 0 auto;
}

.review-goal-icon svg {
  width: 17px;
  height: 17px;
}

.review-goal-metrics {
  min-height: 78px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--review-line-soft);
  border-radius: 15px;
  background: #ffffff;
  overflow: hidden;
}

.review-goal-metrics > div {
  position: relative;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  padding: 10px 9px 9px;
}

.review-goal-metrics > div + div::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 1px;
  background: var(--review-line-soft);
}

.review-goal-metrics span {
  color: #63718a;
  font-size: 12px;
  font-weight: 750;
}

.review-goal-metrics strong {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  color: var(--review-teal);
  font-weight: 950;
  line-height: 1;
}

.review-goal-metrics b {
  font-size: 26px;
  font-weight: 950;
  letter-spacing: -0.045em;
}

.review-goal-metrics small {
  font-size: 15px;
  font-weight: 900;
}

.review-goal-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 2px 7px;
  color: #65738c;
  font-size: 12px;
  font-weight: 800;
}

.review-goal-progress-head strong {
  color: #53617b;
  font-size: 12px;
  font-weight: 800;
}

.review-goal-progress-head b {
  font: inherit;
}

.review-goal-progress {
  height: 7px;
  border-radius: 999px;
  background: #e8edf4;
  overflow: hidden;
}

.review-goal-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0ba995 0%, #17c0ae 100%);
  transition: width 0.28s ease;
}

.review-goal-start {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  padding: 0 15px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(100deg, var(--review-navy) 0%, var(--review-navy-soft) 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 950;
  letter-spacing: -0.035em;
  box-shadow: 0 7px 17px rgba(13, 27, 56, 0.12);
  cursor: pointer;
}

.review-goal-start > span:first-child {
  grid-column: 2;
  justify-self: center;
}

.review-goal-start > svg {
  grid-column: 3;
  width: 22px;
  height: 22px;
  justify-self: end;
}

.review-goal-start:active {
  transform: translateY(1px);
  box-shadow: 0 4px 11px rgba(13, 27, 56, 0.11);
}

.review-composition-card {
  padding: 14px 13px 10px;
}

.review-composition-head {
  padding: 0 3px 9px;
}

.review-composition-head button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  margin: -4px -4px;
  padding: 5px 4px;
  border: 0;
  background: transparent;
  color: #6d7b94;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.review-composition-head button span {
  font-size: 18px;
  line-height: 0.8;
}

.review-composition-list {
  border: 1px solid var(--review-line-soft);
  border-radius: 15px;
  background: #ffffff;
  overflow: hidden;
}

.review-composition-row {
  width: 100%;
  min-height: 56px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 9px;
  padding: 6px 10px;
  border: 0;
  background: #ffffff;
  color: var(--review-navy);
  text-align: left;
  cursor: pointer;
}

.review-composition-row + .review-composition-row {
  border-top: 1px solid var(--review-line-soft);
}

.review-composition-row:active {
  background: #f8fafc;
}

.review-composition-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 11px;
  font-size: 21px;
  font-weight: 900;
}

.review-composition-icon svg {
  width: 19px;
  height: 19px;
}

.review-composition-icon.is-wrong {
  background: #fff0f1;
  color: #e05359;
}

.review-composition-icon.is-confused {
  background: #fff8e8;
  color: #b68018;
}

.review-composition-icon.is-bookmark {
  background: #eafaf8;
  color: #10ad9d;
}

.review-composition-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.review-composition-copy strong {
  color: var(--review-navy);
  font-size: 14px;
  font-weight: 950;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.review-composition-copy small {
  color: #7c899f;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  white-space: normal;
  word-break: keep-all;
}

.review-composition-count {
  min-width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  justify-self: end;
  border-radius: 999px;
  background: #f2f5f9;
  color: var(--review-navy);
  font-size: 14px;
  font-weight: 950;
}

.review-next-card {
  min-height: 62px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  color: var(--review-navy);
  text-align: left;
  cursor: pointer;
}

.review-next-card:active {
  background: #fbfcfe;
}

.review-next-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  color: #64738d;
}

.review-next-icon svg {
  width: 24px;
  height: 24px;
}

.review-next-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.review-next-copy strong {
  color: var(--review-navy);
  font-size: 15px;
  font-weight: 950;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.review-next-copy small {
  color: #78869e;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.1;
  white-space: normal;
}

.review-next-chevron {
  width: 22px;
  height: 22px;
  justify-self: end;
  color: #8996aa;
}

.review-data-sink,
.review-dashboard-data {
  display: none !important;
}

@media (max-width: 390px) {
  body.review-dashboard-active:not(.dedicated-ox-player) {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .review-dashboard-heading h2 {
    font-size: 23px;
  }

  .review-dashboard-section {
    padding-left: 15px;
    padding-right: 15px;
  }

  .review-week-grid {
    gap: 1px;
  }

  .review-week-day {
    min-height: 68px;
  }
}

@media (min-width: 760px) {
  body.review-dashboard-active:not(.dedicated-ox-player) {
    padding: 28px 22px 34px !important;
  }

  body.review-dashboard-active:not(.dedicated-ox-player) #appRoot {
    max-width: 860px !important;
  }

  body.review-dashboard-active:not(.dedicated-ox-player) #appRoot .review-dashboard-shell.review-mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  .review-dashboard-header,
  .review-week-card,
  .review-next-card {
    grid-column: 1 / -1;
  }

  .review-goal-card,
  .review-composition-card {
    height: 100%;
  }
}

/* Legacy mobile button rules use !important and force review buttons into centered flex rows.
   Reassert the approved dashboard geometry after every legacy sheet. */
body.review-dashboard-active:not(.dedicated-ox-player) #appRoot .review-goal-start {
  display: grid !important;
  grid-template-columns: 32px minmax(0, 1fr) 32px !important;
  justify-content: stretch !important;
  justify-items: stretch !important;
  text-align: center !important;
}

body.review-dashboard-active:not(.dedicated-ox-player) #appRoot .review-composition-row {
  display: grid !important;
  grid-template-columns: 36px minmax(0, 1fr) 32px !important;
  justify-content: stretch !important;
  justify-items: stretch !important;
  text-align: left !important;
}

body.review-dashboard-active:not(.dedicated-ox-player) #appRoot .review-composition-icon {
  justify-self: start !important;
}

body.review-dashboard-active:not(.dedicated-ox-player) #appRoot .review-composition-copy {
  justify-self: stretch !important;
  text-align: left !important;
}

body.review-dashboard-active:not(.dedicated-ox-player) #appRoot .review-composition-count {
  justify-self: end !important;
}

body.review-dashboard-active:not(.dedicated-ox-player) #appRoot .review-next-card {
  display: grid !important;
  grid-template-columns: 36px minmax(0, 1fr) 20px !important;
  justify-content: stretch !important;
  justify-items: stretch !important;
  text-align: left !important;
}

body.review-dashboard-active:not(.dedicated-ox-player) #appRoot .review-next-icon {
  justify-self: start !important;
}

body.review-dashboard-active:not(.dedicated-ox-player) #appRoot .review-next-copy {
  justify-self: stretch !important;
  text-align: left !important;
}
