/* The hidden attribute must always win. Component rules like `display:flex`
   otherwise override it, which left an invisible full-screen PIN overlay
   eating every click. */
[hidden] { display: none !important; }

/* tokens.css — shared design tokens for Focus Lock, on the studio design
   system (design/DESIGN_SYSTEM.md). Flat, calm, information-first. No
   paper/brass/ledger skin, no serif, no decorative glyphs, no gradients or
   card shadows. Self-hosted fonts only — this extension's own copy claims
   nothing leaves the device, so nothing may load from a font CDN. */

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/PublicSans-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/PublicSans-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/PublicSans-Bold.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/IBMPlexMono-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/IBMPlexMono-SemiBold.woff2") format("woff2");
}

:root {
  --color-ink: #0b0c0c;
  --color-ink-secondary: #505a5f;
  --color-paper: #ffffff;
  --color-surface: #f3f2f1;
  --color-border: #b1b4b6;
  --color-border-strong: #0b0c0c;

  --color-brand: #1d70b8;
  --color-brand-dark: #003078;
  --color-focus: #f5a623;
  --color-focus-ink: #0b0c0c;

  --color-error: #d4351c;
  --color-error-bg: #fdf2f0;
  --color-success: #00703c;
  --color-success-bg: #eaf5ef;
  --color-warning: #f47738;
  --color-warning-bg: #fdf1e8;

  --space-0: 0;
  --space-1: 5px;
  --space-2: 10px;
  --space-3: 15px;
  --space-4: 20px;
  --space-5: 25px;
  --space-6: 30px;
  --space-7: 40px;
  --space-8: 50px;
  --space-9: 60px;

  --radius-sm: 2px;
  --radius-md: 4px;

  --border-thin: 1px solid var(--color-border);
  --border-input: 2px solid var(--color-ink);
  --border-focus: 3px solid var(--color-focus);

  --shadow-popover: 0 2px 6px rgba(11, 12, 12, 0.25);

  --font-ui: "Public Sans", "Segoe UI", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;

  --motion-fast: 100ms;
  --motion-base: 150ms;
  --motion-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-ink: #f3f2f1;
    --color-ink-secondary: #b1b4b6;
    --color-paper: #0b0c0c;
    --color-surface: #1a1b1b;
    --color-border: #4c4f50;
    --color-border-strong: #f3f2f1;
    --color-brand: #5694ca;
    --color-brand-dark: #85b6e0;
    --color-error: #ff6f59;
    --color-error-bg: #2a1512;
    --color-success: #4fbd82;
    --color-success-bg: #0f241a;
    --color-warning: #f9a26c;
    --color-warning-bg: #2a1c10;
    --shadow-popover: 0 2px 8px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-brand); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--color-brand-dark); }
a:focus-visible { outline: var(--border-focus); outline-offset: 2px; }

button { font-family: inherit; }

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

.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;
}

.mono-time {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------- buttons -------------------------------- */

.btn {
  font: 500 16px/24px var(--font-ui);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--motion-fast) var(--motion-ease);
}
.btn-primary { background: var(--color-brand); color: #fff; }
.btn-primary:hover { background: var(--color-brand-dark); }
.btn-secondary { background: transparent; color: var(--color-ink); border-color: var(--color-ink); }
.btn-secondary:hover { background: var(--color-surface); }
.btn-text {
  background: none;
  border-color: transparent;
  padding: 10px 0; /* no side padding: text lines up with the content edge; tap height kept by block padding */
  margin-inline: 0;
  border: 0;
  color: var(--color-ink-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn-text:hover { color: var(--color-brand-dark); }
.btn:focus-visible { outline: var(--border-focus); outline-offset: 2px; }
.btn:disabled { background: var(--color-border); color: var(--color-ink-secondary); cursor: not-allowed; }

/* ---------------------------------- fields --------------------------------- */

.field { margin-bottom: var(--space-3); }
.field label {
  display: block;
  font: 500 14px/20px var(--font-ui);
  margin-bottom: 4px;
}
.field-hint {
  display: block;
  font: 400 14px/20px var(--font-ui);
  color: var(--color-ink-secondary);
  margin: 4px 0 0;
}
.field input, .field select, .field textarea,
input[type="text"], input[type="password"], input[type="time"], select, textarea {
  padding: 8px 10px;
  border: var(--border-input);
  border-radius: var(--radius-sm);
  font: 400 16px/24px var(--font-ui);
  background: var(--color-paper);
  color: var(--color-ink);
}
.field input:focus-visible, .field select:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: var(--border-focus);
  outline-offset: 0;
  border-color: var(--color-ink);
}
.field.has-error input { border-color: var(--color-error); }

/* ---------------------------------- text labels ----------------------------- */

.text-label {
  display: block;
  font: 500 14px/20px var(--font-ui);
  letter-spacing: 0.01em;
  color: var(--color-ink-secondary);
}

/* ---------------------------------- alert ----------------------------------- */

.alert {
  border-left: 4px solid var(--color-border);
  background: var(--color-surface);
  padding: var(--space-3) var(--space-4);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font: 400 14px/20px var(--font-ui);
}
.alert-error { border-left-color: var(--color-error); background: var(--color-error-bg); color: var(--color-error); }
.alert-success { border-left-color: var(--color-success); background: var(--color-success-bg); }
.alert-warning { border-left-color: var(--color-warning); background: var(--color-warning-bg); }

/* ---------------------------------- empty state ------------------------------ */

.empty-hint {
  margin: 0;
  font: 400 14px/20px var(--font-ui);
  color: var(--color-ink-secondary);
}

/* ---------------------------------- plain list ------------------------------- */
/* Blocklist/schedule rows: site text left, remove control right, thin row
   divider — the table component's logic without needing a table. */

.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-bottom: var(--border-thin);
  font: 400 14px/20px var(--font-mono);
}
.list li:last-child { border-bottom: none; }

.ledger-remove {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-ink-secondary);
  font: 400 14px/20px var(--font-ui);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.ledger-remove:hover { color: var(--color-brand-dark); }
.ledger-remove:disabled { color: var(--color-border); cursor: not-allowed; text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
