.dashboard-grid { align-items: start; }
.dashboard-privacy { display: inline-flex; align-items: center; gap: 7px; margin-top: 14px; color: #9bc5bd; font-size: .75rem; font-weight: 650; }
.dashboard-privacy svg { width: 15px; height: 15px; }
.profile-summary { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; padding: 0 22px 22px; }
.tally-storage-note { margin-top:14px; }
.profile-summary small, .profile-summary strong { display: block; }
.profile-summary strong { margin-top: 4px; font-size: .82rem; }
.settings-grid { grid-template-columns: minmax(0,1fr); }
.settings-grid .full { grid-column: 1 / -1; }
.prototype-banner { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 18px; padding: 12px 14px; border: 1px solid var(--teal-line); border-radius: 11px; color: var(--text-soft); background: var(--primary-soft); font-size: .78rem; line-height: 1.48; }
.prototype-banner strong { color: var(--primary-dark); }
@media (max-width: 760px) {
  .profile-summary, .settings-grid { grid-template-columns: 1fr; }
  .settings-grid .full { grid-column: auto; }
}

.route-host.route-entering > * { animation: routeEnter .28s cubic-bezier(.2,.8,.2,1) both; }
@keyframes routeEnter { from { opacity: 0; transform: translateY(8px) scale(.997); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .route-progress i, .route-loading span, .route-host.route-entering > * { animation: none !important; } }

/* Tally import / export */
.tally-intro { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 18px; }
.tally-intro h2 { margin: 7px 0 6px; font-size: 1.48rem; }
.tally-intro p { max-width: 820px; margin: 0; color: var(--text-soft); font-size: .82rem; line-height: 1.55; }
.tally-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.tally-panel { overflow: hidden; }
.tally-tools { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 20px 13px; }
.tally-tools .secondary { min-height: 32px; padding: 5px 9px; font-size: .75rem; }
.tally-groups { display: grid; gap: 10px; padding: 0 16px 16px; }
.tally-group { overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.tally-group-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 11px; border-bottom: 1px solid var(--line); }
.tally-group-head strong, .tally-group-head small { display: block; }
.tally-group-head strong { font-size: .78rem; }
.tally-group-head small { margin-top: 2px; font-size: .68rem; }
.tally-group-head > div:last-child { display: flex; gap: 9px; }
.tally-group-head .text-button { font-size: .72rem; }
.tally-selection-list { max-height: 270px; overflow: auto; }
.tally-selection-row { position: relative; display: grid; grid-template-columns: 20px 1fr; gap: 9px; align-items: start; padding: 9px 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.tally-selection-row:last-child { border-bottom: 0; }
.tally-selection-row:hover { background: var(--surface); }
.tally-selection-row input { position: absolute; opacity: 0; pointer-events: none; }
.selection-check { display: grid; place-items: center; width: 17px; height: 17px; margin-top: 2px; border: 1.5px solid var(--line-strong); border-radius: 5px; background: var(--surface); }
.tally-selection-row input:checked + .selection-check { border-color: var(--primary); background: var(--primary); box-shadow: inset 0 0 0 3px var(--surface); }
.tally-selection-row strong, .tally-selection-row small, .tally-selection-row em { display: block; }
.tally-selection-row strong { color: var(--text); font-size: .78rem; }
.tally-selection-row small { margin-top: 2px; font-size: .69rem; line-height: 1.35; }
.tally-selection-row em { margin-top: 4px; color: var(--pending); font-size: .67rem; font-style: normal; line-height: 1.35; }
.tally-group-empty, .tally-empty { padding: 22px; color: var(--text-muted); text-align: center; font-size: .75rem; }
.tally-footer { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-soft); }
.tally-footer strong, .tally-footer small { display: block; }
.tally-footer strong { font-size: .77rem; }
.tally-footer small { max-width: 470px; margin-top: 3px; font-size: .68rem; line-height: 1.4; }
.tally-file-row { display: grid; gap: 10px; padding: 0 20px 14px; }
.file-picker { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; align-items: center; padding: 11px 12px; border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--surface-soft); cursor: pointer; }
.file-picker input { display: none; }
.file-picker span { grid-row: 1 / 3; align-self: center; margin: 0; padding: 7px 10px; border-radius: 8px; color: #fff; background: var(--primary); font-size: .75rem; font-weight: 750; }
.file-picker small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toggle-line { display: flex; gap: 9px; align-items: center; color: var(--text-soft); font-size: .74rem; font-weight: 650; }
.toggle-line input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.toggle-line span { margin: 0; }
.tally-result { margin: 0 16px 16px; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.tally-result-summary { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface-soft); }
.tally-result-summary div { padding: 9px 10px; border-right: 1px solid var(--line); }
.tally-result-summary div:last-child { border-right: 0; }
.tally-result-summary small, .tally-result-summary strong { display: block; }
.tally-result-summary strong { margin-top: 2px; font-size: .9rem; }
.tally-result-list { max-height: 180px; overflow: auto; padding: 5px 10px; }
.tally-result-list > div { display: grid; grid-template-columns: minmax(100px, .65fr) 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .68rem; }
.tally-result-list > div:last-child { border-bottom: 0; }
.tally-result-list .failed strong { color: var(--danger); }
.tally-result-list .updated strong { color: var(--primary); }
.tally-result-list .created strong { color: var(--accepted); }
.tally-result-list span { color: var(--text-soft); }

@media (max-width: 1180px) { .tally-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .tally-intro { display: block; }
  .tally-intro .secure-chip { margin-top: 10px; }
  .tally-footer { align-items: stretch; flex-direction: column; }
  .tally-footer .primary { width: 100%; }
  .tally-result-summary { grid-template-columns: repeat(2, 1fr); }
}

.dashboard-period-bar, .tally-period-bar { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 14px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.dashboard-period-bar > div:first-child small, .dashboard-period-bar > div:first-child strong,
.tally-period-bar > div:first-child small, .tally-period-bar > div:first-child strong { display: block; }
.dashboard-period-bar > div:first-child strong, .tally-period-bar > div:first-child strong { margin-top: 2px; font-size: .8rem; }
.report-period-control { display: grid; justify-items: end; gap: 5px; }
.report-period-control > strong { color: var(--text-soft); font-size: .78rem; }
@media (max-width: 760px) {
  .dashboard-period-bar, .tally-period-bar { align-items: stretch; flex-direction: column; }
  .report-period-control { justify-items: stretch; width: 100%; }
  .report-intro { align-items: stretch; flex-direction: column; }
}

/* Account authentication — structurally matched to normal Tizori v200. */
body.auth-active {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}
.auth-view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: #eef4f2;
}
.auth-shell {
  width: 100%;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(440px, 1.15fr) minmax(430px, .85fr);
}
.auth-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: clamp(28px, 4.5vh, 48px) clamp(42px, 7vw, 110px);
  color: #fff;
  background:
    radial-gradient(circle at 86% 10%, rgba(91, 206, 184, .2), transparent 28%),
    radial-gradient(circle at 15% 88%, rgba(55, 151, 134, .18), transparent 32%),
    linear-gradient(145deg, #0b2724 0%, #0c3c37 58%, #0a574f 100%);
}
.auth-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom right, #000, transparent 75%);
}
.auth-brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0;
  color: #fff;
  text-decoration: none;
}
.auth-copy {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin-top: clamp(28px, 6vh, 70px);
}
.auth-copy .eyebrow { color: #86d7c8; }
.auth-copy h1 {
  max-width: 690px;
  margin: 13px 0 15px;
  font-size: clamp(2.6rem, 4.8vw, 5rem);
  line-height: .98;
  letter-spacing: -.065em;
}
.auth-copy > p {
  max-width: 610px;
  margin: 0;
  color: #c4d9d5;
  font-size: clamp(.96rem, 1.15vw, 1.08rem);
  line-height: 1.55;
}
.auth-feature-grid {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin-top: clamp(22px, 4vh, 38px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.auth-feature-grid article {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 11px 13px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  background: rgba(255,255,255,.045);
  backdrop-filter: blur(10px);
}
.auth-feature-grid article > span { flex: none; color: #72cab9; font-size: .82rem; font-weight: 850; letter-spacing: .12em; }
.auth-feature-grid strong { display: block; font-size: .96rem; }
.auth-feature-grid p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin: 4px 0 0;
  color: #a9c3be;
  font-size: .88rem;
  line-height: 1.45;
}
.auth-panel-wrap {
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 48px 7vw;
  background: var(--surface-soft);
}
.auth-card {
  width: min(100%, 480px);
  max-height: calc(100dvh - 40px);
  overflow: hidden;
  padding: clamp(28px, 4vw, 46px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.auth-card-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.auth-card-head .eyebrow { color: var(--primary); }
.auth-card-head h2 { margin: 8px 0 4px; font-size: 2rem; letter-spacing: -.04em; }
.auth-card-head p { margin: 0; color: var(--text-soft); font-size: .96rem; }
.secure-mark { display: grid; place-items: center; width: 44px; height: 44px; flex:none; border: 1px solid var(--teal-line); border-radius: 13px; color: var(--primary); background: var(--primary-soft); font-size: 1.2rem; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 30px 0 26px; padding: 4px; border-radius: 11px; background: var(--surface-muted); }
.auth-tab { border: 0; border-radius: 8px; padding: 11px; color: var(--text-soft); background: transparent; cursor: pointer; font-size: .88rem; font-weight: 700; }
.auth-tab.active { color: var(--text); background: var(--surface); box-shadow: 0 3px 12px rgba(23,35,33,.08); }
.auth-form { display: grid; gap: 17px; }
.auth-aux-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: -2px; }
.auth-remember-row { flex: 1 1 auto; min-width: 0; align-items: center !important; gap: 10px; margin: 0; }
.auth-remember-row input { margin-top: 0; flex: none; }
.auth-remember-row > span { line-height: 1.35; }
.auth-link { flex: none; justify-self: auto; margin: 0; padding: 0; white-space: nowrap; }
.password-help { margin: -10px 0 2px; }
.register-password-warning {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: -2px 0 1px;
  padding: 9px 10px;
  border: 1px solid rgba(188, 136, 0, .34);
  border-radius: 9px;
  background: rgba(255, 193, 7, .12);
  color: var(--text);
  font-size: .8rem;
  line-height: 1.42;
}
.register-password-warning > span { display: grid; place-items: center; width: 19px; height: 19px; flex: 0 0 19px; border-radius: 50%; background: rgba(255, 193, 7, .22); color: #a56d00; font-weight: 900; }
.register-password-warning p { margin: 0; }
.register-password-warning strong { font-weight: 800; }
.auth-form label > span { margin-bottom: 7px; font-size: .88rem; }
.auth-form label em { color: var(--text-muted); font-size: .82rem; font-style: normal; font-weight: 500; }
.auth-form .field-help { margin: -7px 0 0; font-size: .82rem; }
.check-row { display: flex !important; align-items: flex-start; gap: 10px; cursor: pointer; color: var(--text-soft); font-size: .88rem; }
.check-row input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--primary); }
.check-row > span { display: block; margin: 0; }
.wide { width: 100%; }
.large { min-height: 48px; }
.link-button { border: 0; padding: 5px; color: var(--primary); background: none; font-size: .88rem; font-weight: 750; }
.link-button:hover { text-decoration: underline; }
.login-username-status { min-height:0;margin:-4px 0 6px;font-size:.76rem;line-height:1.35; }
.username-availability { display:grid;gap:7px;margin:-3px 0 8px;font-size:.82rem;line-height:1.35; }
.username-availability.checking .username-availability-message::before { width:10px;height:10px;border:2px solid var(--feedback-text);border-right-color:transparent;background:transparent;animation:auth-spin .7s linear infinite; }
.auth-status { margin-top:10px; }
.auth-form .inline-status { margin-top:8px; }
.username-suggestions { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.username-suggestion { min-height:28px; padding:5px 9px; border:1px solid var(--teal-line); border-radius:999px; color:var(--primary-dark); background:var(--surface); font-size:.82rem; font-weight:750; }
.username-suggestion:hover,.username-suggestion:focus-visible { border-color:var(--primary); color:#fff; background:var(--primary); outline:none; }
.inline-status { min-height:0; margin:0; font-size:.88rem; line-height:1.45; }
.mobile-auth-intro, .mobile-auth-back { display: none; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

/* Exact normal-Tizori horizontal auth-logo sizing contract. */
.auth-brand, .front-auth-brand { gap: 0 !important; }
.auth-brand img, .front-auth-brand img, .auth-brand .brand-logo, .mobile-intro-brand img {
  width: auto !important;
  height: auto !important;
  object-fit: contain;
  object-position: left center;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.auth-brand img, .front-auth-brand img, .auth-brand .brand-logo {
  width: 230px !important;
  max-width: min(100%, 230px);
  max-height: 75px !important;
}
.mobile-intro-brand img {
  width: 205px !important;
  max-width: min(100%, 205px);
  max-height: 67px !important;
}

@media (min-width: 901px) and (max-height: 720px) {
  .auth-copy { margin-top: 22px; }
  .auth-copy h1 { font-size: clamp(2.35rem, 4.1vw, 4.15rem); }
  .auth-feature-grid { margin-top: 17px; gap: 7px; }
  .auth-feature-grid article { padding: 8px 10px; }
  .auth-feature-grid p { margin-top: 2px; font-size: .82rem; line-height: 1.3; }
  .auth-card { padding: 25px 30px; }
  .auth-tabs { margin: 20px 0 18px; }
  .auth-form { gap: 12px; }
}

@media (max-width: 900px) {
  body.auth-active { padding-bottom: 0; }
  .auth-view {
    background:
      radial-gradient(circle at 84% 8%, rgba(81, 208, 184, .23), transparent 27%),
      radial-gradient(circle at 8% 92%, rgba(46, 142, 126, .2), transparent 31%),
      linear-gradient(150deg, #0b2724 0%, #0c3c37 57%, #0a574f 100%);
  }
  .mobile-auth-intro {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100dvh;
    padding: max(24px, env(safe-area-inset-top)) 22px max(22px, env(safe-area-inset-bottom));
    color: #fff;
    overflow: hidden;
  }
  .mobile-auth-intro::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: .14;
    background-image: linear-gradient(rgba(255,255,255,.1) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.1) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom right, #000, transparent 80%);
  }
  .mobile-intro-top { min-height: 0; }
  .mobile-intro-brand { display: flex; align-items: center; gap: 11px; font-weight: 800; letter-spacing: -.02em; }
  .mobile-intro-kicker { display: block; margin-top: clamp(34px, 9vh, 72px); color: #86d7c8; font-size: .82rem; font-weight: 850; letter-spacing: .15em; }
  .mobile-auth-intro h1 { margin: 13px 0 14px; font-size: clamp(2.65rem, 11.5vw, 4.6rem); line-height: .98; letter-spacing: -.06em; }
  .mobile-auth-intro p { max-width: 560px; margin: 0; color: #c5dad6; font-size: clamp(.96rem, 3.7vw, 1.05rem); line-height: 1.55; }
  .mobile-intro-features { display: grid; gap: 9px; margin: 18px 0; }
  .mobile-intro-features > div { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 13px; background: rgba(255,255,255,.055); backdrop-filter: blur(10px); }
  .mobile-intro-features b { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 9px; color: #86d7c8; background: rgba(134,215,200,.12); }
  .mobile-intro-features span, .mobile-intro-features strong, .mobile-intro-features small { display: block; }
  .mobile-intro-features strong { font-size: .88rem; }
  .mobile-intro-features small { margin-top: 2px; color: #a9c3be; font-size: .82rem; line-height: 1.35; }
  .mobile-intro-action { flex: none; min-height: 52px; border-radius: 13px; font-size: .88rem; }
  .mobile-intro-action span { margin-left: auto; font-size: 1.15rem; }
  .auth-shell { display: none; grid-template-columns: 1fr; }
  .auth-view.mobile-auth-open .mobile-auth-intro { display: none; }
  .auth-view.mobile-auth-open .auth-shell { display: block; }
  .auth-hero { display: none; }
  .auth-panel-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100dvh;
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
    background: var(--surface-soft);
  }
  .auth-card {
    position: relative;
    width: min(100%, 520px);
    max-height: calc(100dvh - 24px);
    padding: 18px 20px 16px;
    border-radius: 20px;
    overflow: auto;
  }
  .mobile-auth-back { display: inline-flex; align-items: center; gap: 7px; margin: -3px 0 10px; padding: 4px 1px; color: var(--primary); background: transparent; font-size: .82rem; font-weight: 750; }
  .auth-card-head h2 { margin-top: 5px; font-size: 1.55rem; }
  .auth-card-head p { font-size: .88rem; }
  .secure-mark { width: 38px; height: 38px; border-radius: 11px; }
  .auth-tabs { margin: 15px 0 14px; }
  .auth-tab { padding: 9px; }
  .auth-form { gap: 10px; }
  .auth-form label > span { margin-bottom: 4px; font-size: .82rem; }
  .auth-form input { padding: 9px 10px; }
  .auth-form .check-row { font-size: .82rem; }
  .auth-aux-row { align-items: flex-start; }
  .auth-link { margin-top: 0; }
  .auth-form .large { min-height: 43px; }
  .auth-form .field-help { margin-top: -5px; font-size: .76rem; line-height: 1.3; }
  .register-password-warning { padding: 7px 8px; gap: 7px; font-size: .72rem; line-height: 1.32; }
  .register-password-warning > span { width: 17px; height: 17px; flex-basis: 17px; font-size: .7rem; }
  .username-availability { margin-top: -6px; padding: 7px 8px; font-size: .76rem; }
  .login-username-status { margin-top: -6px; font-size: .72rem; }
  #authStatus { min-height:0; margin:7px 0 0; padding:10px 12px; font-size:.82rem; }
  .auth-brand img, .front-auth-brand img, .auth-brand .brand-logo { width: 210px !important; max-width: min(100%, 210px); max-height: 69px !important; }
  .mobile-intro-brand img { width: 195px !important; max-width: min(100%, 195px); max-height: 64px !important; }
}

@media (max-width: 900px) and (max-height: 650px) {
  .mobile-intro-kicker { margin-top: 20px; }
  .mobile-auth-intro h1 { font-size: clamp(2.2rem, 9.5vw, 3.5rem); }
  .mobile-auth-intro p { font-size: .88rem; line-height: 1.4; }
  .mobile-intro-features { gap: 6px; margin: 10px 0; }
  .mobile-intro-features > div { padding: 7px 10px; }
  .mobile-intro-features small { display: none; }
  .auth-card { padding-top: 12px; padding-bottom: 11px; }
  .mobile-auth-back { margin-bottom: 5px; }
  .auth-tabs { margin: 10px 0; }
  .auth-form { gap: 7px; }
  .auth-form input { padding: 7px 9px; }
}

@media (max-width: 520px) {
  .auth-brand img, .front-auth-brand img, .auth-brand .brand-logo { width: 195px !important; max-width: min(100%, 195px); max-height: 64px !important; }
  .mobile-intro-brand img { width: 185px !important; max-width: min(100%, 185px); max-height: 61px !important; }
}

/* Normal Tizori v56/v57 auth viewport/scroll refinements. */
body.auth-active,
.auth-view,
.auth-shell,
.auth-panel-wrap {
  overflow: hidden;
}
.auth-card {
  max-height: calc(100dvh - 40px);
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}
@media (max-width: 900px) {
  #registerForm .username-availability { gap: 5px; margin-top: -6px; padding: 7px 8px; font-size: .76rem; }
  #registerForm .username-suggestion { min-height: 26px; padding: 4px 8px; font-size: .76rem; }
  .auth-card { max-height: calc(100dvh - max(24px, env(safe-area-inset-top) + env(safe-area-inset-bottom) + 16px)); }
  .mobile-auth-intro {
    justify-content: flex-start;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
  }
  .mobile-intro-top, .mobile-intro-features { flex: none; }
  .mobile-intro-features small { display: block; overflow: visible; text-overflow: clip; white-space: normal; }
  .mobile-intro-action {
    position: sticky;
    z-index: 2;
    bottom: max(0px, env(safe-area-inset-bottom));
    margin-top: auto;
    box-shadow: 0 -14px 28px rgba(7, 31, 27, .28), 0 10px 24px rgba(0, 0, 0, .2);
  }
}
@media (min-width: 901px) {
  .auth-hero {
    height: 100dvh;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
  }
  .auth-copy, .auth-feature-grid { flex: none; }
  .auth-feature-grid { padding-bottom: clamp(26px, 4vh, 48px); }
  .auth-feature-grid p { display: block; overflow: visible; -webkit-line-clamp: unset; -webkit-box-orient: initial; }
}
@media (min-width: 901px) and (max-height: 860px) {
  .auth-hero { padding-top: 24px; padding-bottom: 24px; }
  .auth-copy { margin-top: 22px; }
  .auth-copy h1 { margin: 10px 0 12px; font-size: clamp(2.25rem, 4vw, 3.85rem); line-height: 1; }
  .auth-copy > p { font-size: clamp(.88rem, 1vw, .98rem); line-height: 1.48; }
  .auth-feature-grid { margin-top: 17px; gap: 8px; }
  .auth-feature-grid article { padding: 9px 11px; gap: 10px; }
  .auth-feature-grid strong { font-size: .88rem; }
  .auth-feature-grid p { margin-top: 3px; font-size: .82rem; line-height: 1.35; }
}
@media (max-width: 900px) and (max-height: 820px) {
  .mobile-intro-kicker { margin-top: 20px; }
  .mobile-auth-intro h1 { font-size: clamp(2rem, 8.7vw, 3.25rem); line-height: 1; }
  .mobile-auth-intro p { font-size: .88rem; line-height: 1.42; }
  .mobile-intro-features { gap: 7px; margin: 13px 0; }
  .mobile-intro-features > div { padding: 8px 10px; }
}
@media (max-width: 900px) and (max-height: 650px) {
  .mobile-intro-features small { display: block; }
}

/* Getting started */
.onboarding-hero { display:flex; justify-content:space-between; align-items:flex-end; gap:28px; margin-bottom:16px; padding:24px 26px; border:1px solid var(--line); border-radius:var(--radius-lg); background:linear-gradient(145deg,var(--surface),var(--primary-soft)); box-shadow:var(--shadow-sm); }
.onboarding-hero h2 { margin:7px 0 7px; font-size:clamp(1.55rem,2.4vw,2.25rem); }
.onboarding-hero p { max-width:760px; margin:0; color:var(--text-soft); line-height:1.55; }
.onboarding-progress { flex:none; min-width:190px; padding:12px 14px; border:1px solid var(--teal-line); border-radius:12px; background:var(--surface); }
.onboarding-progress strong,.onboarding-progress span { display:block; }
.onboarding-progress strong { color:var(--primary); font-size:.88rem; }
.onboarding-progress span { margin-top:2px; color:var(--text-muted); font-size:.7rem; }
.onboarding-progress i { display:block; height:5px; margin-top:10px; border-radius:999px; background:var(--surface-muted); overflow:hidden; }
.onboarding-progress b { display:block; width:33.33%; height:100%; border-radius:inherit; background:var(--primary); }
.onboarding-layout { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(280px,.6fr); gap:16px; align-items:start; }
.onboarding-primary { overflow:hidden; }
.onboarding-form input:disabled,.onboarding-form textarea:disabled { color:var(--text); background:var(--surface-muted); cursor:not-allowed; -webkit-text-fill-color:var(--text); }
.onboarding-actions { justify-content:space-between; align-items:center; }
.onboarding-side { display:grid; gap:10px; }
.onboarding-step { display:grid; grid-template-columns:38px 1fr; gap:12px; align-items:start; padding:15px; }
.onboarding-step > span { display:grid; place-items:center; width:34px; height:34px; border-radius:10px; color:var(--text-muted); background:var(--surface-muted); font-size:.78rem; font-weight:850; }
.onboarding-step.active > span { color:#fff; background:var(--primary); box-shadow:0 7px 18px color-mix(in srgb,var(--primary) 22%,transparent); }
.onboarding-step strong { font-size:.84rem; }
.onboarding-step p { margin:4px 0 0; color:var(--text-muted); font-size:.74rem; line-height:1.45; }
.onboarding-skip-note { padding:14px 15px; border:1px dashed var(--line-strong); border-radius:12px; background:var(--surface-soft); }
.onboarding-skip-note strong { font-size:.8rem; }
.onboarding-skip-note p { margin:5px 0 6px; color:var(--text-muted); font-size:.73rem; line-height:1.45; }

/* Dashboard time-series */
.dashboard-chart-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin-bottom:16px; }
.chart-panel { min-width:0; overflow:hidden; }
.trend-host { min-height:260px; padding:0 14px 14px; }
.trend-legend { display:flex; flex-wrap:wrap; gap:14px; padding:0 8px 6px; color:var(--text-soft); font-size:.72rem; font-weight:700; }
.trend-legend span { display:inline-flex; align-items:center; gap:6px; }
.trend-legend i { width:18px; height:3px; border-radius:999px; }
.trend-legend .series-1 { background:var(--primary); }
.trend-legend .series-2 { background:var(--credit); }
.trend-svg-wrap { width:100%; overflow:hidden; }
.trend-chart { width:100%; min-width:420px; height:auto; }
.trend-grid { stroke:var(--line); stroke-width:1; }
.trend-y-label,.trend-x-label { fill:var(--text-muted); font-size:10px; font-family:inherit; }
.trend-line { fill:none; stroke-width:2.5; stroke-linecap:round; stroke-linejoin:round; vector-effect:non-scaling-stroke; }
.trend-line.series-1,.trend-dot.series-1 { stroke:var(--primary); fill:var(--surface); }
.trend-line.series-2,.trend-dot.series-2 { stroke:var(--credit); fill:var(--surface); }
.chart-empty { min-height:220px; display:grid; place-items:center; align-content:center; text-align:center; color:var(--text-muted); }
.chart-empty span { display:grid; place-items:center; width:42px; height:42px; margin-bottom:8px; border-radius:12px; color:var(--primary); background:var(--primary-soft); }
.chart-empty strong { color:var(--text); font-size:.82rem; }
.chart-empty p { max-width:330px; margin:4px 0 0; font-size:.72rem; line-height:1.45; }

@media (max-width: 980px) {
  .onboarding-layout { grid-template-columns:1fr; }
  .onboarding-side { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .onboarding-skip-note { grid-column:1/-1; }
  .dashboard-chart-grid { grid-template-columns:1fr; }
}
@media (max-width: 760px) {
  .onboarding-hero { display:block; padding:19px 17px; }
  .onboarding-progress { margin-top:16px; }
  .onboarding-side { grid-template-columns:1fr; }
  .onboarding-actions { align-items:stretch; flex-direction:column-reverse; }
  .onboarding-actions button { width:100%; }
  .trend-host { overflow-x:auto; padding-left:8px; padding-right:8px; }
}
.settings-account-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; padding:0 20px 20px; }
.settings-account-grid > div { min-width:0; padding:11px 12px; border:1px solid var(--line); border-radius:10px; background:var(--surface-soft); }
.settings-account-grid small,.settings-account-grid strong,.settings-account-grid code { display:block; }
.settings-account-grid strong,.settings-account-grid code { margin-top:4px; color:var(--text); font-size:.78rem; overflow-wrap:anywhere; }
@media (max-width:760px){.settings-account-grid{grid-template-columns:1fr;padding:0 15px 15px}}

/* Combined sidebar coins and subscription card. */
.sidebar-coins { width: 100%; display: grid; grid-template-columns:34px minmax(0,1fr) auto; align-items:center; gap:9px 10px; margin-top:12px; padding:11px; border:1px solid rgba(245,194,66,.22); border-radius:13px; color:#e7f0ee; background:rgba(245,194,66,.07); text-align:left; text-decoration:none; cursor:pointer; }
.sidebar-coins:hover,.sidebar-coins.active { border-color:rgba(245,194,66,.42); background:rgba(245,194,66,.13); }
.coin-mark,.coin-large-mark,.coin-button-mark { display:inline-grid; place-items:center; border-radius:999px; color:#5b4300; background:linear-gradient(145deg,#ffe889,#eab93d); box-shadow:inset 0 0 0 2px rgba(255,255,255,.32),0 5px 15px rgba(235,180,48,.18); font-weight:900; }
.coin-mark { width:34px; height:34px; font-size:.82rem; }
.sidebar-coins-copy { min-width:0; }
.sidebar-coins-copy small,.sidebar-coins-copy strong { display:block; }
.sidebar-coins-copy small { color:#9bb3ae; font-size:.76rem; font-weight:700; }
.sidebar-coins-copy strong { margin-top:2px; overflow:hidden; color:#fff4c6; font-size:.88rem; text-overflow:ellipsis; white-space:nowrap; }
.sidebar-coins-copy b { font-size:.96rem; }
.sidebar-coins-copy .sidebar-trial-title { margin-top:3px; color:#ffe995; font-size:.66rem; font-weight:800; }
.sidebar-coins-arrow { color:#d8b955; font-size:1.15rem; }
.coins-page { width:min(1180px,100%); margin:0 auto; }
.coins-page-intro { display:flex; justify-content:space-between; align-items:flex-end; gap:24px; margin-bottom:18px; }
.coins-page-intro h2 { max-width:720px; margin:7px 0 7px; font-size:clamp(1.3rem,2.2vw,1.72rem); letter-spacing:-.035em; line-height:1.14; }
.coins-page-intro p { max-width:760px; margin:0; color:var(--text-soft); font-size:.83rem; line-height:1.58; }
.coin-status-pill { display:inline-flex; align-items:center; justify-content:center; min-width:86px; min-height:30px; padding:6px 11px; border:1px solid var(--line); border-radius:999px; color:var(--text-soft); background:var(--surface); text-align:center; font-size:.66rem; font-weight:850; letter-spacing:.075em; text-transform:uppercase; white-space:nowrap; }
.coin-status-pill.active { border-color:color-mix(in srgb,var(--accepted) 30%,var(--line)); color:var(--accepted); background:var(--accepted-soft); }
.coin-status-pill.inactive,.coin-status-pill.trial { border-color:color-mix(in srgb,var(--pending) 34%,var(--line)); color:var(--pending); background:var(--pending-soft); }
.coin-status-pill.suspended { border-color:color-mix(in srgb,var(--danger) 30%,var(--line)); color:var(--danger); background:var(--danger-soft); }
.coin-trial-banner,.coin-deletion-warning { display:flex;align-items:flex-start;gap:12px;margin-bottom:16px; }
.coin-trial-banner>span,.coin-deletion-warning>span { display:grid;place-items:center;width:30px;height:30px;flex:none;border-radius:999px;color:var(--feedback-text);background:color-mix(in srgb,var(--feedback-text) 14%,var(--surface));font-size:.86rem;font-weight:900; }
.coin-trial-banner strong,.coin-deletion-warning strong { display:block;color:inherit;font-size:.88rem; }
.coin-trial-banner p,.coin-deletion-warning p { margin:3px 0 0;color:inherit;font-size:.8rem;line-height:1.5; }

/* Coins & subscription overview. One coherent card replaces the old pair of
   uneven summary cards, keeping plan and balance visually connected. */
.coins-overview-panel { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(330px,.85fr); overflow:hidden; }
.coins-overview-plan { min-width:0; padding:clamp(20px,2.6vw,30px); border-right:1px solid var(--line); background:radial-gradient(circle at 92% 6%,color-mix(in srgb,var(--primary) 11%,transparent),transparent 34%),var(--surface); }
.coins-overview-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.coins-plan-title-row { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; margin-top:19px; }
.coin-plan-name { margin:0; font-size:clamp(1.75rem,3vw,2.45rem); font-weight:900; letter-spacing:-.05em; line-height:1.02; }
.coin-card-note { max-width:640px; margin:9px 0 0; padding:0; border:0; border-radius:0; color:var(--text-soft); background:transparent; font-size:.8rem; line-height:1.55; }
.coins-rate-strip { display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:10px; margin-top:24px; padding:11px 13px; border:1px solid var(--line); border-radius:11px; background:var(--surface-soft); }
.coins-rate-strip span { color:var(--text-soft); font-size:.75rem; font-weight:700; }
.coins-rate-strip strong { color:var(--primary-dark); font-size:.9rem; }
.coins-rate-strip small { color:var(--text-muted); font-size:.68rem; }
.coins-overview-balance { min-width:0; padding:clamp(20px,2.6vw,30px); background:var(--surface-soft); }
.coin-card-kicker { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.coins-overview-balance .coin-balance-visual { display:flex; align-items:center; justify-content:space-between; gap:18px; margin:16px 0 19px; }
.coins-overview-balance .coin-balance-visual strong { display:block; font-size:clamp(2.65rem,5vw,3.75rem); font-weight:900; line-height:.95; letter-spacing:-.065em; font-variant-numeric:tabular-nums; }
.coins-overview-balance .coin-balance-visual small { display:block; max-width:310px; margin-top:8px; color:var(--text-soft); font-size:.76rem; line-height:1.45; }
.coin-large-mark { display:grid; place-items:center; width:62px; height:62px; flex:none; border-radius:999px; font-size:1.12rem; }
.coin-detail-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; margin:0; }
.coin-detail-list>div { min-width:0; padding:11px 12px; border:1px solid var(--line); border-radius:10px; background:var(--surface); }
.coin-detail-list dt { color:var(--text-muted); font-size:.68rem; font-weight:750; text-transform:uppercase; letter-spacing:.045em; }
.coin-detail-list dd { margin:5px 0 0; overflow:hidden; color:var(--text); font-size:.82rem; font-weight:850; text-overflow:ellipsis; white-space:nowrap; }

/* Buy/redeem actions. Both cards share one layout so their headings, buttons and
   status messages line up instead of looking like unrelated forms. */
.coins-action-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin-top:16px; align-items:start; }
.coin-purchase-panel,.coin-voucher-panel { display:grid; grid-template-columns:42px minmax(0,1fr); gap:0 13px; align-content:start; min-width:0; padding:20px; }
.coin-action-icon { grid-row:1; display:grid; place-items:center; width:42px; height:42px; border:1px solid var(--line); border-radius:12px; color:var(--primary-dark); background:var(--primary-soft); font-size:1.05rem; font-weight:900; }
.coin-action-icon-buy { font-size:1.35rem; }
.coin-action-copy { grid-column:2; min-width:0; }
.coin-action-copy h3 { margin:4px 0 5px; font-size:1rem; }
.coin-card-note { max-width:640px;margin:9px 0 0;padding:0;border:0;border-radius:0;color:var(--text-soft);background:transparent;font-size:.8rem;line-height:1.55; }
.coin-buy-button { grid-column:1/-1; width:100%; margin-top:18px; }
.coin-button-mark { width:22px; height:22px; margin-right:4px; font-size:.76rem; vertical-align:middle; }
.coin-purchase-panel>.inline-status { grid-column:1/-1; }
.coin-voucher-form { grid-column:1/-1; display:grid; gap:7px; margin-top:18px; }
.coin-voucher-form>label { color:var(--text-soft); font-size:.72rem; font-weight:750; }
.coin-voucher-input-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; }
.coin-voucher-input-row input { min-width:0; }
.coin-voucher-input-row .primary { min-width:108px; }
.coin-voucher-form .inline-status { margin:0; }

/* Native <details> gives keyboard/assistive-technology expansion semantics with
   no extra JS state. History values are rendered as text nodes in coins.js. */
.voucher-history { grid-column:1/-1; overflow:hidden; margin-top:14px; border-top:1px solid var(--line); }
.voucher-history summary { position:relative; display:grid; grid-template-columns:minmax(0,1fr) auto 16px; align-items:center; gap:12px; min-height:58px; padding:12px 2px 0; color:var(--text); cursor:pointer; list-style:none; }
.voucher-history summary::-webkit-details-marker { display:none; }
.voucher-history summary::after { content:'›'; display:block; color:var(--text-muted); font-size:1.15rem; font-weight:850; transform:rotate(90deg); transition:transform .16s ease; }
.voucher-history[open] summary::after { transform:rotate(-90deg); }
.voucher-history-summary-copy { min-width:0; }
.voucher-history-summary-copy strong,.voucher-history-summary-copy small { display:block; }
.voucher-history-summary-copy strong { font-size:.78rem; }
.voucher-history-summary-copy small { margin-top:3px; color:var(--text-muted); font-size:.68rem; }
.voucher-history-count { padding:4px 8px; border-radius:999px; color:var(--text-soft); background:var(--surface-muted); font-size:.65rem; font-weight:750; white-space:nowrap; }
.voucher-history-body { margin-top:9px; padding-top:2px; border-top:1px solid var(--line); }
.voucher-history-list { display:grid; }
.voucher-history-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:14px; padding:11px 2px; border-bottom:1px solid var(--line); }
.voucher-history-row:last-child { border-bottom:0; }
.voucher-history-detail { min-width:0; }
.voucher-history-detail strong,.voucher-history-detail small { display:block; }
.voucher-history-detail strong { overflow:hidden; color:var(--text); font-family:ui-monospace,SFMono-Regular,Consolas,monospace; font-size:.75rem; text-overflow:ellipsis; white-space:nowrap; }
.voucher-history-detail small { margin-top:4px; color:var(--text-muted); font-size:.67rem; }
.voucher-history-points { color:var(--accepted); font-size:.75rem; font-weight:850; white-space:nowrap; }
.voucher-history-empty { margin:0; padding:14px 2px 4px; color:var(--text-muted); font-size:.74rem; line-height:1.5; }
.voucher-history-empty.error { color:var(--danger); }

/* Subscription chooser gets deliberate inset/footer spacing on /coins instead
   of letting the cards touch the panel edge. */
.coins-tier-panel { margin-top:16px; overflow:hidden; }
.coins-tier-head { align-items:center; padding-bottom:18px; border-bottom:1px solid var(--line); }
.coins-tier-head>div:first-child { max-width:760px; }
.coins-plan-rule { display:flex; align-items:center; gap:8px; padding:8px 10px; border:1px solid var(--line); border-radius:10px; background:var(--surface-soft); }
.coins-plan-rule strong { color:var(--primary-dark); font-size:1.45rem; line-height:1; }
.coins-plan-rule span { color:var(--text-muted); font-size:.64rem; font-weight:750; line-height:1.2; text-transform:uppercase; letter-spacing:.04em; }
.coins-tier-panel .tier-chooser-host { padding:20px; }
.coins-tier-panel .tier-chooser-host .tier-chooser { grid-template-columns:repeat(3,minmax(0,1fr)); margin:0; }
.coins-tier-actions { margin:0; padding:16px 20px; border-top:1px solid var(--line); background:var(--surface-soft); }
.coins-tier-actions .primary { min-width:180px; }

.app-view.coins-read-only .sidebar-coins { border-color:rgba(245,194,66,.58); background:rgba(245,194,66,.16); }
.app-view.coins-read-only .quick-add-button:disabled { opacity:.48; filter:grayscale(.18); cursor:not-allowed; }
@media (max-width:980px) {
  .coins-overview-panel { grid-template-columns:1fr; }
  .coins-overview-plan { border-right:0; border-bottom:1px solid var(--line); }
  .coins-tier-panel .tier-chooser-host .tier-chooser { grid-template-columns:1fr; }
}
@media (max-width:820px) { .coins-action-grid { grid-template-columns:1fr; } }
@media (max-width:540px) {
  .coins-page-intro { margin-bottom:14px; }
  .coins-overview-plan,.coins-overview-balance { padding:18px 16px; }
  .coins-plan-title-row { flex-direction:column; gap:10px; margin-top:15px; }
  .coins-rate-strip { grid-template-columns:1fr auto; }
  .coins-rate-strip small { grid-column:1/-1; }
  .coins-overview-balance .coin-balance-visual strong { font-size:2.65rem; }
  .coin-large-mark { width:54px; height:54px; }
  .coin-detail-list { grid-template-columns:1fr; }
  .coin-purchase-panel,.coin-voucher-panel { padding:17px 15px; }
  .coin-voucher-input-row { grid-template-columns:1fr; }
  .coin-voucher-input-row .primary { width:100%; }
  .voucher-history summary { grid-template-columns:minmax(0,1fr) 16px; }
  .voucher-history-count { grid-column:1/-1; grid-row:2; justify-self:start; }
  .voucher-history-row { grid-template-columns:1fr; gap:6px; }
  .coins-tier-panel .tier-chooser-host { padding:15px; }
  .coins-tier-actions { padding:14px 15px; }
}
@media (prefers-reduced-motion:reduce) { .voucher-history summary::after { transition:none; } }

/* Settings account/session layout. */
.settings-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr)); gap:16px; max-width:1280px; margin-inline:auto; align-items:stretch; }
.settings-grid > .panel { min-width:0; }
.settings-account-panel { width:100%; }
.settings-grid .panel-head { padding:20px 20px 16px; }
.settings-panel-body { padding:0 20px 20px; }
.books-settings-form { display:grid; gap:18px; }
.books-setting-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px; align-items:start; }
.books-setting-row > label { min-width:0; }
.books-setting-action { padding-top:24px; }
.books-setting-action button { min-height:42px; white-space:nowrap; }
.books-settings-form p { margin:0; padding:0; border:0; border-radius:0; background:transparent; font-size:.78rem; line-height:1.6; }
.books-settings-form p:not(.inline-status):not(.feedback-card) { color:var(--text-soft); }
.books-settings-form p.inline-status { margin-top:0;padding:12px 14px;border:1px solid var(--feedback-line);border-left:4px solid var(--feedback-text);border-radius:10px;color:var(--feedback-text);background:var(--feedback-bg); }
.books-settings-form .inline-status:empty { display:none; }
.settings-account-list { display:grid; gap:0; margin:0; padding:0 20px 16px; }
.settings-account-list>div { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.25fr); gap:14px; padding:12px 0; border-top:1px solid var(--line); }
.settings-account-list dt { color:var(--text-soft); font-size:.8rem; }
.settings-account-list dd { min-width:0; margin:0; font-size:.8rem; font-weight:800; text-align:right; overflow-wrap:anywhere; }
.settings-account-actions { display:grid; gap:8px; padding:0 20px 20px; }
.progrid-card { display:grid; grid-template-columns:minmax(0,1fr) auto; align-content:center; align-items:center; gap:16px; padding:20px; }
/* The official light-theme logo carries dark artwork and the dark-theme logo
   carries a white wordmark, so the plate behind it must follow the colour scheme.
   A fixed white plate made the dark-theme logo white-on-white. */
.progrid-card-logo { grid-column:1/-1; display:grid; place-items:center; min-height:76px; padding:14px; border:1px solid var(--line); border-radius:12px; background:var(--surface-soft); }
.progrid-card-logo picture,.progrid-card-logo img { display:block; width:100%; }
.progrid-card-logo img { max-width:230px; height:auto; margin:auto; object-fit:contain; }
.progrid-card-copy { min-width:0; }
.progrid-card-copy h3 { margin:5px 0; font-size:1.08rem; }
.progrid-card-copy p { margin:0; color:var(--text-soft); font-size:.82rem; line-height:1.55; }
.progrid-coming-soon { justify-self:end; padding:7px 11px; border:1px solid var(--teal-line); border-radius:999px; color:var(--primary-dark); background:var(--primary-soft); font-size:.68rem; font-weight:850; white-space:nowrap; }
.data-policy-copy { padding:0 20px 20px; }
.data-policy-copy p { margin:0; color:var(--text-soft); font-size:.82rem; line-height:1.65; }
.data-policy-copy p + p { margin-top:10px; }
.data-policy-copy strong { color:var(--text); }
@media (max-width:760px) { .settings-grid .full { grid-column:1/-1; } .settings-grid .panel-head { padding:16px 16px 14px; } .settings-panel-body,.settings-account-list { padding:0 16px 16px; } .settings-account-actions { padding:0 16px 16px; } .progrid-card { gap:14px; padding:16px; } .progrid-card-logo { min-height:68px; } .progrid-card-logo img { max-width:200px; } .progrid-card-copy h3 { font-size:.98rem; } .progrid-coming-soon { align-self:start; } .data-policy-copy { padding:0 16px 16px; } }
@media (max-width:480px) { .books-setting-row { grid-template-columns:minmax(0,1fr); gap:8px; } .books-setting-action { padding-top:0; justify-self:end; } .progrid-card { grid-template-columns:minmax(0,1fr); } .progrid-coming-soon { justify-self:start; } }
.password-form { display:grid; gap:13px; }
.password-form label { display:grid; gap:6px; }
.password-form label>span { font-size:.76rem; font-weight:800; }
.password-form .field-note { color:var(--text-muted); font-size:.7rem; line-height:1.45; }

/* Determinate Tally file/import progress. Keep this local to the Tally page. */
.tally-progress {
  margin: 0 20px 14px;
  padding: 11px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}
.tally-progress-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 9px; }
.tally-progress-head strong, .tally-progress-head small { display: block; }
.tally-progress-head strong { color: var(--text); font-size: .78rem; }
.tally-progress-head small { margin-top: 3px; color: var(--text-soft); font-size: .69rem; line-height: 1.4; }
.tally-progress-head > span { flex: none; color: var(--primary); font-size: .76rem; font-weight: 800; }
.tally-progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: var(--line); }
.tally-progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--primary); transition: width .16s linear; }
.tally-progress.is-error { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.tally-progress.is-error .tally-progress-head > span { color: var(--danger); }
.tally-progress.is-error .tally-progress-track i { background: var(--danger); }
@media (prefers-reduced-motion: reduce) { .tally-progress-track i { transition: none; } }

/* Tally unresolved import review */
.tally-unresolved-wrap { display:grid; gap:14px; padding:14px; }
.tally-result-clean { display:grid; gap:3px; padding:16px; border:1px solid var(--teal-line); border-radius:10px; background:var(--primary-soft); }
.tally-result-clean strong { color:var(--primary-dark); font-size:.78rem; }
.tally-result-clean small { color:var(--text-soft); font-size:.7rem; }
.import-fix-reason { margin:0 0 12px; }
.tally-issue-head { display:flex; justify-content:space-between; gap:14px; align-items:center; padding:11px 12px; border-bottom:1px solid var(--line); background:var(--surface-soft); }
.tally-issue-head strong, .tally-issue-head small { display:block; }
.tally-issue-head strong { font-size:.78rem; }
.tally-issue-head small { margin-top:3px; color:var(--text-soft); font-size:.68rem; line-height:1.4; }
.tally-issue-head .secondary { flex:none; min-height:32px; padding:5px 9px; font-size:.7rem; }
.tally-issue-tools { display:flex; flex:none; gap:8px; }
.tally-issue-tools .danger { min-height:32px; padding:5px 9px; font-size:.7rem; }
/* Resolved history is informational, not a problem list. */
.tally-issue-section.history { border-color:color-mix(in srgb, var(--accepted) 26%, var(--line)); }
.tally-issue-section.history .tally-issue-state span { color:var(--accepted); background:color-mix(in srgb, var(--accepted) 10%, transparent); }
.tally-issue-footnote { display:block; padding:9px 12px; border-top:1px solid var(--line); color:var(--text-muted); font-size:.68rem; }
.tally-storage-note { margin-top:14px; }
.tally-storage-note strong { display:block; font-size:.76rem; }
.tally-storage-note small { display:block; margin-top:3px; color:inherit; font-size:.7rem; line-height:1.5; }
.tally-issue-list { max-height:360px; overflow:auto; }
.tally-issue-row { display:grid; grid-template-columns:84px minmax(0,1fr) auto; gap:11px; align-items:center; padding:10px 11px; border-bottom:1px solid var(--line); }
.tally-issue-row:last-child { border-bottom:0; }
.tally-issue-row:hover { background:var(--surface-soft); }
.tally-issue-state { display:grid; gap:3px; }
.tally-issue-state span { width:max-content; padding:3px 7px; border-radius:999px; background:var(--surface-soft); color:var(--text-soft); font-size:.62rem; font-weight:800; text-transform:uppercase; letter-spacing:.04em; }
.tally-issue-section.failed .tally-issue-state span { color:var(--danger); background:color-mix(in srgb, var(--danger) 10%, transparent); }
.tally-issue-section.skipped .tally-issue-state span { color:var(--pending); background:color-mix(in srgb, var(--pending) 11%, transparent); }
.tally-issue-state small { color:var(--text-muted); font-size:.63rem; text-transform:capitalize; }
.tally-issue-copy { min-width:0; }
.tally-issue-copy strong, .tally-issue-copy p, .tally-issue-copy small { display:block; }
.tally-issue-copy strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.76rem; }
.tally-issue-copy p { margin:3px 0 2px;color:inherit;font-size:.69rem;line-height:1.4; }
.tally-issue-copy small { color:inherit;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.6rem; }
.tally-issue-row > .secondary { min-height:31px; padding:5px 9px; font-size:.69rem; white-space:nowrap; }
.tally-show-more { width:100%; padding:9px; border-top:1px solid var(--line); text-align:center; }
.import-fix-reason { margin:0 0 12px; }
.import-fix-reason strong, .import-fix-reason p, .import-fix-reason small { display:block; }
.import-fix-reason strong { font-size:.76rem; }
.import-fix-reason p { margin:4px 0;color:inherit;font-size:.72rem;line-height:1.45; }
.import-fix-reason small { color:inherit;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.61rem; }
.tally-fix-form textarea[name="mappedJson"] { min-height:190px; font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:.68rem; line-height:1.45; }
.tally-fix-form label > small { display:block; margin-top:4px; color:var(--text-muted); font-size:.65rem; line-height:1.4; }
.tally-original-preview { overflow:hidden; border:1px solid var(--line); border-radius:10px; background:var(--surface-soft); }
.tally-original-preview summary { padding:10px 11px; cursor:pointer; color:var(--text-soft); font-size:.72rem; font-weight:750; }
.tally-original-preview pre { max-height:260px; margin:0; padding:11px; overflow:auto; border-top:1px solid var(--line); color:var(--text-soft); font-size:.65rem; line-height:1.45; white-space:pre-wrap; overflow-wrap:anywhere; }
@media (max-width:760px) {
  .tally-issue-head { align-items:stretch; flex-direction:column; }
  .tally-issue-head .secondary { width:100%; }
  .tally-issue-row { grid-template-columns:1fr; gap:7px; }
  .tally-issue-row > .secondary { width:100%; }
}

/* v200 standalone Getting Started surface. This must never inherit the signed-in shell. */
body.onboarding-active { min-height: 100dvh; padding: 0 !important; background: var(--surface-soft); }
.onboarding-view { min-height: 100dvh; background:
  radial-gradient(circle at 88% 0%, color-mix(in srgb, var(--primary) 9%, transparent), transparent 30%),
  linear-gradient(180deg, var(--surface-soft), var(--bg)); }
.setup-page { min-height: 100dvh; }
.setup-header { position: sticky; z-index: 20; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 84px; padding: 16px clamp(22px, 4vw, 58px); border-bottom: 1px solid color-mix(in srgb, var(--line) 86%, transparent); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(16px); }
.setup-brand { display: flex; align-items: center; gap: 9px; color: var(--primary); text-decoration: none; font-size: .74rem; font-weight: 900; letter-spacing: .12em; }
.setup-brand img { width: 176px; height: auto; max-height: 56px; object-fit: contain; object-position: left center; }
.setup-brand span { margin-top: 2px; padding: 4px 7px; border: 1px solid var(--teal-line); border-radius: 999px; background: var(--primary-soft); }
.setup-account { display: flex; align-items: center; gap: 12px; color: var(--text-soft); font-size: .8rem; font-weight: 700; }
.setup-main { width: min(1040px, calc(100% - 36px)); margin: 0 auto; padding: clamp(32px, 5vw, 62px) 0 64px; }
.setup-intro { width: min(840px, 100%); margin: 0 auto 22px; text-align: center; }
.setup-intro .eyebrow { color: var(--primary); }
.setup-intro h1 { margin: 8px 0 10px; font-size: clamp(2rem, 5vw, 3.35rem); letter-spacing: -.055em; }
.setup-intro > p { max-width: 690px; margin: 0 auto; color: var(--text-soft); font-size: .98rem; line-height: 1.58; }
.setup-stepper { display: grid; grid-template-columns: auto 1fr auto 1fr auto 1fr auto 1fr auto 1fr auto; align-items: center; gap: 10px; margin: 30px auto 0; max-width: 980px; }
.setup-stepper > b { height: 1px; background: var(--line-strong); }
.setup-step { appearance: none; display: flex; align-items: center; gap: 9px; min-width: 0; padding: 0; border: 0; color: var(--text-muted); background: transparent; text-align: left; }
button.setup-step { cursor: pointer; }
.setup-step i { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--text-muted); background: var(--surface); font-size: .76rem; font-style: normal; font-weight: 900; }
.setup-step strong, .setup-step small { display: block; }
.setup-step strong { color: var(--text-soft); font-size: .78rem; }
.setup-step small { margin-top: 1px; color: var(--text-muted); font-size: .66rem; }
.setup-step.active i { border-color: var(--primary); color: #fff; background: var(--primary); box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 20%, transparent); }
.setup-step.active strong { color: var(--primary-dark); }
.setup-step.done i { border-color: color-mix(in srgb, var(--accepted) 38%, var(--line)); color: var(--accepted); background: var(--accepted-soft); }
.setup-step.muted { opacity: .72; }
.setup-card { width: min(820px, 100%); margin: 0 auto; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-md); animation: setup-card-in .28s cubic-bezier(.2,.8,.2,1) both; }
.setup-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; padding: 24px 26px 18px; border-bottom: 1px solid var(--line); }
.setup-card-head h2 { margin: 6px 0 6px; font-size: 1.48rem; letter-spacing: -.035em; }
.setup-card-head p { max-width: 620px; margin: 0; color: var(--text-soft); font-size: .84rem; line-height: 1.52; }
.setup-email-status { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 20px 26px 0; }
.setup-email-status > div { min-width: 0; padding: 12px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.setup-email-status small, .setup-email-status strong { display: block; }
.setup-email-status small { color: var(--text-muted); font-size: .68rem; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.setup-email-status strong { overflow: hidden; margin-top: 4px; text-overflow: ellipsis; white-space: nowrap; font-size: .86rem; }
.setup-form { display: grid; gap: 17px; padding: 22px 26px 26px; }
.verification-code-area { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; padding: 14px; border: 1px solid var(--teal-line); border-radius: 12px; background: var(--primary-soft); }
.verification-code-area input { font-size: 1.15rem; font-weight: 850; letter-spacing: .18em; }
.setup-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 3px; }
.setup-actions-right { display: flex; align-items: center; gap: 10px; }
.setup-card > .tier-chooser-host { padding:22px 26px; }
.setup-card > .tier-chooser-host .tier-chooser { margin:0; }
.setup-card > .setup-actions { margin:0; padding:18px 26px; border-top:1px solid var(--line); background:var(--surface-soft); }
.setup-profile-summary { padding: 20px 26px 0; }
.setup-card .onboarding-form { padding: 22px 26px 26px; }
.setup-skip-all { display: block; max-width:100%; margin:20px auto 0; padding:12px 16px; text-align:center; line-height:1.5; }
.secure-chip.success { color: var(--accepted); border-color: color-mix(in srgb, var(--accepted) 35%, var(--line)); background: var(--accepted-soft); }
@keyframes setup-card-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 760px) {
  body.onboarding-active { padding-bottom: 0 !important; }
  .setup-header { min-height: 72px; padding: 12px 14px; }
  .setup-brand img { width: 152px; max-height: 48px; }
  .setup-account > span { display: none; }
  .setup-main { width: min(100% - 24px, 760px); padding: 26px 0 44px; }
  .setup-intro { text-align: left; }
  .setup-intro h1 { font-size: 2.05rem; }
  .setup-intro > p { margin-left: 0; font-size: .88rem; }
  .setup-stepper { grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px 10px; margin-top:24px; }
  .setup-stepper > b { display: none; }
  .setup-step { display: grid; justify-items: center; gap: 5px; text-align: center; }
  .setup-step span { min-width: 0; }
  .setup-step small { display: none; }
  .setup-card { border-radius: 15px; }
  .setup-card-head { display: block; padding: 19px 17px 15px; }
  .setup-card-head .secure-chip { display: inline-flex; margin-top: 12px; }
  .setup-email-status { grid-template-columns: 1fr; margin: 16px 17px 0; }
  .setup-form, .setup-card .onboarding-form { padding: 18px 17px 20px; }
  .setup-card > .tier-chooser-host { padding:18px 17px; }
  .setup-card > .setup-actions { padding:16px 17px 20px; }
  .verification-code-area { grid-template-columns: 1fr; }
  .verification-code-area button { width: 100%; }
  .setup-actions { align-items: stretch; flex-direction: column-reverse; }
  .setup-actions > button, .setup-actions-right, .setup-actions-right button { width: 100%; }
  .setup-actions-right { align-items: stretch; flex-direction: column-reverse; }
  .setup-profile-summary { padding: 16px 17px 0; }
}
