/* Inner Circle, "The Line": brand tokens and shared parts. Used by the member pages, later by admin. */
:root {
  --cobalt: #1C2BD0; --ink: #0A0E33; --porcelain: #F1F2EE; --mist: #D9DCF6; --shell: #FFD2BF;
  --soft: #3B4066; --line: #C9CCDA; --danger: #B3261E; --white: #FFFFFF; --wash: #E9EBF9;
  --serif: 'Newsreader', Georgia, serif; --sans: 'Instrument Sans', system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--porcelain); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--cobalt); text-underline-offset: 3px; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }
[hidden], .hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* type */
.serif { font-family: var(--serif); font-weight: 300; font-variant-numeric: lining-nums; }
.h1 { font-family: var(--serif); font-weight: 300; font-size: clamp(36px, 4vw, 48px); line-height: 1.05; letter-spacing: -.01em; }
.h2 { font-family: var(--serif); font-weight: 300; font-size: 26px; line-height: 1.15; }
.h3 { font-family: var(--serif); font-weight: 300; font-size: 22px; line-height: 1.2; }
.label { font-size: 13px; font-weight: 600; color: var(--ink); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.soft { color: var(--soft); }
.cobalt { color: var(--cobalt); }
.danger { color: var(--danger); }
.num { font-variant-numeric: tabular-nums lining-nums; }

/* surfaces */
.card { background: var(--white); border: 1px solid var(--line); border-radius: 6px; padding: 24px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card.flush { padding: 0; }
.panel { background: var(--cobalt); color: var(--white); border-radius: 6px; padding: 28px; }
.quote { background: var(--porcelain); border-left: 3px solid var(--cobalt); padding: 14px 18px; border-radius: 0 4px 4px 0; }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }
.list > * + * { border-top: 1px solid var(--line); }
.stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.row.top { align-items: flex-start; }
.spread { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

/* buttons and links */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 4px;
  border: 1px solid var(--cobalt); background: var(--cobalt); color: var(--white); font-weight: 600; font-size: 15px; text-decoration: none;
  transition: background .2s var(--ease), color .2s var(--ease); }
.btn:hover { background: #1522A8; border-color: #1522A8; }
.btn.line { background: transparent; color: var(--cobalt); }
.btn.line:hover { background: var(--wash); }
.btn.light { background: var(--white); color: var(--cobalt); border-color: var(--white); }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; font-size: 14px; padding: 0 12px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--cobalt); text-decoration: underline; text-underline-offset: 3px; font-weight: 500; cursor: pointer; }
.panel .link, .panel a { color: var(--white); }

/* pills and chips */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--wash); color: var(--cobalt); font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip.warn { background: #FBE9E7; color: var(--danger); }
.chip.plain { background: var(--porcelain); color: var(--soft); }
.source { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; color: var(--soft); background: var(--white); white-space: nowrap; }
a.source { text-decoration: none; }
a.source:hover { border-color: var(--cobalt); color: var(--cobalt); }

/* avatar: initials on shell, or a photo */
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--shell); color: var(--ink); display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* bars */
.bar { height: 6px; background: var(--mist); border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--cobalt); border-radius: 3px; }

/* switch */
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 13px; background: var(--line); transition: background .2s var(--ease); pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--white); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--cobalt); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--cobalt); outline-offset: 2px; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; }
.input, textarea.input { width: 100%; padding: 12px 14px; border: 1px solid var(--soft); border-radius: 4px; background: var(--white); font-size: 16px; }
textarea.input { min-height: 120px; resize: vertical; }
.choice-row { display: flex; gap: 8px; flex-wrap: wrap; }
.choice-row button { min-width: 44px; min-height: 44px; border: 1px solid var(--line); background: var(--white); border-radius: 4px; font-weight: 600; }
.choice-row button[aria-pressed="true"] { background: var(--cobalt); border-color: var(--cobalt); color: var(--white); }

/* sheet: a dialog on desk, a bottom sheet on phone */
.sheet-back { position: fixed; inset: 0; background: rgba(10, 14, 51, .45); z-index: 40; display: flex; align-items: center; justify-content: center; padding: 24px; }
.sheet { background: var(--white); border-radius: 8px; width: min(520px, 100%); max-height: 90vh; overflow: auto; padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.sheet .close { margin-left: auto; background: none; border: 0; font-size: 14px; color: var(--soft); text-decoration: underline; }
@media (max-width: 899px) {
  .sheet-back { align-items: flex-end; padding: 0; }
  .sheet { border-radius: 12px 12px 0 0; width: 100%; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); }
}

.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--white);
  padding: 12px 18px; border-radius: 6px; font-size: 14px; z-index: 50; max-width: calc(100% - 32px); }
.loading { padding: 64px 24px; text-align: center; color: var(--soft); }
.empty { padding: 20px; border: 1px dashed var(--line); border-radius: 6px; color: var(--soft); text-align: center; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
