/* Dropsi.
 *
 * The Filesharing design system, reduced to what one page needs and rebuilt so
 * that Internet Explorer 11 renders it. Two rules follow from that and run
 * through the whole file:
 *
 * 1. EVERY COLOUR IS DECLARED TWICE - the fixed value first, the custom
 *    property second:
 *
 *        background: #f0921e;
 *        background: var(--accent);
 *
 *    IE 11 has no custom properties, so it drops the second line and keeps the
 *    first. Every other browser applies the second and gets the theme. No
 *    browser sniffing, no second stylesheet, no build step. When you change a
 *    colour, change BOTH lines - a var-only edit is invisible until somebody
 *    opens the page on Windows 7, which is the last place anybody looks.
 *
 * 2. NO `gap`, NO CSS GRID. Spacing is margins, layout is flexbox. IE 11
 *    supports neither `gap` nor modern grid, and carrying two layout systems
 *    behind an @supports query means the fallback is never the one anybody
 *    looks at. One code path, tested everywhere.
 *
 * Dark theme lives in a prefers-color-scheme block, which IE 11 skips - it
 * stays on the light palette, which is correct for the machines in question.
 */

:root {
  --bg: #f1f3f5;
  --surface: #ffffff;
  --surface-2: #f7f8f9;
  --surface-3: #e9edf0;
  --border: #e2e7ea;
  --border-strong: #78878f;

  --text: #1d2b32;
  --text-muted: #54646d;
  --text-subtle: #5e6f78;

  --field-bg: #eef1f3;
  --field-border: #7b8a92;

  --brand: #a05c04;
  --brand-ink: #8d5000;
  --brand-soft: #fdf1e2;
  --brand-border: #f0cfa4;

  --accent: #f0921e;
  --accent-ink: #1a1206;
  --accent-hover: #dc8214;
  --accent-border: #c4761a;

  --nav-bg: #0d5566;
  --nav-text: #ffffff;
  --nav-text-muted: #a9c9d2;
  --nav-border: #14657a;
  --nav-hover: #12667c;
  --nav-active: #12667c;
  --nav-field-bg: #0a4757;
  --nav-field-border: #6fb3c4;

  --success: #146b3a;
  --success-soft: #e4f0e8;
  --success-border: #b2d2bf;
  --warning: #8a5a00;
  --warning-soft: #faefda;
  --warning-border: #e4cfa2;
  --danger: #b3241c;
  --danger-soft: #fbe8e6;
  --danger-border: #efbdb7;

  --focus-ring: #0b1219;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1418;
    --surface: #121c21;
    --surface-2: #18242a;
    --surface-3: #1f2d34;
    --border: #26343a;
    --border-strong: #71858c;

    --text: #e8eef1;
    --text-muted: #abbec5;
    --text-subtle: #9aaeb6;

    --field-bg: #0e171b;
    --field-border: #67848e;

    --brand: #f4b673;
    --brand-ink: #f7c48c;
    --brand-soft: #2a1e10;
    --brand-border: #58401f;

    --nav-bg: #0a4655;
    --nav-border: #0f5a6d;
    --nav-hover: #0f5a6d;
    --nav-active: #0f5a6d;
    --nav-field-bg: #083a47;
    --nav-field-border: #5ba2b4;

    --success: #4cc38a;
    --success-soft: #12241c;
    --success-border: #2c5540;
    --warning: #e2a33f;
    --warning-soft: #291f10;
    --warning-border: #55411e;
    --danger: #f07a72;
    --danger-soft: #2a1614;
    --danger-border: #5c2b27;

    --focus-ring: #f2f6fa;
  }
}

:root[data-theme="dark"] {
  --bg: #0c1418;
  --surface: #121c21;
  --surface-2: #18242a;
  --surface-3: #1f2d34;
  --border: #26343a;
  --border-strong: #71858c;

  --text: #e8eef1;
  --text-muted: #abbec5;
  --text-subtle: #9aaeb6;

  --field-bg: #0e171b;
  --field-border: #67848e;

  --brand: #f4b673;
  --brand-ink: #f7c48c;
  --brand-soft: #2a1e10;
  --brand-border: #58401f;

  --nav-bg: #0a4655;
  --nav-border: #0f5a6d;
  --nav-hover: #0f5a6d;
  --nav-active: #0f5a6d;
  --nav-field-bg: #083a47;
  --nav-field-border: #5ba2b4;

  --success: #4cc38a;
  --success-soft: #12241c;
  --success-border: #2c5540;
  --warning: #e2a33f;
  --warning-soft: #291f10;
  --warning-border: #55411e;
  --danger: #f07a72;
  --danger-soft: #2a1614;
  --danger-border: #5c2b27;

  --focus-ring: #f2f6fa;
}

/* ------------------------------------------------------------------ base */

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: #f1f3f5;
  background: var(--bg);
  color: #1d2b32;
  color: var(--text);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 22px;
}

/* IE 11 knows the attribute but not that it should hide anything. */
[hidden] { display: none !important; }

h1, h2, h3 { margin: 0; font-weight: 650; }

a {
  color: #8d5000;
  color: var(--brand-ink);
  text-underline-offset: 2px;
}

p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

svg { flex: none; vertical-align: middle; }

:focus {
  outline: 2px solid #0b1219;
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
/* Modern browsers get the narrower rule; IE 11 keeps the one above, which is
   the whole point of not using :focus-visible alone. */
:focus:not(:focus-visible) { outline: none; }

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

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 60; }
.skip-link:focus {
  left: 12px; top: 12px; padding: 8px 12px;
  background: #ffffff; background: var(--surface);
  border: 1px solid #78878f; border: 1px solid var(--border-strong);
  border-radius: 4px;
}

.spacer { margin-left: auto; }
.truncate { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabnums { font-variant-numeric: tabular-nums; }

.mono {
  font-family: Consolas, "Courier New", ui-monospace, monospace;
  font-size: 13px;
}

.lead { font-size: 16px; line-height: 24px; color: #54646d; color: var(--text-muted); }

.hint {
  margin: 0;
  font-size: 12px;
  line-height: 16px;
  color: #5e6f78;
  color: var(--text-subtle);
}

/* ------------------------------------------------------------------ rail */

.rail {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: center;
  align-items: center;
  /* Wraps by default rather than at a breakpoint. The bar carries eight
     things and the widest of them is a translated string, so the width at
     which it stops fitting is not a number anybody can pick in advance -
     it moved by 90px between German and English. min-height, not height,
     or the second line is drawn outside the teal. */
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  min-height: 56px;
  padding: 6px 16px;
  background: #0d5566;
  background: var(--nav-bg);
  border-bottom: 1px solid #14657a;
  border-bottom: 1px solid var(--nav-border);
  color: #ffffff;
  color: var(--nav-text);
}

.rail > * { margin-right: 12px; margin-top: 2px; margin-bottom: 2px; }
.rail > *:last-child { margin-right: 0; }

.rail__mark {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: center;
  align-items: center;
  -ms-flex-pack: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 4px;
  background: #f0921e;
  background: var(--accent);
  color: #1a1206;
  color: var(--accent-ink);
}

.rail__name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
  color: var(--nav-text);
  text-decoration: none;
}

.rail__app {
  font-size: 12px;
  color: #a9c9d2;
  color: var(--nav-text-muted);
  padding-left: 12px;
  border-left: 1px solid #14657a;
  border-left: 1px solid var(--nav-border);
}

.rail__nav { display: -ms-flexbox; display: flex; }

.rail__link {
  display: block;
  padding: 6px 12px;
  margin-right: 4px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: #a9c9d2;
  color: var(--nav-text-muted);
}

.rail__link:hover { background: #12667c; background: var(--nav-hover); color: #ffffff; color: var(--nav-text); }
.rail__link.is-active { background: #12667c; background: var(--nav-active); color: #ffffff; color: var(--nav-text); }

.rail__spacer { -ms-flex: 1 1 auto; flex: 1 1 auto; margin-right: 0; }


.rail__state {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: #a9c9d2;
  color: var(--nav-text-muted);
  border-bottom: 1px dotted #6fb3c4;
  border-bottom: 1px dotted var(--nav-field-border);
}

.rail__state--open { color: #f0921e; color: var(--accent); border-bottom-color: transparent; }

.seg {
  display: -ms-flexbox;
  display: flex;
  border: 1px solid #6fb3c4;
  border: 1px solid var(--nav-field-border);
  border-radius: 4px;
  overflow: hidden;
  background: #0a4757;
  background: var(--nav-field-bg);
}

.seg__opt {
  display: block;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  color: #a9c9d2;
  color: var(--nav-text-muted);
}

.seg__opt + .seg__opt { border-left: 1px solid #6fb3c4; border-left: 1px solid var(--nav-field-border); }
.seg__opt.is-on { background: #12667c; background: var(--nav-active); color: #ffffff; color: var(--nav-text); }

.rail__icon {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: center;
  align-items: center;
  -ms-flex-pack: center;
  justify-content: center;
  width: 28px; height: 28px;
  padding: 0;
  border: 1px solid #6fb3c4;
  border: 1px solid var(--nav-field-border);
  border-radius: 4px;
  background: transparent;
  color: #ffffff;
  color: var(--nav-text);
  cursor: pointer;
}

/* ------------------------------------------------------------------ page */

.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 20px 64px;
}

/* A gate is one card on an otherwise empty page, and glued to the top of a
   900px window it looks stranded rather than composed. The offset is in `vh`
   so it scales with the window and disappears on a phone, where the card
   already fills most of the screen - and it is PADDING, not centring: a card
   taller than the window would have its top cut off by `align-items: center`,
   which is the classic way to make a long form unreachable. */
.page--narrow { max-width: 460px; }

@media (min-width: 721px) and (min-height: 640px) {
  .page--narrow { padding-top: 7vh; }
}
.page > * { margin-bottom: 16px; }
.page > *:last-child { margin-bottom: 0; }

/* ----------------------------------------------------------------- cards */

.card {
  background: #ffffff;
  background: var(--surface);
  border: 1px solid #e2e7ea;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.card__head {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: center;
  align-items: center;
  min-height: 48px;
  padding: 8px 16px;
  border-bottom: 1px solid #e2e7ea;
  border-bottom: 1px solid var(--border);
}

.card__title { font-size: 14px; line-height: 20px; font-weight: 700; }

.card__count {
  margin-left: 12px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  color: #5e6f78;
  color: var(--text-subtle);
}

.card__actions { margin-left: auto; }

.card__body { padding: 16px; }
.card__body > * { margin-bottom: 16px; }
.card__body > *:last-child { margin-bottom: 0; }
.card__body--flush { padding: 0; }

/* Was a style attribute, which the CSP blocks - so the divider between the
   command card's two halves was simply not drawn. */
.card__body--divided {
  border-top: 1px solid #e2e7ea;
  border-top: 1px solid var(--border);
}

.card__foot {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: center;
  align-items: center;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 1px solid #e2e7ea;
  border-top: 1px solid var(--border);
  background: #f7f8f9;
  background: var(--surface-2);
  border-radius: 0 0 6px 6px;
}

.card__foot > * { margin-right: 8px; }
.card__foot > *:last-child { margin-right: 0; }

.summary > .summary__row {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: center;
  align-items: center;
  -ms-flex-pack: justify;
  justify-content: space-between;
  min-height: 38px;
  padding: 4px 0;
  border-bottom: 1px solid #e2e7ea;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: #54646d;
  color: var(--text-muted);
}

.summary > .summary__row:last-child { border-bottom: 0; }
.summary b { color: #1d2b32; color: var(--text); font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- buttons */

.btn {
  display: -ms-inline-flexbox;
  display: inline-flex;
  -ms-flex-align: center;
  align-items: center;
  -ms-flex-pack: center;
  justify-content: center;
  height: 38px;
  padding: 0 14px;
  border: 1px solid #78878f;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: #ffffff;
  background: var(--surface);
  color: #1d2b32;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

.btn svg { margin-right: 8px; }
.btn:hover { background: #f7f8f9; background: var(--surface-2); }

.btn--primary {
  background: #f0921e;
  background: var(--accent);
  border-color: #c4761a;
  border-color: var(--accent-border);
  color: #1a1206;
  color: var(--accent-ink);
}

.btn--primary:hover { background: #dc8214; background: var(--accent-hover); }

.btn--danger-quiet {
  color: #b3241c;
  color: var(--danger);
  border-color: #efbdb7;
  border-color: var(--danger-border);
}

.btn--danger-quiet:hover { background: #fbe8e6; background: var(--danger-soft); }

.btn--sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn--sm svg { margin-right: 6px; }
.btn--block { width: 100%; }

.btn[disabled], .btn:disabled {
  background: #e9edf0;
  background: var(--surface-3);
  color: #5e6f78;
  color: var(--text-subtle);
  border-color: #e2e7ea;
  border-color: var(--border);
  cursor: not-allowed;
}

.row {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: center;
  align-items: center;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
}

/* The negative bottom margin cancels the children's on a row that fits on one
   line, and stops paying for itself the moment the row wraps - which on a
   phone is most of them. Without it two stacked buttons touch. */
.row { margin-bottom: -8px; }
.row > * { margin-right: 12px; margin-bottom: 8px; }
.row > *:last-child { margin-right: 0; }
.cell-actions .row > * { margin-right: 8px; }

/* A row of small buttons acting on the field above it. Tighter than a plain
   .row, and top-aligned so a <details> opening inside it does not drag its
   neighbours down with it. */
.row--actions {
  -ms-flex-align: start;
  align-items: flex-start;
}
.row--actions > * { margin-right: 8px; }
.row--actions > *:last-child { margin-right: 0; }

/* ----------------------------------------------------------------- forms */

.field { display: block; }
.field > * { margin-bottom: 6px; }
.field > *:last-child { margin-bottom: 0; }

.field__label {
  display: block;
  font-size: 11px;
  line-height: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #54646d;
  color: var(--text-muted);
}

.input,
input[type="text"],
input[type="password"] {
  display: block;
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #7b8a92;
  border: 1px solid var(--field-border);
  border-radius: 4px;
  background: #eef1f3;
  background: var(--field-bg);
  color: #1d2b32;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
}

.row > .input { -ms-flex: 1 1 auto; flex: 1 1 auto; width: auto; }

/* The editable filename in the command card. Full width it is an 820px box
   holding the word DATEI, which reads as a mistake. */
.input--short { max-width: 360px; }

input[readonly] { color: #54646d; color: var(--text-muted); }

.value-block {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: center;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid #e2e7ea;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #f7f8f9;
  background: var(--surface-2);
  font-size: 14px;
}

.value-block > * { margin-right: 8px; }
.value-block > *:last-child { margin-right: 0; }

/* -------------------------------------------------------------- dropzone */

.dropzone {
  display: block;
  padding: 14px 16px;
  text-align: center;
  border: 2px dashed #78878f;
  border: 2px dashed var(--border-strong);
  border-radius: 6px;
  background: #f7f8f9;
  background: var(--surface-2);
  color: #54646d;
  color: var(--text-muted);
  cursor: pointer;
}

.dropzone:hover { background: #e9edf0; background: var(--surface-3); }

.dropzone.is-dragging {
  border-style: solid;
  border-color: #f0921e;
  border-color: var(--accent);
  background: #fdf1e2;
  background: var(--brand-soft);
}

.dropzone__icon { display: block; margin-bottom: 4px; color: #5e6f78; color: var(--text-subtle); }
.dropzone__title { display: block; font-size: 15px; font-weight: 600; color: #1d2b32; color: var(--text); }
.dropzone__sub { display: block; margin-top: 4px; font-size: 13px; }

.dropzone__limits {
  display: block;
  margin-top: 6px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  color: #5e6f78;
  color: var(--text-subtle);
}

.dropzone--strip { padding: 12px 16px; }
.dropzone--strip .dropzone__icon { display: inline-block; margin: 0 8px 0 0; }
.dropzone--strip .dropzone__title { display: inline; }

/* -------------------------------------------------------------- progress */

.progress {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: #e9edf0;
  background: var(--surface-3);
  overflow: hidden;
}

.progress > span {
  display: block;
  /* Zero HERE and not in a style attribute on the element: the CSP is
     `style-src 'self'`, which blocks every inline style attribute in the
     markup - the console said so on every page load and the bars simply
     started at whatever the default was. Assigning `el.style.width` from the
     script is a CSSOM write and stays allowed. */
  width: 0;
  height: 100%;
  background: #a05c04;
  background: var(--brand);
}

.progress--dual { height: 12px; }

/* TWO LANES, not two bars in one track.
   Stacked they were unreadable: with nothing received yet the pale lane is at
   100% and the solid one at 0, and a full pale bar in a progress track means
   "done" to everybody who has ever seen one. Split, the pale lane can never be
   mistaken for the solid one - it is not even in the same place. */
.progress--dual > span {
  position: absolute;
  left: 0;
  height: 50%;
}

.progress--dual > .progress__ghost { top: 0; }
.progress--dual > span:not(.progress__ghost) { bottom: 0; }

/* The pale bar is what the server has taken from the sender; the solid one is
   what the receiver actually holds. The visible difference between them is
   the lead, drawn to scale. */
.progress--dual > .progress__ghost {
  background: #f0cfa4;
  background: var(--brand-border);
}

.progress--dual > span:not(.progress__ghost) {
  background: #f0921e;
  background: var(--accent);
}

.upbar__meta {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: baseline;
  align-items: baseline;
  margin-bottom: 6px;
  font-size: 13px;
  color: #54646d;
  color: var(--text-muted);
}

.upbar__pct {
  margin-left: auto;
  padding-left: 12px;
  /* The note beside it is a full sentence on the live transfer, and without
     these two the flex row squeezes "0 %" down to one character per line. */
  -ms-flex: 0 0 auto;
  flex: 0 0 auto;
  white-space: nowrap;
  font-family: Consolas, "Courier New", monospace;
  font-variant-numeric: tabular-nums;
}

/* The throttle. It sits at the far end of the button row because it is a
   setting, not an action - and it is the only thing in that row a person may
   still change while an upload runs. */
.fetch {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e2e7ea;
  border-top: 1px solid var(--border);
}
.fetch .row { margin-top: 6px; }
.fetch .row > .btn { -ms-flex: 0 0 auto; flex: 0 0 auto; }
.fetch .filelist:empty { display: none; }

.speed {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: center;
  align-items: center;
  margin-left: auto;
}

.speed__label {
  margin-right: 8px;
  font-size: 11px;
  line-height: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #54646d;
  color: var(--text-muted);
}

.speed__select {
  width: auto;
  height: 32px;
  padding: 0 6px;
  font-size: 13px;
}

/* -------------------------------------------------------------- filelist */

.filelist { list-style: none; margin: 0; padding: 0; border-top: 1px solid #e2e7ea; border-top: 1px solid var(--border); }

.filelist__row {
  position: relative;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: center;
  align-items: center;
  min-height: 56px;
  padding: 8px 16px;
  border-bottom: 1px solid #e2e7ea;
  border-bottom: 1px solid var(--border);
}

.filelist__row:last-child { border-bottom: 0; }
.filelist__row > * { margin-right: 12px; }
.filelist__row > *:last-child { margin-right: 0; }

.filelist__ext {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: center;
  align-items: center;
  -ms-flex-pack: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 4px;
  background: #e9edf0;
  background: var(--surface-3);
  color: #54646d;
  color: var(--text-muted);
  font-family: Consolas, "Courier New", monospace;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.filelist__main { -ms-flex: 1 1 auto; flex: 1 1 auto; min-width: 0; }
.filelist__name { display: block; font-size: 15px; font-weight: 600; word-wrap: break-word; }
.filelist__sub { display: block; font-size: 12px; line-height: 16px; color: #5e6f78; color: var(--text-subtle); }
.filelist__sub.is-done { color: #146b3a; color: var(--success); }
.filelist__sub.is-failed { color: #b3241c; color: var(--danger); }

.filelist__size {
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  color: #5e6f78;
  color: var(--text-subtle);
  font-variant-numeric: tabular-nums;
}

.filelist__row > .progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  margin: 0;
  border-radius: 0;
  background: transparent;
}

/* ---------------------------------------------------------------- tables */

.table-scroll { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: #ffffff;
  background: var(--surface);
}

.table thead th {
  height: 36px;
  padding: 0 12px;
  text-align: left;
  white-space: nowrap;
  background: #f7f8f9;
  background: var(--surface-2);
  color: #54646d;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border-bottom: 2px solid #78878f;
  border-bottom: 2px solid var(--border-strong);
}

.table tbody td {
  padding: 9px 12px;
  vertical-align: middle;
  border-bottom: 1px solid #e2e7ea;
  border-bottom: 1px solid var(--border);
}

.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #f7f8f9; background: var(--surface-2); }

.col-check { width: 34px; }
.col-actions, .cell-actions { text-align: right; }

/* The column that gives way.
   `max-width: 0` with `width: 100%` is the one thing that makes a table cell
   yield: without it the name sets the table's minimum width, the table grows
   past `.table-scroll`, and the row's buttons end up off-screen behind a
   sideways scroll - which is what was happening at EVERY width, desktop
   included, because `.page` caps at 900px and a row with four buttons wants
   about 950. The ellipsis inside only starts working once the cell can be
   narrower than its content. */
.col-name { max-width: 0; width: 100%; overflow: hidden; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

.cell-primary {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 600;
}

.cell-sub {
  display: block;
  font-size: 12px;
  line-height: 17px;
  color: #5e6f78;
  color: var(--text-subtle);
}

.filecell {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: center;
  align-items: center;
  min-width: 0;
}

.filecell > * { margin-right: 12px; }
.filecell > *:last-child { margin-right: 0; }
.filecell__text { min-width: 0; }

.cell-actions .row { -ms-flex-pack: end; justify-content: flex-end; -ms-flex-wrap: nowrap; flex-wrap: nowrap; }

/* ---------------------------------------------------------------- expiry */

.expiry { display: block; min-width: 92px; }
.expiry__track { display: block; height: 3px; border-radius: 2px; background: #e9edf0; background: var(--surface-3); overflow: hidden; }
.expiry__fill { display: block; width: 0; height: 100%; background: #146b3a; background: var(--success); }

/* The countdown is DATA - how much of a file's life is left - and it cannot
   travel in a style attribute for the reason above, nor in a script, because
   the list has to work without one. So it travels as a class, in tenths.
   That is finer than anybody reads a 3px bar, and it is the only shape that
   is both server-rendered and CSP-clean. */
.expiry__fill--0   { width: 0; }
.expiry__fill--10  { width: 10%; }
.expiry__fill--20  { width: 20%; }
.expiry__fill--30  { width: 30%; }
.expiry__fill--40  { width: 40%; }
.expiry__fill--50  { width: 50%; }
.expiry__fill--60  { width: 60%; }
.expiry__fill--70  { width: 70%; }
.expiry__fill--80  { width: 80%; }
.expiry__fill--90  { width: 90%; }
.expiry__fill--100 { width: 100%; }
.expiry[data-level="warn"] .expiry__fill { background: #8a5a00; background: var(--warning); }
.expiry[data-level="danger"] .expiry__fill { background: #b3241c; background: var(--danger); }

.expiry__label {
  display: block;
  margin-top: 5px;
  text-align: right;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  color: #54646d;
  color: var(--text-muted);
}

.expiry[data-level="warn"] .expiry__label { color: #8a5a00; color: var(--warning); }
.expiry[data-level="danger"] .expiry__label { color: #b3241c; color: var(--danger); }

/* ------------------------------------------------------ command card */

.seg-flavour {
  display: -ms-inline-flexbox;
  display: inline-flex;
  border: 1px solid #78878f;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  overflow: hidden;
}

.seg-flavour__opt {
  padding: 5px 12px;
  border: 0;
  background: #ffffff;
  background: var(--surface);
  color: #54646d;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.seg-flavour__opt + .seg-flavour__opt {
  border-left: 1px solid #78878f;
  border-left: 1px solid var(--border-strong);
}

.seg-flavour__opt.is-on {
  background: #f0921e;
  background: var(--accent);
  color: #1a1206;
  color: var(--accent-ink);
}

.cmd {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #e2e7ea;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #f7f8f9;
  background: var(--surface-2);
  color: #1d2b32;
  color: var(--text);
  font-family: Consolas, "Courier New", ui-monospace, monospace;
  font-size: 13px;
  line-height: 20px;
  /* Wide content scrolls inside its own box; the page never scrolls sideways.
     white-space stays `pre` so a copied command keeps its line breaks. */
  overflow-x: auto;
  white-space: pre;
  -webkit-user-select: all;
  user-select: all;
}

/* ------------------------------------------------------------- fileshare */

/* Retention, password and label side by side, wrapping on a narrow screen.
   Margins rather than gap, like everything else here. */
.options-row {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  margin-right: -12px;
}

.options-row > .field {
  -ms-flex: 1 1 200px;
  flex: 1 1 200px;
  min-width: 0;
  margin-right: 12px;
  margin-bottom: 12px;
}

/* A <details>, so the QR is there without a script and folded away until
   somebody wants it. */
.qr { position: relative; }
.qr > summary { display: inline-block; list-style: none; }
.qr > summary::-webkit-details-marker { display: none; }

/* --- the per-row split button and its menu ---------------------------------
   Download stays the default and stays a link; the chevron is the rest. The
   menu is positioned against the PAGE, not the row, because the file table
   scrolls sideways on a narrow screen and a menu inside it would be clipped. */

.split {
  display: -ms-inline-flexbox;
  display: inline-flex;
  -ms-flex-align: stretch;
  align-items: stretch;
}

/* The two halves read as one control: the seam between them is a single
   border, not a gap. */
.split__main {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.split__more {
  margin-left: -1px;
  padding-left: 6px;
  padding-right: 6px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.rowmenu {
  position: absolute;
  z-index: 40;
  min-width: 200px;
  padding: 4px;
  background: #ffffff;
  background: var(--surface);
  border: 1px solid #78878f;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
}

.rowmenu__item {
  display: block;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #1d2b32;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.rowmenu__item:hover {
  background: #f7f8f9;
  background: var(--surface-2);
}

.rowmenu__note {
  display: block;
  padding: 7px 10px;
  font-size: 12px;
  line-height: 16px;
  color: #5e6f78;
  color: var(--text-subtle);
}

.rowmenu__url { margin: 4px; width: calc(100% - 8px); }

/* A foldable card. The default marker disappears the moment a <summary> is
   laid out as a flex row, which is how the room card came to look like a
   heading nobody could open - so the affordance is explicit: a pointer, a
   hover, and a chevron that turns. */
.card--fold > summary {
  cursor: pointer;
  list-style: none;
}
.card--fold > summary::-webkit-details-marker { display: none; }

.card--fold > summary:hover {
  background: #f7f8f9;
  background: var(--surface-2);
}

.fold__text { display: block; min-width: 0; }

.fold__sub {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 16px;
  color: #5e6f78;
  color: var(--text-subtle);
}

.fold__chev {
  -ms-flex: none;
  flex: none;
  margin-left: 12px;
  color: #54646d;
  color: var(--text-muted);
}

.card--fold[open] > summary .fold__chev { transform: rotate(180deg); }

/* Out of flow, or opening the QR would widen this flex item to 200px and
   shove the buttons beside it off the row. */
.qr__panel {
  position: absolute;
  z-index: 3;
  top: 100%;
  left: 0;
  margin-top: 6px;
}

.qr__img {
  display: block;
  padding: 8px;
  background: #ffffff;  /* fixed: a QR on a dark ground does not scan */
  /* A hairline and the white ground carry it, as everywhere else - the panel
     floats over the text below and still may not have a shadow. */
  border: 1px solid #54646d;
  border: 1px solid var(--text-muted);
  border-radius: 4px;
}

/* ---------------------------------------------------------------- alerts */

.alert {
  padding: 12px 16px;
  border: 1px solid #e2e7ea;
  border: 1px solid var(--border);
  border-left: 3px solid #5e6f78;
  border-left: 3px solid var(--text-subtle);
  border-radius: 6px;
  background: #f7f8f9;
  background: var(--surface-2);
}

.alert--warn {
  background: #faefda; background: var(--warning-soft);
  border-color: #e4cfa2; border-color: var(--warning-border);
  border-left-color: #8a5a00; border-left-color: var(--warning);
}

.alert--ok {
  background: #e4f0e8; background: var(--success-soft);
  border-color: #b2d2bf; border-color: var(--success-border);
  border-left-color: #146b3a; border-left-color: var(--success);
}

.alert--danger {
  background: #fbe8e6; background: var(--danger-soft);
  border-color: #efbdb7; border-color: var(--danger-border);
  border-left-color: #b3241c; border-left-color: var(--danger);
}

.alert__title { display: block; font-size: 14px; line-height: 20px; font-weight: 700; }
.alert__title svg { margin-right: 8px; }
.alert__body { display: block; margin-top: 2px; font-size: 13px; line-height: 19px; color: #54646d; color: var(--text-muted); }

/* ----------------------------------------------------------------- empty */

.empty { padding: 48px 24px; text-align: center; color: #5e6f78; color: var(--text-subtle); }
.empty svg { display: block; margin: 0 auto 12px; }
.empty__title { display: block; font-size: 14px; font-weight: 700; color: #1d2b32; color: var(--text); }
.empty__text { max-width: 380px; margin: 8px auto 0; font-size: 14px; line-height: 20px; color: #54646d; color: var(--text-muted); }

.notes { margin: 0; padding-left: 18px; font-size: 13px; line-height: 19px; color: #54646d; color: var(--text-muted); }
.notes li { margin-bottom: 6px; }
.notes li:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------ gate */

.gate {
  padding: 20px;
  border: 1px solid #e2e7ea;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  background: var(--surface);
}

.gate > * { margin-bottom: 12px; }
.gate > *:last-child { margin-bottom: 0; }

.gate__icon {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: center;
  align-items: center;
  -ms-flex-pack: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 999px;
  background: #fdf1e2;
  background: var(--brand-soft);
  border: 1px solid #f0cfa4;
  border: 1px solid var(--brand-border);
  color: #8d5000;
  color: var(--brand-ink);
}

.gate__icon--quiet {
  background: #f7f8f9; background: var(--surface-2);
  border-color: #e2e7ea; border-color: var(--border);
  color: #54646d; color: var(--text-muted);
}

.gate__title { font-size: 20px; line-height: 26px; letter-spacing: -0.01em; }
.gate__text { font-size: 14px; line-height: 20px; color: #54646d; color: var(--text-muted); }
.gate__where { font-size: 13px; color: #54646d; color: var(--text-muted); }

.gate__host {
  display: block;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  color: #1d2b32;
  color: var(--text);
  word-wrap: break-word;
}

.gate form > * { margin-bottom: 16px; }
.gate form > *:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------ responsive */

/* The table stops being a table below 1000px.

   Not 720: an iPad in portrait is 834 and a drop box row wants about 950 -
   four action buttons, a size, a countdown and a filename. Under that the row
   does not shrink, it OVERFLOWS `.table-scroll`, and the Download button ends
   up reachable only by scrolling a table sideways on a touch screen. Letting
   the buttons wrap was tried first and made it worse: the column stayed
   narrow, so they stacked one per line and the table was just as wide.

   `display: block` on table parts is the one restyling Internet Explorer 11
   understands here; a grid would not be. */
@media (max-width: 1000px) {
  .table, .table tbody, .table tr, .table td { display: block; }
  .table thead { display: none; }

  .table tbody tr {
    position: relative;
    padding: 12px 12px 12px 34px;
    border-bottom: 1px solid #e2e7ea;
    border-bottom: 1px solid var(--border);
  }
  .table tbody tr:last-child { border-bottom: 0; }

  .table tbody td { padding: 0 0 6px; border-bottom: 0; }
  /* Undo the desktop yield-column: stacked, the name gets the whole row. */
  .table tbody td.col-name { max-width: none; width: auto; overflow: visible; }
  .table tbody tr:last-child td { border-bottom: 0; }

  /* Out of flow beside the name, so the checkbox does not cost a line. */
  .table tbody td.col-check {
    position: absolute;
    left: 8px;
    top: 15px;
    width: auto;
    padding: 0;
  }

  /* Size and countdown share a line rather than taking one each. */
  .table tbody td.num,
  .table tbody td.col-left {
    display: inline-block;
    width: auto;
    margin-right: 16px;
    text-align: left;
  }

  /* The header row is gone, so each number carries its own label. A share's
     "0" downloads without one is a number with no noun. */
  .table tbody td[data-label]::before {
    content: attr(data-label) " ";
    margin-right: 5px;
    color: #54646d;
    color: var(--text-muted);
    font-family: "Segoe UI", -apple-system, system-ui, Roboto, Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  /* The countdown was built for a narrow table column: label above the bar,
     value below it, right-aligned. Stacked next to a one-line "GRÖSSE 4,0 KB"
     that made the row lopsided - one line on the left, three on the right.
     Laid out along the line it reads as the pair it is. */
  .expiry {
    display: -ms-inline-flexbox;
    display: inline-flex;
    -ms-flex-align: center;
    align-items: center;
    min-width: 0;
  }
  .expiry__track { width: 44px; margin-right: 8px; }
  .expiry__label { margin-top: 0; text-align: left; }

  .table tbody td.cell-actions { padding-top: 8px; text-align: left; }
  .cell-actions .row {
    -ms-flex-pack: start;
    justify-content: flex-start;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
  }
}

/* The tagline is the first thing to go: it is the one element in the rail that
   says nothing a person needs, and without it the bar stays one line down to
   about 800px. */
@media (max-width: 900px) {
  .rail__app { display: none; }
}

@media (max-width: 720px) {
  /* TWO ROWS on purpose, instead of three by accident.
     Left to wrap on its own the bar came out at 123px on a 667px screen -
     nearly a fifth of it - with the name alone on the first line, the tabs
     ragged on the second and the badges on the third. Now: identity and the
     controls on one line, the three destinations on the next, filling the
     width they were always going to take. */
  .rail { padding: 6px 12px 8px; }

  .rail__mark { -ms-flex-order: 1; order: 1; }
  .rail__name { -ms-flex-order: 2; order: 2; }
  .rail__spacer { -ms-flex-order: 3; order: 3; }
  .rail__state { -ms-flex-order: 4; order: 4; }
  .rail .seg { -ms-flex-order: 5; order: 5; }
  .rail__icon { -ms-flex-order: 6; order: 6; }

  /* An enclosing strip, the same idiom as the DE/EN switch directly above it -
     one control for "pick one of these". Without it the active tab is a filled
     tile and the other two are bare text on teal, which at equal thirds reads
     as one button and two labels. */
  /* `order` is what does the work: the nav is third in the markup, and a
     flex item with a 100% basis wraps to a line of its own wherever it sits -
     so without this the bar would be name / tabs / everything-else, three
     lines again. Sent to the back, it is row two and the rest is row one. */
  .rail__nav {
    -ms-flex-order: 8;
    order: 8;
    -ms-flex: 1 1 100%;
    flex: 1 1 100%;
    margin-right: 0;
    margin-top: 6px;
    padding: 3px;
    border: 1px solid #6fb3c4;
    border: 1px solid var(--nav-field-border);
    border-radius: 6px;
    background: #0a4757;
    background: var(--nav-field-bg);
  }

  /* Equal thirds. A tab that is as wide as its own word leaves a third of the
     bar empty and reads as a link; one that owns its share of the width reads
     as a tab. `0px` and not `0`: IE 11 needs the unit in the flex shorthand. */
  .rail__link {
    -ms-flex: 1 1 0px;
    flex: 1 1 0px;
    margin-right: 4px;
    padding: 7px 4px;
    text-align: center;
  }
  .rail__link:last-child { margin-right: 0; }

  .page { padding: 12px 12px 48px; }
  .card__head { -ms-flex-wrap: wrap; flex-wrap: wrap; }
}
