:root {
  color-scheme: dark;
  --canvas: #18181a;
  --rail: #171719;
  --panel: #1d1d20;
  --raised: #222225;
  --raised-hover: #29292d;
  --line: #2b2b2f;
  --line-subtle: #242428;
  --control-line: #3a3a40;
  --text: #f2f2f3;
  --text-2: #b6b6bd;
  --text-3: #85858d;
  --mint: #2ee88b;
  --mint-hover: #51f19f;
  --indigo: #30318c;
  --indigo-soft: #20214b;
  --amber-bg: #302805;
  --amber: #e1c16c;
  --danger-bg: #352126;
  --danger: #ff9aa1;
  --radius-sm: 6px;
  --radius-md: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--canvas); }
body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}
button, input, select, textarea { font: inherit; color: inherit; }
button, input, select, textarea {
  border: 1px solid var(--control-line);
  border-radius: var(--radius-sm);
  background: #1b1b1e;
}
button {
  min-height: 32px;
  padding: 0 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}
button:hover { border-color: #52525a; background: var(--raised-hover); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid #2ee88b99;
  outline-offset: 2px;
}
button:disabled { cursor: not-allowed; opacity: .42; }
button.primary { border-color: var(--mint); background: var(--mint); color: #102118; }
button.primary:hover { border-color: var(--mint-hover); background: var(--mint-hover); }
button.quiet { border-color: transparent; background: transparent; color: var(--text-2); }
button.danger { border-color: #633139; background: var(--danger-bg); color: var(--danger); }
input, select, textarea { width: 100%; min-height: 36px; padding: 7px 10px; }
textarea { min-height: 72px; resize: vertical; }
label { color: var(--text-2); font-size: 12px; font-weight: 600; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: 18px; line-height: 1.3; letter-spacing: -.02em; }
h2 { margin-bottom: 6px; font-size: 18px; line-height: 1.35; letter-spacing: -.02em; }
h3 { margin-bottom: 8px; font-size: 14px; line-height: 1.4; }
small, .muted { color: var(--text-3); }
.eyebrow, .nav-heading {
  color: var(--text-3);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .09em;
}
.eyebrow { margin-bottom: 5px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.error, .global-error { border: 1px solid #693740; background: var(--danger-bg); color: #ffc0c5; }
.error { padding: 10px 12px; border-radius: var(--radius-sm); }
.global-error {
  position: fixed;
  z-index: 40;
  top: 10px;
  right: 12px;
  width: min(560px, calc(100vw - 88px));
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 36px #0008;
}
.result { color: #8af2bb; overflow-wrap: anywhere; }
pre {
  max-width: 100%;
  margin: 0;
  padding: 12px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-sm);
  background: #141416;
  font: 11px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
}
summary { cursor: pointer; font-weight: 600; }
summary::marker { color: var(--text-3); }

.login-shell { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.login-card {
  display: grid;
  width: min(380px, 100%);
  gap: 12px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 24px 70px #0007;
}
.login-card::before {
  content: "M";
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  background: var(--mint);
  color: #102118;
  font-weight: 800;
}
.login-card h1 { margin-bottom: 0; font-size: 30px; }
.login-card p { margin-bottom: 0; }
.login-card button { min-height: 40px; }

.app-shell { min-height: 100vh; padding-left: 64px; }
.topbar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  width: 64px;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 12px 8px;
  border-right: 1px solid var(--line);
  background: var(--rail);
}
.rail-brand {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--mint);
  color: #102118;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 0 0 1px #69f2a955 inset;
}
.rail-nav { display: grid; width: 100%; gap: 6px; }
.rail-button {
  display: grid;
  width: 40px;
  height: 40px;
  min-height: 40px;
  margin: 0 auto;
  padding: 0;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-3);
}
.rail-button:hover { border-color: var(--line); background: var(--raised); color: var(--text); }
.rail-button.active { border-color: #4c4eb4; background: var(--indigo); color: #fff; }
.rail-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 232px 328px minmax(0, 1fr);
}
.views, .queue, .detail { min-width: 0; background: var(--canvas); }
.views {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  padding: 0 10px 12px;
  border-right: 1px solid var(--line);
  background: var(--rail);
  overflow-y: auto;
}
.support-head {
  min-height: 72px;
  margin: 0 -10px 10px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--line);
}
.support-head > div { display: grid; gap: 1px; }
.support-head strong { font-size: 14px; }
.support-head > div span, .mode-label, .sync-status { color: var(--text-3); font-size: 10px; }
.mode-label { color: var(--amber); }
.support-head .mode-label, .support-head .sync-status { display: block; margin-top: 5px; line-height: 1.2; }
.nav-heading { margin: 12px 9px 6px; }
.view-button {
  display: flex;
  width: 100%;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 1px 0;
  padding: 0 9px;
  border-color: transparent;
  background: transparent;
  color: var(--text-2);
  text-align: left;
  font-size: 12px;
  font-weight: 500;
}
.view-button:hover { border-color: transparent; background: var(--raised); color: var(--text); }
.view-button.active { background: var(--indigo); color: #fff; font-weight: 600; }
.view-button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view-button output { flex: 0 0 auto; color: var(--text-3); font-size: 10px; font-variant-numeric: tabular-nums; }
.view-button.active output { color: #d7d7ff; }
.nav-more { margin-top: 8px; }
.nav-more > summary {
  min-height: 30px;
  padding: 7px 9px;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .09em;
}
.nav-more[open] > summary { margin-bottom: 2px; }
.nav-more .view-button { font-size: 11px; }
.nav-tools { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }

.queue {
  height: 100vh;
  border-right: 1px solid var(--line);
  background: #1a1a1c;
  overflow-y: auto;
}
.section-head {
  position: sticky;
  z-index: 8;
  top: 0;
  display: flex;
  min-height: 72px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px 10px;
  border-bottom: 1px solid var(--line);
  background: #1a1a1cf2;
  backdrop-filter: blur(10px);
}
.section-head h1 { font-size: 16px; }
#queue-hint {
  max-width: 245px;
  margin-bottom: 0;
  overflow: hidden;
  color: var(--text-3);
  font-size: 10px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.count {
  min-width: 24px;
  padding-top: 3px;
  color: var(--text-3);
  font-size: 11px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.queue-tools { display: flex; flex: 0 0 auto; align-items: center; gap: 4px; }
.toolbar-toggle {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.toolbar-toggle:hover { border-color: var(--line); background: var(--raised); }
.toolbar-toggle input { width: 14px; min-height: 14px; height: 14px; margin: 0; accent-color: var(--mint); cursor: pointer; }
.toolbar-refresh { display: grid; width: 30px; min-height: 30px; padding: 0; place-items: center; }
.toolbar-refresh svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ticket-list { display: block; }
.ticket-card {
  position: relative;
  min-width: 0;
  border: 0;
  border-bottom: 1px solid var(--line-subtle);
  border-radius: 0;
  background: transparent;
  overflow: hidden;
}
.ticket-card::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0 auto 0 0;
  width: 2px;
  background: transparent;
}
.ticket-card.selected { background: #232328; }
.ticket-card.selected::before { background: var(--mint); }
.ticket-card.selectable { display: grid; grid-template-columns: 28px minmax(0, 1fr); }
.ticket-select { display: grid; min-height: 56px; place-items: center; padding-left: 6px; }
.ticket-select input { width: 14px; min-height: 14px; height: 14px; margin: 0; accent-color: var(--mint); }
.ticket-open {
  display: grid;
  width: 100%;
  height: 56px;
  min-width: 0;
  grid-template-columns: 28px minmax(0, 1fr) 78px;
  align-items: center;
  gap: 9px;
  padding: 5px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
}
.ticket-open:hover { background: #ffffff07; }
.ticket-open[aria-current="true"] { background: transparent; }
.ticket-avatar {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid #38383e;
  border-radius: 7px;
  background: #29292d;
  color: var(--text-2);
  font-size: 9px;
  font-weight: 700;
}
.card-copy { display: grid; min-width: 0; align-content: center; }
.card-product, .card-subject, .card-preview {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-product { color: var(--text-3); font-size: 9px; font-weight: 500; line-height: 1.25; }
.card-subject { color: var(--text); font-size: 12px; font-weight: 600; line-height: 1.35; }
.card-preview { color: var(--text-3); font-size: 10px; line-height: 1.3; }
.card-bottom { display: grid; min-width: 0; justify-items: end; gap: 4px; }
.card-foot { color: var(--text-3); font-size: 9px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.status-pill {
  display: inline-block;
  max-width: 100%;
  padding: 2px 6px;
  overflow: hidden;
  border-radius: 4px;
  background: #29292d;
  color: #c9c9cf;
  font-size: 9px;
  font-weight: 650;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status-pill[data-tone="active"] { background: #1d3529; color: #91edba; }
.status-pill[data-tone="waiting"] { background: var(--amber-bg); color: #dec173; }
.status-pill[data-tone="blocked"] { background: var(--danger-bg); color: var(--danger); }
.status-pill[data-tone="done"] { background: #232d37; color: #a9c8e5; }
.empty { padding: 28px 16px; color: var(--text-3); }
.empty h2 { color: var(--text); font-size: 16px; }
.empty p { font-size: 12px; }

.detail { height: 100vh; overflow-y: auto; scroll-margin-top: 64px; }
#detail-content { width: min(100%, 900px); margin: 0 auto; padding: 0 48px 64px; }
.detail-empty { max-width: 360px; margin: 30vh auto 0; text-align: center; }
.detail-head {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 -48px;
  padding: 10px 48px;
  border-bottom: 1px solid var(--line);
}
.detail-head > div { min-width: 0; }
.detail-head h2 { margin: 0; overflow-wrap: anywhere; font-size: 17px; }
.detail-head .eyebrow { margin-bottom: 2px; }
.detail-head .status-pill { flex: 0 0 auto; }
.meta-row {
  display: flex;
  min-height: 38px;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  color: var(--text-3);
  font-size: 10px;
}
.meta-row span:not(:last-child)::after { content: "·"; margin-left: 12px; color: #55555d; }
.next-step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  margin: 10px 0 16px;
  padding: 11px 12px;
  border: 1px solid #343676;
  border-radius: var(--radius-sm);
  background: var(--indigo-soft);
  scroll-margin-top: 16px;
}
.next-step .eyebrow { margin-bottom: 3px; color: #a9aaf0; font-size: 9px; }
.next-step h3 { margin-bottom: 2px; font-size: 13px; }
.next-step p:not(.eyebrow) { margin-bottom: 0; color: #bdbde0; font-size: 11px; }
#primary-action {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  margin-left: 14px;
}
#primary-action:empty { display: none; }
#primary-action button { min-height: 30px; }
.brief { margin-bottom: 16px; padding: 8px 2px 14px; }
.brief h3 { margin-bottom: 5px; color: var(--text-3); font-size: 11px; font-weight: 600; }
.brief p { margin-bottom: 5px; overflow-wrap: anywhere; font-size: 13px; line-height: 1.6; }
#brief-status { font-size: 10px; }
.detail-sections > .panel {
  margin: 0;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  scroll-margin-top: 16px;
}
.detail-sections > .panel > summary {
  min-height: 46px;
  padding: 14px 2px;
  font-size: 12px;
  font-weight: 600;
}
.detail-sections > .panel[open] { padding-bottom: 16px; }
.detail-sections > .panel[open] > summary { margin-bottom: 2px; }
#report-details > summary { display: flex; justify-content: space-between; gap: 12px; }
#report-revision { font-size: 10px; font-weight: 400; }
.report-section + .report-section { margin-top: 16px; }
.report-section h4 { margin-bottom: 5px; color: var(--text-3); font-size: 10px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.report-section p, .report-section ul { margin: 0; overflow-wrap: anywhere; font-size: 12px; }
.report-section ul { padding-left: 18px; }
#report-decision:not(:empty) { margin-top: 18px; }
.clock-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 14px; border-bottom: 1px solid var(--line-subtle); }
.clock { min-height: 50px; padding: 9px 10px 9px 0; }
.clock + .clock { padding-left: 10px; border-left: 1px solid var(--line-subtle); }
.clock span, .clock strong { display: block; }
.clock span { color: var(--text-3); font-size: 9px; }
.clock strong { margin-top: 3px; font-size: 11px; }
.button-row, .form-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.button-row button { font-size: 11px; }
.inline-form {
  display: grid;
  gap: 8px;
  margin: 10px 0 16px;
  padding: 14px;
  border: 1px solid #303036;
  border-radius: var(--radius-md);
  background: #202024;
}
.check-label { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 400; }
.check-label input { width: auto; min-height: 14px; }
.action-feedback { padding: 7px 0 14px; font-size: 12px; }
.evidence, .link-row, .delivery-row {
  min-height: 46px;
  padding: 10px 2px;
  border-top: 1px solid var(--line-subtle);
  overflow-wrap: anywhere;
  font-size: 12px;
}
.evidence:first-child, .link-row:first-child, .delivery-row:first-child { border-top: 0; }
.evidence code { color: #9cc6ec; font-size: 10px; }
.message {
  max-width: 760px;
  margin-bottom: 10px;
  padding: 13px 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--raised);
  overflow-wrap: anywhere;
  font-size: 12px;
}
.message[data-role="customer"] { border-left-color: var(--mint); }
.message[data-role="bot"] { border-left-color: #6668cf; background: #202024; }
.message[data-role="human"] { border-left-color: #a98122; }
.message-head, .row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-3);
  font-size: 10px;
}
.message-head strong { color: var(--text-2); font-size: 11px; }
.message p { margin: 6px 0 0; white-space: pre-wrap; line-height: 1.55; }
.message small { display: block; margin-top: 5px; font-size: 9px; }
.link-row { display: flex; justify-content: space-between; gap: 12px; }
.link-row p, .delivery-row p { margin-bottom: 0; }
.selection-bar {
  position: sticky;
  z-index: 9;
  bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 10px;
  padding: 10px;
  border: 1px solid #416f55;
  border-radius: var(--radius-md);
  background: #1c2c23f2;
  box-shadow: 0 12px 30px #0007;
  font-size: 11px;
}
.selection-bar strong { width: 100%; }

.special-view .workspace { grid-template-columns: 232px minmax(0, 1fr); }
.special-view .detail { display: none; }
.special-view .queue { border-right: 0; }
.special-view .section-head { padding-inline: max(24px, calc((100% - 840px) / 2)); }
.special-view #demo-panel, .special-view #integration-panel {
  width: min(840px, calc(100% - 40px));
  margin: 22px auto 48px;
}
.demo-tools {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid #4d421f;
  border-radius: var(--radius-md);
  background: #211f18;
}
.demo-tools h2 { margin-top: 10px; font-size: 19px; }
.demo-tools p { margin-bottom: 10px; color: var(--text-2); font-size: 12px; }
.demo-badge { color: var(--amber); font-size: 9px; letter-spacing: .1em; }
.demo-step { display: flex; gap: 14px; padding-top: 16px; border-top: 1px solid #3b3727; }
.demo-step h3 { margin-bottom: 2px; }
.step-number {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #59533a;
  border-radius: 50%;
  color: var(--amber);
  font-size: 10px;
}
.integration-import, .integration-card, .bridge-card {
  margin-bottom: 10px;
  padding: 14px 16px;
  border: 1px solid #303036;
  border-radius: var(--radius-md);
  background: #202024;
}
.integration-import[open] { display: grid; gap: 10px; }
.integration-card summary strong { color: var(--text); font-weight: 550; }
.integration-card p, .bridge-card p { margin: 10px 0 0; color: var(--text-2); font-size: 12px; }
.bridge-card h2 { margin: 0; font-size: 13px; }

dialog {
  width: min(600px, calc(100% - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--control-line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 20px 70px #000a;
}
dialog::backdrop { background: #000b; backdrop-filter: blur(2px); }
#release-form { display: grid; gap: 10px; padding: 22px; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.dialog-head h2 { font-size: 19px; }
#close-release { width: 32px; min-width: 32px; min-height: 32px; padding: 0; font-size: 20px; }
.warning {
  margin-bottom: 3px;
  padding: 9px 11px;
  border: 1px solid #514517;
  border-radius: var(--radius-sm);
  background: var(--amber-bg);
  color: var(--amber);
  font-size: 11px;
}
fieldset { min-width: 0; margin: 4px 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
legend { color: var(--text-3); font-size: 11px; }
.release-tickets { display: grid; gap: 8px; }
.release-tickets label { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 400; }
.release-tickets input { width: auto; min-height: 14px; }
.preview-panel { padding-top: 16px; border-top: 1px solid var(--line); }
.preview-panel details { margin: 14px 0; color: var(--text-3); font-size: 11px; }
.preview-panel pre { max-height: 240px; }
.preview-panel .result { margin-top: 10px; font-size: 12px; }

@media (max-width: 1280px) {
  .workspace { grid-template-columns: 208px 292px minmax(0, 1fr); }
  .special-view .workspace { grid-template-columns: 208px minmax(0, 1fr); }
  #detail-content { padding-inline: 30px; }
  .detail-head { margin-inline: -30px; padding-inline: 30px; }
  .ticket-open { grid-template-columns: 26px minmax(0, 1fr) 68px; gap: 7px; padding-inline: 8px; }
}

@media (max-width: 1000px) {
  .workspace { grid-template-columns: 190px 276px minmax(0, 1fr); }
  .special-view .workspace { grid-template-columns: 190px minmax(0, 1fr); }
  .support-head { padding-inline: 11px; }
  .view-button { font-size: 11px; }
  #detail-content { padding-inline: 22px; }
  .detail-head { margin-inline: -22px; padding-inline: 22px; }
  .card-preview { display: none; }
}

@media (max-width: 850px) {
  .app-shell { padding-top: 56px; padding-left: 0; }
  .topbar {
    position: fixed;
    inset: 0 0 auto;
    width: 100%;
    height: 56px;
    flex-direction: row;
    gap: 8px;
    padding: 8px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .rail-brand { width: 32px; height: 32px; }
  .rail-nav { display: flex; width: auto; gap: 4px; }
  .rail-button { width: 40px; height: 40px; min-height: 40px; }
  .global-error { top: 64px; width: calc(100vw - 24px); }
  .workspace, .special-view .workspace { display: block; min-height: calc(100vh - 56px); }
  .views {
    position: static;
    display: block;
    width: 100%;
    height: auto;
    padding: 8px 10px;
    overflow: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .support-head {
    display: flex;
    min-height: 36px;
    align-items: center;
    justify-content: space-between;
    margin: -8px -10px 8px;
    padding: 7px 10px;
  }
  .support-head > div { display: block; }
  .support-head > div span, .support-head .sync-status { display: none; }
  .support-head .mode-label { margin: 0; }
  .nav-main, .nav-tools {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0 0 4px;
    overflow-x: auto;
    border: 0;
    scrollbar-width: thin;
  }
  .nav-tools { padding: 4px 0 0; border-top: 1px solid var(--line-subtle); }
  .nav-heading { display: none; }
  .view-button { width: auto; min-width: max-content; min-height: 40px; margin: 0; padding-inline: 11px; }
  .nav-more { display: flex; min-width: max-content; align-items: center; gap: 4px; margin: 0; }
  .nav-more > summary { display: flex; min-height: 40px; align-items: center; padding: 0 11px; border-radius: var(--radius-sm); }
  .nav-more[open] > summary { margin: 0; background: var(--raised); }
  .queue { height: auto; overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }
  .section-head { position: static; min-height: 64px; }
  .ticket-list { max-height: min(52vh, 420px); overflow-y: auto; }
  .detail { height: auto; min-height: 340px; overflow: visible; scroll-margin-top: 64px; }
  #detail-content { width: 100%; padding: 0 22px 50px; }
  .detail-head { margin-inline: -22px; padding-inline: 22px; }
  .detail-empty { margin: 48px auto; }
  .special-view .queue { min-height: calc(100vh - 56px); }
  .special-view .section-head { padding-inline: 18px; }
  .special-view #demo-panel, .special-view #integration-panel { width: calc(100% - 32px); margin-top: 16px; }
}

@media (max-width: 560px) {
  .topbar { gap: 5px; padding-inline: 8px; }
  .rail-nav { gap: 1px; }
  .rail-button { width: 36px; }
  .section-head { min-height: 62px; padding-inline: 12px; }
  .section-head h1 { font-size: 15px; }
  #queue-hint { max-width: 280px; }
  .ticket-open { grid-template-columns: 28px minmax(0, 1fr) 66px; gap: 7px; padding-inline: 9px; }
  .ticket-card.selectable { grid-template-columns: 26px minmax(0, 1fr); }
  .ticket-select { padding-left: 4px; }
  .card-preview { display: block; }
  #detail-content { padding-inline: 14px; }
  .detail-head {
    min-height: 78px;
    align-items: flex-start;
    margin-inline: -14px;
    padding: 12px 14px;
  }
  .detail-head h2 { font-size: 15px; }
  .detail-head .status-pill { margin-top: 2px; }
  .meta-row { align-items: flex-start; padding-block: 8px; }
  .next-step { display: block; }
  #primary-action { margin: 10px 0 0; }
  .clock-grid { grid-template-columns: 1fr; }
  .clock + .clock { padding-left: 0; border-top: 1px solid var(--line-subtle); border-left: 0; }
  .link-row { display: block; }
  .link-row .button-row { margin-top: 8px; }
  #release-form { padding: 18px; }
  .demo-tools { padding: 16px; }
}

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