/* Ata Appointment. One style sheet for the Blazor portal and the sign-in pages.
   Phone rules come first in each block; tablet and desktop rules follow in media queries. */
:root {
  --night: #0F1E33;          /* side menu, headings */
  --night-2: #1A2F4D;        /* side menu hover */
  --night-ink: #B9C6D8;      /* text on the side menu */
  --jade: #19C39A;           /* accent on dark */
  --primary: #0B7F63;        /* buttons, links */
  --primary-dark: #086350;
  --primary-soft: #E3F6EF;
  --marigold: #F5A524;       /* the "now" line and highlights */
  --ground: #F2F4F8;
  --surface: #FFFFFF;
  --ink: #0F1E33;
  --ink-2: #52607A;
  --line: #E3E7EE;
  --line-strong: #C8CFDA;

  --ok-bg: #DFF5EC;   --ok-ink: #0A5C47;   --ok-bar: #12A37F;
  --wait-bg: #E1EDFB; --wait-ink: #164A85; --wait-bar: #3B82F6;
  --walk-bg: #FDF0D5; --walk-ink: #6B4706; --walk-bar: #E0A01A;
  --appr-bg: #EEE6FB; --appr-ink: #4B2C8A; --appr-bar: #8B5CF6;
  --bad-bg: #FBE3E3;  --bad-ink: #8A1F1F;  --bad-bar: #DC4444;
  --block-bg: #E6EAF0; --block-ink: #3F4B5F;

  --r-card: 14px;
  --r-ctl: 10px;
  --side: 244px;
  --rail: 76px;
  --tabs: 62px;
  --shadow: 0 1px 2px rgba(15, 30, 51, .06), 0 4px 14px rgba(15, 30, 51, .04);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif; font-size: 15px; line-height: 1.45; color: var(--ink); background: var(--ground); }
h1, h2, h3, p, dl, ul { margin: 0; }
h1 { font-size: 1.5rem; line-height: 1.2; font-weight: 700; letter-spacing: -.015em; }
h2 { font-size: 1.05rem; font-weight: 650; letter-spacing: -.005em; }
h3 { font-size: .95rem; font-weight: 650; }
a { color: var(--primary); }
ul.hint { padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, Consolas, "Cascadia Mono", monospace; font-size: .85rem; overflow-wrap: anywhere; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(25, 195, 154, .55); outline-offset: 2px; }
.icon { flex: none; }

/* ---------- start-up and connection messages ---------- */
.boot { min-height: 100vh; display: flex; align-items: center; justify-content: center; color: var(--ink-2); }
.shell ~ .boot { display: none; }
#blazor-error-ui { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 200; padding: 12px 16px; background: var(--bad-bg); color: var(--bad-ink); }
#blazor-error-ui a { color: var(--bad-ink); font-weight: 600; margin-left: 8px; }

/* ---------- shell: side menu, content, phone tabs ---------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; padding-bottom: calc(var(--tabs) + env(safe-area-inset-bottom)); }
.side { background: var(--night); color: var(--night-ink); display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; position: sticky; top: 0; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; letter-spacing: -.01em; min-width: 0; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--jade); color: var(--night); display: flex; align-items: center; justify-content: center; flex: none; }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-nav { display: none; }
.side-foot { display: flex; align-items: center; gap: 8px; }
.side-user { display: none; }
.side-out { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; min-height: 44px; border-radius: var(--r-ctl); color: var(--night-ink); text-decoration: none; }
.side-out span { display: none; }
.side-out:hover { background: var(--night-2); color: #fff; }
.main { flex: 1; min-width: 0; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: var(--night); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { flex: 1; min-height: var(--tabs); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: .72rem; color: var(--night-ink); text-decoration: none; }
.tabs a.active { color: var(--jade); font-weight: 650; box-shadow: inset 0 3px 0 var(--jade); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--jade); color: var(--night); display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 700; flex: none; }
.av-0 { background: #CDEFE4; color: #0A5C47; }
.av-1 { background: #D9E6FB; color: #164A85; }
.av-2 { background: #FBE7C2; color: #6B4706; }
.av-3 { background: #E6DCFA; color: #4B2C8A; }
.av-4 { background: #F9D9E4; color: #862049; }

@media (min-width: 760px) {
  .shell { flex-direction: row; padding-bottom: 0; }
  .tabs { display: none; }
  .side { width: var(--rail); height: 100vh; flex: none; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 18px; padding: 16px 12px; }
  .side .brand { justify-content: center; }
  .side .brand-name { display: none; }
  .side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
  .side-nav a { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 46px; border-radius: var(--r-ctl); color: var(--night-ink); text-decoration: none; font-weight: 550; }
  .side-nav a span { display: none; }
  .side-nav a:hover { background: var(--night-2); color: #fff; }
  .side-nav a.active { background: var(--jade); color: var(--night); }
  .side-foot { flex-direction: column; align-items: stretch; gap: 6px; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 12px; }
  .side-user { display: flex; align-items: center; justify-content: center; gap: 10px; min-width: 0; }
  .side-user-text { display: none; }
  .main { padding: 22px 24px; gap: 18px; }
}
@media (min-width: 1100px) {
  .side { width: var(--side); padding: 18px 14px; }
  .side .brand { justify-content: flex-start; padding: 0 6px; }
  .side .brand-name { display: block; }
  .side-nav a { justify-content: flex-start; padding: 0 12px; }
  .side-nav a span { display: inline; }
  .side-user { justify-content: flex-start; padding: 0 6px; }
  .side-user-text { display: flex; flex-direction: column; min-width: 0; font-size: .8rem; line-height: 1.3; }
  .side-user-text strong { color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-user-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-out { justify-content: flex-start; padding: 0 12px; }
  .side-out span { display: inline; }
  .main { padding: 26px 30px; }
}

/* ---------- page head and toolbar ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-title { display: flex; flex-direction: column; gap: 3px; min-width: 0; max-width: 70ch; }
.page-title p { color: var(--ink-2); font-size: .9rem; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.seg { display: inline-flex; background: #E4E8EF; border-radius: var(--r-ctl); padding: 3px; }
.seg a { min-height: 38px; padding: 0 16px; display: flex; align-items: center; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 600; }
.seg a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(15, 30, 51, .14); }
.stepper { display: inline-flex; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-ctl); padding: 2px; }
.field-inline { flex-direction: row; align-items: center; gap: 8px; font-size: .85rem; color: var(--ink-2); font-weight: 600; }
.field-inline input, .field-inline select { width: auto; min-width: 140px; }
/* On a phone the three filters share one row; their names are kept for screen readers only. */
@media (max-width: 759px) {
  .toolbar { gap: 8px; }
  .toolbar .field-inline { flex: 1 1 96px; min-width: 0; font-size: 0; gap: 0; }
  .toolbar .field-inline:has(input[type=date]) { flex-basis: 136px; }
  .toolbar .field-inline input, .toolbar .field-inline select { width: 100%; min-width: 0; font-size: .9rem; padding: 8px; }
}

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: .92rem; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #F6F8FB; border-color: #B4BDCB; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-danger { color: var(--bad-ink); border-color: #E3B4B4; }
.btn-danger:hover { background: var(--bad-bg); border-color: #D99; }
.btn-flat { border-color: transparent; min-height: 40px; }
.btn-small { min-height: 36px; padding: 0 12px; font-size: .84rem; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer; text-decoration: none; flex: none; }
.icon-btn:hover { background: #EDF0F5; color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
label { display: flex; flex-direction: column; gap: 5px; font-size: .84rem; font-weight: 600; color: var(--ink-2); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=time], input[type=number], input[type=search], input[type=url], select, textarea {
  width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); background: var(--surface); color: var(--ink); font: inherit; font-weight: 400; }
input:hover, select:hover, textarea:hover { border-color: #AEB8C7; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(25, 195, 154, .35); outline-offset: 0; border-color: var(--primary); }
input[disabled] { background: #F1F3F7; color: var(--ink-2); }
textarea { min-height: 84px; resize: vertical; }
.check { flex-direction: row; align-items: center; gap: 10px; color: var(--ink); font-size: .95rem; font-weight: 500; min-height: 40px; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }
.form { display: flex; flex-direction: column; gap: 14px; }
.form-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.inline-form label { flex: 1 1 150px; }
.hint { font-size: .84rem; color: var(--ink-2); font-weight: 400; }
fieldset.group { border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px 16px 16px; margin: 0; display: flex; flex-direction: column; gap: 12px; }
fieldset.group legend { font-weight: 650; padding: 0 6px; }
details.action { border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 0 14px; }
details.action > summary { cursor: pointer; min-height: 46px; display: flex; align-items: center; font-weight: 600; color: var(--ink); }
details.action[open] { padding-bottom: 14px; }

/* ---------- pieces ---------- */
.banner { padding: 12px 14px; border-radius: var(--r-ctl); font-weight: 500; }
.banner-err { background: var(--bad-bg); color: var(--bad-ink); }
.banner-info { background: var(--wait-bg); color: var(--wait-ink); }
.card { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
/* Two columns that pack cards of different heights without leaving holes. */
@media (min-width: 1000px) {
  .grid-2 { display: block; column-count: 2; column-gap: 18px; }
  .grid-2 > * { break-inside: avoid; margin-bottom: 18px; }
  .grid-2 > *:last-child { margin-bottom: 0; }
}
.chip, .key, .count { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.count { min-width: 28px; justify-content: center; background: #E9EDF3; color: var(--ink-2); }
.st-confirmed { background: var(--ok-bg); color: var(--ok-ink); --bar: var(--ok-bar); }
.st-awaiting { background: var(--wait-bg); color: var(--wait-ink); --bar: var(--wait-bar); }
.st-walkin { background: var(--walk-bg); color: var(--walk-ink); --bar: var(--walk-bar); }
.st-approval { background: var(--appr-bg); color: var(--appr-ink); --bar: var(--appr-bar); }
.st-noshow { background: var(--bad-bg); color: var(--bad-ink); --bar: var(--bad-bar); }
.st-blocked { background: var(--block-bg); color: var(--block-ink); --bar: #8793A6; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; }
.key { background: transparent; color: var(--ink-2); padding-left: 0; font-weight: 500; }
.key::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--bar); }
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); min-width: 0; text-align: left; }
.row:first-child { border-top: 0; }
.row-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.row-main strong { font-weight: 600; overflow-wrap: anywhere; }
.row-main span { color: var(--ink-2); font-size: .85rem; overflow-wrap: anywhere; }
.row-btn { width: 100%; background: transparent; border-left: 0; border-right: 0; border-bottom: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: none; padding: 10px 8px; margin: 0 -8px; width: calc(100% + 16px); border-radius: 8px; }
.row-btn:hover { background: #F4F6FA; }
.empty { color: var(--ink-2); font-size: .9rem; padding: 6px 0; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; font-size: .92rem; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; overflow-wrap: anywhere; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--ink-2); font-weight: 600; white-space: nowrap; }
th.num, td.num { text-align: right; }
.keybox { background: #FFF8E6; border: 1px solid #F1D48A; border-radius: var(--r-card); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

/* ---------- the diary ---------- */
.sched { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow); overflow: auto; max-height: calc(100vh - 250px); min-height: 340px; }
.sched-grid { display: grid; min-width: min-content; }
.sched-corner { position: sticky; left: 0; top: 0; z-index: 6; background: var(--surface); border-bottom: 1px solid var(--line); }
.sched-head { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); padding: 10px 12px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.sched-head.is-today { box-shadow: inset 0 -3px 0 var(--jade); }
.sched-head-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.sched-head-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-head-text span { color: var(--ink-2); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-day { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; background: #EDF0F5; color: var(--ink); text-decoration: none; line-height: 1.05; flex: none; }
.sched-day span { font-size: .68rem; color: var(--ink-2); font-weight: 600; }
.sched-day strong { font-size: 1rem; }
.is-today .sched-day { background: var(--night); color: #fff; }
.is-today .sched-day span { color: var(--jade); }
.sched-times { position: sticky; left: 0; z-index: 4; background: var(--surface); border-right: 1px solid var(--line); }
.sched-times span { position: absolute; right: 8px; font-size: .74rem; color: var(--ink-2); font-variant-numeric: tabular-nums; transform: translateY(-50%); }
.sched-col { position: relative; border-left: 1px solid var(--line);
  background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px), linear-gradient(to bottom, #F0F2F6 1px, transparent 1px);
  background-size: 100% 120px, 100% 60px; }
.sched-col.is-today { background-color: #FAFDFC; }
.ev { position: absolute; left: 4px; right: 4px; border-radius: 8px; overflow: hidden; font: inherit; text-align: left; }
.ev-appt { z-index: 2; border: 0; border-left: 4px solid var(--bar); padding: 4px 8px; display: flex; flex-direction: column; justify-content: flex-start; gap: 1px; cursor: pointer; line-height: 1.25; }
.ev-appt:hover { filter: brightness(.965); }
.ev-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .84rem; }
.ev-line b { font-weight: 700; font-variant-numeric: tabular-nums; margin-right: 2px; }
.ev-line strong { font-weight: 600; }
.ev-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .76rem; opacity: .9; }
.ev-short { padding-top: 2px; padding-bottom: 2px; justify-content: center; }
.ev-block { z-index: 2; background: var(--block-bg); color: var(--block-ink); padding: 5px 9px; font-size: .8rem; font-weight: 600; border-left: 4px solid #8793A6; }
.ev-closed { left: 0; right: 0; border-radius: 0; z-index: 0; color: var(--ink-2); font-size: .8rem; padding: 6px 10px;
  background: repeating-linear-gradient(135deg, #F3F5F8, #F3F5F8 7px, #EBEEF3 7px, #EBEEF3 14px); }
.ev-free { z-index: 1; border: 1px dashed transparent; background: transparent; color: transparent; display: flex; align-items: center; justify-content: center; gap: 4px; font-size: .78rem; font-weight: 600; cursor: pointer; }
.ev-free:hover, .ev-free:focus-visible { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); }
@media (hover: none) { .ev-free { color: #9AA6B8; } .ev-free span { display: none; } }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--marigold); z-index: 3; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--marigold); }
@media (min-width: 760px) { .sched { max-height: calc(100vh - 230px); } }

/* ---------- flyout ---------- */
.flyout { position: fixed; inset: 0; z-index: 60; }
.flyout-backdrop { position: absolute; inset: 0; background: rgba(15, 30, 51, .5); animation: fade-in .15s ease-out; }
.flyout-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; display: flex; flex-direction: column; background: var(--surface); border-radius: 18px 18px 0 0; animation: sheet-up .2s ease-out; outline: 0; }
.flyout-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 18px 12px; border-bottom: 1px solid var(--line); }
.flyout-head h2 { font-size: 1.2rem; overflow-wrap: anywhere; }
.flyout-body { padding: 16px 18px calc(22px + env(safe-area-inset-bottom)); overflow-y: auto; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sheet-in { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 760px) {
  .flyout-panel { left: auto; top: 0; bottom: 0; width: min(460px, 94vw); max-height: none; border-radius: 0; animation-name: sheet-in; box-shadow: -12px 0 32px rgba(15, 30, 51, .18); }
  .flyout-head { padding: 22px 24px 14px; }
  .flyout-body { padding: 18px 24px 28px; }
}
@media (prefers-reduced-motion: reduce) { .flyout-panel, .flyout-backdrop, .toast { animation: none; } }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 12px; left: 12px; bottom: calc(var(--tabs) + 12px + env(safe-area-inset-bottom)); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; max-width: 440px; display: flex; align-items: center; gap: 8px; padding: 10px 8px 10px 16px; border-radius: 12px; background: var(--night); color: #fff; box-shadow: 0 8px 24px rgba(15, 30, 51, .28); border-left: 4px solid var(--jade); animation: sheet-up .18s ease-out; }
.toast-err { border-left-color: var(--bad-bar); }
.toast .icon-btn { color: var(--night-ink); width: 32px; height: 32px; }
.toast .icon-btn:hover { background: var(--night-2); color: #fff; }
@media (min-width: 760px) { .toasts { bottom: 20px; right: 24px; left: auto; } }

/* ---------- stats ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile-label { font-size: .8rem; color: var(--ink-2); font-weight: 600; }
.tile-value { font-size: 1.9rem; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile-note { font-size: .78rem; color: var(--ink-2); }
.tile-lead { background: var(--night); color: #fff; }
.tile-lead .tile-label, .tile-lead .tile-note { color: var(--night-ink); }
.tile-lead .tile-value { color: var(--jade); }
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
.chart-scroll { overflow-x: auto; }
.chart { display: block; width: 100%; min-width: 520px; max-width: 940px; height: auto; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--line-strong); stroke-width: 1; }
.chart .tick { fill: var(--ink-2); font-size: 11px; font-family: inherit; }
.chart .bar { fill: #0E9C7A; }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: rgba(15, 30, 51, .05); }
.hbars { display: flex; flex-direction: column; gap: 9px; }
.hbar-row { display: grid; grid-template-columns: minmax(90px, 36%) minmax(0, 1fr) 40px; gap: 10px; align-items: center; font-size: .88rem; min-height: 24px; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 12px; background: #EEF1F5; border-radius: 4px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; background: #0E9C7A; border-radius: 0 4px 4px 0; }
.hbar-value { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-table summary { cursor: pointer; color: var(--primary); font-size: .85rem; font-weight: 600; min-height: 36px; display: flex; align-items: center; }
.tip { position: fixed; z-index: 90; background: var(--night); color: #fff; padding: 6px 10px; border-radius: 8px; font-size: .8rem; pointer-events: none; max-width: 240px; }

/* ---------- chat test ---------- */
.chat { max-width: 540px; width: 100%; display: flex; flex-direction: column; gap: 12px; }
.chat-log { background: #E9E4DB; border-radius: var(--r-card); padding: 14px; display: flex; flex-direction: column; gap: 8px; max-height: 58vh; min-height: 260px; overflow-y: auto; }
.bubble { max-width: 86%; padding: 8px 12px; border-radius: 12px; font-size: .92rem; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); }
.bubble-in { align-self: flex-end; background: #D5F2C6; color: #173B0B; border-bottom-right-radius: 4px; }
.bubble-out { align-self: flex-start; background: #fff; display: flex; flex-direction: column; gap: 6px; border-bottom-left-radius: 4px; }
.chat-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 0; width: 100%; min-height: 40px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--primary-dark); font: inherit; text-align: left; cursor: pointer; white-space: normal; }
.chat-choice:hover { background: var(--primary-soft); border-color: var(--primary); }
.chat-choice strong { font-weight: 600; }
.chat-choice small { color: var(--ink-2); }

/* ---------- sign-in, registration and home pages ---------- */
body.public { background: var(--night); min-height: 100vh; display: flex; flex-direction: column; }
.public-head { padding: 22px 20px 6px; display: flex; justify-content: center; }
.public-head .brand { font-size: 1.1rem; }
.public-main { flex: 1; width: 100%; max-width: 480px; margin: 0 auto; padding: 16px 16px 40px; display: flex; flex-direction: column; gap: 16px; }
.public-main:has(.public-wide) { max-width: 600px; }
.public-card { background: var(--surface); border-radius: 18px; padding: 24px 22px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 18px 48px rgba(0, 0, 0, .28); }
.public-card h1 { font-size: 1.45rem; }
