/* admin.pascaljund.ch
   The Chalk look shared with pascaljund.ch and taken from Vertex: a crisp
   chalk ground, white paper cards, ink text, one pine accent, and Archivo in
   one family (wide and heavy for headlines and figures). Colours, type and
   feeling only: nothing of Vertex's brand.
   Status is always a shape plus a word, never colour alone:
   dot = fine, ring = idle, triangle = warning, diamond = broken. */

/* Archivo Variable, self-hosted (SIL OFL, see fonts/OFL.txt). */
@font-face {
  font-family: 'Archivo Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62.5% 125%;
  src: url(fonts/archivo-latin-ext-wdth-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Archivo Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62.5% 125%;
  src: url(fonts/archivo-latin-wdth-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  /* Chalk */
  --chalk: #f3f3f0;          /* page ground */
  --paper: #ffffff;          /* cards, fields */
  --line: #deded8;           /* borders, dividers */
  --ink: #15171a;            /* text, 16:1 */
  --ink-2: #4b4f55;          /* secondary text, 7.4:1 */
  --ink-3: #676b71;          /* labels, captions, 4.8:1 */
  --pine: #166534;           /* the one accent, 6.4:1 (7.1:1 on paper) */
  --pine-hover: #0f4a26;
  --pine-tint: #e3eee6;
  /* Night, for the dark variant */
  --night: #0d0f12;
  --night-card: #17191d;
  --night-line: rgba(255, 255, 255, 0.12);
  --night-ink: #f3f4f6;      /* 17:1 */
  --night-ink-2: #a9aeb6;    /* 8.6:1 */

  /* What the rules below use; the dark variant swaps only these. */
  --ground: var(--chalk);
  --card: var(--paper);
  --field: var(--paper);
  --inset: var(--chalk);     /* tiles and panels inside a card */
  --rule: var(--line);
  --edge: #85888e;           /* field and button outlines, 3:1 */
  --text: var(--ink);
  --text-2: var(--ink-2);
  --text-3: var(--ink-3);
  --accent: var(--pine);
  --accent-hover: var(--pine-hover);
  --accent-tint: var(--pine-tint);
  --on-accent: #ffffff;
  --bad: #b42318;            /* red and amber only for problems */
  --bad-tint: #fbeae7;
  --warn: #8a5300;
  --warn-tint: #f7eed8;
  --shadow: 0 18px 40px -16px rgba(21, 23, 26, 0.28);

  --font-sans: 'Archivo Variable', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  --stretch-wide: 125%;      /* display, headlines, figures */
  --stretch-semi: 112.5%;    /* titles */
  --fs-label: 0.75rem;       /* 12, weight 600, caps */
  --fs-small: 0.875rem;      /* 14 */
  --tracking-label: 0.08em;

  --radius-control: 6px;
  --radius-card: 12px;
  --radius-pill: 999px;
  --gutter: clamp(16px, 4vw, 48px);
  --gap: clamp(16px, 2vw, 24px);
  color-scheme: light;
}

/* Night: text, marks and focus rings take night-ink; pine is ~2.6:1 there. */
@media (prefers-color-scheme: dark) {
  :root {
    --ground: var(--night);
    --card: var(--night-card);
    --field: var(--night);
    --inset: #22252a;
    --rule: var(--night-line);
    --edge: #7d828a;
    --text: var(--night-ink);
    --text-2: var(--night-ink-2);
    --text-3: var(--night-ink-2);
    --accent: var(--night-ink);
    --accent-hover: #ffffff;
    --accent-tint: #26292e;
    --on-accent: var(--night);
    --bad: #ff8f85;
    --bad-tint: #33191a;
    --warn: #f0b955;
    --warn-tint: #2e2513;
    --shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  background: var(--ground);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 400 0.9375rem/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; }
h1, h2, h3, p { margin: 0; }
b { font-weight: 600; }
i { font-style: normal; font-weight: 600; color: var(--accent); }

a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }

code {
  font: 0.875em var(--font-mono);
  background: var(--inset);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

::selection { background: var(--accent-tint); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.muted { color: var(--text-2); font-weight: 400; }
.small { font-size: 0.8125rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* 12 px caps label; with --dot it opens a hero */
.label, table.list th, .tile .k {
  font-size: var(--fs-label);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-3);
}
.label--dot { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--text-2); }
.label--dot::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--accent); }

/* Status marks ---------------------------------------------------------- */

/* baseline-aligned: an empty mark sits on the baseline, about x-height tall */
.st { display: inline-flex; align-items: baseline; gap: 0.5em; white-space: nowrap; }
.st.wrap { display: flex; white-space: normal; }
.st::before {
  content: "";
  flex: none;
  width: 0.6em;
  height: 0.6em;
  border-radius: 50%;
  background: var(--accent);
}
.st.idle::before { background: none; border: 1.5px solid var(--text-3); }
.st.warn { color: var(--warn); font-weight: 600; }
.st.warn::before {
  width: 0.74em;
  height: 0.66em;
  border-radius: 0;
  background: var(--warn);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.st.bad { color: var(--bad); font-weight: 600; }
.st.bad::before {
  width: 0.54em;
  height: 0.54em;
  margin: 0 0.05em;
  border-radius: 1px;
  background: var(--bad);
  transform: rotate(45deg);
}
.issue { color: var(--bad); font-size: 0.8125rem; overflow-wrap: anywhere; }

/* Buttons and fields ------------------------------------------------------ */

button, .btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0.35rem 1rem;
  border: 1px solid var(--edge);
  border-radius: var(--radius-control);
  background: var(--card);
  color: var(--text);
  font-size: var(--fs-small);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}
button:hover, .btn:hover { border-color: var(--text); color: var(--text); text-decoration: none; }

button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button.primary:hover, .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }

button.ghost, .btn.ghost { border-color: var(--rule); font-weight: 500; }
button.ghost:hover, .btn.ghost:hover { border-color: var(--text); }

button.small, .btn.small { min-height: 2rem; padding: 0.2rem 0.75rem; font-size: 0.8125rem; }

button.danger { border-color: var(--bad); color: var(--bad); }
button.danger:hover { background: var(--bad); border-color: var(--bad); color: var(--ground); }

button:disabled { opacity: 0.55; cursor: wait; }
.copy { min-width: 4.1rem; }

label { display: block; font-size: 0.8125rem; font-weight: 500; color: var(--text-2); }
label > input:not([type=checkbox]), label > .help { display: block; margin-top: 0.35rem; }
label.check { display: flex; align-items: flex-start; gap: 0.55rem; font-size: var(--fs-small); font-weight: 400; color: var(--text); }
label.check input { flex: none; width: 1.05rem; height: 1.05rem; margin: 0.15rem 0 0; accent-color: var(--accent); }
.help { font-size: 0.8125rem; font-weight: 400; color: var(--text-3); }

input:not([type=checkbox]):not([type=file]) {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-height: 2.5rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--edge);
  border-radius: var(--radius-control);
  background: var(--field);
  color: var(--text);
  font-size: 1rem; /* 16 px: iOS does not zoom on focus */
  font-weight: 400;
  line-height: 1.3;
}
input:not([type=checkbox]):not([type=file]):focus-visible { outline-offset: 1px; border-color: var(--accent); border-radius: var(--radius-control); }
input::placeholder { color: var(--text-3); opacity: 1; }

input[type=file] { max-width: 100%; font-size: var(--fs-small); font-weight: 400; color: var(--text-2); }
input[type=file]::file-selector-button {
  min-height: 2rem;
  margin-right: 0.75rem;
  padding: 0.2rem 0.75rem;
  border: 1px solid var(--edge);
  border-radius: var(--radius-control);
  background: var(--card);
  color: var(--text);
  font: 600 0.8125rem/1.2 var(--font-sans);
  cursor: pointer;
}

progress {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--rule);
  color: var(--accent);
}
progress::-webkit-progress-bar { background: var(--rule); }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }

/* Messages ---------------------------------------------------------------- */

.flash, .error, .alert {
  position: relative;
  margin: 0;
  padding: 0.75rem 1rem 0.75rem 2.4rem;
  border-radius: var(--radius-card);
  background: var(--accent-tint);
  color: var(--text);
  font-weight: 500;
  overflow-wrap: anywhere;
}
.flash::before, .error::before, .alert::before {
  content: "";
  position: absolute;
  left: 1rem;
  top: 1.17rem;
  width: 0.56rem;
  height: 0.56rem;
  border-radius: 50%;
  background: var(--accent);
}
.error, .alert { background: var(--bad-tint); color: var(--bad); }
.error::before, .alert::before { width: 0.5rem; height: 0.5rem; border-radius: 1px; background: var(--bad); transform: rotate(45deg); }
.alert b { font-weight: 700; }
.alert__since { color: var(--text-2); font-weight: 400; white-space: nowrap; }
.alerts { display: grid; gap: 0.5rem; }

/* Overview hero --------------------------------------------------------------
   Label, name in the wide heavy cut, the alert summary and the quick links. */

.hero__in {
  max-width: 1296px;
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 2.25rem) var(--gutter) 0;
}
.hero__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.hero__name {
  margin: 0.5rem 0 0 -0.04em;
  font-size: clamp(2.125rem, 1.3rem + 3.2vw, 3.5rem);
  font-weight: 800;
  font-stretch: var(--stretch-wide);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.hero__row { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem 1rem; margin-top: 1.1rem; }

.state {
  min-height: 2rem;
  padding: 0.2rem 0.85rem;
  border-radius: var(--radius-pill);
  background: var(--accent-tint);
  color: var(--accent);
  font-size: var(--fs-small);
  font-weight: 600;
  text-decoration: none;
  align-items: center;
}
.state.bad { background: var(--bad-tint); color: var(--bad); }
a.state:hover { color: var(--bad); text-decoration: underline; text-decoration-thickness: 1px; }

.quick { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.quick a {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.2rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  background: var(--card);
  color: var(--text);
  font-size: var(--fs-small);
  font-weight: 500;
  text-decoration: none;
  transition: border-color 140ms ease;
}
.quick a:hover { border-color: var(--text); }

.top-actions { display: flex; gap: 0.5rem; }
.top-actions form { margin: 0; }
.top-actions button, .top-actions .btn { min-height: 2.25rem; padding: 0.25rem 0.85rem; }

/* Page and cards ---------------------------------------------------------- */

.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gap);
  max-width: 1296px;
  margin: 0 auto;
  padding: clamp(1.25rem, 2.5vw, 1.75rem) var(--gutter) 5rem;
}

.block {
  min-width: 0;
  padding: clamp(1rem, 2.2vw, 1.5rem);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  background: var(--card);
  scroll-margin-top: 1rem;
}
.block__head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.15rem 1.25rem; margin-bottom: 0.75rem; }
h2 {
  font-size: 1.5rem;
  font-weight: 700;
  font-stretch: var(--stretch-semi);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
h3 { margin: 1.75rem 0 0.25rem; font-size: 1.0625rem; font-weight: 700; font-stretch: var(--stretch-semi); line-height: 1.2; }
.hint { font-size: var(--fs-small); color: var(--text-2); }
.empty { padding: 0.5rem 0 0.25rem; color: var(--text-2); }

.pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); }
@media (min-width: 1040px) {
  .pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Tables ------------------------------------------------------------------
   Cells are padded and the table is pulled out by the same amount, so text
   lines up with the card's heading and a broken row's tint has room. */

table.list { width: calc(100% + 1.5rem); margin: 0 -0.75rem; border-collapse: separate; border-spacing: 0; }
table.list th {
  padding: 0.6rem 0.75rem 0.5rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  white-space: nowrap;
}
table.list td { padding: 0.85rem 0.75rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.list tbody tr:last-child td { border-bottom: 0; }
table.compact td { padding-top: 0.5rem; padding-bottom: 0.5rem; }
table.list .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.c-name { font-weight: 500; overflow-wrap: anywhere; }
.c-since { font-variant-numeric: tabular-nums; white-space: nowrap; }
.health { margin-left: 0.35em; font-size: 0.8125rem; color: var(--text-3); }
.health.unhealthy { color: var(--bad); font-weight: 600; }

/* a broken row is tinted as well as marked */
tr.bad td { background: var(--bad-tint); }
tr.bad td:first-child { border-radius: var(--radius-control) 0 0 var(--radius-control); }
tr.bad td:last-child { border-radius: 0 var(--radius-control) var(--radius-control) 0; }

tr.off .c-title b { color: var(--text-2); }
.shares .c-title { min-width: 12rem; }
.shares .c-updated { white-space: nowrap; font-variant-numeric: tabular-nums; }
.linkcell { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.3rem 0.75rem; overflow-wrap: anywhere; }
.linkcell a, .linkcell .muted { min-width: 0; overflow-wrap: anywhere; }
.shares td.c-link, .shares td.c-actions { padding-top: 0.55rem; padding-bottom: 0.55rem; }
.shares td.c-link .linkcell > a, .shares td.c-link .linkcell > .muted { padding-top: 0.3rem; }

.actions { display: flex; align-items: flex-start; justify-content: flex-end; gap: 0.4rem; }
.actions form { margin: 0; }

/* "More" menu and new share ------------------------------------------------ */

details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }

details.more { position: relative; }
details.more[open] > summary, details.new[open] > summary { border-color: var(--text); background: var(--inset); }
.pop {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 4;
  display: grid;
  gap: 1rem;
  width: 21.5rem;
  padding: 1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: left;
  white-space: normal;
}
.stack { display: grid; gap: 0.6rem; justify-items: start; }
.stack > label:not(.check) { width: 100%; }
.stack > progress { width: 100%; }
.stack + .stack { border-top: 1px solid var(--rule); padding-top: 1rem; }

details.new { margin-top: 1rem; }
.grid-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.5rem;
  max-width: 48rem;
  margin-top: 1rem;
  padding: clamp(1rem, 2vw, 1.25rem);
  border-radius: var(--radius-card);
  background: var(--inset);
}
.grid-form .wide { grid-column: 1 / -1; }
.grid-form code { background: var(--card); }
.submit-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem 1rem; }
.submit-row progress { flex: 1 1 10rem; max-width: 16rem; }

/* Saved links and passkeys -------------------------------------------------- */

ul.links { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
ul.links li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--rule);
}
.links__text { min-width: 0; overflow-wrap: anywhere; }
.inline-form { display: grid; gap: 0.6rem; margin-top: 1rem; }
.link-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
.link-form input[name=url] { grid-column: 1 / 3; }
.pk-form { grid-template-columns: minmax(0, 1fr) auto; }
.inline-form + .error { margin-top: 0.75rem; }

/* Server: four tiles with wide tabular figures, then the tables ------------ */

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; margin-top: 1rem; }
.tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0.9rem 1rem 1rem;
  border-radius: var(--radius-card);
  background: var(--inset);
}
.tile .k { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.75rem; }
.tile .k .st { font-size: 0.8125rem; letter-spacing: 0; text-transform: none; }
.tile .v {
  margin-top: 0.3rem;
  font-size: 2.5rem;
  font-weight: 800;
  font-stretch: var(--stretch-wide);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.tile .unit { margin-left: 0.1em; font-size: 0.5em; font-weight: 700; letter-spacing: 0; color: var(--text-3); }
.tile .small-v {
  display: flex;
  align-items: center;
  min-height: 2.625rem;
  margin-bottom: 0.6rem;
  font-size: 1.125rem;
  font-weight: 700;
  font-stretch: var(--stretch-semi);
  line-height: 1.2;
  letter-spacing: 0;
}
.tile .small-v .st { white-space: normal; font-weight: 700; }
.tile .sub { margin-top: auto; font-size: 0.8125rem; color: var(--text-2); }

/* gauge: a pill, with a tick at the alert threshold */
.gauge { display: block; width: 100%; height: 8px; margin: 0.6rem 0 0.6rem; border-radius: var(--radius-pill); overflow: hidden; }
.gauge__track { fill: var(--rule); }
.gauge__fill { fill: var(--accent); }
.gauge__limit { stroke: var(--text); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.tile.warn .gauge__fill { fill: var(--warn); }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); column-gap: clamp(24px, 3.5vw, 48px); }

/* Login ---------------------------------------------------------------------
   A bright hero beside the form: label, the name in the display cut, one
   line saying what is behind the login. */

.login {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  align-items: center;
  gap: clamp(1.75rem, 5vw, 5rem);
  max-width: 68rem;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 2.5rem var(--gutter) 4rem;
}
.login__name {
  margin: 0.9rem 0 0 -0.045em;
  font-size: clamp(3.25rem, 1.9rem + 6vw, 5rem);
  font-weight: 800;
  font-stretch: var(--stretch-wide);
  line-height: 0.95;
  letter-spacing: -0.025em;
}
.login__name span { display: block; }

.login-card {
  display: grid;
  gap: 1rem;
  width: 100%;
  max-width: 26rem;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  background: var(--card);
}
.login-card button { min-height: 3rem; font-size: 1rem; }
.login-card .login-submit { margin-top: 0.25rem; }
.login-card input.code { font-variant-numeric: tabular-nums; letter-spacing: 0.14em; }
.or { display: flex; align-items: center; gap: 0.9rem; margin: 0.25rem 0 0; font-size: 0.8125rem; color: var(--text-3); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
/* with a passkey on offer, password + code is the quieter way in */
.passkey-btn:not([hidden]) ~ .login-submit { background: var(--card); border-color: var(--edge); color: var(--text); }
.passkey-btn:not([hidden]) ~ .login-submit:hover { border-color: var(--text); }

@media (min-width: 860px) {
  .login { grid-template-columns: minmax(0, 1fr) minmax(0, 26rem); padding-bottom: 12vh; }
}

/* Narrow screens ------------------------------------------------------------ */

@media (max-width: 960px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  button.small, .btn.small { min-height: 2.25rem; padding: 0.25rem 0.8rem; }
  h2 { font-size: 1.375rem; }

  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
  .tile { padding: 0.75rem 0.8rem 0.85rem; }
  .tile .v { font-size: 2rem; }
  .tile .small-v { min-height: 2.1rem; font-size: 1rem; }

  .grid-form { grid-template-columns: minmax(0, 1fr); }
  .link-form, .pk-form { grid-template-columns: minmax(0, 1fr); }
  .link-form input[name=url] { grid-column: auto; }
  .inline-form button { justify-self: start; }
  ul.links li { flex-wrap: wrap; }
  ul.links .actions { justify-content: flex-start; }

  /* tables become one block per row; cells that lose their column header
     say what they are through data-label */
  table.list { display: block; width: auto; margin: 0; }
  table.list tbody { display: block; }
  table.list thead { display: none; }
  table.list tr { display: grid; gap: 0.15rem 0.9rem; padding: 0.7rem 0; border-bottom: 1px solid var(--rule); }
  table.list tbody tr:last-child { border-bottom: 0; }
  table.list td, table.compact td { padding: 0; border: 0; border-radius: 0; background: none; }
  table.list .num { text-align: left; }
  table.list td[data-label]::before { content: attr(data-label) " "; color: var(--text-3); }
  table.compact td:not(.c-name):not(.c-state) { font-size: 0.8125rem; color: var(--text-2); }
  table.list tr.bad {
    margin: 0.25rem -0.6rem;
    padding: 0.6rem;
    border-bottom: 0;
    border-radius: var(--radius-control);
    background: var(--bad-tint);
  }
  tr.bad td:first-child, tr.bad td:last-child { border-radius: 0; }

  table.shares tr { grid-template-columns: minmax(0, 1fr) auto; gap: 0.45rem 1rem; padding: 0.9rem 0; }
  .shares .c-title, .shares .c-link, .shares .c-actions { grid-column: 1 / -1; }
  .shares td.c-link, .shares td.c-actions { padding: 0; }
  .shares .c-link .linkcell { flex-wrap: nowrap; align-items: flex-start; justify-content: space-between; }
  .shares .c-size, .shares .c-updated { font-size: 0.8125rem; color: var(--text-2); }
  .shares .c-size div { display: inline; margin-left: 0.5em; }
  .shares .c-updated { justify-self: end; }
  .shares .c-actions { position: relative; padding-top: 0.25rem; }
  .shares .actions { justify-content: flex-start; }
  details.more { position: static; }
  .pop { left: 0; right: 0; width: auto; }

  table.sites tr { grid-template-columns: max-content max-content 1fr max-content; }
  .sites .c-name { grid-column: 1 / 4; }
  .sites .c-state { grid-column: 4; justify-self: end; }
  table.backups tr { grid-template-columns: minmax(0, 1fr) max-content; }
  table.containers tr { grid-template-columns: max-content 1fr max-content; }
  .containers .c-name { grid-column: 1 / 3; }
  .containers .c-state { grid-column: 3; justify-self: end; }
  .containers .c-since { grid-column: 2 / 4; }
}

@media (pointer: coarse) {
  button.small, .btn.small { min-height: 2.5rem; }
  .quick a, .state { min-height: 2.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
