/* Board chrome in the cabinet redesign style (same palette, fonts and shapes as the homework cabinet).
   Loaded last; only the interface around the canvas changes, drawing logic is untouched. */
@font-face{font-family:Manrope;src:url(fonts/manrope-regular.ttf) format('truetype');font-weight:400;font-display:swap}
@font-face{font-family:Manrope;src:url(fonts/manrope-semibold.ttf) format('truetype');font-weight:600;font-display:swap}
@font-face{font-family:Manrope;src:url(fonts/manrope-bold.ttf) format('truetype');font-weight:700 800;font-display:swap}
@font-face{font-family:Unbounded;src:url(fonts/unbounded-800.ttf) format('truetype');font-weight:500 800;font-display:swap}

:root,:root[data-board-theme="dark"]{
 --bar:#101b1a; --panel:#142120; --panel-soft:#1a2a28; --edge:#22322f; --edge-strong:#2f4441;
 --ink:#9fb2ae; --ink-strong:#eaf1ef; --faint:#62766f;
 --accent:#f0b27a; --accent-soft:rgba(240,178,122,.15); --on-accent:#2b1807;
 --board-surface:#111b1a; --pop:#142120; --shadow:0 12px 32px -14px rgba(0,0,0,.7);
}
:root[data-board-theme="light"]{
 --bar:#e6dfd1; --panel:#efe9dd; --panel-soft:#e4dccc; --edge:#d3c9b5; --edge-strong:#c2b79f;
 --ink:#4f5f5b; --ink-strong:#14201e; --faint:#7d8a86;
 --accent:#c06a22; --accent-soft:rgba(217,130,59,.14); --on-accent:#fff;
 --board-surface:#f4f1ea; --pop:#fff; --shadow:0 12px 30px -16px rgba(20,32,30,.3);
}
body{font-family:Manrope,-apple-system,Arial,sans-serif;color:var(--ink)}

/* Top bar + tool strip: one calm surface */
body>header,body>.strip{background:var(--bar);gap:8px}
body>header{height:54px;padding:0 10px;border-bottom:1px solid var(--edge)}
body>.strip,[data-board-theme="light"] body>.strip{height:62px;padding:0 10px 6px;background:var(--bar);border-bottom:1px solid var(--edge)}
.brand{display:inline-flex;align-items:center;gap:8px;width:auto;padding:0 10px 0 4px;font:700 20px/1 Unbounded,Manrope,sans-serif;letter-spacing:-.01em;color:var(--ink-strong)}
.brand::before{content:'';width:12px;height:12px;border-radius:4px;background:var(--accent);box-shadow:0 0 0 4px var(--accent-soft)}

/* Canvas fills what is left under the taller bars (54 + 62 + borders) */
main{height:calc(100dvh - 118px)}

/* Groups and buttons */
.group{height:40px;padding:3px;gap:2px;border:1px solid var(--edge);border-radius:12px;background:var(--panel)}
.group button{min-width:34px;height:32px;border-radius:9px;color:var(--ink);transition:background .12s,color .12s}
.group button:hover:enabled,[data-board-theme="light"] .group button:hover:enabled{background:var(--panel-soft);color:var(--ink-strong)}
.group button.active,.group button.active:hover:enabled,[data-board-theme="light"] .group button.active{background:var(--accent-soft);color:var(--accent)}
.group button[aria-pressed="true"]{background:var(--accent-soft);color:var(--accent)}
.group i{height:24px;background:var(--edge)}
.group button:disabled{opacity:.4}
.titlebar input,[data-board-theme="light"] body>header .titlebar input{color:var(--ink-strong);font-weight:700;font-size:14.5px}
.titlebar input:focus{outline:none}
.titlebar:focus-within{border-color:var(--accent)}
#insertCode,#videoButton{font-weight:800;font-size:12.5px;letter-spacing:.02em}
.labeled::before,[data-board-theme="light"] .labeled::before{bottom:calc(100% + 3px);left:4px;font:700 9.5px/1 Manrope,sans-serif;letter-spacing:.08em;color:var(--faint)}

/* Colour swatches */
#colors button,#customColor,#fillButton{border-color:var(--edge-strong);border-radius:8px}
#colors button.active{border-color:var(--accent);box-shadow:0 0 0 2px var(--accent-soft)}
.properties button[popovertarget=weights]{color:var(--ink-strong)}
[data-board-theme="light"] :is(#colors button,#customColor,#fillButton){background:repeating-conic-gradient(#f6f3ec 0 25%,#e6e0d4 0 50%) 0/12px 12px}

/* Canvas corner controls */
.zoom,[data-board-theme="light"] .zoom{bottom:12px;right:12px;background:var(--panel);box-shadow:var(--shadow)}
.zoom #reset{font-weight:800;color:var(--ink-strong)}
#miniMap{right:12px;bottom:62px;border:1px solid var(--edge);border-radius:12px;overflow:hidden;box-shadow:var(--shadow)}
.lesson-timer{top:12px;right:12px;padding:8px 14px;border:1px solid var(--edge);border-radius:12px;background:var(--panel);color:var(--ink-strong);font-family:Unbounded,Manrope,sans-serif;font-size:20px;box-shadow:var(--shadow)}
#toast{font-family:Manrope,sans-serif}

/* Menus, popovers, dialogs */
[popover],dialog,[data-board-theme="light"] :is([popover],dialog){background:var(--pop);color:var(--ink-strong);border:1px solid var(--edge);border-radius:14px;box-shadow:var(--shadow);padding:6px}
[popover] button,[popover] label,#boardList button{border-radius:9px;color:var(--ink-strong)}
[popover] button:hover,#boardList button:hover,[data-board-theme="light"] :is([popover],dialog) button:hover{background:var(--panel-soft);color:var(--ink-strong)}
dialog{padding:18px 20px}
dialog h2,.dialog-head h2{font:700 18px/1.2 Unbounded,Manrope,sans-serif;color:var(--ink-strong)}
dialog input,[popover] input:not([type=color]):not([type=range]):not([type=checkbox]):not([type=radio]),dialog textarea,dialog select{border:1px solid var(--edge);border-radius:10px;background:var(--panel-soft);color:var(--ink-strong)}
dialog button.active{background:var(--accent-soft);color:var(--accent)}
#shapes,[data-board-theme="light"] #shapes{background:var(--pop)}
#shapes strong{font:700 10px/1.2 Manrope,sans-serif;letter-spacing:.06em;color:var(--faint)}
#shapes button{border-radius:9px;color:var(--ink)}
#shapes button:hover{background:var(--panel-soft)}
#shapes button.active{background:var(--accent-soft);color:var(--accent)}
input[type=range]{accent-color:var(--accent)}
input[type=checkbox],input[type=radio]{accent-color:var(--accent)}

/* Phone */
@media(max-width:820px){
 body>header .brand{font-size:17px;padding-right:4px}
 .brand::before{width:10px;height:10px}
}
@media(max-width:520px){
 body>header{height:50px;padding:0 6px;gap:5px}
 main{height:calc(100dvh - 114px)}
 body>header .brand{font-size:0;gap:0;padding:0 4px}
 .brand::before{width:14px;height:14px}
 .group{height:38px;border-radius:11px}
}
/* Light theme: separate the bars from the paper */
[data-board-theme="light"] body>.strip{box-shadow:0 6px 14px -10px rgba(20,32,30,.35)}

body.presentation-viewer>header,
body.presentation-viewer>.strip,
.presentation-viewer .zoom,
.presentation-viewer .follow-presenter,
.presentation-viewer .page-nav,
.presentation-viewer #miniMap{display:none!important}
body.presentation-viewer>main{height:100dvh;pointer-events:none}
/* Light theme: cream groups that sit inside the sand bar; menus stay white */
[data-board-theme="light"] .group{box-shadow:inset 0 1px 0 rgba(255,255,255,.55)}
[data-board-theme="light"] .group button.active,[data-board-theme="light"] .group button.active:hover:enabled{background:#f8e6d3;color:var(--accent)}
[data-board-theme="light"] :is(#colors button,#customColor,#fillButton){border-color:#cfc5b1;background:repeating-conic-gradient(#f3eee5 0 25%,#e2dacb 0 50%) 0/12px 12px}
[data-board-theme="light"] #colors button.active{border-color:var(--accent)}
[data-board-theme="light"] .zoom{background:#efe9dd}

/* Use the active theme for form controls as well as the surrounding chrome. */
:root[data-board-theme] .text-settings :is(input,select),
:root[data-board-theme] .inline-text-controls input{
 background:var(--pop);color:var(--ink-strong);border-color:var(--edge-strong);color-scheme:dark;
}
:root[data-board-theme="light"] .text-settings :is(input,select),
:root[data-board-theme="light"] .inline-text-controls input{color-scheme:light}
:root[data-board-theme] :is(dialog,.rich-toolbar,.inline-text-controls) button{
 background:var(--panel);color:var(--ink-strong);border:1px solid var(--edge);
}
:root[data-board-theme] :is(dialog,.rich-toolbar,.inline-text-controls) button:hover:enabled{
 background:var(--panel-soft);color:var(--ink-strong);border-color:var(--edge-strong);
}
:root[data-board-theme] dialog button.active{background:var(--accent-soft);color:var(--accent)}
:root[data-board-theme] :is(#roomState,.participants-hint,.gif-status){color:var(--ink)}
:root[data-board-theme] .inline-text-controls{background:var(--panel);color:var(--ink-strong);border-color:var(--edge-strong)}

/* Shown to a presenter when a new board version is waiting (others reload automatically). */
.build-notice{position:fixed;left:50%;bottom:18px;transform:translateX(-50%);z-index:50;font:600 14px Manrope,Arial,sans-serif;background:var(--accent,#c56a2c);color:white;border:0;border-radius:999px;padding:10px 18px;box-shadow:0 8px 24px -10px rgba(0,0,0,.45);cursor:pointer}
.build-notice[hidden]{display:none}
