/*
 * The site's stylesheet.
 *
 * Same palette and spacing as the desktop app, deliberately: someone arriving
 * here from Kadr should not feel handed off to a different product.
 */

:root {
  color-scheme: dark;

  --bg: #0b0d12;
  --surface-1: #14171e;
  --surface-2: #1b1f28;
  --surface-3: #242a35;
  --line: rgba(255, 255, 255, 0.06);
  --line-strong: rgba(255, 255, 255, 0.11);

  --text: #e8eaef;
  --text-dim: #99a1ae;
  --text-faint: #666e7c;

  --accent: #4d8dff;
  --accent-hover: #6ba0ff;
  --accent-ink: #04101f;
  --danger: #ff4d42;
  --warn: #ffb547;

  --r-sm: 7px;
  --r-md: 10px;
  --r-lg: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ------------------------------------------------------------------ */

.top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
  text-decoration: none;
}

.top__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.top__right form { margin: 0; }

.quiet {
  color: var(--text-dim);
  text-decoration: none;
}

.quiet:hover { color: var(--text); }

.page {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.bottom {
  padding: 20px 24px 28px;
  text-align: center;
  color: var(--text-faint);
  font-size: 12px;
}

/* ------------------------------------------------------------------ */

h1 { margin: 0 0 6px; font-size: 22px; font-weight: 650; letter-spacing: -0.01em; }
h2 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }

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

.muted { color: var(--text-dim); }
.hint { color: var(--text-faint); font-size: 12.5px; }

.alert {
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: rgba(255, 77, 66, 0.12);
  color: #ff8a82;
  font-size: 13px;
}

.card {
  padding: 24px;
  border-radius: var(--r-lg);
  background: var(--surface-1);
  box-shadow: 0 0 0 1px var(--line);
}

.card--center { text-align: center; }
.card--center .form { justify-content: center; }

.hero { padding: 40px 0 8px; }
.hero h1 { font-size: 30px; line-height: 1.2; }
.hero p { max-width: 46ch; color: var(--text-dim); }

/* ------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.btn:hover { background: var(--surface-3); border-color: rgba(255, 255, 255, 0.18); }

.btn--primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
  font-weight: 650;
  box-shadow: 0 2px 12px rgba(77, 141, 255, 0.28);
}

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

.btn--ghost {
  height: 30px;
  padding: 0 11px;
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text-dim);
  font-size: 12.5px;
}

.btn--ghost:hover { color: var(--text); }

.btn--lg { height: 42px; padding: 0 22px; font-size: 15px; }

/* ------------------------------------------------------------------ */

.form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.form--row { flex-direction: row; gap: 10px; margin-top: 22px; }

.form label { display: flex; flex-direction: column; gap: 6px; }
.form label > span { color: var(--text-dim); font-size: 13px; }

.form input[type="email"] {
  height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.form input[type="email"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(77, 141, 255, 0.18);
}

/* ------------------------------------------------------------------ */

.rows { display: flex; flex-direction: column; margin-top: 18px; }

.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.row__label { width: 110px; flex: none; color: var(--text-dim); }
.row__value { min-width: 0; }
.row .btn { margin-left: auto; }

.grants {
  margin: 18px auto 0;
  padding: 0;
  max-width: 44ch;
  list-style: none;
  text-align: left;
  color: var(--text-dim);
  font-size: 13.5px;
}

.grants li { padding: 7px 0 7px 22px; position: relative; }

.grants li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 14px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ------------------------------------------------------------------ */

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }

.plan {
  padding: 20px;
  border-radius: var(--r-md);
  background: var(--surface-1);
  box-shadow: 0 0 0 1px var(--line);
}

.plan--pro { box-shadow: 0 0 0 1px rgba(77, 141, 255, 0.4); }

.plan ul { margin: 12px 0 0; padding-left: 18px; color: var(--text-dim); font-size: 13.5px; }
.plan li { padding: 3px 0; }

@media (max-width: 560px) {
  .page { padding: 22px 14px 36px; }
  .card { padding: 18px; }
  .hero h1 { font-size: 24px; }
  .row__label { width: 88px; }
}

/* ------------------------------------------------------------------ *
 * Account page
 *
 * The page answers four questions in the order people arrive with them,
 * so each one is a card and the cards are not interchangeable: the plan
 * first, then what it was spent on, then the machines spending it.
 * ------------------------------------------------------------------ */

.card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.card__head h1,
.card__head h2 {
  margin: 0;
}

.card__head .muted {
  margin: 4px 0 0;
}

.notice {
  margin: 0 0 20px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: rgba(77, 141, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(77, 141, 255, 0.28);
}

.badge {
  flex: none;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge--pro {
  background: rgba(77, 141, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(77, 141, 255, 0.35);
  color: var(--accent);
}

/* Four numbers across, stacking rather than shrinking: a figure squeezed
   to fit is a figure nobody reads. */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 16px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat__value {
  font-size: 26px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.stat__label {
  color: var(--text-dim);
  font-size: 12.5px;
}

/* ------------------------------------------------------------------ */

/* ------------------------------------------------------------------ */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tab {
  padding: 5px 12px;
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 12.5px;
  text-decoration: none;
}

.tab:hover {
  background: var(--surface-2);
  color: var(--text);
}

.tab.is-on {
  background: var(--surface-3);
  color: var(--text);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  padding: 0 12px 8px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text-faint);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  /* "Keeps until" is two words and one column; letting it wrap makes the
     header row twice as tall as the rows it labels. */
  white-space: nowrap;
}

.table td {
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table tr:last-child td {
  border-bottom: 0;
}

.table__link a {
  color: var(--accent);
  text-decoration: none;
}

.table__link a:hover {
  text-decoration: underline;
}

.table__actions {
  padding-right: 0;
  text-align: right;
}

.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tag {
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-faint);
  font-size: 11px;
  white-space: nowrap;
}

.tag--on {
  background: rgba(77, 141, 255, 0.14);
  color: var(--accent);
}

.pager {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 16px;
}

.pager__page {
  min-width: 28px;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  color: var(--text-dim);
  font-size: 12.5px;
  text-align: center;
  text-decoration: none;
}

.pager__page:hover {
  background: var(--surface-2);
}

.pager__page.is-on {
  background: var(--surface-3);
  color: var(--text);
}

.pager .muted {
  margin-left: auto;
  font-size: 12.5px;
}

/* ------------------------------------------------------------------ */

.btn--sm {
  padding: 5px 10px;
  font-size: 12.5px;
}

/* ------------------------------------------------------------------ */

.compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.compare__col {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-1);
}

.compare__col--pro {
  border-color: rgba(77, 141, 255, 0.35);
}

.compare__col header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.compare__col h3 {
  margin: 0;
  font-size: 16px;
}

.compare__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.compare__list li {
  padding: 5px 0 5px 22px;
  position: relative;
  color: var(--text-dim);
  font-size: 13px;
}

.compare__list li strong {
  color: var(--text);
}

/* The tick and the dash carry the comparison, so they are drawn rather
   than typed: a bullet list of features tells you nothing about which
   plan has them. */
.compare__list li.yes::before,
.compare__list li.no::before {
  position: absolute;
  left: 2px;
  font-weight: 700;
}

.compare__list li.yes::before {
  content: "✓";
  color: var(--accent);
}

.compare__list li.no::before {
  content: "–";
  color: var(--text-faint);
}

.compare__list li.no {
  color: var(--text-faint);
}

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

@media (max-width: 640px) {
  .table th:nth-child(4),
  .table td:nth-child(4) {
    display: none;
  }
}

/* ------------------------------------------------------------------ *
 * Sign-in hand-off
 *
 * What the desktop app's sign-in falls back to when the browser cannot
 * hand the code straight back.
 * ------------------------------------------------------------------ */

/* A code somebody has to read off the screen and type. Spaced and monospaced
   so a 6 and a b are not a guess. */
.code {
  margin: 12px 0 0;
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
  font-family: "Cascadia Mono", Consolas, ui-monospace, monospace;
  font-size: 16px;
  letter-spacing: 0.08em;
  word-break: break-all;
  user-select: all;
}

/* The way out when the hand-back cannot land. Folded away, because on almost
   every machine this page is gone before anyone reads it. */
.fallback {
  margin-top: 20px;
  text-align: left;
}

.fallback > summary {
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
}

.fallback > summary:hover {
  color: var(--text);
}

/* ------------------------------------------------------------------ *
 * Account page
 *
 * This site sends style-src 'self', so nothing on the page may carry a
 * style attribute: every size comes from a class here, from a <meter>,
 * or from an SVG attribute. The first version set its bars' sizes
 * inline and the browser refused all of them.
 * ------------------------------------------------------------------ */

.page--wide { max-width: 1080px; }

.brand__mark { display: block; flex: none; }

.ico { display: block; flex: none; }

/* -- overview -- */

.overview__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.overview__plan {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.overview > .hint { margin: 16px 0 0; }

.tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  box-shadow: 0 0 0 1px var(--line);
}

.tile__label {
  color: var(--text-faint);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tile__value {
  font-size: 24px;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.tile__value small {
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}

.tile__foot { color: var(--text-dim); font-size: 12.5px; }
.tile__foot.is-warn { color: var(--warn); }

/* The month's usage. A <meter> rather than a div sized by percentage:
   it takes its value as an attribute, and low/high turn it amber and
   then red near the limit without any arithmetic in the template. */
.usage {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 6px;
  margin: 4px 0 2px;
  border: 0;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
}

.usage::-webkit-meter-bar {
  height: 6px;
  border: 0;
  border-radius: 99px;
  background: var(--surface-3);
}

.usage::-webkit-meter-optimum-value { background: var(--accent); border-radius: 99px; }
.usage::-webkit-meter-suboptimum-value { background: var(--warn); border-radius: 99px; }
.usage::-webkit-meter-even-less-good-value { background: var(--danger); border-radius: 99px; }
.usage::-moz-meter-bar { background: var(--accent); border-radius: 99px; }
.usage:-moz-meter-sub-optimum::-moz-meter-bar { background: var(--warn); }
.usage:-moz-meter-sub-sub-optimum::-moz-meter-bar { background: var(--danger); }

/* -- activity -- */

.spark {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 8px;
}

.spark__base { stroke: var(--line-strong); stroke-width: 1; }
.spark__hit { fill: transparent; }

.spark__bar {
  fill: var(--accent);
  opacity: 0.55;
  transition: opacity 0.12s;
}

/* An empty day keeps a sliver rather than a gap: the shape of a month
   reads better when the quiet days are still there. */
.spark__bar.is-empty { fill: var(--surface-3); opacity: 1; }
.spark__bar.is-today { opacity: 1; }
.spark g:hover .spark__bar { opacity: 1; }
.spark g:hover .spark__bar.is-empty { fill: var(--text-faint); }

.spark__axis {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--text-faint);
  font-size: 12px;
}

/* -- uploads -- */

.tab__n {
  margin-left: 2px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.tab.is-on .tab__n { color: inherit; opacity: 0.7; }

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.shot {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: var(--r-md);
  background: var(--surface-2);
  box-shadow: 0 0 0 1px var(--line);
  transition: box-shadow 0.12s;
}

.shot:hover {
  box-shadow: 0 0 0 1px var(--line-strong), 0 8px 24px rgba(0, 0, 0, 0.35);
}

.shot__thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--r-md) var(--r-md) 0 0;
  background: var(--surface-3);
}

.shot__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shot__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: auto;
  border-radius: 50%;
  background: rgba(11, 13, 18, 0.72);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.shot__play .ico { width: 18px; height: 18px; margin-left: 2px; }

.shot__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px 12px;
}

.shot__title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.shot__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12.5px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.shot__name:hover { color: var(--accent-hover); }

.shot__size {
  flex: none;
  color: var(--text-faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.shot__meta {
  overflow: hidden;
  color: var(--text-dim);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shot__foot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 99px;
  background: var(--surface-3);
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 550;
  white-space: nowrap;
}

.chip .ico { width: 13px; height: 13px; }
.chip--kept { background: rgba(77, 141, 255, 0.14); color: var(--accent-hover); }
.chip--soon { background: rgba(255, 181, 71, 0.14); color: var(--warn); }

/* Delete asks twice without a script: the first click opens this, the
   button inside it is the one that deletes. */
.confirm { margin-left: auto; }

.confirm > summary,
.rename > summary { list-style: none; }

.confirm > summary::-webkit-details-marker,
.rename > summary::-webkit-details-marker { display: none; }

.iconbtn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  color: var(--text-faint);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.iconbtn:hover,
.confirm[open] > .iconbtn {
  background: var(--surface-3);
  color: var(--danger);
}

.confirm__box,
.rename__box {
  position: absolute;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 10px 10px 12px;
  border-radius: var(--r-md);
  background: var(--surface-3);
  box-shadow: 0 0 0 1px var(--line-strong), 0 12px 32px rgba(0, 0, 0, 0.45);
  font-size: 12.5px;
  white-space: nowrap;
}

.confirm__box { bottom: calc(100% + 8px); }
.rename__box { top: calc(100% + 8px); }

.btn--danger {
  background: var(--danger);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}

.btn--danger:hover { background: #ff6a60; }

/* -- devices -- */

.devices {
  display: flex;
  flex-direction: column;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.device {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.device:first-child { border-top: 0; }

.device__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text-dim);
  box-shadow: 0 0 0 1px var(--line);
}

.device__main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.device__name { font-weight: 600; }
.device__meta { color: var(--text-faint); font-size: 12.5px; }
.device.is-revoked { opacity: 0.55; }
.device.is-revoked .device__name { text-decoration: line-through; }

.device__actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.device__actions form { margin: 0; }

.rename__box input {
  width: 200px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface-1);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.rename__box input:focus { outline: none; border-color: var(--accent); }

/* -- plan -- */

.perks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px 16px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.perks li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
}

.perks .ico { color: var(--accent); }

@media (max-width: 860px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .tiles { gap: 8px; }
  .tile { padding: 12px; }
  .tile__value { font-size: 20px; }
  .overview__head { flex-direction: column; }
  .overview__plan { flex-direction: row; align-items: center; }
  .shots { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .device__meta { font-size: 12px; }
}

.compare + .hint { margin-top: 14px; }

/* ------------------------------------------------------------------ *
 * Administration
 *
 * Built from the account page's parts - tiles, the activity chart, tabs -
 * so there is one visual language to maintain for an audience of one.
 * The account list is a grid of rows rather than a table: each row's
 * Manage panel can then open over the page without a scrolling table
 * clipping it, and the rows can stack on a phone.
 * ------------------------------------------------------------------ */

a.tile__foot { text-decoration: none; }
a.tile__foot:hover { text-decoration: underline; }

.legend {
  display: flex;
  gap: 14px;
  color: var(--text-faint);
  font-size: 12px;
}

.legend__item { display: inline-flex; align-items: center; gap: 6px; }
.legend__bar { width: 8px; height: 10px; border-radius: 2px; background: var(--accent); }
.legend__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }

.spark__signup { fill: var(--warn); }

/* -- list controls -- */

.listbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.listbar__search {
  display: flex;
  flex: 1 1 320px;
  gap: 8px;
  max-width: 460px;
  margin: 0;
}

.listbar__search input[type="search"] {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}

.listbar__search input[type="search"]:focus { outline: none; border-color: var(--accent); }

.sorts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  font-size: 12.5px;
}

.sorts .hint { margin-right: 6px; }

.sorts__link {
  padding: 4px 9px;
  border-radius: 99px;
  color: var(--text-dim);
  text-decoration: none;
}

.sorts__link:hover { color: var(--text); }
.sorts__link.is-on { background: var(--surface-3); color: var(--text); }

.lapsed-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: rgba(255, 181, 71, 0.08);
  color: var(--warn);
}

/* -- the account list -- */

.accts {
  margin: 0;
  padding: 0;
  list-style: none;
}

.acct {
  display: grid;
  grid-template-columns: minmax(0, 2.6fr) minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 0.8fr) minmax(0, 0.6fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px 4px;
  border-top: 1px solid var(--line);
}

.acct--head {
  padding-top: 0;
  border-top: 0;
  color: var(--text-faint);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.acct.is-lapsed { background: linear-gradient(90deg, rgba(255, 181, 71, 0.06), transparent 60%); }

.acct__who {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #0b0d12;
  font-size: 14px;
  font-weight: 700;
}

/* Six hues picked by a hash of the address, so one account keeps its colour
   across visits without anything being stored for it. */
.avatar--0 { background: #4d8dff; }
.avatar--1 { background: #ffb547; }
.avatar--2 { background: #3ddc84; }
.avatar--3 { background: #c084fc; }
.avatar--4 { background: #ff7a6f; }
.avatar--5 { background: #5ad1e6; }

.acct__id {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.acct__email {
  overflow: hidden;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acct__meta {
  overflow: hidden;
  color: var(--text-faint);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acct__plan {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.acct__until { color: var(--text-faint); font-size: 11.5px; white-space: nowrap; }
.acct__until.is-warn { color: var(--warn); }

.acct__num {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.acct__num small { color: var(--text-faint); font-size: 12px; }

.acct__month {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.usage--mini { height: 4px; margin: 0; max-width: 120px; }
.usage--mini::-webkit-meter-bar { height: 4px; }

/* -- Manage -- */

.manage { position: relative; }
.manage > summary { list-style: none; }
.manage > summary::-webkit-details-marker { display: none; }
.manage[open] > summary { color: var(--text); border-color: var(--accent); }

.manage__box {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 3;
  display: flex;
  flex-direction: column;
  width: 300px;
  border-radius: var(--r-md);
  background: var(--surface-3);
  box-shadow: 0 0 0 1px var(--line-strong), 0 16px 40px rgba(0, 0, 0, 0.5);
}

.manage__plan,
.manage__devices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 14px;
}

.manage__devices { border-top: 1px solid var(--line-strong); }

.manage__label {
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
}

.manage__until {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.manage__until input[type="date"] {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface-1);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  color-scheme: dark;
}

/* Free / Pro as a two-way switch made of radios: no script, still one click. */
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border-radius: var(--r-sm);
  background: var(--surface-1);
  box-shadow: 0 0 0 1px var(--line-strong);
}

.seg label { position: relative; }

.seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.seg span {
  display: block;
  padding: 6px 0;
  border-radius: 5px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.seg input:checked + span { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

.btn--danger-ghost {
  background: transparent;
  border-color: rgba(255, 77, 66, 0.45);
  color: #ff8a82;
}

.btn--danger-ghost:hover { background: rgba(255, 77, 66, 0.12); color: #ffb0aa; }

/* -- recent changes -- */

.events {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.events li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 13px;
}

.events li:first-child { border-top: 0; }
.events strong { color: var(--text); font-weight: 550; }
.events__when { color: var(--text-faint); white-space: nowrap; }


.acct__unit { display: none; }

/* Deleting an account: folded inside the Manage panel, and asking for the
   address to be typed, because it is the one action here with no way back. */
.manage__danger {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line-strong);
}

.danger > summary {
  list-style: none;
  color: #ff8a82;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.danger > summary::-webkit-details-marker { display: none; }
.danger > summary:hover { color: #ffb0aa; }
.danger[open] > summary { margin-bottom: 10px; }

.danger__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
}

.danger__what { color: var(--text-dim); font-size: 12.5px; line-height: 1.5; }

.danger__confirm {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.danger__confirm strong { color: var(--text); font-weight: 600; word-break: break-all; }

.danger__confirm input {
  height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(255, 77, 66, 0.45);
  border-radius: var(--r-sm);
  background: var(--surface-1);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.danger__confirm input:focus { outline: none; border-color: var(--danger); }
@media (max-width: 760px) {
  .acct--head { display: none; }

  /* Who, then the plan and Manage beside it, then the numbers in a row. */
  .acct {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "who    manage"
      "plan   plan"
      "month  month"
      "stored devices";
    gap: 8px 12px;
  }

  .acct__who { grid-area: who; }
  .acct__plan { grid-area: plan; flex-direction: row; align-items: center; gap: 8px; }
  .acct__month { grid-area: month; flex-direction: row; align-items: center; gap: 10px; }
  .acct__stored { grid-area: stored; color: var(--text-dim); font-size: 12.5px; }
  .acct__devices { grid-area: devices; color: var(--text-dim); font-size: 12.5px; text-align: right; }
  .acct__unit { display: inline; }
  .acct__devices .hint { display: none; }
  .manage { grid-area: manage; }
  .manage__box { width: min(300px, calc(100vw - 48px)); }
  .events li { grid-template-columns: 1fr; gap: 2px; }
}

/* -- one account, as an administrator sees it -- */

.backlink {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 4px;
  margin-bottom: -6px;
  color: var(--text-dim);
  font-size: 13px;
  text-decoration: none;
}

.backlink:hover { color: var(--text); }

.avatar--lg { width: 52px; height: 52px; font-size: 20px; }

.acct__title {
  margin: 0 0 2px;
  font-size: 20px;
  overflow-wrap: anywhere;
}

.acct__email a { color: inherit; text-decoration: none; }
.acct__email a:hover { color: var(--accent-hover); text-decoration: underline; }

.hint.is-warn { color: var(--warn); }

.shot__owner {
  overflow: hidden;
  color: var(--accent-hover);
  font-size: 12px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shot__owner:hover { text-decoration: underline; }

.manage__open {
  display: block;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--accent-hover);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
}

.manage__open:hover { background: rgba(77, 141, 255, 0.08); }

.chip--gone { background: transparent; color: var(--text-faint); box-shadow: inset 0 0 0 1px var(--line-strong); }
