/* Shared look for the Playground design studios (/icon-studio, /type-studio): clean and minimal. */
@font-face{font-family:"DM Sans";font-style:normal;font-weight:400;font-display:swap;src:url(/fonts/DM-Sans-400.ttf) format("truetype")}
@font-face{font-family:"DM Sans";font-style:normal;font-weight:500;font-display:swap;src:url(/fonts/DM-Sans-500.ttf) format("truetype")}
@font-face{font-family:"DM Sans";font-style:normal;font-weight:600;font-display:swap;src:url(/fonts/DM-Sans-600.ttf) format("truetype")}
@font-face{font-family:"DM Sans";font-style:normal;font-weight:700;font-display:swap;src:url(/fonts/DM-Sans-700.ttf) format("truetype")}
:root{--ink:#1d2b2e;--ink-2:#34474b;--muted:#6b7b7e;--body:#4a5a5d;--bg:#f5f6f4;--card:#fff;--edge:#e3e7e4;--soft-edge:#eef0ee;--hover:#f3f5f3;--accent:#e0602f;--accent-bg:#fdf1eb;--guide:#2f7fb0;--sans:"DM Sans",system-ui,sans-serif;color-scheme:light}
*{box-sizing:border-box}
html,body{margin:0}
body{min-height:100vh;background:var(--bg);color:var(--ink);font:15px/1.5 var(--sans);-webkit-font-smoothing:antialiased}
button,input,select{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--guide);outline-offset:2px}

.back-key{position:fixed;top:24px;left:24px;z-index:40;display:grid;place-items:center;width:42px;height:42px;color:var(--ink);background:#fff;border:1px solid var(--edge);border-radius:10px;text-decoration:none;transition:background .15s,border-color .15s}
.back-key:hover{border-color:#c9d0cc}
.back-key svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

.studio{max-width:1480px;margin:0 auto;padding:28px 32px 64px 96px}
.studio-head{display:flex;justify-content:space-between;align-items:flex-end;gap:16px 32px;flex-wrap:wrap;margin-bottom:24px}
.studio-head h1{margin:0;font-size:32px;font-weight:600;letter-spacing:-.8px;line-height:1.15}
.studio-lede{margin:6px 0 0;color:var(--muted)}
.studio-switch{display:flex;padding:3px;background:#e9ece9;border-radius:10px}
.studio-switch a{padding:7px 14px;font-size:14px;font-weight:500;color:var(--muted);text-decoration:none;border-radius:8px}
.studio-switch a[aria-current=page]{background:#fff;color:var(--ink);box-shadow:0 1px 2px #0000000f}
.studio-switch a:not([aria-current]):hover{color:var(--ink)}

.layout{display:grid;grid-template-columns:200px minmax(0,1fr) 320px;gap:16px;align-items:start}
.panel{background:var(--card);border:1px solid var(--edge);border-radius:14px}
.panel-title{margin:0;padding:14px 16px 0;font-size:13px;font-weight:600;color:var(--ink);display:flex;justify-content:space-between;align-items:center;gap:8px}
.panel-title span+span{font-weight:400;color:var(--muted);font-variant-numeric:tabular-nums}

/* Tools */
.tools{display:flex;flex-direction:column;gap:18px;padding:14px 14px 16px}
.tool-group{display:flex;flex-direction:column;gap:6px;min-width:0}
.tool-label{font-size:12px;font-weight:500;color:var(--muted)}
.tool-grid{display:grid;grid-template-columns:1fr 1fr;gap:4px}
.btn{display:flex;align-items:center;justify-content:flex-start;gap:7px;min-height:34px;padding:6px 9px;font-size:13px;line-height:1.2;background:#fff;border:1px solid var(--edge);border-radius:8px;cursor:pointer;text-align:left}
.btn:hover{background:var(--hover)}
.btn[aria-pressed=true]{background:var(--ink);border-color:var(--ink);color:#fff}
.btn:disabled{opacity:.4;cursor:default;background:#fff}
.btn svg{flex:none;width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.btn-dark{justify-content:center;background:var(--ink);color:#fff;border-color:var(--ink)}
.btn-dark:hover{background:var(--ink-2)}
.btn-wide{grid-column:1/-1}
.check{display:flex;align-items:center;gap:8px;font-size:13px;cursor:pointer;line-height:1.3}
.check input{width:15px;height:15px;margin:0;accent-color:var(--ink);flex:none}
.range{display:flex;align-items:center;gap:8px;font-size:13px}
.range input{flex:1;min-width:0;accent-color:var(--ink)}
.range output{min-width:30px;text-align:right;font-variant-numeric:tabular-nums;color:var(--muted)}

/* Canvas */
.stage-wrap{display:flex;flex-direction:column;gap:12px;padding:12px 16px 16px}
.stage{position:relative;background:#f7f8f7;border-radius:10px;overflow:hidden;touch-action:none;user-select:none;-webkit-user-select:none}
.stage>svg{display:block;width:100%;height:auto;max-height:calc(100vh - 220px);cursor:crosshair}
.stage[data-tool=eraser]>svg{cursor:cell}
.chips{display:flex;flex-wrap:wrap;gap:6px;min-height:26px}
.chip{display:inline-flex;align-items:center;gap:6px;padding:3px 10px;font-size:12.5px;border-radius:99px}
.chip::before{content:"";width:6px;height:6px;border-radius:50%}
.chip.ok{color:#256046;background:#eaf5ee}
.chip.ok::before{background:#3a9467}
.chip.warn{color:#9a3f1c;background:var(--accent-bg)}
.chip.warn::before{background:var(--accent)}
.chip.idle{color:var(--muted);background:#f1f3f1}
.chip.idle::before{background:#b9c3bf}

.sub{border-top:1px solid var(--soft-edge);padding-top:14px}
.sub-head{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:10px}
.sub-head h2{margin:0;font-size:13px;font-weight:600}
.sub-head h2 span{font-weight:400;color:var(--muted)}

/* Guide: always-visible, scannable rules. Clicking one shows it on the canvas. */
.guide{position:sticky;top:20px}
.notes{list-style:none;margin:0;padding:8px}
.note-head{display:grid;grid-template-columns:22px 1fr;gap:2px 8px;width:100%;padding:10px 10px;background:none;border:0;border-radius:10px;cursor:pointer;text-align:left}
.note-head:hover{background:var(--hover)}
.note-head[aria-pressed=true]{background:var(--accent-bg)}
.note-num{grid-row:span 3;padding-top:1px;font-size:12px;font-weight:600;color:#a7b2af;font-variant-numeric:tabular-nums}
.note-head[aria-pressed=true] .note-num{color:var(--accent)}
.note-title{font-size:14.5px;font-weight:600;line-height:1.3}
.note-key{font-size:13px;font-weight:500;color:var(--guide);font-variant-numeric:tabular-nums}
.note-head[aria-pressed=true] .note-key{color:var(--accent)}
.note-text{font-size:13px;line-height:1.45;color:var(--muted)}

.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.flash{animation:flash .9s}
@keyframes flash{0%,100%{box-shadow:none}30%{box-shadow:0 0 0 3px #e0602f40}}

@media (max-width:1240px){
  .layout{grid-template-columns:190px minmax(0,1fr)}
  .guide{grid-column:1/-1;position:static}
  .notes{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr))}
}
@media (max-width:780px){
  .studio{padding:80px 16px 40px}
  .back-key{top:16px;left:16px}
  .studio-head h1{font-size:26px}
  .layout{grid-template-columns:minmax(0,1fr)}
  .tools{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}
  .stage-wrap{padding:10px}
  .stage>svg{max-height:none}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
