/*
 * TOG dashboard identity: "greenhouse control desk after sundown."
 *
 * Deep chlorophyll glass, seed-paper text, marigold signals, and rounded field
 * labels make this operational rather than rustic. It is deliberately neither
 * Axiom's black/oxide editorial luxury nor Tinervin's pale paper system.
 */
:root {
  color-scheme: dark;

  --tog-ink-950: #0b110d;
  --tog-ink-900: #111a14;
  --tog-ink-850: #162119;
  --tog-ink-800: #1b281f;
  --tog-leaf-500: #91b64b;
  --tog-leaf-300: #c3db7b;
  --tog-leaf-100: #e8f1c9;
  --tog-marigold-500: #f0b84b;
  --tog-clay-500: #cc7452;
  --tog-seed-100: #f4eedc;
  --tog-seed-300: #d8d1bd;
  --tog-mist-500: #97a89a;
  --tog-danger-500: #e1786a;
  --tog-info-500: #75b4a4;

  --tog-surface-1: rgba(27, 40, 31, 0.88);
  --tog-surface-2: rgba(36, 52, 40, 0.82);
  --tog-surface-glass: rgba(18, 28, 21, 0.72);
  --tog-line: rgba(210, 228, 185, 0.16);
  --tog-line-strong: rgba(210, 228, 185, 0.3);
  --tog-focus: #f6cf6a;

  --tog-font-display: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --tog-font-body: Aptos, "Gill Sans", "Trebuchet MS", sans-serif;
  --tog-font-mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;

  --tog-text-xs: 0.72rem;
  --tog-text-sm: 0.86rem;
  --tog-text-base: 1rem;
  --tog-text-lg: clamp(1.12rem, 1rem + 0.45vw, 1.38rem);
  --tog-text-xl: clamp(1.75rem, 1.2rem + 2.2vw, 3rem);

  --tog-space-1: 0.25rem;
  --tog-space-2: 0.5rem;
  --tog-space-3: 0.75rem;
  --tog-space-4: 1rem;
  --tog-space-5: 1.5rem;
  --tog-space-6: 2rem;
  --tog-space-7: 3rem;

  --radius: 12px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --panel: var(--tog-surface-glass);
  --panel-2: var(--tog-surface-1);
  --panel-3: var(--tog-surface-2);
  --edge: inset 0 1px 0 var(--tog-line);
  --shadow-1: var(--edge), 0 6px 18px rgba(0, 0, 0, 0.18);
  --shadow-2: var(--edge), 0 20px 50px rgba(0, 0, 0, 0.28);
  --focus-ring: 0 0 0 3px var(--tog-focus);
  --row-alt: color-mix(in srgb, var(--tog-leaf-300) 4%, transparent);
  --tog-radius-sm: var(--radius-sm);
  --tog-radius-md: var(--radius);
  --tog-radius-lg: var(--radius);
  --tog-shadow-raised: 0 20px 50px rgba(0, 0, 0, 0.28);
  --tog-shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --tog-transition: 180ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--tog-ink-950);
  color: var(--tog-seed-100);
  font-family: var(--tog-font-body);
}

body {
  margin: 0;
}

a {
  color: var(--tog-leaf-300);
}

button,
input,
select {
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--tog-focus);
  outline-offset: 3px;
}

.domain-view {
  min-width: 0;
}

.view-status,
.view-empty,
.view-error {
  border: 0;
  border-radius: var(--tog-radius-md);
  color: var(--tog-seed-300);
  padding: var(--tog-space-5);
}

.view-status,
.view-error {
  border: 0;
  border-radius: var(--radius);
  background: var(--panel-2);
}

.view-empty {
  border: 0;
  background: transparent;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--tog-seed-100);
  cursor: pointer;
  vertical-align: middle;
  transition: background var(--tog-transition), color var(--tog-transition);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.icon-btn:hover,
.icon-btn:focus-visible,
.icon-btn[aria-pressed="true"] {
  background: var(--panel-3);
}

.icon-btn:focus-visible {
  outline: 0;
  box-shadow: var(--focus-ring);
}

.icon-btn-primary {
  background: var(--tog-leaf-500);
  color: var(--tog-ink-950);
}

.icon-btn-primary:hover,
.icon-btn-primary:focus-visible,
.icon-btn-primary[aria-pressed="true"] {
  background: var(--tog-leaf-300);
}

.icon-btn-destructive {
  color: var(--tog-danger-500);
}

.icon-btn-destructive:hover,
.icon-btn-destructive:focus-visible,
.icon-btn-destructive[aria-pressed="true"] {
  background: color-mix(in srgb, var(--tog-danger-500) 16%, transparent);
}

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

.icon-btn[aria-busy="true"] {
  cursor: wait;
}

.tog-runtime-sign-out {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1000;
  background: var(--panel-2);
  box-shadow: var(--shadow-1);
}

.tog-tooltip {
  position: fixed;
  z-index: 2147483647;
  max-width: min(260px, calc(100vw - 16px));
  max-height: calc(100vh - 16px);
  overflow: hidden;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--tog-ink-800);
  color: var(--tog-seed-100);
  box-shadow: var(--shadow-2);
  font: 500 var(--tog-text-sm)/1.4 var(--tog-font-body);
  overflow-wrap: anywhere;
  pointer-events: none;
}

.tog-tooltip[hidden] {
  display: none;
}

@media (pointer: coarse), (max-width: 560px) {
  .icon-btn {
    width: 44px;
    height: 44px;
  }
}

.view-error {
  color: #ffd8d1;
}

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