/* ===========================================================================
   Hungry Dogs — exchange tracker
   ---------------------------------------------------------------------------
   Colour carries meaning here rather than decoration: magenta IS Crinkles,
   cyan IS Keifir, and amber is reserved exclusively for gold. Goods read cool,
   money reads warm, so the two never have to be told apart by a label.
   =========================================================================== */

:root {
  /* Surfaces — deep blue-black, never neutral grey */
  --void: #06080f;
  --panel: #0d1220;
  --panel-raised: #131a2e;
  --grid: #1b2544;
  --grid-bright: #2b3a68;

  /* Meaning */
  --crinkle: #ff3ddb;
  --keifir: #3de8ff;
  --chip: #ffc53d; /* gold, and only gold */
  --alarm: #ff5c5c;
  --ok: #4ade80;

  /* Text */
  --ink: #e8ecf8;
  --ink-dim: #8b96b8;
  --ink-faint: #55618a;

  --display: 'Bahnschrift', 'DIN Alternate', 'Oswald', 'Segoe UI Semibold', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', 'SF Mono', Consolas, 'Liberation Mono', monospace;

  /* Sized to what the log actually needs. Wider than this and the table has to
     invent space to fill, which is where stray gaps come from. */
  --shell: 940px;
  --radius: 4px;
  --notch: 10px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--void);
  /* Two faint item-coloured auroras, so the page background belongs to the
     same colour system as the data. */
  background-image:
    radial-gradient(ellipse 70% 50% at 15% -10%, rgba(255, 61, 219, 0.09), transparent 70%),
    radial-gradient(ellipse 70% 50% at 85% -10%, rgba(61, 232, 255, 0.09), transparent 70%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.root {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 28px 20px 96px;
}

/* --------------------------------------------------------------- primitives */

.label {
  font-family: var(--display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

.gold {
  color: var(--chip);
}

.icon {
  width: 1em;
  height: 1em;
  flex: none;
  display: inline-block;
  vertical-align: -0.14em;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

input,
select,
button {
  font-family: inherit;
}

:focus-visible {
  outline: 2px solid var(--keifir);
  outline-offset: 2px;
  border-radius: 2px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  background: transparent;
  border: 1px solid var(--grid-bright);
  border-radius: var(--radius);
  color: var(--ink-dim);
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.btn:hover {
  color: var(--ink);
  border-color: var(--keifir);
  background: rgba(61, 232, 255, 0.07);
}

.btn-primary {
  border-color: rgba(61, 232, 255, 0.55);
  color: var(--keifir);
}

.btn-primary:hover {
  background: rgba(61, 232, 255, 0.14);
}

.btn-danger:hover {
  color: var(--alarm);
  border-color: var(--alarm);
  background: rgba(255, 92, 92, 0.09);
}

.btn-danger-solid {
  border-color: var(--alarm);
  background: rgba(255, 92, 92, 0.16);
  color: var(--alarm);
}

.btn-danger-solid:hover {
  border-color: var(--alarm);
  background: rgba(255, 92, 92, 0.3);
  color: var(--ink);
}

.btn-ghost {
  border-color: transparent;
  padding: 6px 8px;
}

/* --------------------------------------------------------------- header */

.masthead {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--grid);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0;
  font-family: var(--display);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  white-space: nowrap;
}

.wordmark .icon {
  width: 27px;
  height: 27px;
  color: var(--crinkle);
}

/* The two halves of the name take the two item colours: the wordmark is the
   colour key for the whole app. */
.wordmark em {
  font-style: normal;
  color: var(--keifir);
}

.masthead-spacer {
  flex: 1 1 40px;
}

/* --------------------------------------------------------------- filter */

.filter {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 230px;
}

.filter .icon {
  position: absolute;
  left: 11px;
  width: 14px;
  height: 14px;
  color: var(--ink-faint);
  pointer-events: none;
}

.filter input {
  width: 100%;
  padding: 9px 12px 9px 33px;
  background: var(--panel);
  border: 1px solid var(--grid-bright);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 13px;
}

.filter input::placeholder {
  color: var(--ink-faint);
}

.filter input:focus {
  border-color: var(--keifir);
  outline: none;
  box-shadow: 0 0 0 3px rgba(61, 232, 255, 0.13);
}

/* --------------------------------------------------------------- buyer card */

/* Sits directly under the filter that produced it, inside the log panel. */
.buyer-card {
  display: flex;
  align-items: center;
  gap: 10px 22px;
  flex-wrap: wrap;
  padding: 11px 18px;
  background: rgba(61, 232, 255, 0.06);
  border-bottom: 1px solid var(--grid);
  box-shadow: inset 2px 0 0 var(--keifir);
}

.buyer-card-name {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.buyer-card-stat {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 13px;
}

.buyer-card-empty {
  color: var(--ink-faint);
  font-size: 13px;
}

/* --------------------------------------------------------------- tabs */

.tabs {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin: 26px 0 18px;
}

.tab {
  padding: 9px 19px;
  background: var(--panel);
  border: 1px solid var(--grid);
  border-radius: 0;
  color: var(--ink-dim);
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.tab:hover {
  color: var(--ink);
  border-color: var(--grid-bright);
}

.tab[aria-selected='true'] {
  background: var(--panel-raised);
  border-color: var(--keifir);
  box-shadow: inset 0 -2px 0 var(--keifir);
  color: var(--ink);
}

.tab-add {
  padding: 9px 13px;
  color: var(--keifir);
  border-style: dashed;
}

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

.stock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

/* One line per item: name, starting amount, then the meter taking whatever
   width is left, so the card has no dead space to the right. */
.stock-card {
  --accent: var(--keifir);
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  background: var(--panel);
  border: 1px solid var(--grid);
  border-radius: var(--radius);
  overflow: hidden;
}

/* A hairline of the item's own colour along the top edge. */
.stock-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--accent);
  opacity: 0.85;
}

.stock-card > .icon {
  width: 19px;
  height: 19px;
  color: var(--accent);
}

.stock-card-name {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* The batch's starting amount, edited in place. It is the headline number
   because it is the one you set; what is left is in the summary bar. */
.stock-total {
  width: 3.6ch;
  flex: none;
  padding: 1px 6px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--accent);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.1;
  text-align: right;
  transition: border-color 0.12s, background 0.12s;
}

.stock-total::-webkit-outer-spin-button,
.stock-total::-webkit-inner-spin-button {
  appearance: none;
  margin: 0;
}

.stock-total {
  appearance: textfield;
  -moz-appearance: textfield;
}

/* Where supported, the field tracks its own content so a 3-digit stock does not
   leave a hole next to a 2-digit one. */
@supports (field-sizing: content) {
  .stock-total {
    width: auto;
    min-width: 1.6ch;
    field-sizing: content;
  }
}

.stock-total:hover {
  border-color: var(--grid-bright);
  background: rgba(6, 8, 15, 0.5);
}

.stock-total:focus {
  border-color: var(--accent);
  background: var(--void);
  outline: none;
}

.stock-card.is-oversold .stock-total {
  color: var(--alarm);
}

.stock-of {
  font-size: 13px;
  color: var(--ink-faint);
}

/* Signature element: a segmented depletion meter. It reads as a resource bar
   in a game HUD, which is exactly the world this data comes from — you know
   how much is left before you read the number. */
.meter {
  position: relative;
  flex: 1 1 80px;
  min-width: 60px;
  height: 9px;
  background: #0a0f1c;
  border: 1px solid var(--grid);
  border-radius: 2px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: var(--pct, 0%);
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
  transition: width 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Notches drawn over the fill turn a smooth bar into readable segments. */
.meter::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 17px,
    var(--panel) 17px 20px
  );
  pointer-events: none;
}

.stock-card.is-oversold .meter-fill {
  background: var(--alarm);
  box-shadow: 0 0 14px var(--alarm);
}

/* --------------------------------------------------------------- table */

.log {
  background: var(--panel);
  border: 1px solid var(--grid);
  border-radius: var(--radius);
  overflow: hidden;
}

.log-head {
  display: flex;
  align-items: center;
  gap: 10px 12px;
  flex-wrap: wrap;
  padding: 11px 14px 11px 18px;
  border-bottom: 1px solid var(--grid);
}

.log-head-spacer {
  flex: 1 1 20px;
}

.log-head .filter {
  min-width: 0;
  width: 230px;
}

.log-head .filter input {
  padding-top: 7px;
  padding-bottom: 7px;
}

.log-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.log-count {
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 12px;
}

.table-scroll {
  overflow-x: auto;
  /* Without paint containment the table's min-width leaks past this scroll
     container into the document's scroll region, letting the whole page slide
     sideways on a phone. This keeps the overflow where it belongs. */
  contain: paint;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 740px;
  /* Fixed layout makes the declared column widths authoritative, so the one
     column without a width (Total) reliably takes the leftover space. */
  table-layout: fixed;
}

thead th {
  padding: 10px 12px;
  background: #0a0f1c;
  border-bottom: 1px solid var(--grid);
  font-family: var(--display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: left;
  white-space: nowrap;
}

tbody td {
  padding: 7px 12px;
  border-bottom: 1px solid rgba(27, 37, 68, 0.55);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background 0.15s;
}

tbody tr:hover {
  background: rgba(43, 58, 104, 0.16);
}

/* Proportional widths summing to 100%. Every column is declared, so leftover
   space is shared out instead of pooling into one conspicuous gap. */
.col-buyer {
  width: 18%;
}

.col-qty {
  width: 7%;
  text-align: right;
}

.col-item {
  width: 19%;
}

.col-price {
  width: 11%;
  text-align: right;
}

.col-num {
  width: 13%;
  text-align: right;
}

.col-check {
  width: 8%;
  text-align: center;
}

.col-partial {
  width: 10%;
  text-align: right;
}

.col-actions {
  width: 6%;
}

th.col-check {
  text-align: center;
}

/* A column heading that is also a bulk action. */
.col-action {
  padding: 3px 8px;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.col-action:hover {
  color: var(--chip);
  border-color: rgba(255, 197, 61, 0.5);
  background: rgba(255, 197, 61, 0.1);
}

th.col-qty,
th.col-price,
th.col-num,
th.col-partial {
  text-align: right;
}

/* Filter highlights rather than hides, so the totals below always describe the
   whole batch and never quietly change meaning. */
tbody tr.is-dimmed {
  opacity: 0.24;
}

tbody tr.is-match {
  background: rgba(61, 232, 255, 0.09);
  box-shadow: inset 2px 0 0 var(--keifir);
}

tbody tr.is-match:hover {
  background: rgba(61, 232, 255, 0.15);
}

/* Something came in but not all of it — the row that still owes you gold. */
tbody tr.is-part-paid {
  box-shadow: inset 2px 0 0 var(--chip);
}

/* --------------------------------------------------------------- cell inputs */

.cell-input {
  width: 100%;
  padding: 5px 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 14px;
  transition: background 0.12s, border-color 0.12s;
}

.cell-input:hover {
  border-color: var(--grid-bright);
  background: rgba(6, 8, 15, 0.55);
}

.cell-input:focus {
  border-color: var(--keifir);
  background: var(--void);
  outline: none;
}

.cell-input.num {
  text-align: right;
}

/* A money field, so it wears the currency colour rather than the text colour. */
.cell-gold {
  color: var(--chip);
}

.cell-gold::placeholder {
  color: var(--ink-faint);
}

.cell-gold:disabled {
  background: transparent;
  border-color: transparent;
  color: var(--ink-faint);
  cursor: not-allowed;
  opacity: 0.5;
}

.cell-input::-webkit-outer-spin-button,
.cell-input::-webkit-inner-spin-button {
  appearance: none;
  margin: 0;
}

.cell-input[type='number'] {
  appearance: textfield;
  -moz-appearance: textfield;
}

select.cell-input {
  appearance: none;
  padding-right: 22px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-faint) 50%),
    linear-gradient(135deg, var(--ink-faint) 50%, transparent 50%);
  background-position: right 11px center, right 6px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

select.cell-input option {
  background: var(--panel-raised);
  color: var(--ink);
}

.item-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.item-cell select {
  flex: 1;
  min-width: 0;
}

.item-cell .icon {
  width: 16px;
  height: 16px;
  color: var(--item-accent, var(--ink-dim));
}

.line-total {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  color: var(--chip);
  white-space: nowrap;
}

/* --------------------------------------------------------------- checkbox */

.check {
  display: inline-grid;
  place-items: center;
  width: 21px;
  height: 21px;
  padding: 0;
  background: var(--void);
  border: 1px solid var(--grid-bright);
  border-radius: 3px;
  color: transparent;
  transition: border-color 0.15s, color 0.15s, background 0.15s, box-shadow 0.15s;
}

.check .icon {
  width: 13px;
  height: 13px;
}

.check:hover {
  border-color: var(--ink-dim);
}

.check[aria-checked='true'] {
  border-color: var(--ok);
  background: rgba(74, 222, 128, 0.15);
  color: var(--ok);
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.28);
}

/* Money received but not yet banked is the one actionable state in the app, so
   it gets the only colour that means "do something". Border only — a ghosted
   tick would read as half-checked. */
.check.check-bank[aria-checked='false'].is-pending {
  border-color: var(--chip);
  box-shadow: 0 0 8px rgba(255, 197, 61, 0.25);
}

.row-delete {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  background: none;
  border: none;
  border-radius: var(--radius);
  color: var(--ink-faint);
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}

tr:hover .row-delete,
.row-delete:focus-visible {
  opacity: 1;
}

.row-delete:hover {
  color: var(--alarm);
  background: rgba(255, 92, 92, 0.12);
}

/* --------------------------------------------------------------- add row */

.add-row td {
  padding-top: 10px;
  padding-bottom: 10px;
  background: rgba(19, 26, 46, 0.6);
  border-top: 1px solid var(--grid);
  border-bottom: none;
}

.add-row .cell-input {
  border-color: var(--grid);
  background: var(--void);
}

.add-row .cell-input:focus {
  border-color: var(--keifir);
}

.add-submit {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  background: rgba(61, 232, 255, 0.13);
  border: 1px solid rgba(61, 232, 255, 0.45);
  border-radius: var(--radius);
  color: var(--keifir);
  transition: background 0.15s;
}

.add-submit:hover {
  background: rgba(61, 232, 255, 0.26);
}

.add-submit .icon {
  width: 15px;
  height: 15px;
}

/* --------------------------------------------------------------- summary */

.summary {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px 30px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 15px 20px;
  background: rgba(13, 18, 32, 0.93);
  backdrop-filter: blur(10px);
  border: 1px solid var(--grid-bright);
  border-radius: var(--radius);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.55);
}

.summary-group {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.summary-divider {
  flex: 1 1 auto;
}

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

.summary-value {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.1;
}

.summary-value .icon {
  width: 14px;
  height: 14px;
}

.summary-stat.is-item .summary-value {
  color: var(--accent);
}

.summary-stat.is-oversold .summary-value {
  color: var(--alarm);
}

/* Running total — informational, so it stays quiet. */
.summary-stat.is-neutral .summary-value {
  color: var(--ink);
}

/* The only figure that asks you to do something. */
.summary-stat.is-action .summary-value {
  color: var(--chip);
}

.summary-stat.is-done .summary-value {
  color: var(--ok);
}

.summary-stat.is-muted .summary-value {
  color: var(--ink-faint);
}

.summary-stat.is-unpaid .summary-value {
  color: var(--alarm);
}

/* The currency glyph stays gold everywhere, so the figures can carry state
   without any of them stopping looking like money. */
.summary-stat .summary-value .icon {
  color: var(--chip);
  opacity: 0.75;
}

/* The only animated thing on the page, and it only runs when there is money
   sitting unbanked — motion here means "act", not "look at me". */
.summary-stat.is-pending .summary-value {
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

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

.empty {
  padding: 52px 24px;
  text-align: center;
  color: var(--ink-dim);
}

.empty h3 {
  margin: 0 0 7px;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink);
}

.empty p {
  margin: 0 0 18px;
  font-size: 14px;
}

/* --------------------------------------------------------------- dialog */

dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  background: var(--panel);
  border: 1px solid var(--grid-bright);
  border-radius: var(--radius);
  color: var(--ink);
}

dialog::backdrop {
  background: rgba(3, 5, 10, 0.76);
  backdrop-filter: blur(3px);
}

.dialog-body {
  padding: 22px;
}

.dialog-body h2 {
  margin: 0 0 18px;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.field {
  display: block;
  margin-bottom: 15px;
}

.field > span {
  display: block;
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 9px 11px;
  background: var(--void);
  border: 1px solid var(--grid-bright);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 14px;
}

.field input:focus {
  border-color: var(--keifir);
  outline: none;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field .num {
  text-align: right;
}

.field-check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 4px;
  color: var(--ink-dim);
  font-size: 13px;
  cursor: pointer;
}

.field-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--keifir);
  cursor: pointer;
}

.field-check:hover {
  color: var(--ink);
}

.dialog-actions {
  display: flex;
  gap: 9px;
  margin-top: 22px;
}

.dialog-actions .spacer {
  flex: 1;
}

/* --------------------------------------------------------------- login */

.login {
  display: grid;
  place-items: center;
  min-height: 76vh;
}

.login-card {
  width: min(370px, 100%);
  padding: 34px 30px;
  background: var(--panel);
  border: 1px solid var(--grid-bright);
  border-radius: var(--radius);
  text-align: center;
}

.login-card .wordmark {
  justify-content: center;
  margin-bottom: 7px;
}

.login-card p {
  margin: 0 0 24px;
  color: var(--ink-dim);
  font-size: 13px;
}

.login-card input {
  width: 100%;
  margin-bottom: 13px;
  padding: 11px 13px;
  background: var(--void);
  border: 1px solid var(--grid-bright);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 15px;
  text-align: center;
}

.login-card input:focus {
  border-color: var(--keifir);
  outline: none;
}

.login-card .btn {
  width: 100%;
  justify-content: center;
  padding: 11px;
}

.form-error {
  min-height: 19px;
  margin: 0 0 11px;
  color: var(--alarm);
  font-size: 13px;
}

/* --------------------------------------------------------------- confirm */

.confirm-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 5, 10, 0.5);
}

.confirm-pop {
  position: fixed;
  width: 252px;
  padding: 14px 15px 13px;
  background: var(--panel-raised);
  border: 1px solid var(--grid-bright);
  border-radius: var(--radius);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.7);
}

/* A caret pointing back at whatever was clicked. */
.confirm-pop::before {
  content: '';
  position: absolute;
  top: var(--caret-top, 22px);
  width: 9px;
  height: 9px;
  background: var(--panel-raised);
  border-left: 1px solid var(--grid-bright);
  border-bottom: 1px solid var(--grid-bright);
  transform: translateY(-50%) rotate(45deg);
}

.confirm-pop[data-caret='left']::before {
  left: -5px;
}

.confirm-pop[data-caret='right']::before {
  right: -5px;
  transform: translateY(-50%) rotate(225deg);
}

.confirm-pop[data-caret='none']::before {
  display: none;
}

.confirm-message {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.4;
}

.confirm-detail {
  margin: 5px 0 0;
  color: var(--ink-dim);
  font-size: 12px;
  line-height: 1.4;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 13px;
}

.confirm-actions .btn {
  padding: 6px 12px;
  font-size: 11px;
}

.confirm-actions .btn-ghost {
  border-color: var(--grid-bright);
}

/* --------------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 50;
  transform: translateX(-50%);
  padding: 11px 20px;
  background: var(--panel-raised);
  border: 1px solid var(--alarm);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 13px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.6);
}

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

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

@media (max-width: 720px) {
  .root {
    padding: 20px 13px 88px;
  }

  .wordmark {
    font-size: 21px;
  }

  .filter {
    min-width: 0;
    flex: 1 1 100%;
    order: 3;
  }

  .summary {
    gap: 12px 20px;
  }

  .summary-value {
    font-size: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
