:root {
  --bg: #f2f2f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: rgba(60, 60, 67, 0.6);
  --separator: rgba(60, 60, 67, 0.14);
  --fill: rgba(120, 120, 128, 0.12);
  --blue: #007aff;
  --green: #248a3d;
  --green-bg: rgba(52, 199, 89, 0.14);
  --red: #d70015;
  --red-bg: rgba(255, 59, 48, 0.12);
  --orange: #c93400;
  --orange-bg: rgba(255, 149, 0, 0.16);
  --add-line: rgba(52, 199, 89, 0.14);
  --add-num: rgba(52, 199, 89, 0.22);
  --del-line: rgba(255, 59, 48, 0.11);
  --del-num: rgba(255, 59, 48, 0.19);
  --hunk: rgba(0, 122, 255, 0.08);
  --code-bg: #ffffff;
  --bar: rgba(242, 242, 247, 0.8);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 14px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 56px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --text: #f5f5f7;
    --muted: rgba(235, 235, 245, 0.6);
    --separator: rgba(84, 84, 88, 0.6);
    --fill: rgba(120, 120, 128, 0.24);
    --blue: #0a84ff;
    --green: #30d158;
    --green-bg: rgba(48, 209, 88, 0.18);
    --red: #ff453a;
    --red-bg: rgba(255, 69, 58, 0.18);
    --orange: #ff9f0a;
    --orange-bg: rgba(255, 159, 10, 0.18);
    --add-line: rgba(48, 209, 88, 0.13);
    --add-num: rgba(48, 209, 88, 0.22);
    --del-line: rgba(255, 69, 58, 0.13);
    --del-num: rgba(255, 69, 58, 0.22);
    --hunk: rgba(10, 132, 255, 0.14);
    --code-bg: #1c1c1e;
    --bar: rgba(0, 0, 0, 0.75);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.4 var(--font);
  letter-spacing: -0.01em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }

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

[hidden] { display: none !important; }

.mono { font-family: var(--mono); font-size: 0.86em; letter-spacing: 0; }
.muted { color: var(--muted); }
.break { overflow-wrap: anywhere; }
.block { display: block; }

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  min-height: calc(44px + var(--sat));
  padding: var(--sat) 8px 0;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

.bar-title { grid-column: 2; margin: 0; font-weight: 600; font-size: 17px; }

.bar-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  background: none;
  color: var(--blue);
  cursor: pointer;
}

#back { grid-column: 1; justify-self: start; }
.bar-end {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.bar-end [hidden] { display: none; }
.bar-version {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding-right: 2px;
}
#refresh { padding: 0 4px; }
@media (max-width: 359px) {
  .bar-end { gap: 2px; }
  .bar-end .demo-badge { padding: 2px 6px; font-size: 11px; }
}
.bar-btn svg { width: 24px; height: 24px; }
.bar-btn.spin svg { animation: spin 0.9s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

.view {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 16px calc(var(--tabbar-h) + var(--sab) + 32px);
}

.large-title { margin: 4px 0 2px; font-size: 34px; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
.subtitle { margin: 0 0 12px; color: var(--muted); font-size: 15px; overflow-wrap: anywhere; }

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + var(--sab));
  padding-bottom: var(--sab);
  background: var(--bar);
  border-top: 0.5px solid var(--separator);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.tabbar a.active { color: var(--blue); }
.tabbar svg { width: 26px; height: 26px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 0;
}

.empty { text-align: center; padding: 28px 20px; }
.empty h2 { margin: 0 0 6px; font-size: 20px; }
.empty p { margin: 0 0 16px; color: var(--muted); overflow-wrap: anywhere; }
.empty .btn { margin: 4px; }

.loading { color: var(--muted); text-align: center; padding: 24px 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: var(--fill);
  color: var(--blue);
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
}

.btn.primary { background: var(--blue); color: #fff; }
.btn.approve { background: var(--green-bg); color: var(--green); }
.btn.reject { background: var(--red-bg); color: var(--red); }
.btn:disabled { opacity: 0.5; cursor: default; }

.pills { display: flex; flex-wrap: wrap; gap: 6px; }

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--fill);
  color: var(--blue);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.pill[aria-pressed="true"] { background: var(--blue); color: #fff; }
.pill:disabled { opacity: 0.45; cursor: default; }

.filters { display: grid; gap: 10px; margin: 8px 0 12px; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }

.select {
  flex: 1 1 140px;
  min-width: 0;
  display: grid;
  gap: 4px;
}

.select-label { font-size: 13px; color: var(--muted); }

select, input, textarea {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: var(--card);
  font-size: 16px;
}

.card input, .card textarea { background: var(--fill); }
textarea { resize: vertical; min-height: 84px; }
select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.search { background: var(--fill); }

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 2px;
  border-radius: 9px;
  background: var(--fill);
}

.seg {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 44px;
  padding: 2px;
  border: 0;
  border-radius: 7px;
  background: none;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seg.active { background: var(--card); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 0 1px rgba(0, 0, 0, 0.1); }
.seg-count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

.list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
}

.list li + li { border-top: 0.5px solid var(--separator); }

.cell {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: inherit;
}

.cell:active, .review:is(a):active { background: var(--fill); }
.cell-main { flex: 1; min-width: 0; }

.cell-title {
  margin: 0 0 4px;
  font-weight: 600;
  font-size: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.cell-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  min-width: 0;
}

.cell-sub > * { min-width: 0; overflow-wrap: anywhere; }

.chip {
  display: inline-block;
  max-width: 100%;
  padding: 1px 8px;
  border-radius: 6px;
  background: var(--fill);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.add { color: var(--green); font-variant-numeric: tabular-nums; }
.del { color: var(--red); font-variant-numeric: tabular-nums; }

.badge {
  flex: none;
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--fill);
  color: var(--muted);
}

.badge-pending { background: var(--orange-bg); color: var(--orange); }
.badge-approved { background: var(--green-bg); color: var(--green); }
.badge-rejected { background: var(--red-bg); color: var(--red); }

.counts { display: flex; gap: 4px; flex: none; }

.group { margin-top: 8px; }
.group-title, .section-title {
  margin: 20px 4px 6px;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.section-title { margin: 20px 4px 8px; }

.branch-head { margin: 8px 0 12px; }
.eyebrow { margin: 0; color: var(--muted); font-size: 13px; }
.branch-name { margin: 2px 0 6px; font-size: 22px; overflow-wrap: anywhere; }

.commit-head { margin: 8px 0; }
.commit-badges { display: flex; align-items: center; gap: 8px; }
.commit-title { margin: 8px 0 4px; font-size: 24px; line-height: 1.2; font-weight: 700; overflow-wrap: anywhere; }
.commit-body { margin: 6px 0 0; white-space: pre-wrap; color: var(--muted); font-size: 15px; overflow-wrap: anywhere; }

.meta { padding: 4px 16px; }

.meta-row {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  padding: 10px 0;
  font-size: 15px;
}

.meta-row + .meta-row { border-top: 0.5px solid var(--separator); }
.meta-row dt { color: var(--muted); }
.meta-row dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; }

.review-form { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.actions .btn { padding: 0 6px; }
.hint { margin: 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }

.review { display: block; padding: 12px 16px; color: inherit; }
.review-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.review-comment { margin: 8px 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-msg { margin: 4px 0 0; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.form { display: grid; gap: 12px; }
.btn-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.btn-row .btn { padding: 0 12px; text-align: center; }
.btn.done { background: var(--green-bg); color: var(--green); }
.offscreen { position: fixed; top: 0; left: -9999px; opacity: 0; }
.sheet-current { display: grid; gap: 2px; margin: 0; }
.version { text-align: center; color: var(--muted); font-size: 13px; margin: 24px 0; }

.files-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.files-head .section-title { margin-bottom: 4px; }
.file-list { display: grid; gap: 10px; margin-top: 8px; }

.graph-card {
  margin: 8px 0 4px;
  padding: 18px 14px 16px;
  border-radius: 18px;
  background: #141416;
  color: #f5f5f7;
  overflow: visible;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.graph-rule {
  margin: 0 0 18px;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-align: center;
  overflow-wrap: anywhere;
}

.graph-flow {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 56px;
  padding: 2px 4px 4px;
  overflow: visible;
  transition: opacity 240ms ease;
}

.graph-flow.solo { gap: 12px; }

.graph-flow.is-swap {
  opacity: 0;
  transition: none;
}

.graph-arrows {
  position: absolute;
  top: 0;
  overflow: visible;
  pointer-events: none;
}

.graph-row {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.graph-node {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: auto;
  min-width: 0;
  max-width: 240px;
  min-height: 72px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: #2c2c2e;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  color: #f5f5f7;
  text-align: center;
  cursor: default;
  touch-action: manipulation;
}

.graph-node:focus-visible {
  outline: 2px solid #0a84ff;
  outline-offset: 2px;
}

.graph-node:active,
.graph-card[data-paused="true"] .graph-node { border-color: rgba(255, 255, 255, 0.45); }

.graph-phrase {
  font-size: 16px;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.graph-file {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.35;
  color: rgba(235, 235, 245, 0.62);
  overflow-wrap: anywhere;
}

.graph-empty {
  margin: 8px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--fill);
  color: var(--muted);
  font-size: 14px;
}

.graph-note {
  margin: 0;
  color: rgba(235, 235, 245, 0.62);
  font-size: 14px;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .graph-flow { transition: none; }
}

.struct-card { display: grid; gap: 10px; margin: 8px 0 4px; min-width: 0; }
.struct-partial { margin: 0; padding: 0 4px; font-size: 13px; color: var(--muted); }

.struct-file {
  min-width: 0;
  padding: 4px 0 8px;
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}

.struct-file button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.struct-file button:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }

.struct-path { padding: 10px 14px 8px; flex-wrap: wrap; }
.struct-path-text { flex: 1 1 60%; min-width: 0; font: 600 13px/1.35 var(--mono); overflow-wrap: anywhere; }
.struct-counts { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.struct-count { font-weight: 600; }

.struct-card ul { margin: 0; padding: 0; list-style: none; min-width: 0; }
.struct-file > .struct-children { display: grid; gap: 6px; padding: 0 10px; }

.struct-node {
  min-width: 0;
  border-radius: 10px;
  background: var(--fill);
  border-left: 3px solid var(--muted);
  overflow: hidden;
}

.struct-head { padding: 8px 10px; }
.struct-title { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 4px; }
.struct-name { font: 600 14px/1.3 var(--mono); overflow-wrap: anywhere; }
.struct-params { min-width: 0; color: var(--muted); font: 12px/1.3 var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

.struct-kind {
  flex: none;
  padding: 0 6px;
  border-radius: 5px;
  background: var(--card);
  color: var(--muted);
  font-size: 11px;
  line-height: 18px;
}

.node-badge { padding: 1px 8px; font-size: 11px; }
.struct-node .struct-children { padding: 0 6px 6px 14px; display: grid; gap: 2px; }
.struct-node .struct-node { background: var(--card); }

.struct-leaf-btn { padding: 5px 6px; border-radius: 7px; }
.struct-leaf-btn:active, .struct-head:active, .struct-path:active { background: var(--hunk); }
.struct-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.struct-code { flex: 1; min-width: 0; font: 12px/1.35 var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.node-added { border-left-color: var(--green); }
.node-removed { border-left-color: var(--red); }
.node-modified { border-left-color: var(--orange); }
.node-badge.node-added, .struct-count.node-added { background: var(--green-bg); color: var(--green); }
.node-badge.node-removed, .struct-count.node-removed { background: var(--red-bg); color: var(--red); }
.node-badge.node-modified, .struct-count.node-modified { background: var(--orange-bg); color: var(--orange); }
.struct-count { padding: 0 6px; border-radius: 5px; line-height: 18px; }
.struct-leaf.node-added .struct-dot { background: var(--green); }
.struct-leaf.node-removed .struct-dot { background: var(--red); }
.struct-leaf.node-modified .struct-dot { background: var(--orange); }
.struct-leaf.node-removed .struct-code { text-decoration: line-through; color: var(--muted); }

.graph-node { cursor: pointer; }
.graph-node:focus-visible { outline: 2px solid #0a84ff; outline-offset: 2px; }

.flash { animation: flash 1.6s ease-out; }
@keyframes flash { from { box-shadow: inset 0 0 0 999px rgba(10, 132, 255, 0.28); } to { box-shadow: inset 0 0 0 999px rgba(10, 132, 255, 0); } }
@media (prefers-reduced-motion: reduce) { .flash { animation: none; outline: 2px solid var(--blue); } }

.file {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 0;
  scroll-margin-top: 64px;
}

.file summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  min-width: 0;
}

.file summary::-webkit-details-marker { display: none; }
.file[open] summary { border-bottom: 0.5px solid var(--separator); }
.chev { flex: none; width: 16px; height: 16px; color: var(--muted); transition: transform 0.2s; }
.file[open] .chev { transform: rotate(90deg); }

.change {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font: 700 12px/1 var(--mono);
  background: var(--fill);
  color: var(--muted);
}

.change-A { background: var(--green-bg); color: var(--green); }
.change-D { background: var(--red-bg); color: var(--red); }
.change-M { background: var(--orange-bg); color: var(--orange); }
.change-R { background: var(--hunk); color: var(--blue); }

.file-path { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.old-path { color: var(--muted); }
.file-stats { flex: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; font-size: 13px; max-width: 45%; }
.tag { padding: 0 6px; border-radius: 5px; background: var(--fill); color: var(--muted); font-size: 11px; line-height: 18px; }

.note, .warn { margin: 0; padding: 12px 14px; font-size: 14px; color: var(--muted); }
.warn { color: var(--orange); background: var(--orange-bg); }

.diff-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--code-bg);
}

.diff-lines {
  display: inline-block;
  min-width: 100%;
  padding: 4px 0;
  font: 12px/1.55 var(--mono);
  letter-spacing: 0;
}

.ln { display: flex; min-width: 100%; }
.ln .nums {
  position: sticky;
  left: 0;
  flex: none;
  display: flex;
  background: var(--code-bg);
  color: var(--muted);
  user-select: none;
  -webkit-user-select: none;
}

.ln .no { width: calc(var(--nw) + 10px); padding: 0 5px; text-align: right; font-variant-numeric: tabular-nums; }
.ln .sign { flex: none; width: 16px; text-align: center; user-select: none; -webkit-user-select: none; }
.ln .code { flex: 1; padding-right: 12px; white-space: pre; tab-size: 4; }
.ln-add { background: var(--add-line); }
.ln-add .nums { background: linear-gradient(var(--add-num), var(--add-num)), var(--code-bg); }
.ln-add .sign { color: var(--green); }
.ln-del { background: var(--del-line); }
.ln-del .nums { background: linear-gradient(var(--del-num), var(--del-num)), var(--code-bg); }
.ln-del .sign { color: var(--red); }
.ln-hunk { background: var(--hunk); color: var(--muted); }
.ln-hunk .code, .ln-note .code { padding: 4px 12px; }
.ln-note { color: var(--muted); font-style: italic; }

.files.wrap .diff-scroll { overflow-x: hidden; }
.files.wrap .diff-lines { display: block; }
.files.wrap .ln .code { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--sab) + 16px);
  z-index: 20;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 32px);
  margin: 0;
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(30, 30, 32, 0.92);
  color: #fff;
  font-size: 14px;
  text-align: center;
}

.demo-badge {
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--orange-bg);
  color: var(--orange);
  font-size: 12px;
  font-weight: 600;
}

.conn-status { margin: 0; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.conn-status.ok { color: var(--green); }
.conn-status.bad { color: var(--red); }

.sheet-dialog {
  width: min(640px, calc(100vw - 24px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.sheet-dialog[open] { display: flex; flex-direction: column; }
.sheet-dialog::backdrop { background: rgba(0, 0, 0, 0.4); }
.sheet-scroll { overflow-y: auto; padding: 20px 20px 8px; -webkit-overflow-scrolling: touch; min-width: 0; }
.sheet-scroll h2 { margin: 0 0 8px; font-size: 22px; }
.sheet-scroll h3 { margin: 18px 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.02em; }
.sheet-dialog > .btn { margin: 8px 20px 20px; width: calc(100% - 40px); }
.setup-downloads { display: grid; gap: 10px; margin-top: 12px; }
.setup-downloads .btn { text-align: center; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; }
.steps strong { font-weight: 650; }
.code-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.setup-note { margin: 8px 0 0; font-size: 13px; color: var(--green); }
.code-block {
  margin: 10px 0 0;
  max-height: 320px;
  overflow: auto;
  padding: 12px;
  border-radius: 10px;
  background: var(--fill);
  font: 12px/1.45 var(--mono);
  white-space: pre;
  tab-size: 2;
}

@media (min-width: 720px) {
  .view { padding-left: 24px; padding-right: 24px; }
  .diff-lines { font-size: 13px; }
}
