/* Dad Agent: look-only prototype. Warm, minimal, thin lines, gentle.
   Type scale, on purpose: one heading size (24) and one text size (16). Weight and color do the rest.
   Palette: the "gentle" option Steve picked on 2026-11-14 (lighter background, softer brown for what's selected). */

:root {
  --bg: #FAF7F2;          /* light rice paper */
  --paper: #FFFEFB;       /* overlay and input surface */
  --tan: #EEE5D8;         /* hover and your messages */
  --line: #E5DCCF;        /* thin rules */
  --line-strong: #CDBFAA; /* outlines that should read */
  --ink: #2A231C;         /* text */
  --ink-2: #54493D;
  --muted: #8A7D6E;
  --walnut: #7A4F33;
  --on: #6B5847;          /* selected pill, send button: a softer brown */

  --font: "Manrope", system-ui, sans-serif;
  --h: 24px;   /* every heading */
  --t: 16px;   /* everything else */
  --top: 78px; /* the heading row, shared by the left column and the bar across the top */
  --under: 18px; /* space between that row and the first pill, on both sides */
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 500;
  font-size: var(--t);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
input { font: inherit; color: inherit; }

.app {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr) 320px;
  grid-template-rows: var(--top) minmax(0, 1fr);
  height: 100vh;
}
.left { grid-column: 1; grid-row: 1 / 3; }
/* one line under the heading, from the left column to the right edge of the screen */
.topbar {
  grid-column: 2 / 4; grid-row: 1;
  display: flex; align-items: center;
  padding: 0 48px;
  border-bottom: 1px solid var(--line);
}
.center { grid-column: 2; grid-row: 2; }
.right { grid-column: 3; grid-row: 2; }

.head {
  font-size: var(--h);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
}
.sub { font-size: var(--t); font-weight: 800; margin: 0 4px 8px; }
.muted { color: var(--muted); }
.divider { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

/* ---------- pills: one size, both sides ---------- */
.pill {
  display: block;
  width: 100%;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 26px;          /* round ends on one line; a soft box if a long name wraps */
  font-size: var(--t);
  font-weight: 600;
  line-height: 1.6;
  text-align: left;
  overflow-wrap: anywhere;
  transition: background .15s, border-color .15s;
}
.pill:hover { background: var(--tan); border-color: var(--line-strong); }
.pill.is-on { background: var(--on); border-color: var(--on); color: var(--paper); }
.pill.dashed { border: 1.5px dashed var(--line-strong); color: var(--ink-2); }
.pill.dashed:hover { background: transparent; border-color: var(--walnut); color: var(--ink); }
.pill-input {
  width: 100%;
  padding: 11px 18px;
  border: 1.5px solid var(--walnut);
  border-radius: 999px;
  background: var(--paper);
  font-size: var(--t);
  font-weight: 600;
  outline: none;
}

/* ---------- left ---------- */
.left {
  border-right: 1px solid var(--line);
  padding: 0 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}
.left .head { height: var(--top); display: flex; align-items: center; flex: none; margin: 0 4px calc(var(--under) - 10px); }
.left .divider { margin: 8px 0; }
.left .add { margin-top: 8px; }

/* ---------- center ---------- */
.center { display: flex; flex-direction: column; min-height: 0; }

.thread { flex: 1; overflow-y: auto; padding: 32px 48px 24px; }
.thread-inner { max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.msg-you {
  align-self: flex-end;
  max-width: 78%;
  background: var(--tan);
  padding: 12px 18px;
  border-radius: 20px 20px 6px 20px;
}
.msg-jeeves { max-width: 90%; }
.msg-who { align-self: flex-end; font-size: 14px; font-weight: 600; color: var(--muted); margin: 0 6px -16px 0; } /* "Steve" over his messages */
.msg-jeeves p { margin: 0 0 10px; }
.msg-jeeves p:last-child { margin-bottom: 0; }
.chip {
  display: inline-block;
  margin: 2px 0 12px;
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--paper);
  font-weight: 700;
}
.chip:hover { background: var(--tan); }
.typing { display: inline-flex; gap: 5px; padding: 8px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

/* the ask box: the same size whether it's centered or at the bottom */
.composer-wrap { padding: 12px 48px 28px; }
.composer {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 7px 7px 7px 24px;
}
.composer input { flex: 1; border: 0; outline: none; background: transparent; padding: 9px 0; }
.composer input::placeholder { color: var(--muted); }
.send {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--on); color: var(--paper);
  display: grid; place-items: center; flex: none;
}
.send svg { width: 18px; height: 18px; }
.send:disabled { opacity: .45; cursor: default; }
.composer input:disabled { background: transparent; }
/* the mic: talk instead of typing */
.mic {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  color: var(--ink-2);
}
.mic:hover { background: var(--tan); }
.mic svg { width: 20px; height: 20px; }
.mic.is-on { background: var(--walnut); color: var(--paper); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(122, 79, 51, .35); } 50% { box-shadow: 0 0 0 8px rgba(122, 79, 51, 0); } }
/* what Jeeves is doing while it works ("Reading Rent roll.xlsx…") */
.working { margin-top: 4px; }
.status { font-size: 14px; color: var(--muted); margin-top: 2px; }
.msg-jeeves ul, .msg-jeeves ol { margin: 0 0 10px; padding-left: 22px; }
.msg-jeeves li { margin: 2px 0; }
.msg-jeeves a { color: var(--walnut); text-decoration: underline; text-underline-offset: 2px; }

.center.is-empty .thread, .center.is-empty .composer-wrap { display: none; }
.empty { flex: 1; display: none; align-items: center; justify-content: center; padding: 0 48px 12vh; }
.center.is-empty .empty { display: flex; }
.empty .composer { width: 100%; }

/* ---------- right ---------- */
.right {
  position: relative;
  padding: var(--under) 22px 40px; /* first pill sits level with General */
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* a short divider instead of a full-height wall: it stops short of the top line and the bottom */
.right::before {
  content: "";
  position: absolute;
  left: 0; top: 24px; bottom: 24px;
  width: 1px;
  background: var(--line);
}
.group { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.right .bottom { margin-top: auto; padding-top: 24px; display: flex; flex-direction: column; gap: 1px; }
.right .bottom .sub-row.item { color: var(--muted); }               /* quiet actions: small and grey like the rows above */
.right .bottom .sub-row.item:hover { background: transparent; color: var(--walnut); }
.right .bottom .sub-row.item.danger:hover { color: #8E3B24; }
.right .bottom .sub-row.item.pick { color: var(--ink-2); }
.right .bottom .sub-row.item.pick:hover { background: var(--tan); color: var(--ink); }
.right .bottom .ask, .right .bottom .confirm p { font-size: 14px; margin: 0 0 6px 36px; color: var(--muted); }
.right .bottom .confirm-btns { margin-left: 36px; }
.right .bottom .pill-input { font-size: 14px; padding: 8px 14px; }
.msg-note { align-self: center; font-size: 14px; color: var(--muted); padding: 4px 0; }
.confirm p { margin: 0 4px 10px; }
.confirm-btns { display: flex; gap: 10px; }
.group .sub { margin-bottom: 0; }

.row {
  display: block;
  width: 100%;
  padding: 7px 18px;   /* names line up with the text inside the pills */
  margin: -4px 0;
  border-radius: 10px;
  text-align: left;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere; /* long names wrap; nothing gets cut off */
}
.row:hover { background: var(--tan); }
.row.is-on { background: var(--tan); font-weight: 700; }
.row.add, .row.quiet { color: var(--muted); }
.row.add:hover, .row.quiet:hover { background: transparent; color: var(--walnut); }
.row.quiet.danger:hover { color: #8E3B24; }
/* A space's conversations, under its pill while it's open: smaller, one line each, tucked close.
   Every row has a fixed leading slot (+ or a caret), so the words line up. */
.convs { display: flex; flex-direction: column; gap: 1px; margin: -4px 0 0; }
.sub-row {
  display: flex; align-items: center;
  width: 100%;
  padding: 4px 12px 4px 14px;
  border-radius: 8px;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sub-row:hover { color: var(--walnut); }
.lead { width: 14px; margin-right: 8px; flex: none; display: inline-grid; place-items: center; }
.lead.plus { font-size: 16px; font-weight: 600; line-height: 1; }
/* the caret: points right when closed, down when open */
.caret::before {
  content: ""; width: 6px; height: 6px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform .15s;
}
.open > .caret::before { transform: rotate(45deg) translate(-1px, -1px); }
.past { display: flex; flex-direction: column; gap: 1px; max-height: 186px; overflow-y: auto; }
.sub-row.item { display: block; flex: none; padding-left: 36px; color: var(--ink-2); } /* lines up with the words above */
.sub-row.item:hover { background: var(--tan); color: var(--ink); }
.sub-row.item.is-on { background: var(--tan); color: var(--ink); }

/* File lists on the right fold like Past conversations, and scroll the same way past about six.
   An open list gets a little room after it, so the next heading reads as a new group. */
.sublist { display: flex; flex-direction: column; gap: 1px; max-height: 186px; overflow-y: auto; margin-bottom: 10px; }
.past { margin-bottom: 6px; }
.sub-row.item.add { color: var(--muted); }
.sub-row.item.add:hover { background: transparent; color: var(--walnut); }
.sheet-body a.file-link { cursor: pointer; }
.sheet-body a { color: var(--walnut); text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }

/* ---------- overlay ---------- */
.backdrop {
  position: fixed; inset: 0;
  background: rgba(42, 35, 28, .26);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 4vh 4vw;
  z-index: 10;
}
.sheet {
  width: min(800px, 100%);
  max-height: 88vh;
  display: flex; flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 30px 90px rgba(42, 35, 28, .2);
  overflow: hidden;
}
.sheet-top { display: flex; align-items: flex-start; gap: 14px; padding: 24px 28px 18px 34px; border-bottom: 1px solid var(--line); }
.sheet-top .titles { flex: 1; min-width: 0; }
.sheet-top .meta { color: var(--muted); margin-top: 4px; }
.btn {
  padding: 9px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}
.btn:hover { background: var(--tan); }
a.btn { display: inline-block; color: inherit; text-decoration: none; }
.btn.dark { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.dark:hover { background: var(--ink-2); }
.btn.danger { color: #8E3B24; border-color: #D9B3A3; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: grid; place-items: center; flex: none;
}
.icon-btn:hover { background: var(--tan); }
.icon-btn svg { width: 16px; height: 16px; }

.sheet-body { padding: 24px 34px 30px; overflow-y: auto; }
.sheet-body h1, .editable h1 { display: none; } /* the title is already at the top */
.sheet-body h2, .sheet-body h3 { font-size: var(--t); font-weight: 800; margin: 22px 0 4px; }
.sheet-body > :first-child, .sheet-body h1:first-child + *,
.editable > :first-child, .editable h1:first-child + * { margin-top: 0; }
.sheet-body p { margin: 0 0 10px; }
.sheet-body ul, .sheet-body ol { margin: 0 0 10px; padding-left: 22px; }
.sheet-body li { margin: 2px 0; }
.editable {
  outline: none;
  border: 1px solid var(--walnut);
  border-radius: 14px;
  padding: 18px 22px;
  background: #FFFFFF;
  min-height: 40vh;
  caret-color: var(--walnut);
}
.edit-hint { color: var(--muted); margin: 0 0 10px; }
/* Steve's ground rules at the bottom of How Jeeves operates: readable, not editable */
.locked { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.locked h2 { margin-top: 0; }

table.grid { border-collapse: collapse; width: 100%; }
table.grid th, table.grid td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; }
table.grid th { font-weight: 800; border-bottom: 1px solid var(--line-strong); }
table.grid .num { text-align: right; font-variant-numeric: tabular-nums; }
.hint { color: var(--muted); margin-top: 14px; }
.preview {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #FFFFFF;
  min-height: 46vh;
  display: grid; place-items: center;
  color: var(--muted);
  overflow: hidden;
}
.preview img, .preview iframe { width: 100%; height: 60vh; object-fit: contain; border: 0; }

.sheet-foot { display: flex; align-items: center; gap: 12px; padding: 14px 28px 16px 34px; border-top: 1px solid var(--line); }
.sheet-foot .spacer { flex: 1; }
.sheet-foot .ask { font-weight: 600; }
.link-btn { font-weight: 600; color: var(--muted); }
.link-btn:hover { color: #8E3B24; }
