/* Alysian Notetaker. Built on the Alysian tokens (tokens.css): no colour, radius, shadow or
   spacing value is written here that is not one of them, or mixed from them. */

:root {
  --dur-instant: 0.1s;
  --dur-fast: 0.15s;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --page-width: 760px;
  --side-width: 288px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: var(--fs-body); line-height: var(--lh-loose); }
h1, h2, p, ol, ul { margin: 0; }
a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--accent-deep); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.muted { color: var(--text-muted); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ── the bar across the top: what this is, and who is signed in ─────────────── */
.top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-7); padding: var(--space-5) var(--space-9); background: var(--card); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: var(--space-4); font-weight: var(--fw-semibold); font-size: var(--fs-md); color: var(--text-strong); text-decoration: none; white-space: nowrap; }
.brand img { height: 22px; }
.brand span { padding-left: var(--space-4); border-left: 1px solid var(--border-strong); }
.account { display: flex; align-items: center; gap: var(--space-4); min-width: 0; }
.account .avatar { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius-md); background: var(--primary-faint); color: var(--primary); font-size: var(--fs-xs); font-weight: var(--fw-semibold); }
.account .name { font-size: var(--fs-base); font-weight: var(--fw-medium); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linkish { background: none; border: 0; padding: 0; font: inherit; font-size: var(--fs-base); color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.linkish:hover { color: var(--text-strong); }

/* ── History down the side, the page beside it ──────────────────────────────── */
/* The window is filled: the bar on top, and under it History and the page, each scrolling alone. */
body.app { height: 100vh; display: flex; flex-direction: column; }
.top { flex: none; }
.shell { flex: 1; min-height: 0; display: grid; grid-template-columns: var(--side-width) minmax(0, 1fr); }
.side, .beside { position: relative; min-height: 0; overflow-y: auto; } /* positioned, so that what is only for a screen reader scrolls with them */
.side { padding: var(--space-7) var(--space-5) var(--space-9); background: var(--card); border-right: 1px solid var(--border); }
.side-home { display: block; padding: var(--space-4) var(--space-5); border-radius: var(--radius-md); color: var(--text-strong); font-weight: var(--fw-medium); text-decoration: none; transition: background var(--dur-fast) var(--ease-standard); }
.side-title { margin: var(--space-8) var(--space-5) var(--space-3); font-size: var(--fs-xs); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--text-muted); }
.history-month { margin: var(--space-6) var(--space-5) var(--space-2); font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-muted); }
.history-month:first-child { margin-top: var(--space-3); }
.history-list { list-style: none; padding: 0; }
.history-item { display: grid; gap: 1px; padding: var(--space-4) var(--space-5); border-radius: var(--radius-md); color: var(--text); text-decoration: none; transition: background var(--dur-fast) var(--ease-standard); }
.side-home:hover, .history-item:hover { background: var(--surface-hover-2); color: var(--text-strong); }
.side-home[aria-current], .history-item[aria-current] { background: var(--primary-faint); color: var(--text-strong); }
.history-title { font-size: var(--fs-base); font-weight: var(--fw-medium); color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-when { font-size: var(--fs-sm); color: var(--text-muted); }
.dot { display: inline-block; width: 7px; height: 7px; margin-right: var(--space-3); border-radius: 50%; background: var(--primary); vertical-align: middle; }
.history-older { margin: var(--space-5) var(--space-5) 0; }
.history-none { margin: var(--space-3) var(--space-5) 0; font-size: var(--fs-base); }

/* ── the page ───────────────────────────────────────────────────────────────── */
.page { width: 100%; max-width: var(--page-width); margin: 0 auto; padding: var(--space-9) var(--space-7) var(--space-12); }
.page > .notice { margin-bottom: var(--space-6); }
.section { margin-top: var(--space-10); }
.section-title { font-size: var(--fs-lg); font-weight: var(--fw-semibold); color: var(--text-strong); margin-bottom: var(--space-5); }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.panel-pad { padding: var(--space-8); }
.notice { padding: var(--space-5) var(--space-7); border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface-subtle); }
.notice.warn { background: var(--warning-surface); border-color: var(--warning-bg); }
.notice.bad { background: var(--danger-surface); border-color: var(--danger-bg); }

/* ── buttons and tags ───────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-3); min-height: 36px; padding: 0 var(--space-8); border-radius: var(--radius-pill); border: 1px solid var(--primary); background: var(--primary); color: var(--text-on-navy); font: inherit; font-size: var(--fs-base); font-weight: var(--fw-semibold); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background var(--dur-fast) var(--ease-standard), transform var(--dur-instant) var(--ease-standard), box-shadow var(--dur-fast) var(--ease-standard); }
.btn:hover { background: var(--primary-strong); color: var(--text-on-navy); box-shadow: var(--shadow-md); }
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.btn.ghost { background: var(--card); color: var(--text); border-color: var(--border-strong); }
.btn.ghost:hover { background: var(--surface-hover-2); color: var(--text); box-shadow: none; }
.btn.small { min-height: 30px; padding: 0 var(--space-6); font-size: var(--fs-sm); }
.pill { display: inline-flex; align-items: center; padding: 2px var(--space-4); border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: var(--fw-semibold); background: var(--surface-hover-2); color: var(--text-muted); white-space: nowrap; }
.pill.ok { background: var(--success-bg); color: var(--success); }
.pill.bad { background: var(--danger-bg); color: var(--danger); }
.pill.info { background: var(--info-bg); color: var(--info); }

/* ── the two boxes ──────────────────────────────────────────────────────────── */
.field + .field { margin-top: var(--space-8); }
.field label { font-weight: var(--fw-semibold); color: var(--text-strong); }
.field input { width: 100%; padding: var(--space-4) var(--space-5); border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--surface-subtle); font: inherit; color: var(--text); transition: border-color var(--dur-fast) var(--ease-standard), background var(--dur-fast) var(--ease-standard); }
.field input:focus { background: var(--card); border-color: var(--primary); outline: none; box-shadow: 0 0 0 2px var(--primary-glow); }
.field > input { margin-top: var(--space-3); }
.with-button { display: flex; gap: var(--space-4); align-items: center; margin-top: var(--space-3); flex-wrap: wrap; }
.with-button input { flex: 1 1 260px; min-width: 0; }
.field .read { margin-top: var(--space-3); font-size: var(--fs-base); }
.says { margin-top: var(--space-5); min-height: 1.4em; font-size: var(--fs-base); }
.says:empty { min-height: 0; margin-top: 0; }
.says.bad { color: var(--danger); }
.says.ok { color: var(--success); }
[data-meetings] .says { margin: 0 0 var(--space-4); }
[data-meetings] .says:empty { margin: 0; }

.help { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: var(--space-2); border-radius: 50%; border: 1px solid var(--border-strong); color: var(--text-muted); font-size: 12px; font-weight: 600; cursor: help; vertical-align: middle; }
.help-tip { display: none; position: absolute; left: 0; top: 24px; z-index: 20; width: min(420px, 78vw); padding: var(--space-5) var(--space-6); background: var(--card); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius-md); box-shadow: var(--shadow-md); font-size: 13px; font-weight: 400; line-height: 1.5; text-align: left; cursor: default; }
.help:hover .help-tip, .help:focus .help-tip, .help:focus-within .help-tip { display: block; }
.help-tip ol { margin: 0; padding-left: var(--space-6); }
.help-tip li { margin-bottom: var(--space-2); }

/* ── the meetings ───────────────────────────────────────────────────────────── */
.meetings { list-style: none; padding: 0; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.meeting { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: var(--space-6); align-items: center; padding: var(--space-5) var(--space-7); }
.meeting + .meeting { border-top: 1px solid var(--border-faint, var(--border)); }
.meeting-when { color: var(--text-muted); font-size: var(--fs-base); }
.meeting-day { color: var(--text-strong); font-weight: var(--fw-medium); }
.meeting-what { display: grid; min-width: 0; }
.meeting-title { font-weight: var(--fw-medium); color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meeting-note { color: var(--text-muted); font-size: var(--fs-base); }
.meeting-end { display: flex; gap: var(--space-3); align-items: center; justify-content: flex-end; }
@media (max-width: 640px) {
  .top { padding: var(--space-5) var(--space-6); }
  .meeting { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
  .meeting-end { justify-content: flex-start; margin-top: var(--space-2); }
}

/* ── one meeting: what was written down, and the hand-over under it ──────────── */
.reader-head { padding: var(--space-8) var(--space-8) var(--space-6); border-bottom: 1px solid var(--border-faint, var(--border)); }
.reader-title { font-size: var(--fs-xl); font-weight: var(--fw-semibold); color: var(--text-strong); line-height: var(--lh-tight); overflow-wrap: anywhere; }
.reader-head .muted { margin-top: var(--space-2); font-size: var(--fs-base); }
.lines { list-style: none; padding: var(--space-6) var(--space-8); }
.line { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: var(--space-5); padding: var(--space-3) 0; }
.line-at { padding-top: 2px; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; color: var(--text-muted); }
.line-said { overflow-wrap: anywhere; }
.line-said b { margin-right: var(--space-2); font-weight: var(--fw-semibold); color: var(--text-strong); }
.reader-foot { position: sticky; bottom: 0; z-index: var(--z-sticky, 10); padding: var(--space-5) var(--space-8); background: var(--card); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.reader-buttons { display: flex; gap: var(--space-4); flex-wrap: wrap; }
.reader-foot .says { margin-top: var(--space-4); }
.reader-foot .says:empty { margin-top: 0; }
.reader-none { padding: var(--space-7) var(--space-8) var(--space-8); }

/* a narrow window: the page first, History under it */
@media (max-width: 860px) {
  body.app { height: auto; display: block; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side, .beside { overflow-y: visible; }
  .side { order: 2; border-right: 0; border-top: 1px solid var(--border); padding-bottom: var(--space-10); }
  .reader-head, .lines, .reader-foot { padding-left: var(--space-6); padding-right: var(--space-6); }
  .line { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

/* ── sign in, make an account ───────────────────────────────────────────────── */
body.signin { min-height: 100vh; display: grid; place-items: center; background: var(--surface-subtle); padding: var(--space-7); }
.signin-card { width: min(100%, 440px); background: var(--card); border: 1px solid var(--border-faint, var(--border)); border-radius: var(--radius-lg); padding: var(--space-9) var(--space-8); box-shadow: var(--shadow-md); }
.signin-logo { height: 28px; margin-bottom: var(--space-6); }
.signin-card h1 { font-size: var(--fs-xl); font-weight: var(--fw-semibold); color: var(--text-strong); margin-bottom: var(--space-4); }
.signin-card .notice { margin-top: var(--space-5); }
.signin-form { display: grid; gap: var(--space-5); margin-top: var(--space-6); }
.signin-form .field + .field { margin-top: 0; }
.signin-form .btn { justify-self: start; min-width: 120px; }
.signin-other { margin-top: var(--space-7); font-size: var(--fs-base); }
