:root {
  color-scheme: light;
  --canvas: #f3f1eb;
  --sidebar: #ece9e1;
  --panel: #fffefa;
  --panel-muted: #f6f4ee;
  --ink: #18201d;
  --muted: #5d625e;
  --faint: #737873;
  --line: #dcd9d0;
  --line-strong: #c7c4bb;
  --accent: #216d57;
  --accent-strong: #15523f;
  --accent-soft: #dcece5;
  --warm: #8a5a1f;
  --warm-soft: #f5e7ce;
  --danger: #93463f;
  --danger-soft: #f6e4e1;
  --focus: #0969b8;
  --shadow: 0 22px 58px rgba(42, 44, 39, 0.08);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 13px;
  font-family:
    "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", system-ui,
    -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 60% -12%, rgba(255, 255, 255, 0.9), transparent 36rem),
    var(--canvas);
}

button,
input,
textarea {
  color: inherit;
  font: inherit;
}

button,
input,
textarea,
[tabindex] {
  outline: none;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  translate: 0 -180%;
  padding: 10px 14px;
  border-radius: 9px;
  color: #fff;
  background: #101713;
  font-size: 14px;
  font-weight: 700;
}

.skip-link:focus {
  translate: 0;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.preview-strip {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 20px;
  color: #fff;
  background: #1c2a24;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset;
  font-size: 12px;
  letter-spacing: 0.01em;
}

.preview-strip strong {
  padding: 3px 8px;
  border-radius: 999px;
  color: #16231e;
  background: #f0c878;
  font-weight: 800;
}

.preview-strip span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.preview-strip span::before {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.52);
  content: "";
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(560px, 1fr) 312px;
  min-height: calc(100vh - 42px);
}

.sidebar,
.inspector {
  position: sticky;
  top: 42px;
  height: calc(100vh - 42px);
  background: rgba(239, 236, 228, 0.9);
  backdrop-filter: blur(24px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 24px 18px 18px;
  border-right: 1px solid var(--line);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 8px 22px;
}

.brand-row > span:last-child {
  display: grid;
  gap: 2px;
}

.brand-mark {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  overflow: hidden;
  border-radius: 11px;
  background: #182520;
  box-shadow: 0 8px 18px rgba(24, 37, 32, 0.16);
}

.brand-mark span {
  position: absolute;
  left: 10px;
  width: 15px;
  height: 4px;
  border-radius: 9px;
  background: #f7f3e9;
}

.brand-mark span:nth-child(1) {
  top: 9px;
}

.brand-mark span:nth-child(2) {
  top: 15px;
  width: 11px;
  background: #6db198;
}

.brand-mark span:nth-child(3) {
  top: 21px;
  width: 7px;
  background: #e7b969;
}

.brand-name {
  font-size: 16px;
  letter-spacing: -0.025em;
}

.brand-row small {
  color: var(--muted);
  font-size: 10px;
}

.primary-nav {
  display: grid;
  gap: 4px;
}

.nav-item {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.nav-item > span {
  width: 20px;
  color: #4d554f;
  font-size: 17px;
  text-align: center;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.52);
}

.nav-item.is-active {
  border-color: rgba(31, 45, 39, 0.06);
  color: var(--ink);
  background: #dedbd2;
  font-weight: 700;
}

.task-section {
  min-height: 0;
  margin-top: 28px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-heading h2,
.section-heading h3 {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.section-heading > span {
  display: grid;
  min-width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.48);
  font-size: 10px;
}

.search-box {
  display: flex;
  height: 38px;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
}

.search-box > span {
  color: var(--muted);
  font-size: 18px;
}

.search-box input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
}

.search-box input::placeholder {
  color: #777b77;
}

.search-box:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 2px rgba(9, 105, 184, 0.12);
}

.search-box input:focus-visible {
  outline: 0;
}

.search-box kbd {
  flex: 0 0 auto;
  padding: 2px 5px;
  border: 1px solid #d4d0c6;
  border-bottom-width: 2px;
  border-radius: 5px;
  color: var(--faint);
  background: #f7f5ef;
  font-family: inherit;
  font-size: 8px;
}

.task-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.task-card {
  display: grid;
  width: 100%;
  gap: 5px;
  padding: 11px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.task-card:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.4);
}

.task-card.is-active {
  border-color: #d5d1c7;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 7px 18px rgba(42, 44, 39, 0.05);
}

.task-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.task-card strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-card > span:not(.task-card-top),
.task-card small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-state {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--faint);
  background: #e9e6dd;
  font-size: 8px;
}

.task-state.is-working {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.task-state.is-done {
  color: #395c50;
  background: #e0e9e5;
}

.empty-search {
  margin: 16px 4px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 14px 8px 2px;
  border-top: 1px solid var(--line);
}

.sidebar-footer > span:last-child {
  display: grid;
  gap: 2px;
}

.sidebar-footer strong {
  font-size: 11px;
}

.sidebar-footer small {
  color: var(--muted);
  font-size: 9px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border: 2px solid #777c77;
  border-radius: 50%;
  background: transparent;
}

.workspace {
  width: min(880px, 100%);
  margin: 0 auto;
  padding: 32px 34px 60px;
}

.workspace-header,
.conversation-heading,
.inspector-heading,
.change-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  margin: 0 0 7px;
  color: #676c67;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.workspace-header h1 {
  margin: 0;
  font-size: clamp(25px, 3vw, 32px);
  letter-spacing: -0.045em;
  line-height: 1.12;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-pill,
.preview-badge,
.success-chip,
.change-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.mode-pill > span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.icon-button,
.quiet-button,
.secondary-button,
.primary-button,
.send-button {
  min-height: 38px;
  border-radius: 10px;
  font-weight: 700;
}

.icon-button {
  display: none;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
  font-size: 11px;
}

.boundary-card {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-top: 24px;
  padding: 15px 17px;
  border: 1px solid #e5c990;
  border-radius: var(--radius-md);
  color: #523b1d;
  background: #fff5df;
}

.boundary-icon {
  display: grid;
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: #82581f;
  font-size: 14px;
}

.boundary-card h2 {
  margin: 1px 0 4px;
  font-size: 13px;
}

.boundary-card p {
  margin: 0;
  color: #665033;
  font-size: 11px;
  line-height: 1.6;
}

.conversation-card {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255, 254, 250, 0.88);
  box-shadow: var(--shadow);
}

.conversation-heading {
  padding: 22px 24px 16px;
}

.conversation-heading h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.025em;
}

.quiet-button {
  padding: 7px 10px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  font-size: 10px;
}

.quiet-button:hover,
.secondary-button:hover,
.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--panel-muted);
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.tabs button {
  position: relative;
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}

.tabs button::after {
  position: absolute;
  right: 9px;
  bottom: -1px;
  left: 9px;
  height: 2px;
  border-radius: 2px;
  background: transparent;
  content: "";
}

.tabs button[aria-selected="true"] {
  color: var(--ink);
}

.tabs button[aria-selected="true"]::after {
  background: var(--accent);
}

.tabs button span {
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 999px;
  color: var(--muted);
  background: #ece9e1;
  font-size: 8px;
}

.tab-panel {
  min-height: 300px;
}

.timeline {
  padding: 22px 24px 8px;
}

.message {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 11px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.message:first-child {
  padding-top: 2px;
}

.avatar {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: #263b33;
  font-size: 10px;
  font-weight: 800;
}

.avatar.is-user {
  color: #36433d;
  background: #e2e5df;
}

.message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.message-meta strong {
  font-size: 11px;
}

.message-meta span {
  color: var(--faint);
  font-size: 9px;
  white-space: nowrap;
}

.message p,
.activity-card p,
.approval-card > p,
.terminal-placeholder p,
.diff-placeholder p {
  margin: 7px 0 0;
  color: #454b46;
  font-size: 12px;
  line-height: 1.75;
}

.result-list {
  display: grid;
  gap: 7px;
  margin: 13px 0 0;
  padding: 0;
  list-style: none;
}

.result-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #38443e;
  font-size: 11px;
}

.result-list li span {
  display: grid;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 9px;
  font-weight: 900;
}

.activity-card {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: start;
  gap: 11px;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-muted);
}

.activity-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 900;
}

.success-chip {
  padding: 4px 7px;
  font-size: 8px;
}

.approval-card {
  margin: 16px 0;
  padding: 18px;
  border: 1px solid #dfc28a;
  border-radius: var(--radius-lg);
  background: #fffaf0;
}

.approval-card[data-decision="approved"] {
  border-color: #9ac2b1;
  background: #f1f8f4;
}

.approval-card[data-decision="rejected"] {
  border-color: #d9aaa5;
  background: #fff5f3;
}

.approval-heading {
  display: flex;
  align-items: center;
  gap: 11px;
}

.approval-heading .eyebrow {
  margin-bottom: 3px;
  color: #765425;
}

.approval-heading h3 {
  margin: 0;
  font-size: 14px;
}

.approval-icon {
  display: grid;
  flex: 0 0 auto;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: #865c21;
  font-size: 13px;
  font-weight: 900;
}

.approval-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 15px 0 0;
  overflow: hidden;
  border: 1px solid #e7d7b8;
  border-radius: 10px;
  background: #e7d7b8;
}

.approval-details div {
  display: grid;
  gap: 3px;
  padding: 10px;
  background: rgba(255, 254, 250, 0.86);
}

.approval-details dt {
  color: var(--faint);
  font-size: 8px;
}

.approval-details dd {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
}

.approval-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 15px;
}

.secondary-button,
.primary-button {
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  font-size: 10px;
}

.secondary-button {
  color: var(--muted);
  background: var(--panel);
}

.primary-button {
  border-color: var(--accent-strong);
  color: #fff;
  background: var(--accent-strong);
}

.primary-button:hover {
  background: #0e4534;
}

.approval-result {
  margin: 13px 0 0;
  padding-top: 12px;
  border-top: 1px solid currentColor;
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 750;
}

.change-summary {
  padding: 22px 24px 18px;
}

.change-summary h3 {
  margin: 0;
  font-size: 16px;
}

.change-count {
  display: flex;
  gap: 6px;
  font-size: 10px;
  font-weight: 800;
}

.change-count span:first-child {
  color: var(--accent-strong);
}

.change-count span:last-child {
  color: var(--danger);
}

.change-list {
  margin: 0 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.change-list article {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}

.change-list article:last-child {
  border-bottom: 0;
}

.file-kind {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  color: #315549;
  background: #e1ece7;
  font-size: 8px;
  font-weight: 900;
}

.change-list article div {
  display: grid;
  gap: 3px;
}

.change-list strong {
  font-size: 11px;
}

.change-list small {
  color: var(--muted);
  font-size: 9px;
}

.change-badge {
  padding: 3px 6px;
  font-size: 8px;
}

.change-badge.is-new {
  color: #6b4b1e;
  background: var(--warm-soft);
}

.diff-placeholder,
.terminal-placeholder {
  display: grid;
  justify-items: center;
  margin: 16px 24px 24px;
  padding: 28px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: #f8f7f2;
  text-align: center;
}

.diff-placeholder > span,
.terminal-placeholder > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin-bottom: 11px;
  border-radius: 13px;
  color: var(--muted);
  background: #e8e5dc;
  font-weight: 800;
}

.diff-placeholder strong,
.terminal-placeholder h3 {
  margin: 0;
  font-size: 12px;
}

.terminal-placeholder {
  min-height: 270px;
  align-content: center;
}

.terminal-placeholder .secondary-button {
  margin-top: 15px;
}

.composer {
  margin: 8px 16px 16px;
  padding: 13px;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(42, 44, 39, 0.05);
}

.composer:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 2px rgba(9, 105, 184, 0.1);
}

.composer > label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.composer textarea {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  padding: 5px 1px;
  border: 0;
  background: transparent;
  line-height: 1.6;
}

.composer textarea:focus-visible {
  outline: 0;
}

.composer textarea::placeholder {
  color: #797d79;
}

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.composer-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.send-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px 8px 13px;
  border: 0;
  color: #fff;
  background: #1b5745;
  font-size: 10px;
}

.send-button span:last-child {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 50%;
  color: #1b5745;
  background: #fff;
  font-size: 12px;
}

.send-button:hover {
  background: #124535;
}

.inspector {
  padding: 28px 22px;
  overflow-y: auto;
  border-left: 1px solid var(--line);
}

.inspector-heading h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.025em;
}

.preview-badge {
  color: #654817;
  background: #f2dfb8;
}

.status-overview,
.progress-section,
.safety-section {
  margin-top: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.56);
}

.status-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-line > div {
  display: grid;
  gap: 2px;
}

.status-line strong {
  font-size: 11px;
}

.status-line span:last-child {
  color: var(--muted);
  font-size: 9px;
}

.large-status-dot {
  width: 10px;
  height: 10px;
  border: 2px solid #727772;
  border-radius: 50%;
}

.details-list {
  display: grid;
  margin: 15px 0 0;
}

.details-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 10px;
}

.details-list dt {
  color: var(--muted);
}

.details-list dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

.progress-track {
  height: 5px;
  margin-top: 13px;
  overflow: hidden;
  border-radius: 999px;
  background: #ddd9cf;
}

.progress-track span {
  display: block;
  width: 75%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.progress-section ol {
  display: grid;
  gap: 10px;
  margin: 15px 0 0;
  padding: 0;
  list-style: none;
}

.progress-section li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.progress-section li span {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 8px;
}

.progress-section li.is-complete {
  color: var(--ink);
}

.progress-section li.is-complete span {
  border-color: transparent;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-weight: 900;
}

.safety-section {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  color: #4c3a21;
  background: #f8edda;
  border-color: #e7d0a7;
}

.safety-icon {
  display: grid;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: #73501e;
}

.safety-section h3 {
  margin: 1px 0 5px;
  font-size: 11px;
}

.safety-section p {
  margin: 0;
  color: #665136;
  font-size: 9px;
  line-height: 1.65;
}

.toast {
  position: fixed;
  z-index: 90;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 15px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  color: #fff;
  background: #1d2b25;
  box-shadow: 0 16px 40px rgba(20, 28, 24, 0.24);
  font-size: 11px;
  line-height: 1.5;
}

@media (max-width: 1220px) {
  .app-shell {
    grid-template-columns: 228px minmax(0, 1fr);
  }

  .inspector {
    position: static;
    grid-column: 2;
    height: auto;
    margin: 0 28px 48px;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: rgba(239, 236, 228, 0.68);
  }

  .icon-button {
    display: inline-flex;
  }

  .workspace {
    padding-bottom: 28px;
  }
}

@media (max-width: 800px) {
  .preview-strip {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 6px 14px;
    justify-content: start;
    padding: 9px 16px;
  }

  .preview-strip strong {
    justify-self: start;
  }

  .preview-strip span::before {
    display: none;
  }

  .app-shell {
    display: block;
    min-height: auto;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 17px 16px 15px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(239, 236, 228, 0.94);
  }

  .brand-row {
    padding: 0 2px 14px;
  }

  .primary-nav {
    display: flex;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .nav-item {
    width: auto;
    min-width: max-content;
    min-height: 44px;
    padding-inline: 13px;
  }

  .search-box,
  .icon-button,
  .quiet-button,
  .secondary-button,
  .primary-button,
  .send-button,
  .tabs button {
    min-height: 44px;
  }

  .task-section {
    margin-top: 18px;
  }

  .search-box {
    max-width: 420px;
  }

  .task-list {
    display: flex;
    overflow-x: auto;
    padding: 1px 1px 7px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  .task-card {
    flex: 0 0 min(78vw, 260px);
    scroll-snap-align: start;
  }

  .sidebar-footer {
    display: none;
  }

  .workspace {
    width: 100%;
    padding: 24px 16px 18px;
  }

  .workspace-header {
    align-items: flex-start;
  }

  .workspace-header h1 {
    font-size: 25px;
  }

  .mode-pill {
    display: none;
  }

  .boundary-card {
    margin-top: 20px;
  }

  .conversation-card {
    border-radius: 19px;
  }

  .inspector {
    margin: 0 16px 32px;
    padding: 22px 18px;
    border-radius: 19px;
  }
}

@media (max-width: 520px) {
  .preview-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    font-size: 10px;
  }

  .preview-strip strong,
  .preview-strip span {
    min-width: 0;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .search-box kbd,
  .button-label {
    display: none;
  }

  .icon-button {
    min-width: 44px;
    justify-content: center;
    padding: 7px;
  }

  .boundary-card {
    padding: 13px;
  }

  .conversation-heading {
    align-items: flex-start;
    padding: 18px 17px 13px;
  }

  .quiet-button {
    min-height: 44px;
    max-width: 100px;
  }

  .tabs {
    padding: 0 10px;
    overflow-x: auto;
  }

  .tabs button {
    flex: 0 0 auto;
  }

  .timeline {
    padding: 18px 16px 6px;
  }

  .message {
    grid-template-columns: 27px minmax(0, 1fr);
    gap: 9px;
  }

  .avatar {
    width: 27px;
    height: 27px;
    border-radius: 9px;
  }

  .activity-card {
    grid-template-columns: 27px minmax(0, 1fr);
  }

  .activity-card .success-chip {
    grid-column: 2;
    justify-self: start;
  }

  .approval-card {
    padding: 15px;
  }

  .approval-details {
    grid-template-columns: 1fr;
  }

  .approval-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .approval-actions button {
    width: 100%;
  }

  .composer {
    margin: 7px 10px 10px;
  }

  .composer-footer {
    align-items: flex-end;
  }

  .composer-footer p {
    max-width: 150px;
  }

  .send-button span:first-child {
    display: none;
  }

  .send-button {
    min-width: 44px;
    justify-content: center;
    padding: 8px;
  }

  .change-summary {
    padding: 18px 16px 14px;
  }

  .change-list,
  .diff-placeholder,
  .terminal-placeholder {
    margin-right: 16px;
    margin-left: 16px;
  }

  .change-list article {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .change-badge {
    grid-column: 2;
    justify-self: start;
  }

  .toast {
    right: 16px;
    bottom: 16px;
    left: 16px;
    max-width: none;
  }
}

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

@media (prefers-contrast: more) {
  :root {
    --line: #aaa79f;
    --line-strong: #817e77;
    --muted: #414642;
  }

  .mode-pill,
  .preview-badge,
  .success-chip,
  .change-badge {
    border: 1px solid currentColor;
  }
}
