:root {
  color-scheme: dark;
  --surface: #21231f;
  --line: #45483e;
  --muted: #b8b9ae;
  --accent: #c1cc9f;
}
* { box-sizing: border-box; }
body { margin: 0; background: #171817; color: #f1f0e9; font: 16px/1.5 Arial, sans-serif; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px max(5vw, 16px); border-bottom: 1px solid var(--line); }
.brand { font-family: Impact, 'Arial Narrow', sans-serif; font-size: clamp(22px, 4vw, 33px); color: inherit; text-decoration: none; }
.brand span { color: var(--accent); }
.workspace { width: min(1120px, 92%); margin: 44px auto; }
.login { width: min(460px, 92%); margin: min(10vh, 88px) auto; }
.heading, .account, .actions, .tabs, .row-head, .row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.heading, .row-head { justify-content: space-between; }
h1 { font-size: clamp(30px, 5vw, 52px); line-height: 1.1; margin: 0; }
h2 { font-size: 24px; margin: 0 0 12px; }
h3 { font-size: 18px; margin: 0 0 8px; }
p { color: var(--muted); }
.heading p { margin: 8px 0 0; }
.panel { padding: clamp(18px, 4vw, 30px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
button, input, select { font: inherit; }
button { min-height: 42px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 13px; background: #272a23; color: #f1f0e9; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
button:not(:disabled):hover, button[aria-current] { border-color: var(--accent); }
button[aria-current], .primary { background: var(--accent); color: #171817; font-weight: 700; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input, select { min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: 6px; background: #1a1c17; color: inherit; padding: 8px 9px; }
label { display: grid; gap: 5px; font-size: 14px; }
.login form { display: grid; gap: 14px; margin: 23px 0 15px; }
.login form p { margin: 0; font-size: 14px; }
.minor { color: var(--accent); }
.tabs { margin: 18px 0 12px; }
.notice { min-height: 1.5em; }
.error { color: #ffc1b5; }
.items { display: grid; gap: 12px; margin: 16px 0; padding: 0; list-style: none; }
.item { position: relative; padding: 14px; border: 1px solid var(--line); border-radius: 8px; }
.item.dragging { opacity: .55; }
.item.drop-before::before, .item.drop-after::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
  pointer-events: none;
}
.item.drop-before::before { top: -8px; }
.item.drop-after::after { bottom: -8px; }
.row-head > strong { flex: 1; }
.handle {
  display: grid;
  place-items: center;
  min-width: 42px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--accent);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.handle:active { cursor: grabbing; }
.item-position {
  min-width: 2ch;
  color: var(--accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.upload-zone {
  gap: 8px;
  padding: 14px;
  border: 1px dashed var(--muted);
  border-radius: 8px;
  cursor: copy;
}
.upload-zone.upload-over {
  border-color: var(--accent);
  background: #303628;
}
.upload-zone input { cursor: pointer; }
.item-details { margin-top: 8px; }
.item-details > summary { width: fit-content; cursor: pointer; color: var(--accent); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; margin-top: 12px; }
.wide { grid-column: 1 / -1; }
.history { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 22px; }
.history ul { display: grid; gap: 14px; padding: 0; list-style: none; }
.history li { border-top: 1px solid var(--line); padding-top: 9px; }
.history time { color: var(--muted); font-size: 14px; }
