:root {
  --sand: #edf9ff;
  --paper: #fbfeff;
  --foam: #effff9;
  --navy: #123247;
  --navy-soft: #31576b;
  --aqua: #62d4e8;
  --sea: #1598b2;
  --deep-sea: #0d6178;
  --sun: #ffd166;
  --sun-deep: #f4ac45;
  --coral: #ff705d;
  --watermelon: #f54762;
  --leaf: #68c98f;
  --mint: #c8f4d8;
  --line: rgba(18, 76, 99, 0.12);
  --muted: #66808e;
  --shadow: 0 24px 70px rgba(23, 132, 154, 0.12);
  --soft-shadow: 0 12px 32px rgba(23, 132, 154, 0.08);
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
[hidden] { display: none !important; }

body {
  position: relative;
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--navy);
  background:
    linear-gradient(135deg, #dff6ff 0%, #f7fdff 34%, #e8fff7 66%, #ccefff 100%);
  background-size: 280% 280%;
  animation: summerSky 24s ease-in-out infinite;
  font-family: "Microsoft YaHei UI", "PingFang SC", sans-serif;
}

.summer-scene {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.summer-glow {
  position: absolute;
  top: -110px;
  right: -70px;
  width: min(42vw, 600px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 224, 120, .62) 0 16%, rgba(255, 235, 166, .26) 32%, transparent 70%);
  filter: blur(1px);
  animation: sunBreathe 9s ease-in-out infinite;
}

.summer-cloud {
  position: absolute;
  width: 190px;
  height: 52px;
  border-radius: 999px;
  opacity: .62;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 18px 38px rgba(65, 164, 199, .08);
  filter: blur(.2px);
}

.summer-cloud::before,
.summer-cloud::after {
  content: "";
  position: absolute;
  bottom: 9px;
  border-radius: 50%;
  background: inherit;
}

.summer-cloud::before { left: 32px; width: 72px; height: 72px; }
.summer-cloud::after { right: 28px; width: 96px; height: 96px; }
.cloud-one { top: 12%; left: -230px; animation: cloudDrift 42s linear infinite; }
.cloud-two { top: 39%; left: -290px; scale: .64; opacity: .42; animation: cloudDrift 58s linear -17s infinite; }

.water-caustics {
  position: absolute;
  right: -12%;
  bottom: -20%;
  width: 72vw;
  height: 58vh;
  opacity: .28;
  transform: rotate(-8deg);
  background:
    repeating-radial-gradient(ellipse at 50% 120%, transparent 0 23px, rgba(255,255,255,.8) 25px 27px, transparent 30px 48px),
    repeating-linear-gradient(104deg, transparent 0 43px, rgba(37,189,214,.16) 46px 48px, transparent 51px 92px);
  filter: blur(1px);
  animation: waterShimmer 14s ease-in-out infinite alternate;
}

.leaf-shadow {
  position: absolute;
  width: 360px;
  height: 260px;
  opacity: .13;
  transform-origin: 92% 6%;
  background:
    radial-gradient(ellipse at 18% 22%, #168b72 0 7%, transparent 7.5%),
    radial-gradient(ellipse at 35% 46%, #168b72 0 9%, transparent 9.5%),
    radial-gradient(ellipse at 52% 18%, #168b72 0 8%, transparent 8.5%),
    radial-gradient(ellipse at 66% 52%, #168b72 0 10%, transparent 10.5%),
    radial-gradient(ellipse at 82% 25%, #168b72 0 8%, transparent 8.5%),
    linear-gradient(118deg, transparent 49%, #168b72 49.5% 51%, transparent 51.5%);
  filter: blur(3px);
}

.leaf-one { top: -60px; left: 17%; animation: leafSway 10s ease-in-out infinite alternate; }
.leaf-two { right: -90px; bottom: 6%; rotate: 168deg; scale: .82; animation: leafSway 13s ease-in-out -4s infinite alternate; }

@keyframes summerSky {
  0%, 100% { background-position: 0% 35%; }
  50% { background-position: 100% 66%; }
}

@keyframes sunBreathe {
  0%, 100% { transform: scale(.94); opacity: .7; }
  50% { transform: scale(1.08); opacity: 1; }
}

@keyframes cloudDrift {
  from { transform: translateX(0); }
  to { transform: translateX(calc(100vw + 560px)); }
}

@keyframes waterShimmer {
  from { transform: translate3d(-2%, 1%, 0) rotate(-8deg) scale(1); }
  to { transform: translate3d(3%, -2%, 0) rotate(-5deg) scale(1.06); }
}

@keyframes leafSway {
  from { transform: rotate(-4deg) translate3d(-6px, 0, 0); }
  to { transform: rotate(7deg) translate3d(8px, 5px, 0); }
}

button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }
textarea { resize: vertical; }

.app-shell { position: relative; z-index: 1; min-height: 100vh; display: grid; grid-template-columns: 228px minmax(0, 1fr); }

.sidebar {
  position: sticky;
  z-index: 8;
  top: 18px;
  height: calc(100vh - 36px);
  margin: 18px 0 18px 18px;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  color: var(--navy);
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 32px 32px 32px 14px;
  background:
    radial-gradient(circle at 15% 7%, rgba(255,209,102,.42), transparent 20%),
    linear-gradient(160deg, rgba(255,255,255,.84), rgba(228,251,255,.7) 54%, rgba(220,250,238,.72));
  box-shadow: 0 24px 60px rgba(23, 132, 154, .14);
  backdrop-filter: blur(18px) saturate(1.1);
  overflow: hidden;
}

.sidebar::after {
  content: "";
  position: absolute;
  right: -52px;
  bottom: 15%;
  width: 150px;
  height: 150px;
  border: 18px solid rgba(98, 212, 232, .13);
  border-radius: 44% 56% 38% 62%;
  transform: rotate(25deg);
}

.brand { position: relative; z-index: 1; display: flex; gap: 13px; align-items: center; color: inherit; text-decoration: none; }
.brand-mark {
  width: 49px;
  height: 49px;
  display: grid;
  place-items: center;
  border-radius: 50% 50% 47% 53%;
  color: var(--navy);
  background: var(--sun);
  box-shadow: 7px 7px 0 var(--coral);
  font: 700 28px/1 Georgia, serif;
  transform: rotate(-8deg);
}
.brand strong { display: block; letter-spacing: .14em; font-size: 15px; }
.brand small { display: block; margin-top: 4px; color: var(--sea); letter-spacing: .13em; font: 8px/1.2 Consolas, monospace; }

.nav-list { position: relative; z-index: 1; display: grid; gap: 6px; margin-top: 65px; }
.nav-item {
  width: 100%;
  min-height: 47px;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--navy-soft);
  background: transparent;
  text-align: left;
  transition: .2s ease;
}
.nav-item span { color: #72b5c3; font: 9px/1 Consolas, monospace; }
.nav-item b { font-size: 14px; font-weight: 600; }
.nav-item:hover { color: var(--deep-sea); background: rgba(255,255,255,.58); transform: translateX(3px); }
.nav-item.is-active { color: var(--navy); border-color: rgba(255,255,255,.82); background: rgba(255,209,102,.86); box-shadow: 0 10px 24px rgba(244,172,69,.18); }
.nav-item.is-active span { color: #96631d; }

.sidebar-rule {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 18px;
  background: rgba(255,255,255,.5);
  backdrop-filter: blur(8px);
}
.mini-label, .eyebrow { color: var(--muted); letter-spacing: .16em; font: 9px/1.4 Consolas, monospace; text-transform: uppercase; }
.sidebar-rule .mini-label { color: var(--sea); }
.sidebar-rule strong { display: block; margin: 10px 0 8px; color: var(--navy); font: 600 16px/1.45 "KaiTi", "STKaiti", serif; }
.sidebar-rule p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.7; }

.workspace { min-width: 0; padding: 0 34px 44px 46px; }
.topbar {
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgba(18,76,99,.08);
}
.topbar-title { display: flex; align-items: center; gap: 10px; }
.mobile-back { display: none; }
.topbar h1 { margin: 7px 0 0; color: var(--navy); font: 600 25px/1.1 "KaiTi", "STKaiti", serif; }
.topbar-tools { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.model-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 10px;
  border: 1px solid rgba(255,255,255,.84);
  border-radius: 999px;
  background: rgba(255,255,255,.58);
  box-shadow: 0 8px 22px rgba(21,152,178,.06);
  backdrop-filter: blur(10px);
}
.model-picker span { color: var(--muted); font: 700 8px/1 var(--mono); letter-spacing: .12em; }
.model-picker select {
  width: auto;
  min-width: 90px;
  padding: 4px 24px 4px 8px;
  border: 0;
  border-radius: 999px;
  background-color: rgba(255,255,255,.68);
  color: var(--navy);
  font: 700 10px/1.2 var(--mono);
  cursor: pointer;
}
.model-picker select:focus { outline: 2px solid rgba(62,145,170,.28); outline-offset: 1px; }
.status-cluster { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.status-pill { padding: 8px 11px; border: 1px solid rgba(255,255,255,.84); border-radius: 999px; background: rgba(255,255,255,.58); box-shadow: 0 8px 22px rgba(21,152,178,.06); backdrop-filter: blur(10px); font-size: 10px; white-space: nowrap; }
.status-pill i { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #a8bbc3; }
.status-pill.is-ready i { background: var(--leaf); box-shadow: 0 0 0 3px rgba(104,201,143,.16); }
.status-pill.is-warning i { background: var(--coral); box-shadow: 0 0 0 3px rgba(255,112,93,.14); }

.view { display: none; animation: viewIn .42s ease both; }
.view.is-active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }

.summer-hero {
  position: relative;
  min-height: 320px;
  margin-top: 26px;
  padding: clamp(34px, 5vw, 62px);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.88);
  border-radius: 40px 40px 40px 16px;
  background:
    radial-gradient(circle at 14% 10%, rgba(255,255,255,.96), transparent 28%),
    linear-gradient(118deg, rgba(245,253,255,.93) 0 58%, rgba(205,248,233,.82) 58% 100%);
  box-shadow: var(--shadow);
}
.summer-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 18%, rgba(98,212,232,.09) 0 3px, transparent 4px) 0 0 / 34px 34px;
  pointer-events: none;
}
.hero-copy { position: relative; z-index: 2; max-width: 720px; }
.hero-kicker { color: var(--sea); letter-spacing: .17em; font: 10px/1 Consolas, monospace; }
.summer-hero h2, .page-lead h2, .chat-intro h2 {
  margin: 18px 0 20px;
  color: var(--navy);
  font: 600 clamp(38px, 4.8vw, 61px)/1.08 "KaiTi", "STKaiti", "STSong", serif;
  letter-spacing: -.025em;
}
.summer-hero h2 em, .page-lead h2 em, .chat-intro h2 em { color: var(--sea); font-style: normal; }
.summer-hero p { max-width: 620px; margin: 0; color: var(--navy-soft); font-size: 14px; line-height: 1.9; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero-sun {
  position: absolute;
  z-index: 1;
  top: 48px;
  right: 7%;
  width: 170px;
  height: 170px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #996727;
  background: var(--sun);
  box-shadow: 0 0 0 20px rgba(255,209,102,.16), 0 18px 48px rgba(244,172,69,.2);
  font: 700 13px/1.45 Consolas, monospace;
  letter-spacing: .12em;
  text-align: center;
  animation: summerFloat 5s ease-in-out infinite;
}
@keyframes summerFloat { 50% { transform: translateY(-8px) rotate(2deg); } }
.hero-wave {
  position: absolute;
  right: -4%;
  bottom: -75px;
  width: 410px;
  height: 180px;
  border: 28px solid rgba(98,212,232,.55);
  border-radius: 49% 51% 45% 55%;
  transform: rotate(-7deg);
}

.primary-button, .ghost-button, .send-button, .mini-button, .text-link {
  border: 0;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.primary-button { padding: 12px 19px; border-radius: 999px; color: #fff; background: var(--deep-sea); box-shadow: 0 9px 20px rgba(13,97,120,.18); font-weight: 700; }
.primary-button:hover { transform: translateY(-2px); background: var(--sea); box-shadow: 0 12px 26px rgba(13,97,120,.25); }
.primary-button.small { padding: 9px 13px; font-size: 11px; }
.ghost-button { padding: 11px 18px; border: 1px solid rgba(18,50,71,.4); border-radius: 999px; background: rgba(255,255,255,.58); font-weight: 700; }
.ghost-button:hover { transform: translateY(-2px); background: var(--sun); }
.ghost-button.dark { color: #fff; background: var(--navy); }
.text-link { padding: 7px 0; color: var(--sea); background: none; font-size: 11px; }

.personal-row { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 18px; margin: 18px 0; }
.quick-capture-card, .personal-row .task-card { min-height: 220px; padding: 24px; }
.quick-capture-card form { display: grid; gap: 12px; }
.quick-capture-card textarea { min-height: 82px; resize: none; border: 0; border-radius: 18px 18px 18px 7px; background: rgba(239,255,249,.76); box-shadow: inset 0 0 0 1px rgba(21,152,178,.1); }
.quick-capture-card small { color: var(--muted); font-size: 9px; line-height: 1.6; }
.quick-capture-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.time-ledger-entry {
  width: 100%;
  min-height: 92px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 36px;
  align-items: center;
  gap: 18px;
  margin: 18px 0;
  padding: 18px 22px;
  color: var(--navy);
  text-align: left;
}
.time-ledger-entry:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(20,74,84,.12); }
.time-entry-copy { min-width: 0; display: grid; gap: 5px; }
.time-entry-copy > strong { font: 600 18px/1.3 "KaiTi", "STKaiti", serif; }
.time-entry-copy > small { color: var(--muted); font-size: 9px; }
.time-entry-balance { display: grid; grid-template-columns: auto auto; align-items: baseline; gap: 4px; min-width: 104px; padding: 10px 14px; border-radius: 12px; background: rgba(205,238,226,.58); }
.time-entry-balance small { grid-column: 1 / -1; color: var(--muted); font-size: 8px; }
.time-entry-balance strong { color: var(--deep-sea); font: 700 24px/1 Georgia, serif; }
.time-entry-balance i { color: var(--muted); font-style: normal; font-size: 8px; }
.time-entry-arrow { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid rgba(31,67,75,.1); border-radius: 50%; color: var(--deep-sea); background: rgba(255,255,255,.58); font-size: 16px; }

.time-page-lead { margin-bottom: 12px; }
.time-ledger { margin: 18px 0; padding: 28px; }
#view-time .time-ledger { background: var(--paper); }
.time-ledger,
.time-calendar-wrap,
.time-record-form { border-color: rgba(23,25,18,.18); }
.time-ledger.is-standalone { margin-top: 0; }
.time-ledger-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.time-ledger-head h3 { margin: 8px 0 0; color: var(--navy); font-size: 26px; line-height: 1.2; }
.time-month-tools { display: flex; align-items: center; gap: 12px; }
.time-month-tools strong { min-width: 112px; color: var(--navy); font-size: 15px; text-align: center; }
.time-month-tools button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 3px; color: var(--deep-sea); background: var(--paper); font-size: 20px; }
.time-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.time-summary > div { min-height: 78px; display: flex; align-items: baseline; gap: 5px; padding: 14px 16px; border: 1px solid rgba(23,25,18,.15); border-radius: 3px; background: #f7f4eb; }
.time-summary span { margin-right: auto; color: #50534b; font-size: 13px; font-weight: 700; }
.time-summary strong { color: var(--navy); font-size: 30px; line-height: 1; }
.time-summary small { color: #50534b; font-size: 12px; }
.time-summary .balance { background: linear-gradient(90deg, var(--sun) 0 6px, #f5f8e7 6px); }
.time-ledger-body { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, .55fr); align-items: start; gap: 18px; }
.time-calendar-wrap { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 3px; background: #f7f4eb; }
.time-weekdays, .time-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.time-weekdays { margin-bottom: 7px; }
.time-weekdays span { padding: 6px 4px; color: #55584f; font-size: 12px; font-weight: 700; text-align: center; }
.time-day { position: relative; min-height: 68px; display: grid; align-content: space-between; justify-items: start; gap: 4px; padding: 9px; border: 1px solid #e0dbcf; border-radius: 3px; color: var(--navy); background: var(--paper); text-align: left; }
.time-day:hover { border-color: var(--navy); background: #fff; }
.time-day.outside { color: #9a9c94; background: #f0ede4; opacity: 1; }
.time-day.today::after { content: ''; position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--coral); }
.time-day.selected { border-color: var(--navy); background: #f4ffd0; box-shadow: 3px 3px 0 var(--navy); }
.time-day-number { font-size: 14px; line-height: 1; font-weight: 700; }
.time-day-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.time-day-tags i { padding: 3px 6px; border-radius: 999px; font-style: normal; font-size: 10px; line-height: 1.25; }
.time-day-tags .overtime { color: #8b3f32; background: #f7ded7; }
.time-day-tags .rested { color: #245b49; background: #dcefe5; }
.time-record-form { display: grid; align-content: start; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 3px; background: #f2f6ed; }
.time-record-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.time-record-title > div { display: grid; gap: 5px; }
.time-record-title span, .time-note-label { color: #50534b; font-size: 13px; line-height: 1.5; font-weight: 700; }
.time-record-title strong { color: var(--navy); font-size: 18px; line-height: 1.35; }
.time-record-title input { width: 154px; min-height: 44px; padding: 9px 10px; font-size: 14px; }
.time-kind-switches { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.time-kind-switches label { position: relative; min-width: 0; overflow: hidden; }
.time-kind-switches input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.time-kind-switches span { min-height: 50px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 3px; color: #40433c; background: var(--paper); font-size: 14px; font-weight: 700; cursor: pointer; }
.time-kind-switches input:checked + span { border-color: var(--navy); color: var(--navy); background: var(--sun); box-shadow: 3px 3px 0 var(--navy); }
.time-note-label { display: grid; gap: 8px; }
.time-note-label textarea { min-height: 120px; padding: 12px 14px; resize: vertical; font-size: 16px; line-height: 1.65; }
.time-record-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.time-record-form > small { color: #60635a; font-size: 12px; line-height: 1.55; }

.metric-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.metric-card {
  position: relative;
  min-width: 142px;
  min-height: 58px;
  flex: 1 1 142px;
  padding: 10px 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 999px;
  background: rgba(255,255,255,.6);
  backdrop-filter: blur(12px);
  box-shadow: var(--soft-shadow);
}
.metric-card::after { content: ""; position: absolute; right: -22px; bottom: -30px; width: 76px; height: 76px; border-radius: 50%; background: var(--card-color, var(--aqua)); opacity: .22; }
.metric-card span { position: relative; z-index: 1; display: block; font-size: 11px; font-weight: 700; }
.metric-card strong { position: relative; z-index: 1; display: block; font: 700 28px/1 Georgia, serif; }
.metric-card small { display: none; }
.metric-card.decision { --card-color: var(--coral); }
.metric-card.waiting { --card-color: var(--aqua); }
.metric-card.risk, .metric-card.overdue { --card-color: var(--watermelon); }
.metric-card.input { --card-color: var(--sun); }
.metric-card.closed { --card-color: var(--leaf); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .65fr); gap: 18px; align-items: start; }
.factory-pulse-card { margin: 18px 0; overflow: hidden; }
.factory-pulse-head { display: flex; justify-content: space-between; gap: 20px; padding: 20px 22px 14px; border-bottom: 1px solid rgba(62,145,170,.14); }
.factory-pulse-head h3 { margin: 5px 0 3px; font-size: clamp(22px,3vw,34px); }
.factory-pulse-head p { margin: 0; color: var(--muted); font-size: 11px; }
.factory-pulse-state { align-self: flex-start; padding: 7px 11px; border: 1px solid rgba(62,145,170,.2); border-radius: 999px; color: var(--deep-sea); background: rgba(255,255,255,.65); font-size: 9px; font-weight: 800; }
.factory-pulse-state.healthy { background: rgba(201,255,120,.45); }
.factory-pulse-state.attention { background: rgba(255,222,138,.56); }
.factory-pulse-state.risk { color: #7f2f2c; background: rgba(239,122,96,.18); border-color: rgba(174,60,50,.25); }
.factory-pulse-body { display: grid; grid-template-columns: minmax(260px,.7fr) minmax(0,1.3fr); gap: 18px; padding: 18px 22px; }
.factory-pulse-metrics { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.factory-pulse-metrics div { min-width: 0; padding: 13px 10px; border: 1px solid rgba(62,145,170,.14); background: rgba(255,255,255,.47); text-align: center; }
.factory-pulse-metrics strong { display: block; color: var(--deep-sea); font: 700 24px/1 Georgia,serif; }
.factory-pulse-metrics span { display: block; margin-top: 5px; color: var(--muted); font-size: 8px; }
.factory-alert-list { display: grid; gap: 8px; align-content: start; }
.factory-alert { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 10px 12px; border-left: 3px solid #d99d38; background: rgba(255,255,255,.52); }
.factory-alert.risk { border-left-color: var(--coral); }
.factory-alert > span { color: var(--muted); font: 700 7px/1 Consolas,monospace; letter-spacing: .12em; }
.factory-alert strong, .factory-alert small { display: block; }
.factory-alert strong { color: var(--ink); font-size: 11px; }
.factory-alert small { margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.5; }
.factory-alert-details { margin-top: 8px; color: var(--ink-soft); font-size: 9px; }
.factory-alert-details summary { cursor: pointer; font-weight: 700; }
.factory-alert-details ul { display: grid; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.factory-alert-details li { display: grid; gap: 2px; padding: 7px 8px; border: 1px solid rgba(23,25,18,.1); background: rgba(255,255,255,.45); }
.factory-alert-details li span { color: var(--muted); line-height: 1.45; }
.factory-alert-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 9px; }
.factory-alert-actions .text-button { padding: 6px 4px; font-size: 9px; }
.factory-all-clear { margin: 0; padding: 15px; border: 1px dashed rgba(62,145,170,.2); color: var(--sea); font-size: 10px; }
.factory-pulse-foot { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 11px 22px 15px; }
.factory-pulse-foot p { margin: 0; color: var(--muted); font-size: 8px; }
.summer-sheet { border: 1px solid rgba(255,255,255,.82); border-radius: 28px 28px 28px 12px; background: rgba(255,255,255,.64); box-shadow: var(--soft-shadow); backdrop-filter: blur(12px); }
.command-board, .data-source-card, .task-card, .generator-card, .manual-draft-card, .draft-queue { padding: 24px; }
.dashboard-side { display: grid; align-content: start; gap: 18px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 20px; }
.section-heading.compact { margin-bottom: 13px; }
.section-heading h3 { margin: 6px 0 0; font: 700 23px/1.15 "STSong", "SimSun", serif; }
.lane-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.command-lane { padding: 15px; border-radius: 20px 20px 20px 8px; background: rgba(239,255,249,.62); border: 1px solid rgba(255,255,255,.82); }
.command-lane h4 { display: flex; align-items: center; gap: 7px; margin: 0 0 12px; font-size: 11px; }
.dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; }
.dot.coral { background: var(--coral); }
.dot.aqua { background: var(--aqua); }
.dot.red { background: var(--watermelon); }
.lane-list { display: grid; gap: 8px; }
.lane-item { width: 100%; padding: 11px; border: 0; border-radius: 12px; background: #fff; text-align: left; box-shadow: 0 5px 14px rgba(13,97,120,.07); }
.lane-item:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(13,97,120,.12); }
.lane-item span, .lane-item small { display: block; color: var(--muted); font-size: 9px; }
.lane-item strong { display: block; margin: 5px 0; font-size: 12px; line-height: 1.45; }
.source-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.source-state { color: var(--deep-sea); font: 9px/1 Consolas, monospace; text-transform: uppercase; }
.source-state.pending { color: var(--coral); }
.source-state.ready { color: #338557; }
.source-note, .empty-note { color: var(--muted); font-size: 10px; line-height: 1.65; }
.quick-task-form { display: grid; grid-template-columns: minmax(0,1fr) 112px 38px; gap: 7px; }
.quick-task-form input { min-width: 0; }
.quick-task-form button { border: 0; border-radius: 11px; color: #fff; background: var(--sea); font-size: 20px; }
.task-list { display: grid; margin-top: 10px; }
.task-row { display: grid; grid-template-columns: auto 1fr; gap: 9px; align-items: start; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.task-row input { width: 17px; height: 17px; accent-color: var(--sea); }
.task-row strong, .task-row small { display: block; }
.task-row strong { font-size: 11px; line-height: 1.4; }
.task-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }

.page-lead { padding: 48px 5px 32px; }
.page-lead > div { display: flex; align-items: center; gap: 13px; }
.page-number { width: 47px; height: 47px; display: grid; place-items: center; border-radius: 50%; color: var(--navy); background: var(--sun); font: 11px/1 Consolas, monospace; box-shadow: 5px 5px 0 rgba(255,112,93,.55); }
.page-number.watermelon { color: #fff; background: var(--watermelon); box-shadow: 5px 5px 0 rgba(98,212,232,.5); }
.page-number.leaf { color: #fff; background: var(--leaf); box-shadow: 5px 5px 0 rgba(255,209,102,.7); }
.page-lead h2 { max-width: 970px; margin: 22px 0 14px; font-size: clamp(38px, 5vw, 65px); }
.page-lead p { max-width: 760px; margin: 0; color: var(--muted); line-height: 1.75; }
.compact-lead { padding-bottom: 24px; }

.work-layout { display: grid; grid-template-columns: minmax(360px, .78fr) minmax(500px, 1.22fr); gap: 19px; align-items: start; }
.create-panel { position: sticky; top: 18px; max-height: calc(100vh - 36px); padding: 24px; overflow: auto; }
.work-form { display: grid; gap: 12px; }
.work-form label { display: grid; gap: 6px; color: var(--navy-soft); font-size: 10px; font-weight: 700; }
.field-row { display: grid; gap: 10px; }
.field-row.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.field-row.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
input, textarea, select {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(18,50,71,.18);
  border-radius: 10px;
  outline: none;
  color: var(--navy);
  background: rgba(255,255,255,.83);
}
input:focus, textarea:focus, select:focus { border-color: var(--sea); box-shadow: 0 0 0 3px rgba(98,212,232,.18); }
.filter-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px; padding: 0 4px; }
.filter-bar strong { display: block; margin-top: 5px; font-size: 12px; }
.filter-bar select { width: auto; min-width: 120px; }
.work-list { display: grid; gap: 13px; }
.work-card { position: relative; padding: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.85); box-shadow: var(--soft-shadow); }
.work-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--status-color, var(--aqua)); }
.work-card.status-ready_gate { --status-color: var(--coral); }
.work-card.status-blocked { --status-color: var(--watermelon); }
.work-card.status-waiting_evidence, .work-card.status-waiting_reviewer { --status-color: var(--aqua); }
.work-card.status-closed { --status-color: var(--leaf); }
.work-card.status-pending_input { --status-color: var(--sun); }
.work-card-top, .draft-head, .draft-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.work-project { color: var(--deep-sea); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.classification { margin-left: 8px; padding: 4px 7px; border-radius: 999px; color: var(--muted); background: var(--foam); font-size: 8px; }
.work-status, .approval-state { padding: 5px 8px; border-radius: 999px; color: var(--navy); background: var(--mint); font: 8px/1 Consolas, monospace; text-transform: uppercase; }
.work-status.status-blocked { color: #fff; background: var(--watermelon); }
.work-status.status-ready_gate { background: var(--sun); }
.work-status.status-pending_input { background: #f2e4b7; }
.work-card h3 { margin: 15px 0 8px; font: 700 23px/1.2 "STSong", "SimSun", serif; }
.work-fact { margin: 0; color: var(--navy-soft); font-size: 12px; line-height: 1.65; }
.work-meta { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 16px 0; }
.work-meta span { padding: 9px; border-radius: 10px; background: var(--sand); font-size: 10px; overflow-wrap: anywhere; }
.work-meta small { display: block; margin-bottom: 4px; color: var(--muted); font: 8px/1 Consolas, monospace; }
.work-meta--dri { grid-template-columns: minmax(0,1fr); }
.quick-dri-field { display: block; padding: 9px; border-radius: 10px; background: var(--sand); }
.quick-dri-field input { padding: 7px 9px; border-color: transparent; background: rgba(255,255,255,.68); font-size: 10px; }
.evidence-strip { display: flex; flex-wrap: wrap; gap: 6px; }
.evidence-strip span { padding: 5px 8px; border: 1px dashed rgba(18,50,71,.22); border-radius: 8px; color: var(--muted); font-size: 8px; }
.evidence-strip span.has-value { border-style: solid; color: #2d7950; background: var(--mint); }
.work-actions { display: grid; grid-template-columns: minmax(150px,1fr) auto auto; gap: 7px; margin-top: 14px; }
.quick-status { padding: 8px; font-size: 10px; }
.mini-button { padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 9px; }
.mini-button:hover { transform: translateY(-1px); border-color: var(--sea); }
.mini-button.sun { background: var(--sun); }
.mini-button.approve { color: #205f3d; background: var(--mint); }
.work-details { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); }
.work-details summary { color: var(--sea); font-size: 10px; }
.work-edit-form { display: grid; gap: 10px; margin-top: 14px; padding: 15px; border-radius: 14px; background: var(--foam); }
.work-edit-form label { display: grid; gap: 5px; color: var(--navy-soft); font-size: 9px; font-weight: 700; }
.empty-panel { padding: 34px; border: 1px dashed rgba(18,50,71,.24); border-radius: 18px; color: var(--muted); text-align: center; }
.empty-panel strong { color: var(--navy); font: 700 20px/1.2 "STSong", "SimSun", serif; }
.empty-panel p { margin-bottom: 0; font-size: 11px; }

.communication-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.generator-card { background: linear-gradient(145deg, rgba(200,244,216,.92), rgba(255,255,255,.86)); }
.manual-draft-card { background: linear-gradient(145deg, rgba(255,209,102,.28), rgba(255,255,255,.88)); }
.work-form small { color: var(--muted); font-size: 9px; }
.draft-compose-panel { margin-bottom: 18px; overflow: hidden; }
.draft-compose-panel > summary { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 20px 24px; cursor: pointer; list-style: none; }
.draft-compose-panel > summary::-webkit-details-marker { display: none; }
.draft-compose-panel > summary span { color: var(--navy); font: 700 20px/1.1 "STSong", "SimSun", serif; }
.draft-compose-panel > summary small { color: var(--muted); font-size: 9px; }
.draft-compose-panel[open] > summary { border-bottom: 1px solid var(--line); }
.draft-compose-panel .communication-grid { padding: 20px; }
.draft-queue { margin-top: 0; }
.safe-note { padding: 6px 10px; border-radius: 999px; color: #9c4b3b; background: rgba(255,112,93,.13); font-size: 9px; }
.draft-filter-bar { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.draft-filter { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.72); font-size: 9px; }
.draft-filter b { margin-left: 5px; }
.draft-filter.is-active { color: #10170d; border-color: var(--leaf); background: var(--lime); }
.draft-list { display: grid; grid-template-columns: 1fr; gap: 12px; }
.draft-group { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.74); }
.draft-group-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 15px 17px 13px; border-bottom: 1px solid var(--line); }
.draft-group-head h4 { margin: 4px 0 0; color: var(--navy); font-size: 13px; }
.draft-group-head > span { flex: 0 0 auto; color: var(--muted); font-size: 8px; }
.draft-group-items { display: grid; }
.draft-card { border-bottom: 1px solid var(--line); background: rgba(255,255,255,.46); }
.draft-card:last-child { border-bottom: 0; }
.draft-summary { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 16px; padding: 14px 17px; cursor: pointer; list-style: none; }
.draft-summary::-webkit-details-marker { display: none; }
.draft-summary:hover { background: rgba(209,255,48,.08); }
.draft-summary-main { min-width: 0; }
.draft-summary-main strong { margin-left: 7px; color: var(--navy); font-size: 10px; }
.draft-summary-main p { margin: 8px 0 0; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.draft-summary-meta { display: grid; justify-items: end; gap: 7px; }
.draft-summary-meta small { color: var(--muted); font-size: 8px; white-space: nowrap; }
.draft-body { padding: 0 17px 16px; }
.draft-body > p { margin: 0; padding: 16px; border-radius: 12px; color: var(--navy-soft); background: var(--foam); font-size: 11px; line-height: 1.75; white-space: pre-wrap; }
.draft-recipient { margin-bottom: 8px; color: var(--muted); font-size: 8px; }
.draft-channel { margin-right: 8px; padding: 4px 7px; border-radius: 999px; color: var(--deep-sea); background: rgba(98,212,232,.18); font-size: 8px; }
.approval-state.approved { background: var(--mint); }
.approval-state.archived { color: var(--muted); background: var(--sand); }
.draft-foot { margin-top: 10px; }
.draft-foot small { color: var(--muted); font-size: 8px; }
.draft-foot > div { display: flex; gap: 7px; }

.chat-layout { display: grid; grid-template-columns: minmax(0,1fr) 245px; gap: 18px; padding-top: 26px; }
.chat-panel { min-height: calc(100vh - 160px); display: flex; flex-direction: column; overflow: hidden; }
.chat-intro { position: relative; padding: clamp(32px,5vw,64px); overflow: hidden; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, rgba(242,255,251,.84), rgba(255,248,231,.72)); }
.chat-intro::after { content: "J"; position: absolute; right: 25px; top: -32px; color: rgba(21,152,178,.07); font: 700 260px/1 Georgia, serif; }
.chat-intro h2 { position: relative; z-index: 1; max-width: 780px; font-size: clamp(36px,5vw,62px); }
.chat-intro p { position: relative; z-index: 1; color: var(--muted); }
.prompt-chips { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.prompt-chips button { padding: 9px 12px; border: 1px solid var(--sea); border-radius: 999px; color: var(--deep-sea); background: rgba(255,255,255,.64); font-size: 10px; }
.prompt-chips button:hover { color: #fff; background: var(--sea); }
.voice-dock {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(180px,1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 15px 18px 0;
  padding: 12px 14px;
  border: 1px solid rgba(62,145,170,.18);
  border-radius: 13px 21px 15px 9px;
  background:
    linear-gradient(105deg, rgba(255,252,239,.9), rgba(225,241,239,.82)),
    repeating-linear-gradient(0deg, transparent 0 28px, rgba(62,145,170,.07) 29px 30px);
  box-shadow: 5px 7px 0 rgba(113,139,117,.08);
}
.voice-toggle { display: flex; align-items: center; gap: 10px; padding: 7px 12px 7px 8px; border-radius: 999px; color: var(--deep-sea); background: rgba(255,255,255,.82); }
.voice-toggle b { font-size: 10px; white-space: nowrap; }
.voice-toggle:disabled { opacity: .48; cursor: not-allowed; }
.voice-orb { position: relative; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--coral); box-shadow: 0 5px 14px rgba(225,113,91,.22); }
.voice-orb i { width: 8px; height: 13px; border: 2px solid #fff; border-radius: 7px; }
.voice-orb::after { content: ""; position: absolute; bottom: 7px; width: 13px; height: 7px; border: 2px solid #fff; border-top: 0; border-radius: 0 0 9px 9px; }
.voice-toggle.is-active .voice-orb::before { content: ""; position: absolute; inset: -5px; border: 1px solid rgba(225,113,91,.5); border-radius: 50%; animation: voicePulse 1.5s ease-out infinite; }
.voice-toggle.is-active .voice-orb { background: var(--sea); }
@keyframes voicePulse { 0% { opacity: .8; transform: scale(.85); } 100% { opacity: 0; transform: scale(1.45); } }
.voice-copy { min-width: 0; }
.voice-copy strong, .voice-copy small { display: block; }
.voice-copy strong { color: var(--navy); font-size: 11px; }
.voice-copy small { margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.5; }
.voice-copy p { margin: 6px 0 0; color: var(--sea); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voice-interrupt { padding: 8px 10px; border: 1px solid rgba(62,145,170,.25); border-radius: 999px; color: var(--deep-sea); background: rgba(255,255,255,.7); font-size: 9px; }
.voice-interrupt:disabled { opacity: .36; cursor: default; }
.voice-settings { margin: 10px 18px 0; padding: 10px 13px; border: 1px solid rgba(62,145,170,.16); border-radius: 12px; background: rgba(255,255,255,.56); }
.voice-settings summary { color: var(--deep-sea); font-size: 10px; font-weight: 700; cursor: pointer; }
.voice-settings-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; margin-top: 11px; }
.voice-settings-grid label { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px; align-items: center; color: var(--muted); font-size: 8px; font-weight: 700; }
.voice-settings-grid select, .voice-settings-grid input { grid-column: 1 / -1; padding: 8px 9px; font-size: 9px; }
.voice-settings-grid input[type="range"] { padding: 3px 0; accent-color: var(--sea); }
.voice-settings-grid output { color: var(--sea); font: 700 8px/1 Consolas, monospace; }
.voice-shortcuts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.voice-shortcuts button { padding: 6px 9px; border: 1px solid rgba(62,145,170,.18); border-radius: 999px; color: var(--deep-sea); background: rgba(255,255,255,.62); font-size: 8px; cursor: pointer; }
.voice-shortcuts button:hover { border-color: var(--sea); transform: translateY(-1px); }
.voice-settings-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; }
.voice-switch { display: flex; align-items: center; gap: 7px; color: var(--navy-soft); font-size: 9px; }
.voice-switch input { width: 16px; height: 16px; margin: 0; accent-color: var(--sea); }
.voice-settings > small { display: block; margin-top: 8px; color: var(--muted); font-size: 8px; line-height: 1.55; }
.message-list { display: grid; align-content: start; gap: 16px; flex: 1; max-height: calc(100vh - 330px); padding: 26px; overflow: auto; }
.message { max-width: 86%; display: grid; grid-template-columns: 36px minmax(0,1fr); gap: 10px; }
.message.user { margin-left: auto; grid-template-columns: minmax(0,1fr) 36px; }
.message.user .avatar { grid-column: 2; }
.message.user .bubble { grid-column: 1; grid-row: 1; color: #fff; background: var(--deep-sea); }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--navy); background: var(--sun); font: 700 12px/1 Georgia, serif; }
.message.user .avatar { color: #fff; background: var(--coral); }
.bubble { padding: 13px 15px; border: 1px solid var(--line); border-radius: 15px 15px 15px 4px; background: #fff; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.user .bubble { border-radius: 15px 15px 4px 15px; }
.agent-suggestions { width: min(100%, 760px); display: grid; gap: 10px; padding: 14px; border: 1px solid rgba(34,104,120,.16); border-radius: 14px; background: linear-gradient(120deg, rgba(255,255,255,.92), rgba(221,241,234,.76)); box-shadow: 0 10px 28px rgba(34,74,82,.08); }
.suggestion-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; padding: 1px 2px 3px; }
.suggestion-heading > div { display: grid; gap: 3px; }
.suggestion-heading span { color: var(--sea); font: 700 8px/1.2 Consolas, monospace; letter-spacing: .14em; text-transform: uppercase; }
.suggestion-heading strong { color: var(--navy); font-size: 13px; }
.suggestion-heading > small { color: var(--muted); font-size: 8px; white-space: nowrap; }
.suggestion-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; }
.suggestion-card { min-width: 0; display: grid; align-content: start; gap: 8px; padding: 13px; border: 1px solid rgba(31,67,75,.09); border-radius: 10px; background: rgba(255,255,255,.75); }
.suggestion-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.suggestion-card-top span { padding: 3px 7px; border-radius: 999px; color: var(--deep-sea); background: var(--mint); font-size: 8px; font-weight: 700; }
.suggestion-card-top small { color: var(--muted); font-size: 8px; }
.suggestion-card > strong { color: var(--navy); font-size: 12px; line-height: 1.45; }
.suggestion-card > p { display: -webkit-box; margin: 0; overflow: hidden; color: var(--navy-soft); font-size: 9px; line-height: 1.6; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.suggestion-actions { display: flex; align-items: center; gap: 7px; margin-top: 2px; }
.suggestion-confirm, .suggestion-dismiss { min-height: 32px; padding: 7px 10px; border-radius: 8px; font-size: 9px; }
.suggestion-confirm { color: #fff; background: var(--deep-sea); }
.suggestion-dismiss { color: var(--muted); background: transparent; }
.suggestion-confirm:hover { transform: translateY(-1px); }
.suggestion-confirm:disabled, .suggestion-dismiss:disabled { opacity: .55; cursor: wait; }
.composer { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; padding: 15px; border-top: 1px solid var(--line); background: rgba(200,244,216,.4); }
.composer textarea { min-height: 50px; max-height: 150px; resize: none; }
.composer small { grid-column: 1 / -1; color: var(--muted); font-size: 8px; }
.send-button { min-width: 96px; display: flex; align-items: center; justify-content: center; gap: 10px; border-radius: 12px; color: #fff; background: var(--coral); }
.send-button b { font-size: 18px; }
.send-button:hover { transform: translateY(-2px); }
.send-button:disabled { opacity: .6; cursor: wait; }
.chat-side { display: grid; align-content: start; gap: 14px; }
.chat-side section { padding: 20px; }
.chat-side strong { display: block; margin: 16px 0 5px; color: var(--sea); font: 700 58px/1 Georgia, serif; }
.chat-side p { color: var(--muted); font-size: 11px; line-height: 1.7; }
.chat-rule { background: var(--sun); }
.chat-rule p { color: var(--navy); font-weight: 700; }

.memory-grid { display: grid; grid-template-columns: minmax(330px,.7fr) minmax(480px,1.3fr); gap: 18px; }
.memory-grid > section { padding: 24px; }
.memory-suggestions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.memory-suggestions .eyebrow { width: 100%; margin-bottom: 4px; }
.memory-suggestions button { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--foam); font-size: 9px; }
.memory-list { display: grid; gap: 10px; }
.memory-card { position: relative; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.74); }
.memory-card > div { display: flex; justify-content: space-between; color: var(--muted); font: 8px/1 Consolas, monospace; text-transform: uppercase; }
.memory-card p { margin: 10px 0; font-size: 11px; line-height: 1.7; }

.toast { position: fixed; z-index: 20; right: 24px; bottom: 24px; max-width: 380px; padding: 14px 18px; border-radius: 12px; color: #fff; background: var(--deep-sea); box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .25s; }
.toast.is-visible { opacity: 1; transform: none; }
.toast.is-error { background: #a62d42; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* B + D: Japanese seaside morning × tropical field notebook */
body[data-theme="seaside-notebook"] {
  --sand: #edf6f7;
  --paper: #fffef8;
  --foam: #f3f8f3;
  --navy: #173a57;
  --navy-soft: #456275;
  --aqua: #78c7d2;
  --sea: #3e91aa;
  --deep-sea: #1f536b;
  --sun: #e9d49a;
  --sun-deep: #bd9b55;
  --coral: #d9826b;
  --watermelon: #cf6f7b;
  --leaf: #718b75;
  --mint: #dcebdd;
  --line: rgba(23, 58, 87, .12);
  --muted: #718692;
  --shadow: 0 24px 70px rgba(48, 100, 117, .11);
  --soft-shadow: 0 12px 30px rgba(48, 100, 117, .075);
  background:
    radial-gradient(circle at 78% 12%, rgba(255,255,255,.92), transparent 24%),
    linear-gradient(145deg, #e9f6f8 0%, #f8fbf7 44%, #e8f3ee 100%);
  color: var(--navy);
  font-family: "Microsoft YaHei UI", "Yu Gothic UI", "PingFang SC", sans-serif;
}

body[data-theme="seaside-notebook"]::after {
  content: "";
  position: fixed;
  z-index: 0;
  inset: 0;
  opacity: .28;
  pointer-events: none;
  background:
    repeating-linear-gradient(7deg, transparent 0 4px, rgba(34,88,105,.018) 5px 6px),
    repeating-linear-gradient(93deg, transparent 0 7px, rgba(255,255,255,.28) 8px 9px);
  mix-blend-mode: multiply;
}

[data-theme="seaside-notebook"] .summer-glow {
  top: -180px;
  right: -40px;
  width: min(48vw, 690px);
  background: radial-gradient(circle, rgba(255,252,230,.95) 0 18%, rgba(232,242,226,.46) 42%, transparent 71%);
  animation-duration: 13s;
}

[data-theme="seaside-notebook"] .summer-cloud {
  opacity: .38;
  background: rgba(255,255,255,.82);
  filter: blur(1.2px);
}

[data-theme="seaside-notebook"] .water-caustics {
  right: -18%;
  bottom: -26%;
  opacity: .13;
  filter: blur(2px);
}

[data-theme="seaside-notebook"] .leaf-shadow {
  opacity: .11;
  filter: blur(5px);
  background:
    radial-gradient(ellipse at 18% 22%, #416d5b 0 7%, transparent 7.5%),
    radial-gradient(ellipse at 35% 46%, #416d5b 0 9%, transparent 9.5%),
    radial-gradient(ellipse at 52% 18%, #416d5b 0 8%, transparent 8.5%),
    radial-gradient(ellipse at 66% 52%, #416d5b 0 10%, transparent 10.5%),
    radial-gradient(ellipse at 82% 25%, #416d5b 0 8%, transparent 8.5%),
    linear-gradient(118deg, transparent 49%, #416d5b 49.5% 51%, transparent 51.5%);
}

[data-theme="seaside-notebook"] .sidebar {
  border-color: rgba(255,255,255,.92);
  border-radius: 18px 34px 22px 10px;
  background:
    linear-gradient(90deg, rgba(31,83,107,.08) 0 9px, transparent 9px),
    radial-gradient(circle at 85% 4%, rgba(120,199,210,.2), transparent 18%),
    linear-gradient(165deg, rgba(255,254,248,.95), rgba(244,249,245,.82));
  box-shadow: 0 26px 70px rgba(37, 84, 101, .13);
  backdrop-filter: blur(16px);
}

[data-theme="seaside-notebook"] .sidebar::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 9px;
  border-left: 1px dashed rgba(31,83,107,.18);
}

[data-theme="seaside-notebook"] .sidebar::after {
  right: -72px;
  bottom: 10%;
  border-width: 12px;
  border-color: rgba(62,145,170,.09);
}

[data-theme="seaside-notebook"] .brand-mark {
  border: 1px solid rgba(23,58,87,.22);
  border-radius: 16px 16px 16px 5px;
  color: var(--deep-sea);
  background: #fffef8;
  box-shadow: 5px 5px 0 #d7e7e4;
  font-family: "Yu Mincho", "STSong", serif;
  transform: rotate(-3deg);
}

[data-theme="seaside-notebook"] .brand small { color: var(--leaf); letter-spacing: .11em; }
[data-theme="seaside-notebook"] .nav-list { gap: 9px; }

[data-theme="seaside-notebook"] .nav-item {
  border-radius: 10px 16px 16px 5px;
  color: var(--navy-soft);
}

[data-theme="seaside-notebook"] .nav-item:hover {
  background: rgba(226,239,238,.64);
}

[data-theme="seaside-notebook"] .nav-item.is-active {
  border-color: rgba(62,145,170,.18);
  background: #dfeef0;
  box-shadow: 0 9px 20px rgba(62,145,170,.11);
}

[data-theme="seaside-notebook"] .nav-item.is-active::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--coral);
}

[data-theme="seaside-notebook"] .sidebar-rule {
  border-color: rgba(23,58,87,.12);
  border-radius: 5px 16px 9px 12px;
  background:
    repeating-linear-gradient(transparent 0 26px, rgba(62,145,170,.09) 27px 28px),
    rgba(255,254,248,.76);
  box-shadow: 0 10px 24px rgba(48,100,117,.07);
  transform: rotate(-.8deg);
}

[data-theme="seaside-notebook"] .sidebar-rule::after {
  content: "私";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(207,111,123,.5);
  border-radius: 50%;
  color: rgba(180,76,87,.75);
  font: 11px/1 "STKaiti", serif;
  transform: rotate(8deg);
}

[data-theme="seaside-notebook"] .topbar h1,
[data-theme="seaside-notebook"] .section-heading h3,
[data-theme="seaside-notebook"] .page-lead h2,
[data-theme="seaside-notebook"] .chat-intro h2 {
  font-family: "Yu Mincho", "YuMincho", "STSong", serif;
}

[data-theme="seaside-notebook"] .status-pill {
  border-color: rgba(255,255,255,.94);
  background: rgba(255,255,251,.62);
  box-shadow: none;
}

[data-theme="seaside-notebook"] .summer-hero {
  min-height: 304px;
  border-color: rgba(23,58,87,.1);
  border-radius: 12px 34px 18px 8px;
  background:
    linear-gradient(102deg, rgba(255,254,248,.96) 0 63%, rgba(225,240,239,.78) 63% 100%);
  box-shadow: 0 28px 70px rgba(46, 96, 111, .1);
}

[data-theme="seaside-notebook"] .summer-hero::before {
  opacity: .42;
  background:
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(62,145,170,.075) 32px 33px),
    radial-gradient(circle at 89% 12%, rgba(113,139,117,.12) 0 2px, transparent 3px) 0 0 / 28px 28px;
}

[data-theme="seaside-notebook"] .summer-hero::after {
  content: "";
  position: absolute;
  top: -18px;
  left: 10%;
  width: 116px;
  height: 34px;
  background: rgba(224,214,185,.52);
  box-shadow: 0 2px 4px rgba(80,70,50,.04);
  transform: rotate(-2deg);
}

[data-theme="seaside-notebook"] .summer-hero h2 {
  font-family: "Yu Mincho", "YuMincho", "STKaiti", "STSong", serif;
  font-weight: 600;
  letter-spacing: -.015em;
}

[data-theme="seaside-notebook"] .summer-hero h2 em,
[data-theme="seaside-notebook"] .page-lead h2 em,
[data-theme="seaside-notebook"] .chat-intro h2 em { color: var(--sea); }

[data-theme="seaside-notebook"] .hero-kicker {
  color: var(--leaf);
  letter-spacing: .14em;
}

[data-theme="seaside-notebook"] .hero-sun {
  top: 54px;
  right: 8%;
  width: 116px;
  height: 116px;
  border: 1px solid rgba(62,145,170,.28);
  color: var(--deep-sea);
  background: rgba(255,254,248,.66);
  box-shadow: 0 0 0 12px rgba(120,199,210,.08);
  font-family: "Yu Mincho", "STSong", serif;
  font-size: 15px;
  letter-spacing: .16em;
  transform: rotate(4deg);
}

[data-theme="seaside-notebook"] .hero-wave {
  right: -9%;
  bottom: -95px;
  border-width: 20px;
  border-color: rgba(62,145,170,.23);
}

[data-theme="seaside-notebook"] .primary-button {
  border-radius: 9px 15px 15px 5px;
  background: var(--deep-sea);
  box-shadow: 0 9px 18px rgba(31,83,107,.14);
}

[data-theme="seaside-notebook"] .ghost-button {
  border-color: rgba(31,83,107,.28);
  border-radius: 9px 15px 15px 5px;
  background: rgba(255,254,248,.7);
}

[data-theme="seaside-notebook"] .ghost-button:hover { background: #e2efeb; }

[data-theme="seaside-notebook"] .summer-sheet {
  position: relative;
  border-color: rgba(23,58,87,.1);
  border-radius: 9px 22px 14px 7px;
  background:
    repeating-linear-gradient(0deg, transparent 0 35px, rgba(62,145,170,.035) 36px 37px),
    rgba(255,254,248,.78);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(10px);
}

[data-theme="seaside-notebook"] .quick-capture-card {
  background:
    repeating-linear-gradient(0deg, transparent 0 34px, rgba(62,145,170,.1) 35px 36px),
    #fcf8ea;
  clip-path: polygon(0 2%, 98% 0, 100% 96%, 97% 100%, 2% 99%, 0 94%);
  transform: rotate(-.2deg);
}

[data-theme="seaside-notebook"] .quick-capture-card::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: -8px;
  left: 42%;
  width: 94px;
  height: 25px;
  background: rgba(205,221,205,.68);
  transform: rotate(1.5deg);
}

[data-theme="seaside-notebook"] .quick-capture-card textarea {
  border: 0;
  border-radius: 5px 12px 9px 4px;
  background: rgba(255,255,255,.52);
  box-shadow: inset 3px 0 0 rgba(207,111,123,.25);
}

[data-theme="seaside-notebook"] .task-card {
  overflow: hidden;
  background: rgba(250,253,251,.8);
}

[data-theme="seaside-notebook"] .task-card::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -30px;
  width: 130px;
  height: 130px;
  opacity: .07;
  border: 10px double var(--leaf);
  border-radius: 50%;
  pointer-events: none;
}

[data-theme="seaside-notebook"] .metric-card {
  border-color: rgba(23,58,87,.08);
  border-radius: 5px 14px 9px 4px;
  background: rgba(255,254,248,.72);
  box-shadow: 0 8px 20px rgba(48,100,117,.055);
}

[data-theme="seaside-notebook"] .metric-card:nth-child(even) { transform: rotate(.35deg); }
[data-theme="seaside-notebook"] .metric-card:nth-child(odd) { transform: rotate(-.25deg); }

[data-theme="seaside-notebook"] .command-board::before,
[data-theme="seaside-notebook"] .data-source-card::before {
  content: "";
  position: absolute;
  top: -7px;
  width: 58px;
  height: 20px;
  background: rgba(203,219,212,.56);
}

[data-theme="seaside-notebook"] .command-board::before { left: 28px; transform: rotate(-2deg); }
[data-theme="seaside-notebook"] .data-source-card::before { right: 26px; transform: rotate(3deg); }

[data-theme="seaside-notebook"] .command-lane {
  border-color: rgba(23,58,87,.08);
  border-radius: 7px 17px 11px 5px;
  background: rgba(238,246,240,.7);
}

[data-theme="seaside-notebook"] .lane-item,
[data-theme="seaside-notebook"] .work-card,
[data-theme="seaside-notebook"] .draft-card,
[data-theme="seaside-notebook"] .memory-card {
  border-radius: 6px 14px 10px 4px;
  background: rgba(255,254,248,.84);
  box-shadow: 0 6px 16px rgba(48,100,117,.055);
}

[data-theme="seaside-notebook"] input,
[data-theme="seaside-notebook"] textarea,
[data-theme="seaside-notebook"] select {
  border-color: rgba(23,58,87,.14);
  border-radius: 7px 12px 10px 4px;
  background: rgba(255,255,252,.76);
}

[data-theme="seaside-notebook"] .page-number {
  border: 1px solid rgba(23,58,87,.12);
  border-radius: 7px 13px 10px 4px;
  background: #e3eeee;
  box-shadow: 4px 4px 0 rgba(113,139,117,.18);
}

[data-theme="seaside-notebook"] .page-number.watermelon,
[data-theme="seaside-notebook"] .page-number.leaf {
  color: var(--navy);
  background: #e8e0cc;
  box-shadow: 4px 4px 0 rgba(62,145,170,.15);
}

[data-theme="seaside-notebook"] .chat-intro {
  background:
    linear-gradient(110deg, rgba(255,254,248,.9), rgba(225,240,239,.72)),
    repeating-linear-gradient(0deg, transparent 0 35px, rgba(62,145,170,.07) 36px 37px);
}

[data-theme="seaside-notebook"] .chat-intro::after {
  color: rgba(62,145,170,.055);
  font-family: "Yu Mincho", "STSong", serif;
}

[data-theme="seaside-notebook"] .chat-rule { background: #e8e0cc; }
[data-theme="seaside-notebook"] .generator-card { background: rgba(232,242,233,.82); }
[data-theme="seaside-notebook"] .manual-draft-card { background: rgba(250,246,232,.84); }
[data-theme="seaside-notebook"] .model-picker { border-color: rgba(23,58,87,.12); background: rgba(250,246,232,.76); }
[data-theme="seaside-notebook"] .model-picker select { background-color: rgba(232,242,233,.9); }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(3,1fr); }
  .dashboard-grid, .work-layout { grid-template-columns: 1fr; }
  .factory-pulse-body { grid-template-columns: 1fr; }
  .create-panel { position: static; max-height: none; }
  .dashboard-side { grid-template-columns: 1fr; }
  .hero-sun { right: 5%; width: 140px; height: 140px; }
  .summer-hero .hero-copy { max-width: 68%; }
}

@media (max-width: 920px) {
  .app-shell { grid-template-columns: 82px minmax(0,1fr); }
  .sidebar { padding: 23px 12px; align-items: center; }
  .brand > span:last-child, .sidebar-rule { display: none; }
  .nav-list { width: 100%; margin-top: 56px; }
  .nav-item { grid-template-columns: 1fr; justify-items: center; gap: 3px; padding: 7px 3px; }
  .nav-item b { font-size: 9px; }
  .nav-item span { font-size: 8px; }
  .workspace { padding-inline: 22px; }
  .summer-hero .hero-copy { max-width: 100%; }
  .personal-row { grid-template-columns: 1fr; }
  .time-ledger { padding: 16px; }
  .time-ledger-head { align-items: flex-start; flex-wrap: wrap; }
  .time-ledger-head h3 { font-size: 24px; }
  .time-month-tools { width: 100%; justify-content: space-between; }
  .time-month-tools button { width: 48px; height: 48px; }
  .time-summary { gap: 5px; }
  .time-summary > div { min-height: 82px; display: grid; grid-template-columns: 1fr auto; gap: 2px; padding: 9px; }
  .time-summary span { grid-column: 1 / -1; margin: 0; }
  .time-ledger-body { grid-template-columns: 1fr; }
  .time-calendar-wrap { padding: 7px; }
  .time-weekdays, .time-calendar { gap: 3px; }
  .time-day { min-height: 58px; padding: 6px 5px; }
  .time-day-number { font-size: 13px; }
  .time-day-tags i { padding: 2px 4px; font-size: 11px; }
  .time-record-form { padding: 16px; }
  .time-record-title { align-items: flex-start; flex-wrap: wrap; }
  .time-record-title input { width: 100%; min-height: 48px; font-size: 16px; }
  .time-kind-switches span { min-height: 48px; }
  .hero-sun { opacity: .18; right: -20px; }
  .lane-grid, .draft-list { grid-template-columns: 1fr; }
  .communication-grid, .memory-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  body { padding-bottom: 72px; animation: none; background-size: cover; }
  .summer-scene > * { animation: none !important; }
  .summer-cloud, .leaf-shadow { display: none; }
  .summer-glow { opacity: .72; transform: scale(.96); }
  .water-caustics { opacity: .12; filter: none; transform: rotate(-8deg); }
  .sidebar, .model-picker, .status-pill, .summer-sheet { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .voice-toggle.is-active .voice-orb::before { animation: none; opacity: .45; transform: scale(1.18); }
  .view { animation: none; }
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 12; top: auto; bottom: 0; width: 100%; height: 68px; padding: 7px 9px; flex-direction: row; border-radius: 18px 18px 0 0; }
  .brand, .sidebar-rule { display: none; }
  .nav-list { width: 100%; margin: 0; grid-template-columns: repeat(6,1fr); gap: 2px; }
  .nav-item { min-height: 54px; border-radius: 10px; }
  .nav-item:hover { transform: none; }
  .workspace { padding: 0 13px 22px; }
  .topbar { min-height: 92px; align-items: flex-start; padding-top: 15px; }
  .mobile-back:not([hidden]) { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(18,76,99,.14); border-radius: 50%; color: var(--deep-sea); background: rgba(255,255,255,.76); font-size: 20px; }
  .topbar h1 { font-size: 21px; }
  .topbar-tools { display: grid; justify-items: end; gap: 4px; }
  .model-picker { padding: 3px 4px 3px 8px; }
  .model-picker select { min-width: 82px; padding-block: 3px; font-size: 9px; }
  .status-cluster { display: grid; gap: 4px; }
  .status-pill { padding: 6px 7px; font-size: 8px; }
  .summer-hero { min-height: 430px; padding: 32px 22px; }
  .summer-hero h2 { font-size: 40px; }
  .summer-hero p { font-size: 12px; }
  .hero-sun { top: auto; right: 30px; bottom: 40px; width: 112px; height: 112px; opacity: 1; }
  .hero-wave { right: -32%; bottom: -105px; }
  .time-ledger-entry { min-height: 78px; grid-template-columns: minmax(0,1fr) auto 28px; gap: 10px; padding: 14px; }
  .time-entry-copy > strong { font-size: 16px; }
  .time-entry-balance { min-width: 78px; padding: 8px 10px; }
  .time-entry-balance strong { font-size: 20px; }
  .time-entry-arrow { width: 28px; height: 28px; }
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .metric-card { min-height: 58px; }
  .dashboard-side { grid-template-columns: 1fr; }
  .command-board, .data-source-card, .task-card, .generator-card, .manual-draft-card, .draft-queue { padding: 18px; }
  .page-lead { padding-top: 31px; }
  .page-lead h2 { font-size: 39px; }
  .field-row.two, .field-row.three { grid-template-columns: 1fr; }
  .work-actions { grid-template-columns: 1fr 1fr; }
  .work-actions .quick-status { grid-column: 1 / -1; }
  .work-meta { grid-template-columns: 1fr; }
  .draft-head, .draft-foot { align-items: flex-start; flex-direction: column; }
  .chat-layout { grid-template-columns: 1fr; padding-top: 14px; }
  .chat-panel { min-height: calc(100vh - 184px); }
  .chat-intro { padding: 32px 20px; }
  .chat-intro h2 { font-size: 39px; }
  .voice-dock { grid-template-columns: auto minmax(0,1fr); gap: 10px; margin-inline: 10px; padding: 10px; }
  .voice-toggle { padding-right: 9px; }
  .voice-toggle b { display: none; }
  .voice-copy small { font-size: 7px; }
  .voice-interrupt { grid-column: 1 / -1; width: 100%; }
  .voice-settings { margin-inline: 10px; }
  .voice-settings-grid { grid-template-columns: 1fr 1fr; }
  .voice-settings-grid label:first-child { grid-column: 1 / -1; }
  .factory-pulse-head, .factory-pulse-body, .factory-pulse-foot { padding-inline: 14px; }
  .factory-pulse-metrics { grid-template-columns: repeat(2,1fr); }
  .message-list { max-height: none; padding: 18px; }
  .message { max-width: 96%; }
  .agent-suggestions { padding: 11px; }
  .suggestion-heading { align-items: start; }
  .suggestion-grid { grid-template-columns: 1fr; }
  .suggestion-confirm, .suggestion-dismiss { min-height: 42px; padding-inline: 14px; }
  .composer { grid-template-columns: minmax(0,1fr) 78px; }
  .send-button { min-width: 0; }
  .chat-side { grid-template-columns: repeat(2,1fr); }
  .chat-side strong { font-size: 40px; }
  .quick-task-form { grid-template-columns: minmax(0,1fr) 38px; }
  .quick-task-form input[type="date"] { grid-column: 1 / -1; grid-row: 2; }
  body[data-theme="seaside-notebook"] .hero-sun {
    top: 14px;
    right: 14px;
    bottom: auto;
    width: 58px;
    height: 58px;
    opacity: .72;
    font-size: 9px;
    box-shadow: 0 0 0 7px rgba(120,199,210,.07);
  }
  body[data-theme="seaside-notebook"] .nav-item.is-active::after { display: none; }
}

/* James Control Room — cream grid, black rails, signal colors */
body[data-theme="control-room"] {
  --sand: #f2efe6;
  --paper: #fffdf6;
  --foam: #ece9df;
  --navy: #171912;
  --navy-soft: #55584f;
  --aqua: #246bfe;
  --sea: #246bfe;
  --deep-sea: #171912;
  --sun: #d8ff3e;
  --sun-deep: #bce821;
  --coral: #ff7a24;
  --watermelon: #ee3e3e;
  --leaf: #6a8d1f;
  --mint: #d8ff3e;
  --line: rgba(23, 25, 18, .16);
  --muted: #6d7067;
  --shadow: 0 18px 42px rgba(23, 25, 18, .09);
  --soft-shadow: 0 8px 20px rgba(23, 25, 18, .07);
  color: var(--navy);
  background-color: var(--sand);
  background-image:
    linear-gradient(rgba(23,25,18,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23,25,18,.045) 1px, transparent 1px);
  background-size: 28px 28px;
  animation: none;
  font-family: "Bahnschrift", "DIN Alternate", "Microsoft YaHei UI", sans-serif;
}

[data-theme="control-room"] .summer-scene { display: none; }
[data-theme="control-room"] .app-shell { grid-template-columns: 216px minmax(0, 1fr); }
[data-theme="control-room"] .sidebar {
  top: 0;
  height: 100vh;
  margin: 0;
  padding: 30px 18px 22px;
  color: #f6f3e8;
  border: 0;
  border-radius: 0;
  background: #171912;
  box-shadow: none;
  backdrop-filter: none;
}
[data-theme="control-room"] .sidebar::after {
  right: -70px;
  bottom: 10%;
  border-color: rgba(216,255,62,.1);
  border-radius: 0;
}
[data-theme="control-room"] .brand { color: #fffdf6; }
[data-theme="control-room"] .brand-mark {
  color: #171912;
  border: 0;
  border-radius: 3px;
  background: var(--sun);
  box-shadow: 5px 5px 0 #fffdf6;
}
[data-theme="control-room"] .brand small { color: #999d8e; letter-spacing: .16em; }
[data-theme="control-room"] .nav-list { gap: 6px; }
[data-theme="control-room"] .nav-item {
  min-height: 44px;
  padding: 9px 10px;
  grid-template-columns: 24px 1fr;
  color: #b8bbad;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
}
[data-theme="control-room"] .nav-item::before { font-family: Consolas, monospace; color: #777b6d; }
[data-theme="control-room"] .nav-item:nth-child(1)::before { content: "01"; }
[data-theme="control-room"] .nav-item:nth-child(2)::before { content: "02"; }
[data-theme="control-room"] .nav-item:nth-child(3)::before { content: "03"; }
[data-theme="control-room"] .nav-item:nth-child(4)::before { content: "04"; }
[data-theme="control-room"] .nav-item:nth-child(5)::before { content: "05"; }
[data-theme="control-room"] .nav-item:nth-child(6)::before { content: "06"; }
[data-theme="control-room"] .nav-item:nth-child(7)::before { content: "07"; }
[data-theme="control-room"] .nav-item:nth-child(8)::before { content: "08"; }
[data-theme="control-room"] .nav-item:nth-child(9)::before { content: "09"; }
[data-theme="control-room"] .nav-item:hover { color: white; background: rgba(255,255,255,.06); transform: none; }
[data-theme="control-room"] .nav-item.is-active {
  color: #171912;
  border-color: var(--sun);
  background: var(--sun);
  box-shadow: 4px 4px 0 rgba(255,255,255,.13);
}
[data-theme="control-room"] .nav-item.is-active::before { color: #171912; }
[data-theme="control-room"] .sidebar-meta { color: #f6f3e8; border-color: #3f4238; }
[data-theme="control-room"] .sidebar-meta small { color: #8b8f80; }
[data-theme="control-room"] .privacy-dot { background: var(--sun); box-shadow: 0 0 0 4px rgba(216,255,62,.12); }

[data-theme="control-room"] .workspace { padding: 0 32px 42px; }
[data-theme="control-room"] .workspace-header {
  position: sticky;
  z-index: 29;
  top: 0;
  overflow: hidden;
  border-bottom: 2px solid #171912;
  background: rgba(247,243,232,.98);
  backdrop-filter: blur(12px);
}
[data-theme="control-room"] .app-chrome {
  min-height: 68px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 4px;
  border-bottom: 1px solid #e4dcc8;
  background: transparent;
}
.chrome-signals {
  display: flex;
  align-items: center;
  gap: 9px;
}
.chrome-signal {
  width: 14px;
  height: 14px;
  display: block;
  border: 1px solid rgba(23,25,18,.08);
  border-radius: 50%;
  box-shadow: inset 0 1px 1px rgba(255,255,255,.55);
  opacity: .24;
  transition: box-shadow .2s ease, opacity .2s ease, transform .2s ease;
}
.chrome-signal:nth-child(1) { background: #ff5f57; }
.chrome-signal:nth-child(2) { background: #febc2e; }
.chrome-signal:nth-child(3) { background: #28c840; }
.chrome-signal.is-active {
  opacity: 1;
  box-shadow: 0 0 0 4px rgba(23,25,18,.055), inset 0 1px 1px rgba(255,255,255,.58);
}
.chrome-signal.is-checking { animation: chromePulse 1.5s ease-in-out infinite alternate; }
.chrome-signal:hover { transform: scale(1.16); }
@keyframes chromePulse {
  from { opacity: .42; }
  to { opacity: 1; }
}
.chrome-brand {
  display: inline-flex;
  align-items: center;
  justify-self: center;
  gap: 2px;
  color: #171912;
  text-decoration: none;
}
.chrome-brand > span {
  font-size: 20px;
  transform: translateY(-1px);
}
.chrome-brand strong {
  font: 500 25px/1 Georgia, "STSong", serif;
  letter-spacing: .01em;
}
.chrome-review {
  position: relative;
  justify-self: end;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: white;
  background: #72a9f7;
  box-shadow: 0 6px 16px rgba(72,119,186,.18);
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}
.chrome-review:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(72,119,186,.25);
}
.chrome-review > span { font-size: 22px; font-weight: 800; line-height: 1; }
.chrome-review > b {
  position: absolute;
  top: -4px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid #fffdf6;
  border-radius: 999px;
  color: white;
  background: #416ba8;
  font: 800 10px/1 Consolas, monospace;
}
.chrome-review.is-clear { opacity: .58; }
[data-theme="control-room"] .topbar {
  min-height: 88px;
  border-bottom: 0;
  background: transparent;
  backdrop-filter: none;
}
[data-theme="control-room"] .topbar-title h1 { letter-spacing: -.04em; }
[data-theme="control-room"] .eyebrow,
[data-theme="control-room"] .hero-kicker { color: #55584f; font-family: Consolas, monospace; letter-spacing: .13em; }
[data-theme="control-room"] .status-pill,
[data-theme="control-room"] .model-picker,
[data-theme="control-room"] .install-app {
  border-color: rgba(23,25,18,.25);
  border-radius: 2px;
  background: #fffdf6;
  box-shadow: none;
}
[data-theme="control-room"] .status-pill.is-ready i { background: var(--sun-deep); }

[data-theme="control-room"] .summer-sheet,
[data-theme="control-room"] .metric-card,
[data-theme="control-room"] .chat-panel {
  border: 1px solid #c9c6bb;
  border-radius: 3px;
  background: rgba(255,253,246,.96);
  box-shadow: var(--soft-shadow);
  backdrop-filter: none;
}
[data-theme="control-room"] .summer-hero {
  min-height: 220px;
  border: 2px solid #171912;
  border-radius: 3px;
  background:
    linear-gradient(90deg, rgba(216,255,62,.92) 0 10px, transparent 10px),
    #fffdf6;
  box-shadow: 9px 9px 0 #171912;
}
[data-theme="control-room"] .summer-hero::before,
[data-theme="control-room"] .summer-hero::after { border-radius: 0; opacity: .09; }
[data-theme="control-room"] .hero-copy h2 { font-size: clamp(32px,5vw,64px); letter-spacing: -.06em; text-transform: uppercase; }
[data-theme="control-room"] .workspace-date { color: #fffdf6; border-radius: 2px; background: #171912; }
[data-theme="control-room"] .primary-button,
[data-theme="control-room"] .send-button {
  color: #171912;
  border: 1px solid #171912;
  border-radius: 2px;
  background: var(--sun);
  box-shadow: 4px 4px 0 #171912;
}
[data-theme="control-room"] .primary-button:hover,
[data-theme="control-room"] .send-button:hover { transform: translate(-1px,-1px); box-shadow: 6px 6px 0 #171912; }
[data-theme="control-room"] .ghost-button,
[data-theme="control-room"] .text-link,
[data-theme="control-room"] input,
[data-theme="control-room"] textarea,
[data-theme="control-room"] select { border-radius: 2px; }
[data-theme="control-room"] input:focus,
[data-theme="control-room"] textarea:focus,
[data-theme="control-room"] select:focus { outline: 2px solid #246bfe; outline-offset: 1px; }
[data-theme="control-room"] .metric-card { border-top: 5px solid #171912; }
[data-theme="control-room"] .metric-card.waiting { border-top-color: #246bfe; }
[data-theme="control-room"] .metric-card.risk,
[data-theme="control-room"] .metric-card.overdue { border-top-color: #ee3e3e; }
[data-theme="control-room"] .metric-card.input { border-top-color: #ff7a24; }
[data-theme="control-room"] .metric-card.closed { border-top-color: #94bf20; }
[data-theme="control-room"] .work-card,
[data-theme="control-room"] .draft-row,
[data-theme="control-room"] .memory-row,
[data-theme="control-room"] .lane-item { border-radius: 2px; }

.meeting-page-lead { max-width: 920px; }
.meeting-layout { display: grid; grid-template-columns: minmax(240px, .7fr) minmax(0, 2.3fr); gap: 16px; align-items: start; }
.meeting-index-panel { position: sticky; top: 104px; max-height: calc(100vh - 124px); overflow: auto; padding: 16px; }
.meeting-count { min-width: 28px; height: 28px; display: grid; place-items: center; color: #fffdf6; background: #171912; font: 700 13px Consolas, monospace; }
.meeting-list { display: grid; gap: 8px; }
.meeting-list-item { width: 100%; padding: 12px; text-align: left; border: 1px solid #d2cfc4; border-radius: 2px; background: #f7f4eb; }
.meeting-list-item:hover { border-color: #171912; }
.meeting-list-item.is-active { border-color: #171912; background: #fffdf6; box-shadow: inset 5px 0 var(--sun), 4px 4px 0 #171912; }
.meeting-list-item > span { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.meeting-list-item b { font: 800 12px Consolas, monospace; }
.meeting-list-item strong { display: block; margin: 10px 0 6px; font-size: 14px; line-height: 1.35; }
.meeting-list-item small { color: var(--muted); }
.meeting-state { display: inline-flex; align-items: center; min-height: 22px; padding: 3px 7px; color: #171912; background: #ffb678; font: 700 9px Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; }
.meeting-state.confirmed { background: var(--sun); }
.meeting-detail { min-width: 0; padding: 0; overflow: hidden; }
.meeting-hero { padding: clamp(22px,4vw,46px); color: #fffdf6; background: #171912; }
.meeting-hero > div { display: flex; flex-wrap: wrap; gap: 8px; }
.meeting-code { padding: 4px 8px; color: #171912; background: var(--sun); font: 900 12px Consolas, monospace; }
.meeting-hero h2 { max-width: 900px; margin: 24px 0 10px; font-size: clamp(28px,4.3vw,56px); line-height: 1.02; letter-spacing: -.055em; }
.meeting-hero > p { max-width: 820px; color: #cfd2c6; line-height: 1.75; }
.meeting-hero dl { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; margin: 28px 0 0; background: #4b4e43; }
.meeting-hero dl div { padding: 10px 12px; background: #25271f; }
.meeting-hero dt { color: #999d8f; font: 10px Consolas, monospace; text-transform: uppercase; }
.meeting-hero dd { margin: 5px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.meeting-metrics { display: grid; grid-template-columns: repeat(auto-fit,minmax(130px,1fr)); gap: 1px; background: #171912; border-bottom: 2px solid #171912; }
.meeting-metrics article { min-height: 110px; padding: 15px; display: grid; align-content: space-between; background: #fffdf6; border-top: 6px solid #246bfe; }
.meeting-metrics article.tone-risk { border-top-color: #ee3e3e; }
.meeting-metrics article.tone-pending { border-top-color: #ff7a24; }
.meeting-metrics article.tone-good { border-top-color: #9cca22; }
.meeting-metrics span { color: var(--muted); font-size: 11px; }
.meeting-metrics strong { margin: 10px 0; font-size: 25px; letter-spacing: -.04em; }
.meeting-metrics small { line-height: 1.4; }
.meeting-block { padding: clamp(20px,3vw,34px); border-bottom: 1px solid #c9c6bb; }
.meeting-block-head { margin-bottom: 18px; }
.meeting-block-head h3 { margin: 5px 0; font-size: 23px; }
.meeting-block-head > small { color: var(--muted); }
.meeting-timeline { display: grid; grid-template-columns: repeat(auto-fit,minmax(130px,1fr)); gap: 0; }
.meeting-timeline article { position: relative; min-height: 126px; padding: 18px 13px 12px; border-top: 4px solid #a3a69d; border-right: 1px solid #d5d2c8; }
.meeting-timeline article::before { content: ""; position: absolute; top: -9px; left: 12px; width: 11px; height: 11px; border: 2px solid #fffdf6; border-radius: 50%; background: #a3a69d; box-shadow: 0 0 0 1px #a3a69d; }
.meeting-timeline article.tone-active { border-top-color: #246bfe; }.meeting-timeline article.tone-active::before { background: #246bfe; box-shadow: 0 0 0 1px #246bfe; }
.meeting-timeline article.tone-gate { border-top-color: #ff7a24; }.meeting-timeline article.tone-gate::before { background: #ff7a24; box-shadow: 0 0 0 1px #ff7a24; }
.meeting-timeline article.tone-risk { border-top-color: #ee3e3e; }.meeting-timeline article.tone-risk::before { background: #ee3e3e; box-shadow: 0 0 0 1px #ee3e3e; }
.meeting-timeline time { display: block; color: var(--muted); font: 700 12px Consolas, monospace; }
.meeting-timeline strong { display: block; margin: 16px 0 7px; font-size: 16px; }
.meeting-timeline small { line-height: 1.5; }
.meeting-matrix-scroll { overflow-x: auto; border: 1px solid #171912; }
.meeting-matrix { width: 100%; min-width: 620px; border-collapse: collapse; }
.meeting-matrix th { color: #fffdf6; background: #171912; }
.meeting-matrix th,.meeting-matrix td { padding: 10px 12px; border: 1px solid #c9c6bb; text-align: left; font-size: 12px; }
.meeting-matrix tbody tr:nth-child(even) { background: #f2efe6; }
.meeting-note { margin: 12px 0 0; color: var(--muted); line-height: 1.6; }
.meeting-note.good { margin: 16px; padding: 12px; color: #34440f; background: #e7f8ae; }
.meeting-item-list { display: grid; gap: 10px; }
.meeting-item { padding: 15px; border: 1px solid #d0cdc2; border-left: 6px solid #71756a; background: #fffdf6; }
.meeting-item.kind-action { border-left-color: #246bfe; }
.meeting-item.kind-risk { border-left-color: #ee3e3e; }
.meeting-item.kind-decision { border-left-color: #ff7a24; }
.meeting-item.kind-dependency { border-left-color: #7d55c7; }
.meeting-item-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.meeting-kind { padding: 3px 7px; color: #fffdf6; background: #171912; font: 700 10px Consolas, monospace; }
.meeting-select { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; }
.meeting-select input { accent-color: #246bfe; }
.meeting-linked { margin-left: auto; padding: 4px 7px; border: 1px solid #171912; border-radius: 2px; background: var(--sun); font-size: 10px; }
.meeting-item h4 { margin: 11px 0 7px; font-size: 17px; }
.meeting-item > p { margin: 0; line-height: 1.7; white-space: pre-wrap; }
.meeting-item-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 11px; color: var(--muted); font-size: 10px; }
.meeting-proposal { margin-top: 12px; padding: 9px 11px; border: 1px dashed #ff7a24; background: #fff3e8; }
.meeting-proposal summary { cursor: pointer; font-weight: 700; }
.meeting-proposal p { margin: 8px 0 0; line-height: 1.55; }
.meeting-confirm-bar { position: sticky; bottom: 10px; z-index: 3; margin-top: 18px; padding: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #fffdf6; background: #171912; box-shadow: 0 8px 30px rgba(0,0,0,.2); }
.meeting-confirm-bar span { max-width: 580px; font-size: 12px; }
.meeting-source { margin: 20px; border: 1px solid #c9c6bb; }
.meeting-source summary { padding: 12px; cursor: pointer; font-weight: 700; background: #f2efe6; }
.meeting-source pre { max-height: 520px; margin: 0; padding: 16px; overflow: auto; white-space: pre-wrap; word-break: break-word; font: 12px/1.75 Consolas, "Microsoft YaHei UI", sans-serif; }

@media (max-width: 1040px) {
  .meeting-layout { grid-template-columns: 1fr; }
  .meeting-index-panel { position: static; max-height: none; }
  .meeting-list { grid-template-columns: repeat(auto-fit,minmax(210px,1fr)); }
}

@media (max-width: 920px) {
  [data-theme="control-room"] .app-shell { grid-template-columns: 74px minmax(0,1fr); }
  [data-theme="control-room"] .sidebar { padding-inline: 9px; align-items: center; }
  [data-theme="control-room"] .brand > span:last-child,
  [data-theme="control-room"] .sidebar-meta { display: none; }
  [data-theme="control-room"] .nav-item { grid-template-columns: 1fr; justify-items: center; padding-inline: 3px; }
}

@media (max-width: 700px) {
  body[data-theme="control-room"] { padding-bottom: 66px; background-size: 22px 22px; }
  [data-theme="control-room"] .app-shell { display: block; }
  [data-theme="control-room"] .sidebar { position: fixed; top: auto; bottom: 0; width: 100%; height: 66px; padding: 6px; border-top: 2px solid #171912; background: #fffdf6; }
  [data-theme="control-room"] .brand,
  [data-theme="control-room"] .sidebar-meta { display: none; }
  [data-theme="control-room"] .nav-list { width: 100%; margin: 0; grid-template-columns: repeat(7,1fr); gap: 2px; }
  [data-theme="control-room"] .nav-item { min-width: 0; min-height: 52px; padding: 4px 1px; gap: 1px; color: #55584f; }
  [data-theme="control-room"] .nav-item::before { font-size: 9px; }
  [data-theme="control-room"] .nav-item b { font-size: 9px; }
  [data-theme="control-room"] .nav-item.is-active { box-shadow: none; }
  [data-theme="control-room"] .workspace { padding: 0 11px 22px; }
  [data-theme="control-room"] .topbar { min-height: 76px; padding-top: 9px; }
  [data-theme="control-room"] .status-cluster { display: none; }
  [data-theme="control-room"] .summer-hero { min-height: 240px; box-shadow: 6px 6px 0 #171912; }
  [data-theme="control-room"] .hero-copy h2 { font-size: 36px; }
  .meeting-page-lead { padding-top: 18px; }
  .meeting-list { display: flex; overflow-x: auto; padding: 0 0 7px; }
  .meeting-list-item { min-width: 230px; }
  .meeting-hero dl { grid-template-columns: 1fr; }
  .meeting-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .meeting-timeline { display: flex; overflow-x: auto; }
  .meeting-timeline article { min-width: 154px; }
  .meeting-item-meta { display: grid; }
  .meeting-confirm-bar { align-items: stretch; flex-direction: column; }
  .meeting-confirm-bar .primary-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

.install-app {
  border: 1px solid rgba(25,93,116,.22);
  border-radius: 999px;
  background: rgba(255,255,255,.58);
  color: var(--ink, #164b6c);
  padding: 9px 13px;
  font: 700 10px/1 inherit;
  letter-spacing: .08em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(22,75,108,.08);
}

.install-app:hover { transform: translateY(-1px); background: rgba(255,255,255,.86); }

body.auth-locked { overflow: hidden; }
body.auth-locked .app-shell { filter: blur(18px) saturate(.72); pointer-events: none; user-select: none; }

.auth-gate {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 76% 15%, rgba(255,213,122,.78) 0 8%, transparent 8.3%),
    radial-gradient(circle at 26% 72%, rgba(255,255,255,.7), transparent 24%),
    linear-gradient(155deg, rgba(214,246,241,.94), rgba(115,193,204,.9) 60%, rgba(31,112,142,.9));
  backdrop-filter: blur(12px);
}

.auth-gate[hidden] { display: none; }

.auth-card {
  position: relative;
  width: min(460px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 32px 12px 32px 12px;
  padding: 42px;
  background: rgba(249,249,239,.9);
  box-shadow: 0 28px 80px rgba(20,69,95,.24);
}

.auth-card::after {
  content: '';
  position: absolute;
  right: -44px;
  bottom: -64px;
  width: 220px;
  height: 126px;
  border-radius: 50%;
  background: repeating-radial-gradient(ellipse at 50% 100%, transparent 0 16px, rgba(36,125,151,.12) 17px 21px);
  transform: rotate(-9deg);
}

.auth-card h1 { margin: 12px 0 8px; color: #164b6c; font-size: clamp(34px, 8vw, 54px); line-height: .98; }
.auth-card > p { max-width: 340px; margin: 0 0 28px; color: #547083; line-height: 1.7; }
.auth-card form { position: relative; z-index: 1; }
.auth-card label { display: block; margin-bottom: 8px; color: #2c5b70; font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.auth-input-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; }
.auth-input-row input { min-width: 0; border: 1px solid rgba(32,101,126,.22); border-radius: 12px; background: rgba(255,255,255,.82); padding: 13px 14px; color: #164b6c; font-size: 16px; outline: none; }
.auth-input-row input:focus { border-color: #2b8098; box-shadow: 0 0 0 4px rgba(43,128,152,.12); }
.auth-card small { display: block; margin-top: 10px; color: #66808d; line-height: 1.5; }
.auth-card small.is-error { color: #a54735; }

.auth-sun {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: #ffd77a;
  color: #164b6c;
  font-size: 34px;
  font-weight: 900;
  box-shadow: 0 0 0 10px rgba(255,215,122,.16);
}

@media (max-width: 700px) {
  .install-app { padding: 7px 9px; font-size: 8px; }
  .auth-card { padding: 32px 24px; border-radius: 26px 10px 26px 10px; }
  .auth-input-row { grid-template-columns: 1fr; }
  .auth-input-row .primary-button { width: 100%; }
}

/* Coastal Studio: a calm, chat-first personal workspace. */
body[data-theme="coastal-studio"] {
  --sand: #eef5f2;
  --paper: #fbfcfa;
  --foam: #f2f7f4;
  --navy: #183842;
  --navy-soft: #49636a;
  --aqua: #79bdc5;
  --sea: #2d8797;
  --deep-sea: #226878;
  --sun: #e8d7a7;
  --sun-deep: #b79a52;
  --coral: #d77963;
  --watermelon: #c66068;
  --leaf: #6f9a82;
  --mint: #dcece3;
  --line: rgba(31, 67, 75, .11);
  --muted: #70858a;
  --shadow: 0 22px 60px rgba(30, 73, 82, .09);
  --soft-shadow: 0 8px 24px rgba(30, 73, 82, .055);
  color: var(--navy);
  background:
    radial-gradient(circle at 86% -12%, rgba(121, 189, 197, .18), transparent 32%),
    radial-gradient(circle at 24% 108%, rgba(232, 215, 167, .17), transparent 30%),
    linear-gradient(135deg, #edf5f3 0%, #f7faf7 48%, #edf5f2 100%);
  background-size: 135% 135%;
  animation: coastalLight 28s ease-in-out infinite alternate;
  font-family: Inter, "Segoe UI Variable", "Microsoft YaHei UI", "PingFang SC", sans-serif;
}

@keyframes coastalLight {
  from { background-position: 0 0; }
  to { background-position: 100% 60%; }
}

[data-theme="coastal-studio"] .summer-glow {
  top: -260px;
  right: -180px;
  width: 680px;
  opacity: .42;
  background: radial-gradient(circle, rgba(255,255,255,.92), rgba(199,228,225,.3) 38%, transparent 70%);
  animation-duration: 18s;
}

[data-theme="coastal-studio"] .summer-cloud,
[data-theme="coastal-studio"] .leaf-shadow { display: none; }

[data-theme="coastal-studio"] .water-caustics {
  right: -24%;
  bottom: -34%;
  opacity: .07;
  filter: blur(2px);
}

[data-theme="coastal-studio"] .app-shell { grid-template-columns: 218px minmax(0, 1fr); }

[data-theme="coastal-studio"] .sidebar {
  top: 0;
  height: 100vh;
  margin: 0;
  padding: 25px 16px 20px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: rgba(248, 251, 248, .88);
  box-shadow: none;
  backdrop-filter: blur(18px);
}

[data-theme="coastal-studio"] .sidebar::after { display: none; }

[data-theme="coastal-studio"] .brand { gap: 11px; padding: 0 7px; }

[data-theme="coastal-studio"] .brand-mark {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(34,104,120,.16);
  border-radius: 10px;
  color: #fff;
  background: var(--deep-sea);
  box-shadow: none;
  font: 700 17px/1 Georgia, serif;
  transform: none;
}

[data-theme="coastal-studio"] .brand strong { font-size: 12px; letter-spacing: .12em; }
[data-theme="coastal-studio"] .brand small { margin-top: 3px; color: var(--muted); font-size: 7px; letter-spacing: .11em; }
[data-theme="coastal-studio"] .nav-list { gap: 4px; margin-top: 44px; }

[data-theme="coastal-studio"] .nav-item {
  min-height: 42px;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 9px;
  color: #5d7378;
}

[data-theme="coastal-studio"] .nav-item::before {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: #789096;
  font: 600 13px/1 "Segoe UI Symbol", sans-serif;
}

[data-theme="coastal-studio"] .nav-item:nth-child(1)::before { content: "⌂"; }
[data-theme="coastal-studio"] .nav-item:nth-child(2)::before { content: "▦"; }
[data-theme="coastal-studio"] .nav-item:nth-child(3)::before { content: "✎"; }
[data-theme="coastal-studio"] .nav-item:nth-child(4)::before { content: "◌"; }
[data-theme="coastal-studio"] .nav-item:nth-child(5)::before { content: "□"; }
[data-theme="coastal-studio"] .nav-item:nth-child(6)::before { content: "⌘"; }
[data-theme="coastal-studio"] .nav-item b { font-size: 12px; font-weight: 600; }
[data-theme="coastal-studio"] .nav-item:hover { color: var(--navy); background: rgba(45,135,151,.055); transform: none; }

[data-theme="coastal-studio"] .nav-item.is-active {
  color: var(--deep-sea);
  border-color: rgba(45,135,151,.08);
  background: rgba(45,135,151,.09);
  box-shadow: none;
}

[data-theme="coastal-studio"] .nav-item.is-active::before { color: var(--deep-sea); }

.sidebar-meta {
  position: relative;
  z-index: 1;
  margin-top: auto;
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 12px 8px;
  color: var(--muted);
}

.sidebar-meta .privacy-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--leaf); box-shadow: 0 0 0 4px rgba(111,154,130,.12); }
.sidebar-meta strong, .sidebar-meta small { display: block; }
.sidebar-meta strong { color: var(--navy-soft); font-size: 9px; }
.sidebar-meta small { margin-top: 3px; font-size: 8px; }

[data-theme="coastal-studio"] .workspace { padding: 0 34px 42px; }

[data-theme="coastal-studio"] .topbar {
  min-height: 78px;
  border-bottom-color: var(--line);
}

[data-theme="coastal-studio"] .topbar h1,
[data-theme="coastal-studio"] .section-heading h3,
[data-theme="coastal-studio"] .page-lead h2,
[data-theme="coastal-studio"] .chat-intro h2,
[data-theme="coastal-studio"] .work-card h3 {
  font-family: Inter, "Segoe UI Variable", "Microsoft YaHei UI", "PingFang SC", sans-serif;
}

[data-theme="coastal-studio"] .topbar h1 { margin-top: 5px; font-size: 20px; font-weight: 650; }
[data-theme="coastal-studio"] .eyebrow,
[data-theme="coastal-studio"] .hero-kicker,
[data-theme="coastal-studio"] .mini-label { letter-spacing: .12em; font-family: Consolas, monospace; }

[data-theme="coastal-studio"] .model-picker,
[data-theme="coastal-studio"] .status-pill,
[data-theme="coastal-studio"] .install-app {
  border-color: var(--line);
  background: rgba(255,255,255,.58);
  box-shadow: none;
}

[data-theme="coastal-studio"] .summer-hero {
  min-height: 176px;
  margin-top: 22px;
  padding: 30px 32px;
  display: flex;
  align-items: center;
  border: 1px solid rgba(34,104,120,.1);
  border-radius: 15px;
  background:
    linear-gradient(105deg, rgba(255,255,255,.82), rgba(219,238,233,.78)),
    var(--paper);
  box-shadow: var(--soft-shadow);
}

[data-theme="coastal-studio"] .summer-hero::before { display: none; }
[data-theme="coastal-studio"] .hero-copy { max-width: 720px; }
[data-theme="coastal-studio"] .summer-hero h2 { margin: 10px 0 8px; font: 650 clamp(25px,3vw,34px)/1.18 Inter, "Segoe UI Variable", "Microsoft YaHei UI", sans-serif; letter-spacing: -.025em; }
[data-theme="coastal-studio"] .summer-hero p { font-size: 12px; line-height: 1.65; }
[data-theme="coastal-studio"] .hero-actions { gap: 8px; margin-top: 20px; }

.workspace-date {
  position: absolute;
  top: 28px;
  right: 30px;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(34,104,120,.12);
  border-radius: 12px;
  color: var(--deep-sea);
  background: rgba(255,255,255,.52);
  font: 700 9px/1.35 Consolas, monospace;
  letter-spacing: .1em;
  text-align: center;
}

[data-theme="coastal-studio"] .primary-button,
[data-theme="coastal-studio"] .ghost-button { border-radius: 9px; box-shadow: none; }
[data-theme="coastal-studio"] .primary-button { padding: 10px 15px; background: var(--deep-sea); }
[data-theme="coastal-studio"] .ghost-button { padding: 9px 14px; border-color: rgba(34,104,120,.2); background: rgba(255,255,255,.55); }
[data-theme="coastal-studio"] .primary-button:hover,
[data-theme="coastal-studio"] .ghost-button:hover { transform: translateY(-1px); }
[data-theme="coastal-studio"] .ghost-button:hover { background: #fff; }

[data-theme="coastal-studio"] .personal-row { gap: 14px; margin: 14px 0; }
[data-theme="coastal-studio"] .quick-capture-card,
[data-theme="coastal-studio"] .personal-row .task-card { min-height: 196px; padding: 20px; }

[data-theme="coastal-studio"] .summer-sheet {
  border-color: var(--line);
  border-radius: 13px;
  background: rgba(251,252,250,.76);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(10px);
}

[data-theme="coastal-studio"] .quick-capture-card,
[data-theme="coastal-studio"] .task-card,
[data-theme="coastal-studio"] .generator-card,
[data-theme="coastal-studio"] .manual-draft-card,
[data-theme="coastal-studio"] .chat-rule { background: rgba(251,252,250,.78); }

[data-theme="coastal-studio"] .section-heading { margin-bottom: 16px; }
[data-theme="coastal-studio"] .section-heading h3 { margin-top: 5px; font-size: 17px; font-weight: 650; }
[data-theme="coastal-studio"] input,
[data-theme="coastal-studio"] textarea,
[data-theme="coastal-studio"] select { border-color: var(--line); border-radius: 9px; background: rgba(255,255,255,.78); }

[data-theme="coastal-studio"] .metric-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 8px; margin: 14px 0; }
[data-theme="coastal-studio"] .metric-card {
  min-width: 0;
  min-height: 72px;
  display: block;
  padding: 12px;
  border-color: var(--line);
  border-radius: 11px;
  background: rgba(251,252,250,.72);
  box-shadow: none;
}
[data-theme="coastal-studio"] .metric-card::after { display: none; }
[data-theme="coastal-studio"] .metric-card span { color: var(--muted); font-size: 9px; font-weight: 600; }
[data-theme="coastal-studio"] .metric-card strong { margin-top: 9px; color: var(--navy); font: 650 22px/1 Inter, "Segoe UI Variable", sans-serif; }

[data-theme="coastal-studio"] .dashboard-grid { gap: 14px; }
[data-theme="coastal-studio"] .command-board,
[data-theme="coastal-studio"] .data-source-card,
[data-theme="coastal-studio"] .task-card,
[data-theme="coastal-studio"] .generator-card,
[data-theme="coastal-studio"] .manual-draft-card,
[data-theme="coastal-studio"] .draft-queue { padding: 20px; }
[data-theme="coastal-studio"] .lane-grid { gap: 9px; }
[data-theme="coastal-studio"] .command-lane { padding: 12px; border: 1px solid rgba(31,67,75,.07); border-radius: 10px; background: rgba(238,245,242,.72); }
[data-theme="coastal-studio"] .lane-item,
[data-theme="coastal-studio"] .work-card,
[data-theme="coastal-studio"] .draft-card,
[data-theme="coastal-studio"] .memory-card { border-radius: 10px; box-shadow: none; }

[data-theme="coastal-studio"] .page-lead { padding: 31px 2px 22px; }
[data-theme="coastal-studio"] .page-lead h2 { margin: 9px 0 8px; font-size: clamp(27px,3.1vw,38px); font-weight: 650; letter-spacing: -.025em; }
[data-theme="coastal-studio"] .page-lead p { font-size: 11px; }
[data-theme="coastal-studio"] .create-panel { top: 12px; padding: 20px; }
[data-theme="coastal-studio"] .work-card { background: rgba(255,255,255,.72); }
[data-theme="coastal-studio"] .work-card h3 { font-size: 17px; font-weight: 650; }

[data-theme="coastal-studio"] .chat-layout { grid-template-columns: minmax(0,1fr) 220px; gap: 14px; padding-top: 18px; }
[data-theme="coastal-studio"] .chat-panel { min-height: calc(100vh - 118px); }
[data-theme="coastal-studio"] .chat-intro { padding: 30px; background: linear-gradient(105deg, rgba(255,255,255,.78), rgba(225,239,235,.62)); }
[data-theme="coastal-studio"] .chat-intro::after { display: none; }
[data-theme="coastal-studio"] .chat-intro h2 { margin: 10px 0 7px; font-size: 28px; font-weight: 650; }
[data-theme="coastal-studio"] .chat-intro p { margin: 0; font-size: 11px; }
[data-theme="coastal-studio"] .prompt-chips { margin-top: 17px; }
[data-theme="coastal-studio"] .prompt-chips button { padding: 8px 11px; border-color: var(--line); border-radius: 8px; background: rgba(255,255,255,.64); }
[data-theme="coastal-studio"] .prompt-chips button:hover { color: var(--deep-sea); background: #fff; }
[data-theme="coastal-studio"] .voice-dock { border-color: var(--line); border-radius: 10px; background: rgba(247,250,247,.8); box-shadow: none; }
[data-theme="coastal-studio"] .voice-orb { background: var(--deep-sea); box-shadow: none; }
[data-theme="coastal-studio"] .voice-settings { border-color: var(--line); border-radius: 10px; background: rgba(255,255,255,.5); }
[data-theme="coastal-studio"] .message-list { padding: 22px; }
[data-theme="coastal-studio"] .avatar { background: var(--mint); }
[data-theme="coastal-studio"] .message.user .avatar { background: var(--coral); }
[data-theme="coastal-studio"] .bubble { border-radius: 12px 12px 12px 4px; }
[data-theme="coastal-studio"] .message.user .bubble { border-radius: 12px 12px 4px 12px; }
[data-theme="coastal-studio"] .composer { background: rgba(241,247,243,.82); }
[data-theme="coastal-studio"] .send-button { border-radius: 9px; background: var(--deep-sea); }
[data-theme="coastal-studio"] .chat-side strong { color: var(--deep-sea); font: 650 38px/1 Inter, "Segoe UI Variable", sans-serif; }

[data-theme="coastal-studio"] .auth-gate { background: rgba(237,245,243,.94); }
[data-theme="coastal-studio"] .auth-card { border-color: var(--line); border-radius: 16px; background: rgba(251,252,250,.96); box-shadow: var(--shadow); }
[data-theme="coastal-studio"] .auth-card::after { display: none; }
[data-theme="coastal-studio"] .auth-sun { width: 52px; height: 52px; border-radius: 12px; color: #fff; background: var(--deep-sea); box-shadow: none; font-size: 24px; }
[data-theme="coastal-studio"] .auth-card h1 { font-size: clamp(30px,7vw,43px); }

@media (max-width: 1180px) {
  [data-theme="coastal-studio"] .metric-grid { grid-template-columns: repeat(3,1fr); }
}

@media (max-width: 920px) {
  [data-theme="coastal-studio"] .app-shell { grid-template-columns: 74px minmax(0,1fr); }
  [data-theme="coastal-studio"] .sidebar { padding-inline: 10px; align-items: center; }
  [data-theme="coastal-studio"] .brand > span:last-child,
  [data-theme="coastal-studio"] .sidebar-meta { display: none; }
  [data-theme="coastal-studio"] .nav-list { width: 100%; }
  [data-theme="coastal-studio"] .nav-item { grid-template-columns: 1fr; justify-items: center; gap: 2px; padding-inline: 3px; }
  [data-theme="coastal-studio"] .nav-item b { font-size: 9px; }
}

@media (max-width: 700px) {
  body[data-theme="coastal-studio"] { padding-bottom: 64px; animation: none; }
  [data-theme="coastal-studio"] .water-caustics { display: none; }
  [data-theme="coastal-studio"] .app-shell { display: block; }
  [data-theme="coastal-studio"] .sidebar { top: auto; bottom: 0; width: 100%; height: 64px; padding: 6px 8px; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
  [data-theme="coastal-studio"] .brand,
  [data-theme="coastal-studio"] .sidebar-meta { display: none; }
  [data-theme="coastal-studio"] .nav-list { margin: 0; grid-template-columns: repeat(6,1fr); gap: 2px; }
  [data-theme="coastal-studio"] .nav-item { min-height: 51px; }
  [data-theme="coastal-studio"] .nav-item::before { height: 17px; font-size: 12px; }
  [data-theme="coastal-studio"] .nav-item b { font-size: 9px; }
  [data-theme="coastal-studio"] .workspace { padding: 0 12px 20px; }
  [data-theme="coastal-studio"] .topbar { min-height: 76px; padding-top: 10px; }
  [data-theme="coastal-studio"] .topbar h1 { font-size: 18px; }
  [data-theme="coastal-studio"] .topbar-tools { gap: 4px; }
  [data-theme="coastal-studio"] #database-status { display: none; }
  [data-theme="coastal-studio"] .status-pill { padding: 5px 7px; font-size: 8px; }
  [data-theme="coastal-studio"] .summer-hero { min-height: 176px; margin-top: 14px; padding: 24px 20px; }
  [data-theme="coastal-studio"] .summer-hero h2 { max-width: calc(100% - 60px); font-size: 25px; }
  [data-theme="coastal-studio"] .summer-hero p { max-width: calc(100% - 42px); }
  [data-theme="coastal-studio"] .workspace-date { top: 18px; right: 16px; width: 46px; height: 46px; }
  [data-theme="coastal-studio"] .hero-actions { margin-top: 17px; }
  [data-theme="coastal-studio"] .primary-button,
  [data-theme="coastal-studio"] .ghost-button { padding: 9px 11px; font-size: 10px; }
  [data-theme="coastal-studio"] .personal-row { grid-template-columns: 1fr; }
  [data-theme="coastal-studio"] .quick-capture-card,
  [data-theme="coastal-studio"] .personal-row .task-card { min-height: auto; }
  [data-theme="coastal-studio"] .metric-grid { grid-template-columns: repeat(3,1fr); }
  [data-theme="coastal-studio"] .metric-card { min-height: 64px; padding: 10px; }
  [data-theme="coastal-studio"] .metric-card strong { margin-top: 7px; font-size: 20px; }
  [data-theme="coastal-studio"] .page-lead { padding: 24px 2px 17px; }
  [data-theme="coastal-studio"] .page-lead h2 { font-size: 27px; }
  [data-theme="coastal-studio"] .chat-layout { grid-template-columns: 1fr; padding-top: 12px; }
  [data-theme="coastal-studio"] .chat-panel { min-height: calc(100vh - 154px); }
  [data-theme="coastal-studio"] .chat-intro { padding: 24px 18px; }
  [data-theme="coastal-studio"] .chat-intro h2 { font-size: 25px; }
  [data-theme="coastal-studio"] .voice-dock,
  [data-theme="coastal-studio"] .voice-settings { margin-inline: 9px; }
  [data-theme="coastal-studio"] .message-list { padding: 16px; }
  [data-theme="coastal-studio"] .chat-side { grid-template-columns: repeat(2,1fr); }
[data-theme="coastal-studio"] .chat-side strong { font-size: 30px; }
}

/* V0.7.1 meeting cockpit and Factory-KB-style mobile navigation */
.mobile-menu-toggle,
.mobile-menu-close { display: none; }
.mobile-nav-backdrop,
.meeting-index-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(0,0,0,.46);
  backdrop-filter: blur(2px);
}
.meeting-index-backdrop { z-index: 22; }
body.mobile-nav-open,
body.meeting-drawer-open { overflow: hidden; }
html:has(body.mobile-nav-open),
html:has(body.meeting-drawer-open) { overflow: hidden; }

/* V0.9 external connections: useful status first, authorization second. */
.integration-lead { max-width: 900px; }
.integration-lead > p { margin: 8px 0 0; color: var(--ink-soft); font-size: 16px; }
.integration-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 18px;
  padding: 20px 0 40px;
}
.integration-card { min-width: 0; padding: 24px; }
.integration-card-google { grid-column: 1 / -1; }
.integration-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}
.integration-card-head h3 { margin: 4px 0; font-size: 26px; }
.integration-card-head p,
.integration-card > p { margin: 5px 0 0; color: var(--ink-soft); line-height: 1.65; }
.connection-state {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 11px;
  border: 1px solid rgba(23,25,18,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.62);
  font-size: 12px;
  font-weight: 760;
}
.connection-state.ready { border-color: rgba(68,131,89,.28); background: rgba(204,247,145,.58); }
.connection-state.pending { color: var(--ink-soft); }
.integration-permissions,
.integration-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.integration-permissions { margin: 14px 0 18px; }
.integration-permissions span {
  padding: 6px 10px;
  border: 1px solid rgba(23,25,18,.13);
  border-radius: 7px;
  background: rgba(255,255,255,.45);
  font-size: 12px;
}
.integration-actions .primary-button,
.integration-actions .ghost-button { text-decoration: none; }
.text-button {
  border: 0;
  background: transparent;
  padding: 9px 5px;
  font: inherit;
  cursor: pointer;
}
.danger-text { color: #9d382e; }
.integration-note { margin: 15px 0 0; font-size: 13px; }
.push-preferences {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}
.push-preferences label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border: 1px solid rgba(23,25,18,.13);
  border-radius: 999px;
  background: rgba(255,255,255,.45);
  font-size: 13px;
}
.google-feed {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 16px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid rgba(23,25,18,.14);
}
.google-feed h4 { margin: 3px 0 0; font-size: 20px; }
.external-list { display: grid; gap: 9px; margin-top: 12px; }
.mail-digest { margin-bottom: 18px; padding: 14px; border-left: 4px solid var(--signal); background: rgba(201,255,120,.16); }
.mail-digest .section-heading { margin-bottom: 10px; }
.mail-digest pre { margin: 0; white-space: pre-wrap; color: var(--ink); font: 12px/1.65 inherit; }
.mail-digest > small { display: block; margin-top: 9px; color: var(--ink-soft); font-size: 9px; }
.mail-digest-actions { display: grid; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(23,25,18,.14); }
.mail-action-card { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 11px; border: 1px solid rgba(23,25,18,.14); border-left: 4px solid #d0a332; border-radius: 9px; background: rgba(255,255,255,.62); }
.mail-action-card.priority-高 { border-left-color: var(--coral); }
.mail-action-card.priority-低 { border-left-color: var(--mint); }
.mail-action-card > div { display: grid; gap: 3px; min-width: 0; }
.mail-action-card span,.mail-action-card small { color: var(--ink-soft); font-size: 11px; }
.mail-action-card strong { overflow: hidden; font-size: 13px; line-height: 1.45; text-overflow: ellipsis; }
@media (max-width: 700px) {
  .mail-action-card { grid-template-columns: 1fr; }
  .mail-action-card .mini-button { width: 100%; min-height: 42px; }
}
.external-item {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(23,25,18,.13);
  border-radius: 10px;
  background: rgba(255,255,255,.52);
  color: inherit;
  text-decoration: none;
}
.external-item > div { display: grid; gap: 3px; min-width: 0; }
.external-item strong,
.external-item span,
.external-item p { overflow: hidden; text-overflow: ellipsis; }
.external-item strong { white-space: nowrap; }
.external-item span,
.external-item small { color: var(--ink-soft); font-size: 12px; }
.external-item p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.5; }
.external-item .mini-button { justify-self: start; }
.external-file:hover { border-color: rgba(23,25,18,.32); transform: translateY(-1px); }
.error-note { color: #9d382e; }
.integration-boundary {
  display: grid;
  gap: 5px;
  margin-top: 18px;
  padding: 14px;
  border-left: 4px solid var(--signal);
  background: rgba(255,255,255,.48);
}
.integration-boundary span { color: var(--ink-soft); line-height: 1.55; }
.douyin-form { display: grid; gap: 13px; margin-top: 18px; }
.douyin-form label { display: grid; gap: 7px; font-size: 13px; font-weight: 700; }
.douyin-form textarea,
.douyin-form input {
  width: 100%;
  border: 1px solid rgba(23,25,18,.2);
  border-radius: 8px;
  background: rgba(255,255,255,.7);
  padding: 11px 12px;
  color: var(--ink);
  font: inherit;
}
.douyin-result {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(23,25,18,.14);
  border-radius: 10px;
  background: rgba(255,255,255,.55);
  white-space: pre-wrap;
  line-height: 1.7;
}

@media (max-width: 820px) {
  .integration-grid,
  .google-feed { grid-template-columns: 1fr; }
  .integration-card-google { grid-column: auto; }
  .integration-card { padding: 18px; }
  .integration-card-head { align-items: flex-start; }
  .integration-card-head h3 { font-size: 23px; }
  .integration-actions > * { min-height: 44px; }
}

/* V0.8 Global Inbox: a confirmation airlock between Codex projects and James */
[data-theme="control-room"] .global-inbox-card {
  margin: 18px 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #171912;
  border-radius: 0;
  background: #fffdf6;
  box-shadow: 7px 7px 0 rgba(23,25,18,.12);
}
.global-inbox-head {
  min-height: 118px;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #fffdf6;
  background:
    linear-gradient(90deg, transparent 0 73%, rgba(204,255,41,.08) 73% 74%, transparent 74%),
    #171912;
}
.global-inbox-head h3 { margin: 7px 0 5px; font-size: clamp(24px,3vw,38px); line-height: 1; letter-spacing: -.035em; }
.global-inbox-head p { max-width: 680px; margin: 0; color: #b9bdaf; font-size: 11px; line-height: 1.6; }
.global-inbox-counter {
  min-width: 92px;
  padding: 10px 14px;
  display: grid;
  justify-items: end;
  border-left: 4px solid var(--sun);
}
.global-inbox-counter strong { color: var(--sun); font: 800 46px/1 Consolas, monospace; }
.global-inbox-counter span { margin-top: 5px; color: #b9bdaf; font: 700 9px Consolas, monospace; letter-spacing: .14em; }
.global-inbox-flow {
  min-height: 38px;
  padding: 7px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #c9c6bb;
  background: #efede5;
  font: 700 9px Consolas, monospace;
  letter-spacing: .08em;
}
.global-inbox-flow i { color: #868a7e; font-style: normal; }
.global-inbox-flow .is-active { padding: 4px 7px; color: #171912; background: var(--sun); }
.global-inbox-list { display: grid; }
.global-inbox-item {
  min-height: 118px;
  padding: 18px 24px;
  display: grid;
  grid-template-columns: 92px minmax(0,1fr) auto;
  align-items: start;
  gap: 18px;
  border-bottom: 1px solid #d2cfc4;
}
.global-inbox-item:last-child { border-bottom: 0; }
.global-inbox-type { display: grid; gap: 5px; }
.global-inbox-type span { width: fit-content; padding: 4px 7px; color: #171912; background: var(--sun); font-size: 10px; font-weight: 800; }
.global-inbox-type i { color: #72766b; font: 700 8px Consolas, monospace; letter-spacing: .08em; }
.global-inbox-copy { min-width: 0; }
.global-inbox-copy > strong { display: block; font-size: 14px; line-height: 1.45; }
.global-inbox-copy > p { max-width: 900px; margin: 7px 0 5px; color: #505349; font-size: 11px; line-height: 1.55; white-space: pre-wrap; }
.global-inbox-copy > small { display: block; overflow-wrap: anywhere; color: #81857a; font: 9px/1.5 Consolas, monospace; }
.global-inbox-copy details { margin-top: 9px; }
.global-inbox-copy summary { width: fit-content; color: #3f4339; cursor: pointer; font-size: 9px; font-weight: 700; }
.global-inbox-copy pre {
  max-height: 280px;
  margin: 9px 0 0;
  padding: 12px;
  overflow: auto;
  color: #d8dccf;
  background: #20231b;
  font: 9px/1.55 Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.global-inbox-actions { display: grid; grid-template-columns: 1fr; gap: 7px; }
.global-inbox-actions button { min-width: 96px; min-height: 38px; }
.global-inbox-empty { min-height: 96px; padding: 20px 24px; display: flex; align-items: center; gap: 14px; }
.global-inbox-empty > span { width: 36px; height: 36px; display: grid; place-items: center; color: #171912; background: var(--sun); font-weight: 900; }
.global-inbox-empty strong,.global-inbox-empty p { display: block; margin: 0; }
.global-inbox-empty p { margin-top: 4px; color: #767a6f; font-size: 10px; }

[data-theme="control-room"] #view-meetings .meeting-page-lead {
  max-width: none;
  padding: 30px 4px 24px;
}
[data-theme="control-room"] #view-meetings {
  animation: none;
  transform: none;
}
[data-theme="control-room"] #view-meetings .meeting-page-lead h2 {
  margin-bottom: 6px;
  font-size: clamp(32px,4vw,54px);
}
[data-theme="control-room"] #view-meetings .meeting-layout { display: block; }
[data-theme="control-room"] #view-meetings .meeting-detail { width: 100%; }
[data-theme="control-room"] #view-meetings .meeting-index-panel {
  position: fixed;
  z-index: 24;
  top: 104px;
  left: 232px;
  width: min(390px, calc(100vw - 260px));
  height: calc(100vh - 124px);
  height: calc(100dvh - 124px);
  max-height: none;
  padding: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  transform: translateX(calc(-100% - 28px));
  transition: transform .25s ease, box-shadow .25s ease;
  box-shadow: 18px 18px 50px rgba(23,25,18,.22);
}
[data-theme="control-room"] #view-meetings:not(.meeting-index-open) .meeting-index-panel { visibility: hidden; pointer-events: none; }
[data-theme="control-room"] #view-meetings.meeting-index-open .meeting-index-panel { transform: translateX(0); }
.meeting-index-close {
  position: sticky;
  z-index: 2;
  top: 0;
  margin: 0 0 8px auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid #171912;
  border-radius: 2px;
  color: #fffdf6;
  background: #171912;
  font-size: 24px;
}
.meeting-cockpit-toolbar {
  position: relative;
  z-index: 6;
  top: auto;
  min-height: 48px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #d9dccf;
  border-bottom: 1px solid #4d5045;
  background: #171912;
  font: 700 9px Consolas, monospace;
  letter-spacing: .08em;
}
.meeting-index-toggle {
  min-height: 34px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #717568;
  border-radius: 2px;
  color: #fffdf6;
  background: #24271e;
  font-weight: 700;
}
.meeting-index-toggle:hover { border-color: var(--sun); }
.meeting-index-toggle b { min-width: 20px; padding: 2px 5px; color: #171912; background: var(--sun); }
.meeting-control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(330px, 1fr);
  align-items: start;
  border-bottom: 1px solid #c9c6bb;
}
.meeting-control-grid > .meeting-block { height: 100%; border-bottom: 0; }
.meeting-control-grid > .meeting-block + .meeting-block { border-left: 1px solid #c9c6bb; }
.meeting-action-block { min-width: 0; }
.meeting-action-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.meeting-action-filters button {
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid #c9c6bb;
  border-radius: 999px;
  background: #fffdf6;
  font-size: 10px;
}
.meeting-action-filters button.is-active { color: #fffdf6; border-color: #171912; background: #171912; }
.meeting-action-list { display: grid; }
.meeting-action-row { border-top: 1px solid #d5d2c8; background: #fffdf6; }
.meeting-action-row:last-child { border-bottom: 1px solid #d5d2c8; }
.meeting-action-main {
  min-height: 62px;
  padding: 9px 4px;
  display: grid;
  grid-template-columns: auto 10px minmax(0,1fr) auto;
  align-items: center;
  gap: 9px;
}
.meeting-action-main .meeting-select { align-self: center; }
.meeting-action-main .meeting-select span { display: none; }
.meeting-action-signal { width: 9px; height: 9px; border-radius: 50%; background: #246bfe; box-shadow: 0 0 0 5px rgba(36,107,254,.09); }
.meeting-action-row.status-blocked .meeting-action-signal { background: #ee3e3e; box-shadow: 0 0 0 5px rgba(238,62,62,.1); }
.meeting-action-row.status-pending_input .meeting-action-signal { background: #ff7a24; box-shadow: 0 0 0 5px rgba(255,122,36,.1); }
.meeting-action-row.status-confirmed .meeting-action-signal { background: #94bf20; }
.meeting-action-main strong,.meeting-action-main small { display: block; }
.meeting-action-main strong { font-size: 12px; line-height: 1.4; }
.meeting-action-main small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.meeting-action-main time { max-width: 100px; color: var(--muted); text-align: right; font: 700 9px Consolas, monospace; }
.meeting-linked-mark { padding: 3px 5px; color: #34440f; background: #e7f8ae; font-size: 8px; font-weight: 700; }
.meeting-action-row > details { padding: 0 4px 10px 32px; }
.meeting-action-row > details > summary { color: #55584f; cursor: pointer; font-size: 9px; font-weight: 700; }
.meeting-action-row > details > p { line-height: 1.65; white-space: pre-wrap; }
.meeting-action-row .meeting-proposal { margin-right: 0; }
.meeting-action-block .meeting-confirm-bar {
  position: static;
  margin-top: 12px;
  align-items: stretch;
  flex-direction: column;
}
.meeting-action-block .meeting-confirm-bar .primary-button { width: 100%; }
.meeting-context-block .meeting-item-list { grid-template-columns: repeat(2,minmax(0,1fr)); }

@media (max-width: 1180px) {
  .meeting-control-grid { grid-template-columns: 1fr; }
  .meeting-control-grid > .meeting-block + .meeting-block { border-top: 1px solid #c9c6bb; border-left: 0; }
}

@media (max-width: 820px), (max-width: 900px) and (max-height: 500px) {
  .global-inbox-head { min-height: 106px; padding: 18px; align-items: flex-start; }
  .global-inbox-head h3 { font-size: 25px; }
  .global-inbox-head p { font-size: 10px; }
  .global-inbox-counter { min-width: 62px; padding: 8px 0 8px 10px; }
  .global-inbox-counter strong { font-size: 34px; }
  .global-inbox-flow { padding-inline: 18px; overflow-x: auto; white-space: nowrap; }
  .global-inbox-item { padding: 16px 18px; grid-template-columns: 1fr; gap: 11px; }
  .global-inbox-type { display: flex; align-items: center; }
  .global-inbox-actions { grid-template-columns: 1fr 1fr; }
  .global-inbox-actions button { min-height: 44px; }
  body[data-theme="control-room"] { padding-bottom: 0; }
  [data-theme="control-room"] .app-shell { display: block; }
  [data-theme="control-room"] .sidebar {
    position: fixed;
    z-index: 40;
    top: 0;
    left: 0;
    width: min(310px,88vw);
    height: 100vh;
    height: 100dvh;
    padding: max(22px,env(safe-area-inset-top)) 16px max(22px,env(safe-area-inset-bottom));
    align-items: stretch;
    transform: translateX(-102%);
    transition: transform .25s ease;
    box-shadow: 25px 0 80px rgba(0,0,0,.3);
  }
  [data-theme="control-room"] .sidebar.is-mobile-open { transform: translateX(0); }
  [data-theme="control-room"] .sidebar .brand { display: flex; width: 100%; }
  [data-theme="control-room"] .sidebar .brand > span:last-of-type { display: block; }
  [data-theme="control-room"] .sidebar .sidebar-meta { display: flex; width: 100%; }
  [data-theme="control-room"] .nav-list { width: 100%; margin: 34px 0 18px; grid-template-columns: 1fr; gap: 5px; overflow-y: auto; }
  [data-theme="control-room"] .nav-item { min-height: 46px; padding: 9px 12px; grid-template-columns: 28px 1fr; justify-items: start; gap: 10px; color: #b8bbad; }
  [data-theme="control-room"] .nav-item::before { font-size: 10px; }
  [data-theme="control-room"] .nav-item b { font-size: 13px; }
  [data-theme="control-room"] .mobile-menu-close {
    margin-left: auto;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid #494c41;
    border-radius: 2px;
    color: #fffdf6;
    background: #24271e;
    font-size: 24px;
  }
  .mobile-nav-backdrop { z-index: 35; }
  [data-theme="control-room"] .workspace { padding: 0 max(14px,env(safe-area-inset-right)) calc(34px + env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left)); }
  [data-theme="control-room"] .topbar {
    height: 70px;
    min-height: 70px;
    padding: 0;
    align-items: center;
  }
  [data-theme="control-room"] .topbar-title { gap: 11px; }
  [data-theme="control-room"] .mobile-menu-toggle {
    width: 44px;
    height: 44px;
    display: grid;
    place-content: center;
    gap: 4px;
    border: 1px solid #c9c6bb;
    border-radius: 2px;
    background: #fffdf6;
  }
  [data-theme="control-room"] .mobile-menu-toggle i { width: 18px; height: 2px; display: block; background: #171912; }
  [data-theme="control-room"] #mobile-back:not([hidden]) { display: grid !important; }
  [data-theme="control-room"] .topbar-tools { margin-left: auto; }
  [data-theme="control-room"] .model-picker { min-height: 44px; }
  [data-theme="control-room"] #view-meetings .meeting-page-lead { padding: 18px 3px 14px; }
  [data-theme="control-room"] #view-meetings .meeting-page-lead h2 { font-size: 30px; }
  [data-theme="control-room"] #view-meetings .meeting-page-lead p { font-size: 12px; line-height: 1.7; }
  [data-theme="control-room"] #view-meetings .meeting-index-panel {
    z-index: 34;
    top: 0;
    left: 0;
    width: min(330px,90vw);
    max-height: 100vh;
    max-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    padding: max(18px,env(safe-area-inset-top)) 16px max(18px,env(safe-area-inset-bottom));
    transform: translateX(-102%);
    border-radius: 0;
  }
  .meeting-index-backdrop { z-index: 32; }
  .meeting-cockpit-toolbar { min-height: 50px; }
  .meeting-cockpit-toolbar > span { display: none; }
  .meeting-index-toggle { min-height: 38px; }
  .meeting-hero { padding: 24px 20px; }
  .meeting-hero h2 { font-size: 27px; }
  .meeting-hero dl { grid-template-columns: 1fr; }
  .meeting-control-grid { display: block; }
  .meeting-context-block .meeting-item-list { grid-template-columns: 1fr; }
  .meeting-action-main { grid-template-columns: auto 9px minmax(0,1fr); }
  .meeting-action-main time { grid-column: 3; justify-self: start; text-align: left; }
  .meeting-action-row > details { padding-left: 28px; }
}

/* V0.8.1 Mobile reading mode — one responsive source of truth, inspired by Factory KB. */
@media (max-width: 820px) {
  html { font-size: 16px; }
  body[data-theme="control-room"] {
    min-width: 320px;
    padding-bottom: 0;
    background-size: 24px 24px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  [data-theme="control-room"] .workspace {
    width: 100%;
    min-width: 0;
    padding: 0 max(16px,env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));
  }
  [data-theme="control-room"] .app-chrome {
    min-height: calc(62px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 3px 0;
  }
  .chrome-signals { gap: 7px; }
  .chrome-signal { width: 12px; height: 12px; }
  .chrome-brand strong { font-size: 23px; }
  .chrome-review { width: 40px; height: 40px; }
  [data-theme="control-room"] .topbar {
    position: relative;
    z-index: auto;
    top: auto;
    min-height: 72px;
    height: 72px;
    gap: 10px;
    background: transparent;
  }
  [data-theme="control-room"] .topbar-title { min-width: 0; gap: 12px; }
  [data-theme="control-room"] .topbar-title > div { min-width: 0; }
  [data-theme="control-room"] .topbar-title .eyebrow { font-size: 10px; }
  [data-theme="control-room"] .topbar-title h1 {
    margin-top: 3px;
    overflow: hidden;
    font-size: 24px;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  [data-theme="control-room"] .mobile-menu-toggle,
  [data-theme="control-room"] .mobile-menu-close {
    min-width: 48px;
    width: 48px;
    min-height: 48px;
    height: 48px;
    border-radius: 12px;
  }
  [data-theme="control-room"] .mobile-menu-toggle i { width: 22px; }
  [data-theme="control-room"] .topbar-tools { min-width: 0; gap: 8px; }
  [data-theme="control-room"] .install-app,
  [data-theme="control-room"] .status-cluster { display: none !important; }
  [data-theme="control-room"] .model-picker {
    min-width: 112px;
    min-height: 48px;
    padding: 4px 8px;
    gap: 0;
    border-radius: 12px;
  }
  [data-theme="control-room"] .model-picker > span { display: none; }
  [data-theme="control-room"] .model-picker select {
    width: 100%;
    min-height: 38px;
    padding: 0 24px 0 8px;
    font-size: 16px;
  }

  [data-theme="control-room"] .sidebar {
    width: min(360px,88vw);
    padding: max(24px,env(safe-area-inset-top)) 20px max(24px,env(safe-area-inset-bottom));
    flex-direction: column;
    align-items: stretch;
    overflow: hidden;
    border: 0;
    background: #171912;
  }
  [data-theme="control-room"] .sidebar .brand { width: 100%; height: auto; flex: 0 0 auto; }
  [data-theme="control-room"] .sidebar .brand-mark { width: 58px; height: 58px; font-size: 30px; }
  [data-theme="control-room"] .sidebar .brand strong { font-size: 18px; }
  [data-theme="control-room"] .sidebar .brand small { font-size: 10px; }
  [data-theme="control-room"] .nav-list { width: 100%; margin: 32px 0 20px; grid-template-columns: 1fr; gap: 8px; }
  [data-theme="control-room"] .nav-item {
    min-height: 58px;
    padding: 12px 14px;
    grid-template-columns: 34px 1fr;
    border-radius: 12px;
  }
  [data-theme="control-room"] .nav-item::before { font-size: 13px; }
  [data-theme="control-room"] .nav-item b { font-size: 18px; }
  [data-theme="control-room"] .sidebar-meta { padding-top: 18px; }
  [data-theme="control-room"] .sidebar-meta strong { font-size: 15px; }
  [data-theme="control-room"] .sidebar-meta small { font-size: 12px; }
  .mobile-nav-backdrop,
  .meeting-index-backdrop { background: rgba(10,12,8,.62); backdrop-filter: blur(2px); }

  [data-theme="control-room"] .view { width: 100%; min-width: 0; }
  [data-theme="control-room"] .summer-sheet,
  [data-theme="control-room"] .metric-card,
  [data-theme="control-room"] .chat-panel,
  [data-theme="control-room"] .work-card {
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(23,25,18,.07);
  }
  [data-theme="control-room"] input,
  [data-theme="control-room"] textarea,
  [data-theme="control-room"] select { min-height: 48px; font-size: 16px; }
  [data-theme="control-room"] button { touch-action: manipulation; }
  [data-theme="control-room"] .primary-button,
  [data-theme="control-room"] .ghost-button,
  [data-theme="control-room"] .send-button { min-height: 48px; padding: 12px 16px; font-size: 16px; }

  [data-theme="control-room"] .summer-hero {
    min-height: 0;
    margin: 20px 0 18px;
    padding: 30px 22px 24px;
    border-radius: 16px;
    box-shadow: 6px 6px 0 #171912;
  }
  [data-theme="control-room"] .summer-hero .hero-copy { max-width: 100%; }
  [data-theme="control-room"] .hero-copy h2 {
    max-width: calc(100% - 54px);
    margin: 16px 0 14px;
    font-size: clamp(34px,10vw,44px);
    line-height: 1.08;
  }
  [data-theme="control-room"] .summer-hero p { font-size: 16px; line-height: 1.7; }
  [data-theme="control-room"] .workspace-date { top: 22px; right: 20px; width: 50px; height: 50px; font-size: 10px; }
  [data-theme="control-room"] .hero-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 22px; }
  [data-theme="control-room"] .hero-actions button { width: 100%; }

  .global-inbox-head { min-height: 0; padding: 24px 20px; gap: 16px; }
  .global-inbox-head h3 { margin-top: 10px; font-size: 30px; line-height: 1.1; }
  .global-inbox-head p { font-size: 16px; line-height: 1.65; }
  .global-inbox-counter { min-width: 68px; padding: 8px 0 8px 12px; }
  .global-inbox-counter strong { font-size: 38px; }
  .global-inbox-counter span { font-size: 10px; }
  .global-inbox-flow {
    min-height: 46px;
    padding: 9px 16px;
    flex-wrap: wrap;
    gap: 6px;
    overflow: visible;
    white-space: normal;
    font-size: 12px;
  }
  .global-inbox-item { padding: 20px; gap: 14px; }
  .global-inbox-type { gap: 8px; }
  .global-inbox-type span { font-size: 13px; }
  .global-inbox-type i { font-size: 11px; }
  .global-inbox-copy > strong { font-size: 19px; line-height: 1.45; }
  .global-inbox-copy > p { margin-block: 9px 7px; font-size: 16px; line-height: 1.65; }
  .global-inbox-copy > small { font-size: 13px; line-height: 1.55; }
  .global-inbox-copy summary { min-height: 44px; display: flex; align-items: center; font-size: 15px; }
  .global-inbox-actions button { min-height: 48px; font-size: 15px; }
  .global-inbox-empty { min-height: 112px; padding: 22px 20px; }
  .global-inbox-empty > span { width: 44px; height: 44px; }
  .global-inbox-empty strong { font-size: 17px; }
  .global-inbox-empty p { font-size: 14px; line-height: 1.55; }

  .personal-row,
  .dashboard-grid,
  .work-layout,
  .communication-grid,
  .chat-layout { grid-template-columns: 1fr; }
  .personal-row { gap: 16px; margin: 18px 0; }
  .quick-capture-card,
  .personal-row .task-card,
  .command-board,
  .data-source-card,
  .generator-card,
  .manual-draft-card,
  .draft-queue { min-height: 0; padding: 20px; }
  .section-heading h3 { font-size: 25px; }
  .quick-capture-card textarea { min-height: 112px; }
  .quick-capture-card small { font-size: 14px; line-height: 1.6; }
  .quick-task-form { grid-template-columns: minmax(0,1fr) 50px; gap: 10px; }
  .quick-task-form button { min-height: 48px; font-size: 24px; }
  .task-row strong { font-size: 16px; }
  .task-row small { font-size: 13px; }
  .time-ledger-entry { min-height: 112px; padding: 18px; grid-template-columns: minmax(0,1fr) auto; gap: 12px; }
  .time-entry-copy > strong { font-size: 22px; }
  .time-entry-copy > small { font-size: 13px; }
  .time-entry-balance { min-width: 98px; padding: 10px 12px; }
  .time-entry-balance small { font-size: 11px; }
  .time-entry-balance strong { font-size: 30px; }
  .time-entry-balance i { font-size: 11px; }
  .time-entry-arrow { display: none; }
  .metric-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .metric-card { min-width: 0; min-height: 108px; padding: 16px; }
  .metric-card span { font-size: 15px; }
  .metric-card strong { font-size: 34px; }
  .metric-card small { display: block; font-size: 13px; }
  .lane-grid { grid-template-columns: 1fr; }
  .command-lane { padding: 16px; border-radius: 12px; }
  .command-lane h4 { font-size: 17px; }
  .source-row { min-height: 52px; font-size: 16px; }
  .source-state { font-size: 13px; }
  .source-note,
  .empty-note { font-size: 14px; line-height: 1.65; }

  [data-theme="control-room"] .page-lead { padding: 26px 2px 20px; }
  [data-theme="control-room"] .page-lead h2,
  [data-theme="control-room"] #view-meetings .meeting-page-lead h2 { margin: 14px 0 12px; font-size: 36px; line-height: 1.12; }
  [data-theme="control-room"] .page-lead p,
  [data-theme="control-room"] #view-meetings .meeting-page-lead p { font-size: 16px; line-height: 1.7; }
  .work-card { padding: 20px; }
  .work-card h3 { font-size: 24px; }
  .work-fact { font-size: 16px; }
  .work-meta { grid-template-columns: 1fr; }
  .work-meta span { font-size: 14px; }
  .work-meta small { font-size: 11px; }
  .work-details summary { min-height: 44px; display: flex; align-items: center; font-size: 15px; }
  .chat-intro { padding: 28px 20px; }
  .chat-intro h2 { font-size: 34px; }
  .chat-intro p,
  .bubble { font-size: 16px; }
  .prompt-chips button { min-height: 44px; font-size: 14px; }
  .message-list { padding: 18px 14px; }
  .message { max-width: 100%; }
  .composer { grid-template-columns: 1fr; padding: 14px; }
  .composer textarea { min-height: 92px; }
  .composer small { font-size: 12px; }
  .send-button { width: 100%; }

  [data-theme="control-room"] #view-meetings .meeting-index-panel {
    z-index: 42;
    width: min(390px,100vw);
    padding: max(20px,env(safe-area-inset-top)) 18px max(24px,env(safe-area-inset-bottom));
    border-radius: 0;
  }
  .meeting-index-backdrop { z-index: 40; }
  .meeting-index-close { width: 48px; height: 48px; border-radius: 12px; font-size: 26px; }
  .meeting-index-panel .section-heading h3 { font-size: 28px; }
  .meeting-count { min-width: 38px; height: 38px; font-size: 16px; }
  .meeting-list { display: grid; overflow: visible; gap: 12px; }
  .meeting-list-item { min-width: 0; min-height: 112px; padding: 16px; border-radius: 12px; }
  .meeting-list-item b { font-size: 14px; }
  .meeting-list-item strong { font-size: 18px; }
  .meeting-list-item small { font-size: 14px; }
  .meeting-state { min-height: 28px; padding: 5px 8px; font-size: 11px; }
  .meeting-cockpit-toolbar { min-height: 58px; padding: 8px 10px; }
  .meeting-index-toggle { min-height: 44px; padding: 9px 12px; font-size: 15px; }
  .meeting-hero { padding: 26px 20px; }
  .meeting-code { font-size: 14px; }
  .meeting-hero h2 { margin-top: 20px; font-size: 34px; line-height: 1.08; letter-spacing: -.035em; }
  .meeting-hero > p { font-size: 16px; line-height: 1.75; }
  .meeting-hero dl { margin-top: 22px; }
  .meeting-hero dl div { padding: 14px; }
  .meeting-hero dt { font-size: 12px; }
  .meeting-hero dd { font-size: 16px; line-height: 1.5; }
  .meeting-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .meeting-metrics article { min-height: 132px; padding: 16px; }
  .meeting-metrics span { font-size: 14px; }
  .meeting-metrics strong { font-size: 30px; }
  .meeting-metrics small { font-size: 13px; line-height: 1.5; }
  .meeting-block { padding: 24px 18px; }
  .meeting-block-head h3 { font-size: 25px; }
  .meeting-block-head > small { font-size: 14px; line-height: 1.5; }
  .meeting-timeline { display: grid; grid-template-columns: 1fr; overflow: visible; gap: 12px; }
  .meeting-timeline article { min-width: 0; min-height: 124px; padding: 20px 16px; border: 1px solid #d5d2c8; border-top-width: 5px; border-radius: 10px; }
  .meeting-timeline article::before { top: -9px; }
  .meeting-timeline time { font-size: 13px; }
  .meeting-timeline strong { margin-top: 14px; font-size: 19px; }
  .meeting-timeline small { font-size: 15px; line-height: 1.6; }
  .meeting-matrix-scroll { border-radius: 8px; }
  .meeting-matrix th,
  .meeting-matrix td { padding: 12px; font-size: 14px; }
  .meeting-note { font-size: 15px; line-height: 1.7; }
  .meeting-action-filters button { min-height: 44px; padding: 9px 13px; font-size: 15px; }
  .meeting-action-main { min-height: 88px; padding: 14px 4px; grid-template-columns: auto 11px minmax(0,1fr); gap: 10px; }
  .meeting-action-main .meeting-select input { width: 22px; height: 22px; }
  .meeting-action-signal { width: 11px; height: 11px; }
  .meeting-action-main strong { font-size: 18px; line-height: 1.45; }
  .meeting-action-main small { margin-top: 5px; font-size: 14px; line-height: 1.5; }
  .meeting-action-main time { max-width: none; font-size: 13px; }
  .meeting-linked-mark { font-size: 12px; }
  .meeting-action-row > details { padding: 0 4px 16px 44px; }
  .meeting-action-row > details > summary { min-height: 44px; display: flex; align-items: center; font-size: 15px; }
  .meeting-action-row > details > p { margin-top: 8px; font-size: 16px; line-height: 1.7; }
  .meeting-item { padding: 18px; border-radius: 10px; }
  .meeting-kind { font-size: 12px; }
  .meeting-select { min-height: 44px; font-size: 14px; }
  .meeting-select input { width: 22px; height: 22px; }
  .meeting-item h4 { font-size: 20px; }
  .meeting-item > p,
  .meeting-proposal p { font-size: 16px; line-height: 1.7; }
  .meeting-item-meta { font-size: 13px; line-height: 1.55; }
  .meeting-proposal summary { min-height: 44px; display: flex; align-items: center; font-size: 15px; }
  .meeting-confirm-bar { bottom: max(10px,env(safe-area-inset-bottom)); padding: 16px; border-radius: 12px; }
  .meeting-confirm-bar span { font-size: 14px; line-height: 1.55; }
  .meeting-source { margin: 18px 0; border-radius: 10px; overflow: hidden; }
  .meeting-source summary { min-height: 52px; display: flex; align-items: center; padding: 14px 16px; font-size: 16px; }
  .meeting-source pre { padding: 16px; font-size: 14px; line-height: 1.75; }
}

@media (max-width: 430px) {
  [data-theme="control-room"] .model-picker { min-width: 104px; }
  [data-theme="control-room"] .model-picker select { font-size: 15px; }
  .global-inbox-head { display: grid; grid-template-columns: minmax(0,1fr) auto; }
}

@media (max-width: 360px) {
  [data-theme="control-room"] .model-picker { display: none; }
  [data-theme="control-room"] .hero-actions { grid-template-columns: 1fr; }
  .metric-grid,
  .meeting-metrics { grid-template-columns: 1fr; }
}

/* Dashboard 0.12 — one work surface instead of stacked input panels. */
.work-overview-card {
  margin: 18px 0;
  padding: 0;
  overflow: hidden;
  background: rgba(255,253,246,.86);
  border-color: rgba(26,30,22,.16);
}
.work-overview-head {
  padding: 22px 24px 17px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgba(26,30,22,.14);
}
.work-overview-head h3 {
  margin: 7px 0 4px;
  font: 700 30px/1 "STSong","SimSun",serif;
}
.work-overview-head p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}
.work-overview-tabs {
  padding: 10px 16px;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  border-bottom: 1px solid rgba(26,30,22,.14);
  scrollbar-width: none;
}
.work-overview-tabs::-webkit-scrollbar { display: none; }
.work-overview-tabs button {
  min-height: 34px;
  padding: 7px 11px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(26,30,22,.18);
  border-radius: 999px;
  color: #4f5349;
  background: transparent;
  font-size: 10px;
  font-weight: 750;
}
.work-overview-tabs button.is-active {
  color: #171912;
  border-color: #171912;
  background: var(--sun);
  box-shadow: 2px 2px 0 #171912;
}
.work-overview-tabs b {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #fffdf6;
  background: #171912;
  font: 700 9px/1 Consolas,monospace;
}
.work-overview-list { margin: 0; }
.work-overview-row {
  width: 100%;
  min-width: 0;
  min-height: 68px;
  padding: 8px 20px;
  display: grid;
  grid-template-columns: 44px minmax(0,1fr);
  align-items: center;
  gap: 11px;
  border: 0;
  border-bottom: 1px solid rgba(26,30,22,.11);
  color: #171912;
  background: transparent;
  text-align: left;
}
.work-overview-row.is-task { align-items: start; }
.work-overview-row:hover { background: rgba(204,255,41,.12); }
.work-overview-control {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  border: 0;
  color: #171912;
  background: transparent;
}
label.work-overview-control { cursor: pointer; }
.work-overview-control input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #171912;
  cursor: pointer;
}
.work-overview-control.is-marker::before {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(26,30,22,.32);
  content: "";
}
.work-overview-control.is-project-marker::before { background: #171912; }
.work-overview-control.is-inbox-marker::before { background: var(--sun); }
.work-overview-task-detail { min-width: 0; }
.work-overview-main {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(68px,120px) minmax(0,1fr) auto;
  align-items: center;
  gap: 11px;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}
button.work-overview-main,
.work-overview-task-detail > summary { cursor: pointer; }
.work-overview-task-detail > summary { list-style: none; }
.work-overview-task-detail > summary::-webkit-details-marker { display: none; }
.work-overview-main:focus-visible,
.work-overview-control:focus-within {
  outline: 2px solid #315d8d;
  outline-offset: 2px;
}
.work-source {
  max-width: 120px;
  padding: 4px 7px;
  overflow: hidden;
  border: 1px solid rgba(26,30,22,.16);
  color: #55594e;
  background: #efede5;
  font: 700 8px/1 Consolas,monospace;
  letter-spacing: .05em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.work-source.personal { background: #e7f8ed; }
.work-source.project { color: #fffdf6; background: #171912; }
.work-source.codex { color: #171912; background: var(--sun); }
.work-overview-copy { min-width: 0; }
.work-overview-copy strong,
.work-overview-copy small { display: block; }
.work-overview-copy strong {
  overflow: hidden;
  font-size: 12px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.work-overview-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}
.work-overview-tail {
  color: #6c7066;
  font: 700 8px/1.3 Consolas,monospace;
  font-style: normal;
  text-align: right;
}
.work-overview-row.is-done { color: #686c62; background: rgba(239,237,229,.6); }
.work-overview-row.is-done strong { text-decoration: line-through; }
.work-overview-detail-panel {
  margin: 5px 0 7px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 9px;
  border: 1px solid rgba(26,30,22,.12);
  border-radius: 9px;
  background: rgba(255,255,255,.52);
}
.work-overview-detail-panel > div { min-width: 0; }
.work-overview-detail-panel dt {
  margin: 0 0 3px;
  color: #73776d;
  font: 700 8px/1.3 Consolas,monospace;
  letter-spacing: .08em;
}
.work-overview-detail-panel dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 10px;
  line-height: 1.45;
}
.work-overview-empty { margin: 0; padding: 24px; }
.work-overview-more { width: 100%; padding: 13px 20px; text-align: left; }
.work-capture { border-top: 1px solid rgba(26,30,22,.14); }
.work-capture > summary {
  min-height: 48px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  color: #171912;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  list-style: none;
}
.work-capture > summary::-webkit-details-marker { display: none; }
.work-capture[open] > summary { color: #171912; background: var(--sun); }
.work-capture-body {
  padding: 18px 20px 20px;
  display: grid;
  grid-template-columns: minmax(0,.85fr) minmax(0,1.15fr);
  gap: 20px;
  background: rgba(239,237,229,.7);
}
.quick-task-form {
  display: grid;
  grid-template-columns: minmax(0,1fr) 165px;
  gap: 10px;
  align-content: start;
}
.quick-task-form label,
.quick-capture-form { min-width: 0; }
.quick-task-form label > span,
.quick-capture-form > label {
  display: block;
  margin-bottom: 6px;
  color: #65695e;
  font: 700 8px/1 Consolas,monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.quick-task-form input { width: 100%; min-width: 0; }
.quick-task-form button {
  min-height: 40px;
  grid-column: 1 / -1;
  border: 1px solid #171912;
  border-radius: 0;
  color: #171912;
  background: var(--sun);
  box-shadow: 3px 3px 0 #171912;
  font-size: 11px;
  font-weight: 800;
}
.quick-capture-form { display: grid; gap: 9px; }
.quick-capture-form textarea { min-height: 74px; resize: vertical; }
.quick-capture-form small { color: var(--muted); font-size: 9px; line-height: 1.55; }

.global-inbox-card.is-empty .global-inbox-head {
  min-height: 0;
  padding-block: 14px;
}
.global-inbox-card.is-empty .global-inbox-head h3 { margin: 3px 0 0; font-size: 20px; }
.global-inbox-card.is-empty .global-inbox-head p,
.global-inbox-card.is-empty .global-inbox-flow { display: none; }
.global-inbox-card.is-empty .global-inbox-counter { padding-block: 2px; }
.global-inbox-card.is-empty .global-inbox-counter strong { font-size: 26px; }
.global-inbox-card.is-empty .global-inbox-empty {
  min-height: 0;
  padding: 10px 24px;
}
.global-inbox-card.is-empty .global-inbox-empty > span { width: 26px; height: 26px; }
.global-inbox-card.is-empty .global-inbox-empty p { display: none; }

.compact-source-card {
  margin: 18px 0;
  padding: 0;
  overflow: hidden;
}
.connection-disclosure > summary {
  min-height: 64px;
  padding: 13px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  cursor: pointer;
  list-style: none;
}
.connection-disclosure > summary::-webkit-details-marker { display: none; }
.connection-disclosure > summary span { display: grid; gap: 5px; }
.connection-disclosure > summary i { font-style: normal; }
.connection-disclosure > summary strong { font: 700 18px/1 "STSong","SimSun",serif; }
.connection-disclosure > summary > b {
  color: #d7664e;
  font-size: 10px;
}
.connection-disclosure > summary > b.has-connection { color: #338557; }
.connection-disclosure > summary::after {
  content: "＋";
  color: #171912;
  font-size: 18px;
  font-weight: 700;
}
.connection-disclosure[open] > summary::after { content: "−"; }
.connection-details {
  padding: 0 20px 16px;
  border-top: 1px solid rgba(26,30,22,.12);
}
.connection-details .text-link { margin-top: 12px; }

/* Background rules stay compact: current state first, history second. */
.automation-lead p { max-width: 800px; }
.automation-control {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 18px 28px;
  align-items: center;
  margin-bottom: 18px;
  padding: 24px;
}
.automation-control h3 { margin: 7px 0 5px; font-size: 28px; }
.automation-control p { margin: 0; color: var(--muted); line-height: 1.55; }
.automation-quiet-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2,minmax(150px,220px)) auto;
  gap: 12px;
  align-items: end;
  padding-top: 18px;
  border-top: 1px solid rgba(23,25,18,.13);
}
.automation-quiet-form label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; }
.automation-quiet-form input { min-height: 43px; }
.automation-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.automation-rule { padding: 22px; }
.automation-rule-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.automation-rule h3 { margin: 7px 0 0; font-size: 24px; }
.automation-rule p { min-height: 48px; margin: 15px 0; color: var(--muted); line-height: 1.55; }
.automation-rule-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.automation-rule-meta span {
  padding: 6px 9px;
  border: 1px solid rgba(23,25,18,.18);
  border-radius: 999px;
  font-size: 11px;
  background: rgba(255,255,255,.55);
}
.automation-rule-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.automation-state {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid rgba(23,25,18,.2);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.automation-state.is-on { background: rgba(216,255,62,.48); }
.automation-history { margin-top: 18px; padding: 22px; }
.automation-run-list { display: grid; gap: 12px; }
.automation-run {
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid #ded5c1;
  border-radius: 14px;
  background: #fffdf7;
}
.automation-run-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.automation-run-head > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.automation-run strong {
  min-width: 0;
  font-size: 16px;
  line-height: 1.35;
}
.automation-run time {
  flex: 0 0 auto;
  color: #797365;
  font-size: 12px;
  line-height: 1.4;
}
.automation-run-preview {
  display: -webkit-box;
  margin: 12px 0 0;
  overflow: hidden;
  color: #4e4a41;
  font-size: 15px;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow-wrap: anywhere;
}
.automation-run-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid rgba(23,25,18,.14);
  border-radius: 999px;
  font: 700 10px/1 Consolas, monospace;
}
.automation-run-status.completed { color: #496600; background: #eef6d5; }
.automation-run-status.failed { color: #a64031; background: #fff0eb; }
.automation-run-status.skipped { color: #746d60; background: #f1eee5; }
.automation-run-status.running { color: #315d8d; background: #edf5ff; }
.automation-run-details { margin-top: 12px; }
.automation-run-details summary {
  width: fit-content;
  color: #b95d46;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  list-style-position: inside;
}
.automation-run-details > div {
  max-height: 52vh;
  margin-top: 10px;
  padding: 14px;
  overflow: auto;
  border-left: 3px solid #efb5a6;
  border-radius: 0 10px 10px 0;
  color: #3f3c35;
  background: #fbf5e8;
  font-size: 15px;
  line-height: 1.72;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.automation-empty { padding: 22px 0; color: var(--muted); }

@media (max-width: 820px), (max-width: 900px) and (max-height: 500px) {
  .work-overview-card { margin: 14px 0; border-radius: 14px 14px 14px 6px; }
  .work-overview-head { padding: 18px 18px 14px; }
  .work-overview-head h3 { font-size: 29px; }
  .work-overview-head p { font-size: 14px; line-height: 1.5; }
  .work-overview-head > .text-link { display: none; }
  .work-overview-tabs { padding: 10px 12px 12px; }
  .work-overview-tabs button { min-height: 38px; padding: 8px 11px; font-size: 13px; }
  .work-overview-tabs b { min-width: 20px; height: 20px; font-size: 10px; }
  .work-overview-row { min-height: 76px; padding: 10px 12px; gap: 9px; }
  .work-overview-main {
    grid-template-columns: minmax(0,1fr) auto;
    gap: 5px 8px;
  }
  .work-overview-main .work-source { grid-column: 1; grid-row: 1; }
  .work-overview-main .work-overview-tail { grid-column: 2; grid-row: 1; }
  .work-overview-main .work-overview-copy { grid-column: 1 / -1; grid-row: 2; }
  .work-source { max-width: 88px; font-size: 10px; }
  .work-overview-copy strong {
    display: -webkit-box;
    overflow: hidden;
    font-size: 15px;
    line-height: 1.45;
    white-space: normal;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .work-overview-copy small { font-size: 12px; }
  .work-overview-tail { font-size: 10px; }
  .work-overview-detail-panel {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 8px;
    padding: 11px 12px;
  }
  .work-overview-detail-panel dt { font-size: 10px; }
  .work-overview-detail-panel dd { font-size: 13px; }
  .work-capture > summary { min-height: 52px; padding-inline: 16px; font-size: 15px; }
  .work-capture-body { padding: 16px; grid-template-columns: 1fr; gap: 18px; }
  .quick-task-form { grid-template-columns: 1fr; }
  .quick-task-form label > span,
  .quick-capture-form > label { font-size: 12px; }
  .quick-task-form input { min-height: 48px; }
  .quick-task-form button { min-height: 48px; font-size: 15px; }
  .quick-capture-form textarea { min-height: 96px; }
  .quick-capture-form small { font-size: 13px; }

  .global-inbox-card.is-empty .global-inbox-head {
    padding: 13px 16px;
    align-items: center;
  }
  .global-inbox-card.is-empty .global-inbox-head h3 { margin: 4px 0 0; font-size: 21px; }
  .global-inbox-card.is-empty .global-inbox-head .eyebrow { font-size: 10px; }
  .global-inbox-card.is-empty .global-inbox-counter strong { font-size: 24px; }
  .global-inbox-card.is-empty .global-inbox-counter span { font-size: 8px; }
  .global-inbox-card.is-empty .global-inbox-empty { min-height: 0; padding: 9px 16px; }
  .global-inbox-card.is-empty .global-inbox-empty strong { font-size: 13px; }

  .metric-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 9px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .metric-grid::-webkit-scrollbar { display: none; }
  .metric-card {
    min-width: 138px;
    min-height: 90px;
    flex: 0 0 138px;
    scroll-snap-align: start;
  }
  .metric-card strong { font-size: 30px; }
  .compact-source-card { margin: 14px 0; border-radius: 14px 14px 14px 6px; }
  .connection-disclosure > summary { min-height: 58px; padding: 12px 16px; }
  .connection-disclosure > summary strong { font-size: 20px; }
  .connection-disclosure > summary > b { font-size: 12px; }
  .connection-details { padding: 0 16px 16px; }
  .connection-details .source-row { font-size: 15px; }
  .connection-details .source-state { font-size: 12px; }
  .automation-lead { padding-bottom: 16px; }
  .automation-control { grid-template-columns: 1fr auto; padding: 18px; border-radius: 14px 14px 14px 6px; }
  .automation-control h3 { font-size: 23px; }
  .automation-control-copy p { font-size: 13px; }
  .automation-quiet-form { grid-template-columns: 1fr 1fr; }
  .automation-quiet-form button { grid-column: 1 / -1; }
  .automation-grid { grid-template-columns: 1fr; gap: 12px; }
  .automation-rule { padding: 18px; border-radius: 14px 14px 14px 6px; }
  .automation-rule h3 { font-size: 21px; }
  .automation-rule p { min-height: 0; margin: 12px 0; font-size: 13px; }
  .automation-history { padding: 18px; border-radius: 14px 14px 14px 6px; }
  .automation-run { padding: 15px; }
  .automation-run-head { display: grid; gap: 8px; }
  .automation-run-head > div { align-items: flex-start; }
  .automation-run strong { font-size: 17px; }
  .automation-run time { padding-left: 46px; font-size: 12px; }
  .automation-run-preview { margin-top: 11px; font-size: 15px; line-height: 1.72; }
  .automation-run-details > div { padding: 13px; font-size: 15px; }
}

/* Chat stays inside the viewport; only the conversation history scrolls. */
#view-chat.is-active {
  height: calc(100vh - 172px);
  height: calc(100dvh - 172px);
  overflow: hidden;
}
#view-chat .chat-layout {
  height: 100%;
  padding-bottom: 18px;
}
#view-chat .chat-panel {
  height: 100%;
  min-height: 0;
}
#view-chat .message-list {
  min-height: 0;
  max-height: none;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}
#view-chat .composer {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
}
#view-chat .chat-side {
  max-height: 100%;
  overflow-y: auto;
}

@media (max-width: 700px) {
  #view-chat.is-active {
    height: calc(100vh - 226px - env(safe-area-inset-top));
    height: calc(100dvh - 226px - env(safe-area-inset-top));
  }
  #view-chat .chat-layout {
    padding-top: 8px;
    padding-bottom: 4px;
  }
  #view-chat .chat-side { display: none; }
  #view-chat .message-list { padding: 14px 12px; }
  #view-chat .composer {
    grid-template-columns: minmax(0,1fr) 78px;
    padding: 10px 10px max(10px,env(safe-area-inset-bottom));
  }
  #view-chat .composer textarea {
    min-height: 54px;
    max-height: 108px;
  }
  #view-chat .composer .send-button {
    width: auto;
    min-height: 54px;
  }
  #view-chat .composer small { font-size: 10px; }
}

/* V0.12.5 — one warm sidecar shell and a quieter conversation surface. */
#view-chat .chat-panel {
  border: 1px solid #ded5c1;
  border-radius: 18px;
  background: #fbf7eb;
  box-shadow: 0 12px 30px rgba(90,77,48,.08);
}
#view-chat .chat-intro {
  padding: clamp(28px,4vw,44px);
  border-bottom-color: #e2d9c6;
  background: #fbf7eb;
}
#view-chat .chat-intro::after {
  top: -18px;
  color: rgba(234,113,83,.055);
  font-size: 210px;
}
#view-chat .chat-intro h2 {
  font-family: Georgia, "STSong", serif;
  font-size: clamp(34px,4vw,52px);
  font-weight: 600;
  letter-spacing: -.035em;
}
#view-chat .prompt-chips { margin-top: 18px; }
#view-chat .prompt-chips button {
  min-height: 38px;
  border-color: #ddd2bb;
  border-radius: 11px;
  color: #5c574c;
  background: #fffaf0;
}
#view-chat .prompt-chips button:hover {
  color: #c85f49;
  border-color: #edb7a9;
  background: #fff0e9;
}
#view-chat .voice-dock {
  margin: 14px 16px 0;
  padding: 12px;
  border-color: #e0d6c2;
  border-radius: 15px;
  background: #fffaf0;
  box-shadow: none;
}
#view-chat .voice-toggle {
  border: 1px solid #ddd2bb;
  border-radius: 11px;
  background: #fffdf7;
}
#view-chat .voice-orb {
  background: #f08062;
  box-shadow: 0 5px 12px rgba(214,111,83,.18);
}
#view-chat .voice-toggle.is-active .voice-orb { background: #6cab84; }
#view-chat .voice-copy strong { font-size: 12px; }
#view-chat .voice-copy small { font-size: 9px; }
#view-chat .voice-interrupt {
  min-height: 38px;
  border-color: #ddd2bb;
  border-radius: 10px;
  color: #686256;
  background: #fffdf7;
}
#view-chat .voice-settings {
  margin: 9px 16px 0;
  border-color: #e0d6c2;
  border-radius: 13px;
  background: #fffaf0;
}
#view-chat .voice-shortcuts button {
  border-color: #ddd2bb;
  color: #686256;
  background: #fffdf7;
}
#view-chat .message-list {
  gap: 12px;
  padding: 22px;
  background:
    linear-gradient(rgba(222,213,193,.22) 1px, transparent 1px),
    #f8f3e7;
  background-size: 100% 42px;
}
#view-chat .message { max-width: min(90%, 820px); }
#view-chat .avatar {
  width: 32px;
  height: 32px;
  border: 1px solid #ded5c1;
  border-radius: 10px;
  color: #77594e;
  background: #ffe8dd;
  font-size: 11px;
}
#view-chat .message.user .avatar {
  color: #4d688d;
  background: #e7f0fb;
}
#view-chat .bubble,
#view-chat .message.user .bubble {
  padding: 15px 17px;
  color: #302e29;
  border: 1px solid #ded5c1;
  border-radius: 15px;
  background: #fffdf7;
  box-shadow: 0 5px 14px rgba(91,77,49,.045);
}
#view-chat .message.user .bubble { background: #f3eddf; }
#view-chat .agent-suggestions {
  border-color: #ded5c1;
  border-radius: 16px;
  background: #fffaf0;
  box-shadow: none;
}
#view-chat .suggestion-card {
  border-color: #e3d9c5;
  border-radius: 13px;
  background: #fffdf7;
}
#view-chat .composer {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  gap: 10px;
  margin: 10px 14px 14px;
  padding: 10px;
  border: 1px solid #dcd1ba;
  border-radius: 16px;
  background: #fffdf7;
  box-shadow: 0 8px 20px rgba(91,77,49,.07);
}
#view-chat .composer textarea {
  width: 100%;
  min-height: 58px;
  max-height: 160px;
  padding: 13px 14px;
  border: 0;
  border-radius: 11px;
  background: #fbf7eb;
  outline: 0;
}
#view-chat .composer textarea:focus {
  outline: 1px solid #e9b4a6;
  outline-offset: 0;
}
.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.composer-actions small {
  min-width: 0;
  color: #81796b;
  font-size: 11px;
  line-height: 1.35;
}
.mobile-compose-hint { display: none; }
[data-theme="control-room"] #view-chat .send-button {
  min-width: 92px;
  color: #cb684f;
  border: 1px solid #efc1b4;
  border-radius: 12px;
  background: #ffebe4;
  box-shadow: none;
}
[data-theme="control-room"] #view-chat .send-button span { white-space: nowrap; }
[data-theme="control-room"] #view-chat .send-button:hover {
  color: #a64d39;
  background: #ffdfd5;
  box-shadow: none;
  transform: translateY(-1px);
}
#view-chat .chat-side section {
  border-color: #ded5c1;
  border-radius: 16px;
  background: #fffaf0;
  box-shadow: none;
}
#view-chat .chat-side strong { color: #6a9b7a; }
#view-chat .chat-rule { background: #fff0df; }

@media (max-width: 820px) {
  [data-theme="control-room"] .workspace-header {
    margin-left: calc(-1 * max(16px,env(safe-area-inset-left)));
    margin-right: calc(-1 * max(16px,env(safe-area-inset-right)));
    padding-left: max(16px,env(safe-area-inset-left));
    padding-right: max(16px,env(safe-area-inset-right));
  }
  #view-chat .chat-panel { border-radius: 16px; }
  #view-chat .voice-dock,
  #view-chat .voice-settings { margin-inline: 10px; }
  #view-chat .message-list { padding: 14px 11px; }
  #view-chat .composer { margin: 8px 8px 10px; }
}

@media (max-width: 700px) {
  #view-chat .composer {
    grid-template-columns: minmax(0,1fr);
    gap: 8px;
    padding: 9px;
    border-radius: 18px;
  }
  #view-chat .composer textarea {
    min-height: 72px;
    max-height: 132px;
    padding: 12px 13px;
    font-size: 16px;
    line-height: 1.5;
  }
  .desktop-compose-hint { display: none; }
  .mobile-compose-hint { display: inline; }
  .composer-actions { padding-left: 4px; }
  [data-theme="control-room"] #view-chat .send-button {
    min-width: 86px;
    min-height: 44px;
    padding-inline: 13px;
    font-size: 14px;
  }
}

.draft-review-controls {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.draft-review-controls .draft-filter-bar { margin-bottom: 0; }
.draft-bulk-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}
.draft-bulk-button {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid #d8cfbc;
  border-radius: 999px;
  color: #615b4f;
  background: #fffaf0;
  font-size: 12px;
  font-weight: 700;
}
.draft-bulk-button.is-primary {
  color: #273400;
  border-color: #b5d83a;
  background: #e6ff76;
}
.draft-bulk-button:disabled { opacity: .58; }
.draft-bulk-note {
  min-height: 18px;
  margin: 0 0 14px;
  color: #81796b;
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 700px) {
  .draft-review-controls { display: grid; gap: 10px; }
  .draft-review-controls .draft-filter-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .draft-filter { flex: 0 0 auto; }
  .draft-bulk-actions {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    width: 100%;
  }
  .draft-bulk-actions:has(> :only-child) { grid-template-columns: minmax(0,1fr); }
  .draft-bulk-button {
    min-height: 42px;
    border-radius: 12px;
    font-size: 14px;
  }
  .draft-bulk-note { margin-bottom: 12px; font-size: 11px; }
}

/* Progressive disclosure and long-form reading for the single-user mobile workspace. */
.create-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  cursor: pointer;
  list-style: none;
}
.create-panel > summary::-webkit-details-marker { display: none; }
.create-panel > summary h3 { margin: 4px 0 0; font-size: 24px; }
.create-panel > summary small { color: var(--muted); font-size: 11px; }
.create-panel[open] > summary {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.mail-open-button {
  min-width: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  color: inherit;
  background: transparent;
  text-align: left;
}
.mail-open-button strong {
  overflow: hidden;
  font-size: 16px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mail-open-button span { color: var(--ink-soft); font-size: 13px; overflow-wrap: anywhere; }
.mail-item-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mail-read-button { color: #314800; border-color: #b8d951; background: rgba(218,255,111,.62); }

.mail-reader {
  width: min(760px,calc(100vw - 32px));
  max-height: min(820px,calc(100dvh - 40px));
  padding: 0;
  overflow: hidden;
  border: 1px solid #d8cfbc;
  border-radius: 24px;
  color: #25261f;
  background: #fffaf0;
  box-shadow: 0 28px 80px rgba(23,25,18,.28);
}
.mail-reader::backdrop { background: rgba(15,17,12,.56); backdrop-filter: blur(3px); }
.mail-reader-shell { max-height: inherit; display: grid; grid-template-rows: auto auto minmax(160px,1fr) auto; }
.mail-reader-head {
  min-height: 62px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e1d8c6;
  background: #f5f0e4;
}
.mail-reader-head > div { display: grid; gap: 5px; }
.mail-reader-head strong { color: #5d6754; font-size: 12px; }
.mail-reader-close {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #d8cfbc;
  border-radius: 50%;
  color: #34362e;
  background: #fffaf0;
  font-size: 24px;
}
.mail-reader-title { padding: 24px 26px 18px; border-bottom: 1px solid #e8dfcf; }
.mail-reader-title h2 {
  max-width: 24ch;
  margin: 0 0 12px;
  font: 700 clamp(24px,4vw,36px)/1.22 "STSong","SimSun",serif;
  overflow-wrap: anywhere;
}
.mail-reader-title p,
.mail-reader-title time { display: block; margin: 0; color: #696b62; font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.mail-reader-body {
  max-width: 72ch;
  width: 100%;
  margin-inline: auto;
  padding: 24px 28px 34px;
  overflow: auto;
  color: #31332c;
  font-size: 16px;
  line-height: 1.82;
  letter-spacing: .012em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.mail-reader-actions {
  min-height: 70px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid #e1d8c6;
  background: #f5f0e4;
}
.mail-reader-actions span { color: #6b6e64; font-size: 12px; line-height: 1.5; }
body.mail-reader-open { overflow: hidden; }

@media (max-width: 820px) {
  #view-work .page-lead { padding: 20px 2px 14px; }
  [data-theme="control-room"] #view-work .page-lead h2 { margin: 10px 0 8px; font-size: 31px; }
  [data-theme="control-room"] #view-work .page-lead p { font-size: 14px; line-height: 1.6; }
  #view-work .work-list-panel { order: 1; }
  #view-work .create-panel {
    position: static;
    order: 2;
    max-height: none;
    padding: 0;
    overflow: hidden;
  }
  #view-work .create-panel > summary { min-height: 74px; padding: 16px 18px; }
  #view-work .create-panel > summary h3 { font-size: 21px; }
  #view-work .create-panel > summary small { font-size: 12px; }
  #view-work .create-panel[open] > summary { margin-bottom: 0; }
  #view-work .create-panel .work-form { padding: 18px; }
  #view-work .filter-bar { position: sticky; top: 0; z-index: 3; padding: 10px 2px; background: rgba(247,243,232,.94); backdrop-filter: blur(8px); }
  #view-work .work-card { padding: 17px; }
  #view-work .work-card h3 { margin-top: 12px; font-size: 21px; line-height: 1.32; }
  #view-work .work-fact {
    display: -webkit-box;
    overflow: hidden;
    font-size: 16px;
    line-height: 1.65;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .mail-reader {
    width: 100vw;
    max-width: none;
    max-height: calc(100dvh - max(18px,env(safe-area-inset-top)));
    margin: auto 0 0;
    border-width: 1px 0 0;
    border-radius: 26px 26px 0 0;
  }
  .mail-reader-shell { max-height: calc(100dvh - max(18px,env(safe-area-inset-top))); }
  .mail-reader-title { padding: 20px 20px 16px; }
  .mail-reader-title h2 { max-width: none; font-size: 26px; line-height: 1.28; }
  .mail-reader-title p,
  .mail-reader-title time { font-size: 14px; }
  .mail-reader-body { padding: 20px 20px 34px; font-size: 16px; line-height: 1.86; }
  .mail-reader-actions {
    padding: 12px 16px max(12px,env(safe-area-inset-bottom));
    align-items: stretch;
    flex-direction: column;
  }
  .mail-reader-actions .ghost-button { width: 100%; }

  #view-drafts .page-lead { padding-bottom: 12px; }
  #view-drafts .draft-queue { padding: 17px; }
  #view-drafts .draft-group-head { align-items: flex-start; padding: 15px; }
  #view-drafts .draft-group-head h4 { font-size: 17px; line-height: 1.35; }
  #view-drafts .draft-group-head > span { padding-top: 3px; font-size: 11px; }
  #view-drafts .draft-summary { align-items: start; gap: 10px; padding: 14px 15px; }
  #view-drafts .draft-summary-main strong { font-size: 14px; line-height: 1.4; }
  #view-drafts .draft-channel { font-size: 11px; }
  #view-drafts .draft-summary-main p {
    display: -webkit-box;
    margin-top: 9px;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.58;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  #view-drafts .draft-summary-meta small { font-size: 11px; }
  #view-drafts .draft-body { padding: 0 15px 16px; }
  #view-drafts .draft-body > p { padding: 16px; font-size: 16px; line-height: 1.82; overflow-wrap: anywhere; }
  #view-drafts .draft-recipient,
  #view-drafts .draft-foot small { font-size: 12px; line-height: 1.5; }
}
