:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #6a746f;
  --canvas: #f4f3ee;
  --paper: #faf9f5;
  --surface: #fffefa;
  --surface-soft: #eeece5;
  --line: #deddd6;
  --line-strong: #c8cbc3;
  --forest: #173f35;
  --forest-2: #2b6755;
  --forest-3: #3d7c68;
  --mint: #dcebe4;
  --mint-strong: #c8dfd5;
  --sand: #ebe6dc;
  --amber: #b77b3d;
  --red: #a3493f;
  --blue: #507184;
  --shadow-sm: 0 5px 18px rgb(28 42 35 / 6%);
  --shadow-md: 0 18px 48px rgb(24 39 32 / 12%);
  --shadow-lg: 0 28px 80px rgb(18 35 28 / 20%);
  --radius-sm: 10px;
  --radius-md: 15px;
  --radius-lg: 21px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { min-height: 100%; margin: 0; background: var(--canvas); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid rgb(61 124 104 / 28%); outline-offset: 2px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(29px, 4vw, 42px); line-height: 1.12; letter-spacing: -.035em; }
h2 { margin-bottom: 0; font-size: 23px; line-height: 1.25; letter-spacing: -.025em; }
h3 { font-size: 15px; line-height: 1.4; }

.loading-screen, .auth-screen {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  padding: 32px;
  background:
    radial-gradient(circle at 12% 8%, rgb(183 123 61 / 14%), transparent 29rem),
    radial-gradient(circle at 88% 88%, rgb(43 103 85 / 18%), transparent 34rem),
    var(--canvas);
}
.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--forest);
  color: white;
  font-size: 25px;
  font-weight: 820;
  box-shadow: 0 14px 32px rgb(23 63 53 / 22%);
}
.auth-card {
  width: min(440px, calc(100vw - 32px));
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgb(255 254 250 / 94%);
  box-shadow: var(--shadow-lg);
}
.auth-card .brand-mark { margin-bottom: 30px; }
.eyebrow {
  margin: 0 0 7px;
  color: var(--forest-2);
  font: 800 10px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.lead { color: var(--muted); line-height: 1.7; }
.stack { display: grid; gap: 14px; }
.field { display: grid; gap: 7px; color: #3b4641; font-size: 12px; font-weight: 720; }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--surface);
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.field textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--forest-3);
  background: white;
  box-shadow: 0 0 0 3px rgb(61 124 104 / 11%);
}
.button {
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--forest);
  color: white;
  font-size: 13px;
  font-weight: 780;
  transition: background .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.button:hover { background: var(--forest-2); box-shadow: 0 7px 18px rgb(23 63 53 / 13%); transform: translateY(-1px); }
.button.secondary { background: var(--mint); color: var(--forest); }
.button.secondary:hover { background: var(--mint-strong); box-shadow: none; }
.button.ghost { border-color: var(--line-strong); background: var(--surface); color: var(--ink); }
.button.ghost:hover { border-color: #aeb4ad; background: white; box-shadow: var(--shadow-sm); }
.button.danger { background: #f5e4e1; color: var(--red); }
.button.small { min-height: 33px; padding: 6px 10px; font-size: 11px; }
.button[disabled] { cursor: not-allowed; opacity: .45; transform: none; }
.text-button { padding: 4px; border: 0; background: transparent; color: var(--forest-2); font-weight: 760; }
.inline-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.status-line { min-height: 22px; margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.hidden { display: none !important; }

.product-shell { min-height: 100dvh; display: grid; grid-template-columns: 236px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 23px 14px 18px;
  overflow: hidden;
  background: var(--forest);
  color: white;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 7px; }
.sidebar-brand .brand-mark {
  width: 42px;
  height: 42px;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 13px;
  background: rgb(255 255 255 / 10%);
  box-shadow: none;
  font-size: 19px;
}
.sidebar-brand strong { display: block; color: white; letter-spacing: .08em; }
.sidebar-brand small { display: block; margin-top: 2px; color: rgb(255 255 255 / 55%); font-size: 10px; }
.side-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 6px; }
.side-heading span { color: rgb(255 255 255 / 52%); font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.side-heading .text-button { color: #b9dacd; font-size: 20px; }
.case-list { display: grid; gap: 6px; max-height: calc(100dvh - 240px); overflow: auto; }
.case-link {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: rgb(255 255 255 / 70%);
  text-align: left;
  line-height: 1.4;
}
.case-link:hover { background: rgb(255 255 255 / 8%); color: white; }
.case-link.active { border-color: rgb(255 255 255 / 22%); background: var(--surface); color: var(--forest); box-shadow: 0 10px 30px rgb(4 22 16 / 20%); font-weight: 780; }
.side-footer { margin-top: auto; padding: 14px 8px 4px; border-top: 1px solid rgb(255 255 255 / 11%); color: rgb(255 255 255 / 58%); font-size: 10px; }
.side-footer p { margin-bottom: 9px; }
.connection-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: var(--amber); }
.connection-dot.online { background: #74b892; box-shadow: 0 0 0 3px rgb(116 184 146 / 12%); }

.main { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 82px;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto minmax(80px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 13px 28px;
  border-bottom: 1px solid rgb(222 221 214 / 82%);
  background: rgb(250 249 245 / 90%);
  backdrop-filter: blur(18px);
}
.case-title { min-width: 0; }
.case-title h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 25px; }
.mobile-menu { display: none; }
.view-tabs { display: flex; gap: 3px; padding: 4px; border: 1px solid #e3e1da; border-radius: 12px; background: #eae8e1; }
.view-tab { padding: 8px 12px; border: 0; border-radius: 8px; background: transparent; color: #66706b; font-size: 12px; font-weight: 760; white-space: nowrap; }
.view-tab:hover { color: var(--forest); }
.view-tab.active { background: var(--surface); color: var(--forest); box-shadow: 0 2px 9px rgb(24 32 29 / 8%); }
.tab-label-short { display: none; }
.topbar > .inline-actions { justify-self: end; }
.content { padding: 30px 28px 58px; }
.content-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.content-header p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.segmented { display: inline-flex; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.segmented button { padding: 7px 11px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 760; }
.segmented button.active { background: var(--surface); color: var(--forest); box-shadow: 0 2px 8px rgb(24 32 29 / 7%); }

.board {
  display: grid;
  grid-auto-columns: minmax(270px, 1fr);
  grid-auto-flow: column;
  align-items: start;
  gap: 13px;
  padding-bottom: 18px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-color: #bcc3bd transparent;
}
.board-column {
  --column-color: #748078;
  min-height: 330px;
  max-height: calc(100dvh - 208px);
  padding: 10px;
  overflow: auto;
  border: 1px solid #dde0da;
  border-top: 3px solid var(--column-color);
  border-radius: var(--radius-md);
  background: #e9ebe6;
  scroll-snap-align: start;
}
.board-column[data-drop-group="Inbox"] { --column-color: #9b8061; }
.board-column[data-drop-group="Next"] { --column-color: #5c7d70; }
.board-column[data-drop-group="InProgress"] { --column-color: var(--forest-2); }
.board-column[data-drop-group="Waiting"] { --column-color: #ae7b44; }
.board-column[data-drop-group="Review"] { --column-color: #647989; }
.board-column[data-drop-group="Done"] { --column-color: #7b847f; }
.board-column.drop-target { border-color: var(--forest-3); background: #e1e9e3; box-shadow: inset 0 0 0 2px rgb(61 124 104 / 16%); }
.column-header {
  position: sticky;
  top: -10px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px 11px;
  background: #e9ebe6;
}
.column-header h3 { margin: 0; font-size: 13px; }
.count { min-width: 24px; height: 24px; display: grid; place-items: center; border-radius: 999px; background: rgb(255 255 255 / 74%); color: var(--muted); font-size: 10px; font-weight: 800; }
.card-list { min-height: 220px; display: grid; align-content: start; grid-auto-rows: max-content; gap: 9px; }
.task-card {
  padding: 15px;
  border: 1px solid #d9ddd7;
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 3px 12px rgb(31 43 38 / 5%);
  cursor: grab;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.task-card:hover { border-color: #b8c1bb; box-shadow: 0 9px 25px rgb(31 43 38 / 9%); transform: translateY(-2px); }
.task-card.dragging { opacity: .45; transform: rotate(1deg); }
.task-card h3 { margin-bottom: 13px; color: #1d2823; font-size: 14px; line-height: 1.5; }
.meta-row { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; color: var(--muted); font-size: 10px; }
.card-summary { margin: 13px 0 0; padding-top: 11px; border-top: 1px solid #ebeae4; color: #535e58; font-size: 11px; line-height: 1.6; }
.empty-column { padding: 48px 10px; color: #939b96; text-align: center; font-size: 10px; }

.panel { max-width: 920px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.panel-section { padding: 21px; border-bottom: 1px solid #ebe9e2; }
.panel-section:last-child { border-bottom: 0; }
.message-list { max-height: 55dvh; display: flex; flex-direction: column; gap: 12px; padding: 3px; overflow: auto; }
.message { max-width: 80%; padding: 12px 14px; border: 1px solid transparent; border-radius: 14px; background: var(--surface-soft); font-size: 12px; line-height: 1.65; white-space: pre-wrap; }
.message.human { align-self: flex-end; border-bottom-right-radius: 4px; background: var(--forest); color: white; }
.message.agent { align-self: flex-start; border-color: #cddfd6; border-bottom-left-radius: 4px; background: #e5efe9; color: #24483d; }
.message.system { align-self: center; border: 0; background: transparent; color: var(--muted); font-size: 10px; }
.message-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; font-size: 9px; opacity: .7; }
.composer { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px; }
.composer textarea { min-height: 72px; }
.checkline { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 520; }

.file-grid, .reminder-list { display: grid; gap: 11px; }
.settings-grid { max-width: 1080px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 13px; }
.file-row, .setting-card, .reminder-row, .job-row, .proposal-row { display: grid; gap: 9px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.file-row { grid-template-columns: 1fr auto; align-items: center; }
.file-row h3, .setting-card h3 { margin: 0; }
.file-meta, .muted { color: var(--muted); font-size: 10px; line-height: 1.55; }
.setting-card { padding: 20px; box-shadow: 0 3px 12px rgb(31 43 38 / 3%); }
.setting-card > .button, .setting-card > .inline-actions, .setting-card > a { justify-self: start; }
.setting-card .job-row { background: var(--paper); }
.badge { width: fit-content; display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; background: var(--mint); color: var(--forest); font-size: 9px; font-weight: 820; }
.badge.warn { background: #f4e7d4; color: #875c2a; }
.badge.danger { background: #f5e2df; color: var(--red); }
.empty-state { padding: 52px 24px; border: 1px dashed #c8c8c0; border-radius: var(--radius-lg); color: var(--muted); text-align: center; }

.dialog { width: min(650px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); padding: 0; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-lg); }
.dialog::backdrop { background: rgb(18 29 24 / 38%); backdrop-filter: blur(5px); }
.dialog-body { padding: 25px; }
.dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.dialog-head h2 { margin: 0; }
.icon-button, .drawer-close { display: grid; place-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: #55615b; }
.icon-button { width: 36px; height: 36px; font-size: 19px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.detail-block { padding: 12px; border-radius: 12px; background: var(--surface-soft); }
.detail-block dt { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.detail-block dd { margin: 5px 0 0; font-size: 12px; }
.toast-region { position: fixed; z-index: 40; right: 18px; bottom: 18px; display: grid; gap: 8px; }
.toast { max-width: 370px; padding: 12px 15px; border-radius: 12px; background: #1f2d28; color: white; box-shadow: var(--shadow-md); font-size: 12px; }
.toast.error { background: #79382f; }
.secret-box { padding: 12px; overflow-wrap: anywhere; border-radius: 10px; background: #232c29; color: #f8f5ec; font: 11px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }

.task-layer { position: fixed; inset: 0; z-index: 18; visibility: hidden; pointer-events: none; }
.task-layer.open { visibility: visible; pointer-events: auto; }
.task-scrim { position: absolute; inset: 0; width: 100%; border: 0; background: rgb(18 29 24 / 38%); backdrop-filter: blur(6px); opacity: 0; transition: opacity .2s ease; }
.task-layer.open .task-scrim { opacity: 1; }
.task-drawer { position: absolute; inset: 0 0 0 auto; width: min(850px, calc(100vw - 290px)); min-width: 620px; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--canvas); box-shadow: -24px 0 70px rgb(20 31 27 / 18%); transform: translateX(102%); transition: transform .24s ease; }
.task-layer.open .task-drawer { transform: translateX(0); }
.task-hero { display: flex; align-items: start; justify-content: space-between; gap: 28px; padding: 31px 42px 26px; border-bottom: 1px solid var(--line); background: var(--surface); }
.task-hero-copy { min-width: 0; }
.task-hero h2 { max-width: 710px; margin: 0; font-size: clamp(28px, 3vw, 38px); line-height: 1.24; letter-spacing: -.035em; }
.task-badges { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 17px; }
.badge.subtle { background: var(--surface-soft); color: #59645e; }
.drawer-close { flex: 0 0 auto; width: 43px; height: 43px; font-size: 23px; box-shadow: var(--shadow-sm); }
.drawer-close:hover { border-color: #adb4ae; color: var(--forest); }
.task-drawer-scroll { flex: 1; min-height: 0; padding-bottom: 96px; overflow: auto; }
.task-section { padding: 27px 42px; border-bottom: 1px solid var(--line); }
.task-section h3 { margin: 0 0 12px; font-size: 18px; }
.task-fields { background: var(--surface-soft); }
.detail-grid-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.section-label { margin: 0 0 8px; color: var(--forest-2); font: 800 9px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .14em; text-transform: uppercase; }
.summary-card { padding: 21px 23px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); }
.summary-card p, .section-copy { margin: 0; color: #56615c; line-height: 1.75; white-space: pre-wrap; }
.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 38px; }
.two-up > div + div { padding-left: 38px; border-left: 1px solid var(--line); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.section-heading h3 { margin-bottom: 0; }
.job-list { display: grid; gap: 10px; margin-top: 16px; }
.conversation-launch { display: flex; align-items: center; justify-content: space-between; gap: 26px; background: var(--mint); }
.conversation-launch h3 { margin-bottom: 7px; }
.task-danger { padding-block: 23px; }
.danger-text { color: var(--red); }
.task-actions { position: absolute; inset: auto 0 0; display: flex; gap: 9px; padding: 15px 42px calc(15px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgb(255 254 250 / 93%); backdrop-filter: blur(17px); }

.chat-dock { position: fixed; z-index: 24; right: 22px; bottom: 22px; width: min(450px, calc(100vw - 44px)); visibility: hidden; pointer-events: none; }
.chat-dock.open { visibility: visible; pointer-events: auto; }
.mini-chat { height: min(500px, calc(100dvh - 128px)); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 19px; background: var(--paper); box-shadow: var(--shadow-lg); transform-origin: bottom right; }
.mini-chat-head { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px 11px 17px; background: var(--forest); color: white; }
.mini-chat-title { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; }
.mini-chat-title .connection-dot { flex: 0 0 auto; margin: 0; border: 2px solid rgb(255 255 255 / 60%); }
.mini-chat-title span:last-child { min-width: 0; }
.mini-chat-title strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.mini-chat-title small { display: block; margin-top: 3px; color: rgb(255 255 255 / 63%); font-size: 9px; }
.mini-chat-controls { display: flex; gap: 3px; }
.mini-chat-controls button { width: 33px; height: 33px; border: 0; border-radius: 9px; background: transparent; color: rgb(255 255 255 / 76%); font-size: 19px; }
.mini-chat-controls button:hover { background: rgb(255 255 255 / 10%); color: white; }
.mini-chat-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 15px; }
.mini-context { flex: 0 0 auto; margin: 0 0 13px; padding: 0 3px 12px; border-bottom: 1px solid var(--line); color: #59645e; font-size: 10px; line-height: 1.5; }
.mini-context span { display: block; margin-bottom: 5px; color: var(--forest-2); font: 800 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .13em; text-transform: uppercase; }
.mini-chat .message-list { flex: 1; min-height: 0; max-height: none; padding: 2px 3px 13px; }
.mini-chat .message { max-width: 88%; font-size: 11px; box-shadow: 0 3px 10px rgb(24 40 33 / 5%); }
.mini-chat .empty-state { padding: 27px 15px; }
.mini-composer { flex: 0 0 auto; padding-top: 12px; border-top: 1px solid var(--line); }
.mini-composer .composer textarea { min-height: 56px; max-height: 115px; background: var(--surface); }
.mini-composer .checkline { font-size: 9px; }
.mini-composer fieldset { max-height: 80px; overflow: auto; }
.mini-chat-foot { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 15px; border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 9px; }
.chat-dock.minimized { width: min(400px, calc(100vw - 44px)); }
.chat-dock.minimized .mini-chat { height: 68px; }
.chat-dock.minimized .mini-chat-body, .chat-dock.minimized .mini-chat-foot { display: none; }

@media (max-width: 980px) {
  .settings-grid { grid-template-columns: 1fr; }
  .task-drawer { width: min(760px, calc(100vw - 50px)); min-width: 0; }
  .detail-grid-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-hero, .task-section { padding-inline: 28px; }
  .task-actions { padding-inline: 28px; }
}

@media (max-width: 860px) {
  .product-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: min(290px, 86vw); transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { width: 39px; height: 39px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
  .topbar { min-height: 66px; grid-template-columns: auto minmax(0, 1fr) auto; padding: 10px 14px; backdrop-filter: none; }
  .topbar .case-title { display: block; }
  .case-title .eyebrow { display: none; }
  .case-title h1 { font-size: 18px; }
  .topbar .inline-actions .button { display: none; }
  .view-tabs { position: fixed; z-index: 15; inset: auto 8px calc(8px + env(safe-area-inset-bottom)); max-width: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); overflow: visible; padding: 5px; border-color: rgb(210 211 204 / 88%); background: rgb(250 249 245 / 94%); box-shadow: 0 12px 42px rgb(18 35 28 / 22%); backdrop-filter: blur(18px); }
  .view-tab { padding: 10px 4px; font-size: 10px; }
  .tab-label { display: none; }
  .tab-label-short { display: inline; }
  .content { padding: 22px 15px calc(94px + env(safe-area-inset-bottom)); }
  .content-header { align-items: start; flex-direction: column; }
  .board-column { max-height: calc(100dvh - 215px); }
}

@media (max-width: 560px) {
  .auth-card { padding: 27px 22px; }
  .detail-grid { grid-template-columns: 1fr; }
  .file-row { grid-template-columns: 1fr; }
  .composer { grid-template-columns: 1fr; }
  .message { max-width: 94%; }
  .content-header .inline-actions { width: 100%; }
  .content-header .inline-actions > .button { margin-left: auto; }
  .board { grid-auto-columns: minmax(82vw, 1fr); }
  .task-drawer { width: 100vw; }
  .task-hero { padding: 22px 18px 18px; }
  .task-hero h2 { font-size: 27px; }
  .drawer-close { width: 39px; height: 39px; }
  .task-section { padding: 22px 18px; }
  .detail-grid-wide, .two-up { grid-template-columns: 1fr; }
  .two-up { gap: 25px; }
  .two-up > div + div { padding: 25px 0 0; border: 0; border-top: 1px solid var(--line); }
  .conversation-launch { align-items: stretch; flex-direction: column; }
  .task-actions { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, .9fr) minmax(0, .75fr); padding-inline: 18px; overflow: visible; }
  .task-actions .button { min-width: 0; padding-inline: 7px; white-space: nowrap; }
  .chat-dock { right: 8px; bottom: 8px; width: calc(100vw - 16px); }
  .mini-chat { height: min(68dvh, 570px); border-radius: 17px; }
  .chat-dock.minimized { width: calc(100vw - 16px); }
}

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