:root{color-scheme:light;--paper:#f5efe5;--page:#fffaf3;--ink:#211a30;--muted:#5a5163;--line:#d7cbdc;--violet:#493469;--pale:#eee6f6;--accent:#f0c986;font:100%/1.5 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
*,*::before,*::after{box-sizing:border-box}
body{margin:0;background:var(--paper);color:var(--ink)}
button,input{font:inherit}
button{cursor:pointer}
a{color:var(--violet);font-weight:650;text-underline-offset:.2em}
:focus-visible{outline:3px solid #7544a6;outline-offset:3px}
.wrap{width:min(100% - 36px,960px);margin-inline:auto}
.site-head{border-bottom:1px solid var(--line);background:var(--page)}
.top{min-height:58px;display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:.92rem}
.top>span{color:var(--muted)}
.intro{padding:34px 0 26px;display:flex;align-items:center;gap:18px}
.intro img{width:82px;height:82px;flex:none}
.eyebrow{font-size:.72rem;line-height:1.3;letter-spacing:.12em;text-transform:uppercase;font-weight:790;margin:0 0 5px;color:var(--muted)}
h1,h2,h3,p{margin:0}
h1{font:700 clamp(2.4rem,6vw,4.6rem)/.99 Georgia,serif;letter-spacing:-.05em;margin:0 0 6px}
.intro div>p:last-child{color:var(--muted);max-width:52ch}
.demo{padding:clamp(16px,3vw,26px);background:var(--page);border:1px solid var(--line);border-radius:18px;box-shadow:0 8px 30px #3523480d}
.demo-head,.controls,.bottom{display:flex;align-items:center;justify-content:space-between;gap:14px}
h2{font:700 clamp(1.45rem,4vw,2rem)/1.1 Georgia,serif}
.reset,.modes button{min-height:42px;padding:7px 12px;color:var(--violet);background:transparent;border:1px solid var(--line);border-radius:7px;font-weight:670}
.reset:hover,.modes button:hover{background:var(--pale)}
.modes{margin:18px 0 14px;display:flex;gap:6px;flex-wrap:wrap}
.modes button[aria-pressed=true],.main-action{background:var(--violet);color:#fff;border-color:var(--violet)}
.modes button[aria-pressed=true]:hover,.main-action:hover{background:#33234b}
.controls{padding:12px 0 16px;border-bottom:1px solid var(--line)}
.controls p{margin-bottom:5px;color:var(--muted)}
.rule{display:flex;align-items:center;gap:7px;font-size:.9rem;font-weight:670}
.rule input{accent-color:var(--violet);width:18px;height:18px;margin:0;flex:none}
.main-action{min-height:46px;padding:9px 15px;border:1px solid;border-radius:8px;font-weight:750;white-space:nowrap}
.result{padding:16px 0 9px}
.cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.card{border:1px solid var(--line);background:#fbf6ff;border-radius:10px;padding:11px;min-width:0}
.card:nth-child(2){background:#f9f2e8}.card:nth-child(3){background:#eef5ee}.card:nth-child(4){background:#f4eef8}
.card h3{font-size:.88rem;margin-bottom:9px}
.card ul,.desk-grid{margin:0;padding:0;list-style:none}
.card li{display:flex;flex-wrap:wrap;gap:2px 7px;align-items:center;font-weight:650;min-height:32px;border-top:1px solid #24143318;padding:5px 0}
.card small{display:inline-block;color:var(--muted);font-size:.72rem;font-weight:650}
.board{padding:8px 12px;text-align:center;border-radius:6px;background:var(--violet);color:white;font-size:.85rem;font-weight:750;margin:0 auto 12px;max-width:360px}
.desk-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.desk-grid li{border:1px solid #c5b5d9;background:var(--pale);border-radius:7px;min-height:53px;display:grid;place-content:center;text-align:center;font-weight:660;padding:4px}
.desk-grid small{display:block;font-size:.67rem;color:var(--muted);font-weight:600}
.status{font-size:.9rem;color:var(--muted);min-height:1.5em}
.bottom{padding:16px 0 30px;color:var(--muted);font-size:.9rem}
@media(max-width:620px){.cards{grid-template-columns:repeat(2,minmax(0,1fr))}.intro{padding-top:24px}.intro img{width:58px;height:58px}.controls{align-items:flex-start;flex-direction:column}.bottom{align-items:flex-start;flex-direction:column;gap:8px}}
@media(max-width:365px){.wrap{width:calc(100% - 24px)}.reset,.modes button{padding-inline:8px}.intro{gap:10px}.desk-grid{gap:4px}.desk-grid li{font-size:.85rem}}
