:root {
  --h: 188;
  --accent: hsl(var(--h) 92% 60%);
  --accent-bright: hsl(var(--h) 96% 74%);
  --accent-deep: hsl(var(--h) 88% 46%);
  --accent-2: hsl(calc(var(--h) + 44) 92% 62%);
  --accent-3: hsl(calc(var(--h) - 44) 92% 62%);
  --accent-soft: hsl(var(--h) 92% 60% / 0.13);
  --accent-softer: hsl(var(--h) 92% 60% / 0.06);
  --accent-line: hsl(var(--h) 92% 60% / 0.32);
  --accent-glow: hsl(var(--h) 96% 60% / 0.45);
  --bg: #04060c;
  --bg-2: #070b14;
  --panel: rgba(9, 14, 25, 0.72);
  --panel-2: rgba(12, 18, 32, 0.6);
  --panel-solid: #0a1019;
  --ink: #e9f2ff;
  --ink-soft: #c3d2e8;
  --muted: #8ea2c0;
  --dim: #62748f;
  --line: rgba(126, 166, 214, 0.14);
  --line-strong: rgba(126, 166, 214, 0.26);
  --ok: #48e0a4;
  --warn: #ffc857;
  --bad: #ff6b81;
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Segoe UI", "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.85);
  --topbar-h: 72px;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(1100px 700px at 78% -10%, hsl(var(--h) 90% 40% / 0.16), transparent 62%),
    radial-gradient(900px 700px at 8% 8%, hsl(calc(var(--h) + 60) 80% 35% / 0.1), transparent 60%),
    linear-gradient(180deg, #05070e 0%, var(--bg) 45%, #03050a 100%);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.booted {
  overflow-x: hidden;
}

body.booting {
  overflow: hidden;
}

::selection {
  background: hsl(var(--h) 92% 60% / 0.35);
  color: #fff;
}

a {
  color: var(--accent-bright);
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

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

button {
  border: 0;
  background: none;
  cursor: pointer;
}

img,
svg {
  display: block;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

h1, h2, h3, h4, p {
  margin: 0;
}

h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.01em;
}

code,
kbd {
  font-family: var(--mono);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 500;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #04121a;
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 0.2s;
}

.skip-link:focus {
  transform: translateY(0);
}

#bg3d {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.9;
}

.bg-grid {
  position: fixed;
  inset: -10%;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, hsl(var(--h) 80% 60% / 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, hsl(var(--h) 80% 60% / 0.055) 1px, transparent 1px);
  background-size: 48px 48px;
  transform: perspective(900px) rotateX(62deg) translateY(18%);
  transform-origin: center bottom;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 64%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 64%, #000 0%, transparent 78%);
  animation: grid-drift 26s linear infinite;
  opacity: 0.75;
}

.bg-vignette {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 70% at 50% 30%, transparent 40%, rgba(2, 4, 8, 0.55) 100%),
    linear-gradient(180deg, rgba(2, 4, 8, 0.2), transparent 18%, transparent 82%, rgba(2, 4, 8, 0.7));
}

.bg-scan {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 3px);
  opacity: 0.55;
  mix-blend-mode: overlay;
}

.bg-scan::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 28vh;
  background: linear-gradient(180deg, transparent, hsl(var(--h) 90% 60% / 0.045), transparent);
  animation: scan 9s linear infinite;
}

@keyframes scan {
  from { transform: translateY(-40vh); }
  to { transform: translateY(120vh); }
}

@keyframes grid-drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 48px 48px, 48px 48px; }
}

#boot {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 45%, hsl(var(--h) 90% 30% / 0.22), transparent 40%),
    #03050a;
  transition: opacity 0.6s ease, visibility 0.6s;
}

body.booted #boot {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-inner {
  display: grid;
  justify-items: center;
  gap: 18px;
  text-align: center;
}

.boot-core {
  width: 132px;
  height: 132px;
  filter: drop-shadow(0 0 26px var(--accent-glow));
}

.boot-core svg {
  width: 100%;
  height: 100%;
  stroke-width: 1.4;
}

.bc-ring {
  stroke: var(--accent);
  opacity: 0.5;
  stroke-dasharray: 40 14;
  transform-origin: 60px 60px;
  animation: spin 7s linear infinite;
}

.bc-ring-2 {
  stroke: var(--accent-bright);
  opacity: 0.85;
  stroke-dasharray: 8 10;
  animation-direction: reverse;
  animation-duration: 4s;
}

.bc-dot {
  fill: var(--accent-bright);
  stroke: none;
  animation: core-pulse 1.6s ease-in-out infinite;
}

.bc-ticks {
  stroke: var(--accent);
  opacity: 0.4;
}

.boot-word {
  font-family: var(--mono);
  font-size: 22px;
  letter-spacing: 0.62em;
  color: var(--ink);
  padding-left: 0.62em;
}

.boot-log {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  min-height: 18px;
}

.boot-bar {
  width: 260px;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  border-radius: 2px;
}

.boot-bar i {
  display: block;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: boot-bar 1.2s ease-in-out infinite;
}

.boot-skip {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
}

@keyframes boot-bar {
  from { transform: translateX(-120%); }
  to { transform: translateX(320%); }
}

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

@keyframes core-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

#topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 12px clamp(14px, 3vw, 34px);
  min-height: var(--topbar-h);
  background: linear-gradient(180deg, rgba(4, 7, 13, 0.92), rgba(4, 7, 13, 0.66));
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  border-bottom: 1px solid var(--line);
}

#topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-line) 20%, var(--accent-line) 80%, transparent);
  opacity: 0.7;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  min-width: 0;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  color: var(--accent);
  filter: drop-shadow(0 0 12px hsl(var(--h) 92% 60% / 0.4));
}

.brand-mark svg {
  width: 100%;
  height: 100%;
  stroke-width: 1.5;
}

.bm-a {
  stroke: currentColor;
  opacity: 0.4;
  stroke-dasharray: 6 9;
  transform-origin: 24px 24px;
  animation: spin 18s linear infinite;
}

.bm-b {
  stroke: currentColor;
  opacity: 0.75;
}

.bm-c {
  fill: var(--accent-bright);
  stroke: none;
}

.bm-d {
  stroke: currentColor;
  opacity: 0.6;
}

.brand-text {
  display: grid;
  line-height: 1.15;
}

.brand-text b {
  font-family: var(--mono);
  font-size: 17px;
  letter-spacing: 0.3em;
  font-weight: 600;
}

.brand-text small {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  color: var(--dim);
  text-transform: uppercase;
  white-space: nowrap;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 680px;
  justify-self: center;
  height: 46px;
  padding: 0 8px 0 14px;
  background: rgba(8, 13, 24, 0.75);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.search:focus-within {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-softer), 0 10px 30px -18px var(--accent-glow);
  background: rgba(10, 16, 28, 0.94);
}

.search-ic {
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex: 0 0 auto;
}

.search-ic svg {
  width: 100%;
  height: 100%;
}

.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  font-size: 14px;
  color: var(--ink);
  outline: none;
}

.search input::placeholder {
  color: var(--dim);
}

.search input::-webkit-search-cancel-button {
  filter: invert(0.7);
}

.search-kbd {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 1px 6px;
  line-height: 1.5;
}

.search-go {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #04121a;
  background: var(--accent);
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
  box-shadow: 0 0 18px hsl(var(--h) 92% 60% / 0.3);
}

.search-go svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}

.search-go:hover {
  transform: translateX(1px);
  background: var(--accent-bright);
}

.top-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

.top-status .dot {
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok);
}

.top-status.offline .dot {
  background: var(--bad);
  box-shadow: 0 0 10px var(--bad);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  flex: 0 0 auto;
}

.clock {
  display: grid;
  line-height: 1.1;
  padding: 0 6px 0 10px;
  border-left: 1px solid var(--line);
  min-width: 96px;
}

.clock b {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.clock small {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--dim);
  white-space: nowrap;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
  transition: color 0.18s, background 0.18s, border-color 0.18s, transform 0.18s;
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

.icon-btn:hover {
  color: var(--accent-bright);
  background: var(--accent-softer);
  border-color: var(--accent-line);
}

.icon-btn:active {
  transform: scale(0.94);
}

.icon-btn.mini {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.icon-btn.mini svg {
  width: 15px;
  height: 15px;
}

#main {
  position: relative;
  z-index: 2;
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 clamp(14px, 3vw, 34px);
}

#hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  align-items: center;
  gap: 30px;
  padding: clamp(34px, 6vw, 74px) 0 clamp(30px, 4vw, 52px);
  min-height: 330px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.eyebrow.small {
  font-size: 9px;
  margin-bottom: 6px;
}

.eyebrow-line {
  width: 34px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent));
  display: inline-block;
}

#hero-title {
  font-size: clamp(38px, 5.4vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 600;
  max-width: 15ch;
  text-wrap: balance;
}

#hero-title em {
  font-style: normal;
  background: linear-gradient(102deg, var(--accent-bright), var(--accent-2) 55%, var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 24px hsl(var(--h) 92% 60% / 0.25));
}

.hero-sub {
  margin-top: 16px;
  max-width: 62ch;
  color: var(--muted);
  font-size: clamp(14px, 1.3vw, 16px);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(9, 14, 25, 0.55);
  color: var(--ink-soft);
  font-size: 12px;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}

.meta-chip svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
  flex: 0 0 auto;
}

.meta-chip:hover {
  border-color: var(--accent-line);
  color: var(--ink);
  background: var(--accent-softer);
}

.meta-chip.ghost {
  color: var(--muted);
}

.hero-orbit {
  position: relative;
  justify-self: center;
  width: min(330px, 30vw);
  aspect-ratio: 1;
}

.orbit-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid hsl(var(--h) 80% 60% / 0.16);
}

.orbit-ring::before,
.orbit-ring::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.orbit-ring::before {
  top: -3px;
  left: 50%;
}

.orbit-ring::after {
  bottom: -3px;
  left: 50%;
  opacity: 0.4;
}

.r1 {
  animation: spin 26s linear infinite;
}

.r2 {
  inset: 13%;
  border-style: dashed;
  border-color: hsl(var(--h) 80% 60% / 0.22);
  animation: spin 18s linear infinite reverse;
}

.r3 {
  inset: 27%;
  border-color: hsl(var(--h) 80% 60% / 0.1);
  animation: spin 40s linear infinite;
}

.r2::before,
.r3::before {
  background: var(--accent-2);
  box-shadow: 0 0 12px var(--accent-2);
}

.orbit-label {
  position: absolute;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  color: var(--dim);
  text-transform: uppercase;
  white-space: nowrap;
}

.ol-1 { top: 4%; left: 52%; }
.ol-2 { bottom: 12%; left: 2%; }
.ol-3 { right: -4%; bottom: 34%; }

#ticker {
  display: flex;
  align-items: stretch;
  gap: 0;
  height: 44px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, hsl(var(--h) 80% 60% / 0.06), rgba(7, 11, 20, 0.5) 30%, rgba(7, 11, 20, 0.5) 70%, hsl(var(--h) 80% 60% / 0.06));
  overflow: hidden;
  margin-bottom: clamp(16px, 2.4vw, 28px);
  border-radius: 0;
}

.ticker-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-right: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--accent);
  background: rgba(4, 7, 13, 0.7);
  flex: 0 0 auto;
  z-index: 2;
}

.ticker-view {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  mask-image: linear-gradient(90deg, transparent, #000 2%, #000 96%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 2%, #000 96%, transparent);
}

.ticker-track {
  display: flex;
  align-items: center;
  width: max-content;
  white-space: nowrap;
  animation: ticker 70s linear infinite;
  will-change: transform;
}

.ticker-group {
  display: flex;
  align-items: center;
  gap: 42px;
  padding-right: 42px;
  flex: 0 0 auto;
}

.ticker-view:hover .ticker-track {
  animation-play-state: paused;
}

.ticker-track span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-soft);
}

.ticker-track span::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  flex: 0 0 auto;
}

.ticker-track a {
  color: inherit;
}

.ticker-track a:hover {
  color: var(--accent-bright);
}

.ticker-all {
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border-left: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  flex: 0 0 auto;
}

.ticker-all:hover {
  color: var(--accent-bright);
}

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

#dashboard {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  padding-bottom: clamp(30px, 5vw, 60px);
}

.panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background:
    linear-gradient(160deg, rgba(15, 23, 40, 0.72), rgba(7, 11, 20, 0.78) 60%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-line), transparent);
  opacity: 0.55;
  pointer-events: none;
}

.panel:hover {
  border-color: rgba(126, 166, 214, 0.24);
  box-shadow: 0 30px 70px -28px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.panel-weather { grid-column: span 5; }
.panel-ai { grid-column: span 7; }
.panel-stocks { grid-column: span 4; }
.panel-fuel { grid-column: span 4; }
.panel-calendar { grid-column: span 4; }
.panel-news { grid-column: span 8; }
.panel-links { grid-column: span 4; }
.panel-system { grid-column: span 12; }

.panel[hidden] {
  display: none;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent);
}

.ph-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.ph-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-bright);
  flex: 0 0 auto;
}

.ph-icon svg {
  width: 17px;
  height: 17px;
}

.ph-left h2 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
}

.ph-left small {
  display: block;
  font-size: 10.5px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 32ch;
}

.ph-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 21px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
}

.badge.live,
.badge.on {
  color: var(--ok);
  border-color: rgba(72, 224, 164, 0.3);
  background: rgba(72, 224, 164, 0.08);
}

.badge.warn {
  color: var(--warn);
  border-color: rgba(255, 200, 87, 0.3);
  background: rgba(255, 200, 87, 0.08);
}

.badge.off {
  color: var(--bad);
  border-color: rgba(255, 107, 129, 0.3);
  background: rgba(255, 107, 129, 0.08);
}

.panel-body {
  padding: 16px;
  flex: 1;
  min-height: 0;
}

.panel-foot {
  padding: 9px 16px;
  border-top: 1px solid var(--line);
  font-size: 9.5px;
  color: var(--dim);
  letter-spacing: 0.02em;
}

.panel-foot a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
}

.scroll-body {
  max-height: 430px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, hsl(var(--h) 80% 60% / 0.09) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: shimmer 1.6s infinite;
}

.h120 { height: 120px; }
.h140 { height: 140px; }
.h150 { height: 150px; }
.h180 { height: 180px; }
.h220 { height: 220px; }

@keyframes shimmer {
  to { transform: translateX(100%); }
}

.wx-now {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.wx-temp {
  display: flex;
  align-items: flex-start;
  gap: 2px;
  font-family: var(--mono);
  font-weight: 300;
  font-size: clamp(46px, 5vw, 62px);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.wx-temp sup {
  font-size: 0.38em;
  margin-top: 0.35em;
  color: var(--muted);
  letter-spacing: 0;
}

.wx-cond {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 13px;
}

.wx-feel {
  color: var(--dim);
  font-size: 11px;
  margin-top: 2px;
}

.wx-icon {
  width: 74px;
  height: 74px;
  color: var(--accent-bright);
  filter: drop-shadow(0 0 18px hsl(var(--h) 92% 60% / 0.35));
}

.wx-icon svg {
  width: 100%;
  height: 100%;
  stroke-width: 1.4;
}

.wx-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--line);
}

.wx-stat {
  padding: 9px 11px;
  background: rgba(6, 10, 18, 0.72);
}

.wx-stat span {
  display: block;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.wx-stat b {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
}

.wx-hours {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.wx-hour {
  flex: 0 0 auto;
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 52px;
  padding: 8px 4px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.018);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}

.wx-hour.now {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--ink);
}

.wx-hour svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.wx-hour b {
  font-weight: 500;
  color: var(--ink-soft);
}

.wx-days {
  display: grid;
  gap: 2px;
  margin-top: 14px;
}

.wx-day {
  display: grid;
  grid-template-columns: 42px 20px minmax(50px, 1fr) 92px;
  align-items: center;
  gap: 9px;
  padding: 5px 2px;
  font-size: 11px;
  color: var(--muted);
}

.wx-day + .wx-day {
  border-top: 1px solid rgba(126, 166, 214, 0.08);
}

.wx-day .d-name {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.wx-day svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.wx-bar {
  position: relative;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.wx-bar i {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent-bright));
}

.wx-day .d-temp {
  font-family: var(--mono);
  text-align: right;
  font-size: 10.5px;
  color: var(--ink-soft);
}

.wx-air {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--dim);
}

.wx-air b {
  color: var(--ink-soft);
  font-weight: 500;
}

.air-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok);
  display: inline-block;
  margin-right: 6px;
}

.air-dot.warn { background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.air-dot.bad { background: var(--bad); box-shadow: 0 0 10px var(--bad); }

.panel-ai .panel-body {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.chat {
  flex: 1;
  min-height: 250px;
  max-height: 340px;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}

.msg {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  animation: msg-in 0.28s ease both;
}

.msg.user {
  align-self: flex-end;
  background: linear-gradient(150deg, hsl(var(--h) 88% 46% / 0.3), hsl(var(--h) 88% 40% / 0.16));
  border: 1px solid var(--accent-line);
  border-bottom-right-radius: 4px;
  color: var(--ink);
}

.msg.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
  color: var(--ink-soft);
}

.msg.error {
  border-color: rgba(255, 107, 129, 0.35);
  background: rgba(255, 107, 129, 0.08);
  color: #ffc2cb;
}

.msg .msg-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--dim);
}

.msg .msg-meta .dot {
  width: 5px;
  height: 5px;
}

.msg a {
  color: var(--accent-bright);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.msg code {
  font-size: 12px;
  background: rgba(0, 0, 0, 0.3);
  padding: 1px 5px;
  border-radius: 4px;
}

.typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 4px 0;
}

.typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: typing 1.1s ease-in-out infinite;
}

.typing i:nth-child(2) { animation-delay: 0.16s; }
.typing i:nth-child(3) { animation-delay: 0.32s; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
  30% { transform: translateY(-3px); opacity: 1; }
}

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

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 12px;
}

.chips button {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.022);
  font-size: 10.5px;
  color: var(--muted);
  transition: all 0.16s;
}

.chips button:hover {
  color: var(--accent-bright);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.chat-form {
  margin-top: auto;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
  background: rgba(4, 7, 13, 0.5);
}

.chat-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 7px 7px 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(7, 11, 20, 0.8);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input-wrap:focus-within {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-softer);
}

#ai-input {
  flex: 1;
  min-width: 0;
  max-height: 118px;
  padding: 5px 0;
  border: 0;
  background: transparent;
  resize: none;
  outline: none;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink);
}

#ai-input::placeholder {
  color: var(--dim);
}

.send-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  color: #04121a;
  flex: 0 0 auto;
  transition: background 0.18s, transform 0.15s, opacity 0.18s;
  box-shadow: 0 0 20px hsl(var(--h) 92% 60% / 0.25);
}

.send-btn svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.9;
}

.send-btn:hover {
  background: var(--accent-bright);
}

.send-btn:active {
  transform: scale(0.94);
}

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

.chat-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 9px;
  flex-wrap: wrap;
}

.chat-hint {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  color: var(--dim);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 10.5px;
  color: var(--muted);
  user-select: none;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch span {
  position: relative;
  padding-left: 30px;
}

.switch span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 22px;
  height: 12px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid var(--line-strong);
  transition: background 0.2s, border-color 0.2s;
}

.switch span::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 50%;
  width: 8px;
  height: 8px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--dim);
  transition: transform 0.2s, background 0.2s;
}

.switch input:checked + span {
  color: var(--ink-soft);
}

.switch input:checked + span::before {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.switch input:checked + span::after {
  transform: translate(10px, -50%);
  background: var(--accent-bright);
  box-shadow: 0 0 8px var(--accent-glow);
}

.switch input:focus-visible + span::before {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.switch.wide {
  display: flex;
  padding: 8px 0;
}

.switch.wide span {
  padding-left: 34px;
  font-size: 12px;
  color: var(--ink-soft);
}

.stock-list {
  display: grid;
  gap: 3px;
}

.stock-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 62px auto;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 8px;
  transition: background 0.16s;
}

.stock-row:hover {
  background: rgba(255, 255, 255, 0.025);
}

.stock-row + .stock-row {
  border-top: 1px solid rgba(126, 166, 214, 0.07);
}

.stock-id {
  min-width: 0;
}

.stock-id b {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.stock-id span {
  display: block;
  font-size: 10.5px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spark {
  width: 62px;
  height: 24px;
  overflow: visible;
}

.spark path {
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.spark .spark-fill {
  fill: currentColor;
  stroke: none;
  opacity: 0.12;
}

.stock-px {
  text-align: right;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.stock-px small {
  display: block;
  font-size: 10px;
  letter-spacing: 0.02em;
}

.up { color: var(--ok); }
.down { color: var(--bad); }
.flat { color: var(--dim); }

.stock-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  color: var(--dim);
}

.fuel-list {
  display: grid;
  gap: 3px;
}

.fuel-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 6px;
  border-radius: 8px;
  transition: background 0.16s;
}

.fuel-row:hover {
  background: rgba(255, 255, 255, 0.025);
}

.fuel-row + .fuel-row {
  border-top: 1px solid rgba(126, 166, 214, 0.07);
}

.fuel-row.best {
  background: var(--accent-softer);
  border: 1px solid var(--accent-line);
  border-radius: 10px;
  margin: 2px 0;
}

.fuel-id {
  min-width: 0;
}

.fuel-id b {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fuel-id span {
  display: block;
  font-size: 10px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fuel-prices {
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
}

.price {
  display: grid;
  justify-items: center;
  min-width: 46px;
  padding: 3px 6px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  font-family: var(--mono);
  line-height: 1.15;
}

.price small {
  font-size: 7.5px;
  letter-spacing: 0.1em;
  color: var(--dim);
  text-transform: uppercase;
}

.price b {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-soft);
}

.price.cheap {
  border-color: rgba(72, 224, 164, 0.28);
  background: rgba(72, 224, 164, 0.07);
}

.price.cheap b {
  color: var(--ok);
}

.station-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ok);
}

.station-badge.closed {
  color: var(--bad);
}

.empty,
.error-box,
.info-box {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 110px;
  padding: 18px;
  text-align: center;
  font-size: 12px;
  color: var(--dim);
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.012);
}

.error-box {
  border-color: rgba(255, 107, 129, 0.28);
  color: #e6a9b2;
  background: rgba(255, 107, 129, 0.045);
}

.info-box b,
.empty b {
  color: var(--ink-soft);
  font-weight: 500;
}

.empty .btn,
.info-box .btn,
.error-box .btn {
  margin-top: 4px;
}

.cal-list {
  display: grid;
  gap: 4px;
}

.cal-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 7px 4px;
  border-radius: 8px;
}

.cal-item:hover {
  background: rgba(255, 255, 255, 0.025);
}

.cal-item + .cal-item {
  border-top: 1px solid rgba(126, 166, 214, 0.07);
}

.cal-date {
  display: grid;
  justify-items: center;
  padding: 4px 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  line-height: 1.05;
}

.cal-date b {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}

.cal-date span {
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.cal-info {
  min-width: 0;
}

.cal-info b {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-info span {
  display: block;
  font-size: 10px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-when {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
}

.news-list {
  display: grid;
  gap: 0;
}

.news-item {
  display: grid;
  gap: 4px;
  padding: 11px 4px;
  border-radius: 6px;
  transition: background 0.16s;
}

.news-item + .news-item {
  border-top: 1px solid rgba(126, 166, 214, 0.08);
}

.news-item:hover {
  background: rgba(255, 255, 255, 0.022);
}

.news-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}

.news-top .src {
  color: var(--accent);
}

.news-item a {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.news-item a:hover {
  color: var(--accent-bright);
}

.news-item p {
  font-size: 11px;
  color: var(--dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.link-tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink-soft);
  min-width: 0;
  overflow: hidden;
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
}

.link-tile::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: hsl(calc(var(--h) + var(--tile-h, 0)) 90% 60%);
  opacity: 0.7;
}

.link-tile:hover {
  border-color: var(--accent-line);
  background: var(--accent-softer);
  transform: translateY(-1px);
}

.link-initial {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent-bright);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  flex: 0 0 auto;
}

.link-meta {
  min-width: 0;
}

.link-meta b {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-meta span {
  display: block;
  font-size: 9.5px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sys-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.sys-cell {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.018);
}

.sys-cell span {
  display: block;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 4px;
}

.sys-cell b {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
}

.sys-cell .dot {
  width: 5px;
  height: 5px;
}

.sys-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
  margin-top: 6px;
  opacity: 0.55;
}

.sys-bars i {
  display: block;
  width: 3px;
  border-radius: 1px;
  background: var(--accent);
  animation: bars 1.8s ease-in-out infinite;
}

.sys-bars i:nth-child(2n) { animation-delay: 0.2s; }
.sys-bars i:nth-child(3n) { animation-delay: 0.4s; }
.sys-bars i:nth-child(5n) { animation-delay: 0.6s; }

@keyframes bars {
  0%, 100% { height: 25%; opacity: 0.4; }
  50% { height: 100%; opacity: 1; }
}

#footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, rgba(4, 7, 13, 0.7));
}

.foot-main {
  max-width: 1480px;
  margin: 0 auto;
  padding: clamp(26px, 4vw, 44px) clamp(14px, 3vw, 34px) 22px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto auto;
  gap: 26px;
  align-items: start;
}

.foot-brand {
  display: flex;
  gap: 12px;
  max-width: 440px;
}

.brand-mark.small {
  width: 30px;
  height: 30px;
  margin-top: 2px;
}

.foot-brand b {
  font-family: var(--mono);
  letter-spacing: 0.22em;
  font-size: 12px;
}

.foot-brand p {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--dim);
  line-height: 1.6;
}

.foot-links {
  display: grid;
  gap: 7px;
  font-size: 11.5px;
}

.foot-links a {
  color: var(--muted);
}

.foot-links a:hover {
  color: var(--accent-bright);
}

.foot-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-bright);
  font-size: 12px;
  font-weight: 500;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.15s;
}

.btn:hover {
  background: hsl(var(--h) 92% 60% / 0.22);
  border-color: var(--accent);
  color: #fff;
}

.btn:active {
  transform: scale(0.98);
}

.btn.small {
  height: 32px;
  padding: 0 12px;
  font-size: 11px;
  border-radius: 8px;
}

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

.btn.ghost:hover {
  border-color: var(--accent-line);
  color: var(--accent-bright);
  background: var(--accent-softer);
}

.btn.danger {
  border-color: rgba(255, 107, 129, 0.35);
  background: rgba(255, 107, 129, 0.08);
  color: #ffa9b6;
}

.btn.danger:hover {
  background: rgba(255, 107, 129, 0.16);
  border-color: var(--bad);
}

.foot-meta {
  max-width: 1480px;
  margin: 0 auto;
  padding: 14px clamp(14px, 3vw, 34px) 24px;
  border-top: 1px solid rgba(126, 166, 214, 0.08);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  color: var(--dim);
}

.foot-sources {
  flex: 1;
}

.foot-privacy {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(2, 4, 8, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s;
}

.drawer-backdrop.open {
  opacity: 1;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 110;
  display: flex;
  flex-direction: column;
  width: min(430px, 100vw);
  height: 100dvh;
  background: linear-gradient(180deg, #0a1019, #060a12);
  border-left: 1px solid var(--line-strong);
  box-shadow: -30px 0 80px -30px #000;
  transform: translateX(102%);
  transition: transform 0.32s cubic-bezier(0.22, 0.8, 0.24, 1);
  visibility: hidden;
}

.drawer.open {
  transform: translateX(0);
  visibility: visible;
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 7, 13, 0.5);
}

.drawer-head h2 {
  font-size: 22px;
  letter-spacing: -0.02em;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 20px;
  scrollbar-width: thin;
}

.drawer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--dim);
  background: rgba(4, 7, 13, 0.6);
}

.drawer-foot a {
  color: var(--muted);
}

.drawer-foot a:hover {
  color: var(--accent-bright);
}

.set-block {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.set-block:last-child {
  border-bottom: 0;
}

.set-block h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-family: var(--mono);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.set-block h3 .num {
  color: var(--accent);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.set-note {
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--dim);
  margin-bottom: 10px;
}

.loc-current {
  padding: 9px 12px;
  margin-bottom: 8px;
  border-radius: 9px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  font-size: 11.5px;
  color: var(--ink-soft);
}

.loc-search,
.field-row {
  display: flex;
  gap: 7px;
}

.loc-search input,
.field-row input,
.field-col input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: rgba(5, 9, 16, 0.8);
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.loc-search input:focus,
.field-row input:focus,
.field-col input:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-softer);
}

.loc-results {
  display: grid;
  gap: 3px;
  margin-top: 7px;
}

.loc-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  text-align: left;
  font-size: 11.5px;
  color: var(--ink-soft);
  transition: background 0.16s, border-color 0.16s;
}

.loc-result:hover {
  background: var(--accent-softer);
  border-color: var(--accent-line);
}

.loc-result span {
  font-size: 9.5px;
  color: var(--dim);
}

.theme-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: hsl(var(--sw) 90% 58%);
  box-shadow: 0 0 12px hsl(var(--sw) 90% 58% / 0.35), inset 0 0 0 3px rgba(4, 7, 13, 0.7);
  transition: transform 0.16s, border-color 0.16s;
}

.swatch:hover {
  transform: scale(1.1);
}

.swatch.active {
  border-color: #fff;
  box-shadow: 0 0 0 3px hsl(var(--sw) 90% 58% / 0.35), 0 0 16px hsl(var(--sw) 90% 58% / 0.5);
}

.range-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
  margin: 10px 0;
}

.range-row output {
  font-family: var(--mono);
  font-size: 10px;
  text-align: right;
  color: var(--dim);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, hsl(0 90% 60%), hsl(60 90% 60%), hsl(120 90% 60%), hsl(180 90% 60%), hsl(240 90% 60%), hsl(300 90% 60%), hsl(360 90% 60%));
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid hsl(var(--h) 90% 58%);
  box-shadow: 0 0 10px hsl(var(--h) 90% 58% / 0.6);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid hsl(var(--h) 90% 58%);
  cursor: pointer;
}

.module-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 12px;
}

.field-col {
  display: grid;
  gap: 5px;
  font-size: 10.5px;
  color: var(--dim);
}

.palette-backdrop,
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: start center;
  padding: clamp(50px, 12vh, 140px) 16px 24px;
  background: rgba(2, 4, 8, 0.66);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.2s;
}

.palette-backdrop[hidden],
.modal-backdrop[hidden] {
  display: none;
}

.palette-backdrop.open,
.modal-backdrop.open {
  opacity: 1;
}

.palette {
  width: min(620px, 100%);
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #0d1422, #080d17);
  box-shadow: 0 40px 100px -30px #000, 0 0 0 1px rgba(255, 255, 255, 0.03);
  overflow: hidden;
  transform: translateY(-12px) scale(0.985);
  transition: transform 0.2s;
}

.palette-backdrop.open .palette {
  transform: translateY(0) scale(1);
}

.palette-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.palette-ic {
  width: 19px;
  height: 19px;
  color: var(--accent);
  flex: 0 0 auto;
}

.palette-ic svg {
  width: 100%;
  height: 100%;
}

#palette-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 14.5px;
  color: var(--ink);
}

#palette-input::placeholder {
  color: var(--dim);
}

.palette-head kbd,
.palette-foot {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  color: var(--dim);
}

.palette-head kbd {
  padding: 2px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
}

.palette-list {
  max-height: min(380px, 50vh);
  overflow-y: auto;
  padding: 7px;
  scrollbar-width: thin;
}

.pal-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 9px;
  border: 1px solid transparent;
  text-align: left;
  color: var(--ink-soft);
  transition: background 0.12s, border-color 0.12s;
}

.pal-item .pi-ic {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--accent);
  flex: 0 0 auto;
}

.pal-item .pi-ic svg {
  width: 15px;
  height: 15px;
}

.pal-item .pi-meta {
  flex: 1;
  min-width: 0;
}

.pal-item .pi-meta b {
  display: block;
  font-size: 12px;
  font-weight: 500;
}

.pal-item .pi-meta span {
  display: block;
  font-size: 9.5px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pal-item kbd {
  font-size: 8px;
  color: var(--dim);
}

.pal-item.active {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.palette-foot {
  display: flex;
  gap: 16px;
  padding: 9px 16px;
  border-top: 1px solid var(--line);
  background: rgba(4, 7, 13, 0.4);
}

.modal {
  width: min(560px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #0d1422, #080d17);
  box-shadow: 0 40px 100px -30px #000;
  transform: translateY(-12px) scale(0.985);
  transition: transform 0.2s;
  scrollbar-width: thin;
}

.modal-backdrop.open .modal {
  transform: translateY(0) scale(1);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: #0b111c;
  z-index: 2;
}

.modal-head h2 {
  font-size: 18px;
}

.modal-body {
  padding: 18px 20px 24px;
}

.modal-body h3 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 16px 0 4px;
}

.modal-body p {
  font-size: 12px;
  color: var(--muted);
}

.start-url {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px 9px 13px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: rgba(5, 9, 16, 0.75);
  margin: 10px 0 4px;
}

.start-url code {
  flex: 1;
  min-width: 0;
  font-size: 10.5px;
  color: var(--ink-soft);
  overflow-x: auto;
  white-space: nowrap;
}

#toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 220;
  display: grid;
  gap: 8px;
  width: min(340px, calc(100vw - 36px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  border-left: 2px solid var(--accent);
  background: rgba(10, 16, 27, 0.96);
  box-shadow: 0 16px 40px -16px #000;
  font-size: 12px;
  color: var(--ink-soft);
  pointer-events: auto;
  animation: toast-in 0.28s ease both;
}

.toast.warn { border-left-color: var(--warn); }
.toast.bad { border-left-color: var(--bad); }
.toast .dot { margin-top: 5px; }

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

.noscript {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 400;
  max-width: 90vw;
  padding: 12px 18px;
  border-radius: 10px;
  border: 1px solid var(--warn);
  background: #141005;
  color: #ffe6a8;
  font-size: 12px;
}

html.reduce-fx .bg-grid,
html.reduce-fx .bg-scan::after,
html.reduce-fx .orbit-ring,
html.reduce-fx .bm-a,
html.reduce-fx .ticker-track,
html.reduce-fx .sys-bars i {
  animation: none !important;
}

html.reduce-fx #bg3d {
  opacity: 0.55;
}

html.reduce-fx .ticker-view {
  overflow-x: auto;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(126, 166, 214, 0.18);
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(126, 166, 214, 0.32);
  background-clip: padding-box;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(126, 166, 214, 0.22) transparent;
}

@media (max-width: 1180px) {
  .panel-weather { grid-column: span 6; }
  .panel-ai { grid-column: span 6; }
  .panel-stocks { grid-column: span 4; }
  .panel-fuel { grid-column: span 4; }
  .panel-calendar { grid-column: span 4; }
  .panel-news { grid-column: span 12; }
  .panel-links { grid-column: span 12; }
  .sys-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 980px) {
  #hero {
    grid-template-columns: 1fr;
  }
  .hero-orbit {
    display: none;
  }
  .panel-stocks { grid-column: span 6; }
  .panel-fuel { grid-column: span 6; }
  .panel-calendar { grid-column: span 12; }
  .panel-weather { grid-column: span 12; }
  .panel-ai { grid-column: span 12; }
  .chat { max-height: 380px; }
  .foot-main {
    grid-template-columns: 1fr 1fr;
  }
  .foot-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  #topbar {
    grid-template-columns: auto 1fr;
    gap: 10px 14px;
    padding: 10px 14px;
  }
  .brand { grid-column: 1; grid-row: 1; }
  .top-right { grid-column: 2; grid-row: 1; justify-self: end; }
  .search {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: none;
  }
  .clock { display: none; }
  .top-status { display: none; }
  #hero {
    padding-top: 28px;
  }
  .sys-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  :root { --topbar-h: 112px; }
  body { font-size: 14px; }
  #main { padding: 0 12px; }
  #topbar { padding: 9px 12px; }
  .brand-text small { display: none; }
  .brand-text b { font-size: 15px; }
  .brand-mark { width: 34px; height: 34px; }
  .icon-btn { width: 34px; height: 34px; }
  .icon-btn svg { width: 17px; height: 17px; }
  .search { height: 42px; }
  .search-kbd { display: none; }
  #hero {
    min-height: 0;
    padding: 22px 0 26px;
  }
  #hero-title { font-size: clamp(32px, 9vw, 44px); }
  .hero-sub { margin-top: 12px; font-size: 12.5px; }
  .hero-meta { margin-top: 18px; gap: 6px; }
  .meta-chip { height: 31px; font-size: 10.5px; padding: 0 10px; }
  #ticker { height: 38px; margin-bottom: 14px; }
  .ticker-all { display: none; }
  .ticker-label { padding: 0 12px; }
  .ticker-track { gap: 28px; animation-duration: 50s; }
  .ticker-track span { font-size: 11px; }
  #dashboard { gap: 12px; }
  .panel-weather,
  .panel-ai,
  .panel-stocks,
  .panel-fuel,
  .panel-calendar,
  .panel-news,
  .panel-links,
  .panel-system { grid-column: span 12; }
  .panel { border-radius: 15px; }
  .panel-head { padding: 12px 13px; }
  .panel-body { padding: 13px; }
  .ph-icon { width: 30px; height: 30px; border-radius: 9px; }
  .ph-icon svg { width: 15px; height: 15px; }
  .ph-left small { max-width: 24ch; }
  .chat { min-height: 230px; max-height: 330px; padding: 13px; }
  .msg { max-width: 94%; font-size: 13px; }
  .chips { padding: 0 13px 10px; }
  .chat-form { padding: 10px 11px 12px; }
  .chat-hint { display: none; }
  .wx-temp { font-size: 46px; }
  .wx-icon { width: 58px; height: 58px; }
  .wx-stats { grid-template-columns: repeat(3, 1fr); }
  .wx-stat { padding: 8px; }
  .wx-day { grid-template-columns: 38px 18px minmax(40px, 1fr) 78px; gap: 7px; }
  .fuel-row { grid-template-columns: 1fr; gap: 6px; }
  .fuel-prices { justify-content: flex-start; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .sys-grid { grid-template-columns: 1fr 1fr; }
  .foot-main { grid-template-columns: 1fr; gap: 18px; }
  .foot-actions { grid-column: auto; }
  .foot-meta { flex-direction: column; align-items: flex-start; gap: 6px; }
  .drawer { width: 100vw; }
  .palette-backdrop { padding-top: 18vh; }
  .module-grid { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
  .brand-text b { font-size: 13px; letter-spacing: 0.22em; }
  .tiles { grid-template-columns: 1fr; }
  .sys-grid { grid-template-columns: 1fr; }
  .wx-stats { grid-template-columns: 1fr 1fr; }
}

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