:root {
    color-scheme: light dark;
    --paper: #f4f3ee;
    --ink: #223830;
    --soft: #586960;
    --glass: rgba(255,255,250,.77);
    --line: rgba(63,95,77,.20);
    --teal: #245541;
    --inverse: #fffef8;
    --tint: #e3ede3;
    --warn: #944039;
    --field: rgba(255,255,255,.62);
    --glow: #dfebe3;
    --shadow: 0 8px 28px rgba(40,58,42,.045);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
}
@media (prefers-color-scheme: dark) {
    :root { --paper: #122019; --ink: #e0e9dd; --soft: #adbdaf; --glass: rgba(31,47,38,.88);
        --line: rgba(201,224,204,.19); --teal: #b4debd; --inverse: #10291d;
        --tint: #2d4234; --warn: #f0a498; --field: rgba(6,17,12,.38); --glow: #243e30;
        --shadow: none; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: radial-gradient(ellipse at 85% 3%, var(--glow), transparent 44%) var(--paper); }
.wrap { width: min(100% - 40px,1000px); margin: 0 auto; padding-bottom: 64px; }
.mast { display: flex; align-items: center; justify-content: space-between; min-height: 82px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; gap: 10px; align-items: center; color: inherit; text-decoration: none; font: italic 30px/1 Georgia, serif; }
.record { width: 28px; height: 28px; border-radius: 50%; position: relative;
    background: repeating-radial-gradient(circle, #263c32 0 2px, #657467 3px, #283b30 4px);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); }
.record::after { content: ""; position: absolute; inset: 9px; background: #e1d6b9; border-radius: 50%; }
.mast-tools, .hero, .heading, .source-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mast-tools { font-size: .875rem; }
.hero { padding: clamp(34px,5vw,64px) 0 30px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2.2rem,5vw,3.6rem); font-weight: 600; line-height: 1.16; letter-spacing: -.055em; }
h2 { font-size: 1.38rem; font-weight: 620; line-height: 1.3; }
.eyebrow { font: 600 .68rem/1.2 -apple-system, sans-serif; letter-spacing: .14em; color: var(--soft); margin-bottom: 10px; }
.intro, .desc { color: var(--soft); line-height: 1.65; }
.intro { margin-top: 12px; }
.desc { margin: 13px 0 18px; font-size: .93rem; }
.muted, small, .hint { color: var(--soft); }
small, .hint { font-size: .84rem; line-height: 1.62; }
.hint { margin-top: 15px; }
.revision { flex-shrink: 0; min-width: 72px; padding: 10px 15px; text-align: right; border-right: 2px solid var(--teal); }
.revision span { display: block; font-size: .76rem; color: var(--soft); }
.revision strong { font: 2.2rem/1.05 Georgia, serif; }
.grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.panel { min-width: 0; padding: clamp(20px,3vw,28px); border: 1px solid var(--line); background: var(--glass); border-radius: 22px; box-shadow: var(--shadow); }
@supports (backdrop-filter: blur(12px)) { .panel { backdrop-filter: blur(12px); } }
.wide { grid-column: 1 / -1; }
.pill,.small-tag { display: inline-block; font-size: .74rem; color: var(--soft); }
.pill { padding: 4px 8px; border: 1px solid var(--line); border-radius: 20px; white-space: nowrap; }
.pill.on { color: var(--teal); background: var(--tint); }
.stack { display: grid; gap: 13px; }
label { display: block; color: var(--soft); font-size: .84rem; font-weight: 520; }
input:not([type=checkbox]):not([type=hidden]) { width: 100%; min-width: 0; min-height: 43px; padding: 9px 11px; margin-top: 5px;
    color: var(--ink); background: var(--field); border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 1rem; }
a:focus-visible, input:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
button,.btn { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); border: 1px solid var(--line); background: var(--field);
    border-radius: 24px; min-height: 42px; padding: 8px 16px; font: inherit; font-size: .9rem; text-decoration: none; }
button:disabled { opacity: .55; cursor: default; }
.primary { align-self: start; color: var(--inverse); background: var(--teal); border-color: var(--teal); font-weight: 600; }
.quiet { padding: 5px 7px; min-height: 38px; border: none; background: transparent; }
.warning { color: var(--warn); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.qr-pane, .invite { margin: 15px 0; padding: 16px; border-radius: 14px; background: var(--tint); overflow-wrap: anywhere; }
.qr-pane img { display: block; margin: 0 0 10px; padding: 8px; background: white; max-width: 100%; height: auto; border-radius: 10px; }
#qr-message { color: var(--teal); font-size: .9rem; }
.url-box { margin: 16px 0; }
.invite span, .invite small { display: block; }
.invite strong { display: block; margin: 6px 0; font: 600 clamp(1.2rem,3vw,1.7rem)/1.3 ui-monospace, monospace; letter-spacing: .08em; }
.sources { display: grid; gap: 10px; }
.source { border: 1px solid var(--line); border-radius: 14px; padding: 15px; overflow-wrap: anywhere; }
.source-form { display: grid; grid-template-columns: minmax(100px,1fr) minmax(58px,80px) max-content max-content; align-items: end; gap: 12px; margin-top: 12px; }
.switch { display: flex; gap: 6px; min-height: 42px; align-items: center; }
.switch input { accent-color: var(--teal); width: 17px; height: 17px; }
details { margin-top: 18px; }
summary { cursor: pointer; color: var(--teal); font-weight: 600; padding: 8px 0; }
details .stack { margin-top: 10px; max-width: 650px; }
.devices { list-style: none; padding: 0; margin: 12px 0 0; }
.devices li { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line); }
.devices li > div { overflow-wrap: anywhere; }
.devices small { display: block; }
.empty { margin-top: 16px; color: var(--soft); line-height: 1.65; }
.flash { background: var(--tint); padding: 12px 16px; border-radius: 12px; margin-top: 16px; overflow-wrap: anywhere; }
.entrance { width: min(100%,460px); margin: clamp(32px,11vh,110px) auto; }
.entrance h1 { font-size: 2rem; }
.entrance .intro { margin-bottom: 20px; }
@media (max-width: 700px) {
    .wrap { width: calc(100% - 28px); }
    .mast { min-height: 64px; }
    .grid { grid-template-columns: minmax(0,1fr); gap: 12px; }
    .revision { min-width: auto; padding: 8px; }
    .source-form { grid-template-columns: minmax(0,1fr) 64px; gap: 8px; }
    .source-form > button { justify-self: end; }
}
