/* Studio chrome. A quiet print-shop surface so the posters carry the color:
   warm paper, hairline rules, OES green for actions, lime only for selection. */

:root {
  --paper: #f3f0e9;
  --paper-2: #ebe7de;
  --surface: #fbfaf7;
  --line: #dcd6cb;
  --line-strong: #bfb7aa;
  --ink: #17201b;
  --ink-2: #48463f;
  --muted: #7e6f5d;
  --green: #006648;
  --green-deep: #024230;
  --night: #011c14;
  --lime: #86d65c;
  --danger: #9e3626;
  --well: #151b18;
  --radius: 2px;
  --header: 54px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.45 var(--f-sans);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }
::selection { background: rgba(134, 214, 92, .45); }

.label, .eyebrow {
  font-family: var(--f-condensed);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Header ---------- */
/* OES evergreen band: the school mark, the team switcher, then the team's pages. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px 0 20px;
  background: var(--green-deep);
  color: #f4f1ea;
  border-bottom: 3px solid var(--green);
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  white-space: nowrap;
  color: #f4f1ea;
}
.wm-mark { display: block; width: 38px; height: 35px; }
.wm-mark svg { width: 100%; height: 100%; display: block; }
.wm-text { display: flex; align-items: baseline; gap: 6px; }
.wm-text b { font: 900 21px/1 var(--f-display); letter-spacing: .02em; text-transform: uppercase; }
.wm-text i { font: italic 500 19px/1 var(--f-serif); color: #cfc8c2; }
.bar-rule { width: 1px; height: 26px; background: rgba(244, 241, 234, .2); }
.team-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px 0 12px;
  border: 1px solid rgba(244, 241, 234, .22);
  border-radius: var(--radius);
  background: rgba(1, 28, 20, .35);
  color: #f4f1ea;
  cursor: pointer;
  font: 600 13px/1 var(--f-condensed);
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.team-btn:hover { border-color: rgba(244, 241, 234, .5); }
.team-btn svg { width: 14px; height: 14px; color: var(--lime); }
.nav { display: flex; gap: 2px; height: 100%; }
.nav a {
  display: flex;
  align-items: center;
  padding: 0 11px;
  height: 100%;
  text-decoration: none;
  font: 600 13px/1 var(--f-condensed);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #cfc8c2;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
}
.nav a:hover { color: #fff; }
.nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--lime); }
.topbar .spacer { flex: 1; }
.health {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font: 600 11px/1 var(--f-condensed);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #e3c27a;
  white-space: nowrap;
}
.health i { width: 7px; height: 7px; border-radius: 50%; background: #e3a93b; }
.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(244, 241, 234, .35);
  border-radius: 50%;
  background: var(--green);
  color: #f4f1ea;
  overflow: hidden;
  cursor: pointer;
  font: 700 12px/1 var(--f-condensed);
  letter-spacing: .06em;
  flex: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.static { cursor: default; width: 38px; height: 38px; border-color: var(--line); }
.page-head .eyebrow { margin-bottom: 8px; color: var(--green); }

/* ---------- Pages ---------- */
.page { max-width: 1320px; margin: 0 auto; padding: 40px 32px 80px; }
.page-head {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 30px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.page-head h1 {
  margin: 0;
  font: italic 500 46px/1 var(--f-serif);
  letter-spacing: -.01em;
}
.page-head p { margin: 6px 0 0; color: var(--ink-2); max-width: 56ch; }
.page-head .actions { margin-left: auto; display: flex; gap: 10px; }

.empty {
  border: 1px dashed var(--line-strong);
  padding: 56px 32px;
  text-align: center;
  color: var(--ink-2);
}
.empty h2 { font: italic 500 28px/1.1 var(--f-serif); margin: 0 0 8px; color: var(--ink); }
.empty p { margin: 0 auto 20px; max-width: 46ch; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: 600 13px/1 var(--f-condensed);
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: var(--ink-2); }
.btn:focus-visible, .icon-btn:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--green); border-color: var(--green); color: #f4f1ea; }
.btn-primary:hover { background: var(--green-deep); border-color: var(--green-deep); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-quiet:hover { color: var(--ink); border-color: var(--line); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-lg { height: 44px; padding: 0 22px; font-size: 14px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--line); color: var(--ink); background: var(--surface); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.on { color: var(--green); }

/* ---------- Fields ---------- */
.field { display: grid; gap: 6px; }
.field > .label { display: flex; justify-content: space-between; }
.input, .textarea {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { resize: vertical; min-height: 92px; line-height: 1.5; }
.input:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(0, 102, 72, .14); }
.input::placeholder, .textarea::placeholder { color: #a39a8c; }
.input.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }

/* Dropdown */
.dd { position: relative; }
.dd-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}
.dd-btn:hover { border-color: var(--line-strong); }
.dd-btn[aria-expanded="true"] { border-color: var(--green); }
.dd-btn .dd-value { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-btn svg { width: 14px; height: 14px; color: var(--muted); flex: none; }
.dd-btn.compact { height: 30px; font-size: 14px; }

.popover {
  position: fixed;
  z-index: 100;
  min-width: 180px;
  max-height: 360px;
  overflow: auto;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px -16px rgba(23, 32, 27, .35), 0 2px 6px rgba(23, 32, 27, .08);
  animation: pop .14s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: var(--radius);
  background: none;
  text-align: left;
  cursor: pointer;
}
.option small { margin-left: auto; color: var(--muted); font-size: 12px; }
.option[aria-selected="true"] { color: var(--green-deep); font-weight: 600; }
.option[aria-selected="true"]::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); margin-left: auto; }
.option.active, .option:hover { background: var(--paper-2); }
.option.danger { color: var(--danger); }
.menu-sep { height: 1px; margin: 4px 2px; background: var(--line); }

/* Toggle */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
}
.toggle .track {
  position: relative;
  width: 32px;
  height: 18px;
  border-radius: 9px;
  background: var(--line-strong);
  transition: background .15s;
  flex: none;
}
.toggle .track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface);
  transition: transform .18s var(--ease);
}
.toggle[aria-checked="true"] .track { background: var(--green); }
.toggle[aria-checked="true"] .track::after { transform: translateX(14px); }
.toggle[disabled] { opacity: .5; cursor: default; }

/* Segmented */
.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 2px;
  gap: 2px;
}
.seg button {
  flex: 1;
  height: 28px;
  min-width: 30px;
  padding: 0 9px;
  border: 0;
  border-radius: 1px;
  background: none;
  color: var(--ink-2);
  cursor: pointer;
  font-size: 13px;
  display: grid;
  place-items: center;
}
.seg button svg { width: 15px; height: 15px; }
.seg button:hover { color: var(--ink); background: var(--paper-2); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.seg.wide { display: flex; }

/* Chips (multi-choice) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-2);
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--green-deep); border-color: var(--green-deep); color: #f4f1ea; }

/* Slider */
.slider { display: grid; grid-template-columns: 1fr 52px; align-items: center; gap: 10px; }
.slider .rail {
  position: relative;
  height: 22px;
  cursor: pointer;
  touch-action: none;
  outline: none;
}
.slider .rail::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 10px;
  height: 2px;
  background: var(--line);
}
.slider .fill { position: absolute; left: 0; top: 10px; height: 2px; background: var(--ink); }
.slider .knob {
  position: absolute;
  top: 4px;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--ink);
  transition: transform .1s;
}
.slider .rail:focus-visible .knob, .slider .rail:active .knob { transform: scale(1.15); border-color: var(--green); }
.slider .input { height: 28px; min-height: 28px; padding: 3px 6px; text-align: right; font-size: 13px; }

/* Number field with drag-to-scrub label */
.num { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); height: 30px; }
.num:focus-within { border-color: var(--green); }
.num .scrub {
  padding: 0 6px 0 8px;
  font: 600 11px/30px var(--f-condensed);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: ew-resize;
  user-select: none;
}
.num input { width: 100%; min-width: 0; height: 28px; border: 0; background: none; outline: none; padding: 0 6px 0 0; font-size: 13px; font-variant-numeric: tabular-nums; }

/* Color */
.color-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 8px 0 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  font: 13px/1 ui-monospace, "SF Mono", Menlo, monospace;
  width: 100%;
}
.swatch {
  width: 22px;
  height: 22px;
  border-radius: 1px;
  border: 1px solid rgba(0, 0, 0, .12);
  flex: none;
  background-image: linear-gradient(45deg, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%), linear-gradient(45deg, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%);
  background-size: 8px 8px;
  background-position: 0 0, 4px 4px;
  position: relative;
  overflow: hidden;
}
.swatch > i { position: absolute; inset: 0; }
.palette { display: grid; grid-template-columns: repeat(5, 30px); gap: 6px; padding: 6px; }
.palette button { width: 30px; height: 30px; padding: 0; border: 1px solid rgba(0, 0, 0, .14); border-radius: 1px; cursor: pointer; }
.palette button[aria-pressed="true"] { outline: 2px solid var(--ink); outline-offset: 2px; }
.palette-foot { display: flex; gap: 6px; padding: 6px; border-top: 1px solid var(--line); margin-top: 4px; }

/* Calendar */
.cal { width: 252px; padding: 8px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-head strong { font: italic 500 18px/1 var(--f-serif); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-grid .dow { font: 600 10px/24px var(--f-condensed); letter-spacing: .1em; color: var(--muted); }
.cal-grid button { height: 30px; border: 0; border-radius: var(--radius); background: none; cursor: pointer; font-size: 13px; font-variant-numeric: tabular-nums; }
.cal-grid button:hover { background: var(--paper-2); }
.cal-grid button.out { color: #b3aa9c; }
.cal-grid button.today { box-shadow: inset 0 0 0 1px var(--line-strong); }
.cal-grid button[aria-selected="true"] { background: var(--green-deep); color: #f4f1ea; }

/* ---------- Toasts and dialogs ---------- */
.toasts { position: fixed; z-index: 200; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; }
.toast {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 520px;
  padding: 11px 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .5);
  font-size: 14px;
  animation: toast-in .2s var(--ease);
}
.toast.error { background: #3a1610; }
.toast.error::before { content: ""; width: 3px; align-self: stretch; background: #e0745f; margin: -11px 0 -11px -16px; }
.toast button { border: 0; background: none; color: var(--lime); font: 600 12px/1 var(--f-condensed); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; padding: 0; }
.toast.out { opacity: 0; transform: translateY(6px); transition: .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.scrim {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  background: rgba(1, 28, 20, .42);
  animation: fade .15s;
  padding: 24px;
}
@keyframes fade { from { opacity: 0; } }
.dialog {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .45);
  animation: pop .18s var(--ease);
}
.dialog.wide { width: min(860px, 100%); }
.dialog header { padding: 20px 22px 0; }
.dialog h2 { margin: 0; font: italic 500 26px/1.1 var(--f-serif); }
.dialog .body { padding: 10px 22px 20px; color: var(--ink-2); }
.dialog footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--paper); }

/* ---------- Poster thumbnails ---------- */
.thumb {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--well);
  box-shadow: 0 0 0 1px rgba(23, 32, 27, .1);
}
.thumb > .poster-scale { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.thumb img.flat { width: 100%; height: 100%; object-fit: cover; display: block; }

.grid-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 34px 26px; }
.post-card { position: relative; text-decoration: none; color: inherit; display: block; }
.post-card .thumb { transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
.post-card:hover .thumb { box-shadow: 0 0 0 1px rgba(23, 32, 27, .25), 0 22px 40px -24px rgba(1, 28, 20, .7); transform: translateY(-2px); }
.post-card .meta { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; }
.post-card .meta div { flex: 1; min-width: 0; }
.post-card h3 { margin: 0; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-card .sub { margin-top: 3px; }
.post-card .icon-btn { margin-top: -4px; }

/* ---------- New post ---------- */
.compose { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 48px; align-items: start; }
.compose-main { display: grid; gap: 30px; }
.section-title { display: flex; align-items: baseline; gap: 12px; margin: 0 0 12px; }
.section-title h2 { margin: 0; font: italic 500 24px/1 var(--f-serif); }
.section-title .label { margin-left: auto; }
.row-4 { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.3fr; gap: 12px; }
.compose-side { position: sticky; top: calc(var(--header) + 24px); display: grid; gap: 18px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.panel h3 { margin: 0 0 4px; font: italic 500 20px/1.1 var(--f-serif); }
.panel p { margin: 0; color: var(--ink-2); font-size: 14px; }

.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.pick {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: var(--paper-2);
  cursor: pointer;
  overflow: hidden;
}
.pick img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s var(--ease); }
.pick:hover img { transform: scale(1.03); }
.pick .badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: rgba(244, 241, 234, .9);
  color: var(--ink);
  font: 700 12px/22px var(--f-condensed);
  text-align: center;
  opacity: 0;
}
.pick[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--green); }
.pick[aria-pressed="true"] .badge { opacity: 1; background: var(--green); color: #f4f1ea; }
.pick .tag {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 2px 6px;
  background: rgba(1, 28, 20, .78);
  color: #f4f1ea;
  font: 600 10px/1.4 var(--f-condensed);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.pick.upload { display: grid; place-items: center; border: 1px dashed var(--line-strong); background: transparent; color: var(--muted); }
.pick.upload span { font: 600 12px/1.3 var(--f-condensed); letter-spacing: .1em; text-transform: uppercase; text-align: center; }

.selected-photos { display: grid; gap: 8px; }
.sel-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; }
.sel-row img { width: 44px; height: 44px; object-fit: cover; display: block; background: var(--paper-2); }
.sel-row .name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sel-row .label { font-size: 10px; }

/* Composing state */
.composing { display: grid; grid-template-columns: 300px 1fr; gap: 40px; align-items: start; }
.composing .sheet { aspect-ratio: 4 / 5; background: var(--night); position: relative; overflow: hidden; }
.composing .sheet .bars { position: absolute; inset: 0; display: grid; align-content: center; gap: 14px; padding: 36px; }
.composing .sheet .bars i { display: block; height: 10px; background: rgba(134, 214, 92, .14); animation: build 2.4s var(--ease) infinite; transform-origin: left; }
.composing .sheet .bars i:nth-child(1) { height: 54px; animation-delay: .1s; }
.composing .sheet .bars i:nth-child(2) { width: 72%; animation-delay: .3s; }
.composing .sheet .bars i:nth-child(3) { width: 48%; animation-delay: .5s; }
.composing .sheet .bars i:nth-child(4) { height: 120px; width: 60%; justify-self: center; animation-delay: .7s; }
.composing .sheet .bars i:nth-child(5) { width: 64%; justify-self: center; animation-delay: .9s; }
@keyframes build { 0% { transform: scaleX(.1); opacity: .2; } 50% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: .2; } }
.composing h2 { margin: 0 0 6px; font: italic 500 34px/1.1 var(--f-serif); }
.composing .timer { font: 600 13px/1 var(--f-condensed); letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.thinking {
  margin-top: 22px;
  max-height: 340px;
  overflow: auto;
  padding: 16px 18px;
  border-left: 2px solid var(--lime);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}
.progress-line { margin-top: 14px; font-size: 14px; color: var(--ink-2); min-height: 20px; }

/* ---------- Editor ---------- */
body.editing { overflow: hidden; }
.editor { display: grid; grid-template-rows: 48px 1fr; height: calc(100vh - var(--header)); }
.ed-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 0 8px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.ed-title {
  min-width: 120px;
  max-width: 360px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  font: italic 500 20px/1 var(--f-serif);
  outline: none;
}
.ed-title:hover { border-color: var(--line); }
.ed-title:focus { border-color: var(--green); background: var(--surface); }
.ed-bar .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.ed-bar .status { font: 600 11px/1 var(--f-condensed); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-left: 4px; }
.ed-bar .status.dirty { color: #a8741d; }
.ed-bar .spacer { flex: 1; }

.ed-body { display: grid; grid-template-columns: 236px minmax(0, 1fr) 328px; min-height: 0; }
.ed-left, .ed-right { background: var(--paper); overflow: auto; min-height: 0; }
.ed-left { border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.ed-right { border-left: 1px solid var(--line); display: flex; flex-direction: column; }

.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  padding: 0 8px 0 14px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.layers { list-style: none; margin: 0; padding: 6px; flex: 1; overflow: auto; }
.layer {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 4px 0 8px;
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
  color: var(--ink-2);
  border: 1px solid transparent;
}
.layer svg { width: 15px; height: 15px; color: var(--muted); }
.layer .nm { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.layer .acts { display: flex; opacity: 0; }
.layer:hover { background: var(--paper-2); color: var(--ink); }
.layer:hover .acts, .layer .acts .on-hidden { opacity: 1; }
.layer .acts .icon-btn { width: 24px; height: 24px; }
.layer.sel { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.layer.sel .acts { opacity: 1; }
.layer.is-hidden .nm { opacity: .45; text-decoration: line-through; }
.layer.drag-over { box-shadow: inset 0 2px 0 var(--green); }
.layer.drag-over.below { box-shadow: inset 0 -2px 0 var(--green); }
.doc-row { margin: 6px; padding: 9px 10px; border: 1px dashed var(--line-strong); border-radius: var(--radius); cursor: pointer; color: var(--ink-2); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.doc-row:hover { color: var(--ink); border-color: var(--ink-2); }
.doc-row.sel { border-style: solid; background: var(--surface); color: var(--ink); }
.doc-row svg { width: 15px; height: 15px; }

.stage-wrap {
  position: relative;
  background: var(--well);
  overflow: hidden;
  min-height: 0;
}
.stage-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 18px 18px;
  pointer-events: none;
}
.stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .06); }
.stage .pl { cursor: default; }
.overlay { position: absolute; left: 0; top: 0; width: 1080px; height: 1350px; transform-origin: 0 0; pointer-events: none; }
.sel-box { position: absolute; outline: calc(1.5px / var(--z, 1)) solid var(--lime); pointer-events: none; }
.sel-box.hover { outline: calc(1px / var(--z, 1)) solid rgba(134, 214, 92, .6); }
.handle {
  position: absolute;
  width: calc(11px / var(--z, 1));
  height: calc(11px / var(--z, 1));
  margin: calc(-5.5px / var(--z, 1)) 0 0 calc(-5.5px / var(--z, 1));
  background: var(--paper);
  border: calc(1.5px / var(--z, 1)) solid var(--lime);
  pointer-events: auto;
}
.handle.nw { left: 0; top: 0; cursor: nwse-resize; }
.handle.ne { left: 100%; top: 0; cursor: nesw-resize; }
.handle.sw { left: 0; top: 100%; cursor: nesw-resize; }
.handle.se { left: 100%; top: 100%; cursor: nwse-resize; }
.handle.e { left: 100%; top: 50%; cursor: ew-resize; }
.handle.w { left: 0; top: 50%; cursor: ew-resize; }
.handle.s { left: 50%; top: 100%; cursor: ns-resize; }
.handle.n { left: 50%; top: 0; cursor: ns-resize; }
.guide { position: absolute; background: #ff4fa3; pointer-events: none; }
.guide.v { top: 0; bottom: 0; width: calc(1px / var(--z, 1)); }
.guide.h { left: 0; right: 0; height: calc(1px / var(--z, 1)); }
.size-tag {
  position: absolute;
  padding: calc(3px / var(--z, 1)) calc(6px / var(--z, 1));
  background: var(--lime);
  color: var(--night);
  font: 600 calc(11px / var(--z, 1))/1 var(--f-condensed);
  letter-spacing: .06em;
  white-space: nowrap;
  transform: translate(-50%, calc(8px / var(--z, 1)));
}
.zoom-ctl { position: absolute; right: 14px; bottom: 14px; display: flex; gap: 2px; background: rgba(1, 28, 20, .8); border-radius: var(--radius); padding: 3px; }
.zoom-ctl button { border: 0; background: none; color: #cfc8c2; height: 26px; min-width: 28px; padding: 0 6px; cursor: pointer; font: 600 12px/1 var(--f-condensed); letter-spacing: .08em; }
.zoom-ctl button:hover { color: #fff; }

.tabs { display: flex; border-bottom: 1px solid var(--line); flex: none; padding: 0 6px; }
.tabs button {
  height: 40px;
  padding: 0 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  cursor: pointer;
  font: 600 12px/1 var(--f-condensed);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.tab-body { flex: 1; overflow: auto; }

.insp-sec { padding: 14px 14px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.insp-sec > .label { display: flex; align-items: center; justify-content: space-between; }
.insp-sec .label .toggle { font-family: var(--f-sans); text-transform: none; letter-spacing: 0; }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.g3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.g4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.prop { display: grid; grid-template-columns: 84px 1fr; align-items: center; gap: 8px; min-height: 30px; }
.prop > .label { font-size: 11px; }
.insp-sec .textarea { min-height: 80px; font-size: 14px; }
.svg-code { font: 12px/1.45 ui-monospace, "SF Mono", Menlo, monospace !important; min-height: 160px !important; white-space: pre; }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.mini-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.mini-thumbs button { aspect-ratio: 1; padding: 0; border: 0; background: var(--paper-2); cursor: pointer; overflow: hidden; }
.mini-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini-thumbs button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--green); }


.caption-box .textarea { min-height: 220px; font-size: 15px; }
.notes { margin: 0; padding: 12px 14px; font: italic 400 16px/1.45 var(--f-serif); color: var(--ink-2); border-left: 2px solid var(--line-strong); }

/* ---------- Photos ---------- */
.dropzone {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 30px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink-2);
  text-align: center;
  cursor: pointer;
  margin-bottom: 26px;
  transition: background .15s, border-color .15s;
}
.dropzone strong { font: italic 500 22px/1.1 var(--f-serif); color: var(--ink); }
.dropzone.over { background: rgba(0, 102, 72, .06); border-color: var(--green); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; }
.photo { display: grid; gap: 8px; cursor: pointer; }
.photo .img {
  position: relative;
  aspect-ratio: 1;
  background: var(--paper-2);
  overflow: hidden;
}
.photo .img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .img.cut { background: #20302a url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Crect width='8' height='8' fill='%23263a32'/%3E%3Crect x='8' y='8' width='8' height='8' fill='%23263a32'/%3E%3C/svg%3E"); }
.photo .img.cut img { object-fit: contain; }
.photo .name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo:hover .img { box-shadow: 0 0 0 1px var(--ink-2); }

.sheet-side { position: fixed; z-index: 120; top: 0; right: 0; bottom: 0; width: min(460px, 100%); background: var(--surface); border-left: 1px solid var(--line-strong); box-shadow: -30px 0 60px -30px rgba(0, 0, 0, .35); display: flex; flex-direction: column; animation: slide .22s var(--ease); }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.sheet-side header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.sheet-side .content { flex: 1; overflow: auto; padding: 18px; display: grid; gap: 18px; align-content: start; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.compare figure { margin: 0; display: grid; gap: 6px; }
.compare .img { aspect-ratio: 4 / 5; background: var(--paper-2); display: grid; place-items: center; overflow: hidden; }
.compare .img.cut { background: #20302a url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Crect width='8' height='8' fill='%23263a32'/%3E%3Crect x='8' y='8' width='8' height='8' fill='%23263a32'/%3E%3C/svg%3E"); }
.compare img { max-width: 100%; max-height: 100%; display: block; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Brand ---------- */
.brand-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.slots { display: grid; gap: 12px; }
.slot { display: grid; grid-template-columns: 96px 1fr auto; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--line); background: var(--surface); }
.slot .well { width: 96px; height: 72px; background: var(--green-deep); display: grid; place-items: center; overflow: hidden; }
.slot .well.light { background: var(--paper-2); }
.slot .well img { max-width: 80%; max-height: 80%; }
.slot strong { display: block; font-size: 15px; }
.colors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.color-card { border: 1px solid var(--line); background: var(--surface); }
.color-card i { display: block; height: 64px; }
.color-card div { padding: 8px 10px; }
.color-card strong { display: block; font-size: 14px; }
.color-card code { font-size: 12px; color: var(--muted); }
.font-row { display: grid; grid-template-columns: 1fr auto; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); gap: 8px; }
.font-row .sample { font-size: 40px; line-height: 1; color: var(--green-deep); }
.setup { margin: 0; padding-left: 18px; color: var(--ink-2); display: grid; gap: 6px; }
.setup code { font-size: 13px; background: var(--paper-2); padding: 1px 5px; }

/* ---------- Login ---------- */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 22px;
  padding: 24px;
  background: radial-gradient(ellipse 90% 70% at 50% 35%, #006648 0%, #024230 55%, #011c14 100%);
  color: #f4f1ea;
}
.login-card { width: min(380px, 100%); display: grid; justify-items: center; gap: 14px; text-align: center; }
.login-mark { display: block; width: 132px; height: 121px; margin-bottom: 6px; }
.login-mark svg { width: 100%; height: 100%; display: block; }
.login h1 { margin: 0; display: grid; gap: 4px; }
.login h1 span { font: 900 54px/.9 var(--f-display); letter-spacing: .01em; text-transform: uppercase; }
.login h1 i { font: italic 500 30px/1 var(--f-serif); color: var(--lime); }
.login-sub { margin: 0 0 10px; color: #cfc8c2; }
.google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 48px;
  border-radius: var(--radius);
  background: #fff;
  color: #1f1f1f;
  text-decoration: none;
  font: 500 15px/1 var(--f-sans);
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
}
.google-btn:hover { background: #f4f1ea; }
.google-btn svg { width: 18px; height: 18px; display: block; }
.google-btn.disabled { opacity: .55; pointer-events: none; }
.login-err { margin: 4px 0 0; padding: 10px 12px; background: rgba(1, 28, 20, .55); border-left: 3px solid #e0745f; text-align: left; font-size: 14px; }
.dev-login { width: 100%; display: grid; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px dashed rgba(244, 241, 234, .25); }
.dev-login .label { color: #cfc8c2; }
.login-foot { margin: 0; font: italic 400 15px/1 var(--f-serif); color: rgba(244, 241, 234, .55); }

@media (max-width: 1100px) {
  .compose { grid-template-columns: 1fr; }
  .compose-side { position: static; }
  .brand-grid { grid-template-columns: 1fr; }
}

/* ---------- Style ---------- */
.style-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 48px; align-items: start; }
.ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 22px 18px; }
.ref { display: grid; gap: 10px; align-content: start; }
.ref.off { opacity: .5; }
.ref-img { aspect-ratio: 4 / 5; background: var(--well); overflow: hidden; box-shadow: 0 0 0 1px rgba(23, 32, 27, .1); }
.ref-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-img.contain { background: var(--paper-2); }
.ref-img.contain img { object-fit: contain; }
.ref-img.quote { display: grid; place-items: center; padding: 18px; background: var(--surface); border: 1px dashed var(--line-strong); box-shadow: none; }
.ref-img.quote span { font: italic 400 19px/1.35 var(--f-serif); color: var(--ink-2); }
.ref-meta { display: grid; gap: 6px; }
.ref-meta strong { font-size: 14px; }
.ref-meta p { margin: 0; font-size: 14px; color: var(--ink-2); }
.ref-aspects { display: flex; flex-wrap: wrap; gap: 4px; }
.ref-aspects span { padding: 2px 7px; border: 1px solid var(--line); font: 600 10px/1.5 var(--f-condensed); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 1100px) { .style-grid { grid-template-columns: 1fr; } }

/* ---------- Home ---------- */
.home-hero {
  position: relative;
  overflow: hidden;
  padding: 56px 32px 64px;
  background: radial-gradient(ellipse 80% 120% at 85% 10%, #006648 0%, #024230 60%, #011c14 100%);
  color: #f4f1ea;
}
.home-hero-mark { position: absolute; right: -60px; top: -40px; width: 460px; height: 422px; opacity: .1; filter: blur(2px); }
.home-hero-mark svg { width: 100%; height: 100%; display: block; }
.home-hero-text { position: relative; max-width: 1320px; margin: 0 auto; }
.home-hero .eyebrow { color: var(--lime); }
.home-hero h1 { margin: 10px 0 12px; display: grid; gap: 6px; }
.home-hero h1 span { font: 900 clamp(64px, 9vw, 120px)/.85 var(--f-display); text-transform: uppercase; letter-spacing: .01em; }
.home-hero h1 i { font: italic 500 30px/1.1 var(--f-serif); color: #cfc8c2; }
.home-hero p { margin: 0; max-width: 52ch; color: #cfc8c2; }
.home-page { padding-top: 34px; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.team-tile {
  display: grid;
  grid-template-columns: 1fr 104px;
  gap: 14px;
  min-height: 176px;
  padding: 18px;
  background: var(--green-deep);
  color: #f4f1ea;
  text-decoration: none;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.team-tile::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--lime); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease); }
.team-tile:hover { transform: translateY(-2px); box-shadow: 0 24px 40px -26px rgba(1, 28, 20, .9); }
.team-tile:hover::after { transform: scaleX(1); }
.team-tile-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.team-tile-handle { font: 600 11px/1 var(--f-condensed); letter-spacing: .14em; text-transform: uppercase; color: var(--lime); }
.team-tile h2 { margin: 2px 0 0; font: 900 40px/.9 var(--f-display); text-transform: uppercase; letter-spacing: .01em; }
.team-tile-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: auto; font-size: 13px; color: #cfc8c2; }
.team-tile-stats b { color: #f4f1ea; font-weight: 600; }
.team-tile-latest { font: italic 400 14px/1.3 var(--f-serif); color: rgba(244, 241, 234, .6); }
.team-tile-preview { aspect-ratio: 4 / 5; align-self: center; background: rgba(1, 28, 20, .5); display: grid; place-items: center; overflow: hidden; box-shadow: 0 0 0 1px rgba(244, 241, 234, .1); }
.team-tile-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.team-tile-mark { width: 70%; }
.team-tile-mark svg { width: 100%; display: block; }

/* ---------- Access ---------- */
.add-people { display: grid; gap: 14px; max-width: 760px; }
.people { display: grid; border-top: 1px solid var(--line); }
.person { display: grid; grid-template-columns: minmax(220px, 1.2fr) 170px minmax(0, 2fr) 76px; gap: 18px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.person-id { display: flex; gap: 12px; align-items: center; min-width: 0; }
.person-id > div { display: grid; gap: 2px; min-width: 0; }
.person-id strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-role { display: grid; gap: 4px; }
.person-teams .chips { gap: 4px; }
.person-teams .chip { height: 26px; padding: 0 9px; font-size: 12px; }
.handles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.input:disabled, .textarea:disabled { background: var(--paper-2); color: var(--ink-2); }
@media (max-width: 1000px) { .person { grid-template-columns: 1fr; } }
.field > .seg { justify-self: start; min-width: 240px; }
.person-role .seg { justify-self: start; min-width: 170px; }
.login-links { margin: -10px 0 0; display: flex; gap: 18px; }
.login-links a { color: rgba(244, 241, 234, .65); font: 600 12px/1 var(--f-condensed); letter-spacing: .12em; text-transform: uppercase; text-decoration: none; }
.login-links a:hover { color: #fff; }

/* ---------- Copy templates between teams ---------- */
.copy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 14px; max-height: min(56vh, 560px); overflow-y: auto; padding: 4px 2px 2px; }
.copy-pick { position: relative; display: grid; gap: 4px; padding: 0; border: 0; background: none; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.copy-pick .thumb { outline: 2px solid transparent; outline-offset: 2px; transition: outline-color .15s var(--ease); }
.copy-pick:hover .thumb { outline-color: var(--line-strong); }
.copy-pick[aria-pressed="true"] .thumb { outline-color: var(--green-deep); }
.copy-pick strong { margin-top: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.copy-check { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(1, 28, 20, .55); color: transparent; border: 1.5px solid rgba(244, 241, 234, .8); }
.copy-pick[aria-pressed="true"] .copy-check { background: var(--lime, #86D65C); border-color: var(--lime, #86D65C); color: #011C14; }
.copy-pick:focus-visible { outline: none; }
.copy-pick:focus-visible .thumb { outline-color: var(--green-deep); }

.person-actions { display: flex; gap: 2px; justify-content: flex-end; }

/* ---------- Usage (admin) ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 36px; }
.stat { background: var(--surface); padding: 16px 18px; display: grid; gap: 6px; align-content: start; }
.stat strong { font: 400 34px/1 var(--f-display); letter-spacing: .01em; color: var(--ink); }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.usage-daily { margin-bottom: 40px; }
.usage-chart-wrap { position: relative; }
.usage-chart { display: block; width: 100%; height: auto; overflow: visible; }
.usage-chart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.usage-chart .base { stroke: var(--line-strong); stroke-width: 1; }
.usage-chart .tick { fill: var(--muted); font: 600 10px/1 var(--f-condensed); letter-spacing: .08em; }
.usage-chart .bar { fill: var(--green); pointer-events: none; }
.usage-chart .hit { fill: transparent; cursor: default; }
.usage-chart .hit.on { fill: rgba(2, 66, 48, .06); }
.chart-tip { position: absolute; top: -6px; transform: translate(-50%, -100%); display: grid; gap: 3px; padding: 8px 11px; background: var(--night); color: #f4f1ea; pointer-events: none; white-space: nowrap; box-shadow: 0 10px 24px -14px rgba(1, 28, 20, .8); }
.chart-tip .label { color: #cfc8c2; }
.chart-tip strong { font: 400 22px/1 var(--f-display); }
.chart-tip .hint { color: #cfc8c2; font-size: 12px; }
.usage-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 32px; margin-bottom: 40px; }
@media (max-width: 1100px) { .usage-grid { grid-template-columns: 1fr; } }
.usage-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.usage-table th { text-align: left; font: 600 11px/1 var(--f-condensed); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 0 8px 8px 0; border-bottom: 1px solid var(--line-strong); }
.usage-table td { padding: 9px 8px 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.usage-table .num { text-align: right; font-variant-numeric: tabular-nums; padding-right: 0; padding-left: 8px; white-space: nowrap; }
.usage-note { margin-top: 18px; max-width: 760px; }

/* ---------- Ask Claude chat ---------- */
.tab-body.chat-mode { overflow: hidden; display: flex; flex-direction: column; }
.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--line); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 13px; }
.chat-log { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 16px; overscroll-behavior: contain; }
.chat-empty { margin: auto 0 4px; display: grid; gap: 10px; }
.chat-empty h3 { margin: 0; font: italic 500 24px/1.1 var(--f-serif); color: var(--ink); }
.chat-empty p { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.chat-suggest { display: grid; gap: 6px; margin-top: 6px; }
.chat-suggest button { text-align: left; padding: 9px 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; border-radius: 10px; transition: border-color .15s var(--ease), background .15s var(--ease); }
.chat-suggest button:hover:not(:disabled) { border-color: var(--green); background: #fff; }
.chat-suggest button:disabled { opacity: .5; cursor: default; }

.msg { display: flex; flex-direction: column; gap: 4px; max-width: 92%; }
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg.claude { align-self: flex-start; align-items: flex-start; }
.msg-meta { display: flex; gap: 8px; align-items: center; font: 600 10.5px/1 var(--f-condensed); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 0 4px; }
.bubble { padding: 9px 13px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 14px; }
.msg.user .bubble { background: var(--green-deep); color: #f4f1ea; border-bottom-right-radius: 4px; }
.msg.claude .bubble { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.claude.error .bubble { border-color: rgba(158, 54, 38, .35); background: #fbf1ee; color: var(--danger); }
.bubble.quiet { color: var(--muted); font-style: italic; }
.msg-actions { display: flex; gap: 4px; padding-left: 2px; }
.msg-act { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px; border: 0; background: none; color: var(--muted); font: 500 12.5px/1 var(--f-sans); cursor: pointer; border-radius: 6px; }
.msg-act svg { width: 13px; height: 13px; }
.msg-act:hover:not(:disabled) { color: var(--ink); background: var(--paper-2); }
.msg-act:disabled { cursor: default; opacity: .6; }
.msg-progress { font-size: 12.5px; color: var(--muted); padding: 0 4px; min-height: 0; }
.msg-progress:empty { display: none; }
.msg-think { width: 100%; font-size: 12.5px; color: var(--muted); padding: 0 4px; }
.msg-think summary { cursor: pointer; list-style: none; font: 600 10.5px/1 var(--f-condensed); letter-spacing: .12em; text-transform: uppercase; }
.msg-think summary::-webkit-details-marker { display: none; }
.msg-think summary::before { content: "+ "; }
.msg-think[open] summary::before { content: "– "; }
.msg-think .think-text { margin-top: 6px; max-height: 180px; overflow-y: auto; padding: 8px 10px; border-left: 2px solid var(--lime); background: var(--surface); white-space: pre-wrap; line-height: 1.5; color: var(--ink-2); }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--green); animation: dot 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .dots i { animation: none; opacity: .6; } }

.chat-foot { flex: none; padding: 10px 12px 12px; border-top: 1px solid var(--line); background: var(--paper); }
.chat-composer { display: flex; align-items: flex-end; gap: 6px; padding: 6px 6px 6px 12px; background: #fff; border: 1px solid var(--line-strong); border-radius: 14px; transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.chat-composer:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(0, 102, 72, .12); }
.chat-input { flex: 1; resize: none; border: 0; outline: 0; background: none; font: 14px/1.45 var(--f-sans); color: var(--ink); padding: 6px 0; max-height: 160px; min-height: 22px; }
.chat-input::placeholder { color: var(--muted); }
.chat-send { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 10px; background: var(--green-deep); color: #f4f1ea; cursor: pointer; transition: opacity .15s var(--ease); }
.chat-send:disabled { opacity: .3; cursor: default; }
.chat-send svg { width: 15px; height: 15px; }
.chat-hint { margin: 6px 4px 0; font-size: 11.5px; color: var(--muted); }
