/* Shared base styles for personal apps. Apps add their own styles.css on top. */
:root {
  color-scheme: light dark;
  --bg: #f6f6f3;
  --surface: #fcfcfb;
  --surface-2: #f0efeb;
  --border: rgba(11, 11, 11, 0.1);
  --border-strong: rgba(11, 11, 11, 0.18);
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #898781;
  --accent: #1f6f5c;
  --accent-ink: #ffffff;
  --accent-soft: rgba(31, 111, 92, 0.12);
  --danger: #c23434;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.06);
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", sans-serif;
  --font-ar: "Geeza Pro", "SF Arabic", "Noto Naskh Arabic", "Arabic UI Text", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --surface: #1a1a19;
    --surface-2: #242423;
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.18);
    --text: #f0efec;
    --text-2: #c3c2b7;
    --muted: #8f8d86;
    --accent: #3fae8f;
    --accent-ink: #0b1a15;
    --accent-soft: rgba(63, 174, 143, 0.16);
    --danger: #e66767;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3);
  }
}

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

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

button, input, select, textarea { font: inherit; color: inherit; }

button {
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 8px;
  padding: 6px 12px;
}
button:disabled { opacity: 0.45; cursor: default; }
button.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); font-weight: 600; }
button.ghost { background: transparent; border-color: transparent; }
button.danger { color: var(--danger); }
/* Hover only where there is a real pointer; on iPhone it would stick after a tap. */
@media (hover: hover) {
  button:hover { background: var(--surface-2); }
  button.primary:hover { filter: brightness(1.06); }
  button.ghost:hover { background: var(--surface-2); }
}

input, select, textarea {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 6px 8px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.ar { font-family: var(--font-ar); direction: rtl; unicode-bidi: isolate; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
