/* Cask UI tokens.
 *
 * These values are the Phase 1 visual baseline from docs/origin-parity-plan.md
 * section 9.2. Page-specific approximations are not allowed: a measured
 * correction updates the token here and every screenshot baseline together.
 */
:root {
  --canvas: #ffffff;
  --surface-subtle: #f7f7f7;
  --surface-selected: #eeeeee;
  --surface-hover: #fafafa;

  --text: #262626;
  --text-muted: #737373;
  --placeholder: #a3a3a3;

  --border: #e5e5e5;
  --border-strong: #d4d4d4;

  --button: #171717;
  --button-hover: #000000;
  --clone: #07883f;
  --clone-hover: #067134;
  /* Form controls in the reference settings screenshots are blue, not the
   * near-black used for primary buttons. */
  --accent: #2563eb;

  --merged: #7c4dce;
  --open: #16803a;
  --danger: #dc2626;
  --danger-hover: #b91c1c;

  --radius-control: 7px;
  --radius-card: 12px;
  --radius-pill: 999px;

  --h-control: 32px;
  --h-row: 44px;
  --h-bar: 52px;

  --shadow-popover: 0 8px 24px rgb(0 0 0 / 0.10);

  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid #171717;
  outline-offset: 1px;
  border-radius: 4px;
}

/* Content bounds. The shell reproduces the reference crop exactly: 24px gutters
 * with a 1120px content ceiling gives x=24/width=749 at the 797px parity
 * viewport, x=24/width=976 at 1024px, and x=160/width=1120 at 1440px. */
.shell {
  max-width: 1168px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

/* ------------------------------------------------------------------ typography */

.page-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin: 4px 0 0;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.section-help {
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0 0;
}

.meta {
  font-size: 13px;
  color: var(--text-muted);
}

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------------------------------------------ breadcrumbs */

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  padding: 12px 0 10px;
  min-height: 20px;
}

.breadcrumbs a {
  color: var(--text-muted);
}

.breadcrumbs a:hover {
  color: var(--text);
}

.breadcrumbs .crumb-current {
  color: var(--text);
  font-weight: 500;
}

.breadcrumbs .sep {
  color: var(--placeholder);
}

/* ------------------------------------------------------------------ pill tabs */

.tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--h-control);
  padding: 0 10px;
  border-radius: var(--radius-control);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.tab:hover {
  background: var(--surface-hover);
  color: var(--text);
}

/* Selected tabs are a light-gray rounded pill with a dark label, not an
 * underline. */
.tab[aria-current="page"] {
  background: var(--surface-selected);
  color: var(--text);
}

.tab .tab-icon {
  color: var(--text-muted);
  flex: none;
}

.tab[aria-current="page"] .tab-icon {
  color: var(--text);
}

.tabs-sub {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 24px;
}

/* ------------------------------------------------------------------ controls */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--h-control);
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--canvas);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  background: var(--surface-subtle);
}

.btn-primary {
  background: var(--button);
  border-color: var(--button);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--button-hover);
}

.btn-clone {
  background: var(--clone);
  border-color: var(--clone);
  color: #ffffff;
}

.btn-clone:hover {
  background: var(--clone-hover);
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #ffffff;
}

.btn-danger:hover {
  background: var(--danger-hover);
}

.btn-icon {
  width: var(--h-control);
  padding: 0;
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn[aria-disabled="true"]:hover {
  background: var(--canvas);
}

.btn-danger[aria-disabled="true"]:hover {
  background: var(--danger);
}

.btn-quiet {
  border-color: transparent;
  color: var(--text-muted);
}

.btn-quiet:hover {
  color: var(--text);
  background: var(--surface-subtle);
}

.input {
  height: var(--h-control);
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--canvas);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  width: 100%;
  min-width: 0;
}

.input::placeholder {
  color: var(--placeholder);
}

textarea.input {
  height: auto;
  padding: 8px 10px;
  line-height: 1.5;
  resize: vertical;
}

.input-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 120px;
}

.input-search .icon {
  position: absolute;
  left: 10px;
  top: 50%;
  display: flex;
  transform: translateY(-50%);
  color: var(--placeholder);
  pointer-events: none;
}

.input-search .input {
  padding-left: 32px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 13px;
  font-weight: 500;
}

/* ------------------------------------------------------------------ badges */

.badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--canvas);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-state {
  height: 24px;
  padding: 0 10px;
  gap: 5px;
  border: none;
  color: #ffffff;
}

.badge-open {
  background: var(--open);
}

.badge-merged {
  background: var(--merged);
}

.badge-closed {
  background: #737373;
}

.count-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: var(--h-control);
  padding: 0 8px;
  border-radius: var(--radius-control);
  font-size: 13px;
  color: var(--text-muted);
}

a.count-link:hover {
  background: var(--surface-subtle);
  color: var(--text);
}

.count-link strong {
  color: var(--text);
  font-weight: 600;
}

.count-link[aria-disabled="true"] {
  cursor: default;
}

/* ------------------------------------------------------------------ repo header */

.repo-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  margin-bottom: 12px;
}

.repo-head .repo-name {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.repo-icon {
  color: var(--text);
  flex: none;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.toolbar-spacer {
  flex: 1 1 auto;
}

.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-subtle);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* ------------------------------------------------------------------ cards & tables */

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--canvas);
  overflow: hidden;
}

.panel + .panel {
  margin-top: 16px;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--canvas);
  padding: 16px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th {
  height: 40px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: var(--canvas);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.table td {
  height: var(--h-row);
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover {
  background: var(--surface-hover);
}

.table .col-right {
  text-align: right;
  color: var(--text-muted);
  font-size: 13px;
  white-space: nowrap;
}

.table .col-msg {
  color: var(--text-muted);
  font-size: 13px;
  max-width: 380px;
}

.table-scroll {
  overflow-x: auto;
}

.name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.name-cell .icon {
  color: var(--text-muted);
  flex: none;
}

.name-cell a:hover {
  text-decoration: underline;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 168px;
  padding: 32px 24px;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

/* ------------------------------------------------------------------ last commit bar */

.commit-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--h-bar);
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  background: var(--surface-subtle);
  font-size: 13px;
}

.commit-bar + .panel {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: none;
  margin-top: 0;
}

.commit-bar .avatar {
  flex: none;
}

.commit-bar .author {
  font-weight: 500;
  color: var(--text);
}

.commit-bar .subject {
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commit-bar .subject:hover {
  text-decoration: underline;
}

.commit-bar .bar-spacer {
  flex: 1 1 auto;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-pill);
  background: var(--surface-selected);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.avatar-lg {
  width: 24px;
  height: 24px;
  font-size: 11px;
}

/* ------------------------------------------------------------------ popovers */

.popover-host {
  position: relative;
  display: inline-flex;
}

.popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: 332px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--canvas);
  box-shadow: var(--shadow-popover);
}

.popover[hidden] {
  display: none;
}

.popover-left {
  right: auto;
  left: 0;
}

.popover-menu {
  width: 280px;
  padding: 8px;
}

.popover-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

.popover-help {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 8px;
}

.copy-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.copy-row .input {
  font-family: var(--font-mono);
  font-size: 12px;
}

.menu-list {
  max-height: 260px;
  overflow-y: auto;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.menu-item:hover,
.menu-item:focus-visible {
  background: var(--surface-subtle);
}

.menu-item[aria-selected="true"] {
  background: var(--surface-selected);
  font-weight: 500;
}

/* ------------------------------------------------------------------ dialogs */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgb(0 0 0 / 0.32);
}

.overlay[hidden] {
  display: none;
}

.dialog {
  width: 440px;
  max-width: 100%;
  padding: 16px;
  border-radius: var(--radius-card);
  background: var(--canvas);
  box-shadow: var(--shadow-popover);
}

.dialog-wide {
  width: 480px;
  padding: 24px;
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.dialog-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.dialog-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 2px 0 0;
}

.dialog-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dialog-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}

.command-surface {
  padding: 12px;
  border-radius: var(--radius-control);
  background: var(--surface-subtle);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--text);
  overflow-x: auto;
  white-space: pre;
}

/* ------------------------------------------------------------------ file view */

.file-path {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 14px;
}

.file-path .sep {
  color: var(--placeholder);
}

.file-path .current {
  font-weight: 600;
}

.file-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  background: var(--surface-subtle);
  font-size: 13px;
  color: var(--text-muted);
}

.file-actions + .panel {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  margin-top: 0;
}

.code-block {
  margin: 0;
  padding: 12px 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  tab-size: 4;
}

.code-line {
  display: flex;
}

.code-line:hover {
  background: var(--surface-hover);
}

.code-line .ln {
  flex: none;
  width: 52px;
  padding-right: 16px;
  color: var(--placeholder);
  text-align: right;
  user-select: none;
}

.code-line .lc {
  white-space: pre;
}

/* Blame reuses the code-block metrics so switching tabs does not reflow the
 * file: the same 12px mono line, plus a fixed attribution gutter. */
.blame {
  margin: 0;
  padding: 12px 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  tab-size: 4;
}

.blame-line {
  display: flex;
  align-items: baseline;
  /* The same box a code line occupies, so switching to Blame and back does
   * not reflow the file under the cursor. */
  height: 1.6em;
}

.blame-line:hover {
  background: var(--surface-hover);
}

.blame-start {
  border-top: 1px solid var(--border);
}

.blame-line:first-child {
  border-top: none;
}

.blame-commit {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex: none;
  width: 280px;
  padding: 0 12px;
  overflow: hidden;
  white-space: nowrap;
  color: var(--text-muted);
}

.blame-commit a {
  color: var(--text-muted);
  text-decoration: none;
}

.blame-commit a:hover {
  color: var(--text);
  text-decoration: underline;
}

.blame-author {
  max-width: 120px;
  font-family: var(--font);
}

.blame-age {
  margin-left: auto;
  font-family: var(--font);
  color: var(--placeholder);
}

.blame-line .ln {
  flex: none;
  width: 52px;
  padding-right: 16px;
  color: var(--placeholder);
  text-align: right;
  user-select: none;
}

.blame-line .lc {
  white-space: pre;
}

/* ------------------------------------------------------------------ paths */

.path-list {
  list-style: none;
  margin: 0;
  padding: 4px;
}

.path-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
}

.path-item:hover,
.path-item:focus-visible {
  background: var(--surface-subtle);
}

.path-item .icon {
  flex: none;
  color: var(--text-muted);
}

.path-name {
  font-weight: 500;
}

.path-dir {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.hit-file + .hit-file {
  border-top: 1px solid var(--border);
}

.hit-file-head {
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--h-control);
  padding: 0 12px;
  background: var(--surface-subtle);
  font-size: 13px;
}

.hit-file-head a {
  color: var(--text);
  text-decoration: none;
}

.hit-file-head a:hover {
  text-decoration: underline;
}

.hit-line {
  display: flex;
  padding: 2px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
  text-decoration: none;
}

.hit-line:hover {
  background: var(--surface-hover);
}

.hit-line .ln {
  flex: none;
  width: 64px;
  padding-right: 16px;
  color: var(--placeholder);
  text-align: right;
  user-select: none;
}

.hit-line .lc {
  white-space: pre;
  overflow: hidden;
  text-overflow: ellipsis;
}

.markdown {
  padding: 24px 32px;
  font-size: 14px;
  line-height: 1.65;
}

.markdown h1,
.markdown h2,
.markdown h3,
.markdown h4 {
  margin: 24px 0 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.markdown h1 {
  font-size: 26px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.markdown h2 {
  font-size: 20px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.markdown h3 {
  font-size: 16px;
}

.markdown > :first-child {
  margin-top: 0;
}

.markdown p,
.markdown ul,
.markdown ol,
.markdown blockquote,
.markdown table {
  margin: 0 0 16px;
}

.markdown ul,
.markdown ol {
  padding-left: 24px;
}

.markdown li + li {
  margin-top: 4px;
}

.markdown a {
  color: #0969da;
}

.markdown a:hover {
  text-decoration: underline;
}

.markdown code {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--surface-subtle);
  font-family: var(--font-mono);
  font-size: 12px;
}

.markdown pre {
  padding: 12px 16px;
  border-radius: var(--radius-control);
  background: var(--surface-subtle);
  overflow-x: auto;
}

.markdown pre code {
  padding: 0;
  background: none;
}

.markdown blockquote {
  padding-left: 16px;
  border-left: 3px solid var(--border);
  color: var(--text-muted);
}

.markdown table {
  border-collapse: collapse;
  width: 100%;
}

.markdown th,
.markdown td {
  padding: 6px 12px;
  border: 1px solid var(--border);
  text-align: left;
}

.markdown img {
  max-width: 100%;
}

/* ------------------------------------------------------------------ diffs */

.diff-layout {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.diff-nav {
  position: sticky;
  top: 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.diff-nav-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  max-height: 420px;
  overflow-y: auto;
}

.diff-nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
}

.diff-nav-item:hover {
  background: var(--surface-subtle);
}

.diff-file + .diff-file {
  margin-top: 16px;
}

.diff-file-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  background: var(--surface-subtle);
  font-size: 13px;
}

.diff-body {
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  overflow-x: auto;
}

.diff-line {
  display: flex;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
}

.diff-line .lc {
  padding: 0 12px;
  white-space: pre;
  flex: 1 1 auto;
}

.diff-add {
  background: #e6ffec;
}

.diff-del {
  background: #ffebe9;
}

.diff-hunk {
  background: var(--surface-subtle);
  color: var(--text-muted);
}

.stat-add {
  color: var(--open);
  font-weight: 600;
}

.stat-del {
  color: var(--danger);
  font-weight: 600;
}

/* ------------------------------------------------------------------ pull requests */

.pr-state-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.pr-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
}

.pr-title .pr-number {
  color: var(--text-muted);
  font-weight: 500;
}

.branch-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-control);
  background: var(--surface-subtle);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
}

.pr-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 56px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.pr-row:last-child {
  border-bottom: none;
}

.pr-row:hover {
  background: var(--surface-hover);
}

.pr-row-title {
  font-size: 14px;
  font-weight: 500;
}

.pr-row-title:hover {
  text-decoration: underline;
}

.pr-row-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.meta-grid {
  display: grid;
  gap: 0;
}

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.meta-row:last-child {
  border-bottom: none;
}

.meta-row-label {
  font-weight: 500;
}

.meta-row-value {
  color: var(--text-muted);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.timeline-item {
  display: flex;
  gap: 12px;
}

.timeline-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: var(--radius-pill);
  background: var(--surface-subtle);
  color: var(--text-muted);
}

.timeline-icon-merged {
  background: var(--merged);
  color: #ffffff;
}

.timeline-icon-open {
  background: var(--open);
  color: #ffffff;
}

.timeline-body {
  flex: 1 1 auto;
  min-width: 0;
}

.compare-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* Comment bodies are escaped text, so newlines have to survive in CSS rather
 * than in markup. */
.comment-body {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.comment-form .field-label {
  margin-bottom: 8px;
}

.textarea {
  height: auto;
  min-height: 88px;
  padding: 10px 12px;
  line-height: 1.6;
  resize: vertical;
}

/* ------------------------------------------------------------------ progress */

.progress {
  height: 6px;
  margin-top: 16px;
  border-radius: var(--radius-pill);
  background: var(--surface-selected);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--button);
}

.progress-bar[data-step="1"] { width: 20%; }
.progress-bar[data-step="2"] { width: 40%; }
.progress-bar[data-step="3"] { width: 60%; }
.progress-bar[data-step="4"] { width: 80%; }
.progress-bar[data-step="5"] { width: 100%; background: var(--clone); }

/* ------------------------------------------------------------------ settings */

.settings-section + .settings-section {
  margin-top: 32px;
}

.settings-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}

.toggle-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.switch {
  position: relative;
  flex: none;
  width: 40px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface-subtle);
  cursor: pointer;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-pill);
  background: #ffffff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.2);
  transition: left 0.12s ease;
}

.switch[aria-checked="true"] {
  background: var(--accent);
  border-color: var(--accent);
}

.switch[aria-checked="true"]::after {
  left: 20px;
}

.check-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.check-card input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--accent);
  flex: none;
}

.danger-card {
  border-color: #fecaca;
}

.icon-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-subtle);
  color: var(--text-muted);
}

/* ------------------------------------------------------------------ notices */

.notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface-subtle);
  font-size: 13px;
  margin-bottom: 16px;
}

.notice-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.notice-success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #14532d;
}

.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;
}

/* ------------------------------------------------------------------ public site */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border-strong);
  background: var(--canvas);
}

.site-nav-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1168px;
  height: 60px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-nav .brand {
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
}

.site-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  font-size: 13px;
  font-weight: 500;
}

.site-links form {
  display: contents;
}

.site-links a,
.site-links button.btn {
  display: inline-flex;
  align-items: center;
  height: var(--h-control);
  padding: 0 10px;
  border-radius: var(--radius-control);
  color: var(--text);
  text-decoration: none;
}

.site-links a:hover {
  background: var(--surface-subtle);
}

.site-links a.btn,
.site-links button.btn {
  padding: 0 12px;
  margin: 0;
  font: inherit;
  font-weight: 500;
}

.hero {
  max-width: 760px;
  padding: 72px 0 48px;
}

.hero-title {
  margin: 0 0 18px;
  font-size: 54px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 600;
  color: var(--text);
}

.hero-lede {
  margin: 0 0 28px;
  max-width: 640px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-actions .btn {
  height: 36px;
  padding: 0 16px;
  font-size: 14px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.feature-card {
  padding: 20px 20px 22px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-card);
  background: var(--surface-subtle);
}

.feature-name {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.feature-help {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
}

.site-section {
  margin-top: 72px;
}

.site-section .page-title {
  font-size: 26px;
  letter-spacing: -0.02em;
}

.site-section .page-subtitle {
  margin-top: 8px;
  font-size: 15px;
}

/* The first section on a page sits below the site nav rather than below other
 * content, so it needs its own breathing room. */
.site-section-lead {
  margin-top: 0;
  padding: 48px 0 24px;
}

.build-list {
  margin: 28px 0 0;
  padding: 0 0 0 22px;
  max-width: 760px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
}

.build-list li + li {
  margin-top: 16px;
}

.build-list strong {
  color: var(--text);
}

.clone-block {
  max-width: 760px;
  margin-top: 28px;
  padding: 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-card);
  background: var(--surface-subtle);
}

.clone-label {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.clone-block .command-surface {
  margin-top: 0;
  padding: 14px 16px;
  background: var(--canvas);
  border: 1px solid var(--border);
  font-size: 13px;
}

.site-section a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer {
  margin-top: 72px;
  padding-top: 24px;
  border-top: 1px solid var(--border-strong);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* ------------------------------------------------------------------ writing */

.post-row {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.post-row:last-child {
  border-bottom: none;
}

.post-row-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.post-row-title:hover {
  text-decoration: underline;
}

.post-row-summary {
  margin: 6px 0 8px;
  max-width: 720px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}

.post-row-meta,
.post-meta {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: var(--placeholder);
}

.post {
  max-width: 720px;
  margin: 0 auto;
}

.post-head {
  padding: 24px 0 8px;
  border-bottom: 1px solid var(--border);
}

.post-title {
  margin: 0 0 12px;
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.post-subtitle {
  margin: 0 0 16px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-muted);
}

.post-contents {
  margin: 24px 0 0;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface-subtle);
}

.post-contents-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.post-contents ol {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.9;
}

.post-contents a {
  color: var(--text-muted);
  text-decoration: none;
}

.post-contents a:hover {
  color: var(--text);
  text-decoration: underline;
}

/* The article body reuses the Markdown renderer the repository views use, so
 * only the reading measure and heading rhythm change here. */
.post-body {
  padding: 8px 0 0;
  font-size: 16px;
  line-height: 1.75;
}

.post-body h2 {
  margin-top: 40px;
  padding-bottom: 0;
  border-bottom: none;
  font-size: 22px;
}

.post-body h3 {
  margin-top: 28px;
  font-size: 17px;
}

.post-body p,
.post-body ul,
.post-body ol {
  margin: 0 0 20px;
}

/* ------------------------------------------------------------------ login */

.login-wrap {
  max-width: 360px;
  margin: 96px auto 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
}

/* ------------------------------------------------------------------ syntax */

.chroma .k, .chroma .kd, .chroma .kn, .chroma .kp, .chroma .kr, .chroma .kt { color: #cf222e; }
.chroma .s, .chroma .s1, .chroma .s2, .chroma .sb, .chroma .sc, .chroma .sd, .chroma .se, .chroma .sh, .chroma .si, .chroma .sx, .chroma .sr, .chroma .ss { color: #0a3069; }
.chroma .c, .chroma .c1, .chroma .cm, .chroma .cp, .chroma .cs { color: #6e7781; font-style: italic; }
.chroma .nf, .chroma .fm { color: #8250df; }
.chroma .nc, .chroma .nn, .chroma .no { color: #953800; }
.chroma .m, .chroma .mb, .chroma .mf, .chroma .mh, .chroma .mi, .chroma .mo { color: #0550ae; }
.chroma .nt { color: #116329; }
.chroma .na { color: #0550ae; }
.chroma .o, .chroma .ow { color: #0550ae; }
.chroma .err { color: #82071e; }

/* ------------------------------------------------------------------ responsive */

@media (max-width: 900px) {
  .diff-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .diff-nav {
    position: static;
  }
}

@media (max-width: 900px) {
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .shell {
    padding: 0 16px 48px;
  }

  .site-nav-inner {
    padding: 0 16px;
  }

  .hero-title {
    font-size: 34px;
  }

  .feature-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .post-title {
    font-size: 26px;
  }

  /* Tables scroll horizontally rather than dropping a column, so a narrow
   * viewport never hides the last-commit data. */
  .table {
    min-width: 620px;
  }

  .popover {
    width: min(332px, calc(100vw - 32px));
  }
}
