@import url('https://fonts.googleapis.com/css2?family=VT323&family=Share+Tech+Mono&display=swap');

/* ── Variables ─────────────────────────────────────────── */
:root {
  --a:        #e8a400;   /* amber primary                  */
  --a-bright: #ffc400;   /* amber highlight                */
  --a-dim:    #7a5400;   /* amber dim                      */
  --a-glow:   rgba(232, 164, 0, 0.28);
  --a-glow2:  rgba(232, 164, 0, 0.50);
  --bg:       #080700;
  --bg-panel: #0c0a00;
  --bg-input: #040300;
  --red:      #cc3300;
  --red-glow: rgba(204, 51, 0, 0.30);
  --f-pixel:  'VT323', 'Courier New', monospace;
  --f-mono:   'Share Tech Mono', 'Courier New', monospace;
  --safe-top: max(24px, env(safe-area-inset-top));
  --safe-bot: max(28px, env(safe-area-inset-bottom));
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #000;
  font-family: var(--f-mono);
  color: var(--a);
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ── CRT Overlay Effects ───────────────────────────────── */
.crt-vignette {
  position: fixed; inset: 0; z-index: 110; pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%,
    transparent 55%,
    rgba(0,0,0,0.55) 100%);
}

.scanlines {
  position: fixed; inset: 0; z-index: 109; pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.13) 2px,
    rgba(0,0,0,0.13) 4px
  );
  animation: scanflicker 12s infinite;
}

@keyframes scanflicker {
  0%,89%,91%,96%,100% { opacity: 1; }
  90% { opacity: 0.75; }
  97% { opacity: 0.88; }
}

/* ── Screen System ─────────────────────────────────────── */
.screen {
  position: fixed; inset: 0;
  display: flex; align-items: flex-start; justify-content: center;
  background: var(--bg);
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.screen.active { opacity: 1; pointer-events: all; }

.screen-content {
  width: 100%; max-width: 480px;
  padding: var(--safe-top) 22px var(--safe-bot);
  min-height: 100vh;
  display: flex; flex-direction: column; gap: 22px;
}

/* entry animation on each screen */
.screen.active .screen-content {
  animation: fadeup 0.4s ease both;
}

@keyframes fadeup {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Logo (auth) ───────────────────────────────────────── */
.logo { text-align: center; padding: 16px 0 0; }

.logo-title {
  font-family: var(--f-pixel);
  font-size: clamp(44px, 13vw, 64px);
  letter-spacing: 5px;
  line-height: 1;
  color: var(--a-bright);
  text-shadow:
    0 0 8px  var(--a),
    0 0 20px var(--a-dim),
    0 0 50px rgba(232,164,0,0.15);
}

.logo-subtitle {
  font-size: 10px; letter-spacing: 3px;
  color: var(--a-dim); margin-top: 6px;
}

.logo-divider {
  font-size: 13px; letter-spacing: 1px;
  color: var(--a-dim); margin-top: 10px;
  opacity: 0.5;
}

/* ── Auth Panel ────────────────────────────────────────── */
.auth-panel {
  position: relative;
  border: 1px solid var(--a-dim);
  background: var(--bg-panel);
  padding: 26px 22px 22px;
  box-shadow: 0 0 24px var(--a-glow), inset 0 0 30px rgba(0,0,0,0.6);
}

/* bracket corners */
.panel-corner {
  position: absolute; width: 10px; height: 10px;
  border-color: var(--a); border-style: solid;
}
.panel-corner.tl { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.panel-corner.tr { top: -1px; right: -1px; border-width: 2px 2px 0 0; }
.panel-corner.bl { bottom: -1px; left: -1px; border-width: 0 0 2px 2px; }
.panel-corner.br { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

.auth-status-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px;
}

.auth-status-text {
  font-family: var(--f-pixel);
  font-size: 20px; letter-spacing: 3px;
  color: var(--a-bright);
  text-shadow: 0 0 6px var(--a);
}

.auth-form { display: flex; flex-direction: column; gap: 10px; }

.auth-footer {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding-top: 4px;
}

.sys-line {
  font-size: 10px; letter-spacing: 2px; color: var(--a-dim);
}

.reset-link {
  background: none; border: none; cursor: pointer;
  font-family: var(--f-mono); font-size: 10px;
  letter-spacing: 2px; color: var(--a-dim);
  text-decoration: underline; text-underline-offset: 3px;
  opacity: 0.55; transition: opacity 0.2s;
}
.reset-link:hover { opacity: 1; }

/* ── Top Bar (home + session) ──────────────────────────── */
.top-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--a-dim);
}

.top-bar-title {
  font-family: var(--f-pixel);
  font-size: 32px; letter-spacing: 5px;
  color: var(--a); text-shadow: 0 0 8px var(--a-glow2);
}

.top-bar-tag, .session-badge {
  font-size: 10px; letter-spacing: 2px; color: var(--a-dim);
}

.session-badge {
  display: flex; align-items: center; gap: 7px;
  border: 1px solid var(--a-dim);
  padding: 4px 10px;
  color: var(--a);
  font-size: 10px; letter-spacing: 2px;
  transition: border-color 0.3s, color 0.3s;
}

.session-badge.paused {
  border-color: var(--a-dim); color: var(--a-dim);
}

/* ── Field Labels ──────────────────────────────────────── */
.field-label {
  display: block;
  font-size: 9px; letter-spacing: 3px;
  color: var(--a-dim); margin-bottom: 6px;
}

/* ── Input Fields ──────────────────────────────────────── */
.input-row {
  display: flex; align-items: center;
  border: 1px solid var(--a-dim); background: var(--bg-input);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-row:focus-within {
  border-color: var(--a);
  box-shadow: 0 0 14px var(--a-glow);
}

.topic-input-wrap {
  display: flex; align-items: center;
  border: 1px solid var(--a-dim); background: var(--bg-input);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.topic-input-wrap:focus-within {
  border-color: var(--a);
  box-shadow: 0 0 14px var(--a-glow);
}

.input-caret {
  padding: 10px 6px 10px 12px;
  font-family: var(--f-pixel); font-size: 18px;
  color: var(--a); flex-shrink: 0;
}

.retro-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--a); caret-color: var(--a-bright);
  font-family: var(--f-mono); font-size: 16px;
  padding: 11px 12px 11px 4px;
  -webkit-appearance: none; border-radius: 0;
}

.retro-input::placeholder { color: rgba(232,164,0,0.18); }

/* standalone input (auth) */
.auth-form .input-row .retro-input { padding: 11px 12px; }

.topic-input { font-size: 17px; letter-spacing: 0.5px; }

/* ── Error / Status Lines ──────────────────────────────── */
.error-line {
  font-size: 11px; letter-spacing: 1px; min-height: 14px;
  color: #ff4444;
  text-shadow: 0 0 8px rgba(255,68,68,0.4);
  transition: opacity 0.2s;
}

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  background: transparent;
  border: 1px solid var(--a-dim);
  color: var(--a);
  font-family: var(--f-pixel); font-size: 22px; letter-spacing: 4px;
  padding: 13px 18px; cursor: pointer;
  -webkit-appearance: none; border-radius: 0;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s, opacity 0.15s;
  text-transform: uppercase;
}

.btn:active { opacity: 0.75; transform: scale(0.98); }
.btn:disabled { opacity: 0.25; cursor: default; transform: none; }

.btn-full { width: 100%; }

.btn-full:not(:disabled):hover {
  border-color: var(--a);
  box-shadow: 0 0 18px var(--a-glow);
  background: rgba(232,164,0,0.06);
}

/* Start button */
.btn-start {
  width: 100%;
  font-size: 26px; letter-spacing: 6px;
  border: 1px solid var(--a-dim);
  padding: 18px;
}

.btn-start:not(:disabled) {
  border-color: var(--a-dim);
  animation: startpulse 3.5s ease-in-out infinite;
}

.btn-start:not(:disabled):hover, .btn-start:not(:disabled):active {
  animation: none;
  border-color: var(--a);
  box-shadow: 0 0 30px var(--a-glow2), 0 0 60px var(--a-glow);
  background: rgba(232,164,0,0.07);
}

@keyframes startpulse {
  0%,100% { box-shadow: 0 0 12px var(--a-glow); border-color: var(--a-dim); }
  50%     { box-shadow: 0 0 28px var(--a-glow2); border-color: rgba(232,164,0,0.5); }
}

/* Session control buttons */
.session-controls {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}

.btn-pause, .btn-stop {
  padding: 18px 10px; font-size: 18px; letter-spacing: 3px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}

.ctrl-icon { font-size: 26px; line-height: 1; display: block; }
.ctrl-label { font-size: 14px; letter-spacing: 3px; }

.btn-pause:not(:disabled):hover {
  border-color: var(--a);
  box-shadow: 0 0 18px var(--a-glow);
  background: rgba(232,164,0,0.05);
}

.btn-stop {
  border-color: var(--red);
  color: #ff5500;
  box-shadow: 0 0 10px var(--red-glow);
}

.btn-stop:hover {
  background: rgba(204,51,0,0.1);
  box-shadow: 0 0 22px rgba(204,51,0,0.45);
}

/* ── Recent Topics ─────────────────────────────────────── */
.section { display: flex; flex-direction: column; }

.recent-section { flex: 1; display: flex; flex-direction: column; gap: 10px; }

.recent-header {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 9px; letter-spacing: 3px; color: var(--a-dim);
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(122,84,0,0.25);
}

.recent-count { opacity: 0.6; }

.recent-list { display: flex; flex-direction: column; gap: 5px; }

.recent-empty {
  font-size: 11px; letter-spacing: 2px;
  color: var(--a-dim); text-align: center;
  padding: 18px 0; opacity: 0.6;
}

.recent-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(122,84,0,0.35);
  background: rgba(232,164,0,0.015);
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  animation: itemin 0.3s ease both;
}

@keyframes itemin {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}

.recent-item::before {
  content: '▶';
  font-size: 9px; color: var(--a-dim);
  flex-shrink: 0; transition: color 0.18s;
}

.recent-item:hover, .recent-item:active {
  border-color: var(--a);
  background: rgba(232,164,0,0.06);
  box-shadow: 0 0 12px var(--a-glow);
}

.recent-item:hover::before, .recent-item:active::before {
  color: var(--a);
}

.ri-text {
  flex: 1; font-size: 14px; color: var(--a);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.ri-time {
  font-size: 10px; color: var(--a-dim);
  flex-shrink: 0; letter-spacing: 1px;
}

/* ── Session Screen ────────────────────────────────────── */
.topic-frame {
  border: 1px solid var(--a-dim);
  background: var(--bg-panel);
  padding: 18px 20px;
  box-shadow: inset 0 0 24px rgba(0,0,0,0.55);
}

.topic-frame-label {
  font-size: 9px; letter-spacing: 4px; color: var(--a-dim); margin-bottom: 10px;
}

.topic-frozen-text {
  font-family: var(--f-pixel);
  font-size: clamp(26px, 7vw, 36px);
  line-height: 1.25;
  color: var(--a-bright);
  text-shadow: 0 0 10px var(--a), 0 0 24px var(--a-dim);
  word-break: break-word;
}

/* ── Wave Visualiser ───────────────────────────────────── */
.wave-zone {
  display: flex; justify-content: center; align-items: center;
  height: 72px; overflow: hidden;
}

.wave-bars {
  display: flex; align-items: center; gap: 3px; height: 100%;
}

.bar {
  width: 3px; border-radius: 2px;
  background: var(--a); box-shadow: 0 0 5px var(--a);
  animation: wavebar 1.3s ease-in-out infinite;
  min-height: 4px;
}

/* staggered delays for natural wave */
.bar:nth-child(1)  { animation-delay:  0.00s; }
.bar:nth-child(2)  { animation-delay:  0.06s; }
.bar:nth-child(3)  { animation-delay:  0.12s; }
.bar:nth-child(4)  { animation-delay:  0.18s; }
.bar:nth-child(5)  { animation-delay:  0.24s; }
.bar:nth-child(6)  { animation-delay:  0.30s; }
.bar:nth-child(7)  { animation-delay:  0.36s; }
.bar:nth-child(8)  { animation-delay:  0.42s; }
.bar:nth-child(9)  { animation-delay:  0.48s; }
.bar:nth-child(10) { animation-delay:  0.52s; }
.bar:nth-child(11) { animation-delay:  0.48s; }
.bar:nth-child(12) { animation-delay:  0.42s; }
.bar:nth-child(13) { animation-delay:  0.36s; }
.bar:nth-child(14) { animation-delay:  0.30s; }
.bar:nth-child(15) { animation-delay:  0.24s; }
.bar:nth-child(16) { animation-delay:  0.18s; }
.bar:nth-child(17) { animation-delay:  0.12s; }
.bar:nth-child(18) { animation-delay:  0.06s; }
.bar:nth-child(19) { animation-delay:  0.00s; }
.bar:nth-child(20) { animation-delay:  0.06s; }
.bar:nth-child(21) { animation-delay:  0.12s; }
.bar:nth-child(22) { animation-delay:  0.18s; }
.bar:nth-child(23) { animation-delay:  0.24s; }
.bar:nth-child(24) { animation-delay:  0.30s; }

@keyframes wavebar {
  0%, 100% { height: 5px;  opacity: 0.35; }
  50%       { height: 58px; opacity: 1;    }
}

/* paused state — freeze bars and dim them */
.wave-bars.paused .bar {
  animation-play-state: paused;
  height: 5px !important;
  opacity: 0.2 !important;
  transition: height 0.4s ease, opacity 0.4s ease;
}

/* ── Timer ─────────────────────────────────────────────── */
.timer-display {
  font-family: var(--f-pixel);
  font-size: clamp(48px, 14vw, 64px);
  text-align: center; letter-spacing: 4px; line-height: 1;
  color: var(--a);
  text-shadow: 0 0 12px var(--a), 0 0 28px var(--a-dim);
}

/* ── Status Log ────────────────────────────────────────── */
.status-log-line {
  font-size: 10px; letter-spacing: 2px;
  color: var(--a-dim); text-align: center;
  min-height: 14px;
  transition: opacity 0.5s;
}

/* ── Blinking cursor / dot ─────────────────────────────── */
.blink { animation: blink 1.1s step-end infinite; }

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

.status-dot {
  display: inline-block;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--a);
  box-shadow: 0 0 6px var(--a);
}

.session-badge.paused .status-dot {
  background: var(--a-dim);
  box-shadow: none;
  animation: none;
}

/* ── Stream panel (session screen) ──────────────────────── */
.stream-panel {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  margin: 14px 0 10px;
  padding: 14px 14px 10px;
  background: var(--bg-panel);
  border: 1px solid var(--a-dim);
  box-shadow: inset 0 0 22px rgba(232, 164, 0, 0.08), 0 0 18px var(--a-glow);
}

.stream-scroll {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-family: var(--f-mono);
  font-size: 15px;
  line-height: 1.55;
  color: var(--a);
  text-shadow: 0 0 6px var(--a-glow);
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--a-dim) transparent;
}
.stream-scroll::-webkit-scrollbar { width: 6px; }
.stream-scroll::-webkit-scrollbar-track { background: transparent; }
.stream-scroll::-webkit-scrollbar-thumb {
  background: var(--a-dim);
  border-radius: 3px;
}

.stream-text {
  display: inline;
  white-space: pre-wrap;
  word-break: break-word;
  -webkit-user-select: text;
  user-select: text;
}

.stream-caret {
  display: inline-block;
  margin-left: 2px;
  color: var(--a-bright);
  font-size: 13px;
  vertical-align: baseline;
}

/* ── Session screen height containment (item 4) ─────────── */
/* The default .screen-content uses min-height: 100vh and lives inside a
   scrollable .screen — fine for the home screen which has variable content,
   but on the session screen we want a fixed-height column so the stream
   panel scrolls *internally* instead of growing the page. */
#screen-session { overflow: hidden; }
.session-content {
  height: 100dvh;
  min-height: 0 !important;
  max-height: 100dvh;
  gap: 14px !important;
}
.session-content .stream-panel {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}
.session-content .topic-frame { flex: 0 0 auto; }
.session-content .session-meta,
.session-content .speed-row,
.session-content .session-controls { flex: 0 0 auto; }

/* ── Top-bar save button (session) ──────────────────────── */
.icon-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--a-dim);
  color: var(--a); font-family: var(--f-mono);
  padding: 5px 10px; cursor: pointer; letter-spacing: 2px; font-size: 11px;
  transition: border-color 0.18s, color 0.18s, box-shadow 0.18s;
}
.icon-btn:hover, .icon-btn:active {
  border-color: var(--a); box-shadow: 0 0 10px var(--a-glow);
}
.icon-btn.saved {
  border-color: var(--a-bright); color: var(--a-bright);
  box-shadow: 0 0 14px var(--a-glow2);
}
.save-glyph { font-size: 13px; line-height: 1; }

/* ── Speed slider ───────────────────────────────────────── */
.speed-row {
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: 12px;
  padding: 4px 2px;
}
.speed-label, .speed-value {
  font-size: 10px; letter-spacing: 2px; color: var(--a-dim);
}
.speed-value { min-width: 56px; text-align: right; color: var(--a); }
#speed-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; background: var(--a-dim);
  border-radius: 2px; outline: none;
}
#speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--a); border: 1px solid var(--a-bright);
  box-shadow: 0 0 8px var(--a-glow2);
  cursor: pointer;
}
#speed-slider::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--a); border: 1px solid var(--a-bright);
  box-shadow: 0 0 8px var(--a-glow2);
  cursor: pointer;
}

/* Session-meta groups timer + status compactly. */
.session-meta {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px;
}

/* ── Usage panel (home) ─────────────────────────────────── */
.usage-panel {
  border: 1px solid var(--a-dim);
  background: var(--bg-panel);
  padding: 12px 14px;
  box-shadow: inset 0 0 16px rgba(0,0,0,0.45);
}
.usage-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.usage-title {
  font-size: 9px; letter-spacing: 3px; color: var(--a-dim);
}
.usage-window-toggle {
  display: inline-flex; gap: 0;
  border: 1px solid var(--a-dim);
}
.uw-btn {
  background: transparent; color: var(--a-dim);
  font-family: var(--f-mono); font-size: 9px; letter-spacing: 1.5px;
  padding: 4px 8px; border: none; cursor: pointer;
  border-right: 1px solid var(--a-dim);
}
.uw-btn:last-child { border-right: none; }
.uw-btn.active {
  background: rgba(232,164,0,0.12);
  color: var(--a-bright);
}
.usage-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.usage-cell { display: flex; flex-direction: column; gap: 3px; }
.usage-label {
  font-size: 9px; letter-spacing: 2px; color: var(--a-dim);
}
.usage-value {
  font-family: var(--f-pixel); font-size: 24px; color: var(--a-bright);
  text-shadow: 0 0 10px var(--a-glow2);
}

/* ── Tabs + scrollable list (home) ──────────────────────── */
.list-section {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.list-tabs {
  display: flex; align-items: center; gap: 4px;
  border-bottom: 1px solid rgba(122,84,0,0.25);
  padding-bottom: 6px;
}
.list-tab {
  background: transparent; color: var(--a-dim);
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 3px;
  padding: 6px 10px; border: 1px solid transparent; cursor: pointer;
}
.list-tab.active {
  color: var(--a-bright); border-color: var(--a-dim);
  background: rgba(232,164,0,0.06);
  box-shadow: inset 0 0 10px rgba(232,164,0,0.08);
}
.list-count {
  margin-left: auto; font-size: 9px; letter-spacing: 2px;
  color: var(--a-dim);
}
.list-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: 360px;     /* prevents home from blowing up vertically */
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--a-dim) transparent;
}
.list-scroll::-webkit-scrollbar { width: 6px; }
.list-scroll::-webkit-scrollbar-thumb { background: var(--a-dim); border-radius: 3px; }
.list-empty {
  font-size: 11px; letter-spacing: 2px;
  color: var(--a-dim); text-align: center;
  padding: 18px 0; opacity: 0.6;
}
.list-items { display: flex; flex-direction: column; gap: 5px; }
.list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(122,84,0,0.35);
  background: rgba(232,164,0,0.015);
  cursor: pointer;
  animation: itemin 0.3s ease both;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.list-item:hover, .list-item:active {
  border-color: var(--a);
  background: rgba(232,164,0,0.06);
  box-shadow: 0 0 12px var(--a-glow);
}
.list-item::before {
  content: '▸';
  font-size: 10px; color: var(--a-dim);
  flex-shrink: 0;
}
.li-tag {
  font-size: 9px; letter-spacing: 2px;
  color: var(--a-dim); border: 1px solid var(--a-dim);
  padding: 1px 5px; flex-shrink: 0;
}
.li-text {
  flex: 1; font-size: 14px; color: var(--a);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.li-time {
  font-size: 10px; color: var(--a-dim);
  flex-shrink: 0; letter-spacing: 1px;
}
.li-action {
  flex-shrink: 0;
  background: transparent; border: 1px solid transparent;
  color: var(--a-dim); cursor: pointer;
  font-size: 14px; padding: 2px 7px;
  font-family: var(--f-mono);
  transition: color 0.15s, border-color 0.15s;
}
.li-action:hover { color: var(--a-bright); border-color: var(--a-dim); }
.li-action.flash { color: var(--a-bright); }

/* ── Home → Usage nav row ─────────────────────────────── */
.nav-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--bg-panel);
  border: 1px solid var(--a-dim);
  color: var(--a);
  font-family: var(--f-mono);
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.nav-row:hover, .nav-row:active {
  border-color: var(--a);
  background: rgba(232,164,0,0.05);
  box-shadow: 0 0 12px var(--a-glow);
}
.nav-row-label {
  font-size: 10px; letter-spacing: 3px; color: var(--a-dim);
}
.nav-row-summary {
  flex: 1; text-align: right;
  font-size: 12px; letter-spacing: 1px; color: var(--a);
}
.nav-row-arrow {
  font-size: 22px; line-height: 1;
  color: var(--a-dim);
}

/* ── Usage screen ─────────────────────────────────────── */
.back-btn {
  background: transparent; border: 1px solid var(--a-dim);
  color: var(--a); font-family: var(--f-mono);
  font-size: 22px; line-height: 1;
  width: 34px; height: 32px;
  cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  margin-right: 6px;
}
.back-btn:hover, .back-btn:active {
  border-color: var(--a); box-shadow: 0 0 10px var(--a-glow);
}

.usage-window-toggle.wide {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--a-dim);
}
.usage-window-toggle.wide .uw-btn {
  padding: 10px 0; font-size: 11px;
  border-right: 1px solid var(--a-dim);
}
.usage-window-toggle.wide .uw-btn:last-child { border-right: none; }

.usage-big {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.usage-cell.big {
  border: 1px solid var(--a-dim);
  background: var(--bg-panel);
  padding: 18px 16px;
  display: flex; flex-direction: column; gap: 6px;
  box-shadow: inset 0 0 18px rgba(0,0,0,0.45);
}
.usage-value.xl {
  font-family: var(--f-pixel); font-size: 38px; color: var(--a-bright);
  text-shadow: 0 0 12px var(--a-glow2);
  line-height: 1;
}

.usage-breakdown {
  border: 1px solid rgba(122,84,0,0.35);
  display: flex; flex-direction: column;
}
.ub-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(122,84,0,0.25);
}
.ub-row:last-child { border-bottom: none; }
.ub-label {
  font-size: 10px; letter-spacing: 3px; color: var(--a-dim);
}
.ub-val {
  font-family: var(--f-mono); font-size: 14px; color: var(--a);
}
.usage-note {
  font-size: 10px; letter-spacing: 1px; color: var(--a-dim);
  line-height: 1.5; opacity: 0.75;
}

/* ── Icon-only save button (session top-bar) ──────────── */
.icon-btn.icon-only {
  width: 32px; height: 32px;
  padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.icon-btn.icon-only .save-glyph { font-size: 16px; }

/* Top bar tightening when there's a third element. */
.session-content .top-bar { gap: 8px; }
.session-content .top-bar-title { flex: 0 1 auto; }
.session-content .session-badge { margin-left: auto; }
