/*
 * SafeHouse Pocket design tokens.
 *
 * The palette mirrors the desktop SafeHouse tokens
 * (apps/agentsnet-desktop/src/styles/tokens.css) so the phone shares the same
 * visual identity, plus a mobile-oriented spacing / radius / safe-area scale.
 * Dark is the default; a light ("day") theme is provided for parity.
 */
:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1a16;
  --bg-2: #0b120e;
  --panel: #152219;
  --panel-2: #18271e;
  --panel-3: #1d3028;
  --rail: #0c1512;
  --line: #24372e;
  --line-2: #1a2a22;
  --hair: #1a2a22;
  --text: #e8f1ec;
  --text-2: #c3d3ca;
  --muted: #8fa69b;
  --faint: #5d7a6c;
  --green: #4caf50;
  --green-2: #3d8b40;
  --green-ink: #5ec269;
  --green-tint: rgba(76, 175, 80, 0.14);
  --green-glow: 0 0 16px rgba(76, 175, 80, 0.46);
  --blue: #4a9bd9;
  --blue-ink: #74b3e0;
  --blue-tint: rgba(74, 155, 217, 0.14);
  --teal: #26a69a;
  --sea: #6bc5b8;
  --amber: #f1c242;
  --amber-ink: #f1c242;
  --amber-tint: rgba(241, 194, 66, 0.16);
  --amber-bd: #55421a;
  --amber-bg: #2a2412;
  --danger: #f87171;
  --danger-ink: #f87171;
  --danger-tint: rgba(248, 113, 113, 0.14);
  --gold: #c8a24b;
  --grad-green: linear-gradient(160deg, #55d48d, #42c87d);
  --nav-on-bg: linear-gradient(135deg, #1d3a28, #16281d);
  --nav-on-line: #2f5140;
  --scrim: rgba(4, 8, 6, 0.62);
  --glass: rgba(12, 21, 18, 0.76);
  --input-bg: #0f1a16;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.38);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.46);
}

[data-theme="day"] {
  color-scheme: light;
  --bg: #f7faf9;
  --bg-2: #eef5f3;
  --panel: #ffffff;
  --panel-2: #f3f8f6;
  --panel-3: #eef5f3;
  --rail: #eef5f3;
  --line: #d4e0dc;
  --line-2: #e6ede9;
  --hair: #e6ede9;
  --text: #1a2e28;
  --text-2: #35473f;
  --muted: #5d6e66;
  --faint: #8a9a92;
  --green-ink: #2f8a3f;
  --green-tint: rgba(76, 175, 80, 0.12);
  --blue-ink: #2f78b8;
  --blue-tint: rgba(74, 155, 217, 0.12);
  --amber-ink: #8a5a00;
  --amber-tint: #fff8e6;
  --amber-bd: #f1d88a;
  --amber-bg: #fff8e6;
  --danger-ink: #c0392b;
  --danger-tint: rgba(220, 38, 38, 0.1);
  --gold: #a9822f;
  --nav-on-bg: linear-gradient(135deg, #e3f2e5, #d4ead7);
  --nav-on-line: #a9d3ae;
  --scrim: rgba(26, 46, 40, 0.32);
  --glass: rgba(255, 255, 255, 0.8);
  --input-bg: #f3f8f6;
  --shadow-sm: 0 2px 8px rgba(26, 46, 40, 0.06);
  --shadow-md: 0 8px 24px rgba(26, 46, 40, 0.08);
  --shadow-lg: 0 20px 48px rgba(26, 46, 40, 0.12);
}

:root {
  /* Mobile-oriented scale. */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --tap: 44px; /* minimum comfortable touch target */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  /* Left/right insets matter in landscape (side notch / sensor housing) and on
     curved-edge displays; 0 in portrait, so harmless there. */
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --font: "Avenir Next", "Avenir Next World", Avenir, -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --platform-bar-filter: blur(16px);
  --platform-press-scale: 0.98;
  --platform-sheet-ease: ease-out;
  --platform-sheet-duration: 220ms;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
  }
}

html.platform-ios {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Avenir Next",
    "Avenir Next World", Avenir, "Segoe UI", system-ui, sans-serif;
  --platform-bar-filter: saturate(180%) blur(20px);
  --platform-press-scale: 0.97;
  --platform-sheet-ease: cubic-bezier(0.2, 0.9, 0.2, 1);
  --platform-sheet-duration: 240ms;
}

html.platform-android {
  --font: Roboto, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont,
    "Avenir Next", sans-serif;
  --radius: 18px;
  --radius-lg: 24px;
  --platform-bar-filter: blur(14px);
  --platform-press-scale: 0.99;
  --platform-sheet-ease: cubic-bezier(0.2, 0, 0, 1);
  --platform-sheet-duration: 260ms;
}
