/* Sana web account page. Uses the tokens from /style.css. */
.account-root { padding-block: 34px 56px; min-height: 60vh; }
.account-loading { color: var(--muted); padding-block: 40px; }
.account-root h1 { font-size: clamp(2.5rem, 5.4vw, 4.6rem); }
.account-root h1 em { color: var(--blue); font-weight: 460; }
.fine-print { margin-top: 16px; color: var(--muted); font-size: .84rem; max-width: 75ch; }
.form-status { margin-top: 12px; min-height: 1.4em; color: #8a3a10; font-weight: 650; font-size: .9rem; }
.form-status:empty { margin-top: 0; }

/* sign in */
.signin-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); grid-template-areas: "intro card" "anon card"; gap: 0 clamp(24px, 5vw, 72px); align-items: start; }
.signin-intro { grid-area: intro; }
.signin-card { grid-area: card; }
.signin-intro .page-lede { margin-top: 18px; }
.anon-box { grid-area: anon; margin-top: 28px; }
.anon-box h2 { font-size: 1.35rem; margin-bottom: 8px; }
.anon-box p { color: var(--ink); font-size: .95rem; }
.signin-card { display: grid; gap: 12px; padding: clamp(20px, 3vw, 32px); border: 1px solid var(--line); border-radius: 24px; background: var(--paper); box-shadow: 0 18px 40px #17234212; }
.provider-button { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; width: 100%; padding: 12px 18px; border-radius: 999px; font: 750 .97rem/1.2 var(--body); cursor: pointer; }
.provider-button.apple { background: #000; color: #fff; border: 1px solid #000; }
.provider-button.apple:hover { background: #222; }
.provider-button.google { background: #fff; color: #1f1f1f; border: 1px solid #747775; }
.provider-button.google:hover { background: #f4f6fb; }
.provider-icon { display: inline-flex; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .82rem; margin-block: 6px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.email-form { display: grid; gap: 6px; }
.email-form label, .danger-zone label { font-weight: 700; font-size: .88rem; margin-top: 6px; }
.email-form input, .danger-zone input { width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid #c9bcae; border-radius: 12px; background: #fff; color: var(--ink); font: 1rem var(--body); }
.email-form input:focus, .danger-zone input:focus { border-color: var(--blue); outline: 3px solid #234ed533; outline-offset: 0; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 12px; }
.link-button { border: 0; background: none; padding: 8px 0; color: var(--blue-deep); font: 700 .9rem var(--body); text-decoration: underline; text-underline-offset: .22em; cursor: pointer; min-height: 44px; }
.button { cursor: pointer; }
.button:disabled, .provider-button:disabled { opacity: .55; cursor: not-allowed; }
.quiet-button { background: transparent; border: 1px solid transparent; color: var(--blue-deep); }
.quiet-button:hover { text-decoration: underline; }
.outline-button { background: transparent; border: 1px solid #b7c3ef; color: var(--blue-deep); }
.outline-button:hover { background: #e9edfd; }
.danger-button { background: #b3261e; color: #fff; margin-top: 12px; }
.danger-button:hover:not(:disabled) { background: #8c1d18; }

.notice-panel { max-width: 720px; display: grid; gap: 16px; justify-items: start; }
.notice-panel ol { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; }

/* dashboard */
.dash-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 30px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.dash-head h1 { margin-top: 6px; font-size: clamp(2.2rem, 4.6vw, 3.8rem); }
.dash-meta { margin-top: 10px; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.dash-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dash-body { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: clamp(20px, 3.5vw, 48px); padding-top: 26px; }
.dash-nav { position: sticky; top: 16px; align-self: start; }
.account-tabs { display: grid; gap: 4px; }
.account-tabs button { text-align: left; min-height: 44px; padding: 9px 14px; border: 0; border-radius: 12px; background: transparent; color: var(--ink); font: 650 .93rem/1.2 var(--body); cursor: pointer; }
.account-tabs button:hover { background: #efe5da; }
.account-tabs button[aria-selected="true"] { background: var(--blue); color: #fff; }
.account-panel { min-width: 0; outline: none; }
.panel-title { font-size: clamp(1.8rem, 3.2vw, 2.6rem); margin-bottom: 18px; }
.sub-title { font-size: 1.5rem; margin: 26px 0 12px; }
.panel-card { margin-top: 16px; padding: clamp(16px, 2.4vw, 26px); border: 1px solid var(--line); border-radius: 20px; background: var(--paper); }
.panel-card h3 { font-size: 1.45rem; margin-bottom: 12px; }
.panel-card > p { color: var(--muted); }
.panel-card .button { margin-top: 12px; }
.danger-zone { border-color: #e6b5ae; background: #fff6f4; }
.empty, .muted-line { color: var(--muted); font-size: .92rem; }
.muted-line { margin-top: 6px; }
.stack { display: grid; gap: 10px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.stat { padding: 16px 18px; border-radius: 18px; background: #eef1fc; }
.stat-label { color: var(--muted); font-size: .82rem; font-weight: 650; }
.stat-value { margin-top: 6px; font: 600 1.7rem/1.1 var(--display); letter-spacing: -.03em; }
.stat-sub { margin-top: 4px; color: var(--muted); font-size: .8rem; }

.bar-chart { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 72px); justify-content: start; align-items: end; gap: 6px; height: 190px; padding-top: 6px; }
.bar { display: grid; grid-template-rows: auto 1fr auto; height: 100%; text-align: center; min-width: 0; }
.bar-fill { align-self: end; width: 100%; min-height: 2px; border-radius: 8px 8px 3px 3px; background: linear-gradient(#5479f0, var(--blue)); }
.bar-value, .bar-label { font-size: .68rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-label { margin-top: 5px; }
.chart-box { margin-bottom: 14px; }
.line-chart { width: 100%; height: auto; }
.line-chart .line { fill: none; stroke: var(--blue); stroke-width: 2.5; stroke-linejoin: round; }
.line-chart .dot { fill: var(--paper); stroke: var(--blue); stroke-width: 2; }
.line-chart .axis { fill: var(--muted); font: 11px var(--body); }

.day-card { border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.day-card + .day-card { margin-top: 0; }
.day-card summary { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; padding: 13px 16px; cursor: pointer; list-style: none; }
.day-card summary::-webkit-details-marker { display: none; }
.day-card summary::after { content: '+'; margin-left: auto; color: var(--blue-deep); font-weight: 800; }
.day-card[open] summary::after { content: '–'; }
.day-card summary span { display: inline; width: auto; height: auto; background: none; border-radius: 0; place-items: initial; flex: initial; color: var(--muted); font-size: .88rem; font-weight: 500; }
.day-card summary span::before, .day-card[open] summary span::before { content: none; }
.day-card summary { justify-content: flex-start; min-height: 0; }
.day-card > :not(summary) { margin: 0 16px 14px; }
.item-list, .plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.item-list li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.item-list .grow { flex: 1 1 200px; font-weight: 600; }
.tag { padding: 2px 9px; border-radius: 999px; background: var(--peach); font-size: .74rem; font-weight: 750; }
.plain-list li { padding: 7px 0; border-top: 1px solid var(--line); }
.plain-list li:first-child { border-top: 0; }
.row-line { padding: 6px 0; border-top: 1px solid var(--line); font-size: .93rem; }
.exercise-list { display: grid; gap: 10px; }
.exercise-list h4 { margin: 0; font: 700 .95rem var(--body); }
.exercise-list p { color: var(--muted); font-size: .88rem; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table, .compare-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th, .data-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.data-table thead th { color: var(--muted); font-size: .78rem; font-weight: 750; }
.data-table tbody th { font-weight: 650; }

.kv-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 24px; margin: 0; }
.kv-list div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv-list dt { color: var(--muted); font-size: .8rem; font-weight: 700; }
.kv-list dd { margin: 2px 0 0; overflow-wrap: anywhere; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { min-height: 40px; padding: 7px 14px; border: 1px solid #b7c3ef; border-radius: 999px; background: transparent; color: var(--blue-deep); font: 700 .86rem var(--body); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.chat-thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.chat-thread li { max-width: min(640px, 92%); padding: 11px 15px; border-radius: 18px; }
.chat-user { justify-self: end; background: var(--blue); color: #fff; border-bottom-right-radius: 6px; }
.chat-coach { justify-self: start; background: var(--paper); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.chat-who { font-size: .72rem; font-weight: 700; opacity: .75; margin-bottom: 3px; }
.chat-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .94rem; }

.raw-table code { font-size: .74rem; color: var(--muted); }
.raw-table pre { max-height: 420px; overflow: auto; padding: 12px; border-radius: 12px; background: #172342; color: #e8ecff; font-size: .74rem; line-height: 1.45; }

@media (max-width: 850px) {
  .signin-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "card" "anon"; }
  .signin-card { margin-top: 24px; }
  .dash-body { grid-template-columns: minmax(0, 1fr); }
  .dash-nav { position: static; }
  .account-tabs { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 6px; scrollbar-width: thin; }
  .account-tabs button { flex: none; white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; }
}
@media (max-width: 700px) {
  .account-root { padding-block: 20px 40px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-value { font-size: 1.35rem; }
  .bar-value { display: none; }
}
.google-slot { display: flex; justify-content: center; min-height: 52px; }
.google-slot > div { max-width: 100%; }
