/* Fig web UI. System fonts; light and dark follow the browser. */
:root {
  --bg: #f7f6f9;
  --panel: #ffffff;
  --text: #1d1a22;
  --muted: #6b6475;
  --line: #e4e0ea;
  --accent: #6b3fa0;
  --accent-soft: #efe7f8;
  --ok: #1f7a4a;
  --ok-soft: #e3f4ea;
  --bad: #b3261e;
  --bad-soft: #fbe8e6;
  --add: #e6f6ec;
  --add-strong: #c8ecd5;
  --del: #fdecea;
  --del-strong: #f6cdc8;
  --code: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141217;
    --panel: #1c1a21;
    --text: #ebe8f0;
    --muted: #a39cad;
    --line: #2f2b36;
    --accent: #b993e6;
    --accent-soft: #2c2338;
    --ok: #6fd39b;
    --ok-soft: #1b2e23;
    --bad: #f2a29b;
    --bad-soft: #3a1f1d;
    --add: #17291e;
    --add-strong: #21422e;
    --del: #301b1a;
    --del-strong: #4d2723;
  }
}
* { box-sizing: border-box; }
html { font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
body { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--code); font-size: 13px; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 28px 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Top bar */
header.top { display: flex; align-items: center; gap: 18px; padding: 10px 24px; background: var(--panel); border-bottom: 1px solid var(--line); }
header.top .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; color: var(--text); }
header.top .brand svg { width: 24px; height: 24px; }
header.top nav { display: flex; gap: 14px; flex: 1; }
header.top nav a { color: var(--muted); }
header.top nav a.on, header.top nav a:hover { color: var(--text); text-decoration: none; }
header.top .me { display: flex; align-items: center; gap: 12px; color: var(--muted); }
header.top form { margin: 0; }

main { max-width: 1180px; margin: 0 auto; padding: 24px; }
.crumbs { font-family: var(--code); font-size: 14px; margin: 6px 0 16px; word-break: break-all; }
.crumbs a { color: var(--text); }
.crumbs .sep { color: var(--muted); margin: 0 4px; }

/* Repository header and tabs */
.repo-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 14px 0 18px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--text); }
form.stream { display: flex; gap: 6px; align-items: center; }

/* Panels and tables */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 18px; }
.panel > .head { padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.panel > .body { padding: 14px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-weight: 600; color: var(--muted); font-size: 13px; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.nowrap { white-space: nowrap; }
.entry { display: flex; align-items: center; gap: 8px; }
.entry svg { width: 16px; height: 16px; flex: none; color: var(--muted); }
.entry.dir svg { color: var(--accent); }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* Badges and notices */
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.plain { background: var(--line); color: var(--muted); }
.notice { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; background: var(--ok-soft); color: var(--ok); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.secret { font-family: var(--code); padding: 10px 12px; background: var(--accent-soft); border-radius: 8px; word-break: break-all; }

/* Forms */
input[type=text], input[type=password], input[type=number], select, textarea {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 6px 10px;
}
textarea { width: 100%; min-height: 260px; font-family: var(--code); font-size: 13px; }
button, .button {
  font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--panel); color: var(--text);
  padding: 6px 14px; border-radius: 7px; display: inline-block;
}
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { color: var(--bad); }
button:hover, .button:hover { text-decoration: none; filter: brightness(0.97); }
form.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: 10px; max-width: 420px; }
.stack label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.signin { max-width: 360px; margin: 10vh auto; }
.signin .brand { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; margin-bottom: 18px; }
.signin .brand svg { width: 34px; height: 34px; }

/* File contents and diffs */
.code { overflow-x: auto; }
.code table { font-family: var(--code); font-size: 13px; line-height: 1.45; }
.code td { border: none; padding: 0 12px; white-space: pre; }
.code td.ln { text-align: right; color: var(--muted); user-select: none; width: 1%; padding-right: 10px; border-right: 1px solid var(--line); }
.code td.ln a { color: var(--muted); }
.code tr:target td { background: var(--accent-soft); }
.diff td.add { background: var(--add); }
.diff td.del { background: var(--del); }
.diff td.ln.add { background: var(--add-strong); }
.diff td.ln.del { background: var(--del-strong); }
.diff tr.hunk td { background: var(--accent-soft); color: var(--muted); padding: 2px 12px; }
.diff td.sign { width: 1%; padding: 0 4px; color: var(--muted); user-select: none; }
.preview { padding: 18px; text-align: center; background: repeating-conic-gradient(var(--line) 0% 25%, transparent 0% 50%) 50% / 20px 20px; }
.preview img { max-width: 100%; max-height: 70vh; }
.description { white-space: pre-wrap; margin: 0; font: inherit; }
.files-list td a { font-family: var(--code); font-size: 13px; }
.files-list td:nth-child(2) { width: 100%; }
.pager { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
