/* Attention Pro design system.
   Defaults to the SYSTEM theme via prefers-color-scheme; a manual override
   sets html[data-theme="light"|"dark"] and wins over the media query. */

:root {
  --font: -apple-system, "Segoe UI Variable", "Segoe UI", system-ui, Roboto, sans-serif;
  --mono: "Cascadia Code", ui-monospace, "SF Mono", Consolas, monospace;

  /* light (default) */
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef0f3;
  --text: #17191c;
  --text-2: #5c626b;
  --text-3: #9aa0a8;
  --border: #e2e5e9;
  --accent: #2f6fed;
  --accent-soft: #e8effd;
  --green: #1a9e5c;
  --green-soft: #e5f5ec;
  --amber: #b57e10;
  --amber-soft: #fbf1dc;
  --red: #d93d42;
  --red-soft: #fdebec;
  --shadow: 0 1px 3px rgba(20, 24, 33, 0.07), 0 8px 24px rgba(20, 24, 33, 0.06);

  /* Panels and controls paint through these, not through --surface directly,
     so a wallpaper can make them translucent in one place (AP.applyWallpaper).
     Identical to --surface until a wallpaper is set, which is the point: with
     no wallpaper there is nothing to see through to, and nothing changes.
     Mirrors the Android launcher's LocalPanelSurfaceAlpha. */
  --panel: var(--surface);
  --control: var(--surface);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131519;
    --surface: #1c1f25;
    --surface-2: #262a32;
    --text: #edeef0;
    --text-2: #a5abb5;
    --text-3: #6c7280;
    --border: #2e333c;
    --accent: #5b8def;
    --accent-soft: #1e2a44;
    --green: #3dcc85;
    --green-soft: #14301f;
    --amber: #e0a83e;
    --amber-soft: #33280f;
    --red: #f26669;
    --red-soft: #3a1a1b;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

html[data-theme="light"] {
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #eef0f3;
  --text: #17191c; --text-2: #5c626b; --text-3: #9aa0a8; --border: #e2e5e9;
  --accent: #2f6fed; --accent-soft: #e8effd;
  --green: #1a9e5c; --green-soft: #e5f5ec;
  --amber: #b57e10; --amber-soft: #fbf1dc;
  --red: #d93d42; --red-soft: #fdebec;
  --shadow: 0 1px 3px rgba(20, 24, 33, 0.07), 0 8px 24px rgba(20, 24, 33, 0.06);
}

html[data-theme="dark"] {
  --bg: #131519; --surface: #1c1f25; --surface-2: #262a32;
  --text: #edeef0; --text-2: #a5abb5; --text-3: #6c7280; --border: #2e333c;
  --accent: #5b8def; --accent-soft: #1e2a44;
  --green: #3dcc85; --green-soft: #14301f;
  --amber: #e0a83e; --amber-soft: #33280f;
  --red: #f26669; --red-soft: #3a1a1b;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Author display rules (e.g. .banner{display:flex}) would otherwise override
   the UA's [hidden]{display:none} — this keeps the hidden attribute reliable. */
[hidden] { display: none !important; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  font-size: 13px;
  border: 1px solid var(--border);
  background: var(--control);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.05s;
}
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 2px;
}
button:hover { background: var(--surface-2); }
button:active { transform: scale(0.98); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { filter: brightness(1.08); }
button.danger { color: var(--red); }
button.danger:hover { background: var(--red-soft); border-color: var(--red); }
button.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
button.ghost:hover { background: var(--surface-2); color: var(--text); }
/* Disabled buttons: dulled, and hover must not change each variant's own
   background (primary keeps accent — transparent would hide its white text). */
button:disabled { opacity: 0.4; cursor: not-allowed; }
button:disabled:hover { background: var(--surface); }
button:disabled:active { transform: none; }
button.ghost:disabled:hover { background: transparent; }
button.primary:disabled:hover { background: var(--accent); filter: none; }

/* Shared modal footer used by dashboard and toolbar popup. */
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.dialog-actions > button { min-height: 40px; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 10px;
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
}
.checkbox-row input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Keep modal content reachable on compact windows and browser popups. */
dialog.card {
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

input[type="text"], input[type="email"] {
  font-family: inherit;
  font-size: 14px;
  border: 1px solid var(--border);
  background: var(--control);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  outline: none;
}
input[type="text"]:focus, input[type="email"]:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  padding: 3px 10px;
}
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.grey { background: var(--surface-2); color: var(--text-2); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dot.pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
