/* Copyright (c) 2026 Wingit. All rights reserved.
   SPDX-License-Identifier: LicenseRef-Wingit-Proprietary */

/* The edge's own pages (tool down, not found, the sign-in handoff) in the v3.4 look (design language
   v3.4 sunset-dusk: Tropical Sunset by day, Dusk Violet by night; values from @wingit/tokens
   look-v34.css). They follow the device theme: the edge can't read a tool's Light / Dark choice. */

@font-face {
  font-family: 'Figtree';
  src: url('/_edge/fonts/figtree-latin-wght-normal.woff2') format('woff2');
  font-weight: 300 900;
  font-display: swap;
}

@font-face {
  font-family: 'Outfit';
  src: url('/_edge/fonts/outfit-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --color-bg: #fff7f1;
  --color-surface: #fff;
  --color-border: #f0ded0;
  --color-text: #27151e;
  --color-text-secondary: #5c4650;
  --color-link: #c22f72;
  --color-focus: #008fc0;
  --color-brand-subtle: #ffeaf0;
  --color-brand-text: #c22f72;
  --color-danger: #cc2538;
  --color-danger-subtle: #ffebe9;
  --color-danger-text: #ce2739;
  --color-grad-1: #d82a7d;
  --color-grad-2: #c55100;
  --color-on-grad: #fff;
  --color-header-bg: #fff7f1c7;
  --shadow-sm: 0 1px 2px 0 #491f200f, 0 4px 12px -4px #6a2b2e24;
  --shadow-md: 0 2px 6px 0 #491f200f, 0 14px 32px -12px #6a2b2e47;
  --font-sans: 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-display: 'Outfit', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #1b1929;
    --color-surface: #242234;
    --color-border: #434156;
    --color-text: #e9e8f2;
    --color-text-secondary: #bdbbd0;
    --color-link: #ae90fc;
    --color-focus: #957ee5;
    --color-brand-subtle: #3c305c;
    --color-brand-text: #ae90fc;
    --color-danger: #f17776;
    --color-danger-subtle: #512a29;
    --color-danger-text: #f47b79;
    --color-grad-1: #ac8efa;
    --color-grad-2: #dd7eca;
    --color-on-grad: #171322;
    --color-header-bg: #1b1929c7;
    --shadow-sm: 0 1px 2px 0 #0804185c, 0 0 0 1px #ffffff0d;
    --shadow-md: 0 10px 28px -10px #08041873, 0 0 0 1px #ffffff0f;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

a {
  color: var(--color-link);
}

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* A heading that takes focus to announce a new state (INT-7) shows no ring, like the apps'. */
[tabindex='-1']:focus {
  outline: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 8px;
  top: 8px;
  z-index: 90;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--color-surface);
}

.site-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-header-bg);
}

.site-header-inner {
  max-width: 1080px;
  margin: 0 auto;
  min-height: 64px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--color-text);
  text-decoration: none;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.badge {
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--color-brand-subtle);
  color: var(--color-brand-text);
}

main {
  flex: 1;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 40px 16px;
}

.card {
  border: 1px solid var(--color-border);
  border-radius: 24px;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  font-size: clamp(1.75rem, 1.2vw + 1.35rem, 2.25rem);
  outline: none;
}

.lead {
  margin: 8px 0 0;
  font-size: 1.0625rem;
  color: var(--color-text-secondary);
}

.actions {
  margin: 24px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.button-primary {
  background: linear-gradient(135deg, var(--color-grad-1), var(--color-grad-2));
  color: var(--color-on-grad);
  box-shadow: var(--shadow-md);
}

.button-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-text-secondary);
}

.other-tools {
  margin: 24px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--color-border);
}

.other-tools h2 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
}

.other-tools ul {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.other-tools a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
}

.problem {
  margin: 20px 0 0;
  border: 1.5px solid var(--color-danger);
  border-radius: 12px;
  background: var(--color-danger-subtle);
  color: var(--color-danger-text);
  padding: 16px;
}

.problem p {
  margin: 0;
}

.spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-brand-text);
  animation: spin 0.9s linear infinite;
  flex: none;
}

.working {
  margin: 20px 0 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-text-secondary);
}

[hidden] {
  display: none !important;
}

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

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
  }
}

@media (min-width: 640px) {
  main {
    padding: 64px 24px;
  }
  .card {
    padding: 32px;
  }
}
