/* Easy Voca visual system. */

/* Design tokens */
:root {
  --quiet-danger: #a64f45;
  --quiet-danger-soft: #f9e9e8;
  --quiet-radius-xl: 30px;
  --quiet-radius-lg: 22px;
  --quiet-radius-md: 16px;
  --quiet-tap: 52px;
  --adi-primary: var(--quiet-ink);
  --adi-surface: var(--quiet-surface);
  --adi-surface-muted: var(--quiet-bg);
  --adi-text: var(--quiet-ink);
  --adi-text-muted: var(--quiet-muted);
  --adi-sale: var(--quiet-danger);
  --adi-membership: var(--quiet-sage-strong);
  --adi-yellow: var(--quiet-yellow);
  --adi-radius: var(--quiet-radius-md);
  --adi-tap: var(--quiet-tap);
  --adi-font-body: "Pretendard Variable", Pretendard, SUIT, "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  --adi-font-display: "Pretendard Variable", Pretendard, SUIT, "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  --adi-shadow: var(--quiet-shadow);
  --adi-shadow-sm: var(--quiet-shadow-sm);
  --compact-radius-xl: 24px;
  --compact-radius-lg: 20px;
  --deck-yellow-soft: #fff0b4;
  --deck-coral-soft: #ffe0dd;
  --quiet-shadow: 4px 4px 0 rgba(37, 27, 23, 0.1);
  --quiet-shadow-sm: 3px 3px 0 rgba(37, 27, 23, 0.08);
  --compact-shadow: 3px 3px 0 rgba(37, 27, 23, 0.08);
  --compact-gutter: 22px;
  --deck-paper: #fbf6e9;
  --deck-surface: #fefbf4;
  --deck-ink: #251a16;
  --deck-muted: #6e6258;
  --deck-yellow: #fde194;
  --deck-yellow-strong: #f9db87;
  --deck-coral: #f99588;
  --deck-sage: #b5bf93;
  --deck-sage-soft: #e6e8d1;
  --deck-sage-layer: #ccd6b5;
  --deck-review-yellow: #f3ce75;
  --deck-nav-active: #fceec4;
  --deck-line: #251a16;
  --quiet-bg: var(--deck-paper);
  --quiet-surface: var(--deck-surface);
  --quiet-ink: var(--deck-ink);
  --quiet-muted: var(--deck-muted);
  --quiet-yellow: var(--deck-yellow);
  --quiet-yellow-soft: #fff0b8;
  --quiet-blush-soft: #fbe0dc;
  --quiet-sage: var(--deck-sage);
  --quiet-sage-strong: #667454;
  --quiet-sage-soft: var(--deck-sage-soft);
  --quiet-border: #cfc3b5;
}

html, body {
  -webkit-tap-highlight-color: transparent;
}

.stats {
  position: relative;
  z-index: 1;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.button, .ghost-btn, .small-btn, .tab-btn, .answer-btn {
  border: none;
  outline: none;
  cursor: pointer;
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.button.secondary {
  border: 1px solid var(--adi-primary);
  box-shadow: none;
}

.button.outline-only {
  box-shadow: none;
}

.bar .section-title {
  margin-bottom: 0;
}

textarea, input[type="text"] {
  font: inherit;
}

.row-chip {
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.level-badge {
  gap: 6px;
}

.card-face.flipped {
  overflow-y: auto;
}

.card-text {
  word-break: break-word;
}

.tap-guide {
  text-align: center;
}

.effect {
  text-align: center;
}

.list-back {
  word-break: break-word;
}

.toast {
  line-height: 1.4;
}

@media (max-width: 360px) {
  .card-text {
    font-size: 22px;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .answer-row.show {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .answer-btn {
    min-height: 58px;
    padding: 6px 4px;
    font-size: 11px;
    line-height: 1.25;
  }

  .tabs {
    gap: 6px;
  }

  .tab-btn {
    min-height: 52px;
  }

  .btn-row {
    grid-template-columns: 1fr;
  }
}

/* Quiet-focus foundation. */


* {
  box-sizing: border-box;
}

html {
  background: #ebe7df;
}

html, body {
  margin: 0;
  padding: 0;
  color: var(--quiet-ink);
  font-family: var(--adi-font-body);
  text-rendering: optimizeLegibility;
}

body {
  display: flex;
  justify-content: center;
  background: #ebe7df;
}

h1, h2, h3, p {
  margin: 0;
}

button, textarea, input {
  font-family: inherit;
}

button {
  border: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

button:focus-visible, textarea:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--quiet-sage-strong);
  outline-offset: 3px;
}

.app {
  position: relative;
  box-shadow: 0 0 0 1px rgba(38, 30, 26, 0.04), 0 30px 80px rgba(38, 30, 26, 0.12);
}

.view {
  animation: quietFade 0.22s ease both;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

@keyframes quietFade {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.brand-header, .page-header {
  display: flex;
  align-items: center;
}

.brand-avatar {
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  overflow: visible;
}

.brand-copy {
  min-width: 0;
}

.brand-name, .page-title {
  margin: 0;
  color: var(--quiet-ink);
  font-weight: 800;
  letter-spacing: -0.035em;
  text-transform: none;
}

.brand-tagline, .page-subtitle {
  color: var(--quiet-muted);
}

.page-heading {
  min-width: 0;
}

.panel, .review-card, .list-card, .help-step, .toast, .modal-box {
  background: var(--quiet-surface);
  border: 1px solid var(--quiet-border);
  border-radius: var(--quiet-radius-lg);
  box-shadow: var(--quiet-shadow-sm);
}

.home-review-card {
  width: calc(100% - 18px);
  position: relative;
  isolation: isolate;
}

.home-review-card::before {
  position: absolute;
  border-radius: 50%;
  z-index: -1;
}

.home-review-label {
  color: var(--quiet-ink);
  letter-spacing: -0.02em;
}

.due-count {
  color: var(--quiet-ink);
  font-weight: 850;
}

.home-mascot {
  position: absolute;
  height: auto;
  pointer-events: none;
  user-select: none;
}

.home-review-card .button {
  position: relative;
  z-index: 1;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.stat {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--quiet-border);
  border-radius: var(--quiet-radius-lg);
  background: var(--quiet-surface);
  box-shadow: var(--quiet-shadow-sm);
}

.stat-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 13px;
  background: var(--quiet-sage-soft);
  color: var(--quiet-sage-strong);
}

.stat:nth-child(2) .stat-icon {
  background: var(--quiet-blush-soft);
  color: #d87989;
}

.stat-icon svg {
  width: 20px;
  height: 20px;
}

.stat-label {
  margin-bottom: 7px;
  color: var(--quiet-muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.stat-value {
  color: var(--quiet-ink);
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.section-title {
  color: var(--quiet-ink);
  font-size: 14px;
  font-weight: 750;
  letter-spacing: -0.015em;
  text-transform: none;
}

.panel {
  padding: 18px;
}

.info-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 15px 16px;
  border: 1px solid var(--quiet-border);
  border-radius: var(--quiet-radius-lg);
  background: var(--quiet-surface);
  box-shadow: var(--quiet-shadow-sm);
}

.info-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--quiet-yellow-soft);
  color: #c08e1b;
}

.info-icon svg {
  width: 21px;
  height: 21px;
}

.info-content {
  min-width: 0;
  flex: 1;
}

.info-title {
  font-size: 14px;
  font-weight: 750;
  line-height: 1.35;
}

.info-copy {
  margin-top: 3px;
  color: var(--quiet-muted);
  font-size: 12px;
  line-height: 1.45;
}

.help-stack {
  margin-top: 0;
}

.help-step strong {
  margin-bottom: 5px;
  letter-spacing: -0.01em;
  text-transform: none;
}

.button, .ghost-btn, .small-btn, .tab-btn, .answer-btn {
  border-radius: var(--quiet-radius-md);
  letter-spacing: -0.01em;
  text-transform: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, opacity 0.15s ease;
}

.button:active, .ghost-btn:active, .small-btn:active, .tab-btn:active, .answer-btn:active {
  transform: translateY(1px) scale(0.99);
}

.button {
  width: 100%;
  min-height: var(--quiet-tap);
  margin-top: 16px;
  padding: 0 18px;
  border: 1px solid var(--quiet-ink);
  background: var(--quiet-ink);
  color: white;
  box-shadow: none;
  font-size: 14px;
  font-weight: 750;
}

.button:hover {
  background: #3a2f29;
}

button:disabled {
  cursor: default;
  opacity: 0.58;
}

.button.secondary {
  background: var(--quiet-sage-strong);
  color: white;
  border-color: var(--quiet-sage-strong);
}

.button.outline-only {
  background: transparent;
  color: var(--quiet-ink);
  border: 1px solid var(--quiet-border);
}

.button svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.home-review-card .button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ghost-btn {
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid var(--quiet-border);
  background: var(--quiet-surface);
  color: var(--quiet-ink);
  font-size: 13px;
  font-weight: 700;
}

.small-btn {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--quiet-border);
  background: var(--quiet-surface);
  color: var(--quiet-ink);
  font-size: 12px;
  font-weight: 700;
}

.small-btn.danger {
  color: var(--quiet-danger);
  background: var(--quiet-danger-soft);
  border-color: transparent;
}

.small-btn.lav {
  color: var(--quiet-ink);
  background: var(--quiet-yellow-soft);
  border-color: transparent;
}

#enableNotifBtn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.bar .section-title {
  margin: 0;
}

.btn-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

textarea, input[type="text"] {
  width: 100%;
  border-radius: var(--quiet-radius-md);
  padding: 16px;
  line-height: 1.6;
}

textarea {
  resize: vertical;
}

input[type="text"] {
  min-height: 50px;
  margin-top: 8px;
}

textarea::placeholder, input::placeholder {
  opacity: 1;
}

textarea:focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--quiet-sage);
  box-shadow: 0 0 0 4px rgba(120, 145, 123, 0.14);
}

.field-label {
  display: block;
  margin-top: 14px;
  color: var(--quiet-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.hint, .mini-text {
  color: var(--quiet-muted);
  font-size: 13px;
  line-height: 1.6;
}

.utility-panel .section-title {
  margin-bottom: 6px;
}

.preview-box {
  color: var(--quiet-ink);
  font-size: 13px;
  line-height: 1.5;
}

.row-preview {
  display: grid;
  gap: 7px;
  overflow: auto;
}

.row-chip {
  display: block;
  padding: 9px 11px;
  overflow-wrap: anywhere;
  border: 1px solid rgba(120, 145, 123, 0.18);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--quiet-ink);
  font-size: 12px;
  line-height: 1.45;
}

.review-head {
  justify-content: space-between;
}

.progress {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--quiet-ink);
  letter-spacing: -0.04em;
  text-transform: none;
}

.review-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  letter-spacing: 0;
  text-transform: none;
}

.card-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
}

.card-stage:focus-visible {
  outline: 3px solid var(--quiet-sage-strong);
  outline-offset: 3px;
}

.card-stage[role="group"] {
  cursor: default;
}

.card-face {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  border: 1px solid rgba(255, 212, 92, 0.44);
  background: #fff9dd;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.75);
  transition: opacity 0.16s ease, background-color 0.22s ease;
}

.card-face.fade-out {
  opacity: 0;
}

.card-face.flipped {
  background: var(--quiet-sage-soft);
  border-color: rgba(120, 145, 123, 0.22);
}

.card-text {
  max-width: 100%;
  color: var(--quiet-ink);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

.card-front-echo {
  font-weight: 600;
  text-decoration: none;
}

.card-back-text {
  color: var(--quiet-ink);
  font-weight: 700;
}

.tap-guide {
  color: var(--quiet-muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

.effect {
  color: #5c765f;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.answer-row {
  display: none;
}

.answer-row.show {
  display: grid;
}

.answer-btn {
  min-width: 0;
  padding: 7px 6px;
  background: var(--quiet-surface);
  color: var(--quiet-ink);
  line-height: 1.25;
}

.list-wrap {
  display: grid;
}

.list-card {
  grid-template-columns: minmax(0, 1fr) auto;
}

.list-front {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.list-actions {
  grid-template-columns: repeat(2, auto);
}

.empty {
  padding: 38px 20px;
  color: var(--quiet-muted);
  text-align: center;
  font-size: 14px;
  line-height: 1.65;
}

.toast-wrap {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, calc(100% - 32px));
  z-index: 40;
  pointer-events: none;
}

.toast {
  display: none;
  padding: 13px 16px;
  border: none;
  border-radius: 15px;
  background: #334a39;
  color: white;
  box-shadow: 0 12px 28px rgba(38, 30, 26, 0.18);
  text-align: center;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.toast.show {
  display: block;
  animation: quietToast 0.2s ease;
}

.toast.error {
  background: #793e39;
}

.toast.notice {
  background: var(--quiet-ink);
}

@keyframes quietToast {
  from { opacity: 0; transform: translateY(-7px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(38, 30, 26, 0.48);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 50;
}

.modal.show {
  display: flex;
}

.modal-box {
  width: 100%;
  max-width: 390px;
  max-height: min(86vh, 620px);
  padding: 22px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--quiet-radius-lg);
  background: #fffefa;
  box-shadow: 0 24px 70px rgba(38, 30, 26, 0.24);
  text-align: left;
}

.modal-title {
  color: var(--quiet-ink);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.025em;
  text-transform: none;
}

.modal-text {
  margin-top: 8px;
  color: var(--quiet-muted);
  font-size: 13px;
  line-height: 1.65;
}

.modal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 18px;
}

#modalConfirm {
  min-height: 48px !important;
  margin-top: 0 !important;
}

#modalConfirm.danger {
  background: var(--quiet-danger);
  border-color: var(--quiet-danger);
  color: white;
}

#modalCancel {
  min-height: 48px;
}

.footer-space {
  height: 8px;
}

.hidden-file-input {
  display: none;
}

.tabs {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  -webkit-backdrop-filter: blur(18px);
  z-index: 20;
}

.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: transparent;
}

@media (min-width: 560px) {
  .app {
    border-left: 1px solid rgba(38, 30, 26, 0.05);
    border-right: 1px solid rgba(38, 30, 26, 0.05);
  }
}

@media (max-width: 380px) {
  .app {
    padding-left: 16px;
    padding-right: 16px;
  }

  .home-mascot {
    right: 0;
    bottom: 8px;
  }

  .home-review-card .button {
    padding-left: 13px;
    padding-right: 13px;
  }

  .help-hero {
    grid-template-columns: minmax(0, 1fr) 100px;
    gap: 8px;
    padding: 20px;
  }

  .help-hero .brand-name {
    font-size: 26px;
  }

  .stat {
    padding: 15px;
  }

  .stat-value {
    font-size: 24px;
  }

  .tabs {
    padding-left: 12px;
    padding-right: 12px;
  }

  .list-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .answer-btn {
    min-height: 58px;
    padding: 7px 3px;
  }

  .review-card {
    padding: 14px;
  }

  .card-face {
    min-height: 300px;
    padding: 24px 18px;
  }
}

@media (max-height: 700px) and (max-width: 520px) {
  .app {
    padding-top: calc(14px + env(safe-area-inset-top));
  }

  .review-head {
    margin-bottom: 8px;
  }

  .review-card {
    min-height: 0;
    padding: 12px;
  }

  .review-card > .bar {
    margin-bottom: 4px;
  }

  .card-stage {
    padding: 7px 0;
  }

  .card-face {
    min-height: 230px;
    max-height: 260px;
    padding: 20px 16px;
  }

  .tap-guide {
    margin-top: 2px;
  }

  .answer-row {
    margin-top: 7px;
  }

  .answer-btn {
    min-height: 50px;
  }

  .tab-btn {
    min-height: 54px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Card-deck B design and responsive refinements. */


html, body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

body {
  min-height: 100dvh;
}

.app {
  overflow-x: clip;
}

.view {
  width: 100%;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.brand-header, .page-header {
  min-height: 46px;
  gap: 11px;
  margin-bottom: 13px;
}

.brand-avatar {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
}

.brand-name, .page-title {
  font-size: clamp(24px, 7vw, 28px);
  line-height: 1.1;
}

.brand-tagline, .page-subtitle {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.35;
}

.home-review-card::before {
  width: 148px;
  height: 148px;
  right: -54px;
  top: -62px;
}

.home-review-label, .due-count, .home-review-copy {
  position: relative;
  z-index: 1;
}

.home-mascot {
  z-index: 0;
}

.stats.home-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.home-stats .stat {
  display: grid;
  grid-template-rows: auto auto;
  align-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.home-stats .stat-icon {
  grid-row: 1 / 3;
  margin: 0;
}

.home-stats .stat-label {
  align-self: end;
  margin: 0;
  line-height: 1.25;
  white-space: nowrap;
}

.home-stats .stat-value {
  align-self: start;
  margin-top: 2px;
  line-height: 1.1;
}

.home-utilities {
  display: grid;
  gap: 8px;
}

.home-utilities .info-copy {
  line-height: 1.35;
}

.home-utilities #enableNotifBtn {
  min-height: 44px;
  padding: 0 10px;
  border-radius: 13px;
  font-size: 11px;
}

.section {
  margin-top: 12px;
}

.section-title {
  margin-bottom: 9px;
}

.review-head {
  display: grid;
  align-items: center;
  gap: 8px;
}

.review-back-btn {
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--quiet-ink);
}

.review-title {
  justify-self: center;
  line-height: 1;
  letter-spacing: -0.03em;
}

.progress {
  line-height: 1;
  text-align: right;
}

.review-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 0.22s ease;
}

.review-card > .bar {
  margin-bottom: 5px;
}

.card-face {
  height: 100%;
  min-height: 300px;
  max-height: 100%;
  padding: 22px 18px;
  border-radius: 19px;
}

.card-text {
  font-size: clamp(25px, 7vw, 33px);
}

.tap-guide {
  margin-top: 2px;
}

.effect {
  min-height: 18px;
  margin-top: 5px;
}

.answer-btn.delete {
  border: 1px solid #e89a92;
}

.answer-btn.bad {
  border: 1px solid #eed28b;
}

textarea, input[type="text"] {
  border-color: #968c82;
  font-size: 16px;
}

textarea::placeholder, input::placeholder {
  color: #756d66;
}

.row-preview {
  margin-top: 7px;
}

.list-page-header {
  align-items: flex-start;
}

.list-controls {
  display: grid;
}

.list-search {
  position: relative;
  display: block;
}

.list-search svg {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.list-search input {
  margin: 0;
  padding: 0 14px 0 44px;
}

.filter-chips {
  display: flex;
  padding-bottom: 1px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex: 0 0 auto;
}

.filter-chip span {
  margin-left: 2px;
}

.backup-panel {
  margin-top: 11px;
  padding: 0;
  overflow: hidden;
}

.backup-panel summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  list-style: none;
}

.backup-panel summary::-webkit-details-marker {
  display: none;
}

.backup-panel summary::after {
  content: "+";
  margin-left: auto;
  color: var(--quiet-muted);
  font-size: 18px;
}

.backup-panel[open] summary::after {
  content: "−";
}

.backup-panel .mini-text {
  padding: 0 14px;
}

.backup-panel .btn-row {
  padding: 0 14px 14px;
}

.help-hero {
  grid-template-columns: none;
  gap: 12px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.privacy-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.privacy-icon {
  display: grid;
  place-items: center;
  border-radius: 14px;
}

.privacy-card strong {
  display: block;
}

.privacy-card p {
  line-height: 1.45;
}

.help-home-button {
  margin-top: 10px;
}

@media (max-width: 380px) {
  .home-review-card .button {
    width: 146px;
  }

  .home-mascot {
    width: 43%;
  }

  .home-stats .stat {
    column-gap: 8px;
  }

  .home-stats .stat-value {
    font-size: 20px;
  }

  .list-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .answer-btn {
    padding-inline: 3px;
    font-size: 11px;
  }
}

@media (max-height: 740px) and (max-width: 520px) {
  .app {
    padding-top: calc(10px + env(safe-area-inset-top));
  }

  .brand-header, .page-header {
    margin-bottom: 9px;
  }

  .home-review-card {
    min-height: 214px;
  }

  .home-utilities {
    gap: 6px;
    margin-top: 8px;
  }

  .home-utilities .info-card {
    min-height: 54px;
  }

  .review-card {
    height: calc(100dvh - 168px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    min-height: min(430px, calc(100dvh - 168px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
    padding: 11px;
  }

  .card-face {
    min-height: 245px;
    padding: 17px 14px;
  }

  .answer-btn {
    min-height: 50px;
  }
}

/* Card Deck (B): compact iPhone-safe geometry with a tactile flash-card finish. */


.app {
  color: var(--deck-ink);
}

.brand-name, .page-title, .review-title, .due-count {
  font-weight: 900;
  letter-spacing: -0.045em;
}

.brand-avatar {
  padding: 1px;
  border: 2px solid var(--deck-line);
  border-radius: 50%;
  background: var(--deck-yellow-soft);
  box-shadow: 2px 2px 0 var(--deck-coral);
}

.home-review-card::before {
  background: rgba(255, 255, 255, 0.3);
  border: 2px solid rgba(37, 27, 23, 0.08);
}

.button, .ghost-btn, .small-btn, .answer-btn, .review-back-btn, .filter-chip {
  border-width: 2px;
  border-color: var(--deck-line);
  box-shadow: 2px 2px 0 rgba(37, 27, 23, 0.14);
}

.button:active, .ghost-btn:active, .small-btn:active, .answer-btn:active, .review-back-btn:active, .filter-chip:active {
  box-shadow: none;
  transform: translate(2px, 2px);
}

.home-utilities .info-icon {
  color: var(--deck-ink);
}

.home-utilities #enableNotifBtn {
  border-color: var(--deck-line);
  background: var(--deck-sage-soft);
  color: var(--deck-ink);
}

.card-front-echo {
  color: var(--deck-muted);
}

textarea, input[type="text"] {
  border: 2px solid var(--deck-line);
  background: #fffef9;
  color: var(--deck-ink);
  box-shadow: 2px 2px 0 #d8cbbb;
}

.input-panel .button.secondary {
  border-color: var(--deck-line);
}

.input-panel .button.outline-only {
  border-color: var(--deck-line);
}

.filter-chip.active {
  border-color: var(--deck-line);
  color: var(--deck-ink);
}

.list-card:nth-child(3n + 2) {
  box-shadow: 4px 4px 0 var(--deck-coral);
}

.list-card:nth-child(3n + 3) {
  box-shadow: 4px 4px 0 var(--deck-sage);
}

.list-actions .small-btn {
  border-color: var(--deck-line);
}

.help-stack {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.privacy-icon {
  color: var(--deck-ink);
}

.tabs {
  backdrop-filter: none;
}

.tab-btn.active {
  border-color: var(--deck-line);
}

/* Card Deck B — faithful 426px mobile composition. */


html, body {
  background: #e9dfcf;
}

.app {
  width: 100%;
  max-width: 426px;
  min-height: 100dvh;
  padding: calc(28px + env(safe-area-inset-top)) var(--compact-gutter)
        calc(98px + env(safe-area-inset-bottom));
  background: radial-gradient(circle at 13px 11px, rgba(94, 66, 42, 0.05) 0 0.65px, transparent 0.8px) 0 0 / 22px 22px,
        var(--deck-paper);
}

.brand-name, .page-title, .review-title, .due-count, .list-title-row strong {
  color: var(--deck-ink);
  font-weight: 900;
  letter-spacing: -0.055em;
}

/* Home */

#view-home {
  padding-top: max(0px, calc(38px - env(safe-area-inset-top)));
}

.brand-header {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  margin-bottom: 32px;
}

.brand-header .brand-avatar {
  width: 52px;
  height: 52px;
  flex-basis: 52px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #e0d4c3;
  border-radius: 50%;
  background: white;
  box-shadow: none;
}

.brand-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.brand-header .brand-name {
  font-size: clamp(29px, 7.7vw, 33px);
  line-height: 1;
}

.header-notif-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--deck-ink);
  box-shadow: none;
}

.header-notif-btn svg {
  width: 29px;
  height: 29px;
}

.header-notif-btn:disabled {
  opacity: 1;
}

.home-review-card {
  min-height: clamp(284px, 72vw, 307px);
  padding: 24px 44% 22px 20px;
  overflow: hidden;
  border: 2px solid var(--deck-line);
  border-radius: 24px;
  background: linear-gradient(145deg, #fff5c9 0%, #ffe59d 100%);
  box-shadow: 9px 9px 0 -1px var(--deck-sage-layer),
        9px 9px 0 1px var(--deck-line),
        18px 18px 0 -1px #fd8d89,
        18px 18px 0 1px var(--deck-line);
}

.home-review-card::before {
  content: none;
}

.home-review-label {
  font-size: clamp(17px, 4.5vw, 20px);
  font-weight: 850;
  line-height: 1.2;
}

.due-count {
  margin-top: 10px;
  font-size: clamp(64px, 18vw, 78px);
  line-height: 0.92;
  letter-spacing: -0.08em;
}

.home-review-copy {
  max-width: 205px;
  margin-top: 14px;
  color: var(--deck-ink);
  font-size: clamp(14px, 3.7vw, 16px);
  line-height: 1.42;
  white-space: nowrap;
}

.home-review-card .button {
  width: clamp(158px, 42vw, 176px);
  min-height: clamp(58px, 15vw, 65px);
  margin-top: 22px;
  padding: 0 20px;
  border: 0;
  border-radius: 16px;
  background: var(--deck-ink);
  color: white;
  box-shadow: 0 7px 15px rgba(37, 26, 22, 0.16);
  font-size: clamp(18px, 4.8vw, 21px);
  font-weight: 850;
}

.home-review-card .button svg {
  width: 27px;
  height: 27px;
}

.home-mascot {
  right: -12px;
  bottom: 8px;
  width: 42%;
  max-width: 185px;
  filter: drop-shadow(0 0 2px white) drop-shadow(0 5px 6px rgba(37, 26, 22, 0.12));
}

.stats.home-stats {
  min-height: 98px;
  margin-top: 43px;
  overflow: hidden;
  border: 1.5px solid #c9bbaa;
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 8px 22px rgba(67, 46, 30, 0.08);
}

.home-stats .stat {
  grid-template-columns: 51px minmax(0, 1fr);
  min-height: 98px;
  column-gap: 13px;
  padding: 16px 14px;
}

.home-stats .stat + .stat {
  border-left: 1.5px solid #d6cabd;
}

.home-stats .stat-icon {
  width: 51px;
  height: 51px;
  border: 0;
  border-radius: 50%;
  box-shadow: none;
}

.home-stats .stat-icon svg {
  width: 27px;
  height: 27px;
}

.home-stats .stat-label {
  font-size: clamp(14px, 3.8vw, 16px);
  font-weight: 650;
}

.home-stats .stat-value {
  font-size: clamp(27px, 7.5vw, 32px);
  font-weight: 900;
}

.home-utilities {
  margin-top: 24px;
}

.home-utilities .info-card {
  min-height: 80px;
  padding: 13px 17px;
  border: 1.5px solid #c9bbaa;
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 8px 22px rgba(67, 46, 30, 0.07);
}

.home-utilities .info-icon {
  width: 51px;
  height: 51px;
  flex-basis: 51px;
  border: 0;
  border-radius: 50%;
  background: #ffedb5;
  box-shadow: none;
}

.home-utilities .info-icon svg {
  width: 28px;
  height: 28px;
}

.home-utilities .info-title {
  font-size: 17px;
  font-weight: 900;
}

.home-utilities .info-copy {
  margin-top: 4px;
  font-size: 15px;
}

/* Shared illustrated page headers */

.page-header {
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  margin-bottom: 24px;
}

.page-mascot {
  width: 91px;
  height: 110px;
  flex: 0 0 91px;
  object-fit: contain;
  filter: drop-shadow(0 4px 5px rgba(37, 26, 22, 0.08));
}

.page-title {
  font-size: clamp(31px, 8.4vw, 36px);
  line-height: 1;
}

.page-subtitle {
  margin-top: 12px;
  color: var(--deck-ink);
  font-size: 15px;
  line-height: 1.35;
}

/* Review */

.review-head {
  grid-template-columns: 44px minmax(0, 1fr) 58px;
  min-height: 44px;
  margin-bottom: 20px;
}

.review-back-btn {
  width: 44px;
  height: 44px;
  border: 2px solid var(--deck-line);
  border-radius: 15px;
  background: var(--deck-surface);
  box-shadow: none;
}

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

.review-title {
  margin: 0 0 0 14px;
  font-size: 27px;
  font-weight: 900;
}

.progress {
  min-width: 58px;
  font-size: 18px;
  font-weight: 850;
}

.review-track {
  position: relative;
  height: 8px;
  margin: 0 0 34px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #ded6c8;
}

.review-track::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 calc(12.5% - 3px), var(--deck-paper) calc(12.5% - 3px) 12.5%);
}

.review-track span {
  position: relative;
  z-index: 1;
  background: var(--deck-yellow-strong);
}

.review-card {
  height: auto;
  min-height: 0;
  max-height: none;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.review-card > .bar {
  position: absolute;
  top: 24px;
  left: 20px;
  right: 32px;
  z-index: 5;
  margin: 0;
}

.review-card > .bar .mini-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.level-badge {
  min-height: 32px;
  padding: 5px 15px;
  border: 2px solid var(--deck-line);
  border-radius: 999px;
  background: var(--deck-sage);
  color: var(--deck-ink);
  box-shadow: none;
  font-size: 14px;
  font-weight: 900;
}

.card-stage {
  position: relative;
  flex: 0 0 clamp(410px, calc(59.5dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom)), 547px);
  height: clamp(410px, calc(59.5dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom)), 547px);
  min-height: 0;
  padding: 0 20px 28px 0;
  overflow: visible;
  border-radius: 22px;
}

.card-face, .card-face.flipped {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 405px;
  max-height: none;
  padding: 82px 24px 30px;
  overflow-y: auto;
  border: 2px solid var(--deck-line);
  border-radius: 20px;
  background: var(--deck-surface);
  box-shadow: 14px 14px 0 -1px var(--deck-coral),
        14px 14px 0 1px var(--deck-line),
        28px 28px 0 -1px var(--deck-review-yellow),
        28px 28px 0 1px var(--deck-line);
}

.card-face:not(.flipped) {
  align-items: center;
  justify-content: flex-start;
  padding-right: 43%;
  text-align: left;
}

.card-face:not(.flipped) .card-text {
  position: relative;
  z-index: 2;
  width: 100%;
  font-size: clamp(36px, 10vw, 48px);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.055em;
}

.review-mascot {
  position: absolute;
  right: 8px;
  bottom: 22px;
  z-index: 1;
  width: 44%;
  max-height: 57%;
  object-fit: contain;
  filter: drop-shadow(0 0 2px white);
  pointer-events: none;
}

.card-face.flipped .review-mascot {
  display: none;
}

.card-face.flipped {
  align-items: flex-start;
  justify-content: flex-start;
  padding: 78px 28px 28px;
  text-align: left;
}

.card-face.flipped .card-text {
  width: 100%;
  font-size: 15px;
  font-weight: 600;
}

.card-front-echo {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1.5px solid var(--deck-line);
  font-size: 14px;
}

.card-back-text {
  font-size: clamp(15px, 4vw, 17px);
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.review-card > div:last-child {
  flex: 0 0 auto;
  padding-top: 28px;
}

.tap-guide, .effect {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.answer-row {
  grid-template-columns: 0.93fr 1.08fr 1fr;
  gap: 9px;
  margin-top: 8px;
}

.answer-btn {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 2px solid var(--deck-line);
  border-radius: 14px;
  box-shadow: none;
  font-size: 15px;
  font-weight: 850;
}

.answer-btn svg {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  stroke-width: 1.8;
}

.answer-btn.delete {
  border-color: #9f332d;
  background: var(--deck-surface);
  color: #9f332d;
}

.answer-btn.bad {
  border-color: var(--deck-line);
  background: var(--deck-surface);
  color: var(--deck-ink);
}

.answer-btn.good {
  border-color: var(--deck-line);
  background: #a9bd82;
  color: var(--deck-ink);
}

/* Add */

.add-page-header {
  margin-bottom: 46px;
}

.add-input-section {
  margin-top: 0;
}

.input-panel {
  position: relative;
  z-index: 1;
  width: calc(100% - 8px);
  min-height: clamp(535px, 136vw, 579px);
  margin-left: -4px;
  padding: 28px 14px 24px;
  overflow: visible;
  border: 2px solid var(--deck-line);
  border-radius: 18px;
  background: var(--deck-surface);
  box-shadow: 6px 7px 0 -1px var(--deck-surface),
        6px 7px 0 1px var(--deck-line),
        11px 14px 0 -1px var(--deck-surface),
        11px 14px 0 1px var(--deck-line);
}

.input-panel > :not(.deck-tab) {
  position: relative;
  z-index: 2;
}

.deck-tab {
  position: absolute;
  right: -27px;
  z-index: 1;
  width: 30px;
  border: 2px solid var(--deck-line);
  border-left: 0;
  border-radius: 0 13px 13px 0;
}

.deck-tab-coral {
  top: 44px;
  height: 68px;
  background: var(--deck-coral);
}

.deck-tab-sage {
  top: 124px;
  height: 58px;
  background: var(--deck-sage);
}

.input-panel .section-title {
  margin-bottom: 8px;
  font-size: 20px;
  font-weight: 900;
}

textarea {
  min-height: clamp(252px, 64vw, 273px);
  padding: 20px 16px;
  border: 2px solid var(--deck-line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.52);
  box-shadow: none;
  color: var(--deck-ink);
  font-size: 16px;
  line-height: 1.62;
}

.input-panel .button {
  min-height: clamp(52px, 13.25vw, 57px);
  margin-top: 27px;
  border: 2px solid var(--deck-line);
  border-radius: 13px;
  box-shadow: none;
  font-size: 18px;
  font-weight: 900;
}

.input-panel .button + .button {
  margin-top: 9px;
}

.input-panel .button.secondary {
  background: var(--deck-ink);
  color: white;
}

.input-panel .button.outline-only {
  background: var(--deck-yellow);
  color: var(--deck-ink);
}

.preview-box {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-height: 44px;
  margin-top: 16px;
  padding: 8px 12px;
  border: 1.5px solid #aab18d;
  border-radius: 12px;
  background: #eff0df;
}

.preview-info-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #526544;
  color: white;
  font-family: Georgia, serif;
  font-weight: 900;
}

#previewSummary {
  color: #46513c;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 750;
}

.row-preview {
  max-height: 78px;
}

/* List */

#view-list {
  position: relative;
}

.list-page-header {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 48px;
  gap: 12px;
  min-height: 78px;
  margin-bottom: 24px;
}

.list-page-mascot {
  width: 72px;
  height: 78px;
  flex-basis: 72px;
}

.list-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.list-title-row .page-title {
  white-space: nowrap;
  font-size: clamp(27px, 7.6vw, 33px);
}

.list-title-row strong {
  flex: 0 0 auto;
  padding: 8px 11px;
  border-radius: 14px;
  background: var(--deck-yellow);
  font-size: 18px;
  line-height: 1;
}

.list-menu-btn {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 2px solid var(--deck-line);
  border-radius: 13px;
  background: var(--deck-yellow);
  color: var(--deck-ink);
  box-shadow: none;
}

.list-menu-btn svg {
  width: 28px;
  height: 28px;
}

.list-controls {
  gap: 17px;
}

.list-search input {
  min-height: 54px;
  padding-left: 51px;
  border: 2px solid var(--deck-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: none;
  font-size: 16px;
}

.list-search svg {
  left: 16px;
  width: 25px;
  height: 25px;
  color: var(--deck-ink);
}

.filter-chips {
  gap: 10px;
}

.filter-chip {
  min-height: 42px;
  padding: 0 18px;
  border: 1.5px solid #9f9589;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  color: var(--deck-ink);
  font-size: 14px;
  font-weight: 850;
}

.filter-chip.active {
  border: 2px solid var(--deck-line);
  background: var(--deck-yellow);
  box-shadow: none;
}

.backup-panel {
  position: absolute;
  top: 75px;
  right: 0;
  z-index: 30;
  width: min(260px, calc(100% - 22px));
  margin: 0;
  border: 2px solid var(--deck-line);
  border-radius: 14px;
  background: var(--deck-surface);
  box-shadow: 6px 7px 0 var(--deck-yellow);
}

.backup-panel:not([open]) {
  display: none;
}

.backup-panel .btn-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.backup-panel .ghost-btn {
  min-width: 0;
  padding: 0 7px;
  font-size: 11px;
}

#view-list > .section {
  margin-top: 24px;
  padding-right: 12px;
}

.list-wrap {
  gap: 31px;
}

.list-card {
  position: relative;
  z-index: 0;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  min-height: 172px;
  padding: 19px 20px 16px;
  gap: 14px;
  overflow: visible;
  border: 2px solid var(--deck-line);
  border-radius: 15px;
  background: var(--deck-surface);
  box-shadow: 4px 5px 0 -1px var(--deck-surface),
        4px 5px 0 1px var(--deck-line),
        8px 10px 0 -1px var(--deck-surface),
        8px 10px 0 1px var(--deck-line);
}

.list-card::after {
  content: "";
  position: absolute;
  top: 17px;
  right: -18px;
  z-index: -1;
  width: 20px;
  height: 61px;
  border: 2px solid var(--deck-line);
  border-left: 0;
  border-radius: 0 11px 11px 0;
  background: var(--deck-yellow);
}

.list-card:nth-child(3n + 2)::after {
  background: var(--deck-coral);
}

.list-card:nth-child(3n + 3)::after {
  background: var(--deck-sage);
}

.list-card:nth-child(3n + 2), .list-card:nth-child(3n + 3) {
  box-shadow: 4px 5px 0 -1px var(--deck-surface), 4px 5px 0 1px var(--deck-line), 8px 10px 0 -1px var(--deck-surface), 8px 10px 0 1px var(--deck-line);
}

.list-main {
  min-width: 0;
}

.list-label {
  width: max-content;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--deck-sage-soft);
  color: var(--deck-ink);
  font-size: 12px;
  font-weight: 850;
}

.list-front {
  margin-top: 15px;
  color: var(--deck-ink);
  font-size: clamp(23px, 6.5vw, 28px);
  font-weight: 900;
  line-height: 1.16;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

.list-back {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1.5px solid var(--deck-line);
  color: var(--deck-ink);
  font-size: 15px;
  line-height: 1.48;
  overflow-wrap: anywhere;
}

.list-actions {
  align-self: flex-end;
  display: flex;
  align-items: center;
  gap: 10px;
}

.list-actions .small-btn {
  min-width: 0;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--deck-ink);
  font-size: 14px;
  font-weight: 850;
}

.list-actions .small-btn svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.8;
}

.list-actions .small-btn.danger {
  color: #9f332d;
}

.list-action-divider {
  width: 1.5px;
  height: 30px;
  background: var(--deck-line);
}

/* Help */

.help-hero {
  min-height: 152px;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  margin: 0 calc(-1 * var(--compact-gutter)) 0;
  padding: 0 var(--compact-gutter) 24px;
  border-bottom: 2px solid var(--deck-line);
  background: transparent;
}

.help-hero .brand-name {
  font-size: clamp(32px, 8.8vw, 38px);
  line-height: 1;
}

.help-avatar {
  width: 112px;
  height: 112px;
  flex-basis: 112px;
  align-self: flex-start;
  padding: 0;
  overflow: hidden;
  border: 2px solid var(--deck-line);
  border-radius: 50%;
  background: white;
  box-shadow: none;
}

.help-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.help-content {
  margin-top: 26px;
}

.help-stack {
  counter-reset: help-step;
  display: grid;
  gap: clamp(30px, 7.7vw, 33px);
  overflow: visible;
}

.help-step {
  counter-increment: help-step;
  position: relative;
  min-height: clamp(104px, 26.5vw, 113px);
  display: flex;
  align-items: center;
  padding: 18px 83px 18px 77px;
  overflow: visible;
  border: 2px solid var(--deck-line);
  border-radius: 15px;
  background: var(--deck-surface);
  box-shadow: 8px 8px 0 -2px var(--deck-yellow), 8px 8px 0 0 var(--deck-line);
}

.help-step + .help-step {
  border-top: 2px solid var(--deck-line);
}

.help-step:nth-child(2) {
  box-shadow: 8px 8px 0 -2px var(--deck-coral), 8px 8px 0 0 var(--deck-line);
}

.help-step:nth-child(3) {
  box-shadow: 8px 8px 0 -2px var(--deck-sage), 8px 8px 0 0 var(--deck-line);
}

.help-step::before {
  content: counter(help-step);
  position: absolute;
  top: 50%;
  left: 17px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 2px solid var(--deck-line);
  border-radius: 50%;
  background: var(--deck-yellow);
  color: var(--deck-ink);
  font-size: 25px;
  font-weight: 900;
  transform: translateY(-50%);
}

.help-step:nth-child(2)::before {
  background: var(--deck-coral);
}

.help-step:nth-child(3)::before {
  background: var(--deck-sage);
}

.help-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -34px;
  height: 31px;
  border-left: 3px dotted var(--deck-line);
  transform: translateX(-50%);
}

.help-step-copy {
  min-width: 0;
}

.help-step strong {
  display: block;
  color: var(--deck-ink);
  font-size: clamp(21px, 5.8vw, 25px);
  line-height: 1.1;
  font-weight: 900;
}

.help-step p {
  margin-top: 8px;
  color: var(--deck-ink);
  font-size: 14px;
  line-height: 1.42;
}

.help-step-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 58px;
  height: 58px;
  color: var(--deck-line);
  stroke-width: 2.2;
  transform: translateY(-50%);
}

.help-choice-icon {
  position: absolute;
  right: 11px;
  top: 50%;
  display: flex;
  gap: 4px;
  transform: translateY(-50%);
}

.help-choice-icon span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--deck-line);
  border-radius: 50%;
  color: var(--deck-ink);
  font-size: 15px;
  font-weight: 900;
}

.help-choice-icon span:nth-child(1) {
  background: var(--deck-coral);
}

.help-choice-icon span:nth-child(2) {
  background: var(--deck-yellow);
}

.help-choice-icon span:nth-child(3) {
  background: var(--deck-sage);
}

.privacy-card {
  min-height: clamp(86px, 21.6vw, 92px);
  margin-top: 28px;
  padding: 12px 16px;
  border: 2px solid var(--deck-line);
  border-radius: 15px;
  background: var(--deck-sage-soft);
  box-shadow: none;
}

.privacy-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border: 0;
  background: transparent;
}

.privacy-icon svg {
  width: 48px;
  height: 48px;
  stroke-width: 1.6;
}

.privacy-card strong {
  font-size: 17px;
  font-weight: 900;
}

.privacy-card p {
  margin-top: 6px;
  color: var(--deck-ink);
  font-size: 13px;
}

.help-home-button {
  width: 70%;
  min-height: clamp(44px, 11.3vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px auto 0;
  padding: 0 19px;
  border: 2px solid var(--deck-line);
  border-radius: 9px;
  background: var(--deck-surface);
  color: var(--deck-ink);
  box-shadow: none;
  font-size: 17px;
  font-weight: 900;
}

.help-home-button svg {
  width: 25px;
  height: 25px;
}

/* Bottom navigation */

.tabs {
  width: min(426px, 100%);
  min-height: calc(82px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  border-top: 1.5px solid #bfb2a1;
  background: rgba(254, 251, 244, 0.98);
  box-shadow: none;
}

.tab-btn {
  width: 78px;
  min-height: 64px;
  justify-self: center;
  padding: 7px 4px 5px;
  border: 0;
  border-radius: 18px;
  box-shadow: none;
  color: var(--deck-ink);
  font-size: 14px;
  font-weight: 800;
}

.tab-btn svg {
  width: 28px;
  height: 28px;
  stroke-width: 1.9;
}

.tab-btn.active {
  border: 0;
  background: var(--deck-nav-active);
  color: var(--deck-ink);
  box-shadow: none;
}

@media (max-width: 380px) {
  :root {
    --compact-gutter: 18px;
  }

  .app {
    padding-top: calc(22px + env(safe-area-inset-top));
  }

  .brand-header {
    grid-template-columns: 52px minmax(0, 1fr) 44px;
    gap: 10px;
    margin-bottom: 26px;
  }

  .brand-header .brand-avatar {
    width: 52px;
    height: 52px;
  }

  .header-notif-btn {
    width: 44px;
    height: 44px;
  }

  .home-review-card {
    min-height: 286px;
    padding: 24px 43% 23px 18px;
  }

  .home-review-copy {
    white-space: normal;
  }

  .home-review-card .button {
    margin-top: 22px;
  }

  .stats.home-stats {
    margin-top: 38px;
  }

  .home-stats .stat {
    grid-template-columns: 43px minmax(0, 1fr);
    padding: 13px 10px;
  }

  .home-stats .stat-icon {
    width: 43px;
    height: 43px;
  }

  .page-mascot {
    width: 86px;
    height: 102px;
    flex-basis: 86px;
  }

  .list-page-header {
    grid-template-columns: 61px minmax(0, 1fr) 44px;
    gap: 8px;
  }

  .list-page-mascot {
    width: 61px;
    height: 70px;
  }

  .list-menu-btn {
    width: 44px;
    height: 44px;
  }

  .list-title-row {
    gap: 7px;
  }

  .list-title-row strong {
    padding: 7px 8px;
    font-size: 16px;
  }

  .help-avatar {
    width: 102px;
    height: 102px;
    flex-basis: 102px;
  }

  .help-step {
    padding-right: 75px;
    padding-left: 72px;
  }

  .help-step::before {
    left: 13px;
    width: 48px;
    height: 48px;
  }

  .help-step-icon {
    width: 52px;
    height: 52px;
    right: 11px;
  }

  .tab-btn {
    width: 72px;
  }
}

/* Let the mobile PWA use the full canvas instead of sitting in a 426px frame. */

@media (max-width: 600px) {
  html, body {
    background: var(--deck-paper);
  }

  body {
    justify-content: flex-start;
  }

  .app {
    max-width: none;
    padding-top: calc(10px + env(safe-area-inset-top));
    padding-left: max(var(--compact-gutter), env(safe-area-inset-left));
    padding-right: max(var(--compact-gutter), env(safe-area-inset-right));
  }

  #view-home {
    padding-top: 0;
  }

  .tabs {
    width: 100%;
    padding-left: max(8px, env(safe-area-inset-left));
    padding-right: max(8px, env(safe-area-inset-right));
  }
}

/* Semantic element resets and application-only states. */
[hidden] {
  display: none !important;
}

.help-stack,
.list-wrap {
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
  list-style: none;
}

.backup-panel:not([open]) {
  display: block;
}

.clipboard-fallback {
  position: fixed;
  inset: 0 auto auto -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Compact horizontal layout for phones rotated to landscape. */
@media (orientation: landscape) and (max-height: 500px) {
  html,
  body {
    background: var(--deck-paper);
  }

  .app {
    max-width: 720px;
    min-height: 100dvh;
    padding: max(8px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
      calc(62px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }

  .review-head {
    min-height: 40px;
    margin-bottom: 6px;
  }

  .review-back-btn {
    width: 40px;
    height: 40px;
  }

  .review-title {
    font-size: 24px;
  }

  .review-track {
    margin-bottom: 8px;
  }

  .review-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 20px;
    min-height: 0;
    overflow: visible;
  }

  .card-stage {
    grid-column: 1;
    width: 100%;
    height: 244px;
    min-height: 0;
    flex: none;
    padding: 0 14px 14px 0;
  }

  .card-face,
  .card-face.flipped {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    padding: 56px 20px 16px;
    box-shadow: 8px 8px 0 -1px var(--deck-coral),
      8px 8px 0 1px var(--deck-line),
      16px 16px 0 -1px var(--deck-review-yellow),
      16px 16px 0 1px var(--deck-line);
  }

  .card-back-text {
    font-size: 15px;
    line-height: 1.5;
  }

  .review-card > .bar {
    top: 14px;
    left: 14px;
    right: 24px;
  }

  .review-card > div:last-child {
    grid-column: 2;
    align-self: end;
    padding-top: 0;
  }

  .answer-row {
    grid-template-columns: 1fr;
    gap: 7px;
    margin: 0;
  }

  .answer-btn {
    min-height: 62px;
  }

  .tabs {
    width: min(720px, 100%);
    min-height: calc(57px + env(safe-area-inset-bottom));
    padding-top: 4px;
    padding-bottom: calc(4px + env(safe-area-inset-bottom));
  }

  .tab-btn {
    min-height: 48px;
    flex-direction: row;
  }

  .footer-space {
    display: none;
  }
}
