:root {
  --bg: #0f141c;
  --bg2: #171e2a;
  --ink: #e6edf5;
  --muted: #8b9bb0;
  --accent: #3dd6c6;
  --accent-ink: #04221e;
  --warn: #f0a05a;
  --line: rgba(230, 237, 245, 0.1);
  --row: rgba(255, 255, 255, 0.03);
  --font: "Atkinson Hyperlegible", system-ui, sans-serif;
  --display: "Chivo", "Atkinson Hyperlegible", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(61, 214, 198, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 214, 198, 0.04) 1px, transparent 1px),
    radial-gradient(ellipse 70% 55% at 85% 0%, rgba(240, 160, 90, 0.18), transparent 55%),
    radial-gradient(ellipse 55% 45% at 0% 100%, rgba(61, 214, 198, 0.12), transparent 50%),
    linear-gradient(160deg, var(--bg), var(--bg2));
  background-size: 48px 48px, 48px 48px, auto, auto, auto;
  animation: grid-drift 28s linear infinite;
}
@keyframes grid-drift {
  from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0; }
  to { background-position: 48px 48px, 48px 48px, 0 0, 0 0, 0 0; }
}
.meter-plane {
  position: absolute;
  right: -4%;
  top: 18%;
  width: min(42vw, 28rem);
  height: 12rem;
  border: 1px solid rgba(61, 214, 198, 0.25);
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(61, 214, 198, 0.08), rgba(240, 160, 90, 0.22));
  transform: skewY(-6deg);
  pointer-events: none;
  animation: meter-pulse 4.5s ease-in-out infinite;
}
.meter-plane::after {
  content: "";
  position: absolute;
  inset: 0.6rem;
  border: 1px dashed rgba(230, 237, 245, 0.15);
}
@keyframes meter-pulse {
  0%, 100% { opacity: 0.55; filter: saturate(1); }
  50% { opacity: 0.95; filter: saturate(1.2); }
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.brand {
  font-family: var(--display);
  font-weight: 900;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  font-size: 0.95rem;
}
.top nav { display: flex; gap: 0.75rem; align-items: center; }
.top nav a:not(.btn) { color: var(--muted); text-decoration: none; font-size: 0.95rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  padding: 0.65rem 1.1rem;
  border-radius: 2px;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn.buy { background: var(--accent); color: var(--accent-ink); }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.danger {
  background: transparent;
  color: var(--warn);
  border: 1px solid rgba(240, 160, 90, 0.35);
  padding: 0.4rem 0.7rem;
  font-size: 0.8rem;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.hero {
  position: relative;
  min-height: calc(100vh - 4rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 1.5rem 4rem;
  max-width: 42rem;
  overflow: hidden;
}
.brand-hero {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(2.6rem, 9vw, 4.4rem);
  letter-spacing: -0.045em;
  text-transform: uppercase;
  margin: 0 0 1rem;
  line-height: 0.95;
  animation: brand-in 0.7s ease-out;
}
@keyframes brand-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.hero h1 {
  font-size: clamp(1.2rem, 2.8vw, 1.55rem);
  font-weight: 400;
  margin: 0 0 0.75rem;
  max-width: 28ch;
}
.lede { color: var(--muted); margin: 0 0 1.75rem; max-width: 38ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.strip {
  padding: 2.5rem 1.5rem 3rem;
  border-top: 1px solid var(--line);
  max-width: 42rem;
}
.strip h2 {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  font-size: 1.1rem;
}
.strip ul { margin: 0; padding-left: 1.1rem; color: var(--muted); }
.strip li { margin-bottom: 0.4rem; }

.foot {
  padding: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}
.foot a { color: var(--accent); }

.app-body .workspace {
  max-width: 52rem;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.status {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
  font-family: var(--mono);
}
.status.on { color: var(--accent); }

.rate-bar {
  display: grid;
  grid-template-columns: minmax(10rem, 14rem) 1fr;
  gap: 1rem;
  align-items: end;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 640px) {
  .rate-bar { grid-template-columns: 1fr; }
}

.totals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.total {
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--row);
}
.total.warn { border-left-color: var(--warn); }
.total .label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.total .value {
  font-family: var(--mono);
  font-size: clamp(1.15rem, 3vw, 1.55rem);
  font-weight: 500;
  letter-spacing: -0.02em;
}
@media (max-width: 560px) {
  .totals { grid-template-columns: 1fr; }
}

.meetings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.meetings-head h2 {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: 1rem;
  letter-spacing: -0.02em;
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
}
.meetings {
  width: 100%;
  border-collapse: collapse;
  min-width: 40rem;
}
.meetings th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 400;
  padding: 0.65rem 0.6rem;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
}
.meetings td {
  padding: 0.45rem 0.4rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.meetings tr:last-child td { border-bottom: none; }
.meetings input {
  width: 100%;
  min-width: 0;
}
.meetings .col-name { width: 28%; }
.meetings .col-num { width: 14%; }
.meetings .col-act { width: 5%; text-align: center; }
.empty {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 1.25rem;
  margin: 0;
  border: 1px dashed var(--line);
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}
input, textarea {
  font: inherit;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.65rem 0.75rem;
}
input:focus {
  outline: 1px solid rgba(61, 214, 198, 0.45);
  border-color: rgba(61, 214, 198, 0.45);
}
input[type="number"] { font-family: var(--mono); }

dialog {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--bg2);
  color: var(--ink);
  padding: 1.25rem;
  max-width: 22rem;
}
dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
dialog h2 {
  font-family: var(--display);
  text-transform: uppercase;
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}
dialog p { color: var(--muted); font-size: 0.9rem; }
.err { color: #ff8f8f; font-size: 0.85rem; }

@media (max-width: 560px) {
  .top { flex-wrap: wrap; gap: 0.75rem; }
  .meter-plane { opacity: 0.35; width: 55vw; }
}
