: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);
}
.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; }
.mini-label, .eyebrow { color: var(--muted); letter-spacing: .16em; font: 9px/1.4 Consolas, monospace; text-transform: uppercase; }

.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: none;
  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: 1px 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; }
.automation-connections > .section-heading .eyebrow { display: none; }
.automation-connections > .section-heading h3 { margin-top: 0; }
.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: 1px; 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--mail { --status-color: #64a9e0; }
.work-card--mail.status-closed { --status-color: var(--leaf); }
.work-card--mail .work-actions { grid-template-columns: auto; }
.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; }
.bubble .chat-link {
  color: var(--p4-accent-ink, #215e4b);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

/* Conversation-first chat: compact thread controls, recoverable failures and bounded history. */
#view-chat .chat-threadbar {
  min-height: 48px;
  padding: 0 12px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--p4-line, var(--line));
  background: var(--p4-surface, #fff);
}

#view-chat .chat-threadbar > div {
  min-width: 0;
  display: grid;
  justify-items: center;
  line-height: 1.2;
}

#view-chat .chat-threadbar strong {
  max-width: 100%;
  overflow: hidden;
  color: var(--p4-text-1, var(--ink));
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#view-chat .chat-threadbar small {
  max-width: 100%;
  margin-top: 2px;
  overflow: hidden;
  color: var(--p4-text-3, var(--muted));
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#view-chat :is(.chat-thread-menu, .chat-thread-new),
.conversation-rail-head > button,
.conversation-item-action {
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--p4-text-2, var(--ink));
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}

#view-chat :is(.chat-thread-menu, .chat-thread-new):hover,
.conversation-rail-head > button:hover,
.conversation-item-action:hover {
  background: var(--p4-surface-2, rgba(90, 120, 100, .08));
}

#view-chat :is(.chat-thread-menu, .chat-thread-new) svg,
.conversation-rail svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.conversation-rail {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--p4-text-1, var(--ink));
  background: var(--p4-surface, #fff);
}

.conversation-rail-head {
  min-height: 48px;
  padding: 0 10px 0 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--p4-line, var(--line));
}

.conversation-rail-head > div {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.conversation-rail-head span { font-size: 14px; font-weight: 680; }
.conversation-rail-head small { color: var(--p4-text-3, var(--muted)); font-size: 10px; }

.conversation-tabs {
  margin: 9px 10px 7px;
  padding: 2px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  border-radius: 8px;
  background: var(--p4-surface-2, rgba(90, 120, 100, .08));
}

.conversation-tabs button {
  min-height: 29px;
  padding: 0 8px;
  color: var(--p4-text-3, var(--muted));
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  box-shadow: none;
}

.conversation-tabs button.is-active {
  color: var(--p4-text-1, var(--ink));
  background: var(--p4-surface, #fff);
  box-shadow: 0 1px 3px rgba(35, 48, 39, .08);
}

.conversation-search {
  min-height: 34px;
  margin: 0 10px 8px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--p4-line, var(--line));
  border-radius: 8px;
  background: var(--p4-canvas, #f5f7f4);
}

.conversation-search svg { width: 15px; height: 15px; color: var(--p4-text-3, var(--muted)); }
.conversation-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  color: var(--p4-text-1, var(--ink));
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
}

.conversation-list {
  min-height: 0;
  padding: 0 7px 9px;
  display: grid;
  align-content: start;
  gap: 2px;
  overflow-y: auto;
}

.conversation-item {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: center;
  border-radius: 8px;
}

.conversation-item.is-active { background: var(--p4-accent-soft, rgba(83, 132, 104, .12)); }
.conversation-select {
  min-width: 0;
  padding: 9px 4px 9px 9px;
  display: grid;
  gap: 4px;
  color: inherit;
  border: 0;
  background: transparent;
  text-align: left;
  box-shadow: none;
}

.conversation-select > span {
  min-width: 0;
  display: flex;
  gap: 7px;
  align-items: baseline;
  justify-content: space-between;
}

.conversation-select strong,
.conversation-select p {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-select strong { font-size: 12.5px; font-weight: 650; }
.conversation-select time { flex: 0 0 auto; color: var(--p4-text-3, var(--muted)); font-size: 9px; }
.conversation-select p { color: var(--p4-text-3, var(--muted)); font-size: 10.5px; line-height: 1.35; }
.conversation-select:disabled { opacity: 1; cursor: default; }
.conversation-item-action { width: 28px; height: 28px; color: var(--p4-text-3, var(--muted)); }
.conversation-item-action svg { width: 15px; height: 15px; }

.conversation-list-empty {
  padding: 28px 14px;
  display: grid;
  justify-items: center;
  gap: 5px;
  color: var(--p4-text-3, var(--muted));
  text-align: center;
}
.conversation-list-empty strong { color: var(--p4-text-2, var(--ink)); font-size: 12px; }
.conversation-list-empty small { font-size: 10px; }
.conversation-rail-close { display: none; }

#view-chat .chat-load-older {
  margin: 0 auto 4px;
  padding: 5px 10px;
  color: var(--p4-text-3, var(--muted));
  border: 0;
  background: transparent;
  font-size: 10.5px;
  font-weight: 600;
  box-shadow: none;
}

#view-chat .chat-waiting .bubble {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.chat-waiting-dots { display: inline-flex; gap: 3px; }
.chat-waiting-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--p4-accent, #56866d);
  animation: chat-waiting-dot 1.1s infinite ease-in-out;
}
.chat-waiting-dots i:nth-child(2) { animation-delay: .14s; }
.chat-waiting-dots i:nth-child(3) { animation-delay: .28s; }
@keyframes chat-waiting-dot { 0%, 70%, 100% { opacity: .28; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-2px); } }

#view-chat .chat-waiting small { color: var(--p4-text-3, var(--muted)); font-size: 10.5px; }
#view-chat .chat-stream-text {
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#view-chat .message.is-pending { opacity: .72; }

#view-chat .chat-failure {
  width: min(480px, calc(100% - 36px));
  margin: 0 auto;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  color: var(--p4-text-2, var(--ink));
  border: 1px solid color-mix(in srgb, #b67a1a 42%, var(--p4-line, var(--line)));
  border-radius: 9px;
  background: color-mix(in srgb, #fff5d8 68%, var(--p4-surface, #fff));
}

#view-chat .chat-failure > span {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: #91620d;
  border-radius: 50%;
  background: rgba(183, 126, 26, .14);
  font-size: 11px;
  font-weight: 800;
}
#view-chat .chat-failure div { min-width: 0; display: grid; gap: 2px; }
#view-chat .chat-failure strong { font-size: 11.5px; }
#view-chat .chat-failure small { color: var(--p4-text-3, var(--muted)); font-size: 9.5px; }
#view-chat .chat-failure button {
  min-height: 29px;
  padding: 0 10px;
  color: var(--p4-accent-ink, #285f42);
  border: 1px solid var(--p4-line-strong, var(--line));
  border-radius: 7px;
  background: var(--p4-surface, #fff);
  font-size: 10.5px;
  font-weight: 650;
  box-shadow: none;
}

#view-chat .chat-cancel {
  width: 44px;
  min-width: 44px;
  height: 40px;
  padding: 0;
  place-items: center;
  color: var(--p4-accent-ink, #285f42);
  border: 1px solid var(--p4-accent, #56866d);
  border-radius: 8px;
  background: var(--p4-accent-soft, rgba(83, 132, 104, .12));
  box-shadow: none;
}
#view-chat .chat-cancel:not([hidden]) { display: grid; }
#view-chat .chat-cancel span { width: 10px; height: 10px; border-radius: 2px; background: currentColor; }

@media (max-width: 820px) {
  body.conversation-drawer-open { overflow: hidden; }
  #view-chat .conversation-item { min-height: 58px; }
  #view-chat .conversation-select { padding-block: 10px; }
}
.message.user .bubble .chat-link { color: inherit; }
.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"] .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"] .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 {
  display: none;
}

[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 1px 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; }
  .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; }
  .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: none;
  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"] .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"] .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: 1px 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"] .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"] .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) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !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: var(--p4-ui, "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"] .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); }

[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: var(--p4-editorial, "Songti SC", STSong, 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"] .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"] .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: 1px 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-color: #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: 1px 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: 1px 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; }
.inbox-field-patch { min-width: 0; margin: 12px 0 2px; padding: 0; border: 0; }
.inbox-field-patch legend { margin-bottom: 4px; color: #505349; font-size: 10px; font-weight: 700; }
.inbox-field-patch label { min-height: 38px; padding: 6px 0; display: grid; grid-template-columns: 20px minmax(0,1fr); align-items: center; gap: 8px; border-top: 1px solid rgba(82,88,76,.14); cursor: pointer; }
.inbox-field-patch input { width: 16px; height: 16px; margin: 0; accent-color: var(--sea, #477c68); }
.inbox-field-patch label > span { min-width: 0; display: grid; grid-template-columns: 72px minmax(0,1fr); align-items: center; gap: 8px; }
.inbox-field-patch strong { color: #30342d; font-size: 11px; }
.inbox-field-patch small { min-width: 0; display: flex; align-items: center; gap: 7px; color: #70756a; font-size: 11px; line-height: 1.4; }
.inbox-field-patch del,
.inbox-field-patch ins { min-width: 0; overflow-wrap: anywhere; text-decoration: none; }
.inbox-field-patch del { color: #8a8179; }
.inbox-field-patch ins { color: #285e4b; font-weight: 700; }
.inbox-field-patch i { color: #94998e; font-style: normal; }
.inbox-field-patch-empty { margin: 10px 0 0; color: #8a8179; font-size: 11px; }
.inbox-append-target { max-width: 760px; margin-top: 12px; display: grid; gap: 5px; color: #505349; font-size: 10px; font-weight: 700; }
.inbox-append-target select { width: 100%; min-height: 40px; padding: 0 10px; color: #30342d; border: 1px solid rgba(82,88,76,.22); border-radius: 8px; background: rgba(255,255,255,.58); font: 500 12px/1.35 inherit; }
.inbox-append-target small { color: #81857a; font-size: 9px; font-weight: 500; line-height: 1.45; }
.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"] .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"] .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; }
  .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; }
  .inbox-field-patch legend,
  .inbox-field-patch strong,
  .inbox-field-patch small { font-size: 14px; }
  .inbox-field-patch label { min-height: 48px; grid-template-columns: 24px minmax(0,1fr); }
  .inbox-field-patch input { width: 20px; height: 20px; }
  .inbox-field-patch label > span { grid-template-columns: 78px minmax(0,1fr); }
  .inbox-append-target { font-size: 14px; }
  .inbox-append-target select { min-height: 44px; font-size: 16px; }
  .inbox-append-target small { font-size: 13px; }
  .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: 32px 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.is-task.is-done { align-items: center; }
.work-overview-row.is-navigation { cursor: pointer; }
.work-overview-row.is-navigation:focus-visible { outline: 2px solid #315d8d; outline-offset: -3px; }
.work-overview-row:hover { background: rgba(204,255,41,.12); }
.work-overview-control {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  border: 0;
  color: #171912;
  background: transparent;
}
label.work-overview-control { cursor: pointer; }
.work-overview-control input {
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  margin: 0;
  display: grid;
  place-items: center;
  appearance: none;
  border: 1.5px solid rgba(26,30,22,.58);
  border-radius: 999px;
  background: #fffdf6;
  cursor: pointer;
}
.work-overview-control input::before {
  color: #fffdf6;
  content: "✓";
  font: 900 16px/1 Arial,sans-serif;
  transform: scale(0);
}
.work-overview-control input:checked { border-color: #171912; background: #171912; }
.work-overview-control input:checked::before { transform: scale(1); }
.work-overview-control.is-marker::before {
  width: 10px;
  height: 10px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: #9aa095;
  content: "";
}
.work-overview-row.status-open .work-overview-control.is-marker::before { background: #719c46; }
.work-overview-row.status-pending_input .work-overview-control.is-marker::before { background: #d79d22; }
.work-overview-row.status-waiting_evidence .work-overview-control.is-marker::before,
.work-overview-row.status-waiting_reviewer .work-overview-control.is-marker::before { background: #4f8da4; }
.work-overview-row.status-blocked .work-overview-control.is-marker::before { background: #cf6b5d; }
.work-overview-row.status-closed .work-overview-control.is-marker::before { background: #5c8060; }
.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-row.is-navigation { cursor: pointer; }
.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: #30342d; background: #edf0e7; }
.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 { color: #696d65; text-decoration: none; }
.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; }

/* Automation is a small operational console: now first, controls second, history last. */
.automation-now {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
  padding: 22px 24px;
  border: 1px solid #d9d2bf;
  border-top: 1px solid #1f2420;
  border-radius: 16px 16px 16px 6px;
  background: linear-gradient(120deg, #fffdf7, #f5f9e8);
  box-shadow: 5px 5px 0 rgba(28,31,22,.08);
}
.automation-update-diagnostics {
  grid-column: 1 / -1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.automation-update-diagnostics > header,
.automation-update-diagnostics > footer {
  min-height: 52px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.automation-update-diagnostics > header > div { display: flex; align-items: center; gap: 10px; }
.automation-update-diagnostics h3 { margin: 0; font-size: 16px; }
.automation-update-diagnostics header small,
.automation-update-diagnostics header time,
.automation-update-diagnostics footer { color: var(--muted); font-size: 11px; }
.automation-update-diagnostics header small { display: block; margin-top: 2px; }
.automation-update-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-block: 1px solid var(--line); }
.automation-update-metrics article { min-width: 0; padding: 12px 16px; display: grid; grid-template-columns: 1fr auto; gap: 3px 7px; border-right: 1px solid var(--line); }
.automation-update-metrics article:last-child { border-right: 0; }
.automation-update-metrics span { grid-column: 1 / -1; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.automation-update-metrics strong { font-size: 20px; font-weight: 560; }
.automation-update-metrics small { align-self: end; color: var(--muted); font-size: 10px; }
.automation-update-metrics .has-attention strong { color: var(--warning); }
.automation-workflow-path { padding: 13px 16px 15px; border-bottom: 1px solid var(--line); }
.automation-workflow-path > header { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.automation-workflow-path > header strong { font-size: 12px; letter-spacing: .04em; }
.automation-workflow-path > header small { color: var(--muted); font-size: 10px; }
.automation-workflow-path ol { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.automation-workflow-path li { position: relative; min-width: 0; padding: 0 14px 0 24px; display: grid; gap: 3px; border-top: 1px solid var(--line-strong); }
.automation-workflow-path li::before { position: absolute; top: -4px; left: 0; width: 7px; height: 7px; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); content: ""; }
.automation-workflow-path li.is-complete::before { border-color: var(--accent); background: var(--accent); }
.automation-workflow-path li.has-attention::before,
.automation-workflow-path li.is-waiting::before { border-color: var(--warning); background: var(--warning); }
.automation-workflow-path li > span { margin-top: 8px; color: var(--muted); font: 700 9px/1.2 "SFMono-Regular",Consolas,monospace; }
.automation-workflow-path li > b { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.automation-workflow-path li > small { overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.automation-workflow-path li.is-waiting > small,
.automation-workflow-path li.has-attention > small { color: var(--warning); }
.automation-update-diagnostics > footer { min-height: 40px; }

@media (max-width: 820px) {
  .automation-update-diagnostics > header { align-items: flex-start; }
  .automation-update-diagnostics > header time { white-space: nowrap; }
  .automation-update-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .automation-update-metrics article { border-bottom: 1px solid var(--line); }
  .automation-update-metrics article:nth-child(2n) { border-right: 0; }
  .automation-update-metrics article:last-child { grid-column: 1 / -1; border-bottom: 0; }
  .automation-workflow-path > header { align-items: flex-start; flex-direction: column; gap: 3px; }
  .automation-workflow-path ol { grid-template-columns: 1fr; gap: 0; }
  .automation-workflow-path li { min-height: 48px; padding: 6px 0 8px 30px; border-top: 0; border-left: 1px solid var(--line-strong); }
  .automation-workflow-path li::before { top: 9px; left: -4px; }
  .automation-workflow-path li > span { position: absolute; top: 6px; left: 11px; margin: 0; }
  .automation-workflow-path li > small { white-space: normal; }
  .automation-update-diagnostics > footer { align-items: flex-start; flex-direction: column; gap: 4px; }
}
.automation-now-head { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.automation-now-head h3 { margin: 4px 0 6px; font-size: 28px; }
.automation-now-head p { margin: 0; color: var(--muted); line-height: 1.55; }
.automation-now-signal {
  width: 17px; height: 17px; flex: 0 0 auto; margin-top: 8px;
  border: 3px solid #f8f3e8; border-radius: 50%; box-shadow: 0 0 0 1px rgba(23,25,18,.18);
  background: #28be55;
}
.automation-now-signal.is-attention { background: #efae21; }
.automation-now-grid { display: grid; grid-template-columns: minmax(0,1.8fr) minmax(220px,1fr); gap: 14px; }
.automation-run.is-current { border-color: #c4dd68; background: rgba(255,255,255,.82); }
.automation-run-origin { padding: 3px 6px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 9px; font-weight: 650; letter-spacing: .02em; white-space: nowrap; }
.automation-run-origin.is-ai { border-color: rgba(53,126,88,.28); color: var(--accent); background: rgba(53,126,88,.07); }
.automation-run-origin.is-pending { border-color: rgba(166,119,13,.25); color: var(--warning); background: rgba(166,119,13,.06); }
.automation-run-origin.is-fallback { border-color: rgba(177,73,46,.24); color: var(--danger); background: rgba(177,73,46,.06); }
.automation-now-activity { display: grid; align-content: start; gap: 8px; padding: 16px; border: 1px solid #ded5c1; border-radius: 12px; background: rgba(255,253,247,.78); }
.automation-now-activity > p { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 7px; margin: 0; font-size: 13px; line-height: 1.4; }
.automation-now-activity time { grid-column: 2; color: var(--muted); font-size: 11px; }
.automation-new-actions { display: grid; gap: 6px; margin-top: 12px; padding: 11px 12px; border-left: 1px solid #d9ff35; background: #f7fbdc; font-size: 13px; line-height: 1.45; }
.automation-new-actions b { color: #496600; }
.automation-history-disclosure > summary { cursor: pointer; font-weight: 700; list-style-position: inside; }
.automation-history-disclosure > div { display: grid; gap: 12px; margin-top: 14px; }
.automation-rule.is-paused { opacity: .78; }
.automation-rule .primary-button:disabled { min-width: 138px; color: #6d675b; background: #efede5; border-color: #d8d0c0; box-shadow: none; cursor: not-allowed; }
/* 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-recovery { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.automation-rule-recovery i { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--line-strong); }
.automation-rule-recovery.is-healthy i,
.automation-rule-recovery.is-recovered i { background: var(--accent); }
.automation-rule-recovery.is-recovered { color: var(--accent); }
.automation-rule-recovery.is-running i { background: var(--warning); }
.automation-rule-recovery.has-risk { color: var(--danger); }
.automation-rule-recovery.has-risk i { background: var(--danger); }
.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: 1px 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); }

.p4-evening-brief {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--p4-line);
}
.p4-evening-brief[hidden] { display: none; }
.p4-evening-brief .p4-card-heading h4 {
  margin: 5px 0 0;
  color: var(--p4-ink);
  font: 540 17px/1.35 var(--p4-editorial);
}
.p4-evening-brief-content {
  margin-top: 14px;
  font-size: 13px;
}

.p4-brief-document.is-structured { white-space: normal; }
.p4-brief-structured {
  width: 100%;
  max-width: 1120px;
  display: grid;
  gap: 30px;
}
.p4-brief-dateline {
  margin: 0;
  color: var(--p4-text-3);
  font: 650 12px/1.4 monospace;
  letter-spacing: .06em;
}
.p4-brief-conclusion {
  padding: 22px 24px;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: start;
  gap: 20px;
  border: 1px solid var(--p4-line);
  border-radius: 12px;
  background: var(--p4-surface-2);
}
.p4-brief-conclusion > span {
  padding-top: 3px;
  color: var(--p4-accent-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
}
.p4-brief-conclusion > p {
  margin: 0;
  color: var(--p4-ink);
  font: 520 18px/1.7 var(--p4-editorial);
  overflow-wrap: anywhere;
}
.p4-brief-intro { display: grid; gap: 7px; }
.p4-brief-intro h4,
.p4-brief-intro p { margin: 0; }
.p4-brief-intro h4 { color: var(--p4-ink); font-size: 15px; line-height: 1.5; }
.p4-brief-intro p { color: var(--p4-text-2); font-size: 14px; line-height: 1.7; }
.p4-brief-intro p.is-bullet { padding-left: 15px; position: relative; }
.p4-brief-intro p.is-bullet::before {
  content: '';
  width: 4px;
  height: 4px;
  position: absolute;
  top: .72em;
  left: 1px;
  border-radius: 50%;
  background: var(--p4-text-3);
}
.p4-brief-section { display: grid; gap: 16px; }
.p4-brief-section + .p4-brief-section {
  padding-top: 26px;
  border-top: 1px solid var(--p4-line);
}
.p4-brief-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 12px;
}
.p4-brief-section-heading > h4 {
  margin: 0;
  color: var(--p4-ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
}
.p4-brief-section-heading > span {
  color: var(--p4-text-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.p4-brief-items { margin: 0; padding: 0; list-style: none; }
.p4-brief-item {
  padding: 18px 0;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 16px;
  border-top: 1px solid var(--p4-line);
}
.p4-brief-item:first-child { padding-top: 0; border-top: 0; }
.p4-brief-item:last-child { padding-bottom: 0; }
.p4-brief-item-marker {
  width: 5px;
  height: 28px;
  margin-top: 4px;
  border-radius: 99px;
  background: var(--p4-accent);
}
.p4-brief-item.is-risks .p4-brief-item-marker { background: var(--p4-warning); }
.p4-brief-item.is-carryover .p4-brief-item-marker,
.p4-brief-item.is-signals .p4-brief-item-marker { background: var(--p4-line-strong); }
.p4-brief-item.is-completed .p4-brief-item-marker { background: var(--p4-success); }
.p4-brief-item-content { min-width: 0; }
.p4-brief-update-list { display: grid; gap: 10px; }
.p4-brief-update {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: baseline;
  gap: 4px;
}
.p4-brief-update > p {
  margin: 0;
  color: var(--p4-ink);
  font-size: 16px;
  font-weight: 560;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.p4-brief-update > span {
  color: var(--p4-text-3);
  font-size: 11px;
  line-height: 1.5;
}
.p4-brief-item-context {
  margin-top: 9px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 10px;
}
.p4-brief-item-title {
  margin: 0;
  color: var(--p4-text-2);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.p4-brief-item-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.p4-brief-item-meta > span {
  padding: 2px 7px;
  color: var(--p4-text-3);
  border: 1px solid var(--p4-line);
  border-radius: 99px;
  background: var(--p4-surface);
  font-size: 10px;
  line-height: 1.4;
}
.p4-brief-item-body { display: grid; gap: 7px; }
.p4-brief-item-body > p {
  margin: 0;
  color: var(--p4-ink);
  font-size: 16px;
  font-weight: 520;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.p4-brief-item-source {
  margin-top: 11px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.p4-brief-item-source > span {
  flex: 0 0 auto;
  padding: 2px 6px;
  color: var(--p4-text-3);
  border: 1px solid var(--p4-line);
  border-radius: 99px;
  font-size: 10px;
  line-height: 1.4;
}
.p4-brief-item-source > p {
  margin: 1px 0 0;
  color: var(--p4-text-3);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.p4-brief-section.is-carryover,
.p4-brief-section.is-signals { color: var(--p4-text-2); }

@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-now { margin-bottom: 14px; padding: 17px; border-radius: 14px 14px 14px 6px; }
  .automation-now-head h3 { font-size: 23px; }
  .automation-now-head p { font-size: 13px; }
  .automation-now-grid { grid-template-columns: 1fr; gap: 11px; }
  .automation-now-activity { padding: 13px; }
  .automation-new-actions { font-size: 12px; }
  .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(720px,calc(100vw - 40px));
  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 { min-width: 0; padding: 20px 24px 16px; border-bottom: 1px solid #e8dfcf; }
.mail-reader-title h2 {
  max-width: 100%;
  margin: 0 0 10px;
  font: 700 clamp(21px,2.4vw,28px)/1.28 "STSong","SimSun",serif;
  letter-spacing: -.018em;
  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: 15px;
  line-height: 1.72;
  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; }
.mail-reader-actions .ghost-button:disabled {
  cursor: default;
  color: #56604d;
  border-color: #c9c3b5;
  background: #e8e3d8;
  opacity: 1;
}
body.mail-reader-open,
body.task-detail-open,
body.work-detail-open,
body.mail-results-open { overflow: hidden; }

.task-detail-shell { grid-template-rows: auto minmax(0,1fr); }
.task-edit-form {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0,1fr) auto;
  overflow: hidden;
}
.task-detail-title p { max-width: 60ch; }
.task-detail-title h2 { font-size: clamp(20px,2.2vw,26px); line-height: 1.32; }
.task-edit-grid {
  padding: 22px 26px 28px;
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  align-content: start;
  gap: 14px;
  overflow-y: auto;
}
.task-edit-grid label,
.task-edit-source {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid #e4ddcf;
  border-radius: 16px;
  background: #fffdf6;
}
.task-edit-grid label > span,
.task-edit-source > span {
  display: block;
  margin-bottom: 7px;
  color: #777970;
  font: 700 10px/1.2 Consolas,monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.task-edit-grid input,
.task-edit-grid textarea,
.task-edit-grid select {
  width: 100%;
  min-height: 44px;
  padding: 10px 11px;
  border: 1px solid #d7d1c4;
  background: #fff;
  color: #171912;
  font: 600 15px/1.5 "Noto Sans SC","Microsoft YaHei",sans-serif;
}
.task-edit-grid textarea { resize: vertical; }
.task-edit-wide { grid-column: 1 / -1; }
.task-edit-source strong {
  color: #171912;
  font-size: 15px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.task-detail-actions > div { display: flex; gap: 10px; }
.work-detail-advanced {
  grid-column: 1 / -1;
  border: 1px solid #e4ddcf;
  border-radius: 16px;
  background: #fffdf6;
}
.work-detail-advanced > summary {
  min-height: 48px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: #4b594b;
  font-weight: 700;
}
.work-detail-advanced-grid {
  padding: 0 16px 16px;
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 14px;
}
.work-detail-advanced-grid label { min-width: 0; }
.work-detail .task-detail-actions > div { display: grid; grid-template-columns: 1fr; }
.work-detail .task-detail-actions .primary-button { width: 100%; }

.mail-results { width: min(760px,calc(100vw - 32px)); }
.mail-results-shell { grid-template-rows: auto auto minmax(180px,1fr) auto; }
.mail-results-title { padding-bottom: 16px; }
.mail-results-list {
  padding: 8px 20px 24px;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow-y: auto;
}
.mail-result-row {
  width: 100%;
  min-width: 0;
  padding: 15px 16px;
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid #ddd6c8;
  border-radius: 14px;
  background: #fffdf7;
  color: #171912;
  text-align: left;
}
.mail-result-row:hover,
.mail-result-row:focus-visible {
  border-color: #171912;
  box-shadow: 4px 4px 0 rgba(23,25,18,.12);
  transform: translate(-1px,-1px);
}
.mail-result-kind {
  padding: 5px 8px;
  border: 1px solid #bdd7cc;
  background: #eaf7f1;
  font: 700 11px/1 Consolas,monospace;
}
.mail-result-row.is-draft .mail-result-kind {
  border-color: #e5c9bd;
  background: #fff0e9;
}
.mail-result-copy { min-width: 0; }
.mail-result-copy strong,
.mail-result-copy small { display: block; overflow-wrap: anywhere; }
.mail-result-copy strong { font-size: 15px; line-height: 1.45; }
.mail-result-copy small { margin-top: 5px; color: #6e7168; font-size: 12px; line-height: 1.45; }
.mail-result-row i { color: #4f5c50; font-style: normal; font-size: 12px; white-space: nowrap; }

@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: 18px 20px 15px; }
  .mail-reader-title h2 { max-width: none; font-size: 22px; line-height: 1.34; }
  .mail-reader-title p,
  .mail-reader-title time { font-size: 14px; }
  .mail-reader-body { padding: 18px 20px 30px; font-size: 15px; line-height: 1.74; }
  .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%; }
  .task-edit-grid {
    grid-template-columns: 1fr;
    padding: 16px 18px 24px;
  }
  .task-edit-wide { grid-column: auto; }
  .work-detail-advanced { grid-column: auto; }
  .work-detail-advanced-grid { grid-template-columns: 1fr; padding: 0 14px 14px; }
  .task-edit-grid label,
  .task-edit-source { padding: 13px 14px; }
  .task-detail-actions > div { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .task-detail-actions .primary-button,
  .task-detail-actions .ghost-button { width: 100%; }
  .mail-results-list { padding: 6px 14px 22px; }
  .mail-result-row { grid-template-columns: auto minmax(0,1fr); gap: 10px; padding: 14px; }
  .mail-result-row i { grid-column: 2; }

  #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; }
}


/* 0.12.18 — one signal language for James: chrome lights, work states and review queue. */
.work-overview-control { width: 28px; height: 28px; flex-basis: 28px; }
.work-overview-control input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  border: 1px solid #d59b26;
  background: #fff9e8;
  box-shadow: 0 0 0 3px rgba(254,188,46,.12), inset 0 1px 1px rgba(255,255,255,.7);
}
.work-overview-control input::before { color: #fff; font: 900 12px/1 Arial,sans-serif; }
.work-overview-control input:checked {
  border-color: #28a745;
  background: #28c840;
  box-shadow: 0 0 0 3px rgba(40,200,64,.12), inset 0 1px 1px rgba(255,255,255,.58);
}
.work-overview-control.is-marker::before {
  width: 14px;
  height: 14px;
  box-shadow: 0 0 0 3px rgba(23,25,18,.05), inset 0 1px 1px rgba(255,255,255,.58);
}
.work-overview-row.status-open .work-overview-control.is-marker::before { background: #28c840; }
.work-overview-row.status-pending_input .work-overview-control.is-marker::before { background: #febc2e; }
.work-overview-row.status-waiting_evidence .work-overview-control.is-marker::before,
.work-overview-row.status-waiting_reviewer .work-overview-control.is-marker::before { background: #64a9e0; }
.work-overview-row.status-blocked .work-overview-control.is-marker::before { background: #ff5f57; }
.work-overview-row.status-closed .work-overview-control.is-marker::before { background: #28c840; }
.work-overview-row.is-done { color: #667060; background: rgba(40,200,64,.035); }
.work-overview-row.is-done strong { color: #667060; text-decoration: none; }

[data-theme="control-room"] .global-inbox-card {
  border: 1px solid rgba(23,25,18,.15);
  border-radius: 18px 18px 18px 7px;
  background: rgba(255,253,246,.86);
  box-shadow: var(--soft-shadow);
}
.global-inbox-head {
  min-height: 86px;
  padding: 18px 22px;
  color: #171912;
  background: transparent;
}
.global-inbox-head h3 { font: 700 24px/1.08 "STSong","SimSun",serif; letter-spacing: 0; }
.global-inbox-head p { color: var(--muted); }
.global-inbox-counter {
  min-width: 82px;
  padding: 5px 0 5px 14px;
  grid-template-columns: 16px auto;
  column-gap: 9px;
  align-items: center;
  border-left: 1px solid rgba(23,25,18,.12);
}
.global-inbox-counter::before {
  width: 14px;
  height: 14px;
  display: block;
  grid-row: 1 / span 2;
  border: 1px solid #d59b26;
  border-radius: 50%;
  background: #febc2e;
  box-shadow: 0 0 0 3px rgba(254,188,46,.12), inset 0 1px 1px rgba(255,255,255,.58);
  content: "";
}
.global-inbox-counter strong { color: #171912; font: 800 26px/1 Georgia,serif; }
.global-inbox-counter span { margin: 0; color: #74776d; font: 700 8px/1 Consolas,monospace; letter-spacing: .12em; }
.global-inbox-flow { background: #f1eee5; }
.global-inbox-empty { min-height: 58px; padding: 13px 22px; }
.global-inbox-empty > span {
  width: 14px;
  height: 14px;
  border: 1px solid #28a745;
  border-radius: 50%;
  background: #28c840;
  box-shadow: 0 0 0 3px rgba(40,200,64,.12), inset 0 1px 1px rgba(255,255,255,.58);
}
.global-inbox-card.is-empty .global-inbox-head { min-height: 70px; padding-block: 14px; }
.global-inbox-card.is-empty .global-inbox-head h3 { font-size: 20px; }
.global-inbox-card.is-empty .global-inbox-empty { padding-block: 12px; }
.global-inbox-card.is-empty .global-inbox-empty strong::after { content: " · 当前没有需要处理的输入"; color: var(--muted); font-weight: 500; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6,minmax(0,1fr));
  gap: 7px;
  margin: 18px 0;
  padding: 11px;
  border: 1px solid rgba(23,25,18,.12);
  border-radius: 18px 18px 18px 7px;
  background: rgba(255,253,246,.72);
}
.metric-card {
  min-width: 0;
  min-height: 58px;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: 9px minmax(0,1fr) auto;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
}
.metric-card::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--card-color, #9aa095);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--card-color, #9aa095) 14%, transparent);
  content: "";
}
.metric-card::after { display: none; }
.metric-card span { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.metric-card strong { font: 700 22px/1 Georgia,serif; }
.metric-card.decision { --card-color: #febc2e; }
.metric-card.waiting { --card-color: #64a9e0; }
.metric-card.risk, .metric-card.overdue { --card-color: #ff5f57; }
.metric-card.input { --card-color: #febc2e; }
.metric-card.closed { --card-color: #28c840; }

.time-ledger-entry {
  min-height: 76px;
  margin: 28px 0 0;
  padding: 15px 20px;
  border-color: rgba(23,25,18,.14);
  border-radius: 18px 18px 18px 7px;
  background: rgba(255,253,246,.74);
  box-shadow: none;
}
.time-ledger-entry:hover { transform: none; box-shadow: var(--soft-shadow); }
.time-entry-balance { border-radius: 10px; background: rgba(40,200,64,.10); }
.time-entry-arrow { width: 28px; height: 28px; border-color: rgba(23,25,18,.14); color: #171912; }

@media (max-width: 820px), (max-width: 900px) and (max-height: 500px) {
  .metric-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; padding: 8px; overflow: visible; }
  .metric-card { min-width: 0; min-height: 50px; padding: 8px; }
  .metric-card span { font-size: 11px; }
  .metric-card strong { font-size: 20px; }
  .time-ledger-entry { min-height: 74px; margin-top: 20px; }
  .global-inbox-head { min-height: 72px; padding: 14px 16px; }
  .global-inbox-head h3 { font-size: 21px; }
  .global-inbox-card.is-empty .global-inbox-empty strong::after { display: none; }
}

.global-inbox-card.is-empty .global-inbox-counter::before { border-color: #28a745; background: #28c840; box-shadow: 0 0 0 3px rgba(40,200,64,.12), inset 0 1px 1px rgba(255,255,255,.58); }

/* 0.12.22 — keep the completed-task tick centered in its status circle. */
.work-overview-control input {
  position: relative;
}
.work-overview-control input::before {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  line-height: 1;
}

/* 0.12.23 — unified project-card projection. */
.work-card--unified .work-card-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.work-card--unified .work-card-summary span + span::before {
  content: '·';
  margin-right: 14px;
  color: var(--line-strong);
}
.work-card--unified .work-actions { grid-template-columns: auto; }
.task-activity-history {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.5);
}
.task-activity-history > span { color: var(--muted); font-size: 12px; }
.task-activity-history ul { margin: 7px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.6; }
@media (max-width: 680px) {
  .work-card--unified .work-card-summary { display: grid; gap: 2px; }
  .work-card--unified .work-card-summary span + span::before { content: ''; margin: 0; }
}


/* 0.12.24 — one project item language across homepage, project view and details. */
.work-overview-row.item-card { min-height: 92px; grid-template-columns: 34px minmax(0,1fr); gap: 13px; padding: 13px 20px; }
.work-overview-signal {
  width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 30px; position: relative;
  border: 1px solid color-mix(in srgb, var(--signal-color) 55%, #fffdf6); border-radius: 50%;
  background: color-mix(in srgb, var(--signal-color) 12%, #fffdf6);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--signal-color) 10%, transparent);
}
.work-overview-signal::before { width: 12px; height: 12px; border-radius: 50%; background: var(--signal-color); box-shadow: inset 0 1px 1px rgba(255,255,255,.55); content: ""; }
.work-overview-signal.is-complete::before { display: none; }
.work-overview-signal.is-complete::after { color: #fff; content: "✓"; font: 900 17px/1 Arial,sans-serif; }
.work-overview-signal.is-interactive { cursor: pointer; }
.work-overview-signal.is-interactive:hover { transform: scale(1.06); }
.work-overview-signal:focus-visible { outline: 2px solid #315d8d; outline-offset: 3px; }
.signal-green { --signal-color: #28b84b; }
.signal-yellow { --signal-color: #efae20; }
.signal-blue { --signal-color: #4f98c5; }
.signal-red { --signal-color: #e36055; }
.work-overview-main { min-height: 58px; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 18px; }
.work-overview-copy { display: grid; gap: 6px; }
.work-overview-context { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.work-item-type, .item-detail-status {
  padding: 4px 7px; border: 1px solid rgba(26,30,22,.14); border-radius: 999px;
  color: #5d6158; background: #f2efe6; font: 700 9px/1 Consolas,monospace; letter-spacing: .04em;
}
.work-overview-copy strong { font-size: 16px; line-height: 1.42; }
.work-overview-copy small { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 0; color: #73776d; font-size: 12px; line-height: 1.45; }
.work-overview-copy small span + span::before { margin-right: 10px; color: #b2afa6; content: "·"; }
.work-overview-tail { align-self: center; color: #62675e; font-size: 12px; white-space: nowrap; }
.item-detail-context { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 13px; }
.item-detail-status.signal-green { color: #216e34; border-color: rgba(40,184,75,.32); background: rgba(40,184,75,.10); }
.item-detail-status.signal-yellow { color: #815b00; border-color: rgba(239,174,32,.36); background: rgba(239,174,32,.12); }
.item-detail-status.signal-blue { color: #205f80; border-color: rgba(79,152,197,.35); background: rgba(79,152,197,.11); }
.item-detail-status.signal-red { color: #9d3028; border-color: rgba(227,96,85,.34); background: rgba(227,96,85,.10); }
@media (max-width: 680px) {
  .work-overview-row.item-card { min-height: 0; padding: 14px 16px; gap: 11px; }
  .work-overview-main { gap: 10px; }
  .work-overview-tail { align-self: start; padding-top: 3px; font-size: 11px; }
  .work-overview-copy strong { font-size: 15px; line-height: 1.42; }
  .work-overview-copy small { display: grid; gap: 2px; font-size: 11px; }
  .work-overview-copy small span + span::before { display: none; }
}

/* Unified status tones for project cards. */
.work-card.status-green { --status-color: #28b84b; }
.work-card.status-yellow { --status-color: #efae20; }
.work-card.status-blue { --status-color: #4f98c5; }
.work-card.status-red { --status-color: #e36055; }
.work-card.status-green::before { background: #28b84b; }
.work-card.status-yellow::before { background: #efae20; }
.work-card.status-blue::before { background: #4f98c5; }
.work-card.status-red::before { background: #e36055; }
.work-status.status-green { color: #216e34; background: rgba(40,184,75,.10); border-color: rgba(40,184,75,.30); }
.work-status.status-yellow { color: #815b00; background: rgba(239,174,32,.12); border-color: rgba(239,174,32,.34); }
.work-status.status-blue { color: #205f80; background: rgba(79,152,197,.11); border-color: rgba(79,152,197,.32); }
.work-status.status-red { color: #9d3028; background: rgba(227,96,85,.10); border-color: rgba(227,96,85,.32); }

/* P4 — append-only daily item updates. */
.projects-record-update { display: block; max-width: 62ch; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.projects-record-update b { color: var(--ink); font-weight: 600; }
.work-current-overview { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.56); }
.work-current-overview.is-attention { border-left: 1px solid #d09a24; }
.work-current-overview > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.work-current-overview h3 { margin: 2px 0 0; font-size: 16px; line-height: 1.3; }
.work-current-latest { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; color: var(--muted); font-size: 12px; }
.work-current-latest > span:not(.work-current-latest-empty) { padding: 2px 6px; border: 1px solid var(--line); border-radius: 999px; }
.work-current-latest-kind { color: var(--ink); font-weight: 650; }
.work-current-overview-grid { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--line); }
.work-current-overview-grid > div { min-width: 0; padding: 10px 12px; background: var(--surface, #fff); }
.work-current-overview-grid dt { margin: 0 0 4px; color: var(--muted); font-size: 11px; font-weight: 600; }
.work-current-overview-grid dd { margin: 0; overflow-wrap: anywhere; color: var(--ink); font-size: 14px; line-height: 1.45; }
.work-current-overview-grid .work-current-next { grid-column: 1 / -1; }
.work-current-status { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }
.work-current-status::before { width: 7px; height: 7px; display: block; border-radius: 50%; background: currentColor; content: ""; }
.work-current-status.status-green { color: #216e34; }
.work-current-status.status-yellow { color: #815b00; }
.work-current-status.status-blue { color: #205f80; }
.work-current-status.status-red { color: #9d3028; }
.work-current-fields { border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.42); }
.work-current-fields > summary,
.item-update-composer > summary { min-height: 48px; padding: 8px 13px; display: grid; grid-template-columns: auto minmax(0, 1fr) 18px; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.work-current-fields > summary::-webkit-details-marker,
.item-update-composer > summary::-webkit-details-marker { display: none; }
.work-current-fields > summary::after,
.item-update-composer > summary::after { color: var(--muted); content: "+"; font-size: 18px; font-weight: 400; text-align: center; }
.work-current-fields[open] > summary::after,
.item-update-composer[open] > summary::after { content: "−"; }
.work-current-fields > summary > span,
.item-update-composer > summary > span { color: var(--ink); font-size: 14px; font-weight: 650; }
.work-current-fields > summary > small,
.item-update-composer > summary > small { overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.work-current-fields-grid { padding: 4px 13px 13px; display: grid; gap: 12px; }
.work-current-fields-grid > label { min-width: 0; display: grid; gap: 7px; }
.item-update-composer,
.item-update-timeline { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.42); }
.item-update-composer { display: block; padding: 0; }
.item-update-composer-body { padding: 4px 13px 13px; display: grid; gap: 10px; }
.item-update-composer-body > header,
.item-update-timeline > header,
.item-update-composer footer,
.item-update-entry footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.item-update-composer h3,
.item-update-timeline h3 { margin: 2px 0 0; font-size: 16px; line-height: 1.3; }
.item-update-composer-body header small,
.item-update-timeline header small,
.item-update-entry footer small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.item-update-kind-buttons { display: flex; flex-wrap: wrap; gap: 7px; }
.item-update-kind-buttons button { min-height: 32px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: transparent; cursor: pointer; font: 600 12px/1 inherit; }
.item-update-kind-buttons button.is-active { border-color: var(--ink); color: var(--ink); background: rgba(0,0,0,.045); }
.item-update-composer textarea { width: 100%; box-sizing: border-box; resize: vertical; }
.item-update-compose-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.item-update-composer input.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.item-update-compose-tools > small { min-width: 10rem; flex: 1 1 auto; color: var(--muted); font-size: 11px; line-height: 1.35; }
.item-update-tool-button { min-height: 36px; padding: 5px 9px; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); border: 1px solid var(--line); border-radius: 9px; background: transparent; font: 600 12px/1 inherit; }
.item-update-tool-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.item-update-tool-button:hover,
.item-update-tool-button.is-listening { color: var(--ink); border-color: var(--ink); background: rgba(0,0,0,.04); }
.item-update-tool-button.is-listening svg { color: var(--sea, #3f7e67); }
.item-update-attachment-preview { display: flex; gap: 8px; overflow-x: auto; padding: 2px 1px; }
.item-update-attachment-preview[hidden] { display: none; }
.item-update-attachment-preview figure { position: relative; width: 64px; min-width: 64px; margin: 0; }
.item-update-attachment-preview img { width: 64px; height: 64px; display: block; object-fit: cover; border: 1px solid var(--line); border-radius: 9px; background: var(--surface, #fff); }
.item-update-attachment-preview button { position: absolute; top: -7px; right: -7px; width: 30px; height: 30px; padding: 0; display: grid; place-items: center; color: #fff; border: 2px solid var(--surface, #fff); border-radius: 50%; background: rgba(25,35,36,.82); font-size: 16px; line-height: 1; }
.item-update-composer footer select { min-width: 0; max-width: 28rem; height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface, #fff); }
.item-update-entry { padding: 12px 0; border-top: 1px solid var(--line); }
.item-update-entry:first-child { border-top: 0; padding-top: 0; }
.item-update-entry-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.item-update-entry-meta strong { color: var(--ink); font-size: 13px; }
.item-update-entry-meta span { padding: 2px 6px; border: 1px solid var(--line); border-radius: 999px; }
.item-update-entry-meta time { margin-left: auto; }
.item-update-entry p { margin: 7px 0; color: var(--ink); font-size: 14px; line-height: 1.55; white-space: pre-wrap; }
.item-update-entry-attachments { margin: 8px 0 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.item-update-entry-attachments a { width: 92px; height: 70px; display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--surface, #fff); }
.item-update-entry-attachments img { width: 100%; height: 100%; display: block; object-fit: cover; }
.item-update-source-link { min-height: 30px; padding: 4px 8px; font-size: 12px; }
.item-update-empty,
.item-update-loading { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
@media (max-width: 680px) {
  .work-current-overview > header,
  .item-update-composer-body > header,
  .item-update-timeline > header,
  .item-update-composer footer,
  .item-update-entry footer { align-items: stretch; flex-direction: column; }
  .item-update-composer footer select { max-width: none; width: 100%; }
  .item-update-entry-meta time { margin-left: 0; }
  .projects-record-update { max-width: 100%; }
  .item-update-tool-button { min-height: 44px; padding-inline: 12px; }
  .item-update-attachment-preview button { width: 44px; height: 44px; top: -10px; right: -10px; }
  .item-update-entry-attachments a { width: 84px; height: 64px; }
  .work-current-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-current-latest { justify-content: flex-start; }
  .work-current-fields > summary,
  .item-update-composer > summary { min-height: 44px; }
}

.mobile-update-capture-entry,
.mobile-update-capture-sheet,
.mobile-update-capture-backdrop { display: none; }
@media (max-width: 820px) {
  body.mobile-update-capture-open { overflow: hidden !important; }
  .mobile-update-capture-entry {
    width: fit-content;
    min-height: 44px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--p4-text-2);
    border: 1px solid var(--p4-line);
    border-radius: 10px;
    background: var(--p4-surface);
    box-shadow: none;
    font-size: 12px;
  }
  .mobile-update-capture-entry > span { color: var(--p4-accent-ink); font-size: 18px; font-weight: 500; line-height: 1; }
  .mobile-update-capture-entry > b { font-weight: 650; }
  .mobile-update-capture-backdrop {
    position: fixed;
    z-index: 105;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
    background: rgba(16,24,19,.34);
    backdrop-filter: blur(2px);
  }
  .mobile-update-capture-sheet {
    position: fixed;
    z-index: 110;
    inset: auto 0 0;
    width: 100%;
    max-height: 88dvh;
    padding: 18px 18px calc(20px + env(safe-area-inset-bottom));
    display: block;
    color: var(--p4-ink);
    overflow-y: auto;
    border-radius: 20px 20px 0 0;
    background: var(--p4-surface);
    box-shadow: 0 -20px 60px rgba(20,35,25,.22);
  }
  .mobile-update-capture-sheet[hidden],
  .mobile-update-capture-backdrop[hidden] { display: none; }
  .mobile-update-capture-sheet > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
  .mobile-update-capture-sheet > header h2 { margin: 5px 0 0; font: 540 25px/1.2 var(--p4-editorial); }
  .mobile-update-capture-sheet > header button { width: 44px; height: 44px; flex: 0 0 44px; color: var(--p4-text-2); border: 1px solid var(--p4-line); border-radius: 10px; background: transparent; font-size: 21px; }
  .mobile-update-capture-sheet > p { margin: 10px 0 16px; color: var(--p4-text-2); font-size: 12px; line-height: 1.6; }
  #mobile-update-capture-form { display: grid; gap: 12px; }
  #mobile-update-capture-form textarea { width: 100%; min-height: 112px; box-sizing: border-box; resize: vertical; font-size: 16px; }
  #mobile-update-capture-form .item-update-kind-buttons button,
  #mobile-update-capture-form .item-update-tool-button { min-height: 44px; }
  #mobile-update-capture-form .item-update-compose-tools > small { min-width: 0; flex-basis: 100%; font-size: 11px; }
  #mobile-update-capture-form footer { padding-top: 2px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  #mobile-update-capture-form footer small { color: var(--p4-text-3); font-size: 10px; line-height: 1.4; }
  #mobile-update-capture-form footer button { min-height: 46px; padding-inline: 16px; flex: 0 0 auto; }
}

/* P4 responsive framework */
.p4-mobile-tabbar { display: none; }
@media (max-width: 820px) {
  html,
  body[data-theme] {
    min-width: 0;
    color: var(--p4-ink);
    background: var(--p4-bg);
    font-family: var(--p4-ui);
    font-size: 14px;
    line-height: 1.58;
  }
  body[data-theme] .summer-scene { display: none; }
  body[data-theme] .app-shell {
    min-height: 100vh;
    display: block;
  }
  body[data-theme] .sidebar {
    position: fixed;
    z-index: 80;
    inset: 0 auto 0 0;
    width: min(86vw, 320px);
    height: 100dvh;
    padding: 0;
    color: var(--p4-ink);
    overflow: visible;
    border: 0;
    border-right: 1px solid var(--p4-line);
    border-radius: 0;
    background: var(--p4-rail);
    box-shadow: 22px 0 60px rgba(21, 35, 25, .18);
    transform: translateX(-105%);
    transition: transform .22s ease;
  }
  body[data-theme] .sidebar.is-mobile-open { transform: translateX(0); }
  .p4-shell-nav { height: 100%; display: flex; flex-direction: column; }
  body[data-theme] .p4-brand {
    width: auto;
    height: 76px;
    margin: 0;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    color: var(--p4-ink);
    border-bottom: 1px solid var(--p4-line);
  }
  body[data-theme] .p4-brand > .p4-brand-mark {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
  }
  body[data-theme] .p4-brand > span:not(.p4-brand-mark) { display: grid; gap: 1px; }
  .p4-brand strong { font-size: 12px; letter-spacing: .15em; }
  .p4-brand small { color: var(--p4-text-3); font: 650 8px/1.2 monospace; letter-spacing: .08em; }
  .p4-brand-mark { position: relative; place-items: center; }
  .p4-brand-mark i { position: absolute; width: 17px; height: 17px; border: 1px solid var(--p4-line-strong); border-radius: 5px; }
  .p4-brand-mark i:first-child { top: 0; left: 0; background: var(--p4-accent); border-color: var(--p4-accent); }
  .p4-brand-mark i:nth-child(2) { right: 0; bottom: 0; }
  .p4-brand-mark i:nth-child(3) { right: 0; top: 0; opacity: .5; }
  .p4-brand-mark b { position: relative; z-index: 2; font: 500 21px/1 var(--p4-editorial); }
  body[data-theme] .p4-brand .mobile-menu-close {
    right: 14px;
    width: 34px;
    height: 34px;
    color: var(--p4-text-2);
    border: 1px solid var(--p4-line);
    border-radius: 9px;
    background: var(--p4-surface);
  }
  .p4-nav-scroll { flex: 1; min-height: 0; padding: 22px 14px; overflow-y: auto; }
  .p4-nav-label { display: block; margin: 0 10px 9px; color: var(--p4-text-3); font: 700 9px/1 monospace; letter-spacing: .15em; }
  .p4-nav-label:not(:first-child) { margin-top: 26px; }
  .p4-nav-list { display: grid; gap: 3px; }
  body[data-theme] .p4-nav-item,
  body[data-theme] .p4-more-menu .nav-item {
    position: relative;
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    color: var(--p4-text-2);
    text-align: left;
    border: 0;
    border-radius: 10px;
    background: transparent;
  }
  body[data-theme] .p4-nav-item.is-active { color: var(--p4-ink); background: var(--p4-surface); }
  body[data-theme] .p4-nav-item .nav-icon { width: 26px; height: 26px; display: grid; place-items: center; }
  body[data-theme] .p4-nav-item b { display: block; color: inherit; font-size: 13px; font-weight: 650; }
  .p4-nav-count { min-width: 22px; padding: 2px 6px; color: var(--p4-accent-ink); text-align: center; border-radius: 99px; background: var(--p4-accent-soft); font-size: 10px; }
  .p4-more { margin-top: 20px; padding-top: 8px; border-top: 1px solid var(--p4-line); }
  .p4-more > summary { min-height: 42px; padding: 0 12px; display: flex; align-items: center; gap: 13px; color: var(--p4-text-2); list-style: none; }
  .p4-more-menu { display: grid; }
  .p4-nav-footer { padding: 12px 14px 20px; border-top: 1px solid var(--p4-line); }
  .p4-appearance-entry,
  .p4-logout { width: 100%; min-height: 40px; padding: 0 12px; display: flex; align-items: center; gap: 11px; color: var(--p4-text-2); border: 0; border-radius: 10px; background: transparent; }
  .p4-private { margin-top: 9px; padding: 10px 12px 0; display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--p4-line); }
  .p4-private i { width: 7px; height: 7px; border-radius: 50%; background: var(--p4-success); }
  .p4-private span { display: grid; }
  .p4-private b { font-size: 10px; }
  .p4-private small { color: var(--p4-text-3); font-size: 9px; }
  body[data-theme] .mobile-nav-backdrop {
    position: fixed;
    z-index: 70;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(18, 27, 21, .28);
    backdrop-filter: blur(2px);
  }
  body[data-theme] .workspace {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0 0 78px;
    background: var(--p4-bg);
  }
  body[data-theme] .workspace-header {
    position: sticky;
    z-index: 40;
    top: 0;
    width: 100%;
    height: 62px;
    border-bottom: 1px solid var(--p4-line);
    background: color-mix(in srgb, var(--p4-bg) 92%, transparent);
    backdrop-filter: blur(16px);
  }
  body[data-theme] .app-chrome {
    height: 62px;
    padding: 0 14px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    border: 0;
    background: transparent;
  }
  body[data-theme] .chrome-signals { display: none; }
  body[data-theme] .chrome-brand { grid-column: 2; justify-self: start; color: var(--p4-ink); }
  body[data-theme] .chrome-brand strong { display: flex; align-items: center; gap: 6px; font: 550 15px/1 var(--p4-editorial); }
  body[data-theme] .chrome-brand strong > small { color: var(--p4-text-3); font: 700 7px/1 monospace; letter-spacing: .1em; }
  .p4-top-logo-mark { position: relative; width: 24px; height: 24px; display: grid; place-items: center; }
  .p4-top-logo-mark i { position: absolute; width: 11px; height: 11px; border: 1px solid var(--p4-line-strong); border-radius: 3px; }
  .p4-top-logo-mark i:first-child { top: 0; left: 0; background: var(--p4-accent); border-color: var(--p4-accent); }
  .p4-top-logo-mark i:nth-child(2) { right: 0; bottom: 0; }
  .p4-top-logo-mark b { position: relative; z-index: 2; font-size: 12px; }
  body[data-theme] .today-top-actions {
    grid-column: 3;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  body[data-theme] .today-model-picker {
    min-height: 30px;
    padding: 0 6px;
    border: 1px solid var(--p4-line);
    border-radius: 8px;
    background: var(--p4-surface);
  }
  body[data-theme] .today-model-picker > span { display: none; }
  body[data-theme] .today-model-picker select { max-width: 88px; border: 0; background: transparent; font-size: 10px; }
  body[data-theme] .today-focus-toggle,
  body[data-theme] .today-top-divider,
  body[data-theme] .chrome-review,
  body[data-theme] .today-account-entry { display: none; }
  .p4-theme-button { width: 30px; height: 30px; color: var(--p4-text-2); border: 1px solid var(--p4-line); border-radius: 8px; background: var(--p4-surface); }
  body[data-theme] .topbar { display: none; }
  body[data-theme] .view {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 24px 16px 40px;
  }
  body.today-pilot-active[data-theme] #view-dashboard { display: block; padding: 20px 16px 36px; }
  body.today-pilot-active[data-theme] #view-dashboard > :not(.p4-today) { display: none !important; }
  .p4-page-hero,
  .p4-view-hero {
    margin-bottom: 22px;
    display: grid;
    gap: 17px;
  }
  .p4-page-hero h2,
  .p4-view-hero h2 { margin: 8px 0 7px; color: var(--p4-ink); font: 480 38px/1.12 var(--p4-editorial); letter-spacing: -.03em; }
  .p4-view-hero h2 { font-size: 34px; }
  .p4-page-hero p,
  .p4-view-hero p { margin: 0; color: var(--p4-text-2); font-size: 13px; }
  .p4-kicker { color: var(--p4-text-3); font: 700 8px/1.3 monospace; letter-spacing: .14em; }
  .p4-today-grid,
  .p4-brief-layout { display: grid; grid-template-columns: 1fr; gap: 14px; }
  .p4-today-primary,
  .p4-today-secondary,
  .p4-brief-sidebar { display: grid; gap: 14px; }
  .p4-card { color: var(--p4-ink); border: 1px solid var(--p4-line); border-radius: 15px; background: var(--p4-surface); box-shadow: 0 12px 30px rgba(28, 44, 33, .05); }
  .p4-brief-card,
  .p4-priority,
  .p4-project-pulse,
  .p4-schedule-card,
  .p4-agent-summary,
  .p4-project-map,
  .p4-full-brief,
  .p4-brief-sidebar .p4-card { min-height: 0; padding: 20px; }
  .p4-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
  .p4-card-heading h3,
  .p4-section-heading h3,
  .p4-policy-card h3 { margin: 5px 0 0; color: var(--p4-ink); font: 540 21px/1.2 var(--p4-editorial); }
  .p4-freshness { display: inline-flex; align-items: center; gap: 6px; color: var(--p4-text-3); font-size: 9px; white-space: nowrap; }
  .p4-freshness i { width: 6px; height: 6px; border-radius: 50%; background: var(--p4-success); }
  .p4-brief-copy { margin: 23px 0 18px; color: var(--p4-text-2); font-size: 14px; line-height: 1.7; }
  .p4-source-row { display: flex; flex-wrap: wrap; gap: 6px; }
  .p4-source-chip { padding: 5px 8px; display: inline-flex; align-items: center; gap: 5px; color: var(--p4-text-2); border: 1px solid var(--p4-line); border-radius: 99px; background: var(--p4-surface-2); font-size: 9px; }
  .p4-source-chip i { width: 5px; height: 5px; border-radius: 50%; background: var(--p4-success); }
  .p4-card-actions,
  .p4-view-actions { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
  .p4-primary,
  .p4-secondary { min-height: 38px; padding: 0 14px; border-radius: 9px; font-size: 11px; }
  .p4-primary { color: var(--p4-accent-ink); border: 1px solid var(--p4-accent); background: var(--p4-accent); }
  .p4-secondary { color: var(--p4-text-2); border: 1px solid var(--p4-line); background: transparent; }
  .p4-priority { border-left: 1px solid var(--p4-accent); }
  .p4-priority-state,
  .p4-agent-policy { padding: 5px 8px; color: var(--p4-accent-ink); border-radius: 99px; background: var(--p4-accent-soft); font-size: 9px; }
  .p4-priority-content { margin-top: 20px; }
  .p4-priority-content h4 { margin: 7px 0; font: 520 23px/1.3 var(--p4-editorial); }
  .p4-priority-content p { color: var(--p4-text-2); }
  .p4-priority-meta { margin-bottom: 16px; display: grid; gap: 3px; color: var(--p4-text-3); font-size: 10px; }
  .p4-section-heading { margin: 8px 2px 12px; display: flex; align-items: flex-end; justify-content: space-between; }
  .p4-text-link { color: var(--p4-text-2); border: 0; background: transparent; font-size: 10px; }
  .p4-run-grid { display: grid; gap: 8px; }
  .p4-run-result { min-height: 70px; padding: 13px 14px; display: grid; grid-template-columns: 28px minmax(0,1fr); align-items: center; gap: 8px; border: 1px solid var(--p4-line); border-radius: 11px; background: var(--p4-surface); }
  .p4-run-result div { min-width: 0; display: grid; gap: 3px; }
  .p4-run-result b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
  .p4-run-result small { color: var(--p4-text-3); font-size: 9px; }
  .p4-project-mini,
  .p4-schedule-item { width: 100%; padding: 13px 0; color: var(--p4-ink); text-align: left; border: 0; border-bottom: 1px solid var(--p4-line); background: transparent; }
  .p4-project-mini { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; }
  .p4-project-mini span,
  .p4-schedule-item div { display: grid; gap: 3px; }
  .p4-project-mini small,
  .p4-schedule-item small { color: var(--p4-text-3); font-size: 9px; }
  .p4-project-mini > strong { align-self: center; color: var(--p4-text-2); font-size: 9px; }
  .p4-project-mini > strong.is-risk { color: var(--p4-warning); }
  .p4-project-mini > .p4-project-pulse-note { grid-column: 1 / -1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .p4-project-mini > i { height: 3px; grid-column: 1/-1; overflow: hidden; background: var(--p4-line); }
  .p4-project-mini > i em { display: block; height: 100%; background: var(--p4-accent); }
  .p4-schedule-item { display: grid; grid-template-columns: 74px 1fr; gap: 10px; }
  #p4-agent-summary { margin-top: 10px; display: grid; }
  #p4-agent-summary > div { padding: 9px 0; display: flex; justify-content: space-between; border-bottom: 1px solid var(--p4-line); }
  #p4-agent-summary span { color: var(--p4-text-2); font-size: 10px; }
  #p4-agent-summary b { font-size: 9px; }
  .p4-empty { margin: 0; padding: 16px; color: var(--p4-text-3); border: 1px dashed var(--p4-line-strong); border-radius: 10px; }
  .p4-brief-document { margin-top: 24px; color: var(--p4-text-2); font-size: 14px; line-height: 1.8; white-space: pre-wrap; }
  .p4-brief-structured { max-width: none; gap: 22px; }
  .p4-brief-conclusion { padding: 16px 17px; grid-template-columns: 1fr; gap: 6px; }
  .p4-brief-conclusion > p { font-size: 15px; line-height: 1.65; }
  .p4-brief-item { padding: 16px 0; grid-template-columns: 7px minmax(0, 1fr); gap: 11px; }
  .p4-brief-item-marker { width: 4px; height: 24px; }
  .p4-brief-update { grid-template-columns: 1fr; gap: 4px; }
  .p4-brief-update > p,
  .p4-brief-item-body > p { font-size: 15px; line-height: 1.65; }
  .p4-brief-update > span { white-space: normal; }
  .p4-brief-item-title { font-size: 12px; line-height: 1.5; }
  .p4-brief-item-source { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px; }
  .p4-brief-item-source > p { font-size: 12px; }
  .p4-source-ledger article { padding: 12px 0; display: grid; grid-template-columns: 8px 1fr; gap: 3px 8px; border-bottom: 1px solid var(--p4-line); }
  .p4-source-ledger article > i { width: 6px; height: 6px; margin-top: 5px; border-radius: 50%; background: var(--p4-success); }
  .p4-source-ledger div { display: grid; }
  .p4-source-ledger small,
  .p4-source-ledger time { color: var(--p4-text-3); font-size: 9px; }
  .p4-source-ledger time { grid-column: 2; }
  .p4-project-summary { margin-bottom: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .p4-project-summary article { min-height: 82px; padding: 14px; display: flex; align-items: flex-end; justify-content: space-between; border: 1px solid var(--p4-line); border-radius: 13px; background: var(--p4-surface); }
  .p4-project-summary strong { font: 500 32px/1 var(--p4-editorial); }
  .p4-project-summary span { color: var(--p4-text-3); font-size: 9px; }
  .p4-project-row { width: 100%; padding: 16px 0; display: grid; grid-template-columns: 34px minmax(0,1fr) 20px; gap: 10px; color: var(--p4-ink); text-align: left; border: 0; border-bottom: 1px solid var(--p4-line); background: transparent; }
  .p4-project-name { display: grid; gap: 4px; }
  .p4-project-name b { font: 520 17px/1.2 var(--p4-editorial); }
  .p4-project-name small { color: var(--p4-text-3); font-size: 9px; }
  .p4-project-health,
  .p4-project-progress { grid-column: 2; }
  .p4-project-health { color: var(--p4-text-2); font-size: 9px; }
  .p4-project-progress { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 7px; }
  .p4-project-progress > i { height: 3px; overflow: hidden; background: var(--p4-line); }
  .p4-project-progress em { display: block; height: 100%; background: var(--p4-accent); }
  .p4-agent-hero { padding: 22px; color: #edf3ee; border-radius: 15px; background: #17201a; }
  .p4-agent-hero h2,
  .p4-agent-hero p { color: inherit; }
  .p4-agent-hero p { color: #b9c5bc; }
  .p4-lifecycle { margin-bottom: 14px; padding: 14px; display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; border: 1px solid var(--p4-line); border-radius: 13px; background: var(--p4-surface); }
  .p4-lifecycle span { display: flex; align-items: center; gap: 6px; }
  .p4-lifecycle span i { width: 23px; height: 23px; display: grid; place-items:center; border:1px solid var(--p4-line); border-radius:50%; font-size:7px; }
  .p4-lifecycle b { font-size: 9px; }
  .p4-lifecycle > em { display: none; }
  .p4-capability-grid { display: grid; gap: 10px; }
  .p4-capability-card { min-height: 0; padding: 19px; display: grid; grid-template-columns: 1fr auto; color: var(--p4-ink); border:1px solid var(--p4-line); border-radius:14px; background:var(--p4-surface); }
  .p4-capability-card h3 { grid-column:1/-1; margin:18px 0 7px; font:530 19px/1.2 var(--p4-editorial); }
  .p4-capability-card p { grid-column:1/-1; margin:0; color:var(--p4-text-2); font-size:11px; }
  .p4-capability-card footer { margin-top:18px; padding-top:12px; grid-column:1/-1; display:flex; justify-content:space-between; border-top:1px solid var(--p4-line); }
  .p4-capability-card footer button { color:var(--p4-text-2); border:0; background:transparent; font-size:10px; }
  .p4-policy-card { margin-top:14px; padding:20px; }
  .p4-policy-list { margin-top:15px; display:flex; flex-wrap:wrap; gap:6px; }
  .p4-policy-list span { padding:6px 8px; color:var(--p4-text-2); border:1px solid var(--p4-line); border-radius:99px; background:var(--p4-surface-2); font-size:9px; }
  .p4-mobile-tabbar {
    position: fixed;
    z-index: 60;
    right: 9px;
    bottom: max(9px, env(safe-area-inset-bottom));
    left: 9px;
    height: 60px;
    padding: 5px;
    display: grid;
    grid-template-columns: repeat(5,1fr);
    gap: 2px;
    border: 1px solid var(--p4-line);
    border-radius: 17px;
    background: color-mix(in srgb, var(--p4-surface) 94%, transparent);
    box-shadow: 0 14px 35px rgba(22,35,26,.14);
    backdrop-filter: blur(18px);
  }
  .p4-mobile-tabbar button {
    min-width: 0;
    padding: 5px 2px;
    display: grid;
    place-items: center;
    gap: 2px;
    color: var(--p4-text-3);
    border: 0;
    border-radius: 12px;
    background: transparent;
  }
  .p4-mobile-tabbar button.is-active { color: var(--p4-ink); background: var(--p4-accent-soft); }
  .p4-mobile-tabbar span { font-size: 15px; line-height: 1; }
  .p4-mobile-tabbar b { font-size: 9px; font-weight: 650; }
  .p4-appearance-panel {
    position: fixed;
    z-index: 100;
    inset: auto 0 0;
    width: 100%;
    max-height: 86dvh;
    padding: 22px 20px calc(24px + env(safe-area-inset-bottom));
    color: var(--p4-ink);
    overflow-y: auto;
    border-radius: 20px 20px 0 0;
    background: var(--p4-surface);
    box-shadow: 0 -20px 60px rgba(20,35,25,.2);
  }
  .p4-appearance-panel[hidden],
  .p4-panel-backdrop[hidden] { display:none; }
  .p4-appearance-panel header { display:flex; justify-content:space-between; }
  .p4-appearance-panel h2 { margin:5px 0 0; font:520 26px/1.2 var(--p4-editorial); }
  .p4-appearance-panel header button { width:34px;height:34px;color:var(--p4-text-2);border:1px solid var(--p4-line);border-radius:9px;background:transparent; }
  .p4-appearance-panel > p { color:var(--p4-text-2);font-size:10px; }
  .p4-appearance-panel > section { margin-top:22px; }
  .p4-setting-label { margin-bottom:10px;display:grid; }
  .p4-setting-label small { color:var(--p4-text-3);font-size:9px; }
  .p4-theme-choices { display:grid;gap:6px; }
  .p4-theme-choices button { min-height:54px;padding:8px 10px;display:grid;grid-template-columns:34px 1fr;align-items:center;gap:10px;color:var(--p4-ink);text-align:left;border:1px solid var(--p4-line);border-radius:11px;background:var(--p4-surface-2); }
  .p4-theme-choices button.is-selected { border-color:var(--p4-accent); }
  .p4-theme-choices i { width:34px;height:34px;border-radius:8px;background:linear-gradient(135deg,#e7ebe7 50%,#f8faf7 50%); }
  .p4-theme-choices span { display:grid; }
  .p4-theme-choices small { color:var(--p4-text-3);font-size:9px; }
  .p4-density-choices { padding:3px;display:grid;grid-template-columns:1fr 1fr;gap:3px;border:1px solid var(--p4-line);border-radius:9px;background:var(--p4-surface-2); }
  .p4-density-choices button { min-height:34px;color:var(--p4-text-2);border:0;border-radius:7px;background:transparent; }
  .p4-density-choices button.is-selected { color:var(--p4-ink);background:var(--p4-surface); }
  .p4-accessibility-settings label { padding:12px 0;display:flex;justify-content:space-between;border-bottom:1px solid var(--p4-line); }
  .p4-accessibility-settings label span { display:grid; }
  .p4-accessibility-settings small { color:var(--p4-text-3);font-size:9px; }
  .p4-panel-backdrop { position:fixed;z-index:90;inset:0;border:0;background:rgba(16,24,19,.28); }
  .p4-work-capture,
  .p4-confirmation-inbox {
    margin: 12px 0 16px;
    overflow: hidden;
    border: 1px solid var(--p4-line);
    border-radius: 14px;
    background: var(--p4-surface);
    box-shadow: none;
  }
  .p4-work-capture > summary { min-height: 48px; padding: 0 15px; display:flex;align-items:center;color:var(--p4-text-2); }
  .p4-work-capture .work-capture-body { padding:15px;border-top:1px solid var(--p4-line); }
  body.p4-reduce-motion *,
  body.p4-reduce-motion *::before,
  body.p4-reduce-motion *::after { animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important; }
}

@media (max-width: 820px) {
  body.p4-framework[data-theme] .resource-drawer {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    color: var(--p4-ink);
    border: 0;
    background: var(--p4-surface);
  }
  .resource-drawer-shell { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
  .resource-drawer-head { padding: 20px; display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--p4-line); }
  .resource-drawer-head h2 { margin: 6px 0; font: 520 26px/1.2 var(--p4-editorial); }
  .resource-drawer-head p { margin: 0; color: var(--p4-text-2); font-size: 12px; }
  .resource-drawer-close { width: 40px; height: 40px; border: 1px solid var(--p4-line); border-radius: 50%; background: transparent; }
  .resource-toolbar { padding: 12px 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border-bottom: 1px solid var(--p4-line); }
  .resource-toolbar label:first-child { grid-column: 1 / -1; }
  .resource-toolbar input,
  .resource-toolbar select,
  .resource-add-panel input { width: 100%; min-height: 42px; padding: 0 10px; color: var(--p4-ink); border: 1px solid var(--p4-line); border-radius: 9px; background: var(--p4-surface-2); }
  .resource-toolbar button { min-height: 42px; color: var(--p4-text-2); border: 1px solid var(--p4-line); border-radius: 9px; background: var(--p4-surface); }
  .resource-list { min-height: 0; padding: 0 20px; flex: 1; overflow: auto; }
  .resource-row { padding: 14px 0; display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 12px; border-bottom: 1px solid var(--p4-line); }
  .resource-preview { width: 54px; height: 54px; display: grid; place-items: center; color: var(--p4-text-3); border: 1px solid var(--p4-line); border-radius: 8px; overflow: hidden; }
  .resource-preview svg { width: 24px; fill: none; stroke: currentColor; }
  .resource-preview img { width: 100%; height: 100%; object-fit: cover; }
  .resource-copy { min-width: 0; display: grid; gap: 4px; }
  .resource-copy > div { display: flex; gap: 7px; color: var(--p4-text-3); font-size: 11px; }
  .resource-copy strong { font-size: 14px; }
  .resource-url { margin: 0; color: var(--p4-text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
  .resource-row-actions { grid-column: 2; display: flex; gap: 7px; }
  .resource-row-actions button,
  .resource-open { min-height: 34px; padding: 0 11px; display: inline-flex; align-items: center; color: var(--p4-text-2); border: 1px solid var(--p4-line); border-radius: 8px; background: transparent; font-size: 11px; }
  .resource-list-footer { padding: 12px 20px; display: flex; justify-content: space-between; color: var(--p4-text-3); border-top: 1px solid var(--p4-line); font-size: 11px; }
  .resource-add-panel { margin: 0 20px 12px; border: 1px solid var(--p4-line); border-radius: 10px; }
  .resource-add-panel > summary { min-height: 44px; padding: 0 12px; display: flex; align-items: center; list-style: none; }
  .resource-add-panel form { padding: 12px; display: grid; gap: 10px; border-top: 1px solid var(--p4-line); }
  .resource-add-panel label { display: grid; gap: 5px; font-size: 12px; }
  .resource-add-panel p { margin: 0; color: var(--p4-text-3); font-size: 10px; }
  .resource-project-work { min-height: 42px; margin: 0 20px 20px; color: var(--p4-text-2); border: 1px solid var(--p4-line); border-radius: 9px; background: transparent; }
  .resource-empty { padding: 28px 12px; color: var(--p4-text-2); text-align: center; }
  .meeting-hero-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .resource-context-button,
  .finite-list-more { min-height: 40px; color: var(--p4-text-2); border: 1px solid var(--p4-line); border-radius: 9px; background: var(--p4-surface); }
  .finite-list-more { width: 100%; margin-top: 10px; }
}

/* P4 confirmed blueprint: mobile composition for the rewritten Today surface. */
@media (max-width: 820px) {
  body.p4-framework[data-theme] .app-chrome {
    min-height: 56px;
    padding: 0 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
  }

  body.p4-framework[data-theme] .chrome-brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 7px;
  }

  body.p4-framework[data-theme] .chrome-brand > svg {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.4;
  }

  body.p4-framework[data-theme] .chrome-brand .brand-signal {
    fill: var(--p4-accent);
    stroke: var(--p4-accent);
  }

  body.p4-framework[data-theme] .chrome-brand strong {
    overflow: hidden;
    color: var(--p4-ink);
    font-size: 12px;
    font-weight: 760;
    letter-spacing: .14em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.p4-framework[data-theme] .p4-theme-button {
    width: 32px;
    min-width: 32px;
    height: 32px;
    padding: 0;
    display: grid;
    place-items: center;
  }

  body.p4-framework[data-theme] .p4-theme-button svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
  }

  body.p4-framework[data-theme] .p4-theme-button span {
    display: none;
  }

  body.p4-framework.today-pilot-active[data-theme] #view-dashboard {
    padding: 20px 16px 94px !important;
  }

  body.p4-framework[data-theme] .p4-page-hero {
    margin: 0 0 14px;
    gap: 14px;
  }

  body.p4-framework[data-theme] .p4-page-hero h2 {
    max-width: 340px;
    margin: 5px 0 8px;
    font-family: var(--p4-ui);
    font-size: clamp(29px, 8.3vw, 34px);
    font-weight: 680;
    line-height: 1.16;
    letter-spacing: -.035em;
  }

  body.p4-framework[data-theme] .p4-page-hero p {
    max-width: 350px;
    font-size: 12px;
    line-height: 1.65;
  }

  body.p4-framework[data-theme] .p4-command {
    width: 100%;
    height: 48px;
    min-height: 48px;
    margin: 0;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 9px;
    overflow: hidden;
    border: 1px solid var(--p4-line);
    border-radius: 12px;
    background: var(--p4-surface);
  }

  body.p4-framework[data-theme] .p4-command > svg {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    fill: none;
    stroke: var(--p4-text-3);
    stroke-width: 1.6;
  }

  body.p4-framework[data-theme] .p4-command input {
    min-width: 0;
    height: 100%;
    flex: 1;
    color: var(--p4-ink);
    border: 0;
    outline: 0;
    background: transparent;
    font: 500 12px/1.4 var(--p4-ui);
  }

  body.p4-framework[data-theme] .p4-command input::placeholder {
    color: var(--p4-text-3);
    opacity: 1;
  }

  body.p4-framework[data-theme] .p4-command > span,
  body.p4-framework[data-theme] .p4-command kbd {
    display: none;
  }

  body.p4-framework[data-theme] .p4-confirmed-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  body.p4-framework[data-theme] .p4-confirmed-grid > * {
    min-width: 0;
    min-height: 0;
    grid-column: auto;
    grid-row: auto;
  }

  body.p4-framework[data-theme] .p4-confirmed-grid .p4-card {
    min-height: 0;
    padding: 17px;
    border-radius: 14px;
  }

  body.p4-framework[data-theme] .p4-brief-card {
    display: block;
  }

  body.p4-framework[data-theme] .p4-brief-copy {
    max-width: none;
    margin: 20px 0 10px;
    font-size: 22px;
    line-height: 1.3;
  }

  body.p4-framework[data-theme] .p4-brief-note {
    margin: 0;
    font-size: 12px;
    line-height: 1.65;
  }

  body.p4-framework[data-theme] .p4-card-actions {
    margin-top: 16px;
  }

  body.p4-framework[data-theme] .p4-source-row {
    margin-top: 17px;
    padding: 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid var(--p4-line);
  }

  body.p4-framework[data-theme] .p4-source-orbit {
    width: auto;
    height: 32px;
    min-height: 32px;
    padding: 0 11px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--p4-text-2);
    border: 1px solid var(--p4-line);
    border-radius: 999px;
    background: var(--p4-surface-2);
  }

  body.p4-framework[data-theme] .p4-source-orbit strong,
  body.p4-framework[data-theme] .p4-source-orbit span {
    position: static;
    font: 650 10px/1 var(--p4-ui);
  }

  body.p4-framework[data-theme] .p4-source-orbit span::before {
    content: "·";
    margin-right: 6px;
    color: var(--p4-text-3);
  }

  body.p4-framework[data-theme] .p4-source-orbit i {
    display: none;
  }

  body.p4-framework[data-theme] .p4-source-row > small {
    font-size: 9px;
    white-space: nowrap;
  }

  body.p4-framework[data-theme] .p4-priority-content {
    margin-top: 18px;
  }

  body.p4-framework[data-theme] .p4-priority-content h4 {
    font-size: 21px;
    line-height: 1.3;
  }

  body.p4-framework[data-theme] .p4-priority-content p {
    font-size: 11px;
    line-height: 1.6;
  }

  body.p4-framework[data-theme] .p4-priority-content footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  body.p4-framework[data-theme] .p4-priority-content footer:has(> :only-child) {
    grid-template-columns: 1fr;
  }

  body.p4-framework[data-theme] .p4-run-section {
    display: block;
  }

  body.p4-framework[data-theme] .p4-run-title {
    margin-bottom: 14px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
  }

  body.p4-framework[data-theme] .p4-run-title span {
    font-size: 9px;
    text-align: right;
  }

  body.p4-framework[data-theme] .p4-run-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  body.p4-framework[data-theme] .p4-run-result {
    min-height: 67px;
    padding: 11px;
    grid-template-columns: 28px minmax(0, 1fr);
  }

  body.p4-framework[data-theme] .p4-run-result > span {
    font-size: 20px;
  }

  body.p4-framework[data-theme] .p4-activity-list {
    margin-top: 10px;
  }

  body.p4-framework[data-theme] .p4-activity-item {
    grid-template-columns: 8px minmax(0, 1fr);
  }

  body.p4-framework[data-theme] .p4-activity-item time {
    grid-column: 2;
    justify-self: start;
  }

  body.p4-framework[data-theme] .p4-project-pulse,
  body.p4-framework[data-theme] .p4-schedule-card,
  body.p4-framework[data-theme] .p4-activity-card {
    display: block;
  }

  body.p4-framework[data-theme] .p4-agent-summary {
    display: block;
  }

  body.p4-framework[data-theme] #p4-agent-summary {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 12px;
  }

  body.p4-framework[data-theme] #p4-agent-summary > div {
    min-width: 0;
    padding: 9px 0;
  }

  body.p4-framework[data-theme] #p4-agent-summary span,
  body.p4-framework[data-theme] #p4-agent-summary b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.p4-framework[data-theme] .p4-agent-entry {
    width: 100%;
    min-height: 38px;
    margin-top: 12px;
  }

  body.p4-framework[data-theme] .p4-project-mini > progress,
  body.p4-framework[data-theme] .p4-project-progress > progress {
    width: 100%;
    height: 3px;
    grid-column: 1 / -1;
    appearance: none;
    border: 0;
    border-radius: 99px;
    background: var(--p4-line);
  }

  body.p4-framework[data-theme] progress::-webkit-progress-bar {
    background: var(--p4-line);
  }

  body.p4-framework[data-theme] progress::-webkit-progress-value {
    background: var(--p4-accent);
  }

  body.p4-framework[data-theme] progress::-moz-progress-bar {
    background: var(--p4-accent);
  }

  body.p4-framework[data-theme] .p4-mobile-more {
    display: block;
  }

  body.p4-framework[data-theme] .p4-profile {
    width: 100%;
    min-height: 52px;
    padding: 7px 10px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    color: var(--p4-ink);
    text-align: left;
    border: 1px solid var(--p4-line);
    border-radius: 11px;
    background: var(--p4-surface);
  }

  body.p4-framework[data-theme] .p4-profile-avatar {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--p4-accent);
  }

  body.p4-framework[data-theme] .p4-profile > span:last-child {
    min-width: 0;
    display: grid;
    gap: 2px;
  }

  body.p4-framework[data-theme] .p4-profile b {
    font-size: 11px;
  }

  body.p4-framework[data-theme] .p4-profile small {
    color: var(--p4-text-3);
    font-size: 9px;
  }

  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-empty-state {
    margin: 12px 0 0;
    padding: 20px;
    border: 1px solid var(--p4-line);
    border-radius: 14px;
    background: var(--p4-surface);
  }

  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-empty-state h3 {
    margin: 12px 0 8px;
    font: 560 24px/1.25 var(--p4-editorial);
  }

  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-empty-state > p {
    margin: 0;
    color: var(--p4-text-2);
    font-size: 12px;
    line-height: 1.7;
  }

  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-empty-state ul {
    margin: 20px 0;
    padding: 0;
    display: grid;
    gap: 10px;
    list-style: none;
  }

  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-empty-state li {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--p4-text-2);
    font-size: 11px;
  }

  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-empty-state li i {
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    border-radius: 50%;
    background: var(--p4-accent);
  }
}

/* Phase 1 mobile parity: no nested work-list scrolling */
@media (max-width: 820px) {
  body.p4-framework.projects-pilot-active[data-theme] .projects-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  body.p4-framework.projects-pilot-active[data-theme] .projects-toolbar :is(
    .projects-filter,
    .projects-search,
    .projects-sort,
    .projects-create-button
  ) {
    width: 100%;
    min-height: 44px;
    margin: 0;
    border-radius: 10px;
    font-size: 14px;
  }

  body.p4-framework.projects-pilot-active[data-theme] .projects-create-button {
    padding: 0 14px;
    color: var(--p4-accent-ink);
    border: 1px solid color-mix(in srgb, var(--p4-accent) 55%, var(--p4-line-strong));
    background: var(--p4-accent-soft);
    box-shadow: none;
    font-weight: 650;
    text-align: left;
  }

  body.p4-framework.projects-pilot-active[data-theme] .projects-pilot-layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  body.p4-framework.projects-pilot-active[data-theme] .work-list-panel {
    order: 1;
  }

  body.p4-framework.projects-pilot-active[data-theme] .projects-health-panel {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    order: 2;
    padding: 16px;
    color: var(--p4-text);
    border: 1px solid var(--p4-line);
    border-radius: 12px;
    background: var(--p4-surface);
  }

  body.p4-framework.projects-pilot-active[data-theme] .projects-health-heading,
  body.p4-framework.projects-pilot-active[data-theme] .projects-health-heading > div,
  body.p4-framework.projects-pilot-active[data-theme] .projects-health-row > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  body.p4-framework.projects-pilot-active[data-theme] .projects-health-heading h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 650;
  }

  body.p4-framework.projects-pilot-active[data-theme] .projects-health-heading button,
  body.p4-framework.projects-pilot-active[data-theme] .projects-health-reminder button {
    padding: 0;
    color: var(--p4-accent-ink);
    border: 0;
    background: transparent;
    font-size: 12px;
    font-weight: 650;
  }

  body.p4-framework.projects-pilot-active[data-theme] #work-health {
    margin-top: 12px;
    display: grid;
    gap: 12px;
  }

  body.p4-framework.projects-pilot-active[data-theme] :is(
    .projects-health-overall,
    .projects-health-row,
    .projects-health-reminder
  ) {
    padding: 12px;
    display: grid;
    gap: 7px;
    border: 1px solid var(--p4-line);
    border-radius: 10px;
    background: var(--p4-surface-2);
  }

  body.p4-framework.projects-pilot-active[data-theme] .projects-health-overall > strong {
    font-family: var(--p4-editorial);
    font-size: 28px;
    font-weight: 450;
  }

  body.p4-framework.projects-pilot-active[data-theme] :is(
    .projects-health-overall,
    .projects-health-row
  ) progress {
    width: 100%;
    height: 5px;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    accent-color: var(--p4-accent-contrast);
  }

  body.p4-framework.projects-pilot-active[data-theme] .projects-health-list {
    display: grid;
    gap: 8px;
  }

  body.p4-framework.projects-pilot-active[data-theme] .projects-health-row strong {
    font-size: 13px;
  }

  body.p4-framework.projects-pilot-active[data-theme] :is(
    .projects-health-overall small,
    .projects-health-row small,
    .projects-health-reminder p
  ) {
    margin: 0;
    color: var(--p4-text-3);
    font-size: 11.5px;
    line-height: 1.45;
  }

  body.p4-framework.projects-pilot-active[data-theme] .projects-health-reminder {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }

  body.p4-framework.projects-pilot-active[data-theme] .projects-health-reminder button {
    grid-column: 2;
    justify-self: start;
  }

  body.p4-framework[data-theme] .projects-sort {
    min-height: 40px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--p4-text-2);
    border: 1px solid var(--p4-line);
    border-radius: 9px;
    background: var(--p4-surface);
  }

  body.p4-framework[data-theme] .projects-sort select {
    width: 100%;
    color: var(--p4-text);
    border: 0;
    background: transparent;
  }

  body.p4-framework[data-theme] .work-list-panel {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  body.p4-framework[data-theme] #work-list {
    max-height: none;
    overflow: visible;
  }

  body.p4-framework[data-theme] .work-list-footer {
    padding: 10px 12px;
    display: grid;
    gap: 8px;
    color: var(--p4-text-3);
    border-top: 1px solid var(--p4-line);
    background: var(--p4-surface-2);
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-workspace {
    display: block;
    padding: 0 0 86px;
  }

  body.p4-framework.item-detail-open[data-theme] .item-detail-page,
  body.p4-framework.item-detail-open[data-theme] .task-detail-shell {
    width: 100%;
    max-width: none;
    color: var(--p4-text);
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  body.p4-framework.item-detail-open[data-theme] .task-detail-shell > .mail-reader-head {
    padding: 10px 2px;
    display: flex;
    justify-content: space-between;
    border: 0;
    background: transparent;
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-back {
    padding: 0;
    color: var(--p4-text-2);
    border: 0;
    background: transparent;
    font-weight: 650;
  }

  body.p4-framework.item-detail-open[data-theme] .task-detail-title,
  body.p4-framework.item-detail-open[data-theme] .work-detail-grid,
  body.p4-framework.item-detail-open[data-theme] .work-resource-summary {
    padding: 16px;
    border: 1px solid var(--p4-line);
    border-radius: 12px;
    background: var(--p4-surface);
  }

  body.p4-framework.item-detail-open[data-theme] .task-detail-title h2 {
    margin: 10px 0 6px;
    color: var(--p4-text);
    font: 520 30px/1.14 var(--p4-editorial);
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-summary {
    position: sticky;
    top: 60px;
    z-index: 8;
    margin: 10px 0;
    padding: 9px 10px;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    border: 1px solid var(--p4-line);
    border-radius: 10px;
    background: var(--p4-surface);
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-summary > span {
    min-width: 116px;
    display: grid;
    gap: 2px;
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-summary small,
  body.p4-framework.item-detail-open[data-theme] .work-resource-preview-list small {
    color: var(--p4-text-3);
    font-size: 11px;
  }

  body.p4-framework.item-detail-open[data-theme] .work-resource-preview-list {
    margin-top: 12px;
    display: grid;
    gap: 8px;
  }

  body.p4-framework.item-detail-open[data-theme] .work-resource-preview-list a {
    padding: 10px;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 9px;
    color: var(--p4-text);
    border: 1px solid var(--p4-line);
    border-radius: 9px;
  }

  body.p4-framework.item-detail-open[data-theme] .task-detail-actions {
    position: sticky;
    bottom: calc(64px + env(safe-area-inset-bottom));
    z-index: 10;
    margin-top: 10px;
    border: 1px solid var(--p4-line);
    border-radius: 10px;
    background: var(--p4-surface);
  }

  body.p4-framework.resource-workspace-open[data-theme] .resource-workspace {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: block;
    overflow-y: auto;
    color: var(--p4-text);
    background: var(--p4-canvas);
  }

  body.p4-framework.resource-workspace-open[data-theme] .resource-page {
    width: 100%;
    max-width: none;
    padding: 18px 13px 90px;
    background: transparent;
    box-shadow: none;
  }

  body.p4-framework[data-theme] .integration-card-body {
    margin-top: 12px;
    display: grid;
    gap: 12px;
  }

  body.p4-framework.automation-reference-active[data-theme] .automation-reference-brief-copy p {
    font-size: 15px;
    line-height: 1.55;
  }

  body.p4-framework.item-detail-open[data-theme] .task-edit-grid :is(input, textarea, select) {
    font-size: 16px;
    line-height: 1.5;
  }

  body.p4-framework.mail-reader-open[data-theme] #mail-reader-body {
    font-size: 16px;
    line-height: 1.7;
  }
}

/* Chat image attachments stay compact and subordinate to the conversation. */
#view-chat .chat-image-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--p4-text-2, var(--muted));
  border: 1px solid var(--p4-line, var(--line));
  border-radius: 10px;
  background: var(--p4-surface-2, rgba(255,255,255,.82));
}

#view-chat .chat-image-button:hover {
  color: var(--p4-text, var(--navy));
  border-color: var(--p4-accent, var(--sea));
}

#view-chat .chat-image-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#view-chat .chat-attachment-preview {
  grid-column: 1 / -1;
  min-width: 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 1px 4px;
}

#view-chat .chat-attachment-preview[hidden] { display: none; }

#view-chat .chat-attachment-item {
  position: relative;
  width: 72px;
  min-width: 72px;
  margin: 0;
}

#view-chat .chat-attachment-item img {
  width: 64px;
  height: 64px;
  display: block;
  object-fit: cover;
  border: 1px solid var(--p4-line, var(--line));
  border-radius: 9px;
  background: var(--p4-surface-2, #fff);
}

#view-chat .chat-attachment-item figcaption {
  width: 64px;
  margin-top: 4px;
  overflow: hidden;
  color: var(--p4-text-2, var(--muted));
  font-size: 10px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#view-chat .chat-attachment-item button {
  position: absolute;
  top: -5px;
  right: 2px;
  width: 22px;
  height: 22px;
  padding: 0;
  display: grid;
  place-items: center;
  color: #fff;
  border: 2px solid var(--p4-surface, #fff);
  border-radius: 50%;
  background: rgba(25, 35, 36, .82);
  font-size: 15px;
  line-height: 1;
}

#view-chat .message-attachments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 6px;
  white-space: normal;
}

#view-chat .message-attachments + .message-text { margin-top: 8px; }

#view-chat .message-attachments a {
  display: block;
  overflow: hidden;
  border-radius: 8px;
}

#view-chat .message-attachments img {
  width: 100%;
  max-width: 220px;
  max-height: 260px;
  display: block;
  object-fit: cover;
  background: var(--p4-surface-2, #fff);
}

@media (max-width: 820px) {
  body.p4-framework[data-theme] #view-chat .chat-attachment-preview {
    padding-inline: 2px;
  }

  body.p4-framework[data-theme] #view-chat .chat-attachment-item {
    width: 64px;
    min-width: 64px;
  }

  body.p4-framework[data-theme] #view-chat .chat-attachment-item img,
  body.p4-framework[data-theme] #view-chat .chat-attachment-item figcaption {
    width: 56px;
  }

  body.p4-framework[data-theme] #view-chat .chat-attachment-item img { height: 56px; }
  body.p4-framework[data-theme] #view-chat .message-attachments img { max-width: 170px; max-height: 220px; }
  body.p4-framework[data-theme] #view-chat .composer-tools { gap: 6px; }
  body.p4-framework[data-theme] #view-chat .send-button { min-width: 58px; padding-inline: 10px; }
}

.projects-toolbar :is(.projects-filter, .projects-search, .projects-sort, .projects-create-button) > span svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.composer-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

#view-chat .composer-tools .voice-toggle {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--p4-line, var(--line));
  border-radius: 10px;
  background: var(--p4-surface-2, rgba(255,255,255,.82));
}

#view-chat .composer-tools .voice-orb {
  width: 30px;
  height: 30px;
}

.chat-settings-card .chat-settings-panel {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.chat-settings-card .chat-settings-panel > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--p4-text-2, var(--muted));
  font-size: 13px;
}

/* P4 mobile UI reconciliation — shared Studio controls, icons and scroll model. */
@media (max-width: 820px) {
  body.p4-framework[data-theme] .p4-brand-mark svg,
  body.p4-framework[data-theme] .p4-nav-item .nav-icon svg,
  body.p4-framework[data-theme] .p4-appearance-entry .nav-icon svg,
  body.p4-framework[data-theme] .p4-more-icon svg,
  body.p4-framework[data-theme] .projects-toolbar svg,
  body.p4-framework[data-theme] .p4-mobile-tabbar svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  body.p4-framework[data-theme] .p4-brand-mark svg {
    width: 26px;
    height: 26px;
  }

  body.p4-framework[data-theme] .p4-brand-mark .brand-signal,
  body.p4-framework[data-theme] .p4-mobile-tabbar svg circle {
    fill: currentColor;
  }

  body.p4-framework[data-theme] .p4-brand-mark rect {
    fill: currentColor;
    stroke: none;
  }

  body.p4-framework[data-theme] .p4-brand .mobile-menu-close {
    position: static;
    width: 44px;
    min-width: 44px;
    height: 44px;
    margin-left: auto;
    display: grid !important;
    place-items: center;
    font-size: 22px;
  }

  body.p4-framework[data-theme] .p4-more > summary,
  body.p4-framework[data-theme] .p4-appearance-entry,
  body.p4-framework[data-theme] .p4-logout {
    min-height: 44px;
  }

  body.p4-framework[data-theme] .p4-mobile-tabbar {
    height: 66px;
    padding: 5px;
  }

  body.p4-framework[data-theme] .p4-mobile-tabbar button {
    min-height: 54px;
    touch-action: manipulation;
  }

  body.p4-framework[data-theme] .p4-mobile-tabbar span {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    color: inherit;
  }

  body.p4-framework[data-theme] .p4-mobile-tabbar b {
    font-size: 11px;
    font-weight: 650;
  }

  body.p4-framework[data-theme] .workspace {
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-toolbar :is(
    .projects-filter,
    .projects-search,
    .projects-sort
  ) {
    min-height: 46px;
    padding: 0 12px;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    color: var(--p4-text-2);
    border: 1px solid var(--p4-line);
    border-radius: 10px;
    background: var(--p4-surface);
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-toolbar :is(
    .projects-filter,
    .projects-search,
    .projects-sort
  ) > span {
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-toolbar :is(input, select) {
    width: 100%;
    height: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    color: var(--p4-text);
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 14px;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-create-button {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 9px;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-create-button span {
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
  }

  body.p4-framework.projects-pilot-active[data-theme] #work-create-panel:not([open]) {
    display: none !important;
  }

  body.task-detail-open,
  body.work-detail-open,
  body.p4-framework.item-detail-open[data-theme] {
    overflow-y: auto !important;
  }

  body.p4-framework.item-detail-open[data-theme] .item-detail-page,
  body.p4-framework.item-detail-open[data-theme] .task-detail-shell,
  body.p4-framework.item-detail-open[data-theme] .task-edit-form,
  body.p4-framework.item-detail-open[data-theme] .task-edit-grid,
  body.p4-framework.item-detail-open[data-theme] .work-detail-grid {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  body.p4-framework.item-detail-open[data-theme] .task-detail-shell,
  body.p4-framework.item-detail-open[data-theme] .task-edit-form {
    display: block;
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  body.p4-framework.item-detail-open[data-theme] .work-current-fields-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-grid > label,
  body.p4-framework.item-detail-open[data-theme] .work-current-fields-grid > label,
  body.p4-framework.item-detail-open[data-theme] .task-edit-source {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  body.p4-framework.item-detail-open[data-theme] .task-detail-title h2 {
    font-family: var(--p4-ui);
    font-size: 27px;
    font-weight: 650;
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-summary > span {
    min-width: 0;
  }

  body.p4-framework.item-detail-open[data-theme] :is(
    .item-update-kind-buttons button,
    .item-update-source-link,
    .work-current-fields > summary,
    .item-update-composer > summary,
    .work-detail-extras > summary
  ) {
    min-height: 44px;
  }

  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-hero-summary {
    color: var(--p4-text-2);
    font-size: 14px;
    line-height: 1.65;
  }

  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-hero-project > span {
    width: 8px;
    height: 8px;
    display: inline-block;
    overflow: hidden;
    color: transparent;
    border-radius: 50%;
    background: var(--p4-accent);
  }

  body.p4-framework.meetings-reference-active[data-theme] #view-meetings :is(
    .resource-context-button,
    .meeting-action-confirm,
    .meeting-linked,
    .meeting-action-row > details > summary,
    .meeting-action-filters button
  ) {
    min-height: 44px;
  }

  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-action-confirm {
    padding: 0 12px;
  }

  body.p4-framework.connections-reference-active[data-theme] #view-integrations .push-preferences {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body.p4-framework.connections-reference-active[data-theme] #view-integrations .push-preferences label {
    min-width: 0;
    min-height: 48px;
    padding: 9px 11px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--p4-line);
    border-radius: 10px;
    background: var(--p4-surface-2);
    font-size: 12px;
    line-height: 1.35;
  }

  body.p4-framework.connections-reference-active[data-theme] #view-integrations .push-preferences input {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    accent-color: var(--p4-accent);
  }

  body.p4-framework.connections-reference-active[data-theme] #view-integrations :is(
    .integration-card-toggle,
    .integration-actions > button,
    .integration-actions > a
  ) {
    min-height: 44px;
  }

  body.p4-framework.connections-reference-active[data-theme] #view-integrations .integration-card-toggle {
    padding: 0 12px;
    color: var(--p4-text-2);
    border: 1px solid var(--p4-line);
    border-radius: 9px;
    background: var(--p4-surface);
  }

  body.p4-framework.chat-reference-active[data-theme] #view-chat.is-active,
  body.p4-framework[data-theme] #view-chat.is-active {
    height: calc(100dvh - 62px);
    padding: 16px 16px calc(88px + env(safe-area-inset-bottom));
    overflow: hidden;
  }

  body.p4-framework[data-theme] #view-chat .chat-layout {
    height: 100%;
    padding: 0;
  }

  body.p4-framework[data-theme] #view-chat .chat-panel {
    height: 100%;
    min-height: 0;
    color: var(--p4-text);
    border: 1px solid var(--p4-line);
    border-radius: 14px;
    background: var(--p4-surface);
    box-shadow: var(--p4-shadow);
  }

  body.p4-framework[data-theme] #view-chat .chat-intro {
    padding: 18px;
    border-bottom: 1px solid var(--p4-line);
    background: var(--p4-surface);
  }

  body.p4-framework[data-theme] #view-chat .chat-intro::after {
    display: none;
  }

  body.p4-framework[data-theme] #view-chat .chat-intro h2 {
    margin: 7px 0 5px;
    color: var(--p4-text);
    font-family: var(--p4-ui);
    font-size: 26px;
    font-weight: 650;
    line-height: 1.2;
  }

  body.p4-framework[data-theme] #view-chat .chat-intro p {
    margin: 0;
    color: var(--p4-text-2);
    font-size: 12px;
  }

  body.p4-framework[data-theme] #view-chat .prompt-chips {
    margin-top: 13px;
    gap: 7px;
  }

  body.p4-framework[data-theme] #view-chat .prompt-chips button {
    min-height: 44px;
    padding: 0 12px;
    color: var(--p4-text-2);
    border: 1px solid var(--p4-line);
    border-radius: 10px;
    background: var(--p4-surface-2);
    font-size: 12px;
  }

  body.p4-framework[data-theme] #view-chat .voice-dock {
    margin: 10px 10px 0;
    padding: 10px;
    gap: 10px;
    border: 1px solid var(--p4-line);
    border-radius: 11px;
    background: var(--p4-surface-2);
    box-shadow: none;
  }

  body.p4-framework[data-theme] #view-chat .voice-toggle,
  body.p4-framework[data-theme] #view-chat .voice-interrupt {
    min-height: 44px;
  }

  body.p4-framework[data-theme] #view-chat .voice-orb,
  body.p4-framework[data-theme] #view-chat .voice-toggle.is-active .voice-orb {
    background: var(--p4-accent);
    box-shadow: none;
  }

  body.p4-framework[data-theme] #view-chat .voice-copy strong {
    color: var(--p4-text);
    font-size: 12px;
  }

  body.p4-framework[data-theme] #view-chat .voice-copy small {
    color: var(--p4-text-3);
    font-size: 10px;
  }

  body.p4-framework[data-theme] #view-chat .voice-interrupt {
    color: var(--p4-text-2);
    border: 1px solid var(--p4-line);
    border-radius: 9px;
    background: var(--p4-surface);
  }

  body.p4-framework[data-theme] #view-chat .voice-settings {
    margin: 8px 10px 0;
    padding: 0 12px;
    border: 1px solid var(--p4-line);
    border-radius: 10px;
    background: var(--p4-surface);
  }

  body.p4-framework[data-theme] #view-chat .voice-settings > summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    color: var(--p4-text-2);
    font-size: 12px;
  }

  body.p4-framework[data-theme] #view-chat .voice-settings-grid {
    padding-bottom: 12px;
  }

  body.p4-framework[data-theme] #view-chat .voice-settings-grid label,
  body.p4-framework[data-theme] #view-chat .voice-settings > small {
    color: var(--p4-text-2);
    font-size: 11px;
  }

  body.p4-framework[data-theme] #view-chat .voice-settings-grid :is(select, input),
  body.p4-framework[data-theme] #view-chat .voice-shortcuts button,
  body.p4-framework[data-theme] #view-chat .voice-settings-foot button {
    min-height: 44px;
    color: var(--p4-text);
    border-color: var(--p4-line);
    background: var(--p4-surface-2);
  }

  body.p4-framework[data-theme] #view-chat .message-list {
    min-height: 0;
    padding: 14px 12px;
    background: var(--p4-surface-2);
    background-image: none;
  }

  body.p4-framework[data-theme] #view-chat .avatar {
    color: var(--p4-accent-ink);
    border-color: var(--p4-line);
    background: var(--p4-accent-soft);
    box-shadow: none;
  }

  body.p4-framework[data-theme] #view-chat :is(.bubble, .message.user .bubble) {
    color: var(--p4-text);
    border: 1px solid var(--p4-line);
    border-radius: 12px;
    background: var(--p4-surface);
    box-shadow: none;
  }

  body.p4-framework[data-theme] #view-chat .message.user .bubble {
    color: var(--p4-accent-ink);
    background: var(--p4-accent-soft);
  }

  body.p4-framework[data-theme] #view-chat .composer {
    margin: 8px;
    padding: 8px;
    gap: 8px;
    border: 1px solid var(--p4-line);
    border-radius: 13px;
    background: var(--p4-surface);
    box-shadow: none;
  }

  body.p4-framework[data-theme] #view-chat .composer textarea {
    min-height: 64px;
    max-height: 120px;
    padding: 11px 12px;
    color: var(--p4-text);
    border: 1px solid var(--p4-line);
    border-radius: 9px;
    background: var(--p4-surface-2);
    font-size: 16px;
  }

  body.p4-framework[data-theme] #view-chat .composer textarea:focus {
    outline: 2px solid color-mix(in srgb, var(--p4-accent) 55%, transparent);
    outline-offset: 1px;
  }

  body.p4-framework[data-theme] #view-chat .composer-actions small {
    color: var(--p4-text-3);
    font-size: 11px;
  }

  body.p4-framework[data-theme] #view-chat .send-button {
    min-width: 88px;
    min-height: 44px;
    padding: 0 14px;
    color: var(--p4-accent-ink);
    border: 1px solid var(--p4-accent);
    border-radius: 9px;
    background: var(--p4-accent-soft);
    box-shadow: none;
  }

  body.p4-framework[data-theme] #view-chat .send-button:hover {
    color: #fff;
    background: var(--p4-accent);
    transform: none;
  }

  body.p4-framework[data-theme] :is(.page-lead, #view-meetings .meeting-page-lead) h2 {
    margin-top: 10px;
    font-size: 32px;
    line-height: 1.16;
    letter-spacing: -.03em;
  }

  body.p4-framework[data-theme] #view-integrations .integration-lead h2 {
    font-size: 31px;
  }

  body.p4-framework[data-theme] .p4-page-hero h2,
  body.p4-framework[data-theme] #view-chat .chat-intro h2 {
    font-size: 30px;
  }

  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-hero h2 {
    font-size: 28px;
    line-height: 1.12;
    letter-spacing: -.025em;
  }

  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-index-context button {
    min-height: 44px;
  }

  body.p4-framework[data-theme] #view-chat .chat-intro {
    flex: 0 0 auto;
    padding: 12px 14px;
  }

  body.p4-framework[data-theme] #view-chat .chat-intro h2 {
    margin: 5px 0 3px;
    font-size: 26px;
  }

  body.p4-framework[data-theme] #view-chat .chat-intro p {
    font-size: 11px;
  }

  body.p4-framework[data-theme] #view-chat .prompt-chips {
    margin-top: 9px;
    gap: 6px;
  }

  body.p4-framework[data-theme] #view-chat .prompt-chips button {
    padding-inline: 10px;
  }

  body.p4-framework[data-theme] #view-chat .voice-dock {
    min-height: 60px;
    margin: 8px 8px 0;
    padding: 8px;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    flex: 0 0 auto;
  }

  body.p4-framework[data-theme] #view-chat .voice-interrupt:disabled {
    display: none;
  }

  body.p4-framework[data-theme] #view-chat .voice-settings {
    margin: 6px 8px 0;
    padding-inline: 10px;
    flex: 0 0 auto;
  }

  body.p4-framework[data-theme] #view-chat .message-list {
    min-height: 104px;
    padding: 10px;
  }

  body.p4-framework[data-theme] #view-chat .composer {
    margin: 6px 8px 8px;
    padding: 8px;
  }

  body.p4-framework[data-theme] #view-chat .composer textarea {
    min-height: 112px;
    max-height: 180px;
  }

  body.p4-framework[data-theme] #view-chat.is-active {
    padding: 8px 8px calc(82px + env(safe-area-inset-bottom));
  }

  body.p4-framework[data-theme] #view-chat .chat-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    border-radius: 12px;
  }

  body.p4-framework[data-theme] #view-chat .chat-intro {
    grid-row: 1;
    padding: 10px 12px;
  }

  body.p4-framework[data-theme] #view-chat .chat-intro .hero-kicker,
  body.p4-framework[data-theme] #view-chat .chat-intro > p {
    display: none;
  }

  body.p4-framework[data-theme] #view-chat .chat-intro h2 {
    margin: 0 0 7px;
    font-size: 24px;
  }

  body.p4-framework[data-theme] #view-chat .prompt-chips {
    margin-top: 0;
  }

  body.p4-framework[data-theme] #view-chat .voice-dock {
    grid-row: 2;
    grid-column: 1;
    min-height: 60px;
    margin: 6px 8px;
    padding-right: 94px;
  }

  body.p4-framework[data-theme] #view-chat .voice-settings {
    grid-row: 2;
    grid-column: 1;
    align-self: center;
    justify-self: end;
    width: 84px;
    height: 44px;
    margin: 6px 16px 6px 0;
    overflow: hidden;
    z-index: 4;
    background: var(--p4-surface);
  }

  body.p4-framework[data-theme] #view-chat .voice-settings > summary {
    justify-content: center;
    white-space: nowrap;
  }

  body.p4-framework[data-theme] #view-chat .voice-settings[open] {
    grid-row: 2 / 4;
    align-self: start;
    justify-self: center;
    width: calc(100% - 16px);
    height: auto;
    max-height: 320px;
    margin: 6px 8px;
    overflow: auto;
    box-shadow: var(--p4-shadow);
  }

  body.p4-framework[data-theme] #view-chat .message-list {
    grid-row: 3;
    min-height: 0;
    padding: 10px 8px;
  }

  body.p4-framework[data-theme] #view-chat .message {
    max-width: 100%;
  }

  body.p4-framework[data-theme] #view-chat .composer {
    grid-row: 4;
    margin: 6px;
  }

  body.p4-framework[data-theme] #view-chat.is-active {
    width: auto;
    margin-inline: -8px;
    padding: 0 0 calc(80px + env(safe-area-inset-bottom));
  }

  body.p4-framework[data-theme] #view-chat .chat-layout {
    height: 100%;
  }

  body.p4-framework[data-theme] #view-chat .chat-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 10px;
  }

  body.p4-framework[data-theme] #view-chat .chat-intro {
    display: none;
  }

  body.p4-framework[data-theme] #view-chat .message-list {
    flex: 1 1 auto;
    min-height: 0;
    padding: 14px 12px;
    gap: 10px;
  }

  body.p4-framework[data-theme] #view-chat .message {
    max-width: 88%;
    display: block;
  }

  body.p4-framework[data-theme] #view-chat .message.user {
    margin-left: auto;
  }

  body.p4-framework[data-theme] #view-chat .avatar {
    display: none;
  }

  body.p4-framework[data-theme] #view-chat :is(.bubble, .message.user .bubble) {
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.6;
  }

  body.p4-framework[data-theme] #view-chat .composer {
    flex: 0 0 auto;
    margin: 0 8px 8px;
  }

  body.p4-framework[data-theme] #view-chat .composer-actions {
    justify-content: flex-end;
  }

  body.p4-framework[data-theme] #view-chat .composer-actions > small {
    display: none;
  }

  body.p4-framework[data-theme] #view-chat .composer-tools {
    width: 100%;
  }

  body.p4-framework[data-theme] #view-chat .voice-interrupt {
    min-height: 44px;
    padding-inline: 12px;
  }

  body.p4-framework[data-theme] #view-chat .voice-interrupt:disabled {
    display: none;
  }

  body.p4-framework[data-theme] #view-memory .chat-settings-card {
    padding: 18px;
  }

  body.p4-framework[data-theme] #view-memory .chat-settings-panel .voice-settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Mobile chat follows a messaging-first layout: conversation, compact composer, no dashboard chrome. */
  body.p4-framework[data-theme] #view-chat.is-active {
    width: 100% !important;
    margin-inline: 0 !important;
    padding: 0 0 calc(80px + env(safe-area-inset-bottom)) !important;
  }

  body.p4-framework[data-theme] #view-chat .chat-panel {
    border: 0;
    border-radius: 0;
    background: var(--p4-surface-2);
    box-shadow: none;
  }

  body.p4-framework[data-theme] #view-chat .message-list {
    padding: 14px 12px 10px;
    background: var(--p4-surface-2);
  }

  body.p4-framework[data-theme] #view-chat :is(.bubble, .message.user .bubble) {
    border-radius: 9px;
    box-shadow: none;
  }

  body.p4-framework[data-theme] #view-chat .composer {
    margin: 0;
    padding: 8px max(8px, env(safe-area-inset-right)) 8px max(8px, env(safe-area-inset-left));
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px;
    border: 0;
    border-top: 1px solid var(--p4-line);
    border-radius: 0;
    background: var(--p4-surface);
  }

  body.p4-framework[data-theme] #view-chat .composer textarea {
    min-height: 52px;
    max-height: 96px;
    padding: 12px;
    border-radius: 8px;
  }

  body.p4-framework[data-theme] #view-chat .composer-actions,
  body.p4-framework[data-theme] #view-chat .composer-tools {
    width: auto;
  }

  body.p4-framework[data-theme] #view-chat .send-button {
    min-width: 64px;
    padding-inline: 12px;
  }
}

/* Final mobile chat geometry: the thread drawer stays hidden until requested. */
@media (max-width: 820px) {
  body.p4-framework[data-theme] #view-chat .chat-layout {
    position: relative;
    display: block;
  }

  body.p4-framework[data-theme] #view-chat .chat-threadbar {
    position: relative;
    z-index: 4;
    min-height: 48px;
    padding-inline: 8px;
    background: var(--p4-surface);
  }

  body.p4-framework[data-theme] #view-chat .conversation-rail {
    position: fixed;
    z-index: 122;
    inset: 0 auto 0 0;
    width: min(88vw, 340px);
    height: 100dvh;
    padding-top: env(safe-area-inset-top);
    display: flex;
    transform: translateX(-104%);
    transition: transform .2s ease;
    border: 0;
    border-radius: 0;
    background: var(--p4-surface);
    box-shadow: 18px 0 38px rgba(31, 45, 36, .16);
  }

  body.p4-framework[data-theme] #view-chat .conversation-rail.is-open {
    transform: translateX(0);
  }

  body.p4-framework[data-theme] #view-chat .conversation-item.is-active {
    background: rgba(83, 132, 104, .12);
  }

  body.p4-framework[data-theme] #view-chat .conversation-backdrop:not([hidden]) {
    position: fixed;
    z-index: 121;
    inset: 0;
    display: block;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(24, 35, 29, .32);
    backdrop-filter: blur(1px);
  }

  body.p4-framework[data-theme] #view-chat .conversation-rail-close {
    min-height: 44px;
    margin: 8px;
    display: block;
    color: var(--p4-text-2);
    border: 1px solid var(--p4-line);
    border-radius: 8px;
    background: var(--p4-surface-2);
    font-size: 12px;
    font-weight: 600;
  }

  body.p4-framework[data-theme] #view-chat .chat-intro[hidden] {
    display: none !important;
  }

  body.p4-framework[data-theme] #view-chat .chat-failure {
    width: calc(100% - 20px);
    grid-template-columns: 22px minmax(0, 1fr) auto;
  }

  body.p4-framework[data-theme] #view-chat .chat-cancel {
    width: 64px;
    min-width: 64px;
    height: 44px;
  }

  body.conversation-drawer-open #view-chat .chat-thread-new { visibility: hidden; }
  body.conversation-drawer-open .p4-mobile-tabbar { visibility: hidden; }
}

#view-chat .conversation-rail .conversation-list { flex: 1 1 auto; }

/* Project intelligence is a contextual layer over the existing work queue, not a second task system. */
.project-intelligence {
  margin: 18px 0 22px;
  padding: 22px;
  border: 1px solid var(--p4-line, #cfd9d2);
  border-radius: 18px;
  background: var(--p4-surface, #fff);
}

.project-intelligence-heading,
.project-intelligence-heading > div,
.project-intelligence-list article > div,
.project-intelligence-output header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.project-intelligence-heading > div {
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
}

.project-intelligence-heading h3,
.project-intelligence-heading p { margin: 0; }
.project-intelligence-heading p { color: var(--p4-text-2, #66746c); }

.project-intelligence-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 20px;
  border-block: 1px solid var(--p4-line, #d7dfda);
}

.project-intelligence-metrics span {
  min-width: 0;
  padding: 15px 12px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--p4-text-2, #66746c);
}

.project-intelligence-metrics span + span { border-left: 1px solid var(--p4-line, #d7dfda); }
.project-intelligence-metrics b { color: var(--p4-text, #17231c); font-size: 22px; }

.project-intelligence-actions,
.project-field-actions,
.project-field-kind {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.project-intelligence-actions { margin-top: 16px; }
.project-intelligence-actions button,
.project-field-kind button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--p4-line, #cfd9d2);
  border-radius: 999px;
  color: var(--p4-text, #17231c);
  background: var(--p4-surface-2, #f2f6f3);
  font: inherit;
}

.project-field-kind button.is-active {
  color: #fff;
  border-color: var(--p4-accent, #4d8066);
  background: var(--p4-accent, #4d8066);
}

.project-intelligence-output {
  margin-top: 16px;
  padding: 16px 18px;
  border-left: 3px solid var(--p4-accent, #4d8066);
  background: var(--p4-surface-2, #f2f6f3);
}

.project-intelligence-output p { margin: 12px 0 0; line-height: 1.7; }
.project-intelligence-output small { color: var(--p4-text-2, #66746c); }

.project-intelligence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.project-intelligence-grid details {
  min-width: 0;
  border: 1px solid var(--p4-line, #d7dfda);
  border-radius: 12px;
  background: var(--p4-surface, #fff);
}

.project-intelligence-grid :is(.project-integrity, .project-commitments) { grid-column: 1 / -1; }
:is(.project-integrity-basis, .project-commitment-basis) {
  margin: -2px 16px 4px;
  color: var(--p4-text-2, #66746c);
  font-size: 12px;
}
.project-integrity-item { position: relative; padding-left: 14px !important; }
.project-integrity-item::before {
  content: '';
  position: absolute;
  top: 17px;
  bottom: 17px;
  left: 0;
  width: 3px;
  border-radius: 3px;
  background: var(--p4-line, #d7dfda);
}
.project-integrity-item.is-urgent::before { background: #b14e3f; }
.project-integrity-item.is-attention::before { background: #b78624; }
.project-integrity-item.is-check::before { background: var(--p4-accent, #4d8066); }
.project-integrity-item .text-link { flex: 0 0 auto; font-size: 12px; }
.project-commitment-item { position: relative; padding-left: 14px !important; }
.project-commitment-item::before {
  content: '';
  position: absolute;
  top: 17px;
  bottom: 17px;
  left: 0;
  width: 3px;
  border-radius: 3px;
  background: var(--p4-accent, #4d8066);
}
.project-commitment-item.is-overdue::before { background: #b14e3f; }
.project-commitment-item .text-link { flex: 0 0 auto; font-size: 12px; }

.project-intelligence-grid summary {
  padding: 15px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-weight: 700;
}

.project-intelligence-grid summary b {
  min-width: 28px;
  padding: 3px 8px;
  border-radius: 999px;
  text-align: center;
  background: var(--p4-surface-2, #eef3ef);
}

.project-intelligence-list { padding: 0 16px 14px; }
.project-intelligence-list article { padding: 12px 0; border-top: 1px solid var(--p4-line, #e0e6e2); }
.project-intelligence-list article:first-child { border-top: 0; }
.project-intelligence-list :is(p, small) { display: block; margin: 6px 0 0; color: var(--p4-text-2, #66746c); }
.project-intelligence-list time { flex: 0 0 auto; color: var(--p4-text-2, #66746c); font-size: 12px; }
.project-intelligence-empty { margin: 0; padding: 4px 0 14px; color: var(--p4-text-2, #66746c); }

.project-decision-form,
.project-field-mode > p,
.project-field-mode form { margin: 0 16px 16px; }
.project-decision-form label { display: block; margin-top: 10px; }
.project-decision-form :is(select, textarea),
.project-field-mode textarea {
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border: 1px solid var(--p4-line, #cfd9d2);
  border-radius: 10px;
  color: var(--p4-text, #17231c);
  background: var(--p4-surface, #fff);
  font: inherit;
}

.project-field-mode > p { color: var(--p4-text-2, #66746c); }
.project-field-mode textarea { margin: 12px 0; }
.project-field-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.project-field-attachments figure { position: relative; width: 74px; height: 74px; margin: 0; }
.project-field-attachments img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.project-field-attachments button {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: #7a3f35;
}

@media (max-width: 820px) {
  .project-intelligence { margin: 14px 0 18px; padding: 16px; scroll-margin-top: 72px; border-radius: 14px; }
  .project-intelligence-heading { align-items: flex-start; flex-direction: column; }
  .project-intelligence-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-intelligence-metrics span:nth-child(3) { border-left: 0; border-top: 1px solid var(--p4-line, #d7dfda); }
  .project-intelligence-metrics span:nth-child(4) { border-top: 1px solid var(--p4-line, #d7dfda); }
  .project-intelligence-grid { grid-template-columns: 1fr; }
  .project-intelligence-actions button,
  .project-field-actions button { flex: 1 1 auto; }
}
