:root {
  color-scheme: light;
  --canvas: #f3f6f9;
  --sidebar: #141e2f;
  --surface: #fff;
  --ink: #1a273a;
  --muted: #526579;
  --line: #d5dfe8;
  --accent: #197b6e;
  --accent-light: #e3f3ef;
  --danger: #a42b36;
  font: 16px/1.55 system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
a { color: var(--accent); }
button, input, select { font: inherit; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; text-decoration: none; border: 1px solid transparent; border-radius: .7rem; padding: .6rem .95rem; min-height: 42px; font-weight: 650; cursor: pointer; white-space: nowrap; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #64ad9c; outline-offset: 3px; }
button:disabled { opacity: .55; cursor: default; }
.primary { color: white; background: var(--accent); }
.primary:hover:not(:disabled) { background: #104c40; }
.secondary { color: var(--accent); background: var(--accent-light); }
.quiet { color: var(--muted); border-color: var(--line); background: var(--surface); }
.danger { color: var(--danger); background: #fff0f1; }
.admin-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.admin-sidebar { background: var(--sidebar); color: #f1f4f8; padding: 26px 16px; align-self: start; min-height: 100vh; position: sticky; top: 0; }
.admin-sidebar .admin-brand { width: 100%; display: grid; place-items: center; gap: 1rem; text-align: center; font-size: 1.48rem; }
.admin-brand img { object-fit: contain; }
.admin-brand small { display: block; font-size: .52rem; letter-spacing: .26em; color: #b9cbd3; margin-top: .2rem; }
.admin-brand::after { content: ''; width: 22px; height: 2px; margin: .1rem auto .35rem; background: #74d8c5; }
.admin-sidebar nav { display: grid; gap: 10px; margin-top: 1.15rem; }
.admin-sidebar nav .button { width: 100%; min-height: 49px; text-align: center; background: #1c293b; color: #f1f4f8; }
.admin-sidebar nav .button:hover { background: #2b3b50; }
.admin-sidebar nav .button[aria-current="page"] { background: var(--accent); }
.dashboard { width: min(1250px, calc(100% - 3rem)); margin-inline: auto; }
.heading, .card-heading, .top-actions, .row { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.heading, .card-heading { justify-content: space-between; }
.wordmark { display: inline-flex; align-items: center; gap: .7rem; font-weight: 800; letter-spacing: .12em; text-decoration: none; color: inherit; }
.brand-symbol { width: 1.55rem; height: 1.55rem; border-radius: .4rem; background: radial-gradient(circle, #102f2a 1px, transparent 1.4px) 0 0/5px 5px, #8cdec5; transform: rotate(-10deg); }
.dashboard { padding-block: clamp(1.6rem, 4vw, 3.25rem); }
h1, h2, h3, p, dd { margin: 0; }
h1 { font-size: clamp(1.65rem, 3vw, 2.5rem); line-height: 1.2; letter-spacing: -.03em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
.heading p, small, .history p, .empty { color: var(--muted); }
.heading p { margin-top: .4rem; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-block: 1.6rem; }
.stats > div, .card, .entry-card { background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; box-shadow: 0 8px 22px #17263a0b; }
.stats > div { padding: 1rem 1.25rem; }
.stats dt { color: var(--muted); font-size: .875rem; }
.stats dd { font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 770; font-variant-numeric: tabular-nums; }
.stats dd small { font-size: .85rem; font-weight: 550; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, 300px); gap: 1.1rem; align-items: start; }
.card-heading, .form-card, .detail, .account-settings { padding: 1.1rem 1.25rem; }
.card-heading { border-bottom: 1px solid var(--line); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; text-align: left; font-variant-numeric: tabular-nums; }
td, th { padding: .8rem .9rem; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { padding-left: 1.25rem; }
thead th { color: var(--muted); font-weight: 650; white-space: nowrap; }
tbody tr:last-child > * { border-bottom: 0; }
tbody small { display: block; font-weight: 400; }
.person { overflow-wrap: anywhere; font-weight: 720; text-underline-offset: .2em; }
.state { display: inline-block; padding: .2rem .5rem; border-radius: 6px; white-space: nowrap; font-size: .78rem; background: #edf1f0; color: #3e5150; }
.state.on { background: var(--accent-light); color: var(--accent); }
.state.off { background: #fff0f1; color: var(--danger); }
.empty { padding: 1.4rem 1.25rem; }
.stack { display: grid; gap: .8rem; }
.form-card h2, .entry-card h1 { margin-bottom: .85rem; }
label { display: grid; gap: .35rem; font-size: .9rem; font-weight: 670; }
input, select { min-width: 0; width: 100%; color: var(--ink); background: var(--surface); border: 1px solid #becbd7; border-radius: .65rem; padding: .53rem .7rem; }
.detail, .account-settings { margin-top: 1.1rem; }
.detail .card-heading { padding: 0 0 1rem; }
.detail-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1.25rem; padding-top: .9rem; }
.detail-grid h3 { margin-bottom: .55rem; }
.history p { font-size: .85rem; }
.history ul { list-style: none; padding: 0; margin: .5rem 0; }
.history li { display: flex; justify-content: space-between; gap: .4rem; border-bottom: 1px solid var(--line); padding: .4rem 0; }
.history time { font-size: .85rem; color: var(--muted); }
.reset, .account-settings form { margin-top: 1rem; max-width: 340px; }
summary { cursor: pointer; font-weight: 700; }
.notice { background: var(--accent-light); color: var(--accent); border-radius: .65rem; margin-block: .75rem; padding: .65rem .9rem; }
.notice.error { color: var(--danger); background: #fff0f1; }
.entry { min-height: 100dvh; display: grid; place-items: center; padding: 1rem; }
.entry-card { width: min(100%, 410px); padding: clamp(1.3rem, 5vw, 2.05rem); }
.entry-card h1 { margin-top: 1.15rem; font-size: 1.85rem; }
@media (max-width: 780px) {
  .dashboard-grid, .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .admin-shell { grid-template-columns: minmax(0, 1fr); }
  .admin-sidebar { position: static; min-height: 0; padding: .75rem .9rem; }
  .admin-sidebar .admin-brand { width: auto; display: inline-flex; font-size: 1.16rem; gap: .6rem; text-align: left; }
  .admin-brand img { width: 40px; height: 40px; }
  .admin-brand::after { display: none; }
  .admin-sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: .7rem; }
  .admin-sidebar nav .button { font-size: .85rem; min-height: 41px; }
  .dashboard { width: calc(100% - 1.8rem); }
  .stats { gap: .55rem; }
  .stats > div { padding: .7rem .6rem; }
  .stats dt { font-size: .76rem; }
}
.entry-card { padding: 0; width: min(100%, 460px); overflow: hidden; }
.entry-brand { display: flex; align-items: center; gap: .8rem; padding: 1rem 1.55rem; color: #f1f4f8; background: var(--sidebar); font-weight: 800; letter-spacing: .14em; }
.entry-brand small { display: block; font-size: .55rem; letter-spacing: .23em; color: #b9cbd3; }
.entry-content { padding: 1.3rem 1.55rem 1.65rem; }
.entry-content h1 { margin-top: 0; }
.entry-intro, .invite-note { margin: .5rem 0 1rem; color: var(--muted); }
.invite-result, .invite-heading { margin-top: 1rem; }
.pending-invites { margin: .5rem 0 0; padding: 0; list-style: none; }
.pending-invites li { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; justify-content: space-between; padding-block: .45rem; border-bottom: 1px solid var(--line); font-size: .83rem; }

.access-note { color: var(--muted); font-size: .85rem; margin-bottom: .6rem; }
.pending-invites time { display: block; }

.accounts tbody small, .detail .card-heading > div { min-width: 0; overflow-wrap: anywhere; }

.remove-member { margin-top:1rem }
.remove-dialog { width:min(440px,calc(100% - 2rem));border:1px solid var(--line);border-radius:1rem;padding:1.25rem;color:var(--ink) }
.remove-dialog::backdrop { background:#141e2f88 }
.remove-dialog p { margin:.7rem 0 1rem;overflow-wrap:anywhere }
.remove-dialog .row { justify-content:flex-end }

.public-trial-share { margin:0 0 1.15rem;padding:0 0 1.15rem;border-bottom:1px solid var(--line) }
.public-trial-share h2 { margin:0 }
