:root {
    color-scheme: light dark;
    --bg: #f5f5f7;
    --card: #ffffff;
    --text: #1d1d1f;
    --muted: #6e6e73;
    --line: #e5e5ea;
    --accent: #0071e3;
    --accent-text: #ffffff;
    --warn: #b25000;
    --radius: 18px;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #000000;
        --card: #1c1c1e;
        --text: #f5f5f7;
        --muted: #98989d;
        --line: #2c2c2e;
        --accent: #0a84ff;
        --warn: #ff9f0a;
    }
}
* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
    -webkit-font-smoothing: antialiased;
}
main { max-width: 1100px; margin: 0 auto; padding: max(24px, env(safe-area-inset-top)) 20px 48px; }
h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
h2 { font-size: 20px; font-weight: 600; margin: 0; }
code { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; }

.top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.hint, .footer, .empty { color: var(--muted); font-size: 13px; }
.footer { text-align: center; margin-top: 32px; }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); margin-top: 16px; }
.app { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.app header { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.icon { width: 60px; height: 60px; border-radius: 14px; flex: none; object-fit: cover; }
.icon.placeholder {
    display: grid; place-items: center; font-size: 28px; font-weight: 600; color: #fff;
    background: linear-gradient(135deg, #5e5ce6, #0a84ff);
}

.platform { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.platform-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 4px; }
.build { display: flex; flex-direction: column; gap: 10px; }
.build.older { border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 10px; }
.version { font-weight: 600; }
.subject { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { color: var(--muted); font-size: 13px; }
.warning { color: var(--warn); font-size: 13px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
a.primary, a.secondary, button.primary, button.secondary {
    display: inline-flex; align-items: center; justify-content: center; min-height: 36px;
    padding: 0 16px; border-radius: 999px; border: 0; font: inherit; font-weight: 600; font-size: 14px;
    text-decoration: none; cursor: pointer;
}
a.primary, button.primary { background: var(--accent); color: var(--accent-text); }
a.secondary, button.secondary { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
button:disabled { opacity: .5; cursor: default; }
button.link { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }

details.older { margin-top: 10px; }
details.older summary { color: var(--accent); font-size: 13px; cursor: pointer; }

.auth-card {
    max-width: 400px; margin: 12vh auto 0; background: var(--card); border-radius: 22px;
    padding: 32px 28px; text-align: center; box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.auth-card .logo {
    width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 16px; display: grid; place-items: center;
    font-size: 30px; color: #fff; background: linear-gradient(135deg, #5e5ce6, #0a84ff);
}
.auth-card h1 { font-size: 28px; }
.auth-card .lead { color: var(--muted); margin: 8px 0 24px; }
.auth-card button.primary { width: 100%; min-height: 48px; font-size: 16px; }
.message { min-height: 1.5em; margin: 16px 0 0; font-size: 14px; }
.message.error { color: #ff3b30; }
