/* Poetterns site: shared look. Colors follow the system unless the switch picks light or dark. */
[hidden] { display: none !important; }
:root {
  --bg:#faf8f4; --fg:#1d1b18; --muted:#6b655c; --card:#ffffff; --line:#e6e1d8; --accent:#8a5a2b; --bad:#b3261e; --chip:#f1ece3;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:#141311; --fg:#f1ede6; --muted:#a29a8e; --card:#1e1c19; --line:#34302a; --accent:#d9a066; --bad:#f2b8b5; --chip:#2a2723;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg:#141311; --fg:#f1ede6; --muted:#a29a8e; --card:#1e1c19; --line:#34302a; --accent:#d9a066; --bad:#f2b8b5; --chip:#2a2723;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--fg); font:16px/1.5 -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.bad { color: var(--bad); }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.top .wrap { display:flex; align-items:center; gap:12px; height:56px; }
.brand { font: 600 24px/1 "New York", Georgia, serif; letter-spacing: -0.01em; color: var(--fg); text-decoration: none; margin-right: auto; }
.btn { font: inherit; font-size: 14px; color: var(--fg); background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; }

/* Light / dark switch */
.theme { display:inline-flex; border:1px solid var(--line); border-radius:999px; padding:2px; background:var(--card); }
.theme button { font: inherit; font-size: 15px; line-height: 1; border:0; background:transparent; color:var(--muted); padding:5px 10px; border-radius:999px; cursor:pointer; }
.theme button[aria-pressed="true"] { background: var(--chip); box-shadow: inset 0 0 0 1px var(--line); }
.theme button { filter: grayscale(.2); }
.icon-btn { display:inline-grid; place-items:center; width:34px; height:34px; border-radius:999px; border:1px solid var(--line); background:var(--card); color:var(--fg); cursor:pointer; }
.icon-btn:hover { background: var(--chip); }
.offscreen { position:fixed !important; left:-10000px; top:-10000px; width:1px; height:1px; overflow:hidden; }

/* Content */
h1 { font: 600 32px/1.2 "New York", Georgia, serif; margin: 28px 0 4px; }
h2 { font: 600 20px/1.3 "New York", Georgia, serif; margin: 0 0 10px; }
.grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 16px 0; }
.card { background:var(--card); border:1px solid var(--line); border-radius:14px; padding:16px; min-width:0; }
.stat { font: 600 30px/1.1 -apple-system, BlinkMacSystemFont, sans-serif; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 14px; }
table { width:100%; border-collapse:collapse; }
td { padding:6px 0; border-bottom:1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num { text-align:right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 12px; }
details { border-top: 1px solid var(--line); padding: 8px 0; }
details:first-of-type { border-top: 0; }
summary { cursor: pointer; display:flex; justify-content: space-between; gap: 12px; list-style: none; }
summary::-webkit-details-marker { display:none; }
summary::after { content: "›"; color: var(--muted); transition: transform .15s; }
details[open] summary::after { transform: rotate(90deg); }
summary .count { margin-left:auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.chips { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; max-height: 260px; overflow:auto; }
.chip { background: var(--chip); border-radius: 999px; padding: 2px 10px; font-size: 14px; }
.section { margin: 28px 0; }
.center { min-height: 60vh; display:grid; place-items:center; text-align:center; }
#apple-sign-in-button, #apple-sign-out-button { display:inline-block; }
