:root {
  --ink: #26211f;
  --ink-soft: #625851;
  --muted: #94867b;
  --muted-2: #b9aaa0;
  --paper: #fff;
  --shell: #f8ecdf;
  --shell-strong: #f3ddcd;
  --surface: #fdf8f4;
  --line: #eadfd5;
  --line-strong: #dccbbe;
  --accent: #f2632d;
  --accent-dark: #d84b1c;
  --accent-soft: #feebe1;
  --peach: #fff0df;
  --violet: #eee9ff;
  --teal: #dff5f1;
  --blue: #e5f0ff;
  --green: #178a6a;
  --danger: #b9382b;
  --danger-soft: #fff0ed;
  --shadow-sm: 0 8px 28px -18px rgba(82, 49, 29, .28);
  --shadow: 0 20px 55px -30px rgba(82, 49, 29, .36);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --sidebar: 318px;
}

[hidden] { display: none !important; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--shell);
  font: 16px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
textarea { resize: vertical; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.is-hidden { display: none !important; }
.eyebrow { margin: 0 0 5px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.centered { text-align: center; }

/* Login */
.login-screen {
  position: relative; display: grid; min-height: 100%; place-items: center; overflow: hidden;
  padding: 30px; background: linear-gradient(135deg, #f9e5d6 0%, #fff7f0 48%, #f8dfce 100%);
}
.login-art { position: absolute; inset: 0; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .72; }
.orb-a { width: 440px; height: 440px; left: -150px; top: -180px; background: radial-gradient(circle at 60% 60%, #ffbc8f, #ed6532); }
.orb-b { width: 360px; height: 360px; right: -90px; bottom: -170px; background: radial-gradient(circle at 40% 40%, #ffd1b0, #f28a56); }
.orb-c { width: 130px; height: 130px; right: 16%; top: 10%; background: linear-gradient(145deg, rgba(255,255,255,.65), rgba(255,171,117,.35)); box-shadow: 0 30px 90px rgba(132,63,25,.14); }
.login-card {
  position: relative; width: min(430px, 100%); padding: 38px; border: 1px solid rgba(255,255,255,.85);
  border-radius: 28px; background: rgba(255,255,255,.84); box-shadow: 0 40px 90px -42px rgba(95,45,20,.55);
  backdrop-filter: blur(20px);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  display: grid; width: 34px; height: 34px; place-items: center; flex: none; border-radius: 10px;
  color: #fff; background: linear-gradient(145deg, #ff8b49, #ee571f); box-shadow: 0 7px 18px -8px rgba(218,73,20,.8);
  font-weight: 800; font-size: 17px;
}
.brand > span:last-child { display: flex; min-width: 0; flex-direction: column; }
.brand b { font-size: 15px; line-height: 1.15; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.brand-large .brand-mark { width: 42px; height: 42px; border-radius: 12px; font-size: 20px; }
.brand-large b { font-size: 18px; }
.login-copy { margin: 40px 0 28px; }
.login-copy h1 { margin: 0 0 10px; font: 400 35px/1.1 Georgia, "Times New Roman", serif; }
.login-copy p:last-child, .modal-card > p { margin: 0; color: var(--ink-soft); }
.field-label { display: flex; justify-content: space-between; margin: 0 0 7px; font-size: 12px; font-weight: 700; }
.field-label span { color: var(--muted); font-weight: 500; }
.password-field { position: relative; }
.password-field input, .text-input, .modal textarea, .task-panel textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 12px; outline: 0; background: #fff;
  padding: 12px 14px; transition: border .15s, box-shadow .15s;
}
.password-field input { padding-right: 48px; }
.password-field input:focus, .text-input:focus, .modal textarea:focus, .task-panel textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242,99,45,.11);
}
.password-field .icon-button { position: absolute; right: 5px; top: 5px; }
.form-error { min-height: 19px; margin: 7px 0 4px; color: var(--danger); font-size: 12px; }
.login-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 18px 0 0; color: var(--muted); font-size: 11px; }
.login-note svg { width: 13px; height: 13px; }

/* Shared controls */
.button {
  display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 11px; padding: 9px 16px; font-weight: 700; font-size: 13px;
  transition: background .15s, transform .15s, box-shadow .15s;
}
.button svg { width: 16px; height: 16px; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button.primary { border-color: var(--accent); color: #fff; background: var(--accent); box-shadow: 0 8px 24px -13px rgba(226,74,20,.9); }
.button.primary:hover:not(:disabled) { background: var(--accent-dark); }
.button.secondary { border-color: var(--line); background: #fff; }
.button.secondary:hover:not(:disabled) { background: var(--surface); }
.button.danger { border-color: #f1c5bd; color: var(--danger); background: #fff; }
.button.small { min-height: 36px; padding: 7px 12px; }
.button.wide { width: 100%; }
.icon-button {
  display: inline-grid; width: 38px; height: 38px; place-items: center; flex: none;
  border: 1px solid var(--line); border-radius: 11px; background: #fff;
}
.icon-button:hover { background: var(--surface); }
.icon-button svg { width: 18px; height: 18px; }
.icon-button.bare { border-color: transparent; background: transparent; }
.link-button {
  display: inline-flex; align-items: center; gap: 6px; border: 0; color: var(--ink-soft); background: transparent;
  padding: 5px; font-size: 12px; font-weight: 700;
}
.link-button:hover { color: var(--accent); }
.link-button svg { width: 14px; height: 14px; }

/* App shell and sidebar */
.app-shell { display: flex; width: 100%; height: 100%; min-height: 0; }
.sidebar {
  display: flex; width: var(--sidebar); flex: none; flex-direction: column; padding: 18px 14px 14px;
  overflow: hidden; background: linear-gradient(180deg, #f9ebdf 0%, #f5dfcf 100%); transition: width .2s ease, padding .2s ease, opacity .16s ease;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 7px 15px; }
.sidebar-close { display: none; }
.sidebar-collapse { display: grid; }
.sidebar-collapse .collapse-chevron { transform: rotate(90deg); }
.app-shell.sidebar-collapsed .sidebar { width: 0; padding-right: 0; padding-left: 0; opacity: 0; pointer-events: none; }
.app-shell.sidebar-collapsed .main-panel { margin-left: 8px; }
.sidebar-restore { position: absolute; z-index: 105; top: 12px; left: 12px; box-shadow: var(--shadow-sm); }
.workspace-switch {
  display: flex; width: 100%; align-items: center; gap: 10px; margin: 6px 0 18px; padding: 10px;
  border: 1px solid rgba(213,184,163,.55); border-radius: 12px; background: rgba(255,255,255,.47); text-align: left;
}
.workspace-switch:hover { background: rgba(255,255,255,.7); }
.workspace-switch > svg { width: 15px; height: 15px; color: var(--muted); }
.workspace-dot { width: 10px; height: 10px; flex: none; border: 3px solid #ffd0b8; border-radius: 50%; background: var(--accent); }
.workspace-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.workspace-copy small { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.workspace-copy b { overflow: hidden; margin-top: 2px; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; width: 100%; align-items: center; gap: 12px; border: 1px solid transparent; border-radius: 11px;
  padding: 10px 12px; color: #594e47; background: transparent; text-align: left; font-weight: 600;
}
.nav-item svg { width: 18px; height: 18px; color: #75675e; }
.nav-item:hover { background: rgba(255,255,255,.43); }
.nav-item.active { border-color: rgba(220,184,163,.48); color: var(--ink); background: rgba(255,255,255,.72); box-shadow: var(--shadow-sm); }
.nav-item.active svg { color: var(--accent); }
.sidebar-bottom { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.usage-meter {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 8px 1px; color: rgba(111, 93, 82, .62); font-size: 9px;
  letter-spacing: .015em; cursor: default; user-select: none;
}
.usage-meter b { color: rgba(84, 68, 59, .68); font-size: 9px; font-weight: 650; }
.side-status, .user-card {
  display: flex; width: 100%; align-items: center; gap: 10px; border: 1px solid rgba(216,190,171,.62);
  border-radius: 12px; padding: 10px; background: rgba(255,255,255,.54); text-align: left;
}
.side-status:hover, .user-card:hover { background: rgba(255,255,255,.78); }
.side-status > span:nth-child(2), .user-card > span:nth-child(2) { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.side-status b, .user-card b { font-size: 12px; }
.side-status small, .user-card small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.side-status > svg, .user-card > svg { width: 15px; height: 15px; color: var(--muted); }
.status-dot { width: 9px; height: 9px; flex: none; border: 2px solid #e9d4c4; border-radius: 50%; background: #ae9e92; }
.status-dot.online { border-color: #bfe6d9; background: #20a47d; }
.avatar { display: grid; width: 29px; height: 29px; place-items: center; flex: none; border-radius: 50%; color: #a34620; background: #ffdbc6; font-size: 11px; font-weight: 800; }

.main-panel {
  position: relative; min-width: 0; min-height: 0; flex: 1; margin: 8px 8px 8px 0;
  overflow: hidden; border: 1px solid rgba(227,210,197,.9); border-radius: 17px; background: var(--paper);
}
.mobile-header { display: none; }
.view { display: none; width: 100%; height: 100%; overflow: auto; }
.view.active { display: block; }

/* Home */
.home-view { background: linear-gradient(180deg, #fff 0, #fff 78%, #fefbf8 100%); }
.home-inner { width: min(960px, calc(100% - 64px)); margin: 0 auto; padding: 72px 0 80px; }
.welcome { margin: 4px 0 8px; text-align: center; font: 400 clamp(30px, 4vw, 42px)/1.15 Georgia, "Times New Roman", serif; letter-spacing: -.015em; }
.welcome-sub { margin: 0 0 34px; color: var(--muted); text-align: center; }
.prompt-box {
  position: relative; max-width: 900px; margin: 0 auto 54px; border: 1.5px solid var(--line-strong); border-radius: 19px;
  padding: 17px 17px 13px; background: #fff; box-shadow: 0 18px 50px -35px rgba(77,44,24,.5); transition: border .15s, box-shadow .15s;
}
.prompt-box:focus-within, .prompt-box.dragover { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(242,99,45,.09), var(--shadow); }
.prompt-box textarea { width: 100%; min-height: 68px; border: 0; outline: 0; padding: 1px 3px; resize: none; font-size: 15px; line-height: 1.5; }
.prompt-box textarea::placeholder, .chat-composer textarea::placeholder { color: #b3a69d; }
.prompt-toolbar { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.attachment-button { cursor: pointer; }
.pill-button {
  display: inline-flex; height: 36px; align-items: center; gap: 8px; border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 10px 4px 5px; background: var(--surface); font-size: 12px; font-weight: 700;
}
.pill-button:hover { background: var(--accent-soft); }
.pill-button .chevron { width: 13px; height: 13px; color: var(--muted); }
.mini-icon { display: inline-grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; }
.mini-icon svg { width: 14px; height: 14px; }
.mini-icon.coral { color: #d95125; background: #ffe0d0; }
.mini-icon.peach { color: #c36927; background: var(--peach); }
.mini-icon.blue { color: #3f73b9; background: var(--blue); }
.mini-icon.violet { color: #7452c7; background: var(--violet); }
.mini-icon.teal { color: #157e75; background: var(--teal); }
.agent-picker { position: relative; }
.popover {
  position: absolute; z-index: 80; min-width: 290px; border: 1px solid var(--line); border-radius: 14px;
  padding: 6px; background: #fff; box-shadow: 0 22px 60px -26px rgba(72,40,21,.55);
}
.agent-menu { left: 0; bottom: calc(100% + 8px); }
.agent-menu button {
  display: flex; width: 100%; align-items: center; gap: 10px; border: 0; border-radius: 10px;
  padding: 8px; background: transparent; text-align: left;
}
.agent-menu button:hover { background: var(--surface); }
.agent-menu button > span:last-child { display: flex; flex-direction: column; }
.agent-menu b { font-size: 12px; }
.agent-menu small { color: var(--muted); font-size: 10px; }
.prompt-hint { margin-left: auto; color: var(--muted-2); font-size: 11px; }
.send-button {
  display: grid; width: 36px; height: 36px; place-items: center; flex: none; border: 0; border-radius: 50%;
  color: #fff; background: var(--accent); box-shadow: 0 8px 20px -10px rgba(229,72,16,.8);
}
.send-button:hover { background: var(--accent-dark); transform: translateY(-1px); }
.send-button svg { width: 16px; height: 16px; stroke-width: 2.2; }
.drop-overlay {
  position: absolute; z-index: 10; display: none; inset: 0; place-items: center; border: 2px dashed var(--accent);
  border-radius: 17px; color: var(--accent); background: rgba(255,246,240,.96); font-weight: 800;
}
.prompt-box.dragover .drop-overlay { display: grid; }
.file-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.file-chips:not(:empty) { padding: 8px 0 3px; }
.file-chip {
  display: inline-flex; max-width: 260px; align-items: center; gap: 6px; border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 8px 5px 10px; color: var(--ink-soft); background: var(--surface); font-size: 11px;
}
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip button { display: grid; width: 18px; height: 18px; place-items: center; border: 0; border-radius: 50%; background: transparent; }
.file-chip button:hover { color: var(--danger); background: #fff; }
.file-chip svg { width: 11px; height: 11px; }
.home-section + .home-section { margin-top: 46px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 0 0 15px; }
.section-heading h2 { margin: 0; font-size: 18px; }
.section-note { color: var(--muted); font-size: 11px; }
.tool-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.tool-card {
  position: relative; display: grid; min-height: 130px; grid-column: span 2; grid-template-columns: 46px 1fr;
  gap: 12px; border: 1px solid var(--line); border-radius: 15px; padding: 16px; overflow: hidden;
  background: #fff; text-align: left; box-shadow: 0 8px 28px -28px rgba(72,39,19,.6); transition: transform .18s, border .18s, box-shadow .18s;
}
.tool-card:nth-child(4), .tool-card:nth-child(5),
.tool-card:nth-child(6), .tool-card:nth-child(7) { grid-column: span 3; }
.tool-card:hover { z-index: 2; border-color: #ddc5b5; transform: translateY(-2px); box-shadow: var(--shadow); }
.tool-icon, .panel-icon {
  display: grid; width: 46px; height: 46px; place-items: center; flex: none; border-radius: 13px;
}
.tool-icon svg, .panel-icon svg { width: 21px; height: 21px; }
.tool-icon.peach, .panel-icon.peach { color: #c36927; background: var(--peach); }
.tool-icon.coral, .panel-icon.coral { color: #d65024; background: #ffe2d3; }
.tool-icon.violet, .panel-icon.violet { color: #6e4fc1; background: var(--violet); }
.tool-icon.teal, .panel-icon.teal { color: #147c72; background: var(--teal); }
.tool-icon.blue, .panel-icon.blue { color: #3f73b9; background: var(--blue); }
.tool-copy { display: flex; min-width: 0; flex-direction: column; padding-top: 3px; }
.tool-copy b { font-size: 13px; line-height: 1.3; }
.tool-copy small { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.tool-badge {
  position: absolute; left: 16px; bottom: 13px; border-radius: 999px; padding: 3px 8px;
  color: var(--muted); background: var(--surface); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
}
.tool-badge.live { color: #0b7b5c; background: #e7f6f0; }
.tool-arrow { position: absolute; right: 14px; bottom: 13px; width: 16px; height: 16px; color: var(--muted-2); transition: transform .18s; }
.tool-card:hover .tool-arrow { color: var(--accent); transform: translateX(2px); }
.recent-list { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; }
.recent-row {
  display: flex; width: 100%; align-items: center; gap: 12px; border: 0; border-bottom: 1px solid var(--line);
  padding: 12px 14px; background: #fff; text-align: left;
}
.recent-row:last-child { border-bottom: 0; }
.recent-row:hover { background: var(--surface); }
.recent-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.recent-copy b { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.recent-copy small, .recent-date { color: var(--muted); font-size: 10px; }

/* Standard pages and projects */
.standard-view { padding: 46px clamp(28px, 5vw, 70px) 70px; background: #fff; }
.page-top { display: flex; max-width: 1120px; align-items: flex-start; justify-content: space-between; gap: 24px; margin: 0 auto 32px; }
.page-top h1 { margin: 0 0 7px; font: 400 36px/1.15 Georgia, "Times New Roman", serif; }
.page-top p:last-child { max-width: 670px; margin: 0; color: var(--muted); }
.filter-row { display: flex; max-width: 1120px; align-items: center; gap: 12px; margin: 0 auto 17px; }
.search-field {
  display: flex; width: min(360px, 100%); align-items: center; gap: 8px; border: 1px solid var(--line);
  border-radius: 11px; padding: 0 11px; background: #fff;
}
.search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242,99,45,.08); }
.search-field svg { width: 16px; height: 16px; color: var(--muted); }
.search-field input { width: 100%; border: 0; outline: 0; padding: 10px 0; }
.muted-count { margin-left: auto; color: var(--muted); font-size: 11px; }
.projects-grid { display: grid; max-width: 1120px; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0 auto; }
.project-card {
  position: relative; display: flex; min-height: 190px; flex-direction: column; border: 1px solid var(--line);
  border-radius: 16px; padding: 18px; background: #fff; box-shadow: 0 14px 35px -34px rgba(71,38,20,.7);
  transition: transform .17s, border .17s, box-shadow .17s;
}
.project-card:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.project-card.current { border-color: #efad8e; box-shadow: 0 0 0 3px rgba(242,99,45,.07); }
.project-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.project-glyph { display: grid; width: 39px; height: 39px; place-items: center; border-radius: 11px; color: #bb542b; background: var(--accent-soft); }
.project-glyph svg { width: 18px; height: 18px; }
.project-menu { border: 0; color: var(--muted); background: transparent; }
.project-menu svg { width: 18px; height: 18px; }
.project-card h3 { margin: 18px 0 5px; font-size: 15px; }
.project-card > p { display: -webkit-box; overflow: hidden; margin: 0; color: var(--muted); font-size: 11px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.project-stats { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 14px; color: var(--muted); font-size: 10px; }
.project-stats span { display: inline-flex; align-items: center; gap: 4px; }
.project-stats svg { width: 13px; height: 13px; }
.project-open { position: absolute; inset: 0; border: 0; border-radius: inherit; background: transparent; }
.project-card > *:not(.project-open) { position: relative; z-index: 1; pointer-events: none; }
.project-card .project-menu { pointer-events: auto; }
.context-pill {
  display: inline-flex; max-width: 280px; align-items: center; border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 13px; overflow: hidden; color: var(--ink-soft); background: var(--surface); font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap;
}
.empty-state { display: flex; align-items: center; justify-content: center; flex-direction: column; color: var(--muted); text-align: center; }
.empty-state.compact { min-height: 90px; flex-direction: row; gap: 12px; text-align: left; }
.empty-state span:last-child { display: flex; flex-direction: column; }
.empty-state b { color: var(--ink-soft); font-size: 12px; }
.empty-state small { margin-top: 4px; color: var(--muted); }
.empty-icon {
  display: grid; width: 38px; height: 38px; place-items: center; flex: none; border-radius: 12px; color: var(--muted); background: var(--surface);
}
.empty-icon.large { width: 54px; height: 54px; margin-bottom: 15px; border-radius: 16px; }
.empty-icon svg { width: 18px; height: 18px; }
.empty-icon.large svg { width: 23px; height: 23px; }

/* Chat */
.chat-view.active { display: flex; min-height: 0; flex-direction: column; background: #fefdfc; }
.chat-header {
  display: flex; min-height: 79px; align-items: center; gap: 12px; flex: none; border-bottom: 1px solid var(--line);
  padding: 12px clamp(18px, 4vw, 48px); background: rgba(255,255,255,.95);
}
.chat-title { min-width: 0; }
.chat-title h1 { margin: 0; font: 400 20px/1.2 Georgia, "Times New Roman", serif; }
.chat-title small { display: block; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.chat-header-actions { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.agent-mode-switch { display: inline-flex; align-items: center; gap: 2px; border: 1px solid #ead9cc; border-radius: 999px; padding: 3px; background: #f8f2ed; }
.agent-mode-switch button { border: 0; border-radius: 999px; padding: 6px 10px; color: var(--muted); background: transparent; font: inherit; font-size: 10px; font-weight: 700; cursor: pointer; }
.agent-mode-switch button.active { color: var(--ink); background: #fff; box-shadow: 0 2px 8px rgba(69,42,26,.08); }
.express-start { width: fit-content; margin-top: 14px; }
.approval-badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 6px 10px; color: var(--green); background: #e8f6f1; font-size: 10px; font-weight: 800; }
.approval-badge svg { width: 13px; height: 13px; }
.chat-messages {
  width: min(820px, calc(100% - 42px)); min-height: 0; flex: 1; align-self: center; overflow-y: auto;
  padding: 30px 0 160px; overscroll-behavior: contain; scroll-behavior: auto;
}
.chat-welcome { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 28px; padding: 4px; }
.chat-welcome h2 { margin: 2px 0 5px; font-size: 16px; }
.chat-welcome p { max-width: 620px; margin: 0; color: var(--ink-soft); font-size: 13px; }
.message { display: flex; gap: 10px; margin: 0 0 20px; }
.message.user { justify-content: flex-end; }
.message-avatar { display: grid; width: 28px; height: 28px; place-items: center; flex: none; border-radius: 9px; color: var(--accent-dark); background: var(--accent-soft); font-size: 10px; font-weight: 800; }
.message-body { max-width: min(700px, 86%); }
.message.user .message-body { border-radius: 16px 16px 4px 16px; padding: 11px 14px; background: var(--shell); }
.message.assistant .message-body { min-width: 0; flex: 1; padding-top: 2px; }
.message-content { color: var(--ink-soft); font-size: 15px; line-height: 1.66; }
.message.user .message-content { color: var(--ink); white-space: pre-wrap; }
.message.system { justify-content: center; margin: 8px 0 16px; }
.message.system .message-body { width: auto; max-width: min(92%, 620px); border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; color: var(--muted); background: rgba(255,255,255,.76); box-shadow: none; }
.message.system .message-content { display: flex; align-items: center; gap: 7px; font-size: 10px; line-height: 1.35; }
.message.system .message-content svg { width: 12px; height: 12px; flex: none; }
.message.system .message-foot { margin-top: 3px; }
.message-meta { margin-top: 5px; color: var(--muted-2); font-size: 9px; }
.message-files { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.message-file { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 7px; background: #fff; font-size: 9px; }
.message-file svg { width: 11px; height: 11px; }
.thinking { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; }
.thinking i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: bounce 1.1s infinite; }
.thinking i:nth-child(2) { animation-delay: .12s; }.thinking i:nth-child(3) { animation-delay: .24s; }
@keyframes bounce { 0%,60%,100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }
.chat-composer {
  position: absolute; z-index: 8; right: 0; bottom: 0; left: 0; width: min(820px, calc(100% - 42px)); margin: 0 auto 20px;
  border: 1.5px solid var(--line-strong); border-radius: 17px; padding: 11px 12px 9px; background: #fff;
  box-shadow: 0 18px 55px -24px rgba(63,35,18,.45);
}
.chat-composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242,99,45,.08), var(--shadow); }
.chat-composer textarea { width: 100%; min-height: 45px; max-height: 150px; border: 0; outline: 0; padding: 3px; resize: none; }
.composer-toolbar { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.composer-status { margin-left: 2px; color: var(--muted); font-size: 10px; }
.composer-status.is-thinking { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-soft); }
.composer-status.is-thinking::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: thinking-pulse 1.15s ease-in-out infinite; }
.composer-status.is-error { color: #a23b2b; }
.chat-run-error { display: flex; align-items: center; gap: 10px; margin: 6px 0 22px 38px; border: 1px solid #efc8bf; border-radius: 13px; padding: 11px 12px; color: #7f2f22; background: #fff6f3; }
.chat-run-error > svg { width: 17px; height: 17px; flex: none; }
.chat-run-error > div { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 2px; }
.chat-run-error b { font-size: 11px; }
.chat-run-error small { overflow: hidden; color: #95665d; font-size: 10px; text-overflow: ellipsis; }
@keyframes thinking-pulse { 0%,100% { transform: scale(.72); opacity: .42; } 50% { transform: scale(1); opacity: 1; } }
.composer-toolbar .send-button { margin-left: auto; }

/* Research and converter */
.two-column, .converter-layout { display: grid; max-width: 1120px; grid-template-columns: minmax(300px, .82fr) minmax(380px, 1.25fr); gap: 18px; margin: 0 auto; }
.task-panel, .result-panel { border: 1px solid var(--line); border-radius: 18px; padding: 24px; background: #fff; box-shadow: 0 14px 45px -38px rgba(77,42,22,.55); }
.task-panel h2, .result-panel h2 { margin: 14px 0 7px; font-size: 17px; }
.task-panel > p { margin: 0 0 22px; color: var(--muted); font-size: 12px; }
.task-panel textarea { min-height: 150px; margin-bottom: 15px; }
.check-row {
  display: flex; align-items: flex-start; gap: 9px; margin-bottom: 20px; border-radius: 10px; padding: 9px; background: var(--surface); cursor: pointer;
}
.check-row input { margin: 3px 0 0; accent-color: var(--accent); }
.check-row span { display: flex; flex-direction: column; }
.check-row b { font-size: 11px; }
.check-row small { color: var(--muted); font-size: 9px; }
.result-panel { display: flex; min-height: 500px; min-width: 0; flex-direction: column; }
.result-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.result-panel-head h2 { margin: 0; }
.inline-actions, .focus-actions { display: flex; align-items: center; gap: 6px; }
.result-body { min-height: 0; flex: 1; padding-top: 18px; overflow: auto; }
.job-progress { display: flex; height: 100%; align-items: center; justify-content: center; flex-direction: column; text-align: center; }
.job-progress .loader { margin-bottom: 15px; }
.job-progress b { font-size: 13px; }
.job-progress small { max-width: 350px; margin-top: 5px; color: var(--muted); }
.loader { width: 28px; height: 28px; border: 3px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.converter-layout { grid-template-columns: minmax(340px, .9fr) minmax(360px, 1.1fr); }
.file-drop {
  display: flex; min-height: 220px; align-items: center; justify-content: center; flex-direction: column;
  border: 1.5px dashed #dfc9b9; border-radius: 16px; padding: 24px; background: var(--surface);
  text-align: center; cursor: pointer; transition: border .15s, background .15s, transform .15s;
}
.file-drop:hover, .file-drop.dragover { border-color: var(--accent); background: #fff7f1; transform: translateY(-1px); }
.drop-icon { display: grid; width: 48px; height: 48px; place-items: center; margin-bottom: 12px; border-radius: 15px; color: var(--accent); background: var(--accent-soft); }
.drop-icon svg { width: 22px; height: 22px; }
.file-drop b { font-size: 13px; }
.file-drop small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.selected-file { max-width: 100%; margin-top: 13px; overflow: hidden; color: var(--accent-dark); font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.converter-panel .button { margin-top: 15px; }
.artifact-success { display: flex; height: 100%; align-items: center; justify-content: center; flex-direction: column; text-align: center; }
.success-icon { display: grid; width: 56px; height: 56px; place-items: center; margin-bottom: 14px; border-radius: 50%; color: var(--green); background: #e6f6f0; }
.success-icon svg { width: 25px; height: 25px; }
.artifact-success h3 { margin: 0 0 4px; font-size: 15px; }
.artifact-success p { margin: 0 0 15px; color: var(--muted); font-size: 11px; }

/* Markdown */
.markdown { min-width: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.markdown h1 { margin: 12px 0 8px; color: var(--ink); font: 400 27px/1.25 Georgia, "Times New Roman", serif; }
.markdown h2 { margin: 22px 0 8px; color: var(--ink); font-size: 17px; }
.markdown h3 { margin: 17px 0 6px; color: var(--ink); font-size: 14px; }
.markdown p { margin: 7px 0; }
.markdown ul, .markdown ol { margin: 7px 0; padding-left: 22px; }
.markdown li { margin: 3px 0; }
.markdown strong { color: var(--ink); }
.markdown em { color: var(--muted); }
.markdown a { color: var(--accent-dark); text-decoration: underline; text-decoration-color: #f5b395; text-underline-offset: 2px; }
.markdown blockquote { margin: 12px 0; border-left: 3px solid var(--accent); border-radius: 0 9px 9px 0; padding: 9px 13px; color: var(--ink); background: #fff6f0; }
.markdown code { border-radius: 4px; padding: 2px 5px; background: #f3eee9; font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
.markdown pre { overflow: auto; border-radius: 10px; padding: 12px; background: #2f2926; color: #fff; }
.markdown pre code { padding: 0; color: inherit; background: transparent; }
.markdown table { width: 100%; margin: 12px 0; border-collapse: collapse; font-size: 13px; }
.markdown th, .markdown td { border: 1px solid var(--line); padding: 7px 8px; text-align: left; vertical-align: top; }
.markdown th { color: var(--ink); background: var(--surface); }
.markdown hr { margin: 20px 0; border: 0; border-top: 1px solid var(--line); }

/* Board */
.board-view.active { display: block; overflow: hidden; }
.board-viewport { position: relative; width: 100%; height: 100%; overflow: hidden; background-color: #fbf8f5; background-image: radial-gradient(#dbcfc5 1px, transparent 1px); background-size: 23px 23px; cursor: grab; user-select: none; }
.board-viewport.panning { cursor: grabbing; }
.board-canvas { position: absolute; left: 0; top: 0; width: 1px; height: 1px; transform-origin: 0 0; }
.board-empty { position: absolute; left: 50%; top: 50%; display: flex; align-items: center; flex-direction: column; transform: translate(-50%,-50%); color: var(--muted); text-align: center; pointer-events: none; }
.board-empty b { margin-bottom: 4px; color: var(--ink-soft); }
.board-empty small { font-size: 11px; }
.board-topbar {
  position: absolute; z-index: 10; top: 14px; left: 14px; right: 14px; display: flex; align-items: center; gap: 9px;
  pointer-events: none;
}
.board-topbar > * { pointer-events: auto; }
.board-title {
  display: flex; min-width: 0; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 11px;
  padding: 7px 12px; background: rgba(255,255,255,.94); box-shadow: var(--shadow-sm); backdrop-filter: blur(8px);
}
.board-title > svg { width: 17px; height: 17px; color: var(--accent); }
.board-title span { display: flex; min-width: 0; flex-direction: column; }
.board-title small { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.board-title b { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.board-topbar .button { margin-left: auto; }
.board-controls {
  position: absolute; z-index: 10; right: 14px; bottom: 14px; display: flex; height: 38px; align-items: center;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px; background: rgba(255,255,255,.96); box-shadow: var(--shadow-sm);
}
.board-controls button { display: grid; width: 29px; height: 29px; place-items: center; border: 0; border-radius: 50%; background: transparent; }
.board-controls button:hover { color: var(--accent); background: var(--surface); }
.board-controls button svg { width: 14px; height: 14px; }
.board-controls span { min-width: 44px; color: var(--ink-soft); font-size: 10px; text-align: center; }
.board-controls i { width: 1px; height: 18px; margin: 0 3px; background: var(--line); }
.board-tip {
  position: absolute; z-index: 10; bottom: 15px; left: 16px; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 11px; color: var(--muted); background: rgba(255,255,255,.92); font-size: 9px;
}
.board-tip svg { width: 13px; height: 13px; }
.board-card {
  position: absolute; display: flex; width: 330px; min-height: 210px; max-height: 430px; flex-direction: column;
  overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 17px 40px -30px rgba(56,31,17,.7);
  transition: border .12s, box-shadow .12s;
}
.board-card:hover { border-color: #dfc7b7; box-shadow: var(--shadow); }
.board-card.dragging { z-index: 9; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242,99,45,.1), var(--shadow); }
.board-card-head { display: flex; align-items: center; gap: 8px; flex: none; border-bottom: 1px solid var(--line); padding: 9px 10px; cursor: move; }
.board-card-head .mini-icon { width: 27px; height: 27px; flex: none; border-radius: 8px; }
.board-card-title { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.board-card-title b { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.board-card-title small { color: var(--muted); font-size: 8px; }
.board-card-menu { display: grid; width: 27px; height: 27px; place-items: center; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; }
.board-card-menu:hover { background: var(--surface); }
.board-card-menu svg { width: 14px; height: 14px; }
.board-card-body { min-height: 0; flex: 1; padding: 13px; overflow: auto; overscroll-behavior: contain; user-select: text; cursor: grab; }
.board-card-body .markdown { font-size: 10px; line-height: 1.55; }
.board-card-body .markdown h1 { font-size: 16px; }.board-card-body .markdown h2 { margin: 9px 0 4px; font-size: 12px; }.board-card-body .markdown h3 { margin: 7px 0 3px; font-size: 11px; }
.board-card-foot { display: flex; align-items: center; gap: 6px; flex: none; border-top: 1px solid var(--line); padding: 8px 10px; }
.board-card-foot button, .board-card-foot a {
  display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 8px;
  padding: 5px 7px; color: var(--ink-soft); background: #fff; text-decoration: none; font-size: 8px; font-weight: 800;
}
.board-card-foot button:hover, .board-card-foot a:hover { color: var(--accent); background: var(--surface); }
.board-card-foot svg { width: 11px; height: 11px; }
.board-card-status { margin-left: auto; color: var(--muted); font-size: 8px; }
.board-card-updated { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 6px; color: #8a651a; background: #fff4cf; font-size: 8px; font-weight: 800; }
.board-card.has-recent-edits { border-color: #ead6a3; }
.board-card.has-recent-edits .board-card-body { background: linear-gradient(180deg, rgba(255,250,235,.52), #fff 58px); }

/* Dialogs */
.modal {
  width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; border: 0; padding: 24px;
  background: transparent;
}
.modal[open] { display: grid; place-items: center; }
.modal::backdrop { background: rgba(39,31,27,.42); backdrop-filter: blur(3px); }
.modal-card {
  width: min(470px, 100%); max-height: calc(100vh - 48px); overflow: auto; border: 1px solid var(--line);
  border-radius: 22px; padding: 25px; background: #fff; box-shadow: 0 35px 100px -40px rgba(44,25,15,.7);
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.modal-head h2 { margin: 0; font: 400 25px/1.15 Georgia, "Times New Roman", serif; }
.modal-card > .field-label { margin-top: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.compact-drop { min-height: 170px; margin-top: 20px; }
.focus-modal { padding: 32px; }
.focus-card {
  display: flex; width: min(1000px, 100%); height: min(820px, calc(100vh - 64px)); flex-direction: column;
  overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: 0 35px 100px -40px rgba(44,25,15,.7);
}
.focus-head { display: flex; align-items: center; gap: 11px; flex: none; border-bottom: 1px solid var(--line); padding: 14px 18px; }
.focus-head > div:nth-child(2) { min-width: 0; flex: 1; }
.focus-head h2 { overflow: hidden; margin: 0; font: 400 19px/1.2 Georgia, "Times New Roman", serif; text-overflow: ellipsis; white-space: nowrap; }
.focus-head small { color: var(--muted); font-size: 9px; }
.focus-body { min-height: 0; flex: 1; overflow: auto; padding: 28px clamp(22px, 6vw, 70px) 60px; }
.markdown-editor { width: 100%; min-height: 100%; border: 1px solid var(--line); border-radius: 12px; outline: 0; padding: 18px; font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; resize: none; }
.markdown-editor:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242,99,45,.08); }
.picker-card { width: min(560px, 100%); }
.picker-list { display: flex; max-height: 480px; flex-direction: column; gap: 7px; overflow: auto; }
.picker-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 11px; padding: 9px; background: #fff; text-align: left; }
.picker-item:hover { border-color: var(--accent); background: var(--surface); }
.picker-item > span:nth-child(2) { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.picker-item b { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.picker-item small { color: var(--muted); font-size: 9px; }
.picker-item > svg { width: 15px; height: 15px; color: var(--muted); }
.telegram-body { display: flex; min-height: 240px; align-items: center; justify-content: center; flex-direction: column; text-align: center; }
.telegram-body p { color: var(--muted); }
.telegram-body img { width: 210px; height: 210px; object-fit: contain; image-rendering: pixelated; }
.telegram-body .button { margin-top: 12px; }
.toast-region { position: fixed; z-index: 300; right: 20px; top: 68px; display: flex; width: min(360px, calc(100% - 40px)); flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: flex-start; gap: 9px; border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px;
  color: var(--ink-soft); background: rgba(255,255,255,.96); box-shadow: var(--shadow); animation: toast-in .2s ease-out; backdrop-filter: blur(8px);
}
.toast.error { border-color: #f0c2ba; color: var(--danger); background: rgba(255,247,245,.97); }
.toast.success { border-color: #bfe2d5; color: #126d54; background: rgba(247,255,252,.97); }
.toast svg { width: 17px; height: 17px; flex: none; }
.toast span { font-size: 11px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-7px); } }

/* 0.3 visual system — aligned with the supplied VELES references */
.sidebar {
  padding: 20px 12px 14px;
  background: #fcf1e7;
  border-right: 1px solid #eadfd5;
}
.sidebar-head { padding: 0 12px 24px; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: #ff5d1c; box-shadow: none; }
.brand b { font-size: 17px; }
.brand small { color: #a38e80; }
.workspace-switch { min-height: 68px; margin: 4px 0 20px; padding: 12px 13px; border-radius: 16px; background: rgba(255,255,255,.52); }
.workspace-copy small { font-size: 10px; letter-spacing: .1em; }
.workspace-copy b { font-size: 13px; }
.nav { gap: 2px; }
.nav-item { min-height: 48px; gap: 14px; border-radius: 12px; padding: 11px 14px; font-size: 16px; font-weight: 500; }
.nav-item svg { width: 20px; height: 20px; }
.nav-item.active { border-color: #ead5c5; background: #fde9df; box-shadow: none; }
.side-status, .user-card { min-height: 58px; border-radius: 14px; padding: 11px 14px; background: rgba(255,255,255,.68); }
.side-status b, .user-card b { font-size: 14px; }
.side-status small, .user-card small { font-size: 11px; }
.main-panel { margin: 0 8px 8px 0; border-radius: 20px; border-color: #eadfd5; }

.home-inner { width: min(1024px, calc(100% - 64px)); padding: 108px 0 84px; }
.home-inner > .eyebrow, .home-inner > .welcome-sub { display: none; }
.welcome { margin: 0 0 48px; font-size: clamp(36px, 3.2vw, 44px); }
.prompt-box { max-width: 1024px; min-height: 198px; margin-bottom: 70px; border-color: #ead7c8; border-radius: 20px; padding: 20px 20px 14px; box-shadow: none; }
.prompt-box textarea { min-height: 105px; font: 400 18px/1.55 Georgia, "Times New Roman", serif; }
.prompt-toolbar { margin-top: 8px; }
.home-section { max-width: 1024px; margin-right: auto; margin-left: auto; }
.home-section + .home-section { margin-top: 58px; }
.section-heading { margin-bottom: 18px; }
.section-heading .eyebrow { display: none; }
.section-heading h2 { font-size: 20px; }
.tool-grid { display: block; overflow: hidden; border: 1px solid #ead9cc; border-radius: 16px; background: #fff; }
.tool-card, .tool-card:nth-child(4), .tool-card:nth-child(5),
.tool-card:nth-child(6), .tool-card:nth-child(7) {
  display: grid; width: 100%; min-height: 92px; grid-template-columns: 54px minmax(0, 1fr) auto 18px;
  align-items: center; gap: 14px; border: 0; border-bottom: 1px solid #eadfd5; border-radius: 0;
  padding: 14px 20px; box-shadow: none; transform: none;
}
.tool-card:last-child { border-bottom: 0; }
.tool-card:hover { border-color: #eadfd5; background: #fefaf7; box-shadow: none; transform: none; }
.tool-card .tool-icon { width: 50px; height: 50px; }
.tool-copy { padding: 0; }
.tool-copy b { font-size: 16px; }
.tool-copy small { font-size: 14px; }
.tool-badge { position: static; justify-self: end; font-size: 10px; }
.tool-arrow { position: static; width: 17px; height: 17px; }
.recent-list { border-radius: 16px; }
.recent-row { min-height: 74px; padding: 12px 18px; }
.recent-copy b { font-size: 14px; }
.recent-copy small, .recent-date { font-size: 11px; }

.standard-view { padding: 72px clamp(30px, 6vw, 96px) 80px; }
.page-top, .filter-row, .projects-grid { max-width: 1024px; }
.page-top h1 { font-size: 42px; }
.page-top p:last-child { font-size: 16px; }
.projects-grid { gap: 16px; }
.project-card { min-height: 210px; border-radius: 17px; padding: 20px; box-shadow: none; }
.project-card h3 { font-size: 17px; }
.project-card > p { font-size: 13px; }

.agents-view { padding-top: 116px; }
.agents-hero { display: flex; max-width: 1024px; min-height: 220px; align-items: center; justify-content: space-between; gap: 40px; margin: 0 auto 40px; border-radius: 22px; padding: 36px 44px; background: #ffe0d1; }
.agents-hero > div { max-width: 670px; }
.agents-hero h1 { margin: 0 0 10px; font: 400 40px/1.15 Georgia, "Times New Roman", serif; }
.agents-hero p:last-child { margin: 0; color: #6f584c; font: 17px/1.55 Georgia, "Times New Roman", serif; }
.agents-hero-icon { display: grid; width: 112px; height: 112px; place-items: center; flex: none; color: #ff6526; }
.agents-hero-icon svg { width: 96px; height: 96px; stroke-width: 1.4; }
.agents-heading { max-width: 1024px; margin-right: auto; margin-left: auto; }
.agents-heading p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.agents-grid { display: grid; max-width: 1024px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 0 auto; }
.agent-card { display: flex; min-height: 270px; flex-direction: column; border: 1px solid #ead9cc; border-radius: 17px; padding: 24px; background: #fff; }
.agent-card h3 { margin: 18px 0 12px; font-size: 18px; }
.agent-card p { margin: 0; color: #8d7668; font: 15px/1.55 Georgia, "Times New Roman", serif; }
.agent-card .link-button { align-self: flex-end; margin-top: auto; color: #ff5d1c; font-size: 13px; }

.chat-header { min-height: 112px; padding: 14px clamp(22px, 4vw, 60px); }
.chat-title h1 { font-size: 26px; }
.chat-title small { font-size: 12px; }
.chat-messages { width: min(900px, calc(100% - 48px)); padding-top: 34px; padding-bottom: 190px; }
.message-content { font-size: 15px; line-height: 1.7; }
.message.assistant .message-body { max-width: 820px; }
.chat-composer { width: min(1028px, calc(100% - 40px)); margin-bottom: 22px; border-color: #ff6a2c; border-radius: 22px; padding: 16px; }
.chat-composer textarea { min-height: 68px; font: 17px/1.5 Georgia, "Times New Roman", serif; }
.composer-toolbar { gap: 10px; }
.artifact-select-wrap { display: inline-flex; min-width: 0; max-width: 340px; height: 38px; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 0 10px; color: var(--ink-soft); background: #fff; }
.artifact-select-wrap > svg { width: 15px; height: 15px; flex: none; }
.artifact-select-wrap select { min-width: 0; max-width: 290px; border: 0; outline: 0; color: var(--ink-soft); background: transparent; font-size: 12px; }
.artifact-chips:not(:empty) { border-bottom: 1px solid #f0e3d9; padding-bottom: 10px; }
.selected-artifact { color: #7652bd; background: #f6f2ff; }

.workflow-view { padding-top: 72px; }
.workflow-page-top { margin-bottom: 28px; }
.workflow-layout { display: grid; max-width: 1180px; grid-template-columns: 330px minmax(0, 1fr); gap: 18px; margin: 0 auto; }
.workflow-upload-card { display: flex; min-height: 480px; flex-direction: column; border: 1px solid #ead9cc; border-radius: 18px; padding: 24px; background: #fff; }
.workflow-upload-card h2 { margin: 14px 0 7px; font: 400 28px/1.2 Georgia, "Times New Roman", serif; }
.workflow-upload-card p { margin: 0; color: var(--muted); font-size: 13px; }
.workflow-upload-card .file-drop { min-height: 178px; margin: 24px 0 18px; border-style: dashed; border-radius: 16px; background: #fefaf7; }
.workflow-upload-card .button { margin-top: auto; }
.workflow-canvas-shell { display: flex; min-width: 0; min-height: 480px; flex-direction: column; overflow: hidden; border: 1px solid #ead9cc; border-radius: 18px; background: #fbfaf9; }
.workflow-canvas { position: relative; display: grid; min-height: 380px; flex: 1; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; gap: 46px; padding: 54px 28px; background-color: #fcfbfa; background-image: radial-gradient(#dacfc8 1px, transparent 1px); background-size: 18px 18px; }
.workflow-node { position: relative; z-index: 2; display: flex; min-width: 0; min-height: 184px; flex-direction: column; align-items: flex-start; border: 1px solid #dfd5ce; border-radius: 15px; padding: 18px; background: #fff; box-shadow: 0 12px 28px -25px rgba(53,34,24,.75); transition: border .2s, box-shadow .2s, transform .2s; }
.workflow-node .node-number { position: absolute; top: -11px; left: -9px; display: grid; width: 25px; height: 25px; place-items: center; border: 1px solid #dacdc4; border-radius: 50%; color: #8b776a; background: #fff; font-size: 10px; font-weight: 800; }
.workflow-node > div { display: flex; min-width: 0; flex-direction: column; margin-top: 13px; }
.workflow-node small { color: #a28f82; font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.workflow-node b { margin-top: 4px; font-size: 14px; line-height: 1.28; }
.workflow-node p { margin: 5px 0 0; color: #9b887b; font-size: 11px; }
.node-status { margin-top: auto; border-radius: 999px; padding: 4px 8px; color: #8e7e73; background: #f5f0ec; font-size: 9px; font-weight: 800; }
.workflow-node.running { border-color: #ff814c; box-shadow: 0 0 0 4px rgba(255,93,28,.1), 0 22px 40px -30px rgba(110,50,23,.7); transform: translateY(-2px); animation: workflow-node-pulse 1.8s ease-in-out infinite; }
.workflow-node.running .node-status { color: #d84b1c; background: #ffeadf; }
.workflow-node.completed { border-color: #9fd7c5; }
.workflow-node.completed .node-status { color: #0e7c5c; background: #e2f5ee; }
.workflow-node.failed { border-color: #ecaaa0; }
.workflow-node.failed .node-status { color: #ac3127; background: #fff0ed; }
.workflow-connection { position: absolute; z-index: 1; top: 50%; height: 2px; background: #d9cec6; transform: translateY(-1px); }
.workflow-connection::after { position: absolute; top: -4px; right: -1px; width: 8px; height: 8px; border-top: 2px solid #d9cec6; border-right: 2px solid #d9cec6; content: ""; transform: rotate(45deg); }
.connection-one { left: 29%; width: 11.5%; }
.connection-two { left: 62.3%; width: 11.5%; }
.workflow-connection i { position: absolute; top: -3px; left: 0; display: none; width: 8px; height: 8px; border-radius: 50%; background: #ff5d1c; box-shadow: 0 0 0 5px rgba(255,93,28,.12); animation: workflow-travel 1.35s linear infinite; }
.workflow-canvas[data-active-step="brief_master"] .connection-one i,
.workflow-canvas[data-active-step="creative_strategy"] .connection-two i { display: block; }
.workflow-summary { display: flex; min-height: 98px; align-items: flex-start; gap: 12px; border-top: 1px solid #eadfd5; padding: 18px 22px; background: #fff; }
.workflow-summary > div { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.workflow-summary b { font-size: 14px; }
.workflow-summary small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.workflow-summary.running .status-dot, .workflow-summary.queued .status-dot { border-color: #ffd0bb; background: #ff6a2c; animation: status-blink 1.2s ease-in-out infinite; }
.workflow-summary.completed .status-dot { border-color: #bfe6d9; background: #20a47d; }
.workflow-summary.failed .status-dot { border-color: #f3c0b8; background: #c74638; }
.workflow-result-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.workflow-result-link { display: inline-flex; align-items: center; gap: 5px; border: 1px solid #eadfd5; border-radius: 999px; padding: 5px 9px; color: #6f5e54; background: #fff; font-size: 10px; }
.workflow-result-link:hover { color: #ff5d1c; }
.workflow-result-link svg { width: 12px; height: 12px; }
.workflow-history-section { max-width: 1180px; margin: 38px auto 0; }
.workflow-history-section .section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.workflow-history { overflow: hidden; border: 1px solid #ead9cc; border-radius: 16px; }
.workflow-history-row { display: grid; width: 100%; min-height: 68px; grid-template-columns: 12px minmax(0, 1fr) auto 18px; align-items: center; gap: 12px; border: 0; border-bottom: 1px solid #eadfd5; padding: 10px 16px; background: #fff; text-align: left; }
.workflow-history-row:last-child { border-bottom: 0; }
.workflow-history-row:hover, .workflow-history-row.active { background: #fef8f4; }
.workflow-history-row > span:nth-child(2) { display: flex; flex-direction: column; }
.workflow-history-row b { font-size: 13px; }
.workflow-history-row small, .workflow-history-row > span:nth-child(3) { color: var(--muted); font-size: 10px; }
.workflow-history-status { width: 10px; height: 10px; border-radius: 50%; background: #b5a79e; }
.workflow-history-status.running, .workflow-history-status.queued { background: #ff6a2c; }
.workflow-history-status.completed { background: #20a47d; }
.workflow-history-status.failed { background: #c74638; }
@keyframes workflow-travel { from { transform: translateX(0); } to { transform: translateX(78px); } }
@keyframes workflow-node-pulse { 50% { box-shadow: 0 0 0 7px rgba(255,93,28,.06), 0 22px 40px -30px rgba(110,50,23,.7); } }
@keyframes status-blink { 50% { opacity: .45; } }

/* 0.3.1 compact/minimal pass */
:root {
  --sidebar: 254px;
  --radius-sm: 8px;
  --radius: 13px;
  --radius-lg: 18px;
  --shadow-sm: 0 5px 18px -16px rgba(82, 49, 29, .22);
  --shadow: 0 14px 38px -30px rgba(82, 49, 29, .28);
}
body { font-size: 14px; }
.button { min-height: 36px; border-radius: 9px; padding: 7px 13px; font-size: 12px; box-shadow: none !important; }
.icon-button { width: 34px; height: 34px; border-radius: 9px; }
.send-button { width: 34px; height: 34px; box-shadow: none; }
.context-pill { padding: 6px 10px; font-size: 10px; }

.sidebar { padding: 14px 10px 10px; }
.sidebar-head { padding: 0 8px 14px; }
.brand { gap: 8px; }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; font-size: 15px; }
.brand b { font-size: 14px; }
.brand small { font-size: 8px; }
.workspace-switch { min-height: 54px; margin: 2px 0 12px; padding: 8px 10px; border-radius: 12px; }
.workspace-copy small { font-size: 8px; }
.workspace-copy b { font-size: 11px; }
.nav-item { min-height: 39px; gap: 11px; border-radius: 9px; padding: 8px 10px; font-size: 13px; }
.nav-item svg { width: 17px; height: 17px; }
.side-status, .user-card { min-height: 48px; border-radius: 10px; padding: 8px 10px; }
.side-status b, .user-card b { font-size: 12px; }
.side-status small, .user-card small { font-size: 9px; }
.avatar { width: 25px; height: 25px; font-size: 9px; }
.main-panel { margin: 0 5px 5px 0; border-radius: 14px; }

.home-inner { width: min(880px, calc(100% - 48px)); padding: 76px 0 64px; }
.welcome { margin-bottom: 34px; font-size: clamp(29px, 2.7vw, 35px); }
.prompt-box { max-width: 840px; min-height: 156px; margin-bottom: 48px; border-width: 1px; border-radius: 15px; padding: 15px 15px 10px; }
.prompt-box textarea { min-height: 78px; font-size: 15px; }
.prompt-hint, .section-note, .tool-badge { display: none; }
.home-section { max-width: 840px; }
.home-section + .home-section { margin-top: 38px; }
.section-heading { margin-bottom: 12px; }
.section-heading h2 { font-size: 16px; }
.tool-grid { border-radius: 12px; }
.tool-card, .tool-card:nth-child(4), .tool-card:nth-child(5),
.tool-card:nth-child(6), .tool-card:nth-child(7) {
  min-height: 72px;
  grid-template-columns: 42px minmax(0, 1fr) 14px;
  gap: 11px;
  padding: 10px 13px;
}
.tool-card .tool-icon { width: 40px; height: 40px; border-radius: 10px; }
.tool-icon svg, .panel-icon svg { width: 18px; height: 18px; }
.tool-copy b { font-size: 13px; font-weight: 650; }
.tool-copy small { margin-top: 2px; font-size: 11px; }
.recent-list { border-radius: 12px; }
.recent-row { min-height: 60px; padding: 9px 13px; }
.recent-copy b { font-size: 12px; }
.recent-copy small, .recent-date { font-size: 9px; }

.standard-view { padding: 56px clamp(24px, 5vw, 72px) 60px; }
.page-top, .filter-row, .projects-grid { max-width: 920px; }
.page-top { margin-bottom: 24px; }
.page-top h1 { margin-bottom: 5px; font-size: 34px; }
.page-top p:last-child { font-size: 13px; }
.projects-grid { gap: 11px; }
.project-card { min-height: 168px; border-radius: 13px; padding: 15px; }
.project-card h3 { margin-top: 13px; font-size: 14px; }
.project-card > p { font-size: 11px; }
.project-stats { padding-top: 10px; font-size: 9px; }

.agents-view { padding-top: 72px; }
.agents-hero { max-width: 920px; min-height: 0; margin-bottom: 28px; border-radius: 0; padding: 0; background: transparent; }
.agents-hero .eyebrow, .agents-hero-icon { display: none; }
.agents-hero h1 { margin-bottom: 6px; font-size: 34px; }
.agents-hero p:last-child { max-width: 620px; color: var(--muted); font: 13px/1.55 Inter, ui-sans-serif, system-ui, sans-serif; }
.agents-heading, .agents-grid { max-width: 920px; }
.agents-heading p { font-size: 11px; }
.agents-grid { gap: 12px; }
.agent-card { min-height: 210px; border-radius: 13px; padding: 18px; }
.agent-card .tool-icon { width: 40px; height: 40px; border-radius: 10px; }
.agent-card h3 { margin: 13px 0 7px; font-size: 15px; }
.agent-card p { font: 12px/1.5 Inter, ui-sans-serif, system-ui, sans-serif; }
.agent-card .link-button { font-size: 11px; }

.chat-header { min-height: 86px; padding: 10px clamp(18px, 3vw, 42px); }
.chat-header > .tool-icon { width: 40px; height: 40px; }
.chat-title h1 { font-size: 21px; }
.chat-title small { font-size: 10px; }
.chat-messages { width: min(820px, calc(100% - 40px)); padding-top: 24px; padding-bottom: 154px; }
.chat-welcome { padding: 17px; }
.message-content { font-size: 13px; line-height: 1.65; }
.message.assistant .message-body { max-width: 740px; }
.chat-composer { width: min(900px, calc(100% - 32px)); margin-bottom: 14px; border-radius: 16px; padding: 12px; }
.chat-composer textarea { min-height: 52px; font-size: 14px; }
.artifact-select-wrap { height: 34px; max-width: 300px; }
.artifact-select-wrap select { max-width: 250px; font-size: 10px; }

.workflow-view { padding-top: 48px; }
.workflow-page-top { max-width: 920px; margin-bottom: 20px; }
.workflow-page-top .eyebrow, #workflowProjectPill { display: none; }
.workflow-page-top h1 { font-size: 34px; }
.workflow-page-top p:last-child { max-width: 610px; font-size: 13px; }
.workflow-layout { max-width: 920px; grid-template-columns: 260px minmax(0, 1fr); gap: 12px; }
.workflow-upload-card { min-height: 350px; border-radius: 13px; padding: 17px; }
.workflow-upload-card > .panel-icon, .workflow-upload-card .eyebrow { display: none; }
.workflow-upload-card h2 { margin: 0 0 5px; font-size: 22px; }
.workflow-upload-card p { font-size: 11px; }
.workflow-upload-card .file-drop { min-height: 126px; margin: 16px 0 12px; border-radius: 11px; background: #fff; }
.workflow-upload-card .file-drop .drop-icon { width: 38px; height: 38px; }
.workflow-upload-card .file-drop b { max-width: 190px; font-size: 11px; }
.workflow-upload-card .file-drop small { font-size: 9px; }
.workflow-canvas-shell { min-height: 350px; border-radius: 13px; background: #fbfaf9; }
.workflow-canvas { min-height: 286px; gap: 25px; padding: 32px 18px; background: #fbfaf9; background-image: none; }
.workflow-node { min-height: 138px; border-radius: 11px; padding: 13px; box-shadow: none; }
.workflow-node .node-number, .workflow-node > div > small { display: none; }
.workflow-node > .tool-icon { width: 36px; height: 36px; border-radius: 9px; }
.workflow-node > div { margin-top: 9px; }
.workflow-node b { margin-top: 0; font-size: 12px; font-weight: 650; }
.workflow-node p { margin-top: 3px; font-size: 9px; }
.node-status { display: inline-flex; align-items: center; gap: 5px; padding: 0; color: #938278; background: transparent !important; font-size: 8px; }
.node-status::before { width: 5px; height: 5px; border-radius: 50%; background: #b7aaa2; content: ""; }
.workflow-node.running .node-status::before { background: #ff6a2c; }
.workflow-node.completed .node-status::before { background: #20a47d; }
.workflow-node.failed .node-status::before { background: #c74638; }
.workflow-node.running { box-shadow: 0 0 0 3px rgba(255,93,28,.07); transform: none; }
.workflow-connection { height: 1px; background: #ddd5cf; }
.workflow-connection::after { display: none; }
.connection-one { left: 30.2%; width: 10.3%; }
.connection-two { left: 63.6%; width: 10.3%; }
.workflow-summary { min-height: 64px; padding: 12px 16px; }
.workflow-summary.empty { display: none; }
.workflow-summary b { font-size: 11px; }
.workflow-summary small { font-size: 9px; }
.workflow-result-links { margin-top: 6px; }
.workflow-history-section { max-width: 920px; margin-top: 26px; }
.workflow-history-section.is-empty { display: none; }
.workflow-history-row { min-height: 54px; padding: 7px 12px; }
.workflow-history-row b { font-size: 11px; }
.workflow-history-row small, .workflow-history-row > span:nth-child(3) { font-size: 8px; }

/* Responsive */
@media (max-width: 980px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .two-column, .converter-layout { grid-template-columns: 1fr; }
  .result-panel { min-height: 480px; }
  .agents-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow-layout { grid-template-columns: 1fr; }
  .workflow-upload-card { min-height: 390px; }
}

@media (max-width: 760px) {
  body { overflow: hidden; }
  .login-screen { padding: 16px; }
  .login-card { padding: 27px 23px; }
  .login-copy { margin: 30px 0 22px; }
  .sidebar {
    position: fixed; z-index: 120; inset: 0 auto 0 0; width: min(286px, calc(100vw - 46px));
    box-shadow: 25px 0 65px -34px rgba(44,25,15,.8); transform: translateX(-105%); transition: transform .2s ease;
  }
  .app-shell.sidebar-open .sidebar { transform: translateX(0); }
  .mobile-scrim { position: fixed; z-index: 110; display: none; inset: 0; background: rgba(36,28,24,.35); }
  .app-shell.sidebar-open .mobile-scrim { display: block; }
  .sidebar-close { display: grid; }
  .sidebar-collapse, .sidebar-restore { display: none !important; }
  .app-shell.sidebar-collapsed .sidebar { width: min(286px, calc(100vw - 46px)); padding: 18px 14px 14px; opacity: 1; pointer-events: auto; }
  .main-panel { margin: 0; border: 0; border-radius: 0; }
  .mobile-header {
    position: absolute; z-index: 100; top: 0; right: 0; left: 0; display: flex; height: 56px;
    align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 7px 12px; background: rgba(255,255,255,.94); backdrop-filter: blur(9px);
  }
  .brand.compact { gap: 7px; }.brand.compact .brand-mark { width: 28px; height: 28px; border-radius: 8px; font-size: 13px; }
  .view { padding-top: 56px; }
  .home-inner { width: calc(100% - 28px); padding: 42px 0 58px; }
  .welcome { font-size: 29px; }
  .welcome-sub { margin-bottom: 25px; font-size: 12px; }
  .prompt-box { margin-bottom: 38px; padding: 13px 12px 10px; }
  .prompt-hint { display: none; }
  .pill-button { max-width: calc(100vw - 140px); }
  .pill-button > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .agent-menu { min-width: min(290px, calc(100vw - 55px)); }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-card, .tool-card:nth-child(4), .tool-card:nth-child(5),
  .tool-card:nth-child(6), .tool-card:nth-child(7) { min-height: 78px; grid-column: auto; padding: 10px 12px; }
  .tool-card { grid-template-columns: 46px minmax(0, 1fr) 16px; }
  .tool-card .tool-badge { display: none; }
  .section-heading { align-items: center; }
  .standard-view { padding: 90px 17px 50px; }
  .page-top { align-items: stretch; flex-direction: column; margin-bottom: 24px; }
  .page-top h1 { font-size: 31px; }
  .page-top .button { align-self: flex-start; }
  .projects-grid { grid-template-columns: 1fr; }
  .project-card { min-height: 170px; }
  .chat-view { padding-top: 56px; }
  .chat-header { min-height: 70px; padding: 9px 12px; }
  .chat-header > .tool-icon { display: none; }
  .chat-title h1 { font-size: 17px; }
  .chat-header-actions .button span, .chat-header-actions .button:not(.always) { display: none; }
  .chat-messages { width: calc(100% - 24px); padding-top: 20px; padding-bottom: 145px; }
  .chat-composer { width: calc(100% - 20px); margin-bottom: 10px; }
  .artifact-select-wrap { max-width: calc(100vw - 120px); }
  .artifact-select-wrap select { max-width: calc(100vw - 165px); }
  .message-body { max-width: 92%; }
  .two-column, .converter-layout { gap: 13px; }
  .task-panel, .result-panel { padding: 18px; }
  .result-panel { min-height: 430px; }
  .board-view { padding-top: 56px; }
  .board-tip { display: none; }
  .board-card { width: 290px; }
  .board-topbar { top: 10px; left: 10px; right: 10px; }
  .board-title small { display: none; }
  .focus-modal { padding: 9px; }
  .focus-card { height: calc(100vh - 18px); border-radius: 16px; }
  .focus-head { padding: 10px; }
  .focus-head .tool-icon { display: none; }
  .focus-actions .button span { display: none; }
  .focus-body { padding: 20px 16px 45px; }
  .modal { padding: 12px; }
  .modal-card { max-height: calc(100vh - 24px); padding: 20px; }
  .agents-view { padding-top: 80px; }
  .agents-hero { min-height: 0; padding: 0; }
  .agents-hero-icon { display: none; }
  .agents-hero h1 { font-size: 32px; }
  .agents-grid { grid-template-columns: 1fr; }
  .agent-card { min-height: 230px; }
  .workflow-view { padding-top: 80px; }
  .workflow-upload-card { min-height: 0; padding: 16px; }
  .workflow-upload-card .file-drop { min-height: 150px; margin: 14px 0 12px; }
  .workflow-canvas-shell { min-height: 0; }
  .workflow-canvas { min-height: 0; grid-template-columns: 1fr; gap: 12px; padding: 20px 16px; }
  .workflow-node { width: 100%; min-height: 126px; justify-self: center; }
  .workflow-connection { display: none; }
}

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

/* 0.3.2 — three airy workflow views */
.workflow-page-top {
  display: flex;
  max-width: 1040px;
  align-items: flex-end;
  gap: 28px;
  margin-bottom: 44px;
}
.workflow-page-top > div:first-child { max-width: 620px; }
.workflow-page-top h1 { font-size: 36px; }
.workflow-page-top p:last-child { max-width: 560px; line-height: 1.65; }
.workflow-style-switch {
  display: inline-flex;
  margin-left: auto;
  flex: none;
  gap: 2px;
  border: 0;
  border-radius: 999px;
  padding: 3px;
  background: #f6f2ef;
}
.workflow-style-option {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  padding: 5px 12px;
  color: #93847a;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  transition: color .15s, background .15s;
}
.workflow-style-option:hover { color: var(--ink); }
.workflow-style-option.active { color: var(--ink); background: #fff; box-shadow: 0 2px 10px rgba(69, 42, 26, .07); }
.workflow-layout { max-width: 1040px; }
.workflow-view .workflow-upload-card,
.workflow-view .workflow-canvas-shell,
.workflow-view .workflow-node { box-shadow: none; }
.workflow-view .workflow-node.running {
  border-color: transparent;
  box-shadow: none;
  transform: none;
  animation: none;
}
.workflow-view .workflow-node.completed,
.workflow-view .workflow-node.failed { border-color: transparent; }
.workflow-view .workflow-summary { background: transparent; }

/* Variant 1: one horizontal rail */
.workflow-view[data-workflow-style="rail"] .workflow-layout { display: block; }
.workflow-view[data-workflow-style="rail"] .workflow-upload-card {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(180px, .8fr) minmax(360px, 1.55fr) 166px;
  align-items: center;
  gap: 24px;
  border: 0;
  border-bottom: 1px solid #eee6e0;
  border-radius: 0;
  padding: 0 0 30px;
  background: transparent;
}
.workflow-view[data-workflow-style="rail"] .workflow-upload-card h2 { margin: 0 0 5px; font-size: 21px; }
.workflow-view[data-workflow-style="rail"] .workflow-upload-card .file-drop {
  display: grid;
  min-height: 62px;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 11px;
  align-content: center;
  justify-content: stretch;
  margin: 0;
  border-color: #e8ddd5;
  border-radius: 12px;
  padding: 10px 13px;
  background: transparent;
  text-align: left;
}
.workflow-view[data-workflow-style="rail"] .workflow-upload-card .drop-icon {
  width: 32px;
  height: 32px;
  grid-row: 1 / 3;
  margin: 0;
  border-radius: 50%;
}
.workflow-view[data-workflow-style="rail"] .workflow-upload-card .drop-icon svg { width: 15px; height: 15px; }
.workflow-view[data-workflow-style="rail"] .workflow-upload-card .file-drop b { max-width: none; font-size: 10px; }
.workflow-view[data-workflow-style="rail"] .workflow-upload-card .file-drop small { margin: 1px 0 0; font-size: 8px; }
.workflow-view[data-workflow-style="rail"] .workflow-upload-card .button { margin: 0; }
.workflow-view[data-workflow-style="rail"] .workflow-canvas-shell {
  min-height: 0;
  margin-top: 52px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.workflow-view[data-workflow-style="rail"] .workflow-canvas {
  min-height: 150px;
  gap: 74px;
  padding: 0;
  background: transparent;
}
.workflow-view[data-workflow-style="rail"] .workflow-node {
  min-height: 142px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}
.workflow-view[data-workflow-style="rail"] .workflow-node > .tool-icon { width: 42px; height: 42px; border-radius: 12px; }
.workflow-view[data-workflow-style="rail"] .workflow-node > div { margin-top: 13px; }
.workflow-view[data-workflow-style="rail"] .workflow-node b { max-width: 210px; font-size: 13px; }
.workflow-view[data-workflow-style="rail"] .workflow-node p { font-size: 9px; }
.workflow-view[data-workflow-style="rail"] .node-status { margin-top: 14px; }
.workflow-view[data-workflow-style="rail"] .workflow-connection { top: 21px; background: #e8dfd8; }
.workflow-view[data-workflow-style="rail"] .connection-one { left: 4%; width: 33%; }
.workflow-view[data-workflow-style="rail"] .connection-two { left: 40.3%; width: 33%; }
.workflow-view[data-workflow-style="rail"] .workflow-summary { border: 0; padding: 20px 0 0; }

/* Variant 2: vertical timeline */
.workflow-view[data-workflow-style="timeline"] .workflow-layout {
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: start;
  gap: 86px;
}
.workflow-view[data-workflow-style="timeline"] .workflow-upload-card {
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}
.workflow-view[data-workflow-style="timeline"] .workflow-upload-card h2 { font-size: 23px; }
.workflow-view[data-workflow-style="timeline"] .workflow-upload-card .file-drop {
  min-height: 154px;
  margin: 22px 0 14px;
  border-color: #e5d8cf;
  border-radius: 14px;
  background: transparent;
}
.workflow-view[data-workflow-style="timeline"] .workflow-upload-card .button { margin: 0; }
.workflow-view[data-workflow-style="timeline"] .workflow-canvas-shell {
  min-height: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.workflow-view[data-workflow-style="timeline"] .workflow-canvas {
  min-height: 336px;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 0 0 0 44px;
  background: transparent;
}
.workflow-view[data-workflow-style="timeline"] .workflow-canvas::before {
  position: absolute;
  top: 42px;
  bottom: 42px;
  left: 64px;
  width: 1px;
  background: #e8dfd9;
  content: "";
}
.workflow-view[data-workflow-style="timeline"] .workflow-node {
  display: grid;
  width: 100%;
  min-height: 112px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  border: 0;
  border-bottom: 1px solid #f0e9e4;
  border-radius: 0;
  padding: 16px 0;
  background: transparent;
}
.workflow-view[data-workflow-style="timeline"] .workflow-node:last-of-type { border-bottom: 0; }
.workflow-view[data-workflow-style="timeline"] .workflow-node > .tool-icon { width: 42px; height: 42px; border-radius: 50%; }
.workflow-view[data-workflow-style="timeline"] .workflow-node > div { margin: 0; }
.workflow-view[data-workflow-style="timeline"] .workflow-node b { font-size: 13px; }
.workflow-view[data-workflow-style="timeline"] .workflow-node p { font-size: 9px; }
.workflow-view[data-workflow-style="timeline"] .node-status { margin: 0 4px 0 14px; }
.workflow-view[data-workflow-style="timeline"] .workflow-connection { display: none; }
.workflow-view[data-workflow-style="timeline"] .workflow-summary { border: 0; padding: 20px 0 0 44px; }

/* Variant 3: centered editorial focus */
.workflow-view[data-workflow-style="focus"] .workflow-layout { display: block; }
.workflow-view[data-workflow-style="focus"] .workflow-upload-card {
  display: grid;
  max-width: 720px;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 174px;
  align-items: center;
  gap: 12px;
  margin: 0 auto;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}
.workflow-view[data-workflow-style="focus"] .workflow-upload-card > div { grid-column: 1 / -1; text-align: center; }
.workflow-view[data-workflow-style="focus"] .workflow-upload-card h2 { font-size: 23px; }
.workflow-view[data-workflow-style="focus"] .workflow-upload-card > div p { max-width: 460px; margin: 0 auto; }
.workflow-view[data-workflow-style="focus"] .workflow-upload-card .file-drop {
  display: grid;
  min-height: 60px;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 11px;
  align-content: center;
  margin: 18px 0 0;
  border-color: #e5d9d0;
  border-radius: 999px;
  padding: 9px 16px;
  background: transparent;
  text-align: left;
}
.workflow-view[data-workflow-style="focus"] .workflow-upload-card .drop-icon {
  width: 32px;
  height: 32px;
  grid-row: 1 / 3;
  margin: 0;
  border-radius: 50%;
}
.workflow-view[data-workflow-style="focus"] .workflow-upload-card .file-drop b { max-width: none; font-size: 10px; }
.workflow-view[data-workflow-style="focus"] .workflow-upload-card .file-drop small { margin: 1px 0 0; font-size: 8px; }
.workflow-view[data-workflow-style="focus"] .workflow-upload-card .button { margin: 18px 0 0; }
.workflow-view[data-workflow-style="focus"] .workflow-canvas-shell {
  min-height: 0;
  margin-top: 60px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.workflow-view[data-workflow-style="focus"] .workflow-canvas {
  min-height: 260px;
  gap: 52px;
  border-radius: 28px;
  padding: 46px 58px;
  background: #fdf9f6;
}
.workflow-view[data-workflow-style="focus"] .workflow-node {
  min-height: 168px;
  align-items: center;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  text-align: center;
}
.workflow-view[data-workflow-style="focus"] .workflow-node .node-number {
  position: static;
  display: block;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  color: #d8cbc2;
  background: transparent;
  font: 400 38px/1 Georgia, "Times New Roman", serif;
}
.workflow-view[data-workflow-style="focus"] .workflow-node > .tool-icon { display: none; }
.workflow-view[data-workflow-style="focus"] .workflow-node > div { align-items: center; margin-top: 15px; }
.workflow-view[data-workflow-style="focus"] .workflow-node b { max-width: 210px; font-size: 13px; }
.workflow-view[data-workflow-style="focus"] .workflow-node p { font-size: 9px; }
.workflow-view[data-workflow-style="focus"] .node-status { margin-top: 15px; }
.workflow-view[data-workflow-style="focus"] .workflow-connection { display: none; }
.workflow-view[data-workflow-style="focus"] .workflow-summary { justify-content: center; border: 0; padding: 18px 0 0; text-align: left; }

@media (max-width: 980px) {
  .workflow-page-top { max-width: 760px; }
  .workflow-view[data-workflow-style="rail"] .workflow-upload-card {
    grid-template-columns: minmax(170px, .8fr) minmax(300px, 1.3fr);
  }
  .workflow-view[data-workflow-style="rail"] .workflow-upload-card .button { grid-column: 2; width: 166px; justify-self: end; }
  .workflow-view[data-workflow-style="rail"] .workflow-canvas { gap: 38px; }
  .workflow-view[data-workflow-style="timeline"] .workflow-layout { grid-template-columns: 230px minmax(0, 1fr); gap: 44px; }
}

@media (max-width: 760px) {
  .workflow-view { padding: 82px 18px 50px; }
  .workflow-page-top { display: block; margin-bottom: 34px; }
  .workflow-page-top h1 { font-size: 31px; }
  .workflow-page-top p:last-child { font-size: 11px; }
  .workflow-style-switch { display: grid; width: 100%; grid-template-columns: repeat(3, 1fr); margin: 18px 0 0; }
  .workflow-style-option { padding-right: 7px; padding-left: 7px; }
  .workflow-view[data-workflow-style="rail"] .workflow-upload-card,
  .workflow-view[data-workflow-style="focus"] .workflow-upload-card { display: block; }
  .workflow-view[data-workflow-style="rail"] .workflow-upload-card { padding-bottom: 24px; }
  .workflow-view[data-workflow-style="rail"] .workflow-upload-card .file-drop,
  .workflow-view[data-workflow-style="focus"] .workflow-upload-card .file-drop {
    display: flex;
    min-height: 118px;
    margin: 16px 0 10px;
    padding: 18px;
    text-align: center;
  }
  .workflow-view[data-workflow-style="rail"] .workflow-upload-card .drop-icon,
  .workflow-view[data-workflow-style="focus"] .workflow-upload-card .drop-icon { margin: 0 0 8px; }
  .workflow-view[data-workflow-style="rail"] .workflow-upload-card .button,
  .workflow-view[data-workflow-style="focus"] .workflow-upload-card .button { width: 100%; margin: 0; }
  .workflow-view[data-workflow-style="rail"] .workflow-canvas-shell { margin-top: 34px; }
  .workflow-view[data-workflow-style="rail"] .workflow-canvas,
  .workflow-view[data-workflow-style="timeline"] .workflow-canvas {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
  }
  .workflow-view[data-workflow-style="rail"] .workflow-node,
  .workflow-view[data-workflow-style="timeline"] .workflow-node {
    display: grid;
    width: 100%;
    min-height: 100px;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    border-bottom: 1px solid #f0e9e4;
    padding: 14px 0;
  }
  .workflow-view[data-workflow-style="rail"] .workflow-node > .tool-icon,
  .workflow-view[data-workflow-style="timeline"] .workflow-node > .tool-icon { width: 40px; height: 40px; }
  .workflow-view[data-workflow-style="rail"] .workflow-node > div,
  .workflow-view[data-workflow-style="timeline"] .workflow-node > div { margin: 0; }
  .workflow-view[data-workflow-style="rail"] .node-status,
  .workflow-view[data-workflow-style="timeline"] .node-status { margin: 0; }
  .workflow-view[data-workflow-style="rail"] .workflow-connection,
  .workflow-view[data-workflow-style="timeline"] .workflow-canvas::before { display: none; }
  .workflow-view[data-workflow-style="rail"] .workflow-summary,
  .workflow-view[data-workflow-style="timeline"] .workflow-summary { padding: 16px 0 0; }
  .workflow-view[data-workflow-style="timeline"] .workflow-layout { display: block; }
  .workflow-view[data-workflow-style="timeline"] .workflow-upload-card { margin-bottom: 42px; }
  .workflow-view[data-workflow-style="timeline"] .workflow-upload-card .file-drop { min-height: 132px; }
  .workflow-view[data-workflow-style="focus"] .workflow-upload-card > div { text-align: left; }
  .workflow-view[data-workflow-style="focus"] .workflow-upload-card > div p { margin: 0; }
  .workflow-view[data-workflow-style="focus"] .workflow-canvas-shell { margin-top: 36px; }
  .workflow-view[data-workflow-style="focus"] .workflow-canvas {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 34px;
    border-radius: 20px;
    padding: 34px 22px;
  }
  .workflow-view[data-workflow-style="focus"] .workflow-node { min-height: 128px; }
}

/* 0.3.3 — restore workspace readability; sidebar intentionally unchanged */
.main-panel .button { min-height: 39px; padding: 8px 14px; font-size: 13px; }
.main-panel .context-pill { font-size: 11px; }
.main-panel .welcome { font-size: clamp(32px, 3vw, 39px); }
.main-panel .prompt-box textarea { font-size: 17px; }
.main-panel .section-heading h2 { font-size: 18px; }
.main-panel .tool-copy b { font-size: 15px; }
.main-panel .tool-copy small { font-size: 12px; }
.main-panel .recent-copy b { font-size: 14px; }
.main-panel .recent-copy small,
.main-panel .recent-date { font-size: 10px; }
.main-panel .page-top h1 { font-size: 38px; }
.main-panel .page-top p:last-child { font-size: 14px; }
.main-panel .project-card h3 { font-size: 16px; }
.main-panel .project-card > p { font-size: 13px; }
.main-panel .project-stats { font-size: 10px; }
.main-panel .agents-hero h1 { font-size: 38px; }
.main-panel .agents-hero p:last-child { font-size: 14px; }
.main-panel .agents-heading p { font-size: 12px; }
.main-panel .agent-card h3 { font-size: 17px; }
.main-panel .agent-card p { font-size: 13px; }
.main-panel .agent-card .link-button { font-size: 12px; }
.main-panel .chat-title h1 { font-size: 23px; }
.main-panel .chat-title small { font-size: 12px; }
.main-panel .message-content { font-size: 15px; }
.main-panel .chat-composer textarea { font-size: 15px; }
.main-panel .composer-status { font-size: 11px; }
.main-panel .artifact-select-wrap select { font-size: 11px; }
.main-panel .task-panel > p,
.main-panel .result-panel p { font-size: 13px; }
.main-panel .task-panel textarea { font-size: 14px; }
.main-panel .check-row b { font-size: 12px; }
.main-panel .check-row small { font-size: 10px; }
.main-panel .file-drop b { font-size: 13px; }
.main-panel .file-drop small { font-size: 10px; }
.main-panel .markdown { font-size: 15px; }
.main-panel .board-card-title b { font-size: 12px; }
.main-panel .board-card-title small,
.main-panel .board-card-status { font-size: 9px; }
.main-panel .board-card-body .markdown { font-size: 11px; }

/* Eight-view switcher */
.workflow-page-top { flex-wrap: wrap; margin-bottom: 38px; }
.workflow-page-top > div:first-child { max-width: 680px; }
.workflow-style-switch {
  width: 100%;
  order: 3;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 4px;
  margin: 3px 0 0;
  padding: 0;
  background: transparent;
}
.workflow-style-option {
  min-height: 32px;
  padding: 6px 12px;
  color: #88776d;
  font-size: 11px;
}
.workflow-style-option.active { color: #d94f1d; background: #fff1e9; box-shadow: none; }
.workflow-page-top h1 { font-size: 39px; }
.workflow-page-top p:last-child { font-size: 14px; }
.workflow-upload-card h2,
.workflow-view[data-workflow-style="rail"] .workflow-upload-card h2,
.workflow-view[data-workflow-style="timeline"] .workflow-upload-card h2,
.workflow-view[data-workflow-style="focus"] .workflow-upload-card h2 { font-size: 25px; }
.workflow-view .workflow-upload-card p { font-size: 13px; line-height: 1.55; }
.workflow-view .workflow-upload-card .file-drop b,
.workflow-view[data-workflow-style="rail"] .workflow-upload-card .file-drop b,
.workflow-view[data-workflow-style="focus"] .workflow-upload-card .file-drop b { font-size: 12px; }
.workflow-view .workflow-upload-card .file-drop small,
.workflow-view[data-workflow-style="rail"] .workflow-upload-card .file-drop small,
.workflow-view[data-workflow-style="focus"] .workflow-upload-card .file-drop small { font-size: 10px; }
.workflow-view .workflow-node b,
.workflow-view[data-workflow-style="rail"] .workflow-node b,
.workflow-view[data-workflow-style="timeline"] .workflow-node b,
.workflow-view[data-workflow-style="focus"] .workflow-node b { font-size: 14px; line-height: 1.3; }
.workflow-view .workflow-node p,
.workflow-view[data-workflow-style="rail"] .workflow-node p,
.workflow-view[data-workflow-style="timeline"] .workflow-node p,
.workflow-view[data-workflow-style="focus"] .workflow-node p { font-size: 11px; }
.workflow-view .node-status { font-size: 10px; }
.workflow-view .workflow-summary b { font-size: 13px; }
.workflow-view .workflow-summary small { font-size: 11px; }
.workflow-view .workflow-history-row b { font-size: 13px; }
.workflow-view .workflow-history-row small,
.workflow-view .workflow-history-row > span:nth-child(3) { font-size: 10px; }

/* Shared lightweight input rail for Stack, Route, Columns and Strip */
.workflow-view:is(
  [data-workflow-style="stack"],
  [data-workflow-style="route"],
  [data-workflow-style="columns"],
  [data-workflow-style="strip"]
) .workflow-layout { display: block; }
.workflow-view:is(
  [data-workflow-style="stack"],
  [data-workflow-style="route"],
  [data-workflow-style="columns"],
  [data-workflow-style="strip"]
) .workflow-upload-card {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(190px, .8fr) minmax(370px, 1.5fr) 176px;
  align-items: center;
  gap: 24px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}
.workflow-view:is(
  [data-workflow-style="stack"],
  [data-workflow-style="route"],
  [data-workflow-style="columns"],
  [data-workflow-style="strip"]
) .workflow-upload-card .file-drop {
  display: grid;
  min-height: 66px;
  grid-template-columns: 36px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-content: center;
  margin: 0;
  border-color: #e6dbd3;
  border-radius: 13px;
  padding: 10px 14px;
  background: transparent;
  text-align: left;
}
.workflow-view:is(
  [data-workflow-style="stack"],
  [data-workflow-style="route"],
  [data-workflow-style="columns"],
  [data-workflow-style="strip"]
) .workflow-upload-card .drop-icon {
  width: 34px;
  height: 34px;
  grid-row: 1 / 3;
  margin: 0;
  border-radius: 50%;
}
.workflow-view:is(
  [data-workflow-style="stack"],
  [data-workflow-style="route"],
  [data-workflow-style="columns"],
  [data-workflow-style="strip"]
) .workflow-upload-card .file-drop small { margin: 1px 0 0; }
.workflow-view:is(
  [data-workflow-style="stack"],
  [data-workflow-style="route"],
  [data-workflow-style="columns"],
  [data-workflow-style="strip"]
) .workflow-upload-card .button { margin: 0; }
.workflow-view:is(
  [data-workflow-style="stack"],
  [data-workflow-style="route"],
  [data-workflow-style="columns"],
  [data-workflow-style="strip"]
) .workflow-canvas-shell {
  min-height: 0;
  margin-top: 58px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

/* Variant 4: stacked editorial rows */
.workflow-view[data-workflow-style="stack"] .workflow-canvas {
  min-height: 0;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 0;
  background: transparent;
}
.workflow-view[data-workflow-style="stack"] .workflow-node {
  display: grid;
  width: 100%;
  min-height: 112px;
  grid-template-columns: 62px 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  border: 0;
  border-bottom: 1px solid #eee6e0;
  border-radius: 0;
  padding: 18px 4px;
  background: transparent;
}
.workflow-view[data-workflow-style="stack"] .workflow-node:first-of-type { border-top: 1px solid #eee6e0; }
.workflow-view[data-workflow-style="stack"] .workflow-node .node-number {
  position: static;
  display: block;
  width: auto;
  height: auto;
  border: 0;
  color: #c8b8ad;
  background: transparent;
  font: 400 28px/1 Georgia, "Times New Roman", serif;
}
.workflow-view[data-workflow-style="stack"] .workflow-node > .tool-icon { width: 44px; height: 44px; border-radius: 50%; }
.workflow-view[data-workflow-style="stack"] .workflow-node > div { margin: 0; }
.workflow-view[data-workflow-style="stack"] .node-status { margin: 0; }
.workflow-view[data-workflow-style="stack"] .workflow-connection { display: none; }
.workflow-view[data-workflow-style="stack"] .workflow-summary { border: 0; padding: 20px 0 0 132px; }

/* Variant 5: zig-zag route */
.workflow-view[data-workflow-style="route"] .workflow-canvas {
  min-height: 350px;
  align-items: start;
  gap: 78px;
  padding: 18px 30px 80px;
  background: transparent;
}
.workflow-view[data-workflow-style="route"] .workflow-node {
  min-height: 150px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}
.workflow-view[data-workflow-style="route"] .workflow-node:nth-of-type(2) { transform: translateY(112px); }
.workflow-view[data-workflow-style="route"] .workflow-node > .tool-icon { width: 46px; height: 46px; border-radius: 50%; }
.workflow-view[data-workflow-style="route"] .workflow-node > div { margin-top: 14px; }
.workflow-view[data-workflow-style="route"] .node-status { margin-top: 15px; }
.workflow-view[data-workflow-style="route"] .workflow-connection { height: 1px; background: #dfd4cc; }
.workflow-view[data-workflow-style="route"] .connection-one { top: 105px; left: 25%; width: 19%; transform: rotate(20deg); }
.workflow-view[data-workflow-style="route"] .connection-two { top: 155px; left: 58%; width: 19%; transform: rotate(-20deg); }
.workflow-view[data-workflow-style="route"] .workflow-summary { border: 0; padding: 0 0 0 30px; }

/* Variant 6: three open columns */
.workflow-view[data-workflow-style="columns"] .workflow-canvas {
  min-height: 270px;
  gap: 0;
  padding: 0;
  border-top: 1px solid #eee6e0;
  border-bottom: 1px solid #eee6e0;
  background: transparent;
}
.workflow-view[data-workflow-style="columns"] .workflow-node {
  min-height: 270px;
  justify-content: center;
  border: 0;
  border-left: 1px solid #eee6e0;
  border-radius: 0;
  padding: 34px 34px;
  background: transparent;
}
.workflow-view[data-workflow-style="columns"] .workflow-node:first-of-type { border-left: 0; }
.workflow-view[data-workflow-style="columns"] .workflow-node > .tool-icon { width: 46px; height: 46px; border-radius: 14px; }
.workflow-view[data-workflow-style="columns"] .workflow-node > div { margin-top: 22px; }
.workflow-view[data-workflow-style="columns"] .workflow-node b { max-width: 230px; }
.workflow-view[data-workflow-style="columns"] .node-status { margin-top: 22px; }
.workflow-view[data-workflow-style="columns"] .workflow-connection { display: none; }
.workflow-view[data-workflow-style="columns"] .workflow-summary { border: 0; padding: 18px 0 0; }

/* Variant 7: triangular orbit */
.workflow-view[data-workflow-style="orbit"] .workflow-layout {
  grid-template-columns: 270px minmax(0, 1fr);
  align-items: start;
  gap: 72px;
}
.workflow-view[data-workflow-style="orbit"] .workflow-upload-card {
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}
.workflow-view[data-workflow-style="orbit"] .workflow-upload-card .file-drop {
  min-height: 150px;
  margin: 22px 0 14px;
  border-color: #e5d8cf;
  background: transparent;
}
.workflow-view[data-workflow-style="orbit"] .workflow-upload-card .button { margin: 0; }
.workflow-view[data-workflow-style="orbit"] .workflow-canvas-shell {
  min-height: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.workflow-view[data-workflow-style="orbit"] .workflow-canvas {
  display: block;
  min-height: 390px;
  padding: 0;
  background: radial-gradient(circle at 50% 46%, #fdf7f2 0 66px, transparent 67px);
}
.workflow-view[data-workflow-style="orbit"] .workflow-node {
  position: absolute;
  width: 210px;
  min-height: 128px;
  align-items: center;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  text-align: center;
}
.workflow-view[data-workflow-style="orbit"] .workflow-node:nth-of-type(1) { top: 0; left: 50%; transform: translateX(-50%); }
.workflow-view[data-workflow-style="orbit"] .workflow-node:nth-of-type(2) { bottom: 0; left: 2%; }
.workflow-view[data-workflow-style="orbit"] .workflow-node:nth-of-type(3) { right: 2%; bottom: 0; }
.workflow-view[data-workflow-style="orbit"] .workflow-node > .tool-icon { width: 44px; height: 44px; border-radius: 50%; }
.workflow-view[data-workflow-style="orbit"] .workflow-node > div { align-items: center; margin-top: 12px; }
.workflow-view[data-workflow-style="orbit"] .node-status { margin-top: 12px; }
.workflow-view[data-workflow-style="orbit"] .workflow-connection { height: 1px; background: #e1d7d0; }
.workflow-view[data-workflow-style="orbit"] .connection-one { top: 186px; left: 27%; width: 28%; transform: rotate(-35deg); }
.workflow-view[data-workflow-style="orbit"] .connection-two { top: 316px; left: 33%; width: 34%; }
.workflow-view[data-workflow-style="orbit"] .workflow-summary { border: 0; padding: 22px 0 0; }

/* Variant 8: one continuous ribbon */
.workflow-view[data-workflow-style="strip"] .workflow-canvas {
  min-height: 134px;
  gap: 0;
  overflow: hidden;
  border-radius: 24px;
  padding: 0 18px;
  background: #faf7f4;
}
.workflow-view[data-workflow-style="strip"] .workflow-node {
  display: grid;
  min-height: 134px;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 14px;
  border: 0;
  border-left: 1px solid #eae1db;
  border-radius: 0;
  padding: 20px 24px;
  background: transparent;
}
.workflow-view[data-workflow-style="strip"] .workflow-node:first-of-type { border-left: 0; }
.workflow-view[data-workflow-style="strip"] .workflow-node > .tool-icon { width: 42px; height: 42px; grid-row: 1 / 3; border-radius: 50%; }
.workflow-view[data-workflow-style="strip"] .workflow-node > div { margin: 0; }
.workflow-view[data-workflow-style="strip"] .workflow-node p { margin-top: 4px; }
.workflow-view[data-workflow-style="strip"] .node-status { grid-column: 2; margin-top: 8px; }
.workflow-view[data-workflow-style="strip"] .workflow-connection { display: none; }
.workflow-view[data-workflow-style="strip"] .workflow-summary { border: 0; padding: 18px 0 0 18px; }

@media (max-width: 980px) {
  .workflow-view:is(
    [data-workflow-style="stack"],
    [data-workflow-style="route"],
    [data-workflow-style="columns"],
    [data-workflow-style="strip"]
  ) .workflow-upload-card { grid-template-columns: minmax(170px, .75fr) minmax(300px, 1.25fr); }
  .workflow-view:is(
    [data-workflow-style="stack"],
    [data-workflow-style="route"],
    [data-workflow-style="columns"],
    [data-workflow-style="strip"]
  ) .workflow-upload-card .button { grid-column: 2; width: 176px; justify-self: end; }
  .workflow-view[data-workflow-style="orbit"] .workflow-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 36px; }
}

@media (max-width: 760px) {
  .main-panel .page-top h1,
  .main-panel .agents-hero h1 { font-size: 34px; }
  .main-panel .page-top p:last-child { font-size: 13px; }
  .main-panel .tool-copy b { font-size: 14px; }
  .main-panel .message-content { font-size: 14px; }
  .workflow-style-switch {
    display: flex;
    width: calc(100vw - 36px);
    flex-wrap: nowrap;
    gap: 3px;
    overflow-x: auto;
    padding: 0 0 5px;
    scrollbar-width: none;
  }
  .workflow-style-switch::-webkit-scrollbar { display: none; }
  .workflow-style-option { flex: none; min-height: 34px; padding: 7px 12px; font-size: 11px; }
  .workflow-page-top h1 { font-size: 34px; }
  .workflow-page-top p:last-child { font-size: 13px; }
  .workflow-view:is(
    [data-workflow-style="stack"],
    [data-workflow-style="route"],
    [data-workflow-style="columns"],
    [data-workflow-style="strip"]
  ) .workflow-upload-card { display: block; }
  .workflow-view:is(
    [data-workflow-style="stack"],
    [data-workflow-style="route"],
    [data-workflow-style="columns"],
    [data-workflow-style="strip"]
  ) .workflow-upload-card .file-drop {
    display: flex;
    min-height: 120px;
    margin: 16px 0 10px;
    padding: 18px;
    text-align: center;
  }
  .workflow-view:is(
    [data-workflow-style="stack"],
    [data-workflow-style="route"],
    [data-workflow-style="columns"],
    [data-workflow-style="strip"]
  ) .workflow-upload-card .drop-icon { margin: 0 0 8px; }
  .workflow-view:is(
    [data-workflow-style="stack"],
    [data-workflow-style="route"],
    [data-workflow-style="columns"],
    [data-workflow-style="strip"]
  ) .workflow-upload-card .button { width: 100%; margin: 0; }
  .workflow-view:is(
    [data-workflow-style="stack"],
    [data-workflow-style="route"],
    [data-workflow-style="columns"],
    [data-workflow-style="strip"]
  ) .workflow-canvas-shell { margin-top: 38px; }
  .workflow-view[data-workflow-style="stack"] .workflow-node {
    grid-template-columns: 42px 40px minmax(0, 1fr);
    gap: 12px;
    padding: 16px 0;
  }
  .workflow-view[data-workflow-style="stack"] .workflow-node .node-number { font-size: 22px; }
  .workflow-view[data-workflow-style="stack"] .workflow-node > .tool-icon { width: 40px; height: 40px; }
  .workflow-view[data-workflow-style="stack"] .node-status { grid-column: 3; margin-top: -8px; }
  .workflow-view[data-workflow-style="stack"] .workflow-summary { padding-left: 0; }
  .workflow-view[data-workflow-style="route"] .workflow-canvas {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 8px 0;
  }
  .workflow-view[data-workflow-style="route"] .workflow-node,
  .workflow-view[data-workflow-style="route"] .workflow-node:nth-of-type(2) {
    min-height: 126px;
    transform: none;
  }
  .workflow-view[data-workflow-style="route"] .workflow-connection { display: none; }
  .workflow-view[data-workflow-style="route"] .workflow-summary { padding-left: 0; }
  .workflow-view[data-workflow-style="columns"] .workflow-canvas {
    grid-template-columns: 1fr;
    border-bottom: 0;
  }
  .workflow-view[data-workflow-style="columns"] .workflow-node {
    min-height: 150px;
    border-bottom: 1px solid #eee6e0;
    border-left: 0;
    padding: 28px 10px;
  }
  .workflow-view[data-workflow-style="orbit"] .workflow-layout { display: block; }
  .workflow-view[data-workflow-style="orbit"] .workflow-upload-card { margin-bottom: 44px; }
  .workflow-view[data-workflow-style="orbit"] .workflow-canvas {
    display: grid;
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 30px;
    background: transparent;
  }
  .workflow-view[data-workflow-style="orbit"] .workflow-node,
  .workflow-view[data-workflow-style="orbit"] .workflow-node:nth-of-type(1),
  .workflow-view[data-workflow-style="orbit"] .workflow-node:nth-of-type(2),
  .workflow-view[data-workflow-style="orbit"] .workflow-node:nth-of-type(3) {
    position: static;
    width: 100%;
    min-height: 130px;
    transform: none;
  }
  .workflow-view[data-workflow-style="orbit"] .workflow-connection { display: none; }
  .workflow-view[data-workflow-style="strip"] .workflow-canvas {
    grid-template-columns: 1fr;
    border-radius: 18px;
    padding: 10px 18px;
  }
  .workflow-view[data-workflow-style="strip"] .workflow-node {
    min-height: 112px;
    border-bottom: 1px solid #eae1db;
    border-left: 0;
    padding: 18px 4px;
  }
}

/* 0.4 — structured intake and document edits */
.chat-questionnaire {
  width: min(720px, 100%);
  margin-top: 18px;
  border-top: 1px solid #eee5de;
}
.chat-question {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  border-bottom: 1px solid #f1eae5;
  padding: 16px 0;
}
.question-index {
  color: #c2b2a7;
  font: 400 18px/1.2 Georgia, "Times New Roman", serif;
}
.chat-question b { display: block; font-size: 14px; line-height: 1.5; }
.chat-question small { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; }
.question-options { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.question-option {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  color: #6e6057;
  background: #f7f3f0;
  font-size: 11px;
  font-weight: 650;
  transition: color .16s, background .16s, transform .16s;
}
.question-option:hover:not(:disabled) { color: var(--accent-dark); background: #fff0e7; transform: translateY(-1px); }
.question-option.selected {
  color: #fff;
  background: var(--accent);
  animation: answer-selected .24s ease-out;
}
.question-option:disabled { cursor: default; opacity: .72; }
.questionnaire-note { margin: 12px 0 0; color: var(--muted); font-size: 10px; }
.message-answer-summary { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; margin-top: 9px; }
.message-answer-summary span { border-radius: 999px; padding: 4px 8px; color: #9f451f; background: #ffe6d8; font-size: 10px; }
.message-edits {
  display: flex;
  max-width: 680px;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  border-left: 2px solid #d8c8f5;
  padding: 10px 0 10px 13px;
  color: #65547f;
  background: linear-gradient(90deg, rgba(241, 236, 255, .52), transparent 72%);
}
.message-edits b { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.message-edits b svg { width: 13px; height: 13px; }
.message-edits span { font-size: 11px; }
@keyframes answer-selected { from { transform: scale(.94); } 60% { transform: scale(1.04); } to { transform: scale(1); } }

/* The active workflow step stays animated in every one of the eight views. */
.workflow-canvas[data-status="running"] .workflow-node:not(.running):not(.completed),
.workflow-canvas[data-status="queued"] .workflow-node:not(.running):not(.completed) { opacity: .62; }
.workflow-view .workflow-node.running > .tool-icon,
.workflow-view[data-workflow-style="focus"] .workflow-node.running .node-number {
  animation: workflow-active-breathe 1.45s ease-in-out infinite !important;
}
.workflow-view .workflow-node.running .node-status::before { animation: workflow-status-ping 1.15s ease-out infinite; }
.workflow-view .workflow-node.running b { color: #d84b1c; }
@keyframes workflow-active-breathe {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(242, 99, 45, .05); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 9px rgba(242, 99, 45, .1); }
}
@keyframes workflow-status-ping {
  0% { box-shadow: 0 0 0 0 rgba(242, 99, 45, .35); }
  75%, 100% { box-shadow: 0 0 0 7px rgba(242, 99, 45, 0); }
}

@media (max-width: 760px) {
  .chat-questionnaire { margin-top: 14px; }
  .chat-question { grid-template-columns: 28px minmax(0, 1fr); gap: 9px; padding: 14px 0; }
  .question-options { display: grid; grid-template-columns: 1fr; }
  .question-option { width: 100%; border-radius: 10px; text-align: left; }
}

/* 0.4.6 — one reusable chat surface for chat route and project board */
.visually-hidden {
  position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important;
  clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important;
}
.chat-surface { position: relative; display: flex; width: 100%; height: 100%; min-height: 0; flex-direction: column; background: #fefdfc; }
.chat-agent-choice { position: relative; display: inline-flex; max-width: min(420px, 45vw); align-items: center; }
.chat-agent-choice select {
  width: 100%; appearance: none; border: 0; outline: 0; padding: 0 25px 0 0; color: var(--ink); background: transparent;
  font: 400 23px/1.2 Georgia, "Times New Roman", serif; text-overflow: ellipsis; cursor: pointer;
}
.chat-agent-choice svg { position: absolute; right: 2px; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }

.board-chat-dock {
  position: absolute; z-index: 25; top: 72px; bottom: 16px; left: 16px; width: min(410px, calc(100% - 32px));
  overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.98);
  box-shadow: 0 24px 70px -36px rgba(65,37,20,.55); transition: width .2s ease, box-shadow .2s ease;
}
.board-chat-dock.expanded { width: min(640px, calc(100% - 32px)); box-shadow: 0 30px 90px -34px rgba(65,37,20,.62); }
.board-chat-mount { width: 100%; height: 100%; min-height: 0; }
.board-chat-window-actions {
  position: absolute; z-index: 32; top: 12px; right: 12px; display: flex; align-items: center; gap: 3px;
}
.board-chat-window-actions button {
  display: grid; width: 31px; height: 31px; place-items: center; border: 0; border-radius: 9px;
  color: var(--muted); background: transparent;
}
.board-chat-window-actions button:hover { color: var(--ink); background: var(--surface); }
.board-chat-window-actions svg { width: 15px; height: 15px; }
.board-chat-dock .chat-header { min-height: 80px; gap: 9px; padding: 12px 82px 12px 14px; }
.board-chat-dock .chat-back { display: none; }
.board-chat-dock #chatAgentIcon { width: 38px; height: 38px; border-radius: 11px; }
.board-chat-dock .chat-agent-choice { max-width: 250px; }
.board-chat-dock .chat-agent-choice select { font-size: 17px; }
.board-chat-dock .chat-title small { max-width: 250px; font-size: 10px; }
.board-chat-dock .chat-header-actions { display: flex; }
.board-chat-dock .chat-header-actions > :not(.agent-mode-switch) { display: none; }
.board-chat-dock .agent-mode-switch button { padding: 5px 7px; font-size: 9px; }
.board-chat-dock .chat-messages { width: calc(100% - 30px); padding: 22px 0 154px; }
.board-chat-dock .chat-welcome { gap: 10px; margin-bottom: 22px; }
.board-chat-dock .chat-welcome .tool-icon { width: 34px; height: 34px; }
.board-chat-dock .chat-welcome h2 { font-size: 15px; }
.board-chat-dock .chat-welcome p { font-size: 12px; line-height: 1.55; }
.board-chat-dock .message { margin-bottom: 16px; }
.board-chat-dock .message-content { font-size: 13px; line-height: 1.58; }
.board-chat-dock .message-body { max-width: 91%; }
.board-chat-dock .chat-composer { width: calc(100% - 24px); margin-bottom: 12px; border-radius: 15px; padding: 10px; }
.board-chat-dock .chat-composer textarea { min-height: 43px; font-size: 13px; }
.board-chat-dock .composer-toolbar { gap: 6px; }
.board-chat-dock .artifact-select-wrap { max-width: 205px; height: 34px; padding: 0 8px; }
.board-chat-dock .artifact-select-wrap select { max-width: 165px; font-size: 10px; }
.board-chat-dock .composer-status { display: none; }
.board-chat-dock.expanded .chat-agent-choice,
.board-chat-dock.expanded .chat-title small { max-width: 420px; }
.board-chat-dock.expanded .chat-messages { width: min(560px, calc(100% - 40px)); }
.board-chat-dock.expanded .chat-composer { width: min(570px, calc(100% - 28px)); }
.board-chat-launcher {
  position: absolute; z-index: 24; bottom: 16px; left: 16px; display: inline-flex; height: 42px; align-items: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 0 15px; color: #fff; background: var(--accent); box-shadow: 0 12px 30px -15px rgba(216,75,28,.9);
  font-size: 12px; font-weight: 750;
}
.board-chat-launcher svg { width: 17px; height: 17px; }
.board-viewport.chat-open .board-tip { display: none; }
.board-canvas { transition: transform .08s linear; }
.board-topbar { justify-content: center; }
.board-topbar > .icon-button:first-child { position: absolute; left: 0; }
.board-topbar > .button:last-child { position: absolute; right: 0; margin-left: 0; }

@media (max-width: 760px) {
  .chat-agent-choice { max-width: calc(100vw - 155px); }
  .chat-agent-choice select { font-size: 17px; }
  .board-chat-dock,
  .board-chat-dock.expanded { top: 66px; right: 8px; bottom: 8px; left: 8px; width: auto; border-radius: 15px; }
  .board-chat-dock .chat-header { padding-left: 11px; }
  .board-chat-dock #chatAgentIcon { display: none; }
  .board-chat-dock .chat-agent-choice { max-width: calc(100vw - 150px); }
  .board-chat-launcher { bottom: 12px; left: 12px; }
}

/* 0.4.7 — @ file picker reuses regular artifact attachments */
.mention-menu {
  position: absolute; z-index: 40; right: 8px; bottom: calc(100% + 8px); left: 8px; max-height: min(330px, 48vh);
  display: flex; overflow: hidden; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; padding: 7px; background: rgba(255,255,255,.98);
  box-shadow: 0 24px 58px -26px rgba(58,34,20,.5); backdrop-filter: blur(12px);
}
.mention-menu-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 8px 8px; }
.mention-menu-label span { color: var(--ink-soft); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.mention-menu-label small { color: var(--muted); font-size: 9px; }
.mention-option {
  display: flex; width: 100%; align-items: center; gap: 9px; border: 0; border-radius: 10px; padding: 8px;
  color: var(--ink); background: transparent; text-align: left;
}
.mention-option:hover, .mention-option.active { background: var(--surface); }
.mention-option.active { box-shadow: inset 2px 0 var(--accent); }
.mention-option .mini-icon { width: 31px; height: 31px; flex: none; border-radius: 9px; }
.mention-option > span:last-child { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.mention-option b { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.mention-option small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.mention-empty { padding: 18px 10px; color: var(--muted); font-size: 11px; text-align: center; }
.mention-options { min-height: 0; overflow: auto; }
.board-chat-dock .mention-menu { max-height: min(280px, 42vh); }

@media (max-width: 760px) {
  .mention-menu { right: 3px; left: 3px; max-height: 42vh; }
}

/* L.Studio projects list */
.projects-breadcrumb { display: flex; max-width: 1024px; align-items: center; gap: 8px; margin: 0 auto 28px; color: var(--muted); font-size: 12px; }
.projects-breadcrumb svg { width: 13px; height: 13px; }
.projects-breadcrumb b { color: var(--ink); }
.projects-page-top { align-items: end; }
.projects-table { max-width: 1024px; border: 1px solid var(--line); border-radius: 13px; margin: 0 auto; overflow: hidden; background: #fff; }
.projects-table-head,.project-row { display: grid; grid-template-columns: minmax(260px,2.3fr) .65fr 1fr .75fr .75fr 34px; align-items: center; column-gap: 14px; }
.projects-table-head { min-height: 42px; border-bottom: 1px solid var(--line); padding: 0 14px; color: var(--muted); background: #f7f8f9; font-size: 10px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.project-row { min-height: 58px; border-bottom: 1px solid var(--line); padding: 7px 14px; color: var(--ink-soft); font-size: 11px; cursor: pointer; transition: background .16s ease; }
.project-row:last-child { border-bottom: 0; }
.project-row:hover,.project-row:focus-visible { outline: none; background: #f8fafb; }
.project-row.current { background: #fff5ef; }
.project-row > span { display: flex; min-width: 0; align-items: center; gap: 7px; }
.project-row > span > svg { width: 14px; height: 14px; color: var(--muted); }
.project-row-name > svg { width: 18px !important; height: 18px !important; flex: none; color: var(--ink-soft) !important; }
.project-row-name > span { display: flex; min-width: 0; flex-direction: column; }
.project-row-name b,.project-row-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-row-name b { color: var(--ink); font-size: 12px; }
.project-row-name small { color: var(--muted); font-size: 9px; }
.project-owner { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; color: #b7471d; background: #ffe6d5; font-size: 9px; font-style: normal; }
.project-row .project-menu { display: grid; width: 30px; height: 30px; place-items: center; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; }
.project-row .project-menu:hover { color: #b43a2a; background: #fff0ed; }
.project-row .project-menu svg { width: 14px; height: 14px; }
.projects-empty { min-height: 250px; }

/* Multi-select @ menu */
.mention-menu-label button { border: 0; padding: 3px 6px; color: var(--accent); background: transparent; font-size: 9px; font-weight: 750; cursor: pointer; }
.mention-check { display: grid; width: 18px; height: 18px; flex: none; place-items: center; border: 1px solid var(--line-strong); border-radius: 5px; color: #fff; background: #fff; }
.mention-check.checked { border-color: var(--accent); background: var(--accent); }
.mention-check svg { width: 12px; height: 12px; }
.mention-actions { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding: 8px; background: rgba(255,255,255,.98); }
.mention-actions small { color: var(--muted); font-size: 9px; }

/* Whole-chat drop target */
.chat-surface::after { position: absolute; z-index: 40; inset: 10px; display: none; place-items: center; border: 2px dashed var(--accent); border-radius: 16px; color: var(--accent); background: rgba(255,248,243,.94); font-size: 13px; font-weight: 750; content: "Отпустите, чтобы прикрепить к сообщению"; pointer-events: none; }
.chat-surface.dragover::after { display: grid; }
.board-card-head[draggable="true"] { cursor: grab; }
.board-card-head[draggable="true"]:active { cursor: grabbing; }
.board-move-handle { cursor: move; }

.focus-body:has(.document-editor-host:not(.is-hidden)) { padding: 0; background: #f6f7f8; }

@media (max-width: 820px) {
  .projects-table { border: 0; overflow: visible; background: transparent; }
  .projects-table-head { display: none; }
  .projects-table-body { display: grid; gap: 8px; }
  .project-row { min-width: 0; min-height: 76px; grid-template-columns: minmax(0,1fr) auto auto; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 11px; background: #fff; }
  .project-row > span:nth-child(2) { color: var(--muted); font-size: 9px; }
  .project-row > span:nth-child(2)::after { content: " док."; }
  .project-row > span:nth-child(3) { color: var(--muted); font-size: 9px; }
  .project-row > span:nth-child(4), .project-row > span:nth-child(5) { display: none; }
  .project-row .project-menu { grid-column: 3; grid-row: 1 / span 2; }
  .project-row-name { grid-column: 1 / 3; }
  .projects-breadcrumb { margin-bottom: 18px; }
}

/* 0.5.0 — four-stage workflow, shared agent feed and edit highlights */
.workflow-canvas { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.connection-one { left: 23.5%; width: 3%; }
.connection-two { left: 48.5%; width: 3%; }
.connection-three { left: 73.5%; width: 3%; }
.workflow-canvas[data-active-step="brief_master"] .connection-one i,
.workflow-canvas[data-active-step="research_analyst"] .connection-two i,
.workflow-canvas[data-active-step="creative_strategy"] .connection-three i { display: block; }
.workflow-canvas[data-active-step="creative_strategy"] .connection-two i { display: none; }
.workflow-view[data-workflow-style="rail"] .workflow-canvas { gap: 42px; }
.workflow-view[data-workflow-style="rail"] .connection-one { left: 3%; width: 23%; }
.workflow-view[data-workflow-style="rail"] .connection-two { left: 28%; width: 23%; }
.workflow-view[data-workflow-style="rail"] .connection-three { left: 53%; width: 23%; }
.workflow-view[data-workflow-style="route"] .connection-three { top: 105px; left: 76%; width: 12%; transform: rotate(20deg); }
.workflow-view[data-workflow-style="orbit"] .workflow-node:nth-of-type(1) { top: 0; right: auto; bottom: auto; left: 50%; transform: translateX(-50%); }
.workflow-view[data-workflow-style="orbit"] .workflow-node:nth-of-type(2) { top: 132px; right: auto; bottom: auto; left: 0; transform: none; }
.workflow-view[data-workflow-style="orbit"] .workflow-node:nth-of-type(3) { top: 132px; right: 0; bottom: auto; left: auto; transform: none; }
.workflow-view[data-workflow-style="orbit"] .workflow-node:nth-of-type(4) { top: auto; right: auto; bottom: 0; left: 50%; transform: translateX(-50%); }
.workflow-view[data-workflow-style="orbit"] .connection-three { top: 315px; left: 48%; width: 24%; transform: rotate(-35deg); }
.message-agent-label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.message-avatar svg { width: 14px; height: 14px; }
.agent-edit-summary { display: flex; align-items: center; gap: 7px; margin: 0 0 22px; border-radius: 10px; padding: 9px 11px; color: #756459; background: #fff8e7; font-size: 11px; }
.agent-edit-summary svg { width: 13px; height: 13px; color: #d88b18; }
.agent-edit-summary small { margin-left: auto; color: #a98142; }
.agent-edit-summary button { border: 0; border-radius: 7px; padding: 4px 7px; color: #8a6d3a; background: rgba(255,255,255,.72); font-size: 9px; cursor: pointer; }
.agent-edited-block { border-radius: 5px; background: linear-gradient(90deg, rgba(255,220,112,.28), rgba(255,243,195,.12)); box-shadow: -4px 0 0 rgba(225,164,35,.44); }

/* Questionnaire carousel and compact composer controls. */
.chat-questionnaire.carousel { border: 1px solid var(--line); border-radius: 15px; padding: 14px; background: #fffdfb; }
.questionnaire-progress { display: flex; align-items: flex-start; gap: 10px; }
.questionnaire-progress b { flex: none; border-radius: 999px; padding: 3px 7px; color: var(--accent-dark); background: var(--accent-soft); font-size: 10px; }
.questionnaire-progress span { color: var(--ink); font-size: 14px; font-weight: 750; line-height: 1.45; }
.chat-question.current { display: block; border: 0; padding: 6px 0 0; }
.chat-questionnaire.carousel .question-options { display: grid; grid-template-columns: 1fr; gap: 6px; }
.chat-questionnaire.carousel .question-option { width: 100%; border: 1px solid transparent; border-radius: 10px; text-align: left; }
.chat-questionnaire.carousel .question-option.selected { border-color: var(--accent); }
.question-other { width: 100%; min-height: 64px; margin-top: 2px; border: 1px solid var(--line); border-radius: 10px; outline: 0; padding: 9px 10px; resize: vertical; font: inherit; }
.question-other:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242,99,45,.08); }
.chat-questionnaire.carousel > .questionnaire-note { display: block; width: 100%; margin: 10px 0 0; }
.questionnaire-nav { display: flex; align-items: center; gap: 7px; margin-top: 12px; }
.questionnaire-nav > .button:first-child { margin-right: auto; }
.chat-questionnaire.archived { opacity: .72; }
.composer-agent-choice { max-width: 220px; height: 34px; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 0 28px 0 9px; background: #fff; }
.composer-agent-choice select { width: auto; max-width: 160px; padding: 0; font: 750 11px/1.2 Inter, Arial, sans-serif; }
.composer-agent-choice > .chevron { right: 8px; width: 12px; height: 12px; }
.composer-agent-mark { display: grid; width: 18px; height: 18px; place-items: center; color: var(--accent); }
.composer-agent-mark svg { width: 13px; height: 13px; }
.chat-composer.dragover { border-color: var(--accent); background: #fff8f3; box-shadow: 0 0 0 4px rgba(242,99,45,.12), var(--shadow); }
#chatStop { flex: none; }
.print-frame { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.export-more { position: relative; }
.export-more summary { list-style: none; cursor: pointer; }
.export-more summary::-webkit-details-marker { display: none; }
.export-more > a { position: absolute; z-index: 20; top: calc(100% + 5px); right: 0; width: max-content; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; color: var(--ink); background: #fff; box-shadow: var(--shadow); font-size: 10px; text-decoration: none; }
@media (max-width: 640px) {
  .questionnaire-nav { flex-wrap: wrap; }
  .composer-agent-choice { max-width: 165px; }
  .composer-agent-choice select { max-width: 112px; }
}

@media (max-width: 760px) {
  .toast-region { top: 116px; right: 12px; width: min(360px, calc(100% - 24px)); }
}

@media (max-width: 760px) {
  .workflow-canvas { grid-template-columns: 1fr; }
  .workflow-view[data-workflow-style="orbit"] .workflow-node,
  .workflow-view[data-workflow-style="orbit"] .workflow-node:nth-of-type(1),
  .workflow-view[data-workflow-style="orbit"] .workflow-node:nth-of-type(2),
  .workflow-view[data-workflow-style="orbit"] .workflow-node:nth-of-type(3),
  .workflow-view[data-workflow-style="orbit"] .workflow-node:nth-of-type(4) {
    position: relative; top: auto; right: auto; bottom: auto; left: auto; width: 100%; transform: none;
  }
}
