/* =========================================================
   App pages: login, admin dashboard, patient portal.
   Builds on the tokens in style.css.
   ========================================================= */

.app-body { background: var(--cream); min-height: 100vh; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- Demo banner ---------- */
.demo-bar { position: relative; z-index: 60; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 9px 16px; background: repeating-linear-gradient(-45deg, #fff3d6, #fff3d6 12px, #fdebc0 12px, #fdebc0 24px); color: #6b4a12; font-size: .84rem; text-align: center; }
.demo-bar b { font-weight: 700; }
.demo-bar button { padding: 4px 12px; border-radius: 999px; background: #6b4a12; color: #fff; font-size: .78rem; font-weight: 600; }

/* ---------- Auth (login) ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { position: relative; overflow: hidden; background: var(--forest); color: #dbe6de; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side .logo { color: #fff; }
.auth-side .logo-mark { background: var(--blush); color: var(--forest); }
.auth-side h1 { color: #fff; font-size: clamp(2.2rem, 4vw, 3.4rem); margin: 0 0 16px; }
.auth-side h1 em { color: var(--blush); }
.auth-side p { max-width: 420px; font-size: 1.05rem; }
.auth-feats { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.auth-feats li { display: flex; align-items: center; gap: 12px; opacity: 0; transform: translateX(-16px); animation: featIn .8s var(--ease) forwards; }
.auth-feats li:nth-child(2) { animation-delay: .15s; }
.auth-feats li:nth-child(3) { animation-delay: .3s; }
.auth-feats .ic { width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,.08); display: grid; place-items: center; color: var(--blush); }
.auth-feats svg { width: 20px; height: 20px; }
@keyframes featIn { to { opacity: 1; transform: none; } }
.auth-side .blob { opacity: .22; }
.auth-side > * { position: relative; z-index: 1; }
.auth-side .blob, .auth-side .orbit-deco { z-index: 0; position: absolute; }
.orbit-deco { width: 520px; height: 520px; right: -180px; bottom: -180px; border-radius: 50%; border: 1.5px dashed rgba(243, 201, 192, .25); animation: spin 50s linear infinite; }
.orbit-deco::before { content: ""; position: absolute; top: 50%; left: -8px; width: 16px; height: 16px; border-radius: 50%; background: var(--blush); }

.auth-main { position: relative; display: flex; flex-direction: column; padding: 28px 40px 40px; }
.auth-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.auth-top a { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; color: var(--ink-soft); }
.auth-top a:hover { color: var(--rose-deep); }
.auth-top svg { width: 18px; height: 18px; }
.auth-card { width: 100%; max-width: 420px; margin: auto; padding: 40px 0; }
.auth-view { display: none; }
.auth-view.active { display: block; animation: panelIn .6s var(--ease); }
.auth-view h2 { font-size: clamp(1.9rem, 3vw, 2.4rem); margin-bottom: 6px; }
.auth-view > p { color: var(--ink-soft); margin-bottom: 26px; }
.auth-view .field label { justify-content: flex-start; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-inline-end: 48px; }
.pw-toggle { position: absolute; inset-inline-end: 8px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.pw-toggle:hover { background: var(--cream-2); color: var(--forest); }
.pw-toggle svg { width: 18px; height: 18px; }
.auth-row { display: flex; justify-content: space-between; align-items: center; margin: -4px 0 20px; font-size: .88rem; }
.link-btn { color: var(--rose-deep); font-weight: 600; font-size: inherit; padding: 0; }
.link-btn:hover { text-decoration: underline; }
.auth-alt { text-align: center; margin-top: 22px; font-size: .92rem; color: var(--ink-soft); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .86rem; color: var(--ink-soft); margin-bottom: 20px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--forest); flex: none; }
.form-msg { display: none; padding: 12px 14px; border-radius: 12px; font-size: .9rem; margin-bottom: 18px; }
.form-msg.show { display: block; animation: panelIn .4s var(--ease); }
.form-msg.err { background: #fbe4e1; color: #8a2f25; }
.form-msg.ok { background: var(--sage-light); color: var(--forest); }
.state-ic { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; margin-bottom: 22px; background: var(--sage-light); color: var(--forest); }
.state-ic svg { width: 34px; height: 34px; }
.demo-try { margin-top: 28px; padding: 18px; border-radius: 16px; border: 1.5px dashed #e2c17c; background: #fffaf0; font-size: .86rem; color: #6b4a12; }
.demo-try b { display: block; margin-bottom: 4px; }
.demo-try .row-2 { margin-top: 12px; }
.demo-try .btn { padding: 10px 14px; font-size: .84rem; }
.btn .spin { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.btn[disabled] { opacity: .7; pointer-events: none; }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: 28px 20px 36px; }
  .auth-side .auth-feats, .auth-side .auth-foot { display: none; }
  .auth-side h1 { font-size: 1.8rem; margin-top: 24px; }
  .auth-main { padding: 20px 16px 40px; }
  .auth-card { padding: 28px 0; }
}

/* ---------- Dashboard shell ---------- */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 24px 16px; background: var(--forest); color: #cfdcd3; }
.side .logo { color: #fff; padding: 0 10px 22px; }
.side .logo-mark { background: var(--blush); color: var(--forest); }
.side-nav { display: grid; gap: 4px; }
.side-nav button, .side-foot button, .side-foot a { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; border-radius: 12px; font-weight: 500; font-size: .94rem; color: #cfdcd3; text-align: start; transition: background .3s, color .3s; }
.side-nav button:hover, .side-foot button:hover, .side-foot a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-nav button.active { background: rgba(243, 201, 192, .16); color: #fff; }
.side-nav button.active svg { color: var(--blush); }
.side-nav svg, .side-foot svg { width: 20px; height: 20px; flex: none; }
.side-nav .count { margin-inline-start: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--rose); color: #fff; font-size: .72rem; font-weight: 700; display: grid; place-items: center; }
.side-foot { margin-top: auto; display: grid; gap: 4px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.side-user { padding: 10px 14px; font-size: .8rem; color: #9fb5a6; word-break: break-all; }
.main { min-width: 0; padding: 32px clamp(16px, 3vw, 44px) 80px; }
.page { display: none; padding: 0; }
.page.active { display: block; animation: panelIn .55s var(--ease); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head h1 { font-size: clamp(1.8rem, 3vw, 2.5rem); margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--ink-soft); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.mobile-top, .side-scrim { display: none; }
@media (max-width: 960px) {
  .side-scrim { display: block; }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 80; inset: 0 auto 0 0; width: 270px; transform: translateX(-105%); transition: transform .5s var(--ease); }
  [dir="rtl"] .side { inset: 0 0 0 auto; transform: translateX(105%); }
  .side-open .side { transform: none; }
  .side-scrim { position: fixed; inset: 0; z-index: 79; background: rgba(23, 43, 32, .45); opacity: 0; pointer-events: none; transition: opacity .4s; }
  .side-open .side-scrim { opacity: 1; pointer-events: auto; }
  .mobile-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 50; padding: 12px 16px; background: rgba(251, 247, 242, .9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
  .mobile-top .burger { display: block; }
  .main { padding-top: 22px; }
}

/* ---------- Cards, stats, lists ---------- */
.card { background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card h3 { font-size: 1.25rem; margin: 0 0 4px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.stack { display: grid; gap: 20px; }
@media (max-width: 1100px) { .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { position: relative; overflow: hidden; background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 20px; opacity: 0; transform: translateY(14px); animation: featIn .7s var(--ease) forwards; }
.stat-card:nth-child(2) { animation-delay: .07s; }
.stat-card:nth-child(3) { animation-delay: .14s; }
.stat-card:nth-child(4) { animation-delay: .21s; }
.stat-card .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px; }
.stat-card .ic svg { width: 22px; height: 22px; }
.stat-card strong { display: block; font-family: var(--font-display); font-size: 2.1rem; font-weight: 500; line-height: 1; color: var(--forest); }
.stat-card span { font-size: .85rem; color: var(--muted); }
@media (max-width: 900px) { .stats { grid-template-columns: 1fr 1fr; } }

.list { display: grid; gap: 10px; }
.item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: var(--cream); transition: background .3s, transform .4s var(--ease); }
.item.click { cursor: pointer; }
.item.click:hover { background: var(--cream-2); transform: translateX(4px); }
[dir="rtl"] .item.click:hover { transform: translateX(-4px); }
.item-main { flex: 1; min-width: 0; }
.item-main strong { display: block; color: var(--forest); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-main small { color: var(--muted); font-size: .82rem; }
.item-side { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.avatar-sm { width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--forest); color: var(--blush); font-family: var(--font-display); font-size: 1.1rem; }
.date-chip { flex: none; width: 54px; padding: 6px 0; border-radius: 12px; background: #fff; text-align: center; line-height: 1.1; border: 1.5px solid var(--line); }
.date-chip b { display: block; font-family: var(--font-display); font-size: 1.35rem; color: var(--forest); }
.date-chip small { font-size: .68rem; font-weight: 700; text-transform: uppercase; color: var(--rose-deep); letter-spacing: .06em; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: .92rem; border: 1.5px dashed var(--line); border-radius: 14px; }

.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.requested { background: #fff1d9; color: #8a5a06; }
.tag.confirmed { background: var(--sage-light); color: var(--forest); }
.tag.completed { background: #e6eef2; color: #3d6378; }
.tag.cancelled { background: #f6e1de; color: #8a2f25; }
.tag.draft { background: var(--cream-2); color: var(--ink-soft); }
.tag.live { background: var(--sage-light); color: var(--forest); }
.tag.plain::before { display: none; }

.icon-btn { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-soft); transition: background .3s, color .3s; flex: none; }
.icon-btn:hover { background: #fff; color: var(--forest); }
.icon-btn.danger:hover { background: #fbe4e1; color: #a23a2e; }
.icon-btn svg { width: 18px; height: 18px; }
.btn-danger { --bg: #fff; --fg: #a23a2e; box-shadow: inset 0 0 0 1.5px #e9b8b1; }
.btn-danger::before { background: #a23a2e; }
.btn-danger:hover { color: #fff; }

.search { position: relative; flex: 1; max-width: 340px; }
.search svg { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.search .input { padding-inline-start: 42px; border-radius: 999px; padding-block: 11px; }

/* tabs inside a page */
.subtabs { display: flex; gap: 6px; padding: 5px; background: #fff; border: 1.5px solid var(--line); border-radius: 999px; width: max-content; max-width: 100%; overflow-x: auto; margin-bottom: 20px; scrollbar-width: none; }
.subtabs button { padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: .88rem; color: var(--ink-soft); white-space: nowrap; transition: background .3s, color .3s; }
.subtabs button.active { background: var(--forest); color: #fff; }
.subpane { display: none; }
.subpane.active { display: block; animation: panelIn .5s var(--ease); }

/* patient header */
.p-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-bottom: 22px; }
.p-head .avatar-sm { width: 72px; height: 72px; font-size: 1.8rem; }
.p-head h1 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.3rem); }
.p-meta { display: flex; gap: 8px 16px; flex-wrap: wrap; color: var(--ink-soft); font-size: .9rem; margin-top: 6px; }
.p-meta span { display: inline-flex; align-items: center; gap: 6px; }
.p-meta svg { width: 16px; height: 16px; color: var(--sage); }
.back { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; color: var(--ink-soft); margin-bottom: 18px; }
.back:hover { color: var(--rose-deep); }
.back svg { width: 18px; height: 18px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
textarea.input { min-height: 110px; resize: vertical; line-height: 1.6; }
.file-drop { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; border: 1.5px dashed var(--line); background: var(--cream); cursor: pointer; font-size: .9rem; color: var(--ink-soft); transition: border-color .3s, background .3s; }
.file-drop:hover { border-color: var(--sage); background: #fff; }
.file-drop svg { width: 22px; height: 22px; color: var(--sage); }
.file-drop input { display: none; }

/* table */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th { text-align: start; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1.5px solid var(--line); }
table.data td { padding: 12px; border-bottom: 1px solid var(--line); }
table.data tr:last-child td { border-bottom: 0; }

/* ---------- Line chart ---------- */
.chart { position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text { font-family: var(--font-body); font-size: 11px; fill: var(--muted); }
.chart .line { fill: none; stroke: var(--forest); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: drawLine 1.6s var(--ease) forwards; }
.chart .area { fill: url(#areaGrad); opacity: 0; animation: fadeIn 1s .6s forwards; }
.chart .dot { fill: var(--forest); stroke: #fff; stroke-width: 2; }
.chart .dot.last { fill: var(--rose); }
.chart .cross { stroke: var(--ink-soft); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart-tip { position: absolute; pointer-events: none; padding: 8px 12px; border-radius: 10px; background: var(--forest); color: #fff; font-size: .8rem; line-height: 1.35; white-space: nowrap; opacity: 0; transform: translate(-50%, -110%); transition: opacity .15s; }
.chart-tip b { font-family: var(--font-display); font-size: 1rem; }
@keyframes drawLine { to { stroke-dashoffset: 0; } }
@keyframes fadeIn { to { opacity: 1; } }

/* ---------- Post editor ---------- */
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .editor-layout { grid-template-columns: 1fr; } }
.lang-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.lang-tabs button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 12px; font-weight: 600; font-size: .9rem; background: var(--cream); color: var(--ink-soft); transition: background .3s, color .3s; }
.lang-tabs button.active { background: var(--forest); color: #fff; }
.lang-tabs .dotted { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.lang-tabs .dotted.on { background: var(--sage); }
.lang-pane { display: none; }
.lang-pane.active { display: block; animation: panelIn .45s var(--ease); }
.title-input { font-family: var(--font-display); font-size: 1.6rem; padding: 12px 16px; }
.rte-bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border: 1.5px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; background: var(--cream); position: sticky; top: 0; z-index: 5; }
.rte-bar button { min-width: 36px; height: 34px; padding: 0 9px; border-radius: 8px; font-size: .85rem; font-weight: 600; color: var(--ink-soft); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.rte-bar button:hover { background: #fff; color: var(--forest); }
.rte-bar button svg { width: 16px; height: 16px; }
.rte-bar .sep { width: 1px; background: var(--line); margin: 4px 4px; }
.rte { min-height: 340px; max-height: 70vh; overflow-y: auto; padding: 22px 24px; border: 1.5px solid var(--line); border-radius: 0 0 12px 12px; background: #fff; outline: none; }
.rte:focus { border-color: var(--sage); box-shadow: 0 0 0 4px rgba(111, 148, 119, .14); }
.rte:empty::before { content: attr(data-ph); color: var(--muted); }
.rte.prose { font-size: 1.02rem; }
.rte.prose > p:first-of-type::first-letter { all: unset; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches button { width: 38px; height: 38px; border-radius: 12px; box-shadow: inset 0 0 0 2px #fff; outline: 2px solid transparent; transition: outline-color .2s, transform .3s var(--ease-bounce); }
.swatches button.active { outline-color: var(--forest); transform: scale(1.08); }
.icon-pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.icon-pick button { aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center; background: var(--cream); color: var(--ink-soft); }
.icon-pick button.active { background: var(--forest); color: var(--blush); }
.icon-pick svg { width: 20px; height: 20px; }
.cover-preview { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; display: grid; place-items: center; margin-bottom: 16px; }
.cover-preview .cover-art { position: absolute; inset: 0; }
.cover-preview .cover-ic { position: relative; width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,.85); display: grid; place-items: center; }
.cover-preview .cover-ic svg { width: 30px; height: 30px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; font-weight: 600; font-size: .92rem; }
.switch input { display: none; }
.switch i { position: relative; width: 46px; height: 26px; border-radius: 999px; background: var(--line); transition: background .3s; flex: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-s); transition: transform .4s var(--ease-bounce); }
.switch input:checked + i { background: var(--sage); }
.switch input:checked + i::after { transform: translateX(20px); }
[dir="rtl"] .switch i::after { left: auto; right: 3px; }
[dir="rtl"] .switch input:checked + i::after { transform: translateX(-20px); }

/* ---------- Portal ---------- */
.portal-top { position: sticky; top: 0; z-index: 50; background: rgba(251, 247, 242, .88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.portal-top .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 12px; }
.portal-top .right { display: flex; align-items: center; gap: 10px; }
.portal-nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 0 0 12px; }
.portal-nav a { padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: .88rem; color: var(--ink-soft); white-space: nowrap; transition: background .3s, color .3s; }
.portal-nav a.active, .portal-nav a:hover { background: var(--forest); color: #fff; }
.portal-hero { padding: 40px 0 10px; }
.portal-hero h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); margin: 0 0 6px; }
.portal-hero p { color: var(--ink-soft); margin: 0; }
.portal section { padding: 26px 0; scroll-margin-top: 130px; }
.next-card { position: relative; overflow: hidden; background: var(--forest); color: #dbe6de; border-radius: var(--radius-l); padding: 28px; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.next-card .blob { opacity: .2; width: 300px; height: 300px; top: -120px; right: -80px; background: var(--rose); }
.next-card > :not(.blob) { position: relative; }
.next-card small { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--blush); }
.next-card h2 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 8px 0 4px; }
.next-card p { margin: 0; }
.big-stat { font-family: var(--font-display); font-size: 2.6rem; line-height: 1; color: var(--forest); }
.big-stat small { font-size: .4em; color: var(--muted); font-family: var(--font-body); font-weight: 600; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: .9rem; padding: 4px 10px; border-radius: 999px; background: var(--sage-light); color: var(--forest); }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
.mini-stats div { background: var(--cream); border-radius: 12px; padding: 12px 14px; }
.mini-stats span { display: block; font-size: .74rem; font-weight: 600; color: var(--muted); }
.mini-stats strong { font-family: var(--font-display); font-size: 1.3rem; color: var(--forest); font-weight: 600; }
.report-body { white-space: pre-wrap; line-height: 1.75; color: var(--ink); }
.modal-card.wide { max-width: 640px; }
.info-list { display: grid; gap: 0; }
.info-list div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.info-list div:last-child { border-bottom: 0; }
.info-list span { color: var(--muted); }
.info-list b { font-weight: 600; color: var(--forest); text-align: end; }

/* skeleton while loading */
.skel { border-radius: 12px; background: linear-gradient(90deg, var(--cream-2) 25%, #f9f4ee 50%, var(--cream-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* big app-level loader */
.app-loading { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; background: var(--cream); transition: opacity .5s; }
.app-loading.done { opacity: 0; pointer-events: none; }
.app-loading .ring-spin { width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--sage-light); border-top-color: var(--forest); animation: spin .9s linear infinite; }
