:root {
  color-scheme: light;
  --paper: #f5f3ed;
  --paper-deep: #eeece4;
  --card: #fffefa;
  --ink: #242521;
  --ink-soft: #686a61;
  --ink-faint: #71736a;
  --line: #e6e4dc;
  --line-strong: #d8d6cd;
  --accent: #bd522e;
  --accent-hover: #a43f22;
  --accent-wash: #fff0e8;
  --green: #39765d;
  --green-wash: #eaf3ed;
  --yellow: #9b7530;
  --yellow-wash: #f8f0df;
  --red: #a24d45;
  --red-wash: #f9ece9;
  --shadow: 0 14px 40px rgb(35 36 31 / 5%), 0 2px 7px rgb(35 36 31 / 3%);
  --sans: 'DM Sans', 'Helvetica Neue', sans-serif;
  --display: 'Manrope', 'DM Sans', sans-serif;
  --mono: 'DM Mono', ui-monospace, monospace;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--paper); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid rgb(223 109 66 / 42%);
  outline-offset: 3px;
}
::selection { color: var(--ink); background: #f4c7af; }

.boot-screen, .gate-screen {
  min-height: 100vh;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 28px;
}
.boot-mark, .brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px 14px 14px 5px;
  color: #fffaf4;
  background: var(--ink);
  font: 800 22px/1 var(--display);
  letter-spacing: -2px;
}
.boot-mark span { color: #ee8a61; }
.brand-mark .brand-dot { color: #ee8a61; }
.boot-line { width: 90px; height: 2px; overflow: hidden; margin: 26px 0 9px; background: #e4e1d9; }
.boot-line::after { content: ''; display: block; width: 44%; height: 100%; background: var(--accent); animation: travel 1.2s ease-in-out infinite alternate; }
.boot-screen p { color: var(--ink-soft); font-size: 12px; letter-spacing: .02em; }
.gate-screen { position: relative; overflow: hidden; }
.gate-screen::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .4; background-image: radial-gradient(#c9c5ba 0.65px, transparent .65px); background-size: 14px 14px; mask-image: linear-gradient(transparent, #000 28%, #000 72%, transparent); }
.gate-card { z-index: 1; width: min(100%, 440px); padding: 42px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
.gate-card .brand-mark { margin-bottom: 37px; }
.gate-kicker, .eyebrow { color: var(--ink-faint); font: 500 10px/1.4 var(--mono); letter-spacing: .11em; text-transform: uppercase; }
.gate-card h1 { margin: 9px 0 12px; font: 700 27px/1.2 var(--display); letter-spacing: -.045em; }
.gate-card p { margin: 0; color: var(--ink-soft); line-height: 1.65; }
.gate-card .button { margin-top: 26px; }
.gate-foot { display: flex; align-items: center; gap: 9px; margin-top: 34px; padding-top: 19px; border-top: 1px solid var(--line); color: var(--ink-faint); font-size: 11px; }
.gate-foot .lock { color: var(--green); font-size: 14px; }
.gate-error { margin-top: 20px !important; padding: 11px 13px; border-radius: 8px; background: var(--red-wash); color: var(--red) !important; font-size: 12px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 254px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 640px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: #f8f7f2;
}
.sidebar-head { display: flex; align-items: center; gap: 12px; padding: 22px 18px 20px; }
.sidebar-head .brand-mark { flex: 0 0 37px; width: 37px; height: 37px; border-radius: 12px 12px 12px 4px; font-size: 19px; }
.brand-copy { min-width: 0; flex: 1; }
.brand-title { font: 800 14px/1.1 var(--display); letter-spacing: -.035em; }
.brand-subtitle { margin-top: 4px; color: var(--ink-faint); font: 10px/1 var(--mono); letter-spacing: .04em; }
.sidebar-workspace { margin: 0 15px 20px; padding: 12px 12px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fffefa; }
.workspace-line { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; }
.live-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #c2c3bc; }
.live-dot.connected { background: #579572; box-shadow: 0 0 0 3px #e7f1e9; }
.workspace-meta { margin: 7px 0 0 15px; color: var(--ink-faint); font: 10px/1.4 var(--mono); }
.side-section-head { display: flex; justify-content: space-between; align-items: center; padding: 0 15px 8px; }
.side-section-head h2 { margin: 0; color: var(--ink-faint); font: 500 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.icon-button { display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--ink-soft); font-size: 18px; cursor: pointer; }
.icon-button:hover { border-color: var(--line); background: #fffefa; color: var(--ink); }
.client-tree { flex: 1; min-height: 0; overflow: auto; padding: 0 9px 12px; }
.client-block { margin: 2px 0 6px; }
.client-row, .project-row {
  display: flex;
  width: 100%;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.client-row { font-size: 12px; font-weight: 600; }
.project-row { padding-left: 27px; color: var(--ink-soft); font-size: 11px; }
.task-nav-row { min-height: 29px; padding-left: 42px; color: #85867e; font-size: 10px; }
.task-nav-row.is-task-current { border-color: #e8dfd5; background: #fff8f3; color: var(--ink); }
.client-row:hover, .project-row:hover { background: #eeece5; }
.client-row[aria-current="true"], .project-row[aria-current="true"] { border-color: #e8dfd5; background: #fff8f3; color: var(--ink); }
.tree-glyph { display: inline-grid; width: 16px; place-items: center; color: #b1afa5; font-size: 12px; }
.client-row .tree-glyph { color: var(--accent); font-size: 10px; }
.tree-label { overflow: hidden; flex: 1; text-overflow: ellipsis; white-space: nowrap; }
.tree-count { color: var(--ink-faint); font: 10px var(--mono); }
.project-empty { padding: 3px 8px 7px 27px; color: #aaa99f; font-size: 10px; }
.side-empty { padding: 13px 8px; color: var(--ink-faint); font-size: 11px; line-height: 1.5; }
.side-bottom { padding: 12px 14px 14px; border-top: 1px solid var(--line); }
.export-link { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 7px; border: 0; border-radius: 7px; background: none; color: var(--ink-soft); text-decoration: none; font-size: 11px; cursor: pointer; }
.export-link:hover { background: #eeece5; color: var(--ink); }
.owner-chip { display: flex; align-items: center; gap: 9px; padding: 10px 6px 2px; }
.owner-avatar { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 50%; background: #e7e4dc; color: var(--ink); font: 700 10px var(--display); }
.owner-name { min-width: 0; flex: 1; overflow: hidden; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.owner-label { display: block; margin-top: 2px; color: var(--ink-faint); font: 9px var(--mono); letter-spacing: .05em; text-transform: uppercase; }

.main-area { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; height: 58px; align-items: center; justify-content: space-between; padding: 0 30px; border-bottom: 1px solid rgb(230 228 220 / 80%); background: rgb(245 243 237 / 92%); backdrop-filter: blur(12px); }
.breadcrumb { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--ink-faint); font-size: 11px; }
.breadcrumb strong { overflow: hidden; color: var(--ink-soft); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumb .slash { color: #c8c5bb; }
.topbar-right { display: flex; align-items: center; gap: 9px; }
.refresh-label { color: var(--ink-faint); font: 9px var(--mono); }
.mobile-menu { display: none; }
.content { width: min(100%, 1240px); margin: 0 auto; padding: 30px 34px 60px; }
.toast { position: fixed; top: 72px; right: 24px; z-index: 70; max-width: min(430px, calc(100vw - 32px)); padding: 12px 16px; border: 1px solid #e2b39e; border-radius: 9px; background: #fffaf5; box-shadow: var(--shadow); color: #7d3e28; font-size: 12px; line-height: 1.5; }
.toast[data-kind="success"] { border-color: #b9d0be; background: #f4faf5; color: var(--green); }
.toast[data-kind="info"] { border-color: #ebdfc6; background: #fffbf0; color: #795f31; }
.banner { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 26px; padding: 24px 26px; border: 1px solid #e5ddd0; border-radius: 14px; background: #f0ede4; }
.banner-copy { max-width: 600px; }
.banner .eyebrow { color: #a08366; }
.banner h1 { margin: 8px 0 7px; font: 700 25px/1.18 var(--display); letter-spacing: -.05em; }
.banner p { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.55; }
.banner-mark { position: relative; display: grid; width: 74px; height: 74px; flex: 0 0 74px; place-items: center; align-self: center; border: 1px solid #ded2c2; border-radius: 50%; color: #b8734f; font: 500 12px var(--mono); }
.banner-mark::before, .banner-mark::after { content: ''; position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.banner-mark::before { top: -2px; right: 15px; }
.banner-mark::after { bottom: 10px; left: 0; background: #c4b39d; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 27px 0 12px; }
.section-heading h2 { margin: 0; font: 700 15px var(--display); letter-spacing: -.03em; }
.section-heading p { margin: 5px 0 0; color: var(--ink-faint); font-size: 11px; }
.section-heading .eyebrow { margin-bottom: 5px; }
.button-row { display: flex; align-items: center; gap: 8px; }
.button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); border-color: #bcb9af; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button-primary { border-color: var(--accent); background: var(--accent); color: white; }
.button-primary:hover:not(:disabled) { border-color: var(--accent-hover); background: var(--accent-hover); }
.button-soft { border-color: #f1d7c8; background: #fff6f0; color: #9f4e2c; }
.button-danger { border-color: #ead0cb; background: #fffaf9; color: var(--red); }
.button-small { min-height: 30px; padding: 0 10px; font-size: 10px; }
.button-quiet { border-color: transparent; background: transparent; color: var(--ink-soft); }

.readiness-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.readiness-card { min-height: 106px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.readiness-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--ink-faint); font: 10px var(--mono); text-transform: uppercase; letter-spacing: .045em; }
.readiness-icon { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 7px; background: #f1efe8; color: var(--ink-soft); font-size: 12px; }
.readiness-value { margin-top: 12px; font: 700 17px var(--display); letter-spacing: -.035em; }
.readiness-detail { margin-top: 4px; color: var(--ink-faint); font-size: 10px; line-height: 1.4; }
.status-pill { display: inline-flex; min-height: 22px; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; background: #f7f6f2; color: var(--ink-soft); font: 10px var(--mono); white-space: nowrap; }
.status-pill::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #9b9b91; }
.status-pill.connected, .status-pill.approved, .status-pill.completed, .status-pill.review { border-color: #d5e4d9; background: var(--green-wash); color: var(--green); }
.status-pill.connected::before, .status-pill.approved::before, .status-pill.completed::before, .status-pill.review::before { background: #579572; }
.status-pill.paused, .status-pill.queued, .status-pill.awaiting_scope, .status-pill.discussion { border-color: #ebdfc6; background: var(--yellow-wash); color: var(--yellow); }
.status-pill.paused::before, .status-pill.queued::before, .status-pill.awaiting_scope::before, .status-pill.discussion::before { background: #bd8b3f; }
.status-pill.failed, .status-pill.cancelled { border-color: #edd6d2; background: var(--red-wash); color: var(--red); }
.status-pill.failed::before, .status-pill.cancelled::before { background: var(--red); }
.status-pill.running { border-color: #f0d6c9; background: var(--accent-wash); color: #aa512c; }
.status-pill.running::before { background: var(--accent); animation: pulse 1.5s ease-in-out infinite; }

.activity-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.activity-empty { display: grid; min-height: 136px; place-items: center; padding: 25px; text-align: center; }
.empty-symbol { display: grid; width: 37px; height: 37px; place-items: center; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 11px; background: #faf9f5; color: #c17b56; font-size: 17px; }
.activity-empty strong { display: block; font-size: 12px; }
.activity-empty p { max-width: 330px; margin: 5px auto 0; color: var(--ink-faint); font-size: 10px; line-height: 1.5; }
.activity-row { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 13px 15px; border-bottom: 1px solid #f0eee8; text-decoration: none; }
.activity-row:last-child { border-bottom: 0; }
.activity-row:hover { background: #fcfbf7; }
.activity-marker { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; border-radius: 9px; background: #f3f0e8; color: #8f8979; font-size: 12px; }
.activity-copy { min-width: 0; flex: 1; }
.activity-title { overflow: hidden; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.activity-subtitle { overflow: hidden; margin-top: 4px; color: var(--ink-faint); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.activity-time { flex: 0 0 auto; color: var(--ink-faint); font: 9px var(--mono); }
.activity-row .status-pill { margin-left: 4px; }
.setup-strip { display: flex; align-items: center; gap: 12px; margin-top: 17px; padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: 9px; color: var(--ink-soft); }
.setup-strip .setup-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--accent); }
.setup-strip p { flex: 1; margin: 0; font-size: 10px; line-height: 1.45; }
.setup-strip strong { color: var(--ink); }

.project-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.project-hero h1 { margin: 8px 0 7px; font: 700 27px/1.17 var(--display); letter-spacing: -.05em; }
.project-hero p { max-width: 610px; margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.55; }
.repo-link { display: inline-flex; align-items: center; gap: 7px; margin-top: 12px; color: var(--ink-soft); font: 10px var(--mono); text-decoration: none; }
.repo-link:hover { color: var(--accent-hover); text-decoration: underline; }
.task-list { display: grid; gap: 8px; }
.task-list-card { display: flex; align-items: center; gap: 12px; min-height: 65px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); text-align: left; cursor: pointer; }
.task-list-card:hover { border-color: #d2cfc6; box-shadow: 0 5px 15px rgb(35 36 31 / 4%); }
.task-list-card .activity-marker { width: 31px; height: 31px; flex-basis: 31px; }
.task-list-copy { min-width: 0; flex: 1; }
.task-list-title { overflow: hidden; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.task-list-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; color: var(--ink-faint); font-size: 10px; }
.task-separator { color: #d0cdc4; }
.notes-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.note-card { padding: 15px; border-bottom: 1px solid #f0eee8; }
.note-card:last-child { border-bottom: 0; }
.note-head { display: flex; align-items: center; gap: 9px; }
.note-head strong { min-width: 0; flex: 1; font-size: 11px; }
.note-body { margin-top: 9px; color: var(--ink-soft); font-size: 11px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
.note-empty { padding: 18px; color: var(--ink-faint); font-size: 11px; line-height: 1.55; }
.skill-list { display: grid; gap: 6px; }
.skill-chip { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fffefa; }
.skill-chip strong { display: block; font-size: 10px; }
.skill-chip p { margin: 4px 0 0; color: var(--ink-faint); font-size: 10px; line-height: 1.45; }
.skill-version { flex: 0 0 auto; color: #aaa89f; font: 9px var(--mono); }

.task-layout { display: grid; grid-template-columns: minmax(0, 1fr) 265px; align-items: start; gap: 16px; }
.task-main { min-width: 0; }
.task-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 15px; }
.task-heading { min-width: 0; }
.task-heading h1 { margin: 8px 0 0; font: 700 22px/1.2 var(--display); letter-spacing: -.045em; overflow-wrap: anywhere; }
.task-heading p { margin: 6px 0 0; color: var(--ink-faint); font: 10px var(--mono); }
.task-actions { display: flex; flex: 0 0 auto; gap: 6px; }
.task-side { display: grid; gap: 11px; }
.side-card { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.side-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.side-card-heading h2 { margin: 0; font: 700 11px var(--display); }
.side-card-heading .eyebrow { font-size: 9px; }
.scope-card { border-color: #eadbcf; background: #fffaf5; }
.scope-copy { margin: 0; color: #56564f; font-size: 11px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.scope-version { margin-top: 10px; color: #a39483; font: 9px var(--mono); }
.scope-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.task-detail-row { display: flex; align-items: flex-start; gap: 8px; margin: 9px 0; color: var(--ink-soft); font-size: 10px; line-height: 1.45; }
.task-detail-row:last-child { margin-bottom: 0; }
.detail-label { width: 70px; flex: 0 0 70px; color: var(--ink-faint); }
.detail-value { min-width: 0; overflow-wrap: anywhere; }
.task-detail-row a { color: #a34c2d; text-decoration: none; }
.task-detail-row a:hover { text-decoration: underline; }
.pause-callout { margin-top: 10px; padding: 9px; border-radius: 7px; background: #f7f0e4; color: #795d2e; font-size: 10px; line-height: 1.45; }
.chat-panel { display: flex; flex-direction: column; min-height: 510px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #fffefa; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); background: #fffefa; }
.chat-head strong { font: 700 11px var(--display); }
.chat-head span { color: var(--ink-faint); font: 9px var(--mono); }
.messages { display: flex; min-height: 270px; flex: 1; flex-direction: column; gap: 15px; padding: 20px 17px; overflow: auto; overscroll-behavior: contain; }
.messages-empty { display: grid; flex: 1; place-items: center; padding: 32px 20px; color: var(--ink-faint); text-align: center; font-size: 11px; line-height: 1.55; }
.message { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; max-width: min(90%, 680px); }
.message.user { align-self: flex-end; align-items: flex-end; }
.message-meta { display: flex; align-items: center; gap: 7px; color: var(--ink-faint); font: 9px var(--mono); }
.message-role { color: var(--ink-soft); font: 600 10px var(--sans); }
.message-bubble { padding: 10px 12px; border: 1px solid #e9e6df; border-radius: 3px 11px 11px 11px; background: #f8f7f2; color: #41423c; font-size: 11px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.user .message-bubble { border-color: #f0d8ca; border-radius: 11px 3px 11px 11px; background: #fff2e9; color: #573c2e; }
.message.system .message-bubble { border-color: #e9e6df; background: #faf9f5; color: var(--ink-soft); }
.message-images { display: flex; flex-wrap: wrap; gap: 7px; }
.message-image-link { display: block; width: 108px; height: 82px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #efede6; }
.message-image { display: block; width: 100%; height: 100%; object-fit: cover; }
.composer-shell { padding: 11px 12px 12px; border-top: 1px solid var(--line); background: #fbfaf6; }
.pending-images { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 9px; }
.pending-image { position: relative; width: 57px; height: 49px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 6px; background: #f0eee8; }
.pending-image img { width: 100%; height: 100%; object-fit: cover; }
.pending-image button { position: absolute; top: 3px; right: 3px; display: grid; width: 16px; height: 16px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: rgb(35 36 31 / 77%); color: white; font-size: 11px; line-height: 1; cursor: pointer; }
.composer-box { overflow: hidden; border: 1px solid var(--line-strong); border-radius: 8px; background: white; transition: border-color .15s, box-shadow .15s; }
.composer-box:focus-within { border-color: #d3a38b; box-shadow: 0 0 0 3px rgb(223 109 66 / 10%); }
.composer-box textarea { display: block; width: 100%; min-height: 65px; max-height: 210px; resize: vertical; padding: 11px 12px 7px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; line-height: 1.55; }
.composer-box textarea::placeholder { color: #aaa99f; }
.composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 7px 7px; }
.composer-left, .composer-right { display: flex; align-items: center; gap: 6px; }
.composer-hint { color: var(--ink-faint); font-size: 9px; }
.skill-select { max-width: 190px; height: 29px; padding: 0 26px 0 8px; border: 1px solid #e4e1d8; border-radius: 6px; background: #faf9f5; color: var(--ink-soft); font-size: 10px; }
.skill-select:disabled { opacity: .6; }
.upload-button { display: inline-flex; height: 28px; align-items: center; gap: 5px; padding: 0 7px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ink-soft); font-size: 10px; cursor: pointer; }
.upload-button:hover { border-color: var(--line); background: #f8f7f2; }
.upload-button:disabled { opacity: .45; cursor: not-allowed; }
.send-button { min-height: 30px; padding: 0 10px; font-size: 10px; }
.chat-locked { padding: 12px 14px; border-top: 1px solid var(--line); background: #f7f6f1; color: var(--ink-faint); font-size: 10px; line-height: 1.5; }
.chat-locked a { color: var(--accent-hover); }

.dialog-backdrop, dialog::backdrop { background: rgb(34 34 30 / 36%); backdrop-filter: blur(3px); }
dialog { width: min(100% - 28px, 470px); max-height: min(88vh, 760px); padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 13px; background: var(--card); color: var(--ink); box-shadow: 0 30px 80px rgb(25 25 22 / 19%); }
dialog::backdrop { background: rgb(34 34 30 / 36%); backdrop-filter: blur(3px); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 20px 22px 15px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 5px 0 0; font: 700 18px var(--display); letter-spacing: -.04em; }
.dialog-head p { margin: 6px 0 0; color: var(--ink-faint); font-size: 10px; line-height: 1.5; }
.dialog-body { padding: 17px 22px 20px; }
.field { display: grid; gap: 6px; margin: 0 0 14px; }
.field:last-child { margin-bottom: 0; }
.field label { color: var(--ink-soft); font-size: 10px; font-weight: 600; }
.field input, .field textarea, .field select { width: 100%; min-height: 38px; padding: 9px 10px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; color: var(--ink); font-size: 11px; }
.field textarea { min-height: 112px; resize: vertical; line-height: 1.55; }
.field-hint { color: var(--ink-faint); font-size: 9px; line-height: 1.4; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 20px; }
.dialog-error { margin: 0 0 13px; padding: 9px 10px; border-radius: 7px; background: var(--red-wash); color: var(--red); font-size: 10px; line-height: 1.45; }
.dialog-form[aria-busy="true"] { opacity: .68; pointer-events: none; }
.repository-field { font-family: var(--mono) !important; }
.mobile-scrim { display: none; }
.noscript { padding: 20px; color: var(--red); text-align: center; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.error-panel { margin: 16px 0; padding: 16px; border: 1px solid #ead1cc; border-radius: 9px; background: #fff8f6; color: var(--red); font-size: 11px; line-height: 1.5; }
.error-panel p { margin: 0 0 12px; }
.task-feed-empty { padding: 22px; border: 1px dashed var(--line-strong); border-radius: 9px; color: var(--ink-faint); text-align: center; font-size: 10px; line-height: 1.5; }

@keyframes pulse { 50% { opacity: .38; } }
@keyframes travel { to { transform: translateX(125%); } }

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 226px minmax(0, 1fr); }
  .content { padding-right: 24px; padding-left: 24px; }
  .task-layout { grid-template-columns: minmax(0, 1fr) 232px; gap: 12px; }
  .readiness-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: min(290px, calc(100vw - 54px)); height: 100dvh; min-height: 0; transform: translateX(-102%); transition: transform .2s ease; box-shadow: 12px 0 36px rgb(28 28 25 / 8%); }
  .sidebar.open { transform: translateX(0); }
  .mobile-scrim.open { position: fixed; inset: 0; z-index: 15; display: block; border: 0; background: rgb(30 30 27 / 28%); }
  .mobile-menu { display: inline-grid; width: 32px; height: 32px; place-items: center; margin-right: 8px; border: 1px solid var(--line); border-radius: 7px; background: #fffefa; font-size: 16px; cursor: pointer; }
  .topbar { padding: 0 17px; }
  .topbar-left { display: flex; min-width: 0; align-items: center; }
  .content { padding: 24px 18px 48px; }
  .task-layout { grid-template-columns: minmax(0, 1fr); }
  .task-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scope-card { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .topbar { height: 53px; padding: 0 12px; }
  .refresh-label { display: none; }
  .breadcrumb { font-size: 10px; }
  .content { padding: 17px 12px 36px; }
  .banner { padding: 19px 17px; }
  .banner h1 { font-size: 22px; }
  .banner-mark { width: 52px; height: 52px; flex-basis: 52px; font-size: 9px; }
  .readiness-grid { grid-template-columns: 1fr; gap: 7px; }
  .readiness-card { min-height: 85px; }
  .readiness-value { margin-top: 8px; font-size: 15px; }
  .readiness-detail { margin-top: 3px; }
  .section-heading { align-items: flex-start; }
  .section-heading .button-row { flex-wrap: wrap; justify-content: flex-end; }
  .project-hero { flex-direction: column; }
  .project-hero .button-row { width: 100%; }
  .task-topline { flex-direction: column; }
  .task-actions { width: 100%; }
  .task-side { grid-template-columns: minmax(0, 1fr); }
  .scope-card { grid-column: auto; }
  .chat-panel { min-height: 480px; }
  .messages { padding: 16px 11px; }
  .message { max-width: 96%; }
  .chat-head { padding: 11px 12px; }
  .composer-shell { padding: 9px; }
  .composer-footer { align-items: flex-end; }
  .composer-left { flex-wrap: wrap; }
  .skill-select { max-width: 150px; }
  .composer-hint { display: none; }
  .gate-card { padding: 30px 24px; }
  .activity-time { display: none; }
  .activity-row { gap: 9px; padding: 12px 10px; }
  .activity-row .status-pill { font-size: 8px; }
  dialog { width: calc(100% - 20px); }
  .dialog-head { padding: 17px 17px 13px; }
  .dialog-body { padding: 15px 17px 17px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
