/* Shared colors for the directory, comparison and file history. */
:root {
  color-scheme: light;
  --paper: #f4f4f8;
  --surface: #ffffff;
  --wash: #eaeaf2;
  --text: #191924;
  --muted: #555668;
  --line: #d8d9e5;
  --line-strong: #818397;
  --accent: #4d34c9;
  --accent-hover: #39249e;
  --accent-text: #ffffff;
  --soft-accent: #ebe7ff;
  --action: var(--accent);
  --action-hover: var(--accent-hover);
  --success: #176047;
  --soft-success: #e3f5eb;
  --warning: #704407;
  --soft-warning: #fff0cf;
  --error: #9b253d;
  --soft-error: #fee8ec;
  --font-body: system-ui, sans-serif;
  --font-numbers: ui-monospace, monospace;
  --radius-panel: 12px;
  --radius-control: 7px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #141419;
    --surface: #202127;
    --wash: #2b2c36;
    --text: #eeedf6;
    --muted: #b7b8ca;
    --line: #3b3c49;
    --line-strong: #76798f;
    --accent: #bdaeff;
    --accent-hover: #d4caff;
    --accent-text: #171125;
    --soft-accent: #352753;
    --action: #b29aff;
    --action-hover: #c5b3ff;
    --success: #82dfb6;
    --soft-success: #213d33;
    --warning: #ffce83;
    --soft-warning: #47351d;
    --error: #ff9eb2;
    --soft-error: #4a2734;
  }
}
* { box-sizing: border-box; }
html, body { overflow-x: clip; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--text); font: 1rem/1.5 var(--font-body); }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1, h2 { line-height: 1.15; overflow-wrap: break-word; min-width: 0; text-wrap: balance; }
h1 { font-size: 2rem; letter-spacing: -0.035em; }
h2 { font-size: 1.2rem; }
p, small { color: var(--muted); }
h1 + p, h2 + p { margin-top: .4rem; }
.shell { width: min(100% - 3rem, 70rem); margin-inline: auto; }
.top { border-bottom: 1px solid var(--line); background: var(--surface); }
.bar { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem 2.25rem; min-height: 4.25rem; }
.brand { color: var(--text); display: inline-flex; align-items: center; gap: .6rem; font-weight: 750; text-decoration: none; white-space: nowrap; }
.mark { width: 22px; height: 22px; border: 2px solid var(--accent); border-radius: 5px; display: grid; align-content: center; padding-inline: 4px; gap: 4px; }
.mark::before, .mark::after { content: ""; border-top: 2px solid var(--accent); }
.bar nav, .account, .actions, .search, .pagination, .crumb { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; }
.bar nav a { color: var(--muted); text-decoration: none; padding: .62rem .75rem; border-radius: var(--radius-control); }
.bar nav a:hover, .bar nav a[aria-current] { background: var(--soft-accent); color: var(--accent-hover); }
.account { margin-left: auto; min-width: 0; }
.account span { font-size: .875rem; color: var(--muted); overflow-wrap: anywhere; }
main { padding-block: 2.4rem 3rem; }
.heading { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 1.1rem; margin-bottom: 1.4rem; }
.crumb { margin-bottom: 1rem; font-size: .875rem; color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); }
.form-panel, .auth .panel { padding: 1.45rem; }
.form-panel { max-width: 50rem; }
.auth { max-width: 28rem; padding-top: 4rem; }
.stack { margin-top: 1.2rem; display: grid; gap: 1rem; justify-items: start; }
.stack label { width: 100%; }
label { display: grid; gap: .35rem; font-weight: 620; }
input, select, button, .button { font: inherit; min-height: 40px; border-radius: var(--radius-control); }
input, select { background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); padding: .38rem .65rem; min-width: 0; width: 100%; }
input::placeholder { color: var(--muted); }
input[type=file] { padding: .6rem; }
input::file-selector-button { font: inherit; border: 1px solid var(--line-strong); border-radius: var(--radius-control); background: var(--wash); color: var(--text); margin-right: .65rem; padding: .28rem .6rem; }
button, .button { display: inline-flex; align-items: center; justify-content: center; padding: .4rem .8rem; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-weight: 650; text-decoration: none; cursor: pointer; }
button:hover, .button:hover { background: var(--wash); color: var(--text); }
button:active, .button:active { box-shadow: inset 0 0 0 1px var(--line-strong); }
button:disabled { cursor: default; color: var(--muted); background: var(--wash); }
.primary { border-color: var(--action); background: var(--action); color: var(--accent-text); }
.primary:hover { border-color: var(--action-hover); background: var(--action-hover); color: var(--accent-text); }
.subtle { border-color: transparent; }
.switch { margin-top: 1.2rem; }
.notice { padding: .8rem 1rem; background: var(--soft-success); color: var(--success); border-radius: var(--radius-control); margin-bottom: 1rem; }
.notice.error { background: var(--soft-error); color: var(--error); }
.toolbar { padding: 1.1rem 1.35rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .8rem; }
.toolbar p { font-size: .875rem; }
.search input { width: min(16rem, 100%); flex: 1 1 10rem; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: .7rem 1.35rem; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
th { background: var(--wash); color: var(--muted); font-size: .875rem; white-space: nowrap; }
.number { font-family: var(--font-numbers); font-size: .875rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { padding-block: 2rem; }
.empty p { margin: .3rem 0 .5rem; }
.pagination { padding: .75rem 1.35rem; border-top: 1px solid var(--line); }
.mapping { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.preview { margin-top: 1.3rem; }
.preview td { min-width: 8rem; max-width: 24rem; }
.filters { padding: 0 1.35rem .75rem; display: flex; flex-wrap: wrap; gap: .3rem; }
.filters a { border-radius: var(--radius-control); padding: .55rem .65rem; text-decoration: none; color: var(--muted); font-size: .875rem; }
.filters a:hover, .filters a[aria-current] { color: var(--accent-hover); background: var(--soft-accent); }
.filters b { font-variant-numeric: tabular-nums; margin-left: .2rem; }
.status { display: inline-block; border-radius: var(--radius-control); padding: .2rem .5rem; background: var(--wash); font-size: .875rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.status.new { background: var(--soft-success); color: var(--success); }
.status.invalid { background: var(--soft-error); color: var(--error); }
.status.missing { background: var(--soft-warning); color: var(--warning); }
.batch-footer { margin-top: 1rem; max-width: 45rem; }
.batch-footer summary { display: list-item; width: fit-content; padding-block: .65rem; color: var(--accent); cursor: pointer; }
.batch-footer p { margin-bottom: .75rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); white-space: nowrap; overflow: clip; }
.file-context { overflow-wrap: anywhere; margin-bottom: .65rem; }
.operation-list { list-style: none; display: grid; gap: 1rem; margin: 0; padding: 0; }
.operation-list a { font-weight: 650; }
.stack input[type="checkbox"] { width: auto; min-height: 0; margin-inline-end: .35rem; }
@media (max-width: 44rem) {
  .shell { width: calc(100% - 2rem); }
  .bar { padding-block: .55rem; gap: .25rem .65rem; }
  .bar nav { order: 3; width: 100%; gap: .2rem; }
  .account { gap: .2rem; }
  .account span { display: none; }
  main, .auth { padding-top: 1.65rem; }
  .mapping { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 1.75rem; }
  .toolbar, th, td, .pagination { padding-inline: .9rem; }
  .filters { padding-inline: .65rem; }
}
