/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

/*
 * The refill panel wears CORE FIELD's dark theme: the tokens of
 * deployments/core-field/pythonpath/corefield_config/theme.py as its sign-in
 * screen renders them (navy layout, container cards, sky-blue primary, the
 * plant-floor grid, letter-spaced captions, the cut-corner card with its
 * accent bar). Fonts are Inter and IBM Plex Mono, the families CORE FIELD
 * loads, served from this panel under the SIL Open Font License
 * (fonts/licenses/).
 */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/inter-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/inter-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/inter-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}

:root {
  color-scheme: dark;

  /* Surfaces (colorBgLayout, colorBgBase, colorBgContainer). */
  --bg: #030d1f;
  --bg-chrome: #04122a;
  --surface: #0a233f;
  --surface-sunk: #061a33;
  --border: #1e3a66;
  --border-soft: #152c50;
  --glow: rgba(35, 69, 91, 0.55);
  --grid-line: rgba(231, 240, 255, 0.04);

  /* Text (colorTextBase, colorTextSecondary). */
  --text: #e7f0ff;
  --text-body: #cbd7ea;
  --text-muted: #9cb2d0;

  /* Primary (colorPrimary and its active shade). Text on the primary fill
     is navy ink: white on this blue stays below WCAG AA. */
  --primary: #46b6ff;
  --primary-hover: #7ccbff;
  --primary-active: #357dad;
  --primary-ink: #03152e;
  --primary-soft: rgba(70, 182, 255, 0.1);
  --primary-line: rgba(70, 182, 255, 0.42);
  /* The "ACCESO SEGURO" band, darkened so white captions pass AA. */
  --band-from: #1d4d73;
  --band-to: #2c76a8;

  /* States (colorSuccess, colorWarning, colorError). */
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.1);
  --success-line: rgba(52, 211, 153, 0.36);
  --warning: #fcd34d;
  --warning-soft: rgba(252, 211, 77, 0.09);
  --warning-line: rgba(252, 211, 77, 0.4);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.1);
  --danger-line: rgba(248, 113, 113, 0.42);
  --idle: #5d7394;
  --track: rgba(156, 178, 208, 0.1);

  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 18px;
  --shadow: 0 6px 20px rgba(24, 71, 152, 0.24), 0 2px 8px rgba(0, 0, 0, 0.4);
  --font: "Inter", "Aptos", "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --gutter: clamp(16px, 4vw, 40px);
}

/* --- Base ---------------------------------------------------------------- */

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font: 400 15px/1.55 var(--font);
  color: var(--text-body);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse at 12% 0%, var(--glow) 0%, transparent 52%),
    radial-gradient(ellipse at 92% 100%, var(--glow) 0%, transparent 56%);
  -webkit-font-smoothing: antialiased;
}

/* The faint plant-floor grid of the CORE FIELD sign-in. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 80%);
  mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 80%);
  pointer-events: none;
}

body > * {
  position: relative;
}

a {
  color: var(--primary);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--primary-hover);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--text);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(24px, 3vw, 30px);
}

p {
  margin: 0;
}

strong {
  color: var(--text);
  font-weight: 600;
}

code {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-muted);
}

.num,
td,
.figure strong,
.facts dd,
.delta {
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--text-muted);
}

/* Console captions: uppercase, letter-spaced, as CORE FIELD labels them. */
.caption,
.eyebrow,
.panel__title,
.field > span,
.band__title,
.band__tag,
.pill,
.badge,
thead th,
.receipt__lines dt,
.facts dt,
.gauge__axis,
.gauge__today,
.stage__meta,
.session__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.caption {
  color: var(--text-muted);
  font-weight: 500;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 600;
}

.skip:focus {
  top: 12px;
}

/* --- Top bar ------------------------------------------------------------- */

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 12px var(--gutter);
  background: rgba(4, 18, 42, 0.88);
  border-bottom: 1px solid var(--border-soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  min-height: 44px;
  color: var(--text-muted);
  text-decoration: none;
}

.brand img {
  display: block;
  width: 80px;
  height: 30px;
}

.brand__text {
  padding-left: 16px;
  border-left: 1px solid var(--border);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.brand__text strong {
  color: var(--primary);
}

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

.session {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0;
}

.session__who {
  display: grid;
  line-height: 1.25;
  text-align: right;
}

.session__label {
  font-size: 10px;
  color: var(--text-muted);
}

.session__name {
  color: var(--text);
  font-weight: 500;
}

/* --- Page ---------------------------------------------------------------- */

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px var(--gutter) 72px;
}

main:focus {
  outline: none;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--text-muted);
}

.crumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--text-muted);
}

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

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
  margin-bottom: 24px;
}

.page-head > div:first-child {
  display: grid;
  gap: 10px;
}

.page-head > .tags {
  align-self: center;
}

.lead {
  color: var(--text-muted);
  font-size: 16px;
}

.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.summary li {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(10, 35, 63, 0.7);
  color: var(--text-body);
  font-size: 13px;
  font-weight: 500;
}

.summary .is-danger {
  border-color: var(--danger-line);
  color: var(--danger);
}

.summary .is-warning {
  border-color: var(--warning-line);
  color: var(--warning);
}

.summary .is-ok {
  border-color: var(--success-line);
  color: var(--success);
}

/* --- Pills and badges ---------------------------------------------------- */

.tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.pill,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  white-space: nowrap;
}

.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pill--online {
  color: var(--success);
  background: var(--success-soft);
  border-color: var(--success-line);
}

.pill--offline,
.badge--danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger-line);
}

.badge--warning {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: var(--warning-line);
}

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

.plants {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr));
  gap: 24px;
  /* Room for each card's accent bar. */
  padding-left: 6px;
}

/* CORE FIELD's cut-corner card; the accent bar carries the plan's state. */
.plant,
.panel {
  --accent: var(--primary-active);
  position: relative;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 var(--radius-xl) 0 var(--radius-xl);
  box-shadow: -6px 0 0 var(--accent), var(--shadow);
}

.plant {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 24px 24px;
}

.plant--warning {
  --accent: var(--warning);
}

.plant--exhausted,
.plant--offline,
.panel--error {
  --accent: var(--danger);
}

.plant__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.plant__title {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.plant__title h2 {
  font-size: 22px;
  overflow-wrap: anywhere;
}

.plant__title a {
  color: inherit;
  text-decoration: none;
}

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

.plant__error {
  display: grid;
  gap: 16px;
  justify-items: start;
  padding: 16px;
  border: 1px dashed var(--danger-line);
  border-radius: var(--radius);
  background: var(--danger-soft);
}

.plant__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
}

.plant__actions form,
.packs form {
  margin: 0;
}

.plant__more {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  width: 100%;
}

/* --- The meter ----------------------------------------------------------- */

.meter {
  --fill: var(--primary);
  display: grid;
  gap: 14px;
}

.meter--warning {
  --fill: var(--warning);
}

.meter--exhausted {
  --fill: var(--danger);
}

.figure {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 10px;
  color: var(--text-muted);
  font-size: 15px;
}

.figure strong {
  font-size: 46px;
  line-height: 1;
  letter-spacing: -0.03em;
}

.meter--exhausted .figure strong {
  color: var(--danger);
}

.figure__percent {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 13px;
}

/* A tank level read as a bar graph: one segment per day of the month, each
   one day's share of the month's consultas, lit as they are used. */
.gauge {
  padding-top: 22px;
}

.gauge__bar {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 3px;
  height: 34px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-sunk);
}

.gauge__bar > span {
  position: relative;
  border-radius: 2px;
  background: var(--track);
}

.gauge__bar > .is-used {
  background: var(--fill);
}

/* The segment being drawn from: half full, like a tank between marks. */
.gauge__bar > .is-partial {
  background: linear-gradient(to top, var(--fill) 0 50%, var(--track) 50% 100%);
}

/* Today: a needle through the bar, labelled above it. */
.gauge__bar > .is-today::after {
  content: "";
  position: absolute;
  top: -11px;
  bottom: -11px;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  border-radius: 1px;
  background: var(--text);
  box-shadow: 0 0 0 2px var(--surface);
}

.gauge__today {
  position: absolute;
  bottom: calc(100% + 13px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--text);
  white-space: nowrap;
}

.is-today.at-start .gauge__today {
  left: -4px;
  transform: none;
}

.is-today.at-end .gauge__today {
  left: auto;
  right: -4px;
  transform: none;
}

.gauge__axis {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.outlook {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--text-body);
  font-weight: 500;
}

.outlook::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--idle);
  transform: translateY(-1px);
}

.outlook--ok::before {
  background: var(--success);
}

.outlook--warning {
  color: var(--warning);
}

.outlook--warning::before {
  background: var(--warning);
}

.outlook--exhausted {
  color: var(--danger);
}

.outlook--exhausted::before {
  background: var(--danger);
}

.outlook--idle,
.outlook--early {
  color: var(--text-muted);
}

@media (prefers-reduced-motion: no-preference) {
  .gauge__bar > .is-used,
  .gauge__bar > .is-partial {
    transform-origin: bottom;
    animation: segment-on 420ms var(--ease-out) both;
  }

  .gauge__bar > :nth-child(n + 9) {
    animation-delay: 70ms;
  }

  .gauge__bar > :nth-child(n + 17) {
    animation-delay: 140ms;
  }

  .gauge__bar > :nth-child(n + 25) {
    animation-delay: 210ms;
  }
}

@keyframes segment-on {
  from {
    opacity: 0.2;
    transform: scaleY(0.35);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* Secondary figures. */
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 0;
}

.facts > div {
  display: grid;
  gap: 2px;
}

.facts dt {
  font-size: 10.5px;
  color: var(--text-muted);
}

.facts dd {
  margin: 0;
  color: var(--text-body);
  font-size: 14px;
}

/* --- Buttons ------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font: 500 14px/1.2 var(--font);
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease;
}

.button:hover {
  border-color: var(--primary);
  color: var(--text);
}

.button:active {
  background: var(--primary-soft);
}

.button:disabled {
  opacity: 0.55;
  cursor: progress;
}

.button--primary {
  padding: 0 22px;
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.button--primary:hover {
  border-color: var(--primary-hover);
  background: var(--primary-hover);
  color: var(--primary-ink);
}

.button--primary:active {
  background: var(--primary-active);
  border-color: var(--primary-active);
  color: #fff;
}

.button--pack {
  border-color: var(--primary-line);
  background: var(--primary-soft);
  font-weight: 600;
}

.button--pack:hover {
  background: rgba(70, 182, 255, 0.18);
}

.button__price {
  padding-left: 10px;
  border-left: 1px solid var(--primary-line);
  color: var(--text-muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.button--quiet {
  border-color: transparent;
  color: var(--text-muted);
}

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

.button--small {
  min-height: 36px;
  padding: 0 12px;
}

.button--block {
  width: 100%;
}

/* --- Notices ------------------------------------------------------------- */

.flashes {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--primary-line);
  border-left-width: 4px;
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: var(--text-body);
}

.notice > svg {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  color: var(--primary);
}

.notice__body {
  display: grid;
  gap: 4px;
}

.notice__title {
  color: var(--text);
  font-weight: 600;
}

.notice-success {
  border-color: var(--success-line);
  border-left-color: var(--success);
  background: var(--success-soft);
}

.notice-success > svg {
  color: var(--success);
}

.notice-error {
  border-color: var(--danger-line);
  border-left-color: var(--danger);
  background: var(--danger-soft);
}

.notice-error > svg {
  color: var(--danger);
}

.notice-warning {
  border-color: var(--warning-line);
  border-left-color: var(--warning);
  background: var(--warning-soft);
}

.notice-warning > svg {
  color: var(--warning);
}

.notice-info,
.notice-applied {
  border-left-color: var(--primary);
}

/* --- Forms --------------------------------------------------------------- */

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field > span {
  color: var(--primary);
  font-size: 11px;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-sunk);
  color: var(--text);
  font: 400 16px/1.4 var(--font);
}

input::placeholder {
  color: var(--idle);
}

input:hover,
select:hover {
  border-color: var(--primary-active);
}

input:focus-visible,
select:focus-visible {
  border-color: var(--primary);
  outline-offset: 1px;
}

input[readonly] {
  border-style: dashed;
  background: transparent;
  color: var(--text-muted);
}

select {
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%239cb2d0' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 14px center;
  background-repeat: no-repeat;
  cursor: pointer;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
}

.check input {
  flex: none;
  width: 20px;
  height: 20px;
  min-height: 0;
  margin: 1px 0 0;
  accent-color: var(--primary);
}

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

.amount-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 9.5rem;
  gap: 10px;
}

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

.detail {
  display: grid;
  gap: 24px;
  margin-bottom: 24px;
  padding-left: 6px;
}

.panel--error,
.panel--note {
  margin: 0 0 24px 6px;
}

.panel--error .panel__title {
  color: var(--danger);
}

.panel--error .button {
  justify-self: start;
}

.detail > .panel {
  align-self: start;
}

.detail__side {
  display: grid;
  gap: 24px;
  align-content: start;
}

.panel {
  display: grid;
  gap: 18px;
  align-content: start;
  padding: 24px;
}

.panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
}

.panel__title {
  color: var(--primary);
  font-size: 12px;
}

.panel form {
  display: grid;
  gap: 14px;
  margin: 0;
}

.packs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.packs .button {
  width: 100%;
  white-space: nowrap;
  justify-content: space-between;
  min-height: 52px;
}

.divider {
  height: 1px;
  margin: 2px 0;
  background: var(--border-soft);
}

.history {
  margin-left: 6px;
}

.history__tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  align-items: end;
  gap: 12px;
}

.history__tools .field--grow {
  grid-column: span 2;
}

.empty {
  display: grid;
  gap: 6px;
  justify-items: start;
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
}

.empty strong {
  font-size: 16px;
}

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

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

thead th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 10.5px;
  text-align: left;
  white-space: nowrap;
}

tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}

tbody tr:hover {
  background: rgba(70, 182, 255, 0.04);
}

.cell-amount {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
}

.cell-amount small,
.cell-when small {
  display: block;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 400;
}

.cell-when {
  white-space: nowrap;
}

.kind {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--primary-line);
  border-radius: var(--radius-sm);
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
}

.kind--plan {
  border-color: var(--border);
  color: var(--text-body);
}

.kind--reset {
  border-color: var(--warning-line);
  color: var(--warning);
}

.source {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* --- The receipt --------------------------------------------------------- */

.confirm {
  display: grid;
  gap: 20px;
  max-width: 680px;
}

/* The "ACCESO SEGURO" card of the CORE FIELD sign-in. */
.receipt,
.auth {
  margin: 0 0 0 10px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 var(--radius-xl) 0 var(--radius-xl);
  box-shadow: -10px 0 0 var(--primary-active), var(--shadow);
}

.band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 0 22px;
  background: linear-gradient(90deg, var(--band-from) 0%, var(--band-to) 100%);
  color: #fff;
}

.band__title {
  margin: 0;
  color: #fff;
  font-size: 13px;
}

.band__tag {
  flex: none;
  white-space: nowrap;
  padding: 4px 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 10px;
}

.receipt__lines {
  margin: 0;
  padding: 6px 24px;
}

.receipt__lines > div {
  display: grid;
  grid-template-columns: 10.5rem minmax(0, 1fr);
  gap: 6px 18px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--border);
}

.receipt__lines > div:last-child {
  border-bottom: 0;
}

.receipt__lines dt {
  padding-top: 2px;
  color: var(--text-muted);
  font-size: 10.5px;
}

.receipt__lines dd {
  display: grid;
  gap: 6px;
  margin: 0;
  color: var(--text);
}

.receipt__amount dd {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}

.receipt__amount strong {
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.receipt__tokens {
  color: var(--text-muted);
}

.delta {
  width: auto;
  font-size: 14px;
}

.delta th,
.delta td {
  padding: 2px 14px 2px 0;
  border: 0;
  text-align: right;
}

.delta th {
  color: var(--text-muted);
  font-weight: 400;
  text-align: left;
}

.delta .arrow {
  color: var(--text-muted);
}

.receipt__notes {
  display: grid;
  gap: 8px;
  padding: 0 24px 6px;
}

.receipt__foot {
  display: grid;
  gap: 18px;
  padding: 18px 24px 24px;
  border-top: 1px solid var(--border-soft);
  background: rgba(6, 26, 51, 0.6);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.receipt__body {
  display: grid;
  gap: 20px;
  justify-items: start;
  padding: 24px;
}

/* --- Sign-in ------------------------------------------------------------- */

.stage {
  display: flex;
  flex-direction: column;
}

.stage__meta {
  padding: 24px var(--gutter) 0;
  color: var(--text-muted);
  font-weight: 400;
}

.stage__meta strong {
  color: var(--primary);
}

.stage main {
  display: grid;
  flex: 1;
  place-items: center;
  width: 100%;
  padding-top: 32px;
}

.auth {
  width: calc(100% - 10px);
  max-width: 420px;
}

.auth__brand {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 26px 24px 0;
}

.auth__brand img {
  width: 138px;
  height: 52px;
}

.auth__body {
  display: grid;
  gap: 18px;
  padding: 20px 28px 28px;
}

.auth__intro {
  display: grid;
  gap: 4px;
  text-align: center;
}

.auth__intro h1 {
  font-size: 20px;
}

.auth form {
  display: grid;
  gap: 18px;
  margin: 0;
}

.auth .flashes {
  margin: 0;
}

/* --- Small screens ------------------------------------------------------- */

@media (min-width: 1000px) {
  .detail {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .brand__text {
    display: none;
  }

  .plant__head {
    flex-wrap: wrap;
  }

  .plant__head .tags {
    justify-content: flex-start;
  }

  .plant__actions form,
  .plant__actions .button--pack {
    width: 100%;
  }

  .plant__actions .button--pack {
    justify-content: space-between;
  }

  .figure strong {
    font-size: 40px;
  }

  .plant,
  .panel {
    padding: 20px 18px;
  }

  .history__tools .field--grow {
    grid-column: auto;
  }

  .receipt__lines {
    padding: 6px 18px;
  }

  .receipt__lines > div {
    grid-template-columns: minmax(0, 1fr);
  }

  .receipt__foot {
    padding: 18px;
  }

  /* The history reads as one card per movement. */
  .history table,
  .history tbody,
  .history tr,
  .history td {
    display: block;
  }

  .history thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .history tbody tr {
    display: grid;
    gap: 6px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-soft);
  }

  .history tbody td {
    display: grid;
    grid-template-columns: 7.5rem minmax(0, 1fr);
    gap: 12px;
    padding: 0;
    border: 0;
    white-space: normal;
  }

  .history .cell-amount small {
    grid-column: 2;
  }

  .history td > .kind,
  .history td > .source,
  .history td > code {
    justify-self: start;
  }

  .history tbody td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding-top: 3px;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
