@font-face {
  font-family: "D2Coding";
  src: url("/static/assets/fonts/D2Coding.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --desktop-bg: #07111f;
  --desktop-bg-deep: #050d18;
  --panel-bg: rgba(7, 17, 31, 0.94);
  --window-bg: #0d1928;
  --window-bg-soft: #101e2f;
  --titlebar-bg: #111c2a;
  --titlebar-active: #15263a;
  --surface: #0a1522;
  --surface-raised: #112134;
  --border: #26384b;
  --border-soft: #1b2b3e;
  --text-primary: #d8e2ee;
  --text-secondary: #91a0b3;
  --text-muted: #65768a;
  --accent-green: #8be33f;
  --accent-green-soft: rgba(139, 227, 63, 0.14);
  --accent-blue: #35a7ff;
  --accent-blue-soft: rgba(53, 167, 255, 0.14);
  --warning: #f5c451;
  --danger: #ef6262;
  --success: #75d93b;
  --panel-height: 58px;
  --window-radius: 7px;
  --shadow: 0 20px 60px rgba(1, 8, 17, 0.52), 0 4px 14px rgba(1, 8, 17, 0.38);
  --font-ui:
    "Pretendard",
    "Noto Sans KR",
    "IBM Plex Sans KR",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  --font-mono: "D2Coding",
    "Noto Sans Mono CJK KR",
    "Cascadia Mono",
    "Consolas",
    monospace;
  /* --font-mono: "Cascadia Code", "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace; */
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--desktop-bg);
  color: var(--text-primary);
  font-family: var(--font-ui);
}

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

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  /* outline: 2px solid var(--accent-blue);
  outline-offset: 2px; */
  outline: none;
}

.web-desktop {
  width: 100%;
  height: 100%;
  background: var(--desktop-bg);
}

.top-panel {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  height: var(--panel-height);
  padding: 0 18px 0 10px;
  border-bottom: 1px solid rgba(79, 112, 146, 0.2);
  background:
    linear-gradient(180deg, rgba(14, 27, 43, 0.98), rgba(6, 16, 28, 0.96)),
    var(--panel-bg);
  box-shadow: 0 8px 24px rgba(2, 10, 20, 0.24);
  backdrop-filter: blur(16px);
}

.top-panel__launchers {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 100%;
}

.brand-launcher,
.launcher-button {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid transparent;
  background: transparent;
}

.brand-launcher {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  cursor: default;
  user-select: none;
}

.launcher-button {
  cursor: pointer;
}

.brand-launcher img {
  display: block;
}

.panel-divider {
  width: 1px;
  height: 30px;
  margin: 0 9px 0 5px;
  background: linear-gradient(180deg, transparent, var(--border), transparent);
}

.app-launchers {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  height: 100%;
}

.launcher-button {
  width: 43px;
  height: 43px;
  border-radius: 8px;
  border-color: rgba(89, 120, 153, 0.24);
  background: linear-gradient(180deg, rgba(19, 35, 53, 0.85), rgba(8, 19, 31, 0.85));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease, opacity 180ms ease;
}

.launcher-button:hover,
.launcher-button:focus-visible {
  border-color: rgba(53, 167, 255, 0.55);
  background: linear-gradient(180deg, rgba(24, 48, 72, 0.95), rgba(9, 24, 39, 0.95));
  transform: translateY(-1px);
}

.launcher-button.is-running::after,
.launcher-button.is-minimized::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--accent-blue);
  box-shadow: 0 0 10px rgba(53, 167, 255, 0.75);
  transform: translateX(-50%);
}

.launcher-button.is-active {
  border-color: rgba(139, 227, 63, 0.72);
  background: linear-gradient(180deg, rgba(34, 61, 54, 0.95), rgba(10, 30, 33, 0.96));
}

.launcher-button.is-active::after {
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent-green);
  box-shadow: 0 0 10px rgba(139, 227, 63, 0.6);
}

.launcher-button.is-minimized {
  opacity: 0.72;
}

.launcher-button.is-minimized::after {
  background: var(--warning);
  box-shadow: 0 0 10px rgba(245, 196, 81, 0.58);
}

.launcher-button__icon,
.window-titlebar__icon,
.inline-icon {
  display: inline-grid;
  place-items: center;
}

.launcher-button__icon svg,
.window-titlebar__icon svg,
.inline-icon svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.launcher-button__tooltip {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  z-index: 10001;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #111b28;
  color: var(--text-primary);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -5px);
  transition: opacity 150ms ease, transform 150ms ease;
  box-shadow: 0 8px 22px rgba(2, 9, 18, 0.42);
}

.launcher-button__tooltip::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -5px;
  width: 8px;
  height: 8px;
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  background: #111b28;
  transform: translateX(-50%) rotate(45deg);
}

.launcher-button:hover .launcher-button__tooltip,
.launcher-button:focus-visible .launcher-button__tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.system-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
}

.system-status__item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.system-status__label {
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.system-status__separator {
  width: 1px;
  height: 18px;
  background: rgba(139, 227, 63, 0.45);
}

.health {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}

.health__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  box-shadow: 0 0 0 0 rgba(101, 118, 138, 0.4);
}

.health--ok {
  color: var(--success);
}

.health--ok .health__dot {
  background: var(--success);
  animation: healthPulse 1.8s ease-in-out infinite;
}

.health--warning {
  color: var(--warning);
}

.health--warning .health__dot {
  background: var(--warning);
}

.health--error {
  color: var(--danger);
}

.health--error .health__dot {
  background: var(--danger);
}

.desktop-area {
  position: fixed;
  inset: var(--panel-height) 0 0;
  overflow: hidden;
  isolation: isolate;
  background: var(--desktop-bg);
}

.desktop-background,
.window-layer {
  position: absolute;
  inset: 0;
}

.desktop-background {
  overflow: hidden;
  background:
    radial-gradient(circle at 70% 16%, rgba(27, 83, 139, 0.18), transparent 30%),
    radial-gradient(circle at 20% 78%, rgba(18, 74, 126, 0.18), transparent 34%),
    linear-gradient(135deg, #06101d 0%, #08192d 48%, #07111f 100%);
}

.desktop-background__grid {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(80, 126, 168, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80, 126, 168, 0.12) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), transparent 90%);
}

.desktop-background__arc {
  position: absolute;
  border: 1px solid rgba(53, 167, 255, 0.25);
  border-radius: 50%;
  box-shadow: inset 0 0 70px rgba(53, 167, 255, 0.05), 0 0 38px rgba(53, 167, 255, 0.05);
}

.desktop-background__arc--one {
  width: 980px;
  height: 410px;
  left: -160px;
  top: -240px;
  transform: rotate(12deg);
}

.desktop-background__arc--two {
  width: 860px;
  height: 360px;
  right: -250px;
  bottom: -170px;
  transform: rotate(31deg);
}

.desktop-background__glow {
  position: absolute;
  width: 440px;
  height: 440px;
  left: 44%;
  top: 20%;
  border-radius: 50%;
  background: rgba(22, 95, 162, 0.1);
  filter: blur(100px);
}

.window-layer {
  pointer-events: none;
}

.app-window {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 360px;
  min-height: 260px;
  overflow: hidden;
  border: 1px solid rgba(62, 84, 106, 0.68);
  border-radius: var(--window-radius);
  background: var(--window-bg);
  box-shadow: var(--shadow);
  pointer-events: auto;
  opacity: 0.91;
  transform-origin: center;
  transition: border-color 180ms ease, opacity 180ms ease, box-shadow 180ms ease;
}

.app-window.is-opening {
  animation: windowOpen 200ms ease-out both;
}

.app-window.is-minimizing {
  animation: windowMinimize 180ms ease-in both;
  pointer-events: none !important;
}

/* Keep minimized windows out of painting and hit testing on every viewport. */
.app-window.is-minimized,
.app-window[hidden] {
  display: none !important;
  pointer-events: none !important;
}

.app-window.is-active {
  border-color: rgba(77, 121, 159, 0.92);
  box-shadow: 0 26px 74px rgba(1, 8, 17, 0.6), 0 0 0 1px rgba(53, 167, 255, 0.09);
  opacity: 1;
}

.app-window.is-maximized {
  border-radius: 0;
  transition: inset 180ms ease, width 180ms ease, height 180ms ease, border-radius 180ms ease;
}

.window-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 42px;
  min-width: 0;
  padding: 0 6px 0 13px;
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(180deg, #142234 0%, var(--titlebar-bg) 100%);
  user-select: none;
  touch-action: none;
  cursor: move;
}

.app-window.is-active .window-titlebar {
  background: linear-gradient(180deg, #1a2d43 0%, var(--titlebar-active) 100%);
}

.app-window.is-maximized .window-titlebar {
  cursor: default;
}

.window-titlebar__identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 9px;
}

.window-titlebar__icon {
  flex: 0 0 auto;
  color: var(--accent-blue);
}

.window-titlebar__icon svg {
  width: 18px;
  height: 18px;
}

.window-titlebar__title {
  overflow: hidden;
  margin: 0;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.window-titlebar__controls {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.window-control {
  display: grid;
  place-items: center;
  width: 40px;
  height: 31px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 20px;
  line-height: 1;
}

.window-control:hover,
.window-control:focus-visible {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
}

.window-control--close:hover,
.window-control--close:focus-visible {
  background: rgba(239, 98, 98, 0.82);
  color: #f8fbff;
}

.window-content {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(11, 24, 39, 0.94), rgba(8, 20, 33, 0.96)),
    var(--window-bg);
}

/* About and News own their internal scrolling so fixed controls remain visible. */
.window-content--terminal,
.window-content--news {
  overflow: hidden;
}

.resize-handle {
  position: absolute;
  z-index: 3;
}

.resize-handle--n,
.resize-handle--s {
  left: 8px;
  right: 8px;
  height: 7px;
  cursor: ns-resize;
}

.resize-handle--n { top: -3px; }
.resize-handle--s { bottom: -3px; }

.resize-handle--e,
.resize-handle--w {
  top: 8px;
  bottom: 8px;
  width: 7px;
  cursor: ew-resize;
}

.resize-handle--e { right: -3px; }
.resize-handle--w { left: -3px; }

.resize-handle--ne,
.resize-handle--se,
.resize-handle--sw,
.resize-handle--nw {
  width: 12px;
  height: 12px;
}

.resize-handle--ne { top: -4px; right: -4px; cursor: nesw-resize; }
.resize-handle--se { right: -4px; bottom: -4px; cursor: nwse-resize; }
.resize-handle--sw { left: -4px; bottom: -4px; cursor: nesw-resize; }
.resize-handle--nw { top: -4px; left: -4px; cursor: nwse-resize; }

.app-shell {
  min-height: 100%;
  padding: 16px;
  color: var(--text-primary);
}

.app-toolbar,
.field-row,
.action-row,
.filter-row,
.table-tabs,
.news-filters {
  display: flex;
  align-items: center;
  gap: 9px;
}

.app-toolbar,
.filter-row {
  flex-wrap: wrap;
}

.field,
.field-stack {
  display: flex;
  gap: 7px;
}

.field {
  align-items: center;
}

.field-stack {
  flex-direction: column;
  align-items: stretch;
}

.field-label,
.section-label,
.mono-label {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
}

.input,
.select,
.textarea,
.search-input {
  width: 100%;
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  background: #091522;
  color: var(--text-primary);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.input,
.select,
.search-input {
  min-height: 36px;
  padding: 0 11px;
}

.select {
  cursor: pointer;
}

.textarea {
  min-height: 138px;
  padding: 12px;
  resize: none;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
}

.input::placeholder,
.textarea::placeholder,
.search-input::placeholder {
  color: #5d6e82;
}

.input:focus,
.select:focus,
.textarea:focus,
.search-input:focus {
  border-color: rgba(53, 167, 255, 0.7);
  outline: 0;
  background: #0b1928;
  box-shadow: 0 0 0 3px rgba(53, 167, 255, 0.1);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: linear-gradient(180deg, #14243a, #0d1b2d);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.btn:hover,
.btn:focus-visible {
  border-color: #45627d;
  background: linear-gradient(180deg, #1a304b, #10243a);
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  border-color: rgba(139, 227, 63, 0.45);
  background: linear-gradient(180deg, rgba(52, 88, 37, 0.95), rgba(22, 54, 32, 0.95));
  color: var(--accent-green);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  border-color: var(--accent-green);
  background: linear-gradient(180deg, rgba(63, 105, 43, 0.98), rgba(27, 66, 38, 0.98));
}

.btn--ghost {
  background: transparent;
}

.btn--danger {
  border-color: rgba(239, 98, 98, 0.42);
  color: #ffaaaa;
}

.status-line {
  display: flex;
  align-items: center;
  min-height: 28px;
  gap: 8px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
}

.status-line::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-line.is-success::before { background: var(--success); }
.status-line.is-error::before { background: var(--danger); }
.status-line.is-working::before {
  background: var(--accent-blue);
  animation: healthPulse 1s ease-in-out infinite;
}

/* About terminal */
.terminal-app {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 17px 18px 14px;
  background:
    radial-gradient(circle at 90% 0%, rgba(53, 167, 255, 0.06), transparent 33%),
    #07131f;
  color: #cbd6e2;
  font-family: var(--font-mono);
}

.terminal-output {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 5px;
  scrollbar-color: #2e475d transparent;
  scrollbar-width: thin;
}

.terminal-entry {
  margin: 0 0 15px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.62;
}

.terminal-entry--banner {
  color: var(--accent-green);
  letter-spacing: 0.35em;
  font-weight: 700;
}

.terminal-entry--muted {
  color: var(--text-secondary);
}

.terminal-entry--command {
  color: var(--accent-green);
}

.terminal-entry--error {
  color: #ff9292;
}

.terminal-entry--output {
  padding-left: 15px;
  border-left: 1px solid rgba(139, 227, 63, 0.72);
}

.terminal-prompt-prefix {
  color: var(--accent-green);
}

.terminal-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 34px;
  gap: 8px;
  border-top: 1px solid rgba(38, 56, 75, 0.55);
  padding-top: 10px;
}

.terminal-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  caret-color: var(--accent-green);
  font-family: var(--font-mono);
  font-size: 13px;
}

.command-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 9px);
  z-index: 10;
  max-height: 265px;
  overflow: auto;
  padding: 6px;
  border: 1px solid #334a60;
  border-radius: 7px;
  background: rgba(12, 27, 43, 0.98);
  box-shadow: 0 18px 45px rgba(1, 8, 17, 0.56);
  animation: menuIn 150ms ease-out both;
}

.command-menu[hidden] {
  display: none;
}

.command-menu__item {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr);
  width: 100%;
  gap: 12px;
  padding: 9px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.command-menu__item:hover,
.command-menu__item.is-selected {
  background: rgba(53, 167, 255, 0.13);
}

.command-menu__name {
  color: var(--accent-green);
  font-family: var(--font-mono);
}

.command-menu__description {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Tools */
.tools-app {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  gap: 13px;
}

.mode-tabs,
.table-tabs,
.news-filters {
  flex: 0 0 auto;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.mode-tab,
.table-tab,
.filter-chip {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border-soft);
  background: #0a1725;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
}

.mode-tab:first-child,
.table-tab:first-child {
  border-radius: 5px 0 0 5px;
}

.mode-tab:last-child,
.table-tab:last-child {
  border-radius: 0 5px 5px 0;
}

.mode-tab + .mode-tab,
.table-tab + .table-tab {
  margin-left: -1px;
}

.mode-tab:hover,
.table-tab:hover,
.filter-chip:hover {
  color: var(--text-primary);
  background: #102136;
}

.mode-tab.is-active,
.table-tab.is-active,
.filter-chip.is-active {
  position: relative;
  z-index: 1;
  border-color: rgba(139, 227, 63, 0.56);
  background: var(--accent-green-soft);
  color: var(--accent-green);
}

.tools-option-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: rgba(8, 19, 31, 0.68);
  animation: panelFade 180ms ease-out both;
  align-items: end;
}

.tools-io-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
  gap: 12px;
}

.tools-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  gap: 7px;
}

.tools-pane .textarea {
  flex: 1 1 auto;
  min-height: 150px;
}

.tools-pane__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tools-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.prototype-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.45;
}


.checkbox-field {
  display: flex;
  align-items: center;
  min-height: 36px;
  height: 36px;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  background: rgba(12, 28, 45, 0.48);
  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox-field input {
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--accent-green);
}

.checkbox-field__body {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 3px;
}

.checkbox-field__body strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}

.checkbox-field__body small {
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.35;
}

.checkbox-field:hover {
  border-color: rgba(139, 227, 63, 0.42);
  background: rgba(18, 39, 62, 0.82);
}

/* Table */
.table-app {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  gap: 11px;
}

.table-toolbar {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto auto;
  gap: 9px;
}

.table-shell {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  scrollbar-color: #2d455b #091421;
  scrollbar-width: thin;
}

.data-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 12px;
}

.data-table th,
.data-table td {
  padding: 0;
  border-right: 1px solid rgba(38, 56, 75, 0.62);
  border-bottom: 1px solid rgba(38, 56, 75, 0.62);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  padding: 10px 12px;
}

.cell-copy-button {
  display: block;
  width: 100%;
  min-height: 38px;
  padding: 9px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: copy;
  font: inherit;
  text-align: left;
  white-space: pre-wrap;
}

.cell-copy-button:hover,
.cell-copy-button:focus-visible {
  background: rgba(139, 227, 63, 0.08);
  color: var(--text-primary);
  outline: none;
}

.data-table th:last-child,
.data-table td:last-child {
  border-right: 0;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #132236;
  color: var(--accent-green);
  cursor: pointer;
  white-space: nowrap;
}

.data-table tbody tr {
  background: rgba(8, 20, 33, 0.7);
  cursor: pointer;
}

.data-table tbody tr:nth-child(even) {
  background: rgba(12, 27, 43, 0.72);
}

.data-table tbody tr:hover,
.data-table tbody tr.is-selected {
  background: rgba(53, 167, 255, 0.12);
}

.table-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: rgba(8, 19, 31, 0.72);
}

.table-detail__values {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  min-width: 0;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
}

.table-detail__values strong {
  color: var(--text-primary);
  font-weight: 500;
}

.table-detail__source {
  color: var(--text-muted);
}

.column-picker {
  position: relative;
}

.column-picker__menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 20;
  min-width: 190px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #0d1b2b;
  box-shadow: 0 14px 35px rgba(1, 8, 17, 0.5);
}

.column-picker__menu[hidden] {
  display: none;
}

.column-picker__option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* News */
.news-app {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  gap: 11px;
}

.filter-chip {
  border-radius: 999px;
}

.news-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 155px auto;
  flex: 0 0 auto;
  gap: 9px;
}

.news-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(250px, 0.75fr);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: "list detail";
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  gap: 12px;
}

.news-list,
.news-detail {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: rgba(8, 19, 31, 0.65);
  scrollbar-width: thin;
}

.news-list {
  grid-area: list;
  padding: 8px;
}

.news-detail {
  grid-area: detail;
}

.news-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  width: 100%;
  gap: 11px;
  margin: 0 0 8px;
  padding: 11px;
  border: 1px solid rgba(38, 56, 75, 0.72);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(15, 32, 50, 0.88), rgba(8, 20, 33, 0.88));
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.news-card:hover,
.news-card.is-selected {
  border-color: rgba(53, 167, 255, 0.52);
  background: linear-gradient(180deg, rgba(19, 42, 64, 0.95), rgba(10, 27, 43, 0.94));
}

.news-card__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(53, 167, 255, 0.28);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(53, 167, 255, 0.18), rgba(139, 227, 63, 0.08)),
    #0a1827;
  color: var(--accent-blue);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
}

.news-card__favicon {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: contain;
}

.news-card__icon--fallback {
  font-size: 13px;
}

.news-card__title {
  display: block;
  margin-bottom: 5px;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.news-card__summary {
  display: -webkit-box;
  overflow: hidden;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.news-card__meta,
.news-detail__meta {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.news-detail {
  padding: 16px;
}

.news-detail__eyebrow {
  margin: 0 0 8px;
  color: var(--accent-green);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
}

.news-detail h3 {
  margin: 0 0 10px;
  font-size: 17px;
  line-height: 1.4;
}

.news-detail p {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.65;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0;
}

.tag {
  padding: 4px 7px;
  border: 1px solid rgba(53, 167, 255, 0.25);
  border-radius: 999px;
  background: rgba(53, 167, 255, 0.08);
  color: #8fcfff;
  font-family: var(--font-mono);
  font-size: 10px;
}

.empty-state,
.loading-state,
.error-state {
  display: grid;
  place-items: center;
  min-height: 160px;
  padding: 24px;
  color: var(--text-secondary);
  text-align: center;
  font-size: 12px;
}

.loading-state::before {
  content: "";
  width: 24px;
  height: 24px;
  margin-bottom: 10px;
  border: 2px solid rgba(53, 167, 255, 0.18);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.toast-region {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-width: 220px;
  max-width: 360px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(12, 27, 43, 0.96);
  color: var(--text-primary);
  box-shadow: 0 14px 36px rgba(1, 8, 17, 0.5);
  font-size: 12px;
  animation: toastIn 180ms ease-out both;
}

.toast--error {
  border-color: rgba(239, 98, 98, 0.5);
}

@keyframes healthPulse {
  0%, 100% { box-shadow: 0 0 0 0 currentColor; opacity: 0.75; }
  50% { box-shadow: 0 0 0 5px transparent; opacity: 1; }
}

@keyframes windowOpen {
  from { opacity: 0; transform: scale(0.97) translateY(7px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes windowMinimize {
  from { opacity: 1; transform: scale(1) translateY(0); }
  to { opacity: 0; transform: scale(0.88) translateY(-32px); }
}

@keyframes menuIn {
  from { opacity: 0; transform: translateY(5px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes panelFade {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

@media (max-width: 980px) {
  .system-status__label,
  .system-status__ip,
  .system-status__separator:nth-of-type(2) {
    display: none;
  }

  .tools-option-panel {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .news-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      "detail"
      "list";
  }

  .news-detail {
    max-height: min(34vh, 300px);
  }
}

@media (max-width: 720px) {
  :root {
    --panel-height: 54px;
  }

  .top-panel {
    padding: 0 8px;
  }

  .brand-launcher {
    width: 42px;
    height: 42px;
  }

  .brand-launcher img {
    width: 30px;
    height: 30px;
  }

  .panel-divider {
    margin-inline: 3px 7px;
  }

  .app-launchers {
    max-width: calc(100vw - 175px);
    overflow-x: auto;
    gap: 7px;
    scrollbar-width: none;
  }

  .app-launchers::-webkit-scrollbar {
    display: none;
  }

  .launcher-button {
    width: 39px;
    height: 39px;
  }

  .system-status {
    gap: 8px;
    font-size: 11px;
  }

  .system-status__separator,
  .system-status__ip,
  #health-label {
    display: none;
  }

  .app-window {
    inset: 7px !important;
    width: auto !important;
    height: auto !important;
    min-width: 0;
    min-height: 0;
    border-radius: 6px;
  }


  .window-titlebar {
    cursor: default;
  }

  .resize-handle {
    display: none;
  }

  .app-shell {
    padding: 11px;
  }

  .tools-option-panel {
    grid-template-columns: 1fr 1fr;
  }

  .tools-io-grid {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .tools-pane .textarea {
    min-height: 130px;
  }

  .table-toolbar,
  .news-toolbar {
    grid-template-columns: 1fr;
  }

  .table-detail {
    grid-template-columns: 1fr;
  }

  /*
   * Mobile News layout
   *
   * Keep the detail panel above the list, but do not size it from the full
   * viewport height. The News window has already lost space to the browser UI,
   * top panel, title bar, filters, and toolbar. Dividing the remaining layout
   * height guarantees that a usable portion of the list is always visible.
   */
  .window-content--news .app-shell {
    padding: 9px;
  }

  .news-app {
    gap: 8px;
  }

  .news-filters {
    flex-wrap: nowrap;
    min-height: 34px;
    padding-bottom: 0;
  }

  .news-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
  }

  .news-toolbar .search-input {
    grid-column: 1 / -1;
  }

  .news-toolbar .select {
    min-width: 0;
  }

  .news-layout {
    grid-template-rows: minmax(0, 0.72fr) minmax(120px, 1fr);
    gap: 8px;
  }

  .news-detail {
    max-height: none;
    padding: 10px 12px;
    overscroll-behavior: contain;
  }

  .news-detail__eyebrow {
    margin-bottom: 4px;
  }

  .news-detail h3 {
    display: -webkit-box;
    overflow: hidden;
    margin-bottom: 5px;
    font-size: 14px;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .news-detail p:not(.news-detail__eyebrow) {
    display: -webkit-box;
    overflow: hidden;
    margin: 6px 0;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .news-detail .tag-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 7px 0;
    padding-bottom: 1px;
    scrollbar-width: none;
  }

  .news-detail .tag-list::-webkit-scrollbar {
    display: none;
  }

  .news-detail .tag {
    flex: 0 0 auto;
  }

  .news-detail .btn {
    min-height: 32px;
    padding-block: 6px;
  }

  /* Loading/error messages already appear in the panels on mobile. */
  .news-app > .status-line {
    display: none;
  }
}

@media (max-width: 720px) and (max-height: 700px) {
  .news-layout {
    grid-template-rows: minmax(88px, 0.58fr) minmax(112px, 1fr);
  }

  .news-detail h3,
  .news-detail p:not(.news-detail__eyebrow) {
    -webkit-line-clamp: 1;
  }

  .news-detail .tag-list {
    display: none;
  }
}

@media (max-width: 460px) {
  .brand-launcher {
    display: none;
  }

  .panel-divider {
    display: none;
  }

  .app-launchers {
    max-width: calc(100vw - 78px);
  }

  .tools-option-panel {
    grid-template-columns: 1fr;
  }

  .window-control {
    width: 36px;
  }
}

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


/* Theme transition */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 240ms;
  animation-timing-function: ease;
}

html.is-theme-transitioning *,
html.is-theme-transitioning *::before,
html.is-theme-transitioning *::after {
  transition-property: background-color, border-color, color, fill, stroke, box-shadow !important;
  transition-duration: 240ms !important;
  transition-timing-function: ease !important;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.01ms;
  }

  html.is-theme-transitioning *,
  html.is-theme-transitioning *::before,
  html.is-theme-transitioning *::after {
    transition-duration: 0.01ms !important;
  }
}

/* About structured command responses */
.terminal-entry--structured {
  display: grid;
  gap: 8px;
}

.terminal-response-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  min-height: 24px;
  gap: 10px;
}

.terminal-response-row--muted {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
}

.terminal-response-label {
  color: var(--text-secondary);
}

.terminal-response-value {
  min-width: 0;
  overflow-wrap: anywhere;
}

.terminal-response-value--invalid {
  color: var(--danger);
}

.terminal-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  gap: 7px;
  color: var(--accent-blue);
  text-decoration: none;
  text-underline-offset: 3px;
  transition:
    color 160ms ease,
    transform 160ms ease,
    text-decoration-color 160ms ease;
}

.terminal-link:hover {
  color: var(--accent-green);
  text-decoration: underline;
}

.terminal-link:focus-visible {
  outline: 1px solid var(--accent-blue);
  outline-offset: 4px;
  border-radius: 3px;
}

.terminal-link__icon {
  display: inline-flex;
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
}

.terminal-link__icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.terminal-link__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .terminal-response-row {
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 8px;
  }
}

/* =========================================================
   Top-panel controls and light theme recovery
   ========================================================= */

.theme-toggle,
.health__indicator {
  -webkit-appearance: none;
  appearance: none;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.theme-toggle {
  position: relative;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border-radius: 8px;
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease,
    transform 180ms ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: color-mix(in srgb, var(--accent-blue) 48%, transparent);
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
}

.theme-toggle:active {
  transform: scale(0.94);
}

.theme-toggle__icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: rotate(-65deg) scale(0.72);
  transition: opacity 210ms ease, transform 240ms ease;
  pointer-events: none;
}

.theme-toggle__icon svg {
  display: block;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html:not([data-theme="light"]) .theme-toggle__icon--sun,
html[data-theme="dark"] .theme-toggle__icon--sun,
html[data-theme="light"] .theme-toggle__icon--moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

html:not([data-theme="light"]) .theme-toggle__icon--moon,
html[data-theme="dark"] .theme-toggle__icon--moon,
html[data-theme="light"] .theme-toggle__icon--sun {
  opacity: 0;
  transform: rotate(65deg) scale(0.72);
}

.health {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.health__indicator {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.health__indicator:hover,
.health__indicator:focus-visible {
  border-color: color-mix(in srgb, currentColor 48%, transparent);
  background: color-mix(in srgb, currentColor 11%, transparent);
}

.health__dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--text-muted) 45%, transparent);
}

.health--pending {
  color: var(--text-muted);
}

.health--ok .health__dot {
  background: var(--success);
  box-shadow: 0 0 10px color-mix(in srgb, var(--success) 65%, transparent);
  animation: healthPulse 1.8s ease-in-out infinite;
}

.health--warning .health__dot {
  background: var(--warning);
  box-shadow: 0 0 10px color-mix(in srgb, var(--warning) 60%, transparent);
}

.health--error .health__dot {
  background: var(--danger);
  box-shadow: 0 0 10px color-mix(in srgb, var(--danger) 60%, transparent);
}

.health-tooltip {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 10020;
  min-width: 172px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-raised) 96%, transparent);
  color: var(--text-primary);
  box-shadow: 0 14px 38px rgba(1, 8, 17, 0.4);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-5px);
  transition: opacity 150ms ease, transform 150ms ease, visibility 150ms ease;
}

.health-tooltip::before {
  content: "";
  position: absolute;
  top: -5px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  background: var(--surface-raised);
  transform: rotate(45deg);
}

.health:hover .health-tooltip,
.health:focus-within .health-tooltip {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.health-tooltip__list {
  display: grid;
  gap: 5px;
}

.health-tooltip__row {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 24px;
  padding: 2px 5px;
  border-radius: 4px;
}

.health-tooltip__service-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.health-tooltip__service-dot.is-up {
  background: var(--success);
  box-shadow: 0 0 7px color-mix(in srgb, var(--success) 55%, transparent);
}

.health-tooltip__service-dot.is-down {
  background: var(--danger);
  box-shadow: 0 0 7px color-mix(in srgb, var(--danger) 50%, transparent);
}

.health-tooltip__service-name {
  overflow: hidden;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-theme="light"] {
  color-scheme: light;
  --desktop-bg: #e9f0f6;
  --desktop-bg-deep: #d9e5ef;
  --panel-bg: rgba(246, 249, 252, 0.96);
  --window-bg: #f8fbfd;
  --window-bg-soft: #eef4f8;
  --titlebar-bg: #e8eff5;
  --titlebar-active: #dce9f3;
  --surface: #f4f8fb;
  --surface-raised: #ffffff;
  --border: #b9c9d7;
  --border-soft: #cedae4;
  --text-primary: #17283a;
  --text-secondary: #50657a;
  --text-muted: #72869a;
  --accent-green: #4f971e;
  --accent-green-soft: rgba(87, 156, 38, 0.13);
  --accent-blue: #1477bd;
  --accent-blue-soft: rgba(20, 119, 189, 0.12);
  --warning: #b77a08;
  --danger: #c53f47;
  --success: #4c9b26;
  --shadow: 0 22px 55px rgba(43, 72, 98, 0.2), 0 4px 12px rgba(43, 72, 98, 0.12);
}

html[data-theme="light"] body,
html[data-theme="light"] .web-desktop,
html[data-theme="light"] .desktop-area {
  background: var(--desktop-bg);
}

html[data-theme="light"] .top-panel {
  border-bottom-color: rgba(91, 122, 149, 0.25);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(235, 242, 248, 0.96)),
    var(--panel-bg);
  box-shadow: 0 8px 22px rgba(56, 82, 105, 0.12);
}

html[data-theme="light"] .launcher-button {
  border-color: rgba(91, 122, 149, 0.28);
  background: linear-gradient(180deg, #ffffff, #e9f0f6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

html[data-theme="light"] .launcher-button:hover,
html[data-theme="light"] .launcher-button:focus-visible {
  border-color: rgba(20, 119, 189, 0.5);
  background: linear-gradient(180deg, #ffffff, #deebf4);
}

html[data-theme="light"] .launcher-button.is-active {
  border-color: rgba(79, 151, 30, 0.58);
  background: linear-gradient(180deg, #f4fbef, #e4f1dc);
}

html[data-theme="light"] .launcher-button__tooltip,
html[data-theme="light"] .launcher-button__tooltip::before {
  background: #ffffff;
}

html[data-theme="light"] .desktop-background {
  background:
    radial-gradient(circle at 70% 16%, rgba(39, 131, 196, 0.12), transparent 30%),
    radial-gradient(circle at 20% 78%, rgba(73, 145, 193, 0.11), transparent 34%),
    linear-gradient(135deg, #edf3f8 0%, #e4edf4 48%, #f1f5f8 100%);
}

html[data-theme="light"] .desktop-background__grid {
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(62, 104, 137, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(62, 104, 137, 0.12) 1px, transparent 1px);
}

html[data-theme="light"] .desktop-background__arc {
  border-color: rgba(20, 119, 189, 0.18);
}

html[data-theme="light"] .desktop-background__glow {
  background: rgba(48, 139, 199, 0.09);
}

html[data-theme="light"] .app-window {
  border-color: rgba(132, 158, 181, 0.72);
  background: var(--window-bg);
}

html[data-theme="light"] .app-window.is-active {
  border-color: rgba(20, 119, 189, 0.7);
  box-shadow: var(--shadow), 0 0 0 1px rgba(20, 119, 189, 0.08);
}

html[data-theme="light"] .window-titlebar {
  background: linear-gradient(180deg, #f7fafc, var(--titlebar-bg));
}

html[data-theme="light"] .app-window.is-active .window-titlebar {
  background: linear-gradient(180deg, #eef6fb, var(--titlebar-active));
}

html[data-theme="light"] .window-content {
  background: linear-gradient(180deg, rgba(250, 252, 254, 0.98), rgba(241, 247, 251, 0.98));
}

html[data-theme="light"] .window-control:hover,
html[data-theme="light"] .window-control:focus-visible {
  background: rgba(40, 86, 122, 0.08);
}

html[data-theme="light"] .input,
html[data-theme="light"] .select,
html[data-theme="light"] .textarea,
html[data-theme="light"] .search-input {
  background: #ffffff;
}

html[data-theme="light"] .input:focus,
html[data-theme="light"] .select:focus,
html[data-theme="light"] .textarea:focus,
html[data-theme="light"] .search-input:focus {
  background: #ffffff;
}

html[data-theme="light"] .btn {
  background: linear-gradient(180deg, #ffffff, #e8eff5);
}

html[data-theme="light"] .btn:hover,
html[data-theme="light"] .btn:focus-visible {
  background: linear-gradient(180deg, #ffffff, #dde9f2);
}

html[data-theme="light"] .btn--primary {
  background: linear-gradient(180deg, #edf8e8, #dcefd2);
}

html[data-theme="light"] .terminal-app {
  background:
    radial-gradient(circle at 90% 0%, rgba(20, 119, 189, 0.06), transparent 33%),
    #edf4f8;
  color: #25394b;
}

html[data-theme="light"] .command-menu,
html[data-theme="light"] .column-picker__menu {
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(43, 72, 98, 0.2);
}

html[data-theme="light"] .mode-tab,
html[data-theme="light"] .table-tab,
html[data-theme="light"] .filter-chip {
  background: #f2f6f9;
}

html[data-theme="light"] .mode-tab:hover,
html[data-theme="light"] .table-tab:hover,
html[data-theme="light"] .filter-chip:hover {
  background: #e3edf4;
}

html[data-theme="light"] .tools-option-panel,
html[data-theme="light"] .table-detail,
html[data-theme="light"] .news-list,
html[data-theme="light"] .news-detail {
  background: rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] .data-table th {
  background: #e4edf4;
}

html[data-theme="light"] .data-table tbody tr {
  background: rgba(255, 255, 255, 0.78);
}

html[data-theme="light"] .data-table tbody tr:nth-child(even) {
  background: rgba(236, 243, 248, 0.82);
}

html[data-theme="light"] .news-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(236, 243, 248, 0.94));
}

html[data-theme="light"] .news-card:hover,
html[data-theme="light"] .news-card.is-selected {
  background: linear-gradient(180deg, #ffffff, #e5f0f7);
}

html[data-theme="light"] .news-card__icon {
  background: linear-gradient(135deg, rgba(20, 119, 189, 0.12), rgba(79, 151, 30, 0.08)), #eef5f9;
}

html[data-theme="light"] .toast {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 34px rgba(43, 72, 98, 0.18);
}

@media (max-width: 720px) {
  .theme-toggle {
    width: 30px;
    height: 30px;
  }

  .theme-toggle__icon svg {
    width: 17px;
    height: 17px;
  }

  .health__indicator {
    width: 28px;
    height: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle,
  .theme-toggle__icon,
  .health-tooltip {
    transition: none !important;
  }
}

/* Tools option layout refinements */
.field-inline-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 7px;
  grid-column: span 2;
}

.field-inline-group__title {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field-inline-group__row {
  display: grid;
  grid-template-columns: minmax(120px, 0.85fr) minmax(180px, 1.65fr);
  gap: 8px;
  align-items: end;
}

.field-inline-group__item {
  display: flex;
  min-width: 0;
}

html[data-theme="light"] .checkbox-field {
  border-color: rgba(160, 181, 199, 0.82);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(237, 244, 249, 0.92));
  color: var(--text-secondary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

html[data-theme="light"] .checkbox-field:hover,
html[data-theme="light"] .checkbox-field:focus-within {
  border-color: rgba(20, 119, 189, 0.46);
  background: linear-gradient(180deg, #ffffff, #e6f0f7);
}

@media (max-width: 980px) {
  .field-inline-group {
    grid-column: span 2;
  }
}

@media (max-width: 460px) {
  .field-inline-group {
    grid-column: span 1;
  }

  .field-inline-group__row {
    grid-template-columns: 1fr;
  }
}
