/* Youni V3 · Island Daily theme
 * Decorative island language is presentation-only. Run, risk, scope and
 * side-effect truth still come from the typed server contract.
 */
:root {
  color-scheme: light;
  --island-sky: #dff4f0;
  --island-cream: #fff9e9;
  --island-paper: #fffdf7;
  --leaf: #6dae83;
  --leaf-deep: #39745a;
  --clay: #d77a5d;
  --clay-deep: #a94f3e;
  --sea: #5b9eb3;
  --sun: #f2c866;
  --danger: #b34b45;
  --ink: #283c39;
  --muted: #5e716c;
  --line: #d8e6db;
  --line-strong: #b9d3c2;
  --shadow-paper: 0 16px 40px rgb(57 116 90 / 12%);
  --shadow-soft: 0 8px 22px rgb(57 116 90 / 10%);
  --radius-card: 20px;
  --radius-shell: 30px;
  --focus: 0 0 0 4px rgb(57 116 90 / 25%);
  font-family: "Nunito", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

[data-theme="neutral"] {
  --island-sky: #f4efe8;
  --island-cream: #fbf4ed;
  --island-paper: #fffdf9;
  --leaf: #7a8d86;
  --leaf-deep: #52655f;
  --clay: #d67962;
  --clay-deep: #ad5545;
  --line: #e5d9ce;
  --line-strong: #d5c5b7;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--island-sky); }
body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgb(255 255 255 / 84%) 0 3%, transparent 18%),
    radial-gradient(circle at 86% 4%, rgb(242 200 102 / 24%) 0 2%, transparent 16%),
    linear-gradient(180deg, var(--island-sky) 0 38%, #eff7e8 68%, #f9f3de 100%);
}
body::before,
body::after {
  position: fixed;
  z-index: 0;
  width: 140px;
  height: 220px;
  pointer-events: none;
  content: "";
  opacity: .18;
  background:
    radial-gradient(ellipse at 50% 18%, var(--leaf) 0 12%, transparent 13%),
    radial-gradient(ellipse at 28% 38%, var(--leaf) 0 11%, transparent 12%),
    radial-gradient(ellipse at 72% 55%, var(--leaf) 0 11%, transparent 12%),
    linear-gradient(72deg, transparent 48%, var(--leaf-deep) 49% 52%, transparent 53%);
  transform: rotate(-12deg);
}
body::before { top: 10%; left: -42px; }
body::after { right: -42px; bottom: 8%; transform: scaleX(-1) rotate(-12deg); }

button, textarea, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible,
summary:focus-visible { outline: none; box-shadow: var(--focus); }

.youni-shell { position: relative; z-index: 1; display: grid; grid-template-rows: auto minmax(0, 1fr); width: min(1180px, calc(100% - 32px)); height: 100dvh; min-height: 0; margin: 0 auto; padding: 22px 0; overflow: hidden; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  position: relative;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 3px solid var(--island-paper);
  border-radius: 16px 16px 16px 8px;
  color: var(--island-paper);
  background: var(--leaf);
  font-size: 20px;
  font-weight: 900;
  box-shadow: var(--shadow-soft);
  transform: rotate(-4deg);
}
.brand-mark::after { position: absolute; right: -6px; bottom: -7px; width: 14px; height: 14px; border-radius: 50%; content: ""; background: var(--sun); }
.brand-copy { color: var(--leaf-deep); font-size: 16px; font-weight: 900; letter-spacing: .02em; }
.health-pill { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 8px 14px; color: var(--leaf-deep); background: rgb(255 253 247 / 82%); font-size: 13px; font-weight: 800; box-shadow: 0 4px 14px rgb(57 116 90 / 7%); }
.health-pill::before { width: 9px; height: 9px; border-radius: 50%; content: ""; background: var(--leaf); box-shadow: 0 0 0 4px rgb(109 174 131 / 18%); }

.workspace {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.52fr) minmax(300px, .68fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "intro intro"
    "conversation side"
    "composer side";
  gap: 18px 24px;
  margin-top: 30px;
  min-height: 0;
  height: calc(100% - 30px);
  padding: clamp(22px, 3.2vw, 36px);
  overflow: hidden;
  border: 1px solid rgb(185 211 194 / 76%);
  border-radius: var(--radius-shell);
  background: rgb(255 253 247 / 92%);
  box-shadow: var(--shadow-paper);
  backdrop-filter: blur(9px);
}
.workspace::before { position: absolute; top: -78px; right: 10%; width: 210px; height: 140px; border-radius: 50%; content: ""; opacity: .55; background: radial-gradient(ellipse, rgb(255 255 255 / 90%) 0 45%, transparent 46%); transform: rotate(-6deg); }
.workspace > * { position: relative; z-index: 1; min-width: 0; }
.intro { grid-area: intro; max-width: 720px; }
.workspace-side { grid-area: side; display: grid; align-content: start; gap: 14px; min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--leaf-deep); font-size: 12px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.eyebrow::before { width: 22px; height: 9px; border-radius: 100% 0 100% 0; content: ""; background: var(--leaf); transform: rotate(-18deg); }
.title { margin: 10px 0 10px; color: var(--ink); font-size: clamp(34px, 5vw, 58px); line-height: 1.05; letter-spacing: -.05em; }
.subtitle { max-width: 640px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.75; }

.island-card {
  align-self: start;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 17px 18px;
  background:
    radial-gradient(circle at 92% 8%, rgb(242 200 102 / 30%) 0 10%, transparent 11%),
    linear-gradient(145deg, rgb(223 244 240 / 90%), rgb(255 249 233 / 88%));
  box-shadow: var(--shadow-soft);
}
.island-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.island-kicker { color: var(--leaf-deep); font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.island-status { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 10px; color: var(--leaf-deep); background: rgb(255 253 247 / 82%); font-size: 11px; font-weight: 900; }
.island-status::before { width: 7px; height: 7px; border-radius: 50%; content: ""; background: var(--leaf); }
.island-status[data-state="failed"] { color: var(--danger); background: #fff0ed; }
.island-status[data-state="failed"]::before { background: var(--danger); }
.island-status[data-state="awaiting_subject"], .island-status[data-state="awaiting_user_input"], .island-status[data-state="awaiting_approval"], .island-status[data-state="unknown"], .island-status[data-state="retry_wait"] { color: #8b6a1f; background: #fff5d3; }
.island-status[data-state="awaiting_subject"]::before, .island-status[data-state="awaiting_user_input"]::before, .island-status[data-state="awaiting_approval"]::before, .island-status[data-state="unknown"]::before, .island-status[data-state="retry_wait"]::before { background: var(--sun); }
.island-card-title { margin: 12px 0 10px; color: var(--ink); font-size: 18px; line-height: 1.35; }
.next-steps { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.next-steps li { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 13px; line-height: 1.5; }
.next-steps li::before { flex: 0 0 auto; width: 9px; height: 9px; margin-top: 5px; border-radius: 50% 50% 50% 0; content: ""; background: var(--leaf); transform: rotate(-45deg); }
.island-card-note { margin: 14px 0 0; padding-top: 11px; border-top: 1px solid rgb(185 211 194 / 60%); color: var(--muted); font-size: 12px; line-height: 1.55; }

.history-tools { display: grid; gap: 11px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 16px; background: rgb(255 253 247 / 88%); box-shadow: 0 4px 14px rgb(57 116 90 / 5%); }
.history-tools-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.side-card-kicker { color: var(--leaf-deep); font-size: 12px; font-weight: 900; }
.history-tools-caption { color: var(--muted); font-size: 10px; }
.history-tools .conversation-meta { justify-content: space-between; padding-top: 11px; border-top: 1px solid var(--line); }
.conversation-panel { grid-area: conversation; display: grid; grid-template-rows: auto minmax(0, 1fr); align-content: stretch; gap: 12px; min-height: 0; overflow: hidden; padding: 18px; border: 1px solid var(--line-strong); border-radius: 22px; background: rgb(255 253 247 / 88%); box-shadow: var(--shadow-soft); }
.conversation-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 2px; }
.conversation-heading { display: grid; gap: 3px; }
.conversation-title { color: var(--ink); font-size: 15px; letter-spacing: .02em; }
.conversation-subtitle { display: none; }
.conversation-meta { display: inline-flex; align-items: center; gap: 8px; }
.conversation-count { color: var(--muted); font-size: 12px; font-weight: 800; }
.clear-history { min-height: 30px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 9px; color: var(--muted); background: transparent; font-size: 11px; }
.clear-history:hover { border-color: var(--clay); color: var(--clay-deep); background: #fff7f2; }
.messages { display: none !important; }
.conversation-empty { display: grid; align-content: center; justify-items: start; min-height: 420px; padding: 24px 8px; }
.conversation-empty::before { width: 34px; height: 5px; margin-bottom: 16px; border-radius: 999px; content: ""; background: var(--clay); opacity: .78; }
.conversation-empty-title { color: var(--leaf-deep); font-size: 20px; letter-spacing: -.02em; }
.conversation-empty-copy { max-width: 340px; margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.message { position: relative; max-width: min(88%, 620px); border: 1px solid var(--line); padding: 14px 17px; border-radius: var(--radius-card); line-height: 1.7; box-shadow: 0 4px 10px rgb(57 116 90 / 4%); }
.message::after { position: absolute; bottom: -7px; width: 14px; height: 14px; border: 1px solid var(--line); content: ""; background: inherit; transform: rotate(45deg); }
.message-user { justify-self: end; border-color: var(--clay); color: #fff; background: var(--clay); border-bottom-right-radius: 7px; }
.message-user::after { right: 14px; border-top: 0; border-left: 0; border-color: var(--clay); }
.message-assistant { justify-self: start; background: var(--island-cream); border-bottom-left-radius: 7px; }
.message-assistant::after { left: 14px; border-right: 0; border-bottom: 0; }
.message-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.message-label { opacity: .72; font-size: 11px; font-weight: 900; }
.message-time { opacity: .55; font-size: 10px; }
.message-body { white-space: pre-wrap; overflow-wrap: anywhere; }

.composer { grid-area: composer; display: grid; align-self: stretch; min-height: 0; border: 1px solid var(--line-strong); border-radius: 19px; padding: 15px 16px; background: var(--island-paper); box-shadow: var(--shadow-soft); }
.composer-input { width: 100%; min-height: 92px; border: 0; outline: 0; resize: vertical; color: var(--ink); background: transparent; line-height: 1.7; }
.composer-input::placeholder { color: #82948d; }
.composer-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 11px; }
.composer-note-group { display: grid; gap: 4px; min-width: 0; }
.composer-note { max-width: 330px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.composer-shortcut { color: var(--leaf-deep); font-size: 11px; font-weight: 800; }
.composer-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; clip-path: inset(50%); }
.send-button, .settings-save { min-height: 44px; border: 0; border-radius: 999px; padding: 11px 19px; color: #fff; background: var(--clay); font-weight: 900; box-shadow: 0 6px 14px rgb(169 79 62 / 18%); }
.send-button:hover, .settings-save:hover { background: var(--clay-deep); }
.send-button:disabled, .settings-save:disabled { cursor: wait; opacity: .58; }

.debug-panel { border: 1px solid var(--line-strong); border-radius: 16px; background: rgb(239 247 232 / 70%); box-shadow: 0 5px 16px rgb(57 116 90 / 5%); }
.debug-panel[open] { background: rgb(239 247 232 / 84%); }
.debug-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 13px 16px; color: var(--leaf-deep); cursor: pointer; list-style: none; font-size: 13px; font-weight: 900; }
.debug-summary::-webkit-details-marker { display: none; }
.debug-summary::before { width: 8px; height: 8px; margin-right: 2px; border-right: 2px solid var(--leaf-deep); border-bottom: 2px solid var(--leaf-deep); content: ""; transform: rotate(-45deg); transition: transform .18s ease; }
.debug-panel[open] .debug-summary::before { transform: rotate(45deg); }
.debug-summary-copy { display: inline-flex; align-items: center; gap: 8px; flex: 1; }
.debug-summary-copy::after { width: 6px; height: 6px; border-radius: 50%; content: ""; background: var(--leaf); }
.debug-summary-status { border-radius: 999px; padding: 5px 9px; color: var(--leaf-deep); background: rgb(255 253 247 / 78%); font-size: 11px; }
.debug-summary-status[data-state="failed"] { color: var(--danger); background: #fff0ed; }
.debug-summary-status[data-state="awaiting_subject"], .debug-summary-status[data-state="awaiting_user_input"], .debug-summary-status[data-state="awaiting_approval"], .debug-summary-status[data-state="unknown"], .debug-summary-status[data-state="retry_wait"] { color: #8b6a1f; background: #fff5d3; }
.debug-body { display: grid; gap: 12px; max-height: 380px; overflow: auto; padding: 0 16px 16px; }
.debug-intro { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.performance-section { display: grid; gap: 8px; border: 1px solid rgb(185 211 194 / 65%); border-radius: 12px; padding: 10px 11px; background: rgb(255 253 247 / 58%); }
.performance-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.performance-title { margin: 0; color: var(--leaf-deep); font-size: 12px; }
.performance-caption { color: var(--muted); font-size: 10px; }
.performance-list { display: grid; gap: 5px; }
.performance-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; color: var(--muted); font-size: 11px; }
.performance-row-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.performance-row-duration { color: var(--ink); font-size: 11px; }
.performance-empty, .performance-total { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.performance-total { padding-top: 5px; border-top: 1px solid var(--line); color: var(--leaf-deep); }
.run-progress { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 4px 0 6px; }
.progress-step { display: grid; grid-template-columns: 24px 1fr; gap: 7px; align-items: center; min-width: 0; color: var(--muted); font-size: 11px; }
.progress-dot { display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--muted); background: var(--island-paper); font-size: 11px; font-weight: 900; }
.progress-step[data-state="done"] .progress-dot { border-color: var(--leaf); color: #fff; background: var(--leaf); }
.progress-step[data-state="current"] .progress-dot { border-color: var(--clay); color: var(--clay-deep); background: #fff1ea; box-shadow: 0 0 0 4px rgb(215 122 93 / 12%); }
.progress-step[data-state="current"] .progress-label { color: var(--ink); }
.progress-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acceptance { min-height: 18px; margin: 0; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.run-summary { color: var(--ink); font-size: 12px; font-weight: 800; overflow-wrap: anywhere; }
.run-outcome { color: var(--leaf-deep); font-size: 13px; line-height: 1.55; }
.run-error { display: grid; gap: 4px; border: 1px solid rgb(179 75 69 / 35%); border-radius: 12px; padding: 11px 12px; color: var(--danger); background: #fff4f1; }
.run-error-title { font-size: 13px; line-height: 1.5; }
.run-error-code { color: #8e625d; font-size: 11px; }
.debug-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.run-refresh, .run-retry, .scenario-button { min-height: 38px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 8px 14px; color: var(--leaf-deep); background: var(--island-paper); font-size: 12px; font-weight: 800; }
.run-retry { border-color: rgb(215 122 93 / 55%); color: var(--clay-deep); }
.run-refresh:hover, .run-retry:hover, .scenario-button:hover { border-color: var(--leaf); background: #f3fbef; }
.run-refresh:disabled, .run-retry:disabled, .scenario-button:disabled { cursor: wait; opacity: .56; }
.timeline-heading { margin: 4px 0 0; color: var(--leaf-deep); font-size: 12px; letter-spacing: .05em; }
.run-timeline { display: grid; gap: 9px; max-height: 220px; overflow: auto; margin: 0; padding: 0 4px 0 0; list-style: none; }
.timeline-item { display: flex; gap: 9px; align-items: flex-start; }
.timeline-marker { flex: 0 0 auto; width: 9px; height: 9px; margin-top: 5px; border: 2px solid var(--leaf); border-radius: 50%; background: var(--island-paper); }
.timeline-item[data-kind="run.failed"] .timeline-marker { border-color: var(--danger); }
.timeline-item[data-kind="run.completed"] .timeline-marker { border-color: var(--leaf-deep); background: var(--leaf); }
.timeline-content { display: grid; gap: 2px; min-width: 0; }
.timeline-title { color: var(--ink); font-size: 12px; }
.timeline-detail, .timeline-empty { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.timeline-empty { padding: 4px 0; }

.scenario-panel, .settings-panel { border: 1px solid var(--line); border-radius: 16px; padding: 13px; color: var(--muted); background: rgb(255 249 233 / 72%); font-size: 13px; }
.scenario-summary, .settings-summary { color: var(--leaf-deep); cursor: pointer; font-weight: 900; }
.scenario-controls { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.scenario-select { min-width: 0; flex: 1; border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px; color: var(--ink); background: var(--island-paper); }
.scenario-result { max-height: 260px; overflow: auto; margin: 12px 0 0; border: 1px solid var(--line); border-radius: 12px; padding: 12px; color: var(--leaf-deep); background: rgb(255 253 247 / 90%); white-space: pre-wrap; overflow-wrap: anywhere; }
.settings-panel { background: rgb(255 253 247 / 92%); }
.settings-form { display: grid; grid-template-columns: 1fr; gap: 9px; margin-top: 12px; }
.settings-label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 800; }
.settings-input { width: 100%; border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px; color: var(--ink); background: var(--island-paper); }
.settings-save { justify-self: stretch; min-height: 38px; padding: 9px 14px; font-size: 12px; }

/* V3 business debug workbench: dense enough for operations, still sharing
   the Island Daily paper/leaf/clay language with the conversation shell. */
.v3-workbench-shell { border: 1px solid rgb(185 211 194 / 72%); border-radius: 18px; background: rgb(239 247 232 / 84%); overflow: hidden; }
.v3-workbench-shell[open] { box-shadow: 0 10px 30px rgb(65 104 74 / 8%); }
.v3-workbench-summary { display: grid; grid-template-columns: minmax(118px, 1fr) minmax(0, 1.35fr); align-items: center; gap: 10px; min-height: 48px; padding: 12px 14px; color: var(--leaf-deep); cursor: pointer; list-style: none; font-size: 12px; font-weight: 900; }
.v3-workbench-summary::-webkit-details-marker { display: none; }
.v3-workbench-summary::before { width: 7px; height: 7px; margin-right: 2px; border-right: 2px solid var(--leaf-deep); border-bottom: 2px solid var(--leaf-deep); content: ""; transform: rotate(-45deg); transition: transform .18s ease; }
.v3-workbench-shell[open] .v3-workbench-summary::before { transform: rotate(45deg); }
.v3-workbench-summary-title { min-width: 0; color: var(--leaf-deep); line-height: 1.35; white-space: normal; word-break: keep-all; overflow-wrap: normal; }
.v3-workbench-summary-meta { min-width: 0; overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 700; line-height: 1.35; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.v3-workbench-mount { display: grid; gap: 10px; padding: 0 10px 10px; }
.v3-workbench-preset-root, .v3-workbench-view-root { min-width: 0; }
.v3-inline-mount { display: grid; gap: 8px; min-height: 0; height: 100%; overflow: hidden; padding: 0 0 8px; }
.v3-inline-mount .v3-workbench-view-root, .v3-inline-mount .v3-workbench-view { min-width: 0; min-height: 0; height: 100%; }
.v3-inline-mount .workbench-context-panel,
.v3-inline-mount .workbench-cards-panel,
.v3-inline-mount .workbench-actions-panel,
.v3-inline-mount .workbench-debug-panel { display: none; }
.v3-inline-mount .workbench-chat-timeline { height: 100%; min-height: 0; max-height: none; border: 0; padding: 8px 16px 16px; background: transparent; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.v3-inline-mount .workbench-message { display: grid; }
.v3-inline-mount .workbench-chat-timeline > .workbench-panel-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.preset-controls { display: grid; gap: 9px; border: 1px solid var(--line); border-radius: 14px; padding: 10px; background: rgb(255 253 247 / 90%); }
.preset-controls-heading { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.preset-kicker { color: var(--clay-deep); font-size: 9px; font-weight: 900; letter-spacing: .1em; }
.preset-title { color: var(--leaf-deep); font-size: 12px; }
.preset-status { margin-left: auto; border-radius: 999px; padding: 4px 7px; color: var(--muted); background: #f3f5ed; font-size: 9px; }
.preset-status[data-state="requires_confirmation"] { color: #8b6a1f; background: #fff5d3; }
.preset-status[data-state="resolved"] { color: var(--leaf-deep); background: #e8f5e2; }
.preset-controls-fields { display: grid; grid-template-columns: 1fr; gap: 7px; }
.preset-field { display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 800; }
.preset-field select { min-width: 0; border: 1px solid var(--line-strong); border-radius: 9px; padding: 8px; color: var(--ink); background: var(--island-paper); font-size: 11px; }
.preset-reset, .workbench-action, .workbench-memory-action { min-height: 40px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 8px 12px; color: var(--leaf-deep); background: var(--island-paper); font-size: 11px; font-weight: 800; }
.preset-reset:hover, .workbench-action:hover, .workbench-memory-action:hover { border-color: var(--leaf); background: #f3fbef; }
.preset-reset:disabled, .workbench-action:disabled, .workbench-memory-action:disabled { cursor: not-allowed; opacity: .5; }
.preset-note { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.workbench-chat-timeline, .workbench-context-panel, .workbench-cards-panel, .workbench-actions-panel, .workbench-debug-panel { display: grid; gap: 7px; border: 1px solid var(--line); border-radius: 14px; padding: 10px; background: rgb(255 253 247 / 86%); }
.workbench-chat-timeline { max-height: 620px; overflow: auto; align-content: start; scroll-behavior: smooth; }
.workbench-message { display: grid; gap: 3px; max-width: 92%; border-radius: 12px; padding: 8px 10px; }
.workbench-message-user { justify-self: end; color: var(--ink); background: #eef7e9; }
.workbench-message-assistant { justify-self: start; color: var(--ink); background: #f6f2e8; }
.workbench-message-role { color: var(--leaf-deep); font-size: 9px; font-weight: 900; }
.workbench-message-text { margin: 0; font-size: 11px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.workbench-timeline-card { display: grid; gap: 4px; }
.workbench-action-status-line, .workbench-system-event { border-left: 2px solid var(--line-strong); padding: 4px 8px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.workbench-action-status-line.status-pending { border-left-color: var(--sun); color: var(--ink); }
.workbench-action-status-line.status-succeeded { border-left-color: var(--leaf); }
.workbench-action-status-line.status-failed, .workbench-action-status-line.status-blocked { border-left-color: var(--danger); }
.workbench-panel-title { color: var(--leaf-deep); font-size: 11px; font-weight: 900; }
.workbench-context-subject, .workbench-context-meta, .workbench-empty { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.workbench-context-subject { color: var(--ink); font-size: 12px; font-weight: 900; }
.workbench-subtitle { margin: 4px 0 0; color: var(--leaf-deep); font-size: 10px; }
.workbench-memory-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 5px; align-items: center; min-width: 0; }
.workbench-memory-summary { overflow: hidden; color: var(--ink); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.workbench-memory-status, .workbench-card-status { border-radius: 999px; padding: 3px 6px; color: var(--muted); background: #f3f5ed; font-size: 9px; white-space: nowrap; }
.workbench-memory-action { min-height: 24px; padding: 3px 7px; font-size: 9px; }
.workbench-card { display: grid; gap: 7px; border: 1px solid rgb(185 211 194 / 68%); border-left: 4px solid var(--leaf); border-radius: 14px; padding: 12px 13px; background: #fbfff8; box-shadow: 0 4px 12px rgb(57 116 90 / 5%); }
.workbench-card[data-state="pending"] { border-color: rgb(242 200 102 / 70%); border-left-color: var(--sun); background: #fffaf0; }
.workbench-card[data-state="succeeded"] { border-color: rgb(109 174 131 / 70%); border-left-color: var(--leaf); background: #f3fbef; }
.workbench-card[data-state="failed"], .workbench-card[data-state="blocked"] { border-color: rgb(179 75 69 / 45%); border-left-color: var(--danger); background: #fff5f2; }
.workbench-card[data-state="expired"], .workbench-card[data-state="cancelled"] { border-color: var(--line); border-left-color: var(--muted); background: #f5f6f0; opacity: .84; }
.workbench-card-health_risk { border-left-color: var(--danger); background: #fff7f3; }
.workbench-card-profile_memory_update { border-left-color: var(--clay); }
.workbench-card-memory_capture { border-left-color: var(--sun); }
.workbench-card-grain_analysis { border-left-color: var(--leaf); }
.workbench-card-product_recommendation { border-left-color: var(--sky); }
.workbench-card-product_feedback { border-left-color: var(--clay); }
.workbench-card-recipe_result { border-left-color: var(--sun); background: #fffaf0; }
.workbench-card-store_activity { border-left-color: var(--sea); background: #f3faff; }
.workbench-card-kicker { color: var(--leaf-deep); font-size: 10px; font-weight: 900; letter-spacing: .04em; }
.workbench-card-title { margin: 0; color: var(--ink); font-size: 14px; line-height: 1.4; }
.workbench-card-summary { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.workbench-list { display: grid; gap: 3px; margin: 0; padding-left: 16px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.workbench-card-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 3px; }
.workbench-card-state { justify-self: start; border-radius: 999px; padding: 5px 9px; color: var(--muted); background: #f1f4ed; font-size: 10px; font-weight: 900; }
.workbench-card-state.state-submitted, .workbench-card-state.state-pending { color: #8b6a1f; background: #fff1bf; }
.workbench-card-state.state-succeeded { color: var(--leaf-deep); background: #dff1dd; }
.workbench-card-state.state-failed, .workbench-card-state.state-blocked { color: var(--danger); background: #ffe1db; }
.workbench-question-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; padding-top: 5px; }
.workbench-question-option { min-height: 44px; border: 1px solid var(--line-strong); border-radius: 12px; padding: 9px 13px; color: var(--leaf-deep); background: var(--island-paper); font-size: 12px; font-weight: 800; cursor: pointer; transition: border-color .18s ease, background .18s ease, color .18s ease, opacity .18s ease; }
.workbench-question-option:hover { border-color: var(--leaf); background: #f3fbef; }
.workbench-question-option[data-selected="true"] { border-color: var(--leaf-deep); color: #fff; background: var(--leaf); box-shadow: 0 0 0 3px rgb(109 174 131 / 18%); }
.workbench-question-option[data-action-state="pending"], .workbench-question-option[data-action-state="submitted"] { border-color: var(--sun); color: #8b6a1f; background: #fff5d3; }
.workbench-question-option:disabled { cursor: not-allowed; opacity: .58; }
.workbench-question-option[data-selected="true"]:disabled { opacity: 1; }
.workbench-card-action { width: auto; min-width: 88px; }
.workbench-actions-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.workbench-actions-panel > .workbench-panel-title, .workbench-actions-panel > .workbench-empty { grid-column: 1 / -1; }
.workbench-action { width: 100%; }
.workbench-action-label { display: block; }
.workbench-action-status { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 700; }
.workbench-debug-panel { background: rgb(247 250 242 / 90%); }
.workbench-debug-summary { color: var(--leaf-deep); cursor: pointer; font-size: 10px; font-weight: 900; }
.workbench-debug-body { max-height: 230px; overflow: auto; margin: 0; color: var(--muted); font: 9px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (min-width: 821px) {
  .preset-controls-fields { grid-template-columns: 1fr 1fr; }
  .preset-controls-fields .preset-field:nth-child(3) { grid-column: 1 / -1; }
  .preset-controls-fields .preset-reset { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 820px) {
  body { overflow: auto; }
  .youni-shell { display: block; height: auto; min-height: 100dvh; overflow: visible; }
  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    grid-template-areas: "intro" "conversation" "composer" "side";
    gap: 18px;
    height: auto;
    min-height: 0;
  }
  .workspace-side { gap: 12px; overflow: visible; }
  .conversation-panel { grid-template-rows: auto auto; min-height: 0; }
  .v3-inline-mount { height: auto; overflow: visible; }
  .v3-inline-mount .v3-workbench-view-root, .v3-inline-mount .v3-workbench-view { height: auto; }
  .v3-inline-mount .workbench-chat-timeline { height: min(62dvh, 560px); max-height: 560px; }
  .conversation-empty { min-height: 300px; }
  .run-progress { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 10px; }
  .settings-form { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
  .youni-shell { width: min(100% - 18px, 1180px); padding-top: 12px; }
  .topbar { align-items: flex-start; }
  .health-pill { min-height: 34px; padding: 7px 10px; font-size: 11px; }
  .workspace { margin-top: 18px; padding: 24px 15px 20px; border-radius: 24px; }
  .title { font-size: clamp(32px, 12vw, 48px); }
  .subtitle { font-size: 14px; }
  .message { max-width: 94%; }
  .conversation-header { align-items: flex-start; flex-direction: column; }
  .conversation-meta { width: 100%; justify-content: space-between; }
  .scenario-controls { align-items: stretch; flex-direction: column; }
  .scenario-button { align-self: flex-start; }
  .composer-controls { align-items: stretch; flex-direction: column; }
  .composer-note { max-width: none; }
  .send-button { width: 100%; }
  .settings-form { grid-template-columns: 1fr; }
  .run-progress { grid-template-columns: 1fr 1fr; }
  .debug-summary { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
@media (forced-colors: active) {
  .brand-mark, .send-button, .settings-save, .message-user { border: 1px solid ButtonText; }
  .health-pill, .debug-panel, .scenario-panel, .settings-panel, .composer, .message, .conversation-empty, .run-error { border: 1px solid CanvasText; }
}
