/* The Forum — design tokens
   Paper #F5F3EC · Ink #1B231F · Forest #2F6B4F · Brass #A9812F · Linen #E3DFD2 · Claret #8E3B2F */

:root {
  --paper: #F5F3EC;
  --paper-raised: #FDFCF8;
  --ink: #1B231F;
  --ink-soft: #4C554F;
  --ink-faint: #8B9089;
  --forest: #2F6B4F;
  --forest-deep: #24523C;
  --brass: #A9812F;
  --brass-soft: #C9A45A;
  --linen: #E3DFD2;
  --claret: #8E3B2F;
  --claret-soft: #F3E2DE;
  --sage: #E8EEE7;
  --shadow: 0 1px 2px rgba(27,35,31,.06), 0 8px 24px -12px rgba(27,35,31,.18);
  --radius: 14px;
  --display: "Fraunces", Georgia, serif;
  --body: "Public Sans", -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  font-size: 15.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 4px; }

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

/* ============ THE GATE (login) ============ */

.gate {
  min-height: 100dvh;
  background:
    radial-gradient(120% 90% at 50% -10%, #2A3630 0%, var(--ink) 58%);
  color: #EDEAE0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 24px calc(32px + var(--safe-b));
  text-align: center;
}
.gate-plate {
  width: 64px; height: 64px; border-radius: 50%;
  border: 1px solid rgba(201,164,90,.55);
  display: grid; place-items: center;
  margin-bottom: 22px;
  background: radial-gradient(circle at 32% 28%, rgba(201,164,90,.28), rgba(201,164,90,.06) 70%);
}
.gate-plate svg { display: block; }
.gate h1 {
  font-family: var(--display);
  font-weight: 400; font-size: 34px; letter-spacing: .01em;
  color: #F3F0E6;
}
.gate .gate-sub {
  color: #9FA79F; font-size: 13.5px; letter-spacing: .14em; text-transform: uppercase;
  margin: 10px 0 36px;
}
.gate-step { width: 100%; max-width: 360px; animation: rise .45s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.gate input.code {
  width: 100%;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(237,234,224,.22);
  border-radius: 12px;
  color: #F3F0E6;
  font-family: var(--mono); font-size: 15px; letter-spacing: .06em;
  padding: 15px 16px; text-align: center;
}
.gate input.code::placeholder { color: #767E76; letter-spacing: .02em; font-family: var(--body); }
.gate input.code:focus { border-color: var(--brass-soft); outline: none; }

.btn-gate {
  width: 100%; margin-top: 14px;
  background: var(--brass);
  color: #171A16; font-weight: 600; font-size: 15px;
  border-radius: 12px; padding: 14px;
  transition: background .15s;
}
.btn-gate:hover { background: var(--brass-soft); }
.btn-gate:disabled { opacity: .4; cursor: default; }

.gate-error { color: #E4A08F; font-size: 13.5px; margin-top: 12px; min-height: 20px; }
.gate-hint { color: #767E76; font-size: 12.5px; margin-top: 26px; }

/* roster of name cards */
.roster { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.roster .card-m {
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(237,234,224,.14);
  border-radius: 12px;
  padding: 16px 10px 13px;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  transition: border-color .15s, background .15s, transform .1s;
}
.roster .card-m:hover { border-color: rgba(201,164,90,.6); background: rgba(255,255,255,.08); }
.roster .card-m:active { transform: scale(.97); }
.roster .card-m .name { font-family: var(--display); font-size: 16.5px; font-weight: 500; color: #F3F0E6; line-height: 1.15; }
.roster .card-m .role { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--brass-soft); }

.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-weight: 600; font-size: 14px;
  flex: none;
}

/* PIN pad */
.pin-who { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 22px; }
.pin-who .name { font-family: var(--display); font-size: 22px; color: #F3F0E6; }
.pin-who .role { font-size: 11px; letter-spacing: .13em; text-transform: uppercase; color: var(--brass-soft); }
.pin-dots { display: flex; gap: 14px; justify-content: center; margin: 6px 0 24px; }
.pin-dots span {
  width: 13px; height: 13px; border-radius: 50%;
  border: 1.5px solid rgba(237,234,224,.4);
  transition: background .12s, border-color .12s;
}
.pin-dots span.on { background: var(--brass-soft); border-color: var(--brass-soft); }
.pin-dots.shake { animation: shake .4s; }
@keyframes shake { 20%,60% { transform: translateX(-7px);} 40%,80% { transform: translateX(7px);} }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 270px; margin: 0 auto; }
.keypad button {
  height: 62px; border-radius: 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(237,234,224,.12);
  font-size: 22px; font-weight: 500; color: #F3F0E6;
  transition: background .1s;
}
.keypad button:active { background: rgba(201,164,90,.3); }
.keypad button.ghost { background: none; border: 0; font-size: 14px; color: #9FA79F; }
.gate-back { margin-top: 22px; color: #9FA79F; font-size: 13.5px; }
.gate-back:hover { color: #EDEAE0; }

/* ============ APP SHELL ============ */

.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(245,243,236,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--linen);
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; }
.topbar .brand .mark { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--brass); display: grid; place-items: center; }
.topbar .brand .t { font-family: var(--display); font-size: 18px; font-weight: 500; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.iconbtn { position: relative; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-soft); }
.iconbtn:hover { background: var(--sage); }
.iconbtn .badge {
  position: absolute; top: 4px; right: 4px;
  min-width: 16px; height: 16px; border-radius: 8px;
  background: var(--claret); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; padding: 0 4px;
}

.main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 20px 18px calc(86px + var(--safe-b)); }

/* bottom tabs */
.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  background: rgba(253,252,248,.95); backdrop-filter: blur(10px);
  border-top: 1px solid var(--linen);
  display: flex; justify-content: space-around;
  padding: 6px 8px calc(6px + var(--safe-b));
}
.tabs button {
  flex: 1; max-width: 130px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 0 4px; border-radius: 10px;
  color: var(--ink-faint); font-size: 10.5px; font-weight: 600; letter-spacing: .04em;
}
.tabs button svg { opacity: .75; }
.tabs button.on { color: var(--forest-deep); }
.tabs button.on svg { opacity: 1; }

/* ============ COMMON ============ */

.card {
  background: var(--paper-raised);
  border: 1px solid var(--linen);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--brass); margin-bottom: 8px;
}
h2.section {
  font-family: var(--display); font-weight: 500; font-size: 21px;
  margin: 26px 0 12px;
}
h2.section:first-child { margin-top: 0; }
.muted { color: var(--ink-soft); font-size: 13.5px; }
.tiny { font-size: 12px; color: var(--ink-faint); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--forest); color: #fff;
  font-weight: 600; font-size: 14.5px;
  border-radius: 11px; padding: 12px 18px;
  transition: background .15s;
}
.btn:hover { background: var(--forest-deep); }
.btn.secondary { background: transparent; color: var(--forest-deep); border: 1.5px solid var(--forest); }
.btn.secondary:hover { background: var(--sage); }
.btn.danger { background: transparent; color: var(--claret); border: 1.5px solid var(--claret); }
.btn.danger:hover { background: var(--claret-soft); }
.btn.small { padding: 8px 13px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

input.field, select.field, textarea.field {
  width: 100%;
  background: #fff; border: 1px solid var(--linen); border-radius: 10px;
  padding: 11px 12px; font-size: 15px;
}
input.field:focus, select.field:focus, textarea.field:focus { border-color: var(--forest); outline: none; }
label.lbl { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin: 12px 0 5px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(92px + var(--safe-b)); transform: translateX(-50%);
  background: var(--ink); color: #F3F0E6;
  padding: 11px 20px; border-radius: 100px;
  font-size: 14px; font-weight: 500;
  box-shadow: 0 10px 30px -8px rgba(27,35,31,.45);
  z-index: 100; white-space: nowrap;
  animation: rise .3s ease both;
}

/* sheet (modal) */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet-wrap .scrim { position: absolute; inset: 0; background: rgba(27,35,31,.45); animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: relative; width: 100%; max-width: 560px;
  max-height: 88dvh; overflow-y: auto;
  background: var(--paper-raised);
  border-radius: 20px 20px 0 0;
  padding: 10px 20px calc(26px + var(--safe-b));
  animation: up .28s cubic-bezier(.2,.9,.3,1) both;
}
@keyframes up { from { transform: translateY(60px); opacity: .4; } }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--linen); margin: 6px auto 14px; }
.sheet h3 { font-family: var(--display); font-weight: 500; font-size: 20px; margin-bottom: 4px; }
@media (min-width: 640px) {
  .sheet-wrap { align-items: center; padding: 24px; }
  .sheet { border-radius: 20px; }
}

/* ============ TODAY ============ */

.hero {
  background: linear-gradient(160deg, #223A2E 0%, var(--ink) 90%);
  color: #EFEDE3;
  border-radius: 18px;
  padding: 26px 22px 22px;
  margin-bottom: 18px;
  box-shadow: 0 14px 34px -14px rgba(27,35,31,.5);
  position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; top: -40px; right: -40px;
  width: 170px; height: 170px; border-radius: 50%;
  border: 1px solid rgba(201,164,90,.25);
}
.hero::before {
  content: ""; position: absolute; top: -10px; right: 20px;
  width: 170px; height: 170px; border-radius: 50%;
  border: 1px solid rgba(201,164,90,.13);
}
.hero .eyebrow { color: var(--brass-soft); }
.hero .big-date {
  font-family: var(--display); font-weight: 300; font-size: 44px; line-height: 1.05;
  letter-spacing: -.01em; margin: 2px 0 4px;
}
.hero .big-date .yr { color: #93A296; }
.hero .count { color: #B9C2B8; font-size: 14px; }
.hero .count b { color: var(--brass-soft); font-weight: 600; }
.hero .lock-tag {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 14px; padding: 5px 11px;
  border: 1px solid rgba(201,164,90,.4); border-radius: 100px;
  color: var(--brass-soft); font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
}

.dayline { margin-top: 16px; border-top: 1px solid rgba(237,234,224,.14); padding-top: 14px; display: grid; gap: 9px; }
.dayline .slot { display: flex; gap: 12px; align-items: baseline; font-size: 14px; }
.dayline .slot .t { font-family: var(--mono); font-size: 12.5px; color: var(--brass-soft); width: 46px; flex: none; }
.dayline .slot .what { color: #D8DCD2; }
.dayline .slot .opt { color: #8D978D; font-size: 12px; }

.pending { border-left: 3px solid var(--brass); }
.pending .who-row { display: flex; margin: 10px 0 4px; }
.pending .who-row .avatar { width: 30px; height: 30px; font-size: 11.5px; margin-right: -7px; border: 2px solid var(--paper-raised); }
.pending .who-row .avatar.dim { opacity: .25; }

.notif { display: flex; gap: 12px; padding: 13px 2px; border-bottom: 1px solid var(--linen); }
.notif:last-child { border-bottom: 0; }
.notif .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brass); margin-top: 7px; flex: none; }
.notif.read .dot { background: var(--linen); }
.notif .txt { font-size: 14px; }
.notif .when { font-size: 11.5px; color: var(--ink-faint); margin-top: 2px; }

/* ============ CALENDAR ============ */

.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head .m { font-family: var(--display); font-size: 22px; font-weight: 500; }
.cal-nav { display: flex; gap: 4px; }
.cal-nav button { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-soft); border: 1px solid var(--linen); background: var(--paper-raised); }
.cal-nav button:hover { background: var(--sage); }

.cal { background: var(--paper-raised); border: 1px solid var(--linen); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.cal .wd { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--linen); }
.cal .wd span { text-align: center; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; color: var(--ink-faint); padding: 9px 0 7px; }
.cal .grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal .day {
  aspect-ratio: 1 / 1.12;
  border-top: 1px solid #EFECE2; border-left: 1px solid #EFECE2;
  padding: 5px 4px 3px;
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 13px;
  background: none; border-radius: 0;
}
.cal .day:nth-child(7n+1) { border-left: 0; }
.cal .day.out { color: #C9C7BC; }
.cal .day.window { background: #F0F3EC; }
.cal .day .n { line-height: 1.4; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.cal .day.today .n { border: 1.5px solid var(--brass); font-weight: 700; }
.cal .day.meet .n { background: var(--forest); color: #fff; font-weight: 700; }
.cal .day.proposed .n { background: none; border: 1.5px dashed var(--forest); color: var(--forest-deep); font-weight: 700; }
.cal .day .marks { display: flex; gap: 2.5px; flex-wrap: wrap; justify-content: center; max-width: 34px; }
.cal .day .marks i { width: 5px; height: 5px; border-radius: 50%; }
.cal .day .hol { position: absolute; bottom: 3px; left: 20%; right: 20%; height: 2.5px; border-radius: 2px; background: var(--brass-soft); }
.cal .day .hol.school { background: repeating-linear-gradient(90deg, var(--brass-soft) 0 3px, transparent 3px 6px); }

.legend { display: flex; flex-wrap: wrap; gap: 12px 16px; margin-top: 12px; font-size: 12px; color: var(--ink-soft); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.legend i.sq { border-radius: 2px; height: 3px; width: 14px; }

/* ============ PLAN (the loom) ============ */

.window-note { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.window-note .range { font-family: var(--display); font-size: 19px; font-weight: 500; }

.loom-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -18px; padding: 0 18px; }
.loom { border-collapse: collapse; }
.loom th.member-th {
  position: sticky; left: 0; background: var(--paper-raised);
  text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-soft);
  padding: 0 10px 0 2px; white-space: nowrap;
  z-index: 2;
}
.loom th.member-th .avatar { width: 24px; height: 24px; font-size: 9.5px; display: inline-grid; vertical-align: middle; margin-right: 7px; }
.loom td { padding: 0; }
.loom .cell { width: 26px; height: 34px; display: grid; place-items: center; }
.loom .thread { width: 100%; height: 3px; border-radius: 2px; }
.loom .cell .gap { width: 16px; height: 16px; border-radius: 5px; display: grid; place-items: center; }
.loom thead .dhead {
  font-size: 10px; color: var(--ink-faint); font-weight: 600; text-align: center;
  padding-bottom: 6px; white-space: nowrap;
}
.loom thead .dhead.free { color: var(--forest-deep); }
.loom thead .dhead .dn { font-size: 12.5px; display: block; }
.loom tfoot .foot { text-align: center; padding-top: 6px; }
.loom tfoot .foot .cand { width: 7px; height: 7px; border-radius: 50%; background: var(--forest); display: inline-block; }
.loom col.candidate { background: #EDF3EC; }
.loom col.weekend { background: #FAF8F1; }

.best-dates { display: grid; gap: 10px; margin-top: 16px; }
.best-date {
  display: flex; align-items: center; gap: 13px;
  background: var(--paper-raised); border: 1px solid var(--linen); border-radius: 12px;
  padding: 12px 14px;
}
.best-date .d {
  font-family: var(--display); font-size: 20px; font-weight: 500; line-height: 1;
  width: 52px; text-align: center; flex: none;
}
.best-date .d small { display: block; font-family: var(--body); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin-top: 3px; }
.best-date .info { flex: 1; min-width: 0; }
.best-date .info .free { font-size: 13px; font-weight: 600; color: var(--forest-deep); }
.best-date .info .fl { font-size: 11.5px; color: var(--ink-faint); }
.vote-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--linen); border-radius: 100px;
  padding: 7px 13px; font-size: 13px; font-weight: 600; color: var(--ink-soft);
}
.vote-btn.on { border-color: var(--brass); color: var(--brass); background: #FBF6EA; }

.pref-days { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 8px; }
.pref-days button {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1.5px solid var(--linen); background: var(--paper-raised);
  font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
}
.pref-days button.on { background: var(--forest); border-color: var(--forest); color: #fff; }

.blockout-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--linen); }
.blockout-row:last-child { border-bottom: 0; }
.blockout-row .bar { width: 4px; align-self: stretch; border-radius: 2px; }
.blockout-row .dates { font-weight: 600; font-size: 14px; }
.blockout-row .why { font-size: 12.5px; color: var(--ink-soft); }
.blockout-row .del { margin-left: auto; color: var(--claret); font-size: 12.5px; font-weight: 600; padding: 6px; }

/* ============ MORE / ADMIN ============ */

.me-card { display: flex; align-items: center; gap: 14px; }
.me-card .name { font-family: var(--display); font-size: 20px; font-weight: 500; }
.member-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--linen); }
.member-row:last-child { border-bottom: 0; }
.member-row .r { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--brass); font-weight: 700; }
.member-row .loc { margin-left: auto; font-size: 12px; color: var(--ink-faint); }

.agenda-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--linen); align-items: baseline; }
.agenda-item:last-child { border-bottom: 0; }
.agenda-item .t { font-family: var(--mono); font-size: 12.5px; color: var(--brass); width: 48px; flex: none; }
.agenda-item .lead { font-size: 12px; color: var(--ink-faint); margin-left: auto; white-space: nowrap; }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--linen); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--ink-soft); }
.kv .v { font-weight: 600; text-align: right; }
.kv .v.mono { font-family: var(--mono); font-size: 12.5px; word-break: break-all; }

.seg { display: flex; background: var(--sage); border-radius: 10px; padding: 3px; margin: 10px 0; }
.seg button { flex: 1; padding: 8px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.seg button.on { background: var(--paper-raised); color: var(--ink); box-shadow: var(--shadow); }

.hol-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--linen); font-size: 13.5px; }
.hol-row:last-child { border-bottom: 0; }
.hol-row .flag { font-size: 15px; }
.hol-row .d { color: var(--ink-soft); font-size: 12.5px; }
.hol-row .del { margin-left: auto; color: var(--claret); font-size: 12px; font-weight: 600; padding: 6px; }

.empty { text-align: center; padding: 26px 16px; color: var(--ink-faint); font-size: 14px; }
.empty .art { font-family: var(--display); font-size: 26px; color: var(--linen); display: block; margin-bottom: 6px; }
