/* Shared styles for mirons.org. Each app page sets --accent on <body> via a class. */
:root {
  --bg: #f6fafb;
  --surface: #ffffff;
  --surface-2: #eef4f6;
  --fg: #10262e;
  --muted: #5a6f76;
  --line: #dbe6e9;
  --accent: #0e7c86;
  --accent-ink: #ffffff;
  --accent-soft: #e0f1f2;
  --good: #1f9d55;
  --soon: #d97706;
  --bad: #d64545;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 38, 46, .06), 0 8px 24px rgba(16, 38, 46, .06);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1a20;
    --surface: #122731;
    --surface-2: #17313c;
    --fg: #e8f3f5;
    --muted: #9db3b9;
    --line: #23414c;
    --accent: #3cc4cf;
    --accent-ink: #062027;
    --accent-soft: #143c44;
    --good: #4ade80;
    --soon: #fbbf24;
    --bad: #f87171;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 1000px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }

/* Header & footer */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--fg); text-decoration: none; font-size: 1.05rem; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.site-nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a { color: var(--fg); text-decoration: none; padding: 6px 12px; border-radius: 999px; font-size: .95rem; }
.site-nav a:hover { background: var(--surface-2); }
.site-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.site-footer { border-top: 1px solid var(--line); margin-top: 72px; padding: 28px 0 40px; font-size: .9rem; color: var(--muted); }
.site-footer .wrap { display: flex; gap: 8px 20px; flex-wrap: wrap; align-items: center; }
.site-footer a { color: var(--muted); }
.site-footer .spacer { flex: 1; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 12px; border: 0;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
}
.btn:hover { filter: brightness(1.06); }
.btn.secondary { background: var(--surface); color: var(--fg); border: 1px solid var(--line); }
.btn[aria-disabled="true"] { opacity: .75; cursor: default; }
.btn svg { width: 20px; height: 20px; }

/* Landing */
.hero { padding: 64px 0 40px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero .app-icon { width: 96px; height: 96px; border-radius: 22px; box-shadow: var(--shadow); }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); margin: 18px 0 12px; }
.hero p.lead { font-size: 1.2rem; color: var(--muted); margin: 0 0 24px; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.badge-note { font-size: .85rem; color: var(--muted); margin-top: 10px; }

/* CSS phone mock of the app's home screen */
.phone {
  width: 300px; max-width: 100%; margin: 0 auto; padding: 14px;
  border-radius: 44px; background: #0d1215; box-shadow: 0 30px 60px rgba(0,0,0,.25);
}
.screen { border-radius: 32px; overflow: hidden; background: #f2f2f7; color: #111; font-size: 13px; line-height: 1.35; }
.screen .bar { height: 30px; }
.screen .title { font-size: 26px; font-weight: 700; padding: 0 16px 8px; }
.screen .tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 12px 10px; }
.screen .tile { background: #fff; border-radius: 10px; padding: 7px 8px; }
.screen .tile b { display: block; font-size: 18px; }
.screen .tile.soon { box-shadow: inset 0 0 0 1.5px #f59e0b; }
.screen .sec { padding: 6px 16px 4px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.screen .av { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 9px; font-weight: 700; }
.screen .list { background: #fff; margin: 0 12px 8px; border-radius: 10px; }
.screen .row { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 1px solid #ececf0; }
.screen .row:last-child { border-bottom: 0; }
.screen .dot { width: 18px; height: 18px; border-radius: 50%; flex: none; }
.screen .row .info { flex: 1; min-width: 0; }
.screen .row .loc { font-weight: 600; }
.screen .row .sub { color: #6b7280; font-size: 11px; }
.screen .row .exp { text-align: right; font-size: 11px; color: #6b7280; }
.screen .row .exp b { display: block; color: #111; font-size: 12px; }
.screen .tabs { display: flex; justify-content: space-around; padding: 8px 0 14px; background: #f9f9fb; color: #8e8e93; font-size: 10px; border-top: 1px solid #e5e5ea; }
.screen .tabs .on { color: #0e7c86; font-weight: 600; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 24px 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card h3 { margin: 10px 0 6px; font-size: 1.1rem; }
.card p { margin: 0; color: var(--muted); font-size: .97rem; }
.card .ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.card .ico svg { width: 22px; height: 22px; }

.band { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; margin: 40px 0; display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.band .ico { width: 56px; height: 56px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.band h2 { margin: 0 0 4px; font-size: 1.3rem; }
.band p { margin: 0; color: var(--muted); }

.disclaimer { font-size: .9rem; color: var(--muted); border-left: 3px solid var(--line); padding: 4px 0 4px 14px; }

/* Text pages */
.page-head { padding: 48px 0 8px; }
.page-head h1 { font-size: clamp(1.9rem, 4vw, 2.5rem); margin: 0 0 6px; }
.prose h2 { margin-top: 2.2rem; font-size: 1.3rem; }
.prose table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.prose code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: .92em; }

/* FAQ */
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin: 10px 0; }
.faq summary { cursor: pointer; padding: 14px 18px; font-weight: 600; list-style: none; display: flex; gap: 12px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; margin-left: auto; font-size: 1.3rem; color: var(--muted); line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq .answer { padding: 0 18px 14px; }
.faq .answer > :first-child { margin-top: 0; }
.faq h2 { margin-top: 2rem; font-size: 1.1rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; padding: 0; list-style: none; }
.codes li { background: var(--surface-2); border-radius: 8px; padding: 6px 10px; font-size: .95rem; }
.codes b { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; margin-right: 6px; }

/* Support + form */
.help-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 20px 0 8px; }
.help-grid a.card { text-decoration: none; color: var(--fg); }
.help-grid a.card:hover { border-color: var(--accent); }
form.feedback { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label, .field legend { font-weight: 600; font-size: .95rem; }
.field .hint { font-size: .85rem; color: var(--muted); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
input[type=text], input[type=email], select, textarea {
  width: 100%; font: inherit; color: var(--fg); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
}
textarea { min-height: 160px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.notice { border-radius: 12px; padding: 14px 16px; margin: 8px 0; }
.notice.ok { background: color-mix(in srgb, var(--good) 14%, transparent); border: 1px solid color-mix(in srgb, var(--good) 40%, transparent); }
.notice.err { background: color-mix(in srgb, var(--bad) 12%, transparent); border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent); }
[hidden] { display: none !important; }

/* Directory home */
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin: 24px 0; }
.app-card { display: flex; gap: 14px; align-items: center; text-decoration: none; color: var(--fg); }
.app-card img { width: 64px; height: 64px; border-radius: 15px; }
.app-card h2 { margin: 0; font-size: 1.15rem; }
.app-card p { margin: 2px 0 0; color: var(--muted); font-size: .95rem; }
.app-card:hover { border-color: var(--accent); }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; gap: 36px; }
  .features, .help-grid { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
  .band { grid-template-columns: 1fr; }
  .site-nav { margin-left: 0; width: 100%; padding-bottom: 8px; }
}

/* Mock + helpers (no inline styles: the CSP forbids them) */
.screen .dot.g { background: #22c55e; }
.screen .dot.o { background: #f59e0b; }
.screen .av.c1 { background: #2f80ed; }
.screen .av.c2 { background: #9b51e0; }
.flush { margin: 0; }

/* Admin inbox */
.inbox-item { margin: 16px 0; }
.inbox-item.done { opacity: .7; }
.inbox-item .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .9rem; }
.inbox-item .from { margin: 10px 0 6px; }
.inbox-item .message { white-space: normal; overflow-wrap: anywhere; background: var(--surface-2); border-radius: 10px; padding: 12px 14px; }
.inbox-item .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.pill { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 2px 10px; font-weight: 600; font-size: .85rem; }
.pill.topic-bug, .pill.topic-scanner { background: color-mix(in srgb, var(--soon) 18%, transparent); color: var(--fg); }
.pill.topic-praise { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--fg); }
.btn.small { padding: 6px 12px; font-size: .9rem; border-radius: 9px; }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 50%, transparent); }
form.inline { display: inline; margin: 0; }
.small { font-size: .88rem; }

/* Admin visitors */
.toolbar { display: flex; gap: 12px 20px; align-items: center; flex-wrap: wrap; margin: 24px 0 16px; }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; background: var(--surface-2); border-radius: 10px; padding: 3px; margin-bottom: 12px; }
.toolbar .segmented { margin-bottom: 0; }
.segmented a { color: var(--fg); text-decoration: none; padding: 5px 12px; border-radius: 8px; font-size: .92rem; }
.segmented a[aria-current="page"] { background: var(--surface); color: var(--accent); font-weight: 600; box-shadow: var(--shadow); }
.apple-card { margin: 0 0 20px; }
.apple-card h2 { margin: 0 0 8px; font-size: 1.2rem; }
.apple-card > p { color: var(--fg); }
.apple-card > p.small { color: var(--muted); margin-top: 12px; }
.pill.apple { background: var(--fg); color: var(--bg); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 0 0 8px; }
.stat { padding: 16px 18px; }
.stat b { display: block; font-size: 1.8rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .9rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 32px; }
.grid2 h2, main > h2 { font-size: 1.15rem; margin: 28px 0 8px; }
.table-scroll { overflow-x: auto; }
table.data { border-collapse: collapse; width: 100%; font-size: .9rem; }
table.data th { text-align: left; font-weight: 600; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
table.data th, table.data td { border-bottom: 1px solid var(--line); padding: 7px 10px 7px 0; vertical-align: top; }
table.data td { font-variant-numeric: tabular-nums; }
table.data tr.dim td { color: var(--muted); }
table.data meter { width: 70px; vertical-align: middle; }
.nowrap { white-space: nowrap; }
.mono-break { overflow-wrap: anywhere; }
@media (max-width: 820px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .grid2 { grid-template-columns: 1fr; }
}
