/* Duck — interface styles. */

:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #16191d;
  --muted: #6b7280;
  --line: #e3e6ea;
  --accent: #f0a500;
  --accent-ink: #3d2a00;
  --danger: #c0392b;
  --ok: #1a7f4b;
  --shadow: 0 1px 2px rgba(16, 20, 26, .06), 0 8px 24px rgba(16, 20, 26, .06);
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171b;
    --panel: #1b1f24;
    --ink: #e8eaed;
    --muted: #9aa2ad;
    --line: #2b3138;
    --accent: #f5b731;
    --accent-ink: #2a1d00;
    --danger: #e0685c;
    --ok: #4ec98a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, select, input { font: inherit; color: inherit; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
.ok { color: var(--ok); }

/* ------------------------------------------------------------ sign-in */

body.gate {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.card {
  width: 100%;
  max-width: 360px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  text-align: center;
}

.card .mark { font-size: 40px; line-height: 1; }
.card h1 { margin: 12px 0 4px; font-size: 22px; letter-spacing: -.01em; }
.card .sub { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.card label { display: block; text-align: left; margin-bottom: 12px; font-size: 12px; color: var(--muted); }
.card input {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
}
.card input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.card button {
  width: 100%; margin-top: 8px; padding: 10px 14px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
  border: 0; border-radius: 8px; font-weight: 600;
}
.notice {
  margin: 0 0 16px; padding: 9px 12px; border-radius: 8px; font-size: 13px;
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger); text-align: left;
}

/* ---------------------------------------------------------------- app */

body.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.bar, .toolbar, .status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}

.bar { height: 50px; }
.toolbar { height: 48px; flex-wrap: wrap; }
.status { height: 34px; font-size: 12px; border-bottom: 0; border-top: 1px solid var(--line); }

.brand { font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 6px; }
.brand .mark { font-size: 18px; }

.crumbs {
  display: flex; align-items: center; gap: 3px;
  overflow-x: auto; white-space: nowrap; font-size: 13px;
  padding: 4px 8px; border-radius: 8px; background: var(--bg);
  max-width: 55vw;
}
.crumbs a { color: var(--ink); text-decoration: none; padding: 1px 4px; border-radius: 5px; }
.crumbs a:hover { background: var(--line); text-decoration: underline; }

#rootPicker {
  padding: 6px 8px; background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px;
}

.toolbar button, .bar button, .bar .ghost {
  padding: 7px 12px; cursor: pointer;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
}
.toolbar button:hover:not(:disabled), .bar button:hover { border-color: var(--muted); }
.toolbar button:disabled { opacity: .45; cursor: default; }
.toolbar button.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.toolbar button.danger:not(:disabled) { color: var(--danger); }
.ghost { background: transparent; border: 1px solid transparent; color: var(--muted); text-decoration: none; padding: 7px 10px; border-radius: 8px; }
.ghost:hover { color: var(--ink); }
form.inline { display: inline; }

/* ------------------------------------------------------------- listing */

.listing { position: relative; flex: 1 1 auto; overflow: auto; }

table { width: 100%; border-collapse: collapse; }
thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--bg); color: var(--muted);
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  text-align: left; font-weight: 600;
  padding: 8px 10px; border-bottom: 1px solid var(--line);
}
tbody td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }

.c-check { width: 34px; }
.c-size { width: 90px; color: var(--muted); font-variant-numeric: tabular-nums; }
.c-date { width: 175px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.c-act { width: 110px; text-align: right; }
.c-name a { color: var(--ink); text-decoration: none; }
.c-name a:hover { text-decoration: underline; }
.icon { display: inline-block; width: 20px; }

button.link {
  background: none; border: 0; padding: 2px 4px; cursor: pointer;
  color: var(--muted); font-size: 12px; text-decoration: underline;
}
button.link:hover { color: var(--ink); }

.empty { padding: 40px; text-align: center; color: var(--muted); }

.drop-hint {
  position: absolute; inset: 0; display: none;
  place-items: center; pointer-events: none;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 2px dashed var(--accent); border-radius: var(--radius);
}
.listing.dragging .drop-hint { display: grid; }
.drop-hint div {
  background: var(--panel); padding: 12px 20px;
  border-radius: 999px; font-weight: 600; box-shadow: var(--shadow);
}

/* --------------------------------------------------------------- queue */

.queue {
  position: fixed; right: 16px; bottom: 46px; width: min(430px, calc(100vw - 32px));
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 14px; z-index: 20;
}
.queue-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.bar-outer { height: 7px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.bar-inner { height: 100%; width: 0; background: var(--accent); transition: width .15s linear; }
#queueDetail { margin-top: 6px; font-size: 12px; }
.errors { margin: 8px 0 0; padding-left: 18px; max-height: 110px; overflow: auto; font-size: 12px; color: var(--danger); }

@media (max-width: 720px) {
  .c-date { display: none; }
  .crumbs { max-width: 100%; order: 10; flex-basis: 100%; }
  .bar { height: auto; padding: 8px 12px; flex-wrap: wrap; }
}
