* { box-sizing:border-box }
body { margin:0; background:#efe9df; color:#231e19; font:14px/1.45 Inter,system-ui,sans-serif }
button, input, select, summary { font:inherit; color:inherit }
button, summary { cursor:pointer }
button { background:transparent; border:1px solid transparent; border-radius:4px; padding:6px 9px; display:inline-flex; align-items:center; justify-content:center; gap:7px }
button:disabled { opacity:.35; cursor:default }
button:not(:disabled):hover, summary:hover { background:var(--rule) }
button:focus-visible, summary:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline:2px solid var(--accent); outline-offset:2px }
button svg { width:17px; height:17px; flex-shrink:0; stroke-width:1.65 }
.desk { --paper:#efe9df; --ink:#231e19; --muted:#665e53; --accent:#a24931; --rule:#d4cbbe; background:var(--paper); color:var(--ink); height:100vh; height:100dvh; display:flex; flex-direction:column; outline:none }
.desk[data-theme=dark] { color-scheme:dark; --paper:#191815; --ink:#ede6db; --muted:#c6bcac; --accent:#e18d71; --rule:#423e38 }
header { display:flex; align-items:center; justify-content:space-between; gap:24px; padding:14px clamp(14px,2vw,32px); border-bottom:1px solid var(--rule) }
.brand,.actions,.row { display:flex; align-items:center; gap:9px }
.brand { gap:22px }
.brand a { display:grid; place-items:center; width:40px; height:40px; flex:none; border-radius:4px }
.brand a:hover { background:var(--rule) }
.brand img { display:block; width:28px; height:28px }
.desk[data-theme=dark] .brand img { filter:invert(1) }
h1,h2,legend { font:400 30px/1 'Cormorant Garamond',Georgia,serif; letter-spacing:-.045em; margin:0 }
h1 { font-size:clamp(35px,4vw,58px) }
h1 i { color:var(--accent); font-weight:normal }
.drawing-name { flex:1; max-width:350px; min-width:0 }
.drawing-name span,footer,.field { color:var(--muted); font-size:11px }
.drawing-name span { text-transform:uppercase; letter-spacing:.17em; display:block }
.drawing-name input { border:none; border-bottom:1px solid var(--rule); background:transparent; width:100%; padding:3px 0; font-size:16px }
.actions { gap:3px }
summary { list-style:none }
summary::-webkit-details-marker { display:none }
.files { position:relative; z-index:6 }
.files summary,.primary { background:var(--ink); color:var(--paper); padding:9px 15px; border-radius:4px }
.files summary:hover,.primary:hover { background:var(--accent)!important }
.files div { position:absolute; top:calc(100% + 3px); right:0; min-width:110px; display:grid; background:var(--paper); border:1px solid var(--rule); padding:4px }
.workspace { display:grid; grid-template-columns:150px minmax(0,1fr) 213px; flex:1; min-height:0; position:relative }
.toolbox,aside { overflow:auto; padding:18px 12px }
.toolbox { display:flex; flex-direction:column; gap:3px; border-right:1px solid var(--rule) }
.toolbox button { flex:none; justify-content:flex-start; padding:8px; }
.toolbox kbd { margin-left:auto; color:var(--muted); font-size:10px }
.toolbox button[aria-pressed=true] { background:var(--ink); color:var(--paper) }
.toolbox button[aria-pressed=true] kbd { color:inherit }
.sheet { position:relative; min-width:0; min-height:0; overflow:hidden; touch-action:none }
.fit,.inspector-toggle,.text-entry,.message { position:absolute; z-index:2; background:var(--paper); border:1px solid var(--rule); border-radius:4px }
.fit { bottom:15px; right:15px; font-variant-numeric:tabular-nums }
.inspector-toggle,.aside-title button { display:none }
aside { border-left:1px solid var(--rule); padding:24px 18px; background:var(--paper) }
.aside-title { display:flex; align-items:center; justify-content:space-between }
.aside-title h2 { font-size:24px }
fieldset { border:none; margin:20px 0 0; padding:8px 0 0; border-top:1px solid var(--rule); display:grid; gap:6px; min-width:0 }
legend { font:600 10px/1.5 Inter,system-ui,sans-serif; letter-spacing:.14em; text-transform:uppercase; color:var(--accent); padding:0 7px 0 0 }
fieldset label { display:flex; align-items:center; gap:7px; font-size:12px }
input[type=checkbox] { accent-color:var(--accent); margin:0 }
.field { justify-content:space-between }
select, .mcp-info input,.text-entry input { max-width:100%; min-width:0; border:1px solid var(--rule); background:var(--paper); border-radius:3px; padding:5px; font-size:12px }
.row { flex-wrap:wrap }
.row button { border-color:var(--rule); font-size:12px }
.mcp-info { margin-top:26px; border-top:1px solid var(--rule); padding-top:12px; color:var(--muted); font-size:12px }
.mcp-info summary { text-decoration:underline; text-underline-offset:3px }
.text-entry { top:12px; left:12px; padding:6px; display:flex; max-width:94% }
footer { display:flex; gap:16px; align-items:center; justify-content:space-between; padding:8px 16px; border-top:1px solid var(--rule); font-variant-numeric:tabular-nums }
footer span:first-child { flex:1 }
.message { bottom:48px; left:50%; transform:translateX(-50%); display:flex; align-items:center; gap:10px; padding:8px 14px; max-width:95vw }
.shade { position:fixed; inset:0; z-index:12; background:#0007; display:grid; place-items:center; padding:15px }
.shade section, dialog { color:var(--ink); border:0; background:var(--paper); padding:28px; max-width:420px; overflow-wrap:anywhere }
dialog::backdrop { background:#0007 }
@media(max-width:1000px) {
    .workspace { grid-template-columns:54px minmax(0,1fr) }
    .toolbox { padding:8px 4px; align-items:center }
    .toolbox button span,.toolbox kbd { display:none }
    aside { display:none }
    aside.opened { display:block; position:absolute; right:0; top:0; bottom:0; width:min(255px,85%); z-index:4 }
    .inspector-toggle { display:flex; top:12px; right:12px }
    .aside-title button { display:flex }
    .brand { gap:10px }
}
@media(max-width:650px) {
    header { flex-wrap:wrap; gap:5px 10px; padding:8px 10px }
    .brand { flex:1 }
    .drawing-name { order:3; flex:0 0 100%; max-width:none; display:flex; align-items:center; gap:10px }
    .drawing-name input { font-size:13px }
    .actions { gap:0 }
    .actions button { padding:6px }
    .actions button span,footer span:last-child { display:none }
    .files summary { padding:6px 8px }
    footer { font-size:10px; padding:5px 8px; gap:8px }
    .message { width:max-content }
}

.offset-entry { position:absolute; top:12px; left:12px; display:flex; gap:6px; align-items:center; border:1px solid var(--rule); border-radius:4px; background:var(--paper); padding:6px 9px; font-size:12px }
.offset-entry input { width:5em; padding:3px; background:var(--paper); border:1px solid var(--rule) }
