:root {
  color-scheme: dark;
  --bg: #111318;
  --panel: #1a1e24;
  --panel-2: #20262e;
  --line: #343c46;
  --text: #f4f1e8;
  --muted: #9aa5ae;
  --amber: #ffb23f;
  --teal: #23c4ad;
  --red: #f05d50;
  --steel: #c7d0d9;
  --ink: #0b0d11;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 178, 63, 0.08), transparent 32%),
    linear-gradient(135deg, #111318 0%, #151a1c 48%, #101115 100%);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid rgba(255, 178, 63, 0.45);
  border-radius: 6px;
  background: linear-gradient(180deg, #ffbc51, #df8428);
  color: #1a1107;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 160ms ease,
    filter 160ms ease,
    border-color 160ms ease;
}

button:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  cursor: progress;
  filter: grayscale(0.2) brightness(0.85);
  transform: none;
}

.ghost-button {
  min-height: 32px;
  padding: 0 10px;
  border-color: var(--line);
  background: #171b20;
  color: var(--steel);
  font-weight: 700;
}

.wide-button {
  width: 100%;
}

.app-shell {
  width: min(1460px, calc(100vw - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 0 28px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(300px, 370px) minmax(500px, 1fr);
  align-items: end;
  gap: 18px;
  min-height: 88px;
  padding: 18px 0;
}

.eyebrow,
.panel-kicker,
.readout-label {
  display: block;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.8rem);
  line-height: 0.88;
  letter-spacing: 0;
}

.status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 64px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(26, 30, 36, 0.8);
  color: var(--steel);
  font-size: 1.08rem;
  font-weight: 800;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 18px rgba(240, 93, 80, 0.8);
}

.dot.online {
  background: var(--teal);
  box-shadow: 0 0 18px rgba(35, 196, 173, 0.8);
}

.workbench {
  display: grid;
  grid-template-columns: minmax(300px, 370px) minmax(500px, 1fr);
  gap: 16px;
  align-items: start;
}

.panel,
.forecourt {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(26, 30, 36, 0.92);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

.panel {
  padding: 16px;
}

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

.field {
  display: grid;
  gap: 7px;
  margin: 13px 0;
}

.field span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.setting-list {
  display: grid;
  gap: 10px;
}

.setting-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #15191f;
}

.setting-row .field {
  margin: 0;
}

.account-card {
  display: grid;
  gap: 6px;
  margin: 8px 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101318;
}

.account-card span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.account-card strong {
  min-height: 22px;
  overflow-wrap: anywhere;
}

.inline-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101318;
  color: var(--text);
  outline: none;
}

input {
  min-height: 40px;
  padding: 0 11px;
}

select {
  min-height: 40px;
  padding: 0 11px;
}

textarea {
  min-height: 118px;
  padding: 11px;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(35, 196, 173, 0.8);
  box-shadow: 0 0 0 3px rgba(35, 196, 173, 0.14);
}

.ticket-box {
  min-height: 92px;
  color: #b7f7e9;
}

.status-message {
  min-height: 44px;
  margin-top: 16px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101318;
  color: var(--steel);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.status-message[data-tone="ok"] {
  border-color: rgba(35, 196, 173, 0.55);
  color: #8df2df;
}

.status-message[data-tone="warn"] {
  border-color: rgba(255, 178, 63, 0.58);
  color: #ffd28a;
}

.status-message[data-tone="error"] {
  border-color: rgba(240, 93, 80, 0.62);
  color: #ffaaa2;
}

.split-line {
  height: 1px;
  margin: 18px 0 4px;
  background: var(--line);
}

.forecourt {
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  min-height: 680px;
}

.pump-stage {
  position: relative;
  min-height: 510px;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 30%),
    linear-gradient(180deg, #20262e 0%, #171b20 62%, #0d0f13 62%, #0d0f13 100%);
}

.station-art {
  position: absolute;
  inset: auto 4% 31% 4%;
  width: 92%;
  height: auto;
  max-height: 44%;
  object-fit: contain;
  opacity: 0.98;
  pointer-events: none;
}

.pump-grid {
  position: absolute;
  inset: 13% 6% auto 6%;
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: clamp(12px, 2vw, 28px);
}

.pump-card {
  display: grid;
  grid-template-rows: auto 72px 1fr;
  gap: 10px;
  min-height: 250px;
  padding: 14px;
  border: 1px solid #4a525c;
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 0 8%, rgba(255, 255, 255, 0.04) 8% 11%, transparent 11%),
    linear-gradient(180deg, #ece9dd 0%, #b8c2c8 100%);
  color: var(--ink);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.22), 0 16px 36px rgba(0, 0, 0, 0.35);
}

.pump-live {
  border-color: var(--amber);
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.22),
    0 0 0 3px rgba(255, 178, 63, 0.14),
    0 16px 36px rgba(0, 0, 0, 0.35);
}

.pump-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-width: 64px;
  min-height: 30px;
  padding: 0 9px;
  border-radius: 5px;
  background: #191d23;
  color: var(--amber);
  font-weight: 900;
}

.pump-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: 8px;
  border: 5px solid #1a1f24;
  border-radius: 6px;
  background: #0c1918;
  color: #7ff5df;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(0.9rem, 2vw, 1.45rem);
  font-weight: 900;
  text-align: center;
  overflow-wrap: anywhere;
}

.pump-meter {
  display: flex;
  align-items: end;
  justify-content: end;
  min-height: 88px;
  padding: 10px;
  border-radius: 6px;
  background:
    linear-gradient(180deg, transparent 0 68%, rgba(240, 93, 80, 0.82) 68%),
    #2d343d;
  color: #f9f5e9;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(1.15rem, 3vw, 2.1rem);
  font-weight: 900;
}

.meter-band {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.9fr auto;
  gap: 12px;
  align-items: center;
  min-height: 112px;
  padding: 16px;
  border-top: 1px solid var(--line);
  background: #15191f;
}

.meter-band strong {
  display: block;
  min-height: 26px;
  overflow-wrap: anywhere;
}

.pump-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-width: 230px;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .workbench {
    grid-template-columns: 1fr;
  }

  .forecourt {
    min-height: auto;
  }

  .pump-stage {
    min-height: 470px;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100vw - 18px, 680px);
    padding-top: 10px;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .status-strip {
    justify-content: space-between;
  }

  .inline-field,
  .setting-row,
  .meter-band,
  .pump-actions {
    grid-template-columns: 1fr;
  }

  .pump-stage {
    min-height: 560px;
    padding: 14px;
  }

  .station-art {
    inset: auto 2% 16% 2%;
    width: 96%;
  }

  .pump-grid {
    inset: 18px 14px auto 14px;
    grid-template-columns: 1fr;
  }

  .pump-card {
    grid-template-columns: 76px 1fr 1fr;
    grid-template-rows: auto;
    align-items: center;
    min-height: 104px;
  }

  .pump-screen,
  .pump-meter {
    min-height: 64px;
  }
}
