:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --bg-deep: #080b10;
  --surface: #111821;
  --surface-2: #17212c;
  --surface-3: #1d2936;
  --border: #243244;
  --border-soft: #1a2634;
  --text: #e7eef7;
  --muted: #8a9bb0;
  --muted-2: #64748b;
  --accent: #ffb020;
  --accent-soft: rgba(255, 176, 32, 0.12);
  --up: #ff5d5d;
  --down: #20c997;
  --danger: #ff6b6b;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", "JetBrains Mono", Consolas, monospace;
  --sans: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg-deep);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  background:
    radial-gradient(1100px 520px at 18% -12%, rgba(255, 176, 32, 0.10), transparent 62%),
    radial-gradient(900px 600px at 100% 0%, rgba(32, 201, 151, 0.07), transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 78%);
}

.app {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 26px 30px 54px;
}

.hidden {
  display: none !important;
}

/* -- top bar ---------------------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 13px;
  color: #191204;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.06em;
  background: linear-gradient(145deg, #ffd36b, var(--accent) 58%, #e08a00);
  box-shadow: 0 8px 24px rgba(255, 176, 32, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.brand-copy h1 {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.brand-copy p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(17, 24, 33, 0.72);
  font-size: 12px;
  white-space: nowrap;
}

.pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-2);
}

.pill-live {
  color: #b7f7df;
  border-color: rgba(32, 201, 151, 0.34);
  background: rgba(32, 201, 151, 0.08);
}

.pill-live .dot {
  background: var(--down);
  box-shadow: 0 0 0 4px rgba(32, 201, 151, 0.12);
  animation: pulse 2.2s ease-in-out infinite;
}

.pill-warn {
  color: #ffe0b0;
  border-color: rgba(255, 176, 32, 0.35);
  background: rgba(255, 176, 32, 0.08);
}

.pill-warn .dot {
  background: var(--accent);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-2);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease, opacity 0.14s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:focus-visible,
.tab:focus-visible,
.select:focus-visible,
.search:focus-visible,
input:focus-visible,
.icon-btn:focus-visible {
  outline: 2px solid rgba(255, 176, 32, 0.65);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  color: #201604;
  background: linear-gradient(180deg, #ffc24d, var(--accent));
  box-shadow: 0 8px 22px rgba(255, 176, 32, 0.18);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #ffd06c, #ffb020);
}

.btn-secondary {
  border-color: var(--border);
  background: var(--surface-2);
}

.btn-secondary:hover:not(:disabled) {
  border-color: #3a4e67;
  background: var(--surface-3);
}

.btn-ghost {
  border-color: var(--border);
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  border-color: #3a4e67;
}

.btn-ghost.is-on {
  color: #b7f7df;
  border-color: rgba(32, 201, 151, 0.38);
  background: rgba(32, 201, 151, 0.08);
}

.btn-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #201604;
  box-shadow: 0 0 0 3px rgba(32, 22, 4, 0.14);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-left: auto;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

/* -- banner ----------------------------------------------------------- */

.banner {
  margin-top: 18px;
  padding: 14px 16px 0;
  border: 1px solid rgba(255, 176, 32, 0.25);
  border-radius: 13px;
  background: linear-gradient(90deg, rgba(255, 176, 32, 0.10), rgba(255, 176, 32, 0.03));
  overflow: hidden;
}

.banner-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 13px;
}

.banner-copy {
  min-width: 0;
}

.banner-copy strong {
  display: block;
  font-size: 13px;
  font-weight: 650;
}

.banner-copy p {
  margin: 2px 0 0;
  color: #c7b48d;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.banner-error {
  border-color: rgba(255, 107, 107, 0.28);
  background: linear-gradient(90deg, rgba(255, 107, 107, 0.10), rgba(255, 107, 107, 0.02));
}

.banner-error .banner-copy p {
  color: #f0b4b4;
}

.spinner {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin-top: 2px;
  border: 2px solid rgba(255, 176, 32, 0.22);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

.progress-track {
  height: 3px;
  margin: 0 -16px;
  background: rgba(255, 255, 255, 0.05);
}

.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #ff9d00, #ffd36b);
  box-shadow: 0 0 14px rgba(255, 176, 32, 0.55);
  transition: width 0.28s ease;
}

/* -- hero ------------------------------------------------------------- */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 26px;
  align-items: center;
  margin-top: 18px;
  padding: 28px 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 176, 32, 0.055), transparent 48%),
    linear-gradient(180deg, rgba(23, 33, 44, 0.92), rgba(17, 24, 33, 0.92));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  top: -70px;
  right: 110px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 176, 32, 0.13), transparent 68%);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.kicker {
  margin: 0 0 7px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.17em;
}

.hero h2 {
  margin: 0;
  font-size: clamp(25px, 3.1vw, 38px);
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.hero-sub {
  margin: 10px 0 0;
  max-width: 640px;
  color: #b5c2d2;
  font-size: 13px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 11px;
}

.chip-live {
  color: #b7f7df;
  border-color: rgba(32, 201, 151, 0.28);
  background: rgba(32, 201, 151, 0.06);
}

.chip-error {
  color: #f0b4b4;
  border-color: rgba(255, 107, 107, 0.28);
  background: rgba(255, 107, 107, 0.06);
}

.meta-item {
  color: var(--muted);
  font-size: 12px;
}

.meta-item b {
  color: #c7d3e1;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}

.countdown-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 17px 18px 16px;
  border: 1px solid rgba(255, 176, 32, 0.19);
  border-radius: 13px;
  background: linear-gradient(160deg, rgba(255, 176, 32, 0.10), rgba(255, 176, 32, 0.02));
}

.countdown-label {
  color: #baaa8f;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.13em;
}

.countdown {
  color: #ffd789;
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.countdown-note {
  color: var(--muted);
  font-size: 11px;
}

/* -- metrics ---------------------------------------------------------- */

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-top: 14px;
}

.metric {
  position: relative;
  padding: 16px 17px 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(23, 33, 44, 0.8), rgba(17, 24, 33, 0.72));
  overflow: hidden;
}

.metric::after {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 2px;
  border-radius: 2px;
  background: #2a3a4e;
}

.metric-accent::after {
  background: linear-gradient(180deg, #ffd36b, var(--accent));
  box-shadow: 0 0 14px rgba(255, 176, 32, 0.35);
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.metric-value {
  display: block;
  margin-top: 7px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.metric-accent .metric-value {
  color: #ffd789;
}

.metric-sub {
  display: block;
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 11px;
}

/* -- controls --------------------------------------------------------- */

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 14px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(17, 24, 33, 0.66);
}

.control-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  min-width: 0;
}

.control-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.field {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.field input {
  width: 72px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: var(--bg-deep);
  font: inherit;
  font-family: var(--mono);
  font-size: 13px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.field input:hover {
  border-color: #33455b;
}

.field input:focus {
  border-color: rgba(255, 176, 32, 0.55);
}

.field .unit {
  color: var(--muted-2);
  font-family: var(--mono);
}

.field-date input {
  width: 142px;
  padding: 0 7px;
  text-align: left;
}

.select {
  height: 36px;
  max-width: 180px;
  padding: 0 26px 0 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  background: var(--surface-2)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238a9bb0' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat right 10px center;
  font: inherit;
  font-size: 12px;
  appearance: none;
  cursor: pointer;
}

.select:hover {
  border-color: #3a4e67;
}

.hint {
  color: var(--muted-2);
  font-size: 11px;
}

.hint.dirty {
  color: #d9b46b;
}

.hint.saved {
  color: #75d6b5;
}

.scan-controls {
  justify-content: flex-end;
}

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

.table-section {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(17, 24, 33, 0.72);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
  overflow: hidden;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-soft);
}

.tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.035);
  border-radius: 10px;
  background: rgba(8, 11, 16, 0.55);
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.14s ease, background 0.14s ease;
}

.tab:hover {
  color: #c6d2e0;
}

.tab.active {
  color: var(--text);
  background: var(--surface-3);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.tab .count {
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.055);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 17px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.tab.active .count {
  color: #ffe0a8;
  background: rgba(255, 176, 32, 0.14);
}

.table-tools {
  display: flex;
  align-items: center;
  gap: 11px;
}

.table-note {
  color: var(--muted-2);
  font-size: 11px;
  white-space: nowrap;
}

.search {
  width: 210px;
  height: 33px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: var(--bg-deep);
  font: inherit;
  font-size: 12px;
}

.search::placeholder {
  color: var(--muted-2);
}

.search:hover {
  border-color: #33455b;
}

.table-wrap {
  overflow-x: auto;
  scrollbar-color: #33455b transparent;
}

table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 11px 13px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  background: #111923;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-align: right;
  white-space: nowrap;
}

thead th:first-child {
  text-align: left;
}

thead th:nth-child(8),
thead th:nth-child(9) {
  text-align: left;
}

tbody td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 12.5px;
  text-align: right;
  vertical-align: middle;
}

tbody td:first-child {
  min-width: 190px;
  text-align: left;
}

tbody td:nth-child(8),
tbody td:nth-child(9) {
  text-align: left;
}

tbody tr {
  transition: background 0.12s ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

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

tbody tr.qualified {
  background: linear-gradient(90deg, rgba(255, 176, 32, 0.08), rgba(255, 176, 32, 0.012) 42%, transparent);
}

tbody tr.qualified:hover {
  background: linear-gradient(90deg, rgba(255, 176, 32, 0.12), rgba(255, 176, 32, 0.02) 45%, transparent);
}

tbody tr.qualified td:first-child {
  box-shadow: inset 3px 0 var(--accent);
}

tbody tr.has-error {
  opacity: 0.64;
}

.stock-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.stock-name {
  color: #f1f6fc;
  font-size: 13.5px;
  font-weight: 650;
}

.stock-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.stock-code {
  color: #8fa1b8;
  font-family: var(--mono);
  letter-spacing: 0.02em;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 5px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 10px;
  font-weight: 550;
  white-space: nowrap;
}

.tag-hot {
  color: #ffd080;
  border-color: rgba(255, 176, 32, 0.24);
  background: rgba(255, 176, 32, 0.10);
}

.reason {
  max-width: 170px;
  overflow: hidden;
  color: #a7b6c8;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-error {
  margin-top: 4px;
  max-width: 300px;
  overflow: hidden;
  color: #e29a9a;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.num {
  color: #d7e2ee;
  font-family: var(--mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.num-strong {
  font-size: 14.5px;
  font-weight: 650;
}

.up {
  color: var(--up);
}

.down {
  color: var(--down);
}

.flat {
  color: #9fb0c4;
}

.subnum {
  margin-top: 2px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.bar {
  display: block;
  width: 62px;
  height: 3px;
  margin: 5px 0 0 auto;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--up);
  opacity: 0.72;
}

.bar.down i {
  background: var(--down);
}

.bar.neutral i {
  background: #6b7f96;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 23px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 650;
  white-space: nowrap;
}

.badge.hit {
  color: #2a1e05;
  border-color: rgba(255, 210, 110, 0.5);
  background: linear-gradient(180deg, #ffd36b, var(--accent));
  box-shadow: 0 4px 12px rgba(255, 176, 32, 0.18);
}

.badge.miss {
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.035);
}

.badge.err {
  color: #f0b4b4;
  border-color: rgba(255, 107, 107, 0.18);
  background: rgba(255, 107, 107, 0.07);
}

.spark {
  display: block;
  width: 118px;
  height: 30px;
  margin-left: auto;
  overflow: visible;
}

.spark polyline {
  fill: none;
  stroke: var(--up);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.spark.down polyline {
  stroke: var(--down);
}

.spark-empty {
  display: block;
  color: var(--muted-2);
  text-align: right;
}

.empty {
  padding: 54px 24px;
  text-align: center;
}

.empty strong {
  display: block;
  color: #c9d5e3;
  font-size: 14px;
  font-weight: 600;
}

.empty p {
  margin: 5px 0 0;
  color: var(--muted-2);
  font-size: 12px;
}

/* -- footer ----------------------------------------------------------- */

.footer {
  margin-top: 18px;
  padding: 0 2px;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.7;
}

.footer p {
  margin: 2px 0;
}

/* -- toasts ----------------------------------------------------------- */

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: fit-content;
  max-width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #dbe6f2;
  background: rgba(23, 33, 44, 0.97);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
  font-size: 12px;
  line-height: 1.45;
  pointer-events: auto;
  animation: toast-in 0.2s ease both;
}

.toast::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--muted);
}

.toast-success {
  border-color: rgba(32, 201, 151, 0.26);
}

.toast-success::before {
  background: var(--down);
}

.toast-warn {
  border-color: rgba(255, 176, 32, 0.26);
}

.toast-warn::before {
  background: var(--accent);
}

.toast-error {
  border-color: rgba(255, 107, 107, 0.28);
}

.toast-error::before {
  background: var(--danger);
}

/* -- motion ----------------------------------------------------------- */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@media (max-width: 1120px) {
  .controls {
    align-items: flex-start;
    flex-direction: column;
  }

  .scan-controls {
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  .app {
    padding: 20px 18px 42px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding: 24px;
  }

  .countdown-card {
    width: 100%;
    max-width: 290px;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-tools {
    width: 100%;
    justify-content: space-between;
  }

  .search {
    flex: 1;
    width: auto;
    min-width: 0;
  }
}

@media (max-width: 620px) {
  .app {
    padding: 16px 12px 36px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    font-size: 13px;
  }

  .brand-copy h1 {
    font-size: 17px;
  }

  .brand-copy p {
    display: none;
  }

  .top-actions {
    gap: 7px;
  }

  .pill {
    height: 30px;
    padding: 0 9px;
    font-size: 11px;
  }

  #notify-btn {
    height: 30px;
    padding: 0 10px;
    font-size: 11px;
  }

  .hero {
    padding: 20px 18px;
  }

  .hero h2 {
    font-size: 24px;
  }

  .countdown {
    font-size: 25px;
  }

  .metric {
    padding: 13px 13px 12px;
  }

  .metric-value {
    font-size: 22px;
  }

  .controls {
    padding: 12px;
  }

  .field {
    flex: 1 1 auto;
  }

  .field input {
    width: 62px;
  }

  .field-date {
    flex: 1 1 100%;
  }

  .field-date input {
    width: 100%;
  }

  .scan-controls .btn {
    flex: 1;
  }

  .scan-controls .select {
    flex: 1 1 100%;
    max-width: none;
  }

  .tabs {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .tab {
    flex: 0 0 auto;
    padding: 0 9px;
  }

  .table-note {
    display: none;
  }

  .footer {
    font-size: 10px;
  }

  .toasts {
    right: 12px;
    bottom: 12px;
  }
}

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