/* Visual language of the Together OS mockup (Deals pane):
 * cream #FBF4ED, card #FFFDFC, ink #180A2B, accent #B53B36,
 * hairlines #EAE3DD / #D8D0C9, tan hover #F6E9DC,
 * Playfair Display for headlines, Inter for everything else. */

:root {
  --cream: #FBF4ED;
  --card: #FFFDFC;
  --ink: #180A2B;
  --accent: #B53B36;
  --accent-dark: #9E322E;
  --hairline: #EAE3DD;
  --hairline-strong: #D8D0C9;
  --tan: #F6E9DC;
  --muted: #827982;
  --dim: #625866;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  background: var(--cream);
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }

.boot { padding: 60px; text-align: center; color: var(--muted); font-size: 13px; }

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

.topbar {
  height: 52px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
}
.topbar img { height: 16px; width: auto; display: block; }
.topbar .who {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.topbar .who .label { color: var(--muted); }
.topbar .who .email { font-weight: 500; color: var(--ink); }
.initials {
  width: 24px; height: 24px; border-radius: 999px;
  background: var(--tan); color: var(--ink);
  font-size: 9px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
  text-transform: uppercase;
}
.signout {
  background: none; border: none; cursor: pointer;
  font-size: 12px; color: var(--accent); padding: 4px 6px;
}
.signout:hover { text-decoration: underline; }

.main { max-width: 1120px; margin: 0 auto; padding: 30px 28px 60px; }

/* ---- backend banner ---- */

.banner {
  display: flex; align-items: baseline; gap: 10px;
  background: #FDF1F0;
  border: 1px solid #EACBC9;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 22px;
  font-size: 13px;
  color: var(--ink);
}
.banner .status { font-size: 11px; color: var(--dim); font-family: ui-monospace, 'SF Mono', Menlo, monospace; }
.banner .retry { margin-left: auto; background: none; border: none; color: var(--accent); font-size: 12px; cursor: pointer; }
.banner .retry:hover { text-decoration: underline; }

/* Staleness (not an error): the feed is serving the last-known-good snapshot
 * because the live filestore link has missed its sync window. */
.banner.stale {
  background: #FBF2E2;
  border-color: #EBD9B8;
  border-left-color: #C08A2D;
}

/* ---- feed header ---- */

.feed-head { display: flex; align-items: flex-start; gap: 24px; }
.headline {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 400; font-size: 34px; line-height: 1.15; color: var(--ink);
}
.subline { margin-top: 9px; font-size: 13px; color: var(--muted); }

/* ---- stage strip ---- */

.strip-label {
  margin-top: 24px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}
.stage-strip { display: flex; gap: 0; margin-top: 14px; align-items: flex-end; }
.stage-stat { flex: 1; min-width: 130px; display: flex; flex-direction: column; }
.stage-stat .n { font-size: 34px; line-height: 1; color: var(--ink); }
.stage-stat .name {
  margin-top: 7px; font-size: 11px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.stage-stat .rule { margin-top: 14px; height: 2px; background: var(--hairline-strong); position: relative; }
.stage-stat .rule .dot {
  position: absolute; left: 0; top: -3px; width: 8px; height: 8px;
  border-radius: 999px; background: var(--accent);
}

/* ---- deals table ---- */

.deals-card {
  margin-top: 26px;
  background: var(--card);
  border: 1px solid var(--hairline-strong);
  border-radius: 6px;
  overflow: hidden;
}
.deals-card .card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 18px; border-bottom: 1px solid var(--hairline);
}
.card-title {
  font-size: 11px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}
.card-hint { margin-left: auto; font-size: 11px; color: var(--muted); }

/* Deterministic columns: fixed/minmax tracks, and min-width: 0 on every cell
 * so long content clamps with an ellipsis instead of stretching its column
 * off the card (grid items default to min-width: auto, which is what let the
 * one-liners spill). No cell ever forces horizontal scroll. */
.deal-row {
  display: grid;
  grid-template-columns: minmax(148px, 1.1fr) 86px minmax(0, 2.3fr) minmax(96px, 0.7fr) minmax(148px, 0.85fr);
  column-gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
  align-items: center;
  width: 100%;
  background: none; border-left: none; border-right: none; border-top: none;
  text-align: left;
  font-size: 13px;
  color: var(--ink);
}
.deal-row > * { min-width: 0; }
.deal-row:hover { background: var(--cream); }
.deal-row .co { display: flex; align-items: center; gap: 8px; }
.deal-row .co .name {
  font-size: 13px; font-weight: 500; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.badge {
  font-size: 10px; color: var(--dim);
  border: 1px solid var(--hairline); background: var(--cream);
  border-radius: 3px; padding: 1px 5px; white-space: nowrap; flex: none;
}
.badge.seed { color: var(--accent); border-color: #EACBC9; background: #FDF1F0; }
.deal-row .stage { font-size: 13px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal-row .read { display: flex; flex-direction: column; gap: 2px; }
.deal-row .read .line { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal-row .read .next { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal-row .owner { display: flex; align-items: center; gap: 7px; }
.deal-row .owner .pill {
  width: 20px; height: 20px; border-radius: 999px; background: var(--tan);
  font-size: 8px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  text-transform: uppercase;
}
.deal-row .owner .who { font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal-row .touch { display: flex; align-items: center; gap: 7px; }
.deal-row .touch .date { font-size: 12px; color: var(--dim); white-space: nowrap; flex: none; }
.chip {
  font-size: 10px; color: var(--dim);
  border: 1px dashed var(--hairline-strong);
  border-radius: 3px; padding: 1px 5px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.deals-empty { padding: 28px 18px; font-size: 13px; color: var(--muted); }
.deals-foot { padding: 11px 18px; font-size: 12px; color: var(--muted); }

/* ---- deal detail ---- */

.back {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--accent);
  background: none; border: none; cursor: pointer; padding: 0;
}
.back:hover { text-decoration: underline; }

.detail-title { margin-top: 14px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.detail-title .name {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 400; font-size: 32px; line-height: 1.1; color: var(--ink);
}
.stage-pill {
  display: inline-flex; font-size: 11px; font-weight: 500; color: var(--ink);
  background: var(--tan); border-radius: 4px; padding: 3px 8px;
}
.meta-chip {
  display: inline-flex; gap: 4px; font-size: 11px; color: var(--dim);
  border: 1px dashed var(--hairline-strong); border-radius: 4px; padding: 2px 7px;
}
.detail-owner { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--dim); }

.detail-grid {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px;
  margin-top: 24px; align-items: start;
}
@media (max-width: 860px) {
  .detail-grid { grid-template-columns: 1fr; }
  .stage-stat { min-width: 90px; }
  .deal-row { grid-template-columns: minmax(120px, 1.2fr) minmax(0, 1.8fr) minmax(120px, 0.9fr); }
  .deal-row .stage, .deal-row .owner { display: none; }
}

.panel {
  background: var(--card);
  border: 1px solid var(--hairline-strong);
  border-radius: 6px;
  overflow: hidden;
}
.panel + .panel { margin-top: 16px; }
.panel .panel-head { padding: 11px 18px; border-bottom: 1px solid var(--hairline); }
.panel .panel-body { padding: 15px 18px; display: flex; flex-direction: column; gap: 10px; }
.one-liner { font-size: 14px; color: var(--ink); line-height: 1.6; text-wrap: pretty; }

.fact-row { display: flex; align-items: baseline; gap: 10px; font-size: 13px; }
.fact-row .k {
  width: 88px; flex: none;
  font-size: 11px; font-weight: 500; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
}
.fact-row .v { color: var(--ink); }

.file-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 18px; border-bottom: 1px solid var(--hairline);
  font-size: 13px;
}
.file-row:last-child { border-bottom: none; }
.file-row .fname { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .fsize { margin-left: auto; font-size: 11px; color: var(--muted); font-family: ui-monospace, 'SF Mono', Menlo, monospace; white-space: nowrap; }
.file-row.unsaved .fname { color: var(--muted); }

.next-step { padding: 12px 18px; background: var(--tan); display: flex; flex-direction: column; gap: 5px; }
.next-step .label {
  font-size: 11px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}
.next-step .what { font-size: 13px; color: var(--ink); line-height: 1.5; }

.classification { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ---- sign-in / denied ---- */

.gate {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--cream);
  padding: 24px;
}
.gate-card {
  width: 400px; max-width: 100%;
  background: var(--card);
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  padding: 40px 36px 36px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  text-align: center;
}
.gate-card img { height: 22px; margin-bottom: 6px; }
.gate-card h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 400; font-size: 28px; color: var(--ink);
}
.gate-card p { font-size: 13px; color: var(--muted); line-height: 1.6; }
.gate-error { font-size: 12px; color: var(--accent); }
.gsi-slot { min-height: 44px; display: flex; align-items: center; justify-content: center; }

.denied-email {
  font-size: 13px; font-weight: 500; color: var(--ink);
  border: 1px dashed var(--hairline-strong); border-radius: 4px; padding: 3px 10px;
}

.test-signin { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.test-signin input {
  font-family: inherit; font-size: 13px; color: var(--ink);
  border: 1px solid var(--hairline-strong); border-radius: 5px;
  padding: 8px 10px; background: #FFFFFF; width: 100%;
}
.test-signin button {
  font-size: 13px; font-weight: 500; color: #FFFFFF;
  background: var(--accent); border: none; border-radius: 5px;
  padding: 9px 12px; cursor: pointer;
}
.test-signin button:hover { background: var(--accent-dark); }
.test-note { font-size: 10px; color: var(--muted); }
