:root {
  --bg: #f7f7f8;
  --panel: #f1f1f3;
  --card: #ffffff;
  --ink: #1f2023;
  --soft: #606168;
  --faint: #6b6c73;
  --line: #dedfe3;
  --line-2: #ececef;
  --accent: #4f5bc2;
  --danger: #a23f39;
  --warn: #9a621f;
  --review: #6749a8;
  --sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --nav-w: 216px;
  --radius: 7px;
  --radius-sm: 5px;
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
html, body { overflow-x: hidden; }
#app:has(> .theme-dark) { background: #0f1011; }
html:has(#app > .theme-dark), body:has(#app > .theme-dark) { background: #0f1011; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }
button, input, textarea, select, .task, .board-row, .page-row, .bucket, .check {
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease, opacity .15s ease;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  display: block;
}
.icon-label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-label .icon { color: var(--faint); }
.icon-label:hover .icon, .icon-label.on .icon { color: inherit; }

.shell { min-height: 100%; display: flex; color: var(--ink); background: var(--bg); }
.settings-page { height: 100%; overflow-y: auto; display: flex; color: var(--ink); background: var(--bg); }
.theme-dark {
  --bg: #0f1011;
  --panel: #151617;
  --card: #1b1c1e;
  --ink: #f1f1f2;
  --soft: #a0a0a5;
  --faint: #85868d;
  --line: #2b2c2f;
  --line-2: #232427;
  --accent: #8791f0;
  --danger: #d07862;
  --warn: #d39a55;
  --review: #c0acec;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--nav-w);
  flex: 0 0 var(--nav-w);
  height: 100vh;
  position: sticky;
  top: 0;
  overflow: hidden;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; }
.sidebar-content { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 20px; }
.nav-boards { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sidebar-head .sidebar-toggle { display: none; width: 34px; height: 34px; padding: 0; }
.brand { font-size: 16px; font-weight: 700; letter-spacing: -.01em; padding: 0 8px; display: flex; align-items: center; gap: 0; }
.brand::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 2px;
  background: var(--accent);
  flex: 0 0 auto;
}
.brand span { color: var(--faint); font-weight: 500; }
.brand-button {
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.nav-sec-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.theme-switch {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 5%, transparent);
}
.theme-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  border-radius: 999px;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .14);
  transition: transform .24s cubic-bezier(.4, .1, .2, 1);
}
.theme-switch.dark .theme-switch-thumb { transform: translateX(100%); }
.theme-switch button {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--faint);
  font-size: 12px;
  font-weight: 600;
}
.theme-switch button .icon {
  width: 14px;
  height: 14px;
  transition: transform .35s cubic-bezier(.4, .1, .2, 1);
}
.theme-switch button:hover { color: var(--soft); }
.theme-switch button.on { color: var(--ink); }
.theme-switch button.on .icon { color: var(--accent); }
.theme-switch button[data-set-theme="light"].on .icon { transform: rotate(45deg); }
.nav-sec h3 {
  margin: 0 0 8px;
  padding: 0 10px;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--faint);
}
.page-row, .plain-btn, .board-select {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--soft);
  font-weight: 500;
}
.nav-link { display: flex; text-decoration: none; }
.plain-btn.on { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); font-weight: 600; }
.page-row:hover, .plain-btn:hover, .board-row:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); }
.page-row.on { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); font-weight: 600; }
.pages { min-height: 0; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.board-create { flex: 0 0 auto; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.board-create .plain-btn { color: var(--faint); }
.board-create .plain-btn:hover { color: var(--ink); }
.board-create .plain-btn:disabled { cursor: not-allowed; opacity: .55; background: transparent; color: var(--faint); }
.board-limit { margin: 3px 10px 0; color: var(--faint); font-size: 10px; line-height: 1.35; }
.board-row { display: flex; align-items: center; border-radius: var(--radius-sm); }
.board-row.on { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.board-select { flex: 1; min-width: 0; display: flex; align-items: center; color: var(--soft); }
.board-select span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-row.on .board-select { color: var(--ink); font-weight: 600; }
.board-actions {
  display: flex;
  align-items: center;
}
.board-actions button, .board-rename-controls button {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  color: var(--faint);
}
.board-row:hover .board-actions button, .board-actions button:focus-visible { opacity: 1; }
.board-actions button:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); }
.board-actions [data-delete-board]:hover { color: var(--danger); }
.board-row-editing { display: block; padding: 4px 5px 3px; }
.board-rename { min-width: 0; }
.board-rename-controls { display: flex; align-items: center; }
.board-rename-controls input {
  flex: 1;
  min-width: 0;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 5px 7px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
}
.board-rename-controls input:focus { border-color: var(--accent); outline: 0; }
.board-rename-controls input[aria-invalid="true"] { border-color: var(--danger); }
.board-rename-controls button { opacity: 1; }
.board-rename-controls button:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); }
.board-rename-error { min-height: 0; margin: 2px 4px 0; font-size: 10px; line-height: 1.35; }
.board-rename-error:empty { display: none; }
.seg { display: flex; gap: 2px; background: color-mix(in srgb, var(--ink) 6%, transparent); border-radius: var(--radius); padding: 2px; }
.seg button { flex: 1; border: 0; background: none; border-radius: var(--radius-sm); padding: 7px 0; color: var(--soft); font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 7px; }
.seg button .icon { width: 14px; height: 14px; color: var(--faint); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.seg button.on .icon, .seg button:hover .icon { color: inherit; }
.limit-control input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Main ---------- */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.topbar { min-height: 64px; display: flex; align-items: center; gap: 16px; padding: 10px 24px; border-bottom: 1px solid var(--line-2); }
.week {
  font-size: 12px;
  font-weight: 600;
  color: var(--faint);
}
.top-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.status-error { margin: 0 24px; color: var(--danger); font-size: 12px; }
.add-list-placeholder { visibility: hidden; }
.view-switch { display: flex; gap: 2px; }
.view-switch button {
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--soft);
  padding: 6px 9px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.view-switch .icon { width: 14px; height: 14px; color: var(--faint); }
.view-switch button:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.view-switch button.on { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
.view-switch button:hover .icon { color: inherit; }
.view-switch button.on .icon { color: var(--accent); }
.icon-btn, .primary, .secondary, .danger {
  border: 0;
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.icon-btn { background: transparent; color: var(--soft); }
.icon-btn:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }
.primary { background: var(--ink); color: var(--bg); }
.primary:hover { background: color-mix(in srgb, var(--ink) 85%, var(--bg)); }
.primary:disabled { cursor: wait; opacity: .6; }
.secondary { background: transparent; color: var(--soft); border: 1px solid var(--line); }
.secondary:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); color: var(--ink); }
.danger { background: transparent; color: var(--danger); }
.danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }

/* ---------- Board grid ---------- */
.grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(230px, 1fr);
  gap: 12px;
  margin: 16px 24px 10px;
  overflow-y: auto;
  overflow-x: hidden;
}
.bucket {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: 14px 16px 10px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.bucket:hover { border-color: color-mix(in srgb, var(--ink) 16%, var(--line)); }
.bucket.dragging { opacity: .45; }
.bucket.drop-before-bucket { box-shadow: -9px 0 0 -7px var(--accent); }
.bucket.drop-after-bucket { box-shadow: 9px 0 0 -7px var(--accent); }
.bucket.over-limit { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.bucket-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; cursor: grab; }
.bucket-head input {
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  outline: 0;
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  margin-left: -6px;
  cursor: text;
}
.bucket-head input:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.bucket-head input:focus { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.count { color: var(--faint); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.over-limit .count { color: var(--warn); }
.bucket-menu { display: flex; align-items: center; align-self: center; gap: 4px; }
.bucket-menu .icon-btn { opacity: 0; width: 26px; height: 26px; padding: 0; }
.bucket:hover .bucket-menu .icon-btn, .bucket-menu .icon-btn:focus-visible { opacity: 1; }
.bucket-goal {
  width: 100%;
  margin: -2px 0 8px;
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: var(--soft);
  outline: 0;
  font-size: 12px;
  opacity: 0;
}
.bucket:hover .bucket-goal, .bucket-goal:focus, .bucket-goal:not(:placeholder-shown) { opacity: 1; }
.bucket-goal::placeholder { color: var(--faint); }
.bucket-goal:focus { border-bottom: 1px solid var(--accent); }
.bucket-goal-error { margin: -5px 0 8px; min-height: 0; font-size: 10px; }

/* ---------- Tasks ---------- */
.tasks { list-style: none; margin: 0; padding: 0; overflow-y: auto; overflow-x: hidden; flex: 1; }
.tasks.drop-into { box-shadow: inset 0 0 0 1px var(--accent); border-radius: var(--radius-sm); }
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 90px;
  color: var(--faint);
  font-size: 12px;
  text-align: center;
}
.empty-state p { margin: 0; }
.empty-state .icon { width: 20px; height: 20px; stroke-width: 1.5; opacity: .55; }
.token-list .empty-state { padding: 24px 0; }
.task {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 6px;
  margin: 0 -6px;
  border-bottom: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  cursor: grab;
}
.task:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.task:active { cursor: grabbing; }
.task.dragging { opacity: .4; }
.task.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.task.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.task.done .task-title { color: var(--faint); text-decoration: line-through; }
.check {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border: 1.5px solid color-mix(in srgb, var(--faint) 55%, var(--line));
  border-radius: 4px;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--card);
  padding: 0;
}
.check .icon { width: 11px; height: 11px; stroke-width: 3; opacity: 0; transition: opacity .15s ease; }
.check:hover { border-color: var(--accent); }
.task:not(.done) .check:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
.task:not(.done) .check:hover .icon { opacity: .6; }
.task.done .check { background: var(--accent); border-color: var(--accent); }
.task.done .check .icon { opacity: 1; }
.task-body { flex: 1; min-width: 0; }
.task-open { width: 100%; border: 0; padding: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.avatar { width: 34px; height: 34px; flex: 0 0 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .03em; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 22%); }
.avatar-small { width: 23px; height: 23px; flex-basis: 23px; font-size: 8px; }
.avatar-large { width: 44px; height: 44px; flex-basis: 44px; }
.avatar-inactive { filter: grayscale(1); opacity: .58; }
.agent-avatar .icon { width: 21px; height: 21px; stroke-width: 1.65; }
.agent-avatar.avatar-small .icon { width: 14px; height: 14px; stroke-width: 1.8; }
.agent-avatar.avatar-large .icon { width: 25px; height: 25px; }
.user-avatar { color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); box-shadow: none; }
.user-avatar .icon { width: 18px; height: 18px; stroke-width: 1.65; }
.user-avatar.avatar-small .icon { width: 13px; height: 13px; }
.tone-0 { background: #5966c8; }
.tone-1 { background: #a14f72; }
.tone-2 { background: #367b70; }
.tone-3 { background: #8b6037; }
.tone-4 { background: #7656a5; }
.tone-5 { background: #3d708f; }
.user-avatar[class*="tone-"] { color: #fff; border-color: rgb(255 255 255 / 24%); }
.task-assignee { display: inline-flex; align-items: center; gap: 5px; color: var(--faint); font-size: 11px; }
.current-user { display: inline-flex; align-items: center; }
.item-dot { flex: 0 0 auto; width: 16px; height: 20px; display: grid; place-items: center; }
.item-dot::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--faint); }
.task-title { overflow-wrap: anywhere; line-height: 1.35; display: flex; align-items: center; gap: 6px; }
.state-badge {
  flex: 0 0 auto;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: none;
}
.state-working { background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); }
.state-needs_review { background: color-mix(in srgb, var(--review) 12%, transparent); color: var(--review); }
.task-list-name, .task-date {
  margin-top: 3px;
  color: var(--faint);
  font-size: 11px;
  display: block;
}
.add-task { display: flex; gap: 9px; padding-top: 9px; align-items: center; }
.add-task .add-icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border: 1.5px dashed var(--line);
  border-radius: 4px;
  color: var(--faint);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.add-task .add-icon:hover { border-color: var(--accent); color: var(--accent); }
.add-task .add-icon .icon { width: 10px; height: 10px; }
.add-task input { min-width: 0; flex: 1; border: 0; background: transparent; outline: 0; color: inherit; border-radius: var(--radius-sm); padding: 4px 6px; margin-left: -6px; }
.add-task input:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.add-task input:focus { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.add-task input::placeholder { color: var(--faint); }
.footer {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 9px 24px 12px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
}
.foot-stat { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto; }
.dot-working { background: var(--accent); }
.dot-review { background: var(--review); }
.footer-error { color: var(--danger); letter-spacing: 0; text-transform: none; font-size: 12px; font-weight: 500; }

/* ---------- Flow ---------- */
.flow-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.flow-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 24px 0;
}
.flow-toolbar label {
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.flow-toolbar select {
  min-width: 160px;
  max-width: 280px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 7px 30px 7px 10px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
}
.flow {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 12px;
  margin: 10px 24px 10px;
  overflow: auto;
}
.flow-column {
  min-width: 0;
  min-height: 230px;
  display: flex;
  flex-direction: column;
  padding: 14px 14px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}
.flow-column.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, var(--card)); }
.flow-column > header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.flow-column > header h2 { margin: 0; font-size: 15px; }
.flow-column > header span { color: var(--faint); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.flow-cards { flex: 1; min-height: 0; list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.flow-card { border-bottom: 1px solid var(--line-2); cursor: grab; }
.flow-card:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.flow-card:active { cursor: grabbing; }
.flow-card.dragging { opacity: .4; }
.flow-card.done .flow-card-title { color: var(--faint); text-decoration: line-through; }
.flow-card-open { width: 100%; padding: 10px 6px; color: inherit; text-align: left; }
.flow-card-title { display: block; overflow-wrap: anywhere; font-weight: 600; line-height: 1.35; }
.flow-card-meta { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 5px; color: var(--faint); font-size: 11px; }
.flow-empty { padding: 28px 4px; color: var(--faint); font-size: 12px; text-align: center; }

/* ---------- Week ---------- */
.week-calendar {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 12px 28px;
}
.calendar-toolbar { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.calendar-toolbar b { margin-left: 4px; font-size: 12px; color: var(--soft); white-space: nowrap; }
.calendar-toolbar .plain-btn { width: auto; }
.calendar-toolbar .icon-btn { width: 32px; height: 32px; padding: 0; }
.calendar-toolbar .next .icon { transform: rotate(180deg); }
.calendar-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  gap: 1px;
}
.calendar-day { min-width: 0; min-height: 240px; background: var(--card); padding: 12px 10px; }
.calendar-day.drop-into { box-shadow: inset 0 0 0 1px var(--accent); }
.calendar-day > header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 2px 10px; }
.calendar-day > header span { color: var(--faint); font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.calendar-day > header b { font-size: 15px; font-variant-numeric: tabular-nums; }
.calendar-day.today > header b {
  width: 26px;
  height: 26px;
  margin: -4px -3px -4px 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--card);
}
.calendar-tasks { list-style: none; margin: 0; padding: 0; min-height: calc(100% - 34px); }
.calendar-task { margin: 0; padding: 9px 4px; gap: 8px; }
.calendar-empty { padding: 12px 4px; color: var(--faint); font-size: 11px; }

/* ---------- Today ---------- */
.today-view {
  flex: 1;
  min-height: 0;
  width: min(760px, calc(100% - 56px));
  margin: 12px auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.today-section { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; background: var(--card); }
.today-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.today-section-head span { color: var(--faint); font-size: 9px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.today-section h2 { margin: 2px 0 0; font-size: 17px; }
.today-section-head > b { color: var(--faint); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.today-section ul { list-style: none; margin: 10px 0 0; padding: 0; }
.today-notes { background: color-mix(in srgb, var(--ink) 2%, var(--card)); }
.today-notes .task { opacity: .78; }
.today-empty {
  padding: 34px 4px;
  color: var(--faint);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.today-empty p { margin: 0; }
.today-empty .icon { width: 20px; height: 20px; stroke-width: 1.5; opacity: .55; }

/* ---------- Item editor ---------- */
.detail-overlay {
  position: fixed;
  z-index: 60;
  inset: 0;
  padding: 8vh 24px 24px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: rgba(8, 9, 11, .58);
  backdrop-filter: blur(2px);
  overflow-y: auto;
  animation: detail-fade-in .16s ease-out;
}
.detail {
  width: min(720px, 100%);
  max-height: min(760px, 84vh);
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--line) 75%, var(--ink));
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .3), 0 2px 8px rgba(0, 0, 0, .16);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: detail-rise-in .18s ease-out;
}
@keyframes detail-fade-in { from { opacity: 0; } }
@keyframes detail-rise-in { from { opacity: 0; transform: translateY(8px) scale(.99); } }
.detail-head { display: flex; align-items: center; min-height: 50px; padding: 9px 12px 9px 22px; border-bottom: 1px solid var(--line-2); }
.detail-context { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--faint); font-size: 12px; }
.detail-context span:first-child { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-context b { color: var(--soft); font-weight: 600; }
.detail-close {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--faint);
  border-radius: var(--radius-sm);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-close:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }
.detail-close:disabled, .detail-actions button:disabled { cursor: wait; opacity: .5; }
.detail form { min-height: 0; display: flex; flex: 1; flex-direction: column; }
.detail-body { flex: 1; min-height: 0; padding: 28px 28px 22px; overflow-y: auto; }
.detail-title {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  outline: 0;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: -.025em;
}
.detail-title::placeholder { color: var(--faint); }
.detail-title:focus-visible, .detail-description:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 58%, transparent);
  outline-offset: 6px;
}
.detail-description {
  width: 100%;
  min-height: 150px;
  margin: 18px 0 24px;
  padding: 0;
  resize: vertical;
  border: 0;
  background: transparent;
  color: var(--ink);
  outline: 0;
  line-height: 1.55;
}
.detail-description::placeholder { color: var(--faint); }
.detail-properties {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line-2);
}
.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
}
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  background: var(--card);
  color: var(--ink);
  outline: 0;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
.field textarea { resize: vertical; min-height: 86px; }
.location-button {
  width: 100%;
  min-height: 37px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  text-align: left;
}
.location-button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.location-button b { color: var(--accent); font-size: 12px; }
.location-button:hover { border-color: var(--accent); }
.move-panel { margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--card) 94%, var(--panel)); }
.move-panel[hidden] { display: none; }
.move-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.move-panel-head span { color: var(--faint); font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.move-panel-head h3 { margin: 2px 0 0; font-size: 16px; }
.move-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.move-panel-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.detail-error { margin: 10px 0 0; min-height: 18px; }
.detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-top: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--card) 94%, var(--panel));
}
.detail-actions > div { display: flex; align-items: center; gap: 8px; }
.toggles { display: flex; gap: 10px; }
.toggles label { display: flex; align-items: center; gap: 6px; color: var(--soft); font-weight: 600; }
.toggles input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }
.status-notice { margin: 0 24px; padding: 9px 12px; display: flex; align-items: center; gap: 10px; border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--line)); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--accent) 8%, var(--card)); color: var(--soft); font-size: 12px; }
.status-notice span { flex: 1; }
.status-notice button { border: 0; background: transparent; color: var(--accent); font-weight: 650; }
.status-notice #dismiss-notice { width: 24px; height: 24px; padding: 4px; color: var(--faint); }

/* ---------- Login ---------- */
.login {
  min-height: 100%;
  display: grid;
  place-items: center;
  background: var(--bg);
  user-select: none;
}
.login form {
  width: min(400px, calc(100vw - 32px));
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 28px 22px;
}
.login h1 { margin: 22px 0 4px; font-weight: 700; font-size: 26px; letter-spacing: -.02em; }
.login p { margin: 0 0 22px; color: var(--soft); line-height: 1.45; }
.login-label {
  display: block;
  margin-bottom: 6px;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
}
.login input, .login button { user-select: auto; }
.login input { width: 100%; margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; background: var(--card); color: var(--ink); outline: 0; }
.login input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
.login .primary { width: 100%; padding: 10px; margin-top: 4px; }
.login .brand { padding: 0; }
.login .form-help { margin: -7px 0 14px; font-size: 12px; }
.login .auth-link { width: 100%; margin-top: 14px; border: 0; background: transparent; color: var(--soft); cursor: pointer; }
.login .auth-link:hover { color: var(--ink); }
.login .reset-notice { min-height: 0; margin: 18px 0 0; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line)); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--accent) 7%, var(--card)); color: var(--ink); font-size: 14px; }
.login .reset-notice:empty { display: none; }
.login .reset-notice:not(:empty) + .auth-link { margin-top: 12px; }
.error { color: var(--danger); min-height: 20px; }
.notice { color: var(--soft); min-height: 20px; }

/* ---------- Landing ---------- */
.landing {
  --bg: #f4f2ee;
  --card: #fcfbf9;
  --ink: #23221e;
  --soft: #5f5e58;
  --faint: #8b8880;
  --line: #e1ded7;
  --line-2: #eae7e0;
  --serif: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  height: 100%;
  overflow-y: auto;
  background: var(--bg);
  color: var(--ink);
  display: flex;
  flex-direction: column;
}

@keyframes landing-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes landing-settle {
  from { transform: scale(1.06); }
  to { transform: scale(1); }
}
@keyframes landing-pulse {
  0%, 100% { opacity: .35; }
  50% { opacity: 1; }
}
.landing .rise {
  animation: landing-rise .9s cubic-bezier(.22, .61, .21, 1) both;
  animation-delay: calc(var(--d, 0) * 130ms);
}
.landing [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s cubic-bezier(.22, .61, .21, 1), transform 1s cubic-bezier(.22, .61, .21, 1);
  transition-delay: calc(var(--d, 0) * 120ms);
}
.landing [data-reveal].in { opacity: 1; transform: translateY(0); }

.landing-nav {
  height: 76px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 48px);
}
.landing-nav-actions, .docs-nav-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}
.landing-nav-actions a, .docs-nav-actions a {
  color: var(--soft);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.landing-nav-actions a:hover, .docs-nav-actions a:hover { color: var(--ink); }
.nav-action {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 999px;
}
.nav-action:hover { border-color: var(--faint); }
.landing-main { flex: 1 0 auto; width: 100%; }

.landing-hero {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(12px, 4vh, 44px) clamp(20px, 4vw, 48px) 0;
  display: grid;
  grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
}
.landing-hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(42px, 4.9vw, 76px);
  line-height: 1.03;
  letter-spacing: -.022em;
  text-wrap: balance;
}
.landing-hero h1 em { font-weight: 400; }
.landing-lede {
  max-width: 520px;
  margin: 24px 0 0;
  color: var(--soft);
  font-size: 16.5px;
  line-height: 1.6;
  text-wrap: pretty;
}
.landing-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  margin-top: 32px;
}
.landing-actions .primary { padding: 11px 20px; font-size: 14px; border-radius: 8px; }
.secondary-link {
  color: var(--soft);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 4px;
  padding: 8px 0;
}
.secondary-link:hover { color: var(--ink); text-decoration-color: var(--faint); }
.hero-photo {
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: #b3aca0;
}
.hero-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 70%;
  animation: landing-settle 2.6s cubic-bezier(.16, .6, .2, 1) both;
}

.landing-preview {
  width: 100%;
  max-width: 1240px;
  margin: clamp(88px, 14vh, 150px) auto 0;
  padding: 0 clamp(20px, 4vw, 48px);
}
.tour-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 0 22px;
}
.tour-tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--faint);
  font-weight: 600;
  font-size: 13.5px;
  padding: 8px 16px;
  border-radius: 999px;
}
.tour-tab:hover { color: var(--ink); }
.tour-tab.on { color: var(--ink); background: var(--card); border-color: var(--line); }
.tour-frame {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #f4f3f1;
  box-shadow:
    0 44px 88px -52px color-mix(in srgb, var(--ink) 42%, transparent),
    0 2px 6px color-mix(in srgb, var(--ink) 4%, transparent);
}
.tour-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 0;
  opacity: 0;
  transition: opacity .5s ease;
}
.tour-img.on { opacity: 1; }
.preview-caption {
  position: relative;
  margin: 22px 0 0;
  min-height: 1.4em;
  text-align: center;
  color: var(--faint);
  font-size: 13px;
}
.tour-caption {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}
.tour-caption.on { position: static; opacity: 1; pointer-events: auto; }

.landing-principles {
  width: 100%;
  max-width: 1240px;
  margin: clamp(96px, 15vh, 170px) auto 0;
  padding: 0 clamp(20px, 4vw, 48px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 44px clamp(28px, 4vw, 56px);
}
.principles-head {
  grid-column: 1 / -1;
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(30px, 3.4vw, 46px);
  letter-spacing: -.018em;
}
.principles-sub {
  grid-column: 1 / -1;
  margin: 14px 0 8px;
  max-width: 640px;
  color: var(--soft);
  font-size: 15.5px;
  line-height: 1.65;
}
.principle { border-top: 1px solid color-mix(in srgb, var(--ink) 20%, transparent); padding-top: 24px; }
.principle-num {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.principle h3 { margin: 18px 0 10px; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.principle p { margin: 0; color: var(--soft); font-size: 14.5px; line-height: 1.65; }

.landing-manifesto {
  width: 100%;
  max-width: 1240px;
  margin: clamp(96px, 15vh, 170px) auto 0;
  padding: 0 clamp(20px, 4vw, 48px);
}
.manifesto-inner { position: relative; border-radius: 14px; overflow: hidden; }
.manifesto-inner img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transform: scale(1.05);
  transition: transform 3.2s cubic-bezier(.16, .6, .2, 1);
}
.manifesto-inner.in img { transform: scale(1); }
.manifesto-inner blockquote {
  position: absolute;
  inset: 0 clamp(28px, 7vw, 100px) 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  margin: 0;
}
.manifesto-inner blockquote p { margin: 0; }
.manifesto-line {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(24px, 3.5vw, 48px);
  line-height: 1.14;
  letter-spacing: -.018em;
  color: #33322c;
}
.manifesto-sub {
  font-size: clamp(13px, 1.1vw, 15px);
  font-weight: 600;
  letter-spacing: .04em;
  color: #5b5a53;
}

.landing-note {
  width: 100%;
  max-width: 760px;
  margin: clamp(96px, 15vh, 170px) auto 0;
  padding: 0 clamp(20px, 4vw, 48px);
}
.note-label {
  margin: 0 0 28px;
  color: var(--soft);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.note-body p {
  margin: 0 0 22px;
  font-family: var(--serif);
  font-size: clamp(18px, 2.1vw, 22px);
  line-height: 1.62;
  color: var(--ink);
}
.note-body p:last-child { margin-bottom: 0; }
.note-sign {
  margin: 32px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-weight: 700;
  font-size: 14px;
}
.note-sign span {
  display: block;
  margin-top: 3px;
  font-weight: 500;
  color: var(--faint);
  font-size: 12.5px;
}

.landing-close {
  text-align: center;
  margin: clamp(96px, 15vh, 170px) auto clamp(88px, 13vh, 150px);
  max-width: 720px;
  padding: 0 24px;
}
.landing-close h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(34px, 4.4vw, 58px);
  letter-spacing: -.02em;
  text-wrap: balance;
}
.landing-close p { margin: 18px 0 32px; color: var(--soft); font-size: 15.5px; line-height: 1.6; }
.landing-request {
  display: inline-block;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  font-size: 14px;
  padding: 13px 26px;
  border-radius: 8px;
  text-decoration: none;
  transition: background-color .15s ease;
}
.landing-request:hover { background: color-mix(in srgb, var(--ink) 85%, var(--bg)); }

.landing-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px clamp(20px, 4vw, 48px);
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 12px;
}
.landing-footer-links, .docs-footer-links { display: flex; align-items: center; gap: 18px; }
.landing-footer a { color: var(--soft); font-weight: 600; text-decoration: none; }
.landing-footer a:hover { color: var(--ink); }

/* ---------- CLI documentation ---------- */
.docs-body { background: #f4f2ee; }
.docs-page { height: auto; min-height: 100%; overflow: visible; }
.docs-brand { color: var(--ink); text-decoration: none; }
.docs-nav-actions .nav-action { color: var(--ink); }
.docs-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 52px clamp(20px, 4vw, 48px) 120px;
  display: grid;
  grid-template-columns: 180px minmax(0, 720px);
  justify-content: center;
  gap: clamp(48px, 8vw, 104px);
}
.docs-toc {
  position: sticky;
  top: 28px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 8px;
}
.docs-toc p {
  margin: 0 0 10px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.docs-toc a {
  margin-left: -10px;
  padding: 7px 10px;
  border-radius: 5px;
  color: var(--soft);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.docs-toc a:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); }
.docs-article { min-width: 0; }
.docs-hero { padding-bottom: 56px; }
.docs-eyebrow {
  margin: 0 0 18px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.docs-hero h1 {
  max-width: 680px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(42px, 5.8vw, 68px);
  font-weight: 500;
  letter-spacing: -.024em;
  line-height: 1.04;
  text-wrap: balance;
}
.docs-hero > p:last-child {
  max-width: 620px;
  margin: 24px 0 0;
  color: var(--soft);
  font-size: 17px;
  line-height: 1.65;
}
.docs-section {
  padding: 52px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 28px;
}
.docs-section h2 {
  margin: 0 0 20px;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -.018em;
}
.docs-section h3 { margin: 32px 0 12px; font-size: 16px; }
.docs-section p, .docs-section li, .docs-section dd {
  color: var(--soft);
  font-size: 14.5px;
  line-height: 1.7;
}
.docs-section p { margin: 0 0 18px; }
.docs-section ol { margin: 0 0 22px; padding-left: 22px; }
.docs-section li { padding-left: 5px; }
.docs-section a { color: var(--ink); text-decoration-color: var(--faint); text-underline-offset: 3px; }
.docs-section code {
  border-radius: 4px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  padding: 2px 5px;
  color: var(--ink);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: .9em;
}
.docs-section pre {
  margin: 22px 0;
  overflow-x: auto;
  border: 1px solid #34332f;
  border-radius: 9px;
  background: #252521;
  padding: 18px 20px;
  color: #f3f1ec;
  line-height: 1.65;
}
.docs-section pre code { padding: 0; background: transparent; color: inherit; font-size: 13px; }
.docs-note {
  margin: 26px 0;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, var(--card));
  padding: 16px 18px;
}
.docs-note strong { display: block; margin-bottom: 5px; font-size: 13px; }
.docs-note p { margin: 0; font-size: 13.5px; }
.docs-troubleshooting { margin: 0 0 30px; }
.docs-troubleshooting dt { margin-top: 24px; font-weight: 700; }
.docs-troubleshooting dd { margin: 7px 0 0; }

@media (max-width: 940px) {
  .landing-hero { grid-template-columns: 1fr; gap: 44px; }
  .hero-photo { aspect-ratio: 4 / 3; }
  .landing-principles { grid-template-columns: 1fr; gap: 30px; }
}

@media (max-width: 800px) {
  .docs-shell { display: block; padding-top: 28px; }
  .docs-toc { display: none; }
}

@media (max-width: 700px) {
  .manifesto-inner img { aspect-ratio: 4 / 3; object-position: 16% 50%; }
  .manifesto-inner blockquote {
    position: static;
    inset: auto;
    justify-content: center;
    padding: 28px 16px 4px;
    text-align: center;
  }
  .manifesto-line { color: var(--ink); font-size: clamp(26px, 7.4vw, 34px); }
  .manifesto-sub { color: var(--soft); }
  .manifesto-inner { overflow: visible; }
  .manifesto-inner img { border-radius: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .landing .rise,
  .landing [data-reveal],
  .hero-photo img,
  .manifesto-inner img {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .tour-img, .tour-caption { transition: none !important; }
  .theme-switch-thumb, .theme-switch button .icon { transition: none !important; }
  .agent-loading-mark { animation: none !important; }
}

/* ---------- Settings ---------- */
.settings-sidebar-title { margin: 4px 10px 0; color: var(--faint); font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; }
.settings-nav-link { display: flex; text-decoration: none; }
.settings-nav-link .icon { width: 14px; height: 14px; }
.settings-actions { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.settings-account-link { text-decoration: none; }
.settings-main { flex: 1; min-width: 0; background: var(--bg); padding: 36px 44px; }
.settings-panel { width: min(720px, 100%); }
.settings-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.settings-head p:not(.settings-description) { margin: 0 0 6px; color: var(--faint); font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.settings-head h1 { margin: 0; font-weight: 700; font-size: 24px; letter-spacing: -.02em; }
.settings-head .settings-description { margin: 7px 0 0; color: var(--faint); font-size: 12px; line-height: 1.5; }
.settings-section { padding: 22px 0; border-top: 1px solid var(--line); }
.settings-section:first-of-type { border-top: 0; padding-top: 0; }
.settings-section-head { margin-bottom: 14px; }
.settings-section-head h2 { margin: 0 0 4px; font-size: 16px; }
.settings-section-head p { margin: 0; color: var(--faint); font-size: 12px; line-height: 1.5; }
.settings-card { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.settings-row { min-height: 76px; padding: 15px 17px; display: flex; align-items: center; justify-content: space-between; gap: 28px; border-bottom: 1px solid var(--line-2); }
.settings-row:last-child { border-bottom: 0; }
.settings-row-copy { min-width: 0; display: grid; gap: 4px; color: var(--ink); }
.settings-row-copy strong { font-size: 12px; line-height: 1.35; }
.settings-row-copy span { color: var(--faint); font-size: 11px; line-height: 1.45; }
.settings-field-wrap { width: min(280px, 48%); flex: 0 0 auto; }
.settings-field-wrap input,
.token-create-control input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: var(--bg);
  color: var(--ink);
  outline: 0;
}
.settings-field-wrap input:focus,
.token-create-control input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
.settings-field-wrap input[aria-invalid="true"],
.token-create-control input[aria-invalid="true"] { border-color: var(--danger); }
.read-only-value { min-width: 0; max-width: 48%; overflow-wrap: anywhere; color: var(--soft); font-size: 12px; }
.profile-avatar-row .avatar { margin-right: 4px; }
.settings-card-actions {
  min-height: 58px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: color-mix(in srgb, var(--ink) 2%, var(--card));
}
.settings-status { min-height: 18px; margin: 0; color: var(--soft); font-size: 11px; line-height: 1.45; }
.settings-status.error { color: var(--danger); }
.field-error { min-height: 14px; margin: 4px 1px -2px; color: var(--danger); font-size: 10px; line-height: 1.35; }
.field-error:empty { visibility: hidden; }
.settings-page .settings-submit,
.settings-page .settings-row-actions button {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 12px;
  line-height: 1.15;
  white-space: nowrap;
}
.settings-page .settings-submit { align-self: center; }
.settings-page button:disabled { cursor: wait; opacity: .58; }
.settings-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.settings-row-actions .danger { color: var(--faint); }
.settings-row-actions .danger:hover, .settings-row-actions .danger:focus-visible { color: var(--danger); }
.settings-limit { width: min(120px, 48%); }
.theme-choice { flex: 0 0 auto; display: flex; gap: 7px; }
.theme-choice button { min-width: 92px; padding: 9px 12px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); color: var(--soft); font-weight: 600; }
.theme-choice button:hover { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 22%, var(--line)); }
.theme-choice button.on { color: var(--ink); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.theme-choice button.on .icon { color: var(--accent); }
.token-form { margin: 0; }
.token-create-control { width: min(330px, 52%); flex: 0 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; align-items: start; }
.token-create-control .field-error { grid-column: 1 / -1; }
.one-time-token { padding: 16px; border-bottom: 1px solid var(--line-2); background: color-mix(in srgb, var(--accent) 6%, var(--card)); }
.one-time-token > div:first-child { margin-bottom: 12px; }
.one-time-token strong { font-size: 12px; }
.one-time-token p { margin: 4px 0 0; color: var(--soft); font-size: 11px; line-height: 1.45; }
.token-list { display: grid; }
.token-row { display: flex; gap: 12px; align-items: center; min-height: 58px; padding: 9px 16px; border-bottom: 1px solid var(--line-2); }
.token-row:last-child { border-bottom: 0; }
.token-row > span { flex: 1; min-width: 0; display: grid; gap: 3px; overflow: hidden; text-overflow: ellipsis; }
.token-row strong { overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.token-row small { color: var(--faint); font-size: 10px; }
.token-row code { font-size: 12px; overflow-wrap: anywhere; }
.agent-credentials-link { min-height: 74px; padding: 15px 17px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.agent-credentials-link:hover { border-color: color-mix(in srgb, var(--ink) 24%, var(--line)); background: color-mix(in srgb, var(--ink) 2%, var(--card)); }
.settings-link-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--card)); }
.settings-link-icon .icon { width: 18px; height: 18px; }
.agent-credentials-link > span:nth-child(2) { min-width: 0; display: grid; gap: 4px; }
.agent-credentials-link strong { font-size: 12px; }
.agent-credentials-link small { color: var(--faint); font-size: 11px; line-height: 1.45; }
.agent-credentials-link .chevron-right { transform: rotate(180deg); color: var(--faint); }
.board-settings-context { margin: -4px 2px 0; padding: 10px 8px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--soft); }
.board-settings-context span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
.board-settings-context .icon { color: var(--accent); }
.board-settings-head h1 { overflow-wrap: anywhere; }

/* ---------- Agents ---------- */
.agents-main { flex: 1; min-width: 0; overflow-y: auto; background: var(--bg); }
.agents-wrap { width: min(940px, 100%); margin: 0 auto; padding: 44px 42px 72px; }
.agents-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; margin-bottom: 34px; }
.agents-head .eyebrow { margin: 0 0 8px; color: var(--faint); font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.agents-head h1 { margin: 0; font-size: 30px; letter-spacing: -.035em; }
.agents-head > div > p:last-child { max-width: 600px; margin: 9px 0 0; color: var(--soft); line-height: 1.55; }
.agents-wrap > .status-error { margin: -20px 0 24px; }
.agents-new-action, .agents-empty .primary, .agent-form-actions a { text-decoration: none; }
.agents-new-action { flex: 0 0 auto; margin-top: 20px; }
.agents-new-action.disabled { cursor: not-allowed; opacity: .48; }
.back-link { width: fit-content; margin: 0 0 13px -5px; padding: 4px 5px; display: inline-flex; align-items: center; gap: 4px; color: var(--faint); text-decoration: none; font-size: 12px; font-weight: 600; border-radius: var(--radius-sm); }
.back-link:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.agent-directory-meta { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.agent-directory-meta h2 { margin: 0; font-size: 14px; }
.agent-directory-meta h2 span { margin-left: 5px; color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.agent-directory-meta p { margin: 5px 0 0; color: var(--faint); font-size: 11px; }
.agent-directory { display: grid; }
.agent-directory-row { min-width: 0; min-height: 104px; border-bottom: 1px solid var(--line-2); }
.agent-directory-row.archived { opacity: .72; }
.agent-directory-link { min-width: 0; min-height: 104px; padding: 18px 4px; display: grid; grid-template-columns: auto minmax(180px, 1fr) minmax(280px, .9fr) auto; align-items: center; gap: 14px; border-radius: var(--radius-sm); color: inherit; text-decoration: none; }
.agent-directory-link:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.agent-directory-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.agent-row-arrow { color: var(--faint); transform: rotate(180deg); }
.agent-row-arrow .icon { width: 16px; height: 16px; }
.agent-identity { min-width: 0; }
.agent-name-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.agent-name-line h3 { min-width: 0; margin: 0; overflow-wrap: anywhere; font-size: 14px; }
.agent-purpose { margin: 5px 0 0; overflow-wrap: anywhere; color: var(--faint); font-size: 12px; line-height: 1.45; }
.connection-state { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 7px; color: var(--soft); background: var(--card); font-size: 9px; font-weight: 700; letter-spacing: .03em; }
.connection-state::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--faint); }
.state-connected::before { background: var(--accent); }
.state-needs-connection::before { background: var(--warn); }
.state-archived::before { width: 6px; height: 1px; border-radius: 0; }
.agent-facts { min-width: 0; margin: 0; display: grid; gap: 9px; }
.agent-facts div { min-width: 0; display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 10px; }
.agent-facts dt { color: var(--faint); font-size: 10px; }
.agent-facts dd { min-width: 0; margin: 0; overflow-wrap: anywhere; color: var(--soft); font-size: 11px; line-height: 1.35; }
.archived-agents { margin-top: 30px; border-top: 1px solid var(--line); }
.archived-agents summary { width: fit-content; margin-top: 16px; padding: 4px 2px; color: var(--soft); cursor: pointer; font-size: 12px; font-weight: 700; }
.archived-agents summary span { margin-left: 4px; color: var(--faint); font-variant-numeric: tabular-nums; }
.archived-agents > p { margin: 4px 0 6px; color: var(--faint); font-size: 11px; }
.agents-state, .agents-empty { min-height: 290px; border: 1px dashed var(--line); border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 36px; text-align: center; }
.agents-state h2, .agents-empty h2 { margin: 14px 0 6px; font-size: 17px; }
.agents-state p, .agents-empty p { max-width: 440px; margin: 0; color: var(--soft); line-height: 1.55; }
.agents-empty .primary, .agents-state .secondary { margin-top: 20px; }
.agent-state-icon, .agent-loading-mark { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line)); }
.agent-state-icon .icon, .agent-loading-mark .icon { width: 23px; height: 23px; }
.agent-loading-mark { animation: agent-pulse 1.4s ease-in-out infinite; }
@keyframes agent-pulse { 50% { transform: translateY(-2px); opacity: .65; } }
.agent-error-state .error { color: var(--danger); }
.agent-create-form, .agent-connection-result { width: min(640px, 100%); padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.agent-create-field { display: block; margin-bottom: 22px; }
.agent-create-field label { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 7px; font-weight: 700; font-size: 12px; }
.agent-create-field label span { color: var(--faint); font-size: 10px; font-weight: 500; }
.agent-create-field input, .agent-create-field textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 11px; background: var(--bg); color: var(--ink); resize: vertical; }
.agent-create-field textarea { min-height: 96px; line-height: 1.5; }
.agent-create-field input:focus, .agent-create-field textarea:focus { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.agent-create-field [aria-invalid="true"] { border-color: var(--danger); }
.agent-create-field .form-help { margin: 6px 0 0; color: var(--faint); font-size: 10px; }
.field-error { min-height: 14px; margin: 3px 0 -17px; font-size: 10px; }
.agent-create-error:empty { display: none; }
.agent-form-actions { margin-top: 24px; display: flex; justify-content: flex-end; gap: 8px; }
.connection-agent { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.connection-agent p { margin: 0 0 3px; color: var(--faint); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.connection-agent h2 { margin: 0; overflow-wrap: anywhere; font-size: 18px; }
.credential-warning { margin-bottom: 16px; padding: 13px 14px; border-left: 3px solid var(--warn); background: color-mix(in srgb, var(--warn) 7%, transparent); }
.credential-warning strong { font-size: 12px; }
.credential-warning p { margin: 3px 0 0; color: var(--soft); font-size: 11px; line-height: 1.45; }
.credential-value { display: flex; align-items: center; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.credential-value code { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--ink); font-size: 11px; }
.credential-value button { flex: 0 0 auto; }
.credential-copy-error { min-height: 15px; margin: 6px 2px 0; font-size: 10px; line-height: 1.4; }
.credential-copy-error:empty { visibility: hidden; }
.connection-steps { margin: 24px 0 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.connection-steps li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 9px; align-items: start; }
.connection-steps li > span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--accent) 11%, transparent); color: var(--accent); font-size: 10px; font-weight: 700; }
.connection-steps strong { display: block; margin: 2px 0 6px; font-size: 11px; }
.connection-steps code { display: block; max-width: 100%; overflow-wrap: anywhere; border-radius: var(--radius-sm); padding: 9px 10px; background: var(--bg); color: var(--soft); font-size: 10px; }
.agent-create-notice { margin: 18px 0 0; padding: 10px 12px; border: 1px solid var(--warn); border-radius: var(--radius-sm); color: var(--soft); background: color-mix(in srgb, var(--warn) 6%, transparent); font-size: 11px; line-height: 1.45; }

/* ---------- Agent detail ---------- */
.agent-detail-wrap > .back-link { margin-bottom: 24px; }
.agent-detail-state { min-height: 360px; }
.agent-detail-state h1 { margin: 14px 0 6px; font-size: 20px; }
.agent-detail-state a { text-decoration: none; }
.agent-detail-head { min-width: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.agent-detail-identity { min-width: 0; display: flex; align-items: flex-start; gap: 15px; }
.agent-detail-identity > .avatar { flex: 0 0 auto; width: 56px; height: 56px; }
.agent-detail-identity .agent-name-line { flex-wrap: wrap; }
.agent-detail-identity h1 { min-width: 0; margin: 0; overflow-wrap: anywhere; font-size: 28px; letter-spacing: -.035em; }
.agent-detail-identity p { max-width: 600px; margin: 7px 0 0; color: var(--soft); line-height: 1.5; overflow-wrap: anywhere; }
.agent-detail-identity .agent-last-used { color: var(--faint); font-size: 10px; }
.agent-detail-head > .primary { flex: 0 0 auto; margin-top: 8px; }
.agent-tabs { margin: 30px 0 28px; display: flex; gap: 22px; border-bottom: 1px solid var(--line); }
.agent-tabs a { position: relative; padding: 0 2px 10px; color: var(--faint); text-decoration: none; font-size: 12px; font-weight: 700; }
.agent-tabs a[aria-selected="true"] { color: var(--ink); }
.agent-tabs a[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }
.agent-tabs a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
.agent-tab-panel:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: var(--radius-sm); }
.agent-settings-card { margin-bottom: 18px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.agent-settings-card > header { min-width: 0; margin-bottom: 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.agent-settings-card > header .eyebrow { margin: 0 0 5px; color: var(--faint); font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.agent-settings-card > header h2 { margin: 0; font-size: 16px; }
.agent-settings-card > header > span { max-width: 48%; overflow-wrap: anywhere; color: var(--faint); font-size: 9px; }
.agent-settings-card > header > .icon { width: 20px; height: 20px; color: var(--faint); }
.agent-settings-card > p { max-width: 650px; margin: -4px 0 0; color: var(--soft); font-size: 11px; line-height: 1.55; }
.agent-settings-card .agent-create-field { margin-bottom: 17px; }
.agent-settings-card .field-title { display: block; margin-bottom: 7px; font-size: 11px; font-weight: 700; }
.agent-settings-card .agent-create-field small { min-height: 14px; display: block; margin-top: 5px; font-size: 10px; }
.agent-settings-actions { margin-top: 18px; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.agent-settings-actions .danger-text { color: var(--danger); }
.agent-danger-zone { border-color: color-mix(in srgb, var(--danger) 25%, var(--line)); }
.agent-lifecycle-dialog { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.agent-lifecycle-dialog > header { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: flex-start; gap: 14px; }
.agent-lifecycle-dialog > header .agent-state-icon { width: 38px; height: 38px; }
.agent-lifecycle-dialog > header .icon { width: 19px; height: 19px; }
.agent-lifecycle-dialog h2 { margin: 1px 0 6px; font-size: 17px; }
.agent-lifecycle-dialog header p { margin: 0; color: var(--soft); font-size: 11px; line-height: 1.55; }
.agent-lifecycle-dialog > .status-error { margin: 16px 0 0; }
.agent-lifecycle-pending { margin: 16px 0 0; padding: 9px 11px; border-radius: var(--radius-sm); color: var(--soft); background: color-mix(in srgb, var(--accent) 8%, transparent); font-size: 11px; }
.agent-lifecycle-pending:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.agent-lifecycle-dialog footer { margin-top: 22px; display: flex; justify-content: flex-end; gap: 8px; }
.agent-archived-note { margin: 0 0 24px; padding: 13px 15px; border: 1px solid var(--line); border-left: 3px solid var(--faint); border-radius: var(--radius-sm); background: var(--card); }
.agent-archived-note strong { font-size: 12px; }
.agent-archived-note p { margin: 4px 0 0; color: var(--soft); font-size: 11px; line-height: 1.45; }
.agent-detail-notice { margin: 0 0 22px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: var(--radius-sm); color: var(--soft); background: color-mix(in srgb, var(--accent) 6%, transparent); font-size: 11px; }
.agent-current { margin-bottom: 30px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.agent-section-heading { min-width: 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.agent-section-heading .eyebrow { margin: 0 0 5px; color: var(--faint); font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.agent-section-heading h2 { margin: 0; font-size: 17px; }
.agent-section-heading > span { color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.agent-current-list { margin-top: 14px; display: grid; gap: 6px; }
.agent-no-current { min-height: 88px; margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 9px; border: 1px dashed var(--line); border-radius: var(--radius-sm); color: var(--faint); text-align: center; }
.agent-no-current .icon { width: 18px; height: 18px; }
.agent-no-current p { margin: 0; font-size: 12px; }
.agent-work-groups { display: grid; gap: 28px; }
.agent-work-section > header { min-width: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.agent-work-section h2 { margin: 0; font-size: 14px; }
.agent-work-section header p { margin: 4px 0 0; color: var(--faint); font-size: 10px; line-height: 1.45; }
.agent-work-section header > span { color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.agent-work-list { display: grid; }
.agent-work-item { width: 100%; min-width: 0; min-height: 62px; padding: 12px 4px; display: grid; grid-template-columns: minmax(170px, 1fr) minmax(310px, auto); align-items: center; gap: 16px; border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.agent-work-item:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.agent-work-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--radius-sm); }
.agent-work-title { min-width: 0; overflow-wrap: anywhere; font-size: 12px; font-weight: 650; }
.agent-work-meta { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 9px; color: var(--faint); font-size: 9px; }
.agent-work-meta > span:not(.state-badge) { overflow-wrap: anywhere; }
.agent-work-meta .state-badge { flex: 0 0 auto; margin: 0; }
.agent-work-empty { margin: 0; padding: 18px 4px; border-bottom: 1px solid var(--line-2); color: var(--faint); font-size: 11px; }
.agent-work-truncated { margin: 8px 2px 0; color: var(--faint); font-size: 9px; }
.agent-view-all { margin-top: 32px; padding-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); }
.agent-view-all a { text-decoration: none; }
.agent-view-all p { margin: 0; color: var(--faint); font-size: 10px; }
.agent-all-work > .agent-section-heading { margin-bottom: 20px; }
.agent-page-group { margin-top: 24px; }
.agent-page-group h3 { margin: 0 0 6px; color: var(--faint); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.agent-work-page-empty { min-height: 260px; }
.agent-pagination { margin-top: 26px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; }
.agent-pagination a { text-decoration: none; }
.agent-pagination a.disabled { pointer-events: none; opacity: .42; }
  .agent-pagination span { color: var(--faint); text-align: center; font-size: 10px; font-variant-numeric: tabular-nums; }
.assign-work-dialog { max-height: min(760px, calc(100vh - 36px)); }
.assign-agent-summary { margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.assign-agent-summary > span:last-child { min-width: 0; display: grid; gap: 2px; }
.assign-agent-summary small { color: var(--faint); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
.assign-agent-summary strong { overflow-wrap: anywhere; font-size: 12px; }
.assign-actions > span { min-width: 1px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .shell, .settings-page { flex-direction: column; }
  .shell .sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    width: 100%;
    height: 56px;
    flex: 0 0 56px;
    padding: 10px 14px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .shell .sidebar-head { width: 100%; }
  .shell .sidebar-toggle { display: flex; }
  .shell .sidebar-content {
    display: none;
    position: absolute;
    top: 55px;
    left: 0;
    right: 0;
    max-height: calc(100vh - 55px);
    overflow-y: auto;
    padding: 16px 14px;
    gap: 18px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .1);
  }
  .shell .sidebar.open .sidebar-content { display: flex; }
  .shell .nav-sec-footer { margin-top: 0; }
  .settings-page .sidebar {
    width: 100%;
    height: auto;
    flex: 0 0 auto;
    padding: 10px 14px;
    position: static;
    align-items: stretch;
    gap: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }
  .settings-page .settings-sidebar-title { margin-top: 0; }
  .settings-page .settings-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .settings-page .settings-nav-link { min-width: 0; padding: 7px 4px; justify-content: center; text-align: center; white-space: nowrap; }
  .settings-page .settings-actions { margin-top: 2px; padding-top: 8px; flex-direction: row; justify-content: space-between; }
  .settings-page .settings-actions .plain-btn { width: auto; white-space: nowrap; }
  .board-settings-page .settings-actions { flex-direction: column; align-items: stretch; }
  .board-settings-page .settings-actions .plain-btn { width: 100%; white-space: normal; }
  .board-settings-page .settings-actions .plain-btn span { min-width: 0; overflow-wrap: anywhere; }
  .board-actions button { opacity: 1; }
  .bucket-menu .icon-btn { opacity: 1; }
  .bucket-goal { opacity: 1; }
  .main { width: 100%; }
  .grid { grid-template-columns: 1fr; grid-auto-rows: minmax(280px, auto); margin: 10px 14px; overflow: visible; }
  .bucket.drop-before-bucket { box-shadow: 0 -9px 0 -7px var(--accent); }
  .bucket.drop-after-bucket { box-shadow: 0 9px 0 -7px var(--accent); }
  .flow { grid-template-columns: 1fr; margin: 10px 14px 20px; overflow: visible; }
  .flow-view { overflow: visible; }
  .flow-toolbar { margin: 10px 14px 0; }
  .flow-toolbar select { flex: 1; min-width: 0; max-width: none; }
  .flow-column { min-height: 180px; }
  .week-calendar { margin: 10px 14px 20px; overflow: visible; }
  .calendar-grid { grid-template-columns: 1fr; overflow: visible; }
  .calendar-day { min-height: 140px; }
  .today-view { width: auto; margin: 10px 14px 20px; overflow: visible; }
  .topbar {
    min-height: 96px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "date" "actions";
    align-content: center;
    padding: 10px 14px;
    gap: 6px 12px;
  }
  .week { grid-area: date; display: block; white-space: normal; text-align: left; }
  .top-actions { grid-area: actions; width: 100%; margin: 0; justify-content: space-between; gap: 4px; }
  .view-switch { flex: 1; min-width: 0; }
  .view-switch button { flex: 1; padding: 7px 6px; }
  #add-list { padding: 7px 8px; white-space: nowrap; }
  .status-error { margin: 0 14px; }
  .footer { padding: 10px 16px 16px; gap: 12px; flex-wrap: wrap; }
  .settings-main { padding: 20px 14px; }
  .agents-main { width: 100%; overflow: visible; }
  .agents-wrap { padding: 28px 20px 60px; }
}

@media (max-width: 600px) {
  .view-switch button span { display: none; }
  .view-switch button { justify-content: center; padding: 7px 0; }
  .landing-nav { height: 60px; padding: 0 16px; }
  .landing-hero { padding: 16px 16px 0; }
  .landing-hero h1 { font-size: 40px; }
  .landing-preview, .landing-principles, .landing-manifesto, .landing-note { padding: 0 16px; }
  .tour-tab { padding: 7px 12px; font-size: 12.5px; }
  .landing-footer { padding: 18px 16px; }
  .landing-nav-actions, .docs-nav-actions { gap: 12px; }
  .landing-nav-actions > a:first-child { display: none; }
  .docs-shell { padding: 22px 16px 72px; }
  .docs-hero { padding-bottom: 40px; }
  .docs-hero h1 { font-size: 42px; }
  .docs-section { padding: 40px 0; }
  .docs-section h2 { font-size: 29px; }
  .docs-section pre { margin-left: -4px; margin-right: -4px; padding: 16px; }
  .settings-page .settings-nav-link { gap: 5px; font-size: 12px; }
  .settings-page .settings-nav-link .icon { width: 13px; height: 13px; }
  .settings-row { min-height: 0; padding: 14px; align-items: stretch; flex-direction: column; gap: 10px; }
  .profile-avatar-row { flex-direction: row; align-items: center; }
  .settings-field-wrap, .settings-limit, .read-only-value { width: 100%; max-width: none; }
  .theme-choice { width: 100%; }
  .theme-choice button { flex: 1; min-width: 0; }
  .token-create-control { width: 100%; }
  .settings-card-actions { align-items: flex-start; }
  .agent-credentials-link { padding: 14px; }
  .settings-head { margin-bottom: 18px; }
  .settings-section { padding: 18px 0; }
  .agents-wrap { padding: 24px 14px 44px; }
  .agents-head { display: grid; gap: 16px; margin-bottom: 24px; }
  .agents-head h1 { font-size: 26px; }
  .agents-new-action { width: 100%; margin-top: 0; }
  .agent-directory-row { padding: 0; }
  .agent-directory-link { grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; padding: 16px 2px; }
  .agent-directory-link .agent-facts { grid-column: 2 / 4; }
  .agent-facts div { grid-template-columns: 1fr; gap: 2px; }
  .agent-create-form, .agent-connection-result { padding: 18px 14px; }
  .agent-form-actions { flex-wrap: wrap; }
  .agent-form-actions > * { flex: 1; min-width: 110px; }
  .credential-value { align-items: stretch; flex-direction: column; }
  .credential-value button { align-self: flex-start; }
  .agent-detail-wrap > .back-link { margin-bottom: 18px; }
  .agent-detail-head { display: grid; gap: 16px; }
  .agent-detail-identity { gap: 11px; }
  .agent-detail-identity > .avatar { width: 48px; height: 48px; }
  .agent-detail-identity h1 { font-size: 23px; }
  .agent-detail-head > .primary { width: 100%; margin: 0; }
  .agent-tabs { margin: 24px 0 22px; }
  .agent-current { padding: 15px 12px; }
  .agent-work-item { grid-template-columns: 1fr; gap: 7px; padding: 12px 2px; }
  .agent-work-meta { justify-content: flex-start; flex-wrap: wrap; gap: 6px 9px; }
  .agent-view-all { align-items: flex-start; flex-direction: column; }
  .agent-pagination { gap: 8px; }
  .agent-pagination a { padding-left: 8px; padding-right: 8px; }
  .agent-settings-card { padding: 17px 13px; }
  .agent-settings-card > header { gap: 10px; }
  .agent-settings-card > header > span { max-width: 42%; }
  .agent-settings-actions { align-items: stretch; flex-direction: column; }
  .agent-settings-actions > * { width: 100%; }
  .agent-lifecycle-dialog { padding: 18px 14px; }
  .agent-lifecycle-dialog footer { flex-direction: column-reverse; }
  .agent-lifecycle-dialog footer button { width: 100%; }
  .detail-overlay { padding: 0; align-items: stretch; }
  .detail { width: 100%; max-height: none; min-height: 100%; border: 0; border-radius: 0; }
  .detail-head { padding-left: 16px; }
  .detail-body { padding: 24px 18px 18px; }
  .detail-title { font-size: 22px; }
  .detail-description { min-height: 130px; }
  .detail-properties { grid-template-columns: 1fr; gap: 12px; }
  .move-fields { grid-template-columns: 1fr; }
  .detail-actions { padding: 12px; }
  .detail-actions .danger { padding-left: 6px; padding-right: 6px; }
}
