/* upload.lappari.com — „póstlúga" */
:root {
  --fog: #EEF1F4;
  --paper: #FFFFFF;
  --ink: #18212B;
  --muted: #5B6875;
  --line: #D5DBE1;
  --well: #E3E8ED;
  --fjord: #0E5E6F;
  --fjord-strong: #0A4652;
  --fjord-soft: #D7E8EC;
  --ok: #2E7D4F;
  --ok-soft: #DDEFE3;
  --wait: #8A5A00;
  --wait-soft: #F6EAD2;
  --bad: #B3261E;
  --bad-soft: #F7DEDC;
  --mouth: #1E2934;
  --radius-s: 4px;
  --radius-m: 8px;
  --font: ui-sans-serif, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --font-num: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fog: #10161D;
    --paper: #18212B;
    --ink: #E6EBF0;
    --muted: #96A3AF;
    --line: #2B3743;
    --well: #1F2A35;
    --fjord: #5DB8C8;
    --fjord-strong: #86CCD8;
    --fjord-soft: #173842;
    --ok: #6CC28E;
    --ok-soft: #173826;
    --wait: #E2B45A;
    --wait-soft: #3A2D12;
    --bad: #F08A82;
    --bad-soft: #42201E;
    --mouth: #0A0F14;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fog);
  color: var(--ink);
  font: 400 1rem/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--fjord); }
:focus-visible { outline: 3px solid var(--fjord); outline-offset: 2px; border-radius: 2px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

/* ---------- Ramminn ---------- */
.shell { max-width: 38rem; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.shell-admin { max-width: 72rem; }
.masthead {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; padding: 0.25rem 0 2.5rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); }
.brand-slot { width: 1.6rem; height: 0.45rem; border-radius: 2px; background: var(--fjord); }
.brand-name { font-weight: 650; letter-spacing: -0.01em; }
.brand-sub { color: var(--muted); padding-left: 0.6rem; border-left: 1px solid var(--line); }
.masthead-nav { display: flex; align-items: center; gap: 1rem; font-size: 0.925rem; flex-wrap: wrap; }
.who { color: var(--muted); overflow-wrap: anywhere; }

/* ---------- Spjöld ---------- */
.panel {
  background: var(--paper);
  border-radius: var(--radius-m);
  padding: 2rem 2rem 2.25rem;
  box-shadow: 0 1px 0 var(--line), 0 0 0 1px var(--line) inset;
}
.panel-narrow { max-width: 28rem; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.1rem); line-height: 1.15; letter-spacing: -0.02em; font-weight: 650; margin: 0 0 0.6rem; }
h2 { font-size: 1.05rem; font-weight: 650; margin: 0 0 0.75rem; letter-spacing: -0.005em; }
.lede { color: var(--muted); margin: 0 0 1.75rem; max-width: 34rem; }
.lede strong { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.aside { color: var(--muted); font-size: 0.875rem; margin: 1rem 0 0; padding-left: 0.25rem; }

/* ---------- Form ---------- */
.form { display: grid; gap: 1rem; }
.field { display: grid; gap: 0.35rem; }
.field-label { font-size: 0.875rem; font-weight: 600; }
input[type=email], input[type=text], input[type=password], input[type=date], input[type=search], textarea, select {
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 0.7rem 0.8rem; width: 100%; min-height: 2.9rem;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--fjord); box-shadow: 0 0 0 3px var(--fjord-soft); }
input[aria-invalid=true] { border-color: var(--bad); }
input::placeholder { color: var(--muted); opacity: 0.6; }
.code-input { font-family: var(--font-num); font-size: 1.9rem; letter-spacing: 0.45em; padding-left: 1rem; text-align: left; }
.field-error { color: var(--bad); font-size: 0.9rem; margin: -0.4rem 0 0; }

.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  background: var(--fjord); color: #fff; border: 0; border-radius: var(--radius-s);
  padding: 0.75rem 1.2rem; min-height: 2.9rem; justify-self: start;
}
@media (prefers-color-scheme: dark) { .btn { color: #0B1A1F; } }
.btn:hover { background: var(--fjord-strong); }
.btn-quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-quiet:hover { background: var(--well); }
.btn-danger { background: transparent; color: var(--bad); box-shadow: inset 0 0 0 1px currentColor; }
.btn-danger:hover { background: var(--bad-soft); }
.btn-s { padding: 0.35rem 0.7rem; min-height: 2rem; font-size: 0.875rem; }
.link {
  font: inherit; background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--fjord); text-decoration: underline; text-underline-offset: 0.18em;
}
.form-inline { display: flex; align-items: center; gap: 0.9rem; margin-top: 1.5rem; font-size: 0.925rem; flex-wrap: wrap; }
.sep { width: 1px; height: 1em; background: var(--line); }

/* ---------- Tilkynningar ---------- */
.note { border-radius: var(--radius-s); padding: 0.75rem 1rem; margin: 0 0 1.25rem; font-size: 0.95rem; }
.note-ok { background: var(--ok-soft); color: var(--ok); }
.note-warn { background: var(--wait-soft); color: var(--wait); }
.note-bad { background: var(--bad-soft); color: var(--bad); }

/* ---------- Lúgan ---------- */
.slot { position: relative; }
.slot-mouth {
  display: grid; justify-items: center; gap: 0.5rem;
  padding: 2.75rem 1.25rem 2.25rem; cursor: pointer;
  background: var(--well);
  border-radius: var(--radius-m);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background 160ms ease;
}
.slot-icon {
  width: 3.25rem; height: 3.25rem; margin-bottom: 0.4rem;
  fill: none; stroke: var(--fjord); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 220ms cubic-bezier(.2, .8, .2, 1);
}
.slot-icon-doc { fill: var(--paper); }
.slot-icon-zip { stroke: var(--muted); }
.slot-text { font-size: 1.15rem; font-weight: 600; }
.slot-hint { color: var(--muted); font-size: 0.9rem; }
.slot-hint u { color: var(--fjord); text-underline-offset: 0.18em; }
.slot-mouth:hover { background: var(--fjord-soft); }
#file:focus-visible + .slot-mouth { outline: 3px solid var(--fjord); outline-offset: 3px; }
.slot.is-over .slot-mouth { background: var(--fjord-soft); box-shadow: inset 0 0 0 2px var(--fjord); }
.slot.is-over .slot-icon, .slot-mouth:hover .slot-icon { transform: translateY(-4px); }
@media (prefers-reduced-motion: reduce) {
  .slot-icon, .slot-mouth { transition: none; }
}

/* ---------- Biðröð ---------- */
.queue { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: 0.6rem; }
.queue:empty { display: none; }
.item { border-radius: var(--radius-s); box-shadow: inset 0 0 0 1px var(--line); padding: 0.8rem 0.9rem 0.7rem; }
.item-top { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.file-name { font-weight: 600; overflow-wrap: anywhere; }
.file-meta { color: var(--muted); font-size: 0.85rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar { height: 4px; background: var(--well); border-radius: 2px; margin: 0.6rem 0 0.45rem; overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; background: var(--fjord); transition: width 120ms linear; }
.item-status { margin: 0; font-size: 0.875rem; color: var(--muted); }
.item[data-state=scanning] .bar-fill { background: var(--wait); animation: pulse 1.1s ease-in-out infinite; }
.item[data-state=ok] .bar-fill { background: var(--ok); }
.item[data-state=ok] .item-status { color: var(--ok); font-weight: 600; }
.item[data-state=wait] .bar-fill { background: var(--wait); }
.item[data-state=wait] .item-status { color: var(--wait); font-weight: 600; }
.item[data-state=bad] .bar-fill { background: var(--bad); }
.item[data-state=bad] .item-status { color: var(--bad); font-weight: 600; }
@keyframes pulse { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .item[data-state=scanning] .bar-fill { animation: none; } }

/* ---------- Saga ---------- */
.history { margin-top: 2.25rem; padding: 0 0.25rem; }
.files { list-style: none; margin: 0; padding: 0; }
.files li {
  display: grid; grid-template-columns: 1fr auto; gap: 0.1rem 1rem; align-items: center;
  padding: 0.7rem 0; border-top: 1px solid var(--line);
}
.files .file-meta { grid-column: 1; }
.files .badge { grid-column: 2; grid-row: 1 / span 2; }

.badge {
  display: inline-block; font-size: 0.8rem; font-weight: 600; line-height: 1;
  padding: 0.35rem 0.55rem; border-radius: 99px; white-space: nowrap;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-wait { background: var(--wait-soft); color: var(--wait); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-off { background: var(--well); color: var(--muted); }

/* ---------- Admin ---------- */
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); margin: 0 0 1.75rem; overflow-x: auto; }
.tab {
  padding: 0.65rem 0.9rem; text-decoration: none; color: var(--muted); font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab[aria-current=page] { color: var(--ink); border-color: var(--fjord); }
.tab .count { font-weight: 400; color: var(--muted); margin-left: 0.3rem; font-variant-numeric: tabular-nums; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
.panel-tight { padding: 1.4rem 1.4rem 1.5rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }
.help { color: var(--muted); font-size: 0.825rem; margin: 0; }

.table-wrap { overflow-x: auto; background: var(--paper); border-radius: var(--radius-m); box-shadow: 0 0 0 1px var(--line) inset; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; font-weight: 600; color: var(--muted); padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 0.825rem; }
td { padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
td .sub { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 0.15rem; overflow-wrap: anywhere; }
td.actions { white-space: nowrap; text-align: right; }
td.actions form { display: inline; }
td.actions > * + * { margin-left: 0.35rem; }
.mono { font-family: var(--font-num); font-size: 0.8rem; overflow-wrap: anywhere; }
.empty { padding: 2.5rem 1rem; text-align: center; color: var(--muted); }

.toolbar { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar input[type=search] { max-width: 18rem; min-height: 2.4rem; padding: 0.45rem 0.7rem; }
.toolbar select { width: auto; min-height: 2.4rem; padding: 0.45rem 0.7rem; }

.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: grid; grid-template-columns: 1.4rem 1fr; gap: 0.6rem; padding: 0.75rem 0; border-top: 1px solid var(--line); }
.checks li:first-child { border-top: 0; }
.dot { width: 0.7rem; height: 0.7rem; border-radius: 50%; margin-top: 0.4rem; }
.dot-ok { background: var(--ok); }
.dot-bad { background: var(--bad); }
.dot-wait { background: var(--wait); }
.checks strong { display: block; font-weight: 600; }
.checks span { color: var(--muted); font-size: 0.875rem; overflow-wrap: anywhere; }

details.edit summary { cursor: pointer; color: var(--fjord); list-style: none; }
details.edit summary::-webkit-details-marker { display: none; }
details.edit[open] { margin-top: 0.4rem; }
details.edit .form { margin-top: 0.75rem; min-width: 16rem; text-align: left; }

@media (max-width: 520px) {
  .panel { padding: 1.5rem 1.15rem 1.6rem; }
  .brand-sub { display: none; }
}
.input-s { max-width: 16rem; min-height: 2.4rem; padding: 0.45rem 0.7rem; }
.mt { margin-top: 1.75rem; }
.check { display: flex; gap: 0.55rem; align-items: center; font-size: 0.925rem; }
.check input { width: 1.05rem; height: 1.05rem; accent-color: var(--fjord); }
a.btn { text-decoration: none; display: inline-block; }
td.actions details.edit, td.actions form, td.actions a.btn { display: inline-block; vertical-align: top; }
td.actions details.edit[open] { display: block; margin-bottom: 0.5rem; }
