/* Layout: a desk calendar. The next meeting is a tear-off leaf with its agenda and the last summary beside it; below, each month is a heading with its meeting days as small leaves. */
:root {
  --paper: #f3f5f8;
  --surface: #ffffff;
  --ink: #161922;
  --muted: #5a6070;
  --line: #d9dee7;
  --reherza: #9b2c6e;
  --tixverse: #0b7a70;
  --on-accent: #ffffff;
  --mark: #ffe48a;
  --danger: #b42318;
  --shadow: 0 1px 2px rgb(22 25 34 / 6%), 0 8px 24px rgb(22 25 34 / 8%);
  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --accent: var(--reherza);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1116; --surface: #181b23; --ink: #eceef3; --muted: #a0a7b6; --line: #2b303c;
    --reherza: #e889c0; --tixverse: #55cbbd; --on-accent: #12141a; --mark: #6e5d14; --danger: #ff8a7a;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 10px 28px rgb(0 0 0 / 35%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1116; --surface: #181b23; --ink: #eceef3; --muted: #a0a7b6; --line: #2b303c;
  --reherza: #e889c0; --tixverse: #55cbbd; --on-accent: #12141a; --mark: #6e5d14; --danger: #ff8a7a;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 10px 28px rgb(0 0 0 / 35%);
  color-scheme: dark;
}
body[data-startup="reherza"] { --accent: var(--reherza); }
body[data-startup="tixverse"] { --accent: var(--tixverse); }

* { box-sizing: border-box; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--f-display); line-height: 1.1; margin: 0; text-wrap: balance; }
mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 1px; }
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 16px; }
@media (min-width: 700px) { .wrap { padding-inline: 32px; } }

/* Header */
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding-block: 12px; }
.brand {
  font-family: var(--f-display); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none; margin-right: auto;
}
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.tab {
  border: 0; background: transparent; padding: 7px 16px; border-radius: 999px; cursor: pointer;
  font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 8px;
}
.tab .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.tab[data-startup="reherza"] .dot { background: var(--reherza); }
.tab[data-startup="tixverse"] .dot { background: var(--tixverse); }
.tab[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }
.tab[aria-selected="true"] .dot { background: var(--on-accent); }
.tools { display: flex; gap: 10px; align-items: center; }
.search {
  width: 220px; max-width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface);
}
.btn {
  border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 10px;
  cursor: pointer; font-weight: 600; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--muted); }
.btn.quiet:hover { color: var(--ink); }
.btn.danger { color: var(--danger); }
.btn[disabled] { opacity: .6; cursor: progress; }
@media (max-width: 720px) {
  .bar { gap: 10px; }
  .tabs { order: 3; width: 100%; }
  .tab { flex: 1; justify-content: center; }
  .tools { order: 4; width: 100%; }
  .search { flex: 1; width: auto; min-width: 0; }
}

main { padding-block: 28px 64px; display: grid; gap: 48px; }
.status {
  margin: 0; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted);
}

/* Up next sheet */
.sheet {
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow);
  padding: 24px; display: grid; gap: 28px;
  grid-template-columns: minmax(0, 1fr);
}
.sheet-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.leaf {
  width: 104px; flex: none; border-radius: 14px; overflow: hidden; text-align: center;
  border: 1px solid var(--line); background: var(--surface);
  font-variant-numeric: tabular-nums;
}
.leaf-month {
  display: block; background: var(--accent); color: var(--on-accent);
  font-weight: 700; font-size: .8rem; letter-spacing: .14em; padding: 5px 0; text-transform: uppercase;
}
.leaf-day { display: block; font-family: var(--f-display); font-weight: 800; font-size: 3.2rem; line-height: 1; padding-top: 8px; }
.leaf-week { display: block; font-size: .8rem; color: var(--muted); padding: 2px 0 10px; }
.leaf.unset .leaf-day { font-size: 2.2rem; padding-block: 14px 6px; color: var(--muted); }
.head-text { flex: 1; min-width: 0; }
.eyebrow {
  margin: 0 0 6px; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
}
.sheet h1 { font-size: clamp(1.6rem, 4.2vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; }
.rel { margin: 6px 0 0; color: var(--muted); font-weight: 500; }
.rel strong { color: var(--ink); }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 600px) { .sheet-head .head-actions { width: 100%; } .sheet-head .head-actions .btn { flex: 1; } }
.cols { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .cols { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 36px; } }
.panel h2 {
  font-size: 1.05rem; font-weight: 700; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px;
}
.panel h2 .when { font-family: var(--f-body); font-weight: 500; font-size: .9rem; color: var(--muted); }
.panel.agenda {
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  border-radius: 14px; padding: 18px 20px;
}
.panel.summary { padding: 18px 0 0; }
@media (min-width: 760px) { .panel.summary { padding: 18px 4px 0 0; } }
.prose { max-width: 65ch; overflow-wrap: anywhere; }
.prose p { margin: 0 0 .6em; }
.prose ul, .prose ol { margin: 0 0 .7em; padding-left: 1.25em; }
.prose li { margin: .3em 0; padding-left: .15em; }
.prose li::marker { color: var(--accent); font-weight: 700; }
.prose strong { font-weight: 700; color: var(--ink); }
.prose .sec {
  font-family: var(--f-display); font-size: 1.08em; font-weight: 700; letter-spacing: -0.005em;
  display: flex; align-items: center; gap: .55em; margin: 1.15em 0 .4em;
}
.prose .num {
  flex: none; width: 1.65em; height: 1.65em; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-family: var(--f-body); font-size: .78em; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.prose .sub {
  font-family: var(--f-body); font-size: .98em; font-weight: 700; color: var(--accent);
  letter-spacing: 0; text-transform: none; margin: 1em 0 .3em;
}
.prose .lead { font-weight: 600; margin-top: 1em; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.none { color: var(--muted); font-style: italic; margin: 0; }
.empty { display: grid; gap: 14px; justify-items: start; }
.empty h1 { font-size: clamp(1.5rem, 3.6vw, 2.2rem); }
.empty p { margin: 0; color: var(--muted); max-width: 52ch; }

/* Timeline */
.tl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.tl-head h2 { font-size: 1.35rem; font-weight: 700; }
.tl-count { color: var(--muted); font-size: .92rem; }
.month { padding-block: 22px 6px; }
.month + .month { border-top: 1px solid var(--line); }
.month-h {
  font-size: clamp(1.9rem, 5vw, 2.8rem); font-weight: 800; letter-spacing: -0.025em; margin-bottom: 16px;
}
.month-h .yr { color: var(--muted); font-weight: 500; }
.tiles { display: flex; flex-wrap: wrap; gap: 10px; }
.tile {
  width: 76px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  cursor: pointer; padding: 0 0 8px; overflow: hidden; text-align: center; position: relative;
  font-variant-numeric: tabular-nums; transition: transform .15s ease, border-color .15s ease;
}
.tile::before { content: ""; display: block; height: 6px; background: color-mix(in srgb, var(--accent) 35%, var(--surface)); }
.tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.t-day { display: block; font-family: var(--f-display); font-weight: 800; font-size: 1.9rem; line-height: 1.1; padding-top: 6px; }
.t-wk { display: block; font-size: .78rem; color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.tile[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.tile[aria-pressed="true"]::before { background: color-mix(in srgb, var(--on-accent) 30%, var(--accent)); }
.tile[aria-pressed="true"] .t-wk { color: inherit; }
.tile .latest {
  position: absolute; top: 9px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}
.tile[aria-pressed="true"] .latest { background: var(--on-accent); }
.detail {
  margin-top: 18px; padding: 20px 22px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
  display: grid; gap: 18px;
}
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.detail-head h3 { font-size: 1.3rem; font-weight: 700; }
.detail h4 {
  font-family: var(--f-body); font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px;
}
.detail .next-line { margin: 0 0 8px; font-weight: 600; }
.confirm {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: 10px;
  background: color-mix(in srgb, var(--danger) 9%, var(--surface));
}
.confirm p { margin: 0; margin-right: auto; font-weight: 600; }
.no-results { color: var(--muted); padding-block: 16px; margin: 0; }

/* Dialogs */
dialog {
  border: 0; border-radius: 18px; padding: 0; background: var(--surface); color: var(--ink);
  width: min(680px, calc(100% - 32px)); max-height: calc(100% - 32px); box-shadow: var(--shadow);
}
dialog::backdrop { background: rgb(10 12 18 / 55%); }
.form { display: grid; gap: 16px; padding: 24px; }
.form h2 { font-size: 1.4rem; font-weight: 800; }
.row { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 560px) { .row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-weight: 600; font-size: .92rem; }
.field .hint { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper);
}
.field textarea { resize: vertical; min-height: 140px; line-height: 1.5; }
.form-msg { margin: 0; padding: 10px 12px; border-radius: 10px; font-weight: 600; }
.form-msg.error { color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, var(--surface)); }
.form-msg.warn { background: color-mix(in srgb, var(--mark) 55%, var(--surface)); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

#present { width: min(1100px, calc(100% - 32px)); height: calc(100% - 32px); max-height: none; }
.present-inner { padding: clamp(24px, 5vw, 56px); display: grid; gap: 32px; }
.present-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.present-inner h1 { font-size: clamp(2rem, 5vw, 3.6rem); font-weight: 800; letter-spacing: -0.02em; }
.present-inner .cols { gap: 48px; }
.present-inner .prose { font-size: clamp(1.1rem, 1.8vw, 1.35rem); line-height: 1.6; }
.present-inner .panel h2 { font-size: 1.3rem; }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 999px; font-weight: 600;
  box-shadow: var(--shadow); z-index: 30;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } .tile:hover { transform: none; } }

/* Site header extras */
.signout { color: var(--muted); font-weight: 600; font-size: .92rem; text-decoration: none; white-space: nowrap; background: none; border: 0; padding: 6px 2px; cursor: pointer; }
.signout:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 720px) {
  .tools { order: 3; width: 100%; }
}

/* Home */
.home { display: grid; gap: 24px; }
.home-title { font-size: clamp(2rem, 6vw, 3.2rem); font-weight: 800; letter-spacing: -0.025em; }
.home-cards { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .home-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.home-card[data-startup="reherza"] { --accent: var(--reherza); }
.home-card[data-startup="tixverse"] { --accent: var(--tixverse); }
.home-card {
  display: grid; gap: 6px; padding: 26px 24px 22px; border-radius: 18px; background: var(--surface);
  box-shadow: var(--shadow); color: var(--ink); text-decoration: none; position: relative; overflow: hidden;
  border-top: 8px solid var(--accent); transition: transform .15s ease;
}
.home-card:hover { transform: translateY(-3px); }
.home-name { font-family: var(--f-display); font-weight: 800; font-size: clamp(1.8rem, 5vw, 2.4rem); letter-spacing: -0.02em; color: var(--accent); }
.home-next { font-weight: 600; font-size: 1.05rem; }
.home-role { color: var(--muted); font-size: .9rem; }
@media (prefers-reduced-motion: reduce) { .home-card:hover { transform: none; } }

/* Sign in */
.signin { display: grid; gap: 18px; justify-items: start; }
.signin-text { margin: 0; color: var(--muted); max-width: 52ch; font-size: 1.05rem; }
#gsi-button { min-height: 44px; }
