/* ==========================================================================
   THE RETURN — private deal room
   Layered on top of site.css; inherits every token from it.
   ========================================================================== */

/* --- Login -------------------------------------------------------------- */

.auth-wrap {
  min-height: 100dvh;
  display: grid; place-items: center;
  padding: 40px var(--gut);
}

.auth-card {
  width: 100%; max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  padding: 34px 30px;
}
.auth-card h1 { font-size: 30px; margin-bottom: 8px; }

.field { display: block; margin-top: 18px; }
.field > span {
  display: block; margin-bottom: 7px;
  font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-dim);
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 13px;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: var(--r);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--green);
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-dim); }

.code-input {
  letter-spacing: .5em; text-align: center;
  font-size: 20px !important; font-weight: 600;
}

.notice {
  margin-top: 16px; padding: 11px 13px;
  border-radius: var(--r);
  font-size: 13px; line-height: 1.5;
  border: 1px solid var(--hairline);
  background: rgba(255,255,255,.03);
  color: var(--ink-mute);
}
.notice--err  { border-color: rgba(232,64,47,.42); background: rgba(232,64,47,.10); color: #ffb3aa; }
.notice--ok   { border-color: rgba(23,198,83,.42); background: rgba(23,198,83,.10); color: #8ef0b1; }

/* --- Room chrome -------------------------------------------------------- */

.room-top {
  position: sticky; top: 0; z-index: 40;
  background: rgba(11,11,16,.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.room-top__inner {
  display: flex; align-items: center; gap: 20px;
  height: 62px;
}
.room-top .wordmark { font-size: 17px; }

.room-nav { display: flex; gap: 4px; margin-left: 12px; flex-wrap: wrap; }
.room-nav button {
  background: none; border: 0; cursor: pointer;
  padding: 7px 13px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500; color: var(--ink-mute);
  transition: background .16s, color .16s;
}
.room-nav button:hover { color: var(--ink); background: rgba(255,255,255,.05); }
.room-nav button[aria-current="page"] { color: var(--ink); background: rgba(255,255,255,.08); }

.who {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 5px 12px 5px 6px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-size: 12px; color: var(--ink-mute);
  white-space: nowrap;
}
.who__dot {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--green-dim); color: var(--green);
  font-size: 10px; font-weight: 700; letter-spacing: 0;
}
.who b { color: var(--ink); font-weight: 600; }

.room-main { padding: 34px 0 90px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 22px;
}
.panel__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.panel__head h2 { font-size: clamp(20px, 2.2vw, 26px); }
.panel__head p  { font-size: 13px; color: var(--ink-mute); margin: 0; }

.module { margin-bottom: 26px; }
.module:last-child { margin-bottom: 0; }

/* --- Overview tiles ----------------------------------------------------- */

.stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
@media (max-width: 860px) { .stats { grid-template-columns: 1fr; } }

.stat {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 22px;
}
.stat__k {
  font-size: 11px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink-dim); margin-bottom: 12px;
}
.stat__v {
  font-family: var(--display); font-size: clamp(26px, 3.4vw, 40px);
  text-transform: uppercase; line-height: 1;
}
.stat__sub { font-size: 13px; color: var(--ink-mute); margin-top: 9px; }

.countdown { display: flex; gap: 18px; align-items: baseline; }
.countdown div { text-align: left; }
.countdown b {
  display: block;
  font-family: var(--display); font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 400; line-height: 1;
}
.countdown span {
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim);
}

/* --- Timeline ----------------------------------------------------------- */

.timeline { position: relative; padding-left: 34px; }
.timeline::before {
  content: ''; position: absolute; left: 10px; top: 6px; bottom: 6px;
  width: 2px; background: var(--hairline);
}

.ms { position: relative; padding-bottom: 22px; }
.ms:last-child { padding-bottom: 0; }

.ms__node {
  position: absolute; left: -34px; top: 1px;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg); border: 2px solid var(--hairline);
  font-size: 10px; line-height: 1; color: var(--ink-dim);
}
.ms--complete .ms__node { border-color: var(--green); color: var(--green); }
.ms--active   .ms__node { border-color: var(--gold);  color: var(--gold); }

.ms__head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.ms__head h3 { font-size: 18px; }
.ms__meta {
  display: flex; gap: 16px; flex-wrap: wrap;
  margin-top: 7px; font-size: 12.5px; color: var(--ink-mute);
}
.ms__meta b { color: var(--ink); font-weight: 600; }

.ms__body {
  margin-top: 12px;
  background: rgba(255,255,255,.022);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r);
  padding: 14px 16px;
}

.thread-toggle {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: var(--green);
}
.thread-toggle:hover { text-decoration: underline; }

/* --- Comments ----------------------------------------------------------- */

.comment { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--hairline-soft); }
.comment:first-child { border-top: 0; }

.avatar {
  flex: 0 0 auto;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--panel-2); border: 1px solid var(--hairline);
  font-size: 11px; font-weight: 700; color: var(--ink-mute);
}
.comment__head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.comment__head b { font-size: 13.5px; }
.comment__head time { font-size: 11.5px; color: var(--ink-dim); }
.comment__body { font-size: 14px; margin-top: 3px; white-space: pre-wrap; }

.role-tag {
  font-size: 9.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 3px;
  background: rgba(255,255,255,.06); color: var(--ink-dim);
}
.role-tag--family    { background: rgba(23,198,83,.14);  color: var(--green); }
.role-tag--host      { background: rgba(252,209,22,.14); color: var(--gold); }
.role-tag--broadcast { background: rgba(232,64,47,.14);  color: #ff8d80; }
.role-tag--admin     { background: rgba(255,255,255,.12); color: var(--ink); }

.comment-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--hairline-soft); }
.comment-form textarea { min-height: 66px; resize: vertical; }
.comment-form .row { justify-content: space-between; margin-top: 10px; gap: 12px; }

.empty {
  padding: 18px; text-align: center;
  font-size: 13px; color: var(--ink-dim);
}

/* --- Calendar ----------------------------------------------------------- */

.cal-layout { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,0.9fr); gap: 26px; }
@media (max-width: 900px) { .cal-layout { grid-template-columns: 1fr; } }

.cal { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cal th {
  padding: 0 0 10px;
  font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-dim); text-align: center;
}
.cal td {
  height: 62px; vertical-align: top;
  border: 1px solid var(--hairline-soft);
  padding: 5px 6px;
  font-size: 12px;
}
.cal td.out { color: var(--ink-dim); background: rgba(0,0,0,.22); }
.cal td.has { background: rgba(23,198,83,.07); }
.cal td.genna { background: rgba(252,209,22,.12); border-color: rgba(252,209,22,.4); }
.cal__n { font-weight: 600; }
.cal__ev {
  display: block; margin-top: 3px;
  font-size: 10px; line-height: 1.3; color: var(--ink-mute);
  overflow: hidden; text-overflow: ellipsis;
}
.cal__dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--green); margin-right: 4px; }
.cal__dot--genna { background: var(--gold); }

.datelist { display: flex; flex-direction: column; gap: 8px; }
.dateitem {
  display: grid; grid-template-columns: 54px minmax(0,1fr) auto;
  gap: 14px; align-items: center;
  padding: 12px 14px;
  background: rgba(255,255,255,.022);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r);
}
.dateitem__d { text-align: center; line-height: 1; }
.dateitem__d b { display: block; font-family: var(--display); font-size: 21px; font-weight: 400; }
.dateitem__d span { display: block; margin-top: 3px; font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); }
.dateitem strong { font-size: 14px; font-weight: 600; }
.dateitem em { display: block; font-style: normal; font-size: 12px; color: var(--ink-mute); }

/* --- Tables (budget, vault, activity) ----------------------------------- */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.data {
  width: 100%; border-collapse: collapse; min-width: 660px;
}
table.data th {
  text-align: left; padding: 0 14px 11px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .11em; text-transform: uppercase;
  color: var(--ink-dim);
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}
table.data td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--hairline-soft);
  font-size: 13.5px; vertical-align: top;
}
table.data tbody tr:hover { background: rgba(255,255,255,.022); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tfoot td {
  padding-top: 15px; font-weight: 700; font-size: 14px;
  border-bottom: 0; border-top: 1px solid var(--hairline);
}
table.data .cat b { display: block; font-weight: 600; }
table.data .cat span { display: block; font-size: 12px; color: var(--ink-mute); margin-top: 2px; }

.tbc { color: var(--ink-dim); font-style: italic; font-size: 12.5px; }

.locked {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--ink-dim);
}

/* --- Vault -------------------------------------------------------------- */

.doc { display: flex; align-items: center; gap: 14px; }
.doc__icon {
  flex: 0 0 auto; width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.05); color: var(--ink-mute);
}
.doc b { display: block; font-size: 13.5px; font-weight: 600; }
.doc span { display: block; font-size: 11.5px; color: var(--ink-dim); margin-top: 2px; }

/* --- Activity log ------------------------------------------------------- */

.log { display: flex; flex-direction: column; }
.logrow {
  display: grid; grid-template-columns: 150px minmax(0,1fr);
  gap: 16px; padding: 10px 0;
  border-bottom: 1px solid var(--hairline-soft);
  font-size: 13px;
}
.logrow:last-child { border-bottom: 0; }
.logrow time { color: var(--ink-dim); font-size: 12px; font-variant-numeric: tabular-nums; }
.logrow b { font-weight: 600; }
@media (max-width: 620px) {
  .logrow { grid-template-columns: 1fr; gap: 3px; }
}

/* --- Confidential furniture --------------------------------------------- */

.confbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 8px var(--gut);
  background: rgba(7,7,11,.94);
  border-top: 1px solid var(--hairline-soft);
  backdrop-filter: blur(8px);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 11px; color: var(--ink-dim);
}

.spinner {
  display: none;
  width: 13px; height: 13px;
  border: 2px solid var(--hairline); border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.htmx-request .spinner, .spinner.htmx-request { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
