@font-face {
  font-family: "Antonio";
  src: url("/static/fonts/Antonio.ttf") format("truetype");
  font-weight: 100 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --orange: #ff9900;
  --peach: #ffcc99;
  --lilac: #cc99cc;
  --violet: #9999ff;
  --sky: #99ccff;
  --apricot: #ff9966;
  --rust: #cc6666;
  --gold: #ffaa00;
  --text: #ffe6cc;
  --bg: #000;
  --side: 168px;
  --bar: 28px;
  --gap: 6px;
  --r-out: 72px;
  --r-in: 34px;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body {
  font-family: "Antonio", "Arial Narrow", "Roboto Condensed", "Helvetica Neue", sans-serif;
  color: var(--peach);
  font-size: 17px;
  letter-spacing: .04em;
  text-transform: uppercase;
  min-height: 100vh;
  padding: 12px 16px;
}

.lcars {
  display: grid;
  grid-template-columns: var(--side) 1fr;
  grid-template-rows: auto 1fr auto;
  gap: 0 14px;
  max-width: 1600px;
  margin: 0 auto;
  min-height: calc(100vh - 24px);
}

/* ---------- elbows ---------- */
.elbow {
  position: relative;
  background: var(--orange);
  height: 128px;
}
.elbow::after {
  content: "";
  position: absolute;
  right: 0;
  width: calc(100% - var(--side));
  background: var(--bg);
}
.elbow.top {
  border-top-left-radius: var(--r-out);
  grid-column: 1 / 3;
  margin-right: 0;
  display: grid;
}
.elbow.top::after {
  bottom: 0;
  height: calc(100% - var(--bar));
  border-top-left-radius: var(--r-in);
}
.elbow.bottom {
  background: var(--lilac);
  border-bottom-left-radius: var(--r-out);
  grid-column: 1 / 3;
  height: 96px;
}
.elbow.bottom::after {
  top: 0;
  height: calc(100% - var(--bar));
  border-bottom-left-radius: var(--r-in);
}
.elbow-label {
  position: absolute;
  left: 18px;
  font-size: 13px;
  color: #000;
  font-weight: 600;
  z-index: 1;
}
.elbow.top .elbow-label { bottom: 8px; }
.elbow.bottom .elbow-label { top: 8px; }

/* bar segments inside the elbows' horizontal strip */
.strip {
  position: absolute;
  left: calc(var(--side) + var(--r-in) + 48px);
  right: 0;
  height: var(--bar);
  display: flex;
  gap: var(--gap);
  z-index: 2;
  padding-left: 14px;
  background: var(--bg);
}
.elbow.top .strip { top: 0; }
.elbow.bottom .strip { bottom: 0; }
.strip span {
  display: block;
  height: 100%;
  background: var(--seg, var(--orange));
}
.strip .grow { flex: 1; }
.strip .cap { width: 22px; border-radius: 0 14px 14px 0; }
.strip .txt {
  background: none;
  color: var(--orange);
  font-size: 22px;
  line-height: var(--bar);
  padding: 0 8px;
  white-space: nowrap;
}

/* header content sits in the black area beneath the strip */
.head {
  position: absolute;
  left: var(--side);
  right: 0;
  top: var(--bar);
  bottom: 0;
  padding: 10px 0 0 30px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  z-index: 2;
}
.title { min-width: 0; }
.title h1 {
  margin: 0;
  font-size: clamp(26px, 4.2vw, 54px);
  font-weight: 600;
  line-height: 1;
  color: var(--orange);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.title .sub {
  margin-top: 6px;
  font-size: 15px;
  color: var(--lilac);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.clock { text-align: right; flex: none; }
.clock .time {
  font-size: clamp(28px, 3.6vw, 48px);
  font-weight: 600;
  line-height: 1;
  color: var(--peach);
  font-variant-numeric: tabular-nums;
}
.clock .meta {
  margin-top: 6px;
  font-size: 14px;
  color: var(--sky);
  font-variant-numeric: tabular-nums;
}

/* ---------- sidebar ---------- */
.side {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding: var(--gap) 0;
}
.side > div {
  background: var(--c, var(--peach));
  color: #000;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 6px 10px;
  min-height: 46px;
}
.side .grow { flex: 1; }
.side .counter {
  min-height: 0;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  padding: 10px;
}
.side .counter b {
  display: block;
  font-size: 34px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: .06em;
}
.side .counter small { font-size: 12px; }

/* ---------- main ---------- */
main {
  padding: 18px 0 18px 4px;
  min-width: 0;
}
.alert {
  display: flex;
  align-items: stretch;
  gap: var(--gap);
  margin-bottom: 22px;
}
.alert .pill {
  background: var(--rust);
  color: #000;
  font-weight: 600;
  font-size: 18px;
  padding: 8px 22px;
  border-radius: 22px 0 0 22px;
  display: flex;
  align-items: center;
  white-space: nowrap;
}
.alert .msg {
  flex: 1;
  border: 2px solid var(--rust);
  border-left: 0;
  border-radius: 0 22px 22px 0;
  padding: 8px 18px;
  color: var(--text);
  font-size: 18px;
  display: flex;
  align-items: center;
  min-width: 0;
  overflow-wrap: anywhere;
}
.alert .msg b { color: var(--apricot); font-weight: 600; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 22px 26px;
  align-items: start;
}
.panel.wide { grid-column: 1 / -1; }

.panel h2 {
  display: flex;
  align-items: center;
  gap: var(--gap);
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 600;
  color: var(--pc, var(--orange));
  height: 26px;
}
.panel h2::before {
  content: "";
  width: 34px;
  height: 100%;
  border-radius: 13px 0 0 13px;
  background: var(--pc, var(--orange));
}
.panel h2::after {
  content: "";
  flex: 1;
  height: 100%;
  border-radius: 0 13px 13px 0;
  background: var(--pc, var(--orange));
  opacity: .9;
}
.panel h2 .code { color: #000; background: var(--pc, var(--orange)); padding: 0 8px; height: 100%; display: flex; align-items: center; font-size: 13px; order: 2; }

dl.rows {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(110px, max-content) 1fr;
  gap: 3px 14px;
}
dl.rows dt {
  color: var(--pc, var(--orange));
  opacity: .85;
  font-size: 14px;
  text-align: right;
  padding-top: 2px;
  white-space: nowrap;
}
dl.rows dd {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  text-transform: none;
  letter-spacing: .02em;
  overflow-wrap: anywhere;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
dl.rows dd.dim { color: #8a7a6a; }
dl.rows dd .tag {
  display: inline-block;
  margin-left: 8px;
  padding: 0 8px;
  border-radius: 9px;
  font-size: 12px;
  text-transform: uppercase;
  color: #000;
  background: var(--pc, var(--orange));
  vertical-align: 2px;
}

.big {
  font-size: clamp(30px, 4vw, 46px) !important;
  font-weight: 600;
  color: var(--peach) !important;
  line-height: 1.05;
}

.hdr-wrap { overflow-x: auto; }
table.hdrs {
  border-collapse: separate;
  border-spacing: 0 3px;
  width: 100%;
  font-size: 15px;
}
table.hdrs th {
  text-align: right;
  color: var(--sky);
  font-weight: 400;
  padding: 1px 14px 1px 0;
  white-space: nowrap;
  vertical-align: top;
  width: 1%;
}
table.hdrs td {
  color: var(--text);
  text-transform: none;
  letter-spacing: .02em;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.fp {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  margin: 2px 0 10px;
}
.fp .id {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 600;
  color: var(--peach);
  letter-spacing: .12em;
}
.fp .note { color: var(--violet); font-size: 14px; }

footer {
  grid-column: 1 / 3;
  font-size: 13px;
  color: #6f6255;
  padding: 8px 0 0 calc(var(--side) + 14px);
}

/* ---------- motion ---------- */
.blink { animation: blink 1.6s steps(1) infinite; }
@keyframes blink { 50% { opacity: .25; } }
.boot .panel { opacity: 0; transform: translateX(-8px); animation: in .45s ease-out forwards; }
.boot .panel:nth-child(2) { animation-delay: .12s; }
.boot .panel:nth-child(3) { animation-delay: .24s; }
.boot .panel:nth-child(4) { animation-delay: .36s; }
.boot .panel:nth-child(5) { animation-delay: .48s; }
.boot .panel:nth-child(6) { animation-delay: .6s; }
@keyframes in { to { opacity: 1; transform: none; } }
.side .scan { animation: scan 3.2s ease-in-out infinite; }
.side .scan:nth-child(2) { animation-delay: .4s; }
.side .scan:nth-child(4) { animation-delay: .8s; }
@keyframes scan { 0%, 100% { filter: none; } 50% { filter: brightness(1.25); } }
@media (prefers-reduced-motion: reduce) {
  .blink, .side .scan { animation: none; }
  .boot .panel { animation: none; opacity: 1; transform: none; }
}

/* ---------- narrow ---------- */
@media (max-width: 900px) {
  :root { --side: 96px; --r-out: 52px; --r-in: 24px; }
  .head { flex-direction: column; gap: 6px; padding-left: 18px; }
  .clock { text-align: left; }
  .elbow.top { height: 170px; }
  .strip .txt { font-size: 16px; }
  .side .counter b { font-size: 22px; }
}
@media (max-width: 560px) {
  :root { --side: 44px; --r-out: 34px; --r-in: 16px; --bar: 22px; }
  body { padding: 8px 16px; font-size: 16px; }
  .lcars { gap: 0 10px; }
  .side > div { font-size: 0; min-height: 34px; padding: 0; }
  .side .counter { display: none; }
  .strip .hide-s { display: none; }
  .elbow-label { display: none; }
  dl.rows { grid-template-columns: 1fr; gap: 0; }
  dl.rows dt { text-align: left; padding-top: 8px; }
  .alert { flex-direction: column; }
  .alert .pill { border-radius: 18px 18px 0 0; }
  .alert .msg { border-left: 2px solid var(--rust); border-radius: 0 0 18px 18px; }
  footer { padding-left: 0; }
}

/* ---------- color / width utilities (no inline styles: strict CSP) ---------- */
.k-orange { --seg: var(--orange); --c: var(--orange); --pc: var(--orange); }
.k-peach { --seg: var(--peach); --c: var(--peach); --pc: var(--peach); }
.k-lilac { --seg: var(--lilac); --c: var(--lilac); --pc: var(--lilac); }
.k-violet { --seg: var(--violet); --c: var(--violet); --pc: var(--violet); }
.k-sky { --seg: var(--sky); --c: var(--sky); --pc: var(--sky); }
.k-apricot { --seg: var(--apricot); --c: var(--apricot); --pc: var(--apricot); }
.k-rust { --seg: var(--rust); --c: var(--rust); --pc: var(--rust); }
.strip .w46 { width: 46px; }
.strip .w60 { width: 60px; }
.strip .w90 { width: 90px; }
.strip .w100 { width: 100px; }
.strip .w120 { width: 120px; }
.strip .w160 { width: 160px; }
