:root {
  color-scheme: light;
  --ink:#172a3d; --muted:#506579; --line:#d8e2e9; --surface:#fff;
  --page:#f2f6f9; --navy:#172b3d; --accent:#10786f; --accent-dark:#086359; --mint:#dff4ef;
  --mono:"SFMono-Regular",Consolas,"Liberation Mono",monospace;
  font:16px/1.5 Inter, "Helvetica Neue", Arial, sans-serif;
  background:var(--page); color:var(--ink);
}
* {box-sizing:border-box}
[hidden] {display:none!important}
body {margin:0}
button,input,textarea {font:inherit}
button,a {touch-action:manipulation}
button {cursor:pointer}
button:disabled {cursor:wait;opacity:.6}
a {color:inherit}
:focus-visible {outline:3px solid #2ba79d;outline-offset:3px}
.skip {position:fixed;top:6px;left:8px;z-index:10;background:white;padding:10px;transform:translateY(-140%)}
.skip:focus {transform:none}
.top {min-height:76px;background:var(--navy);color:white;display:grid;grid-template-columns:minmax(220px,1fr) minmax(280px,500px) minmax(145px,1fr);align-items:center;gap:24px;padding:14px 32px}
.brand {display:flex;align-items:center;gap:11px;text-decoration:none;width:max-content}
.brand img {border-radius:10px}
.brand strong {font-size:1.32rem;line-height:1.1;display:block;letter-spacing:-.045em}
.brand strong span {color:#9ce5d7}
.brand small {color:#d0e0ea;font-size:.76rem;display:block;margin-top:2px}
.suite {justify-self:end;color:#d8e8f1;font-size:.9rem;text-decoration:none;border:1px solid #5a7081;padding:7px 12px;border-radius:7px}
.suite:hover {color:#fff;background:#284153}
.search {position:relative}
.search label {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.search input {width:100%;padding:10px 13px;border:1px solid #536a7d;border-radius:8px;background:#21394c;color:white}
.search input::placeholder {color:#bdcfdb}
.matches {z-index:5;position:absolute;top:calc(100% + 6px);width:100%;background:white;color:var(--ink);border:1px solid var(--line);border-radius:9px;box-shadow:0 16px 30px #11283b25;max-height:65vh;overflow:auto}
.matches button {display:block;width:100%;text-align:left;border:0;border-bottom:1px solid var(--line);padding:11px 13px;background:white;color:var(--ink)}
.matches button:hover {background:var(--mint)}
.matches small,.machine small,.muted {color:var(--muted)}
.matches small,.machine small {display:block}
.layout {max-width:1700px;margin:auto;display:grid;grid-template-columns:244px minmax(0,1fr);min-height:calc(100vh - 76px)}
.side {background:#e9f0f5;border-right:1px solid var(--line);padding:28px 16px}
.side-heading {display:flex;align-items:center;justify-content:space-between;margin-bottom:17px}
.side h2 {font-size:.93rem;margin:0}
.machine {display:block;text-align:left;width:100%;border:1px solid transparent;border-radius:9px;background:none;padding:10px 11px;margin:0 0 5px;color:var(--ink);line-height:1.35}
.machine small {font: .78rem/1.6 var(--mono)}
.machine:hover {background:#f4f8fa}
.machine[aria-current=true] {background:white;border-color:#c3d5de;box-shadow:inset 3px 0 var(--accent)}
main {padding:28px clamp(17px,3.2vw,46px) 40px;min-width:0}
.app-status {margin:0;color:var(--accent-dark);font-size:.9rem}
.app-status:not(:empty) {margin-bottom:11px}
.app-status[data-error] {color:#a12836}
.crumb {color:var(--muted);font: .85rem/1.5 var(--mono);margin:0 0 6px}
.title {display:flex;align-items:start;justify-content:space-between;gap:14px;margin-bottom:23px}
.title h1 {font-size:clamp(1.9rem,3vw,2.75rem);line-height:1.06;letter-spacing:-.046em;margin:0 0 8px}
.title p {margin:0;color:var(--muted);max-width:64ch}
.row {display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.button {appearance:none;display:inline-flex;align-items:center;justify-content:center;min-height:38px;border:1px solid #c8d7de;background:white;border-radius:7px;color:var(--ink);padding:6px 12px;text-decoration:none;font-size:.87rem;font-weight:650;white-space:nowrap}
.button:hover {background:#f0f7fa;border-color:#a9c3cc}
.button.primary {background:var(--accent);color:white;border-color:var(--accent)}
.button.primary:hover {background:var(--accent-dark)}
.button.small {min-height:32px;font-size:.8rem;padding:4px 9px}
.button.danger {color:#a12836}
.tabs {display:flex;align-items:center;flex-wrap:wrap;gap:7px;border-bottom:1px solid var(--line);margin-bottom:16px;padding-bottom:9px}
.tab[aria-current=true] {background:var(--mint);border-color:#a5d9d1;color:var(--accent-dark)}
.panels {display:grid;grid-template-columns:minmax(0,1.13fr) minmax(330px,1fr);align-items:start;gap:15px}
.card {min-width:0;background:var(--surface);border:1px solid var(--line);border-radius:11px;overflow:hidden}
.card-head {display:flex;justify-content:space-between;align-items:center;gap:8px;min-height:58px;padding:10px 14px}
.card-head h2 {font-size:1rem;margin:0}
.card-head small {font-size:.82rem;color:var(--muted)}
.drawing {position:relative;background:#eff4f8;isolation:isolate}
.drawing img {display:block;width:100%;height:auto}
.drawing.picking {cursor:crosshair}
.marker {position:absolute;translate:-50% -50%;width:34px;height:34px;border-radius:50%;border:2px solid white;box-shadow:0 2px 7px #142e4b45;color:#fff;background:#23536c;font:700 .78rem/1 var(--mono);display:grid;place-items:center}
.marker[aria-pressed=true] {background:var(--accent-dark);box-shadow:0 0 0 4px #3da99c50}
.drawing-hint {border-top:1px solid var(--line);font-size:.84rem;color:var(--muted);padding:10px 14px;margin:0}
.empty {padding:26px 16px;color:var(--muted);margin:0}
.table-wrap {overflow-x:auto}
table {width:100%;border-collapse:collapse;text-align:left}
th,td {border-top:1px solid var(--line);padding:10px 8px;font-size:.87rem;vertical-align:middle}
th {background:#f3f7f9;color:var(--muted);font-weight:650;font-size:.78rem}
th:first-child,td:first-child {padding-left:13px}
th:last-child,td:last-child {padding-right:13px}
tbody tr[data-selected] {background:#e9f7f3}
td .pick {padding:0;background:none;border:0;color:var(--accent-dark);font:700 .83rem/1.5 var(--mono);text-align:left}
td .pick:hover {text-decoration:underline}
td:last-child,th:last-child {text-align:right}
.code {font-family:var(--mono);overflow-wrap:anywhere}
.part-detail {border-top:1px solid var(--line);padding:12px 14px}
.part-detail h3 {margin:0 0 3px;font-size:.94rem}
.part-detail p {margin:0 0 9px;color:var(--muted);overflow-wrap:anywhere;font-size:.88rem}
dialog {width:min(520px,calc(100% - 24px));max-height:90dvh;padding:0;border:1px solid var(--line);border-radius:12px;color:var(--ink);background:white}
dialog::backdrop {background:#142b3eaa}
dialog form {padding:17px}
.editor-head,.editor-foot {display:flex;justify-content:space-between;align-items:center;gap:8px}
.editor-head h2 {font-size:1.18rem;margin:0}
.editor-foot {padding-top:12px;justify-content:flex-end}
.editor-foot .danger {margin-right:auto}
#editor-fields {display:grid;gap:11px;margin-top:17px}
#editor-fields label {display:grid;gap:4px;font-size:.88rem;font-weight:650}
input:not([type=search]),textarea {border:1px solid #b9cbd4;border-radius:7px;color:var(--ink);padding:7px 9px;min-width:0;width:100%}
textarea {resize:vertical}
.error {color:#a12836;margin:8px 0 0;font-size:.87rem}
@media(max-width:1160px) {.panels {grid-template-columns:1fr}}
@media(max-width:740px) {
 .top {grid-template-columns:1fr auto;gap:12px;padding:12px 14px}
 .top .search {grid-column:1/-1;grid-row:2}
 .layout {grid-template-columns:1fr}
 .side {padding:11px 14px;border-right:0;border-bottom:1px solid var(--line)}
 .side-heading {margin-bottom:5px}
 .side nav {display:flex;gap:5px;overflow:auto}
 .machine {width:auto;min-width:130px}
 main {padding:15px 13px 30px}
 .title {flex-direction:column}
 .card-head {flex-wrap:wrap}
}

.account { max-width: 36rem; margin: 2rem auto; padding: 0 1rem; }
.account-manager { max-width: 62rem; }
.account .card { padding: 1rem 1.25rem; margin: 1rem 0; }
.account-form { display: grid; gap: .8rem; align-items: start; max-width: 30rem; }
.account-form label { display: grid; gap: .25rem; }
.account-form .choice { display: flex; align-items: center; gap: .5rem; }
.account-form .button { justify-self: start; }
.account input:not([type=checkbox]), .account select, #catalog-space {
  font: inherit; border: 1px solid #9eacbb; padding: .5rem .65rem; border-radius: .35rem; max-width: 100%;
}
.account details { padding: .5rem 0; }
.account details form { margin: .65rem 0; }
.account summary { cursor: pointer; }
.account .inline-form { display: inline; }
#catalog-space { width: 100%; margin: .4rem 0 1rem; }
body[data-readonly] #workspace [data-action]:not([data-action=export], [data-action=studio], [data-action=balloon], [data-action=balloon-part]) { display: none; }
.files { margin: .65rem 0; }
.files ul { padding-left: 1.25rem; overflow-wrap: anywhere; }
.files summary { cursor: pointer; }
.part-photo { display: block; max-width: min(100%, 16rem); max-height: 12rem; object-fit: contain; margin: .5rem 0; }

.plate-art { display: block; width: 100%; height: auto; }
.studio-callout { cursor: pointer; }
.studio-callout:focus-visible { outline: 2px solid #138b85; }
.studio-dialog { width: min(1460px, calc(100% - 20px)); max-height: 95dvh; }
.studio-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 18px; background: #153044; color: white; }
.studio-head h2 { margin: 0 0 4px; font-size: 1.12rem; }
.studio-head span { font-size: .9rem; color: #cadde7; }
.studio-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 9px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.studio-toolbar label, .studio-tools label { display: grid; gap: 4px; font-size: .82rem; }
.studio-toolbar input[type=file] { width: 14rem; max-width: 100%; }
.studio-status { min-height: 2.1rem; padding: 7px 16px; font-size: .9rem; color: var(--muted); }
.studio-work { display: grid; grid-template-columns: minmax(165px, 225px) minmax(0,1fr); align-items: start; border-top: 1px solid var(--line); }
.studio-tools { padding: 13px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.studio-tools label, .studio-tools .row { grid-column: 1 / -1; }
.studio-tools input:not([type=color]), .studio-dialog select { width: 100%; min-width: 0; border: 1px solid var(--line); background: white; color: var(--ink); padding: .39rem; border-radius: 5px; font: inherit; }
.studio-tools .button { justify-content: center; }
.studio-tools [aria-pressed=true] { color: white; background: #11766e; }
.studio-paper { padding: 15px; background: #e5eef3; display: grid; place-items: start center; }
.studio-paper svg { display: block; width: 100%; max-height: 73dvh; touch-action: none; cursor: crosshair; }
.studio-paper svg .chosen { filter: drop-shadow(0 0 3px #18a99b); }
@media (max-width: 700px) {
  .studio-work { grid-template-columns: 1fr; }
  .studio-tools { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .studio-tools label, .studio-tools .row { grid-column: span 2; }
  .studio-paper { padding: 7px; }
}
.studio-progress { grid-column: 1 / -1; color: var(--muted); }
.studio-paper svg [data-end] { cursor: move; }
.marker.marker--embedded { opacity: 0; }
.marker.marker--embedded:is(:hover,:focus-visible,[aria-pressed=true]) { opacity: 1; }
@media (min-width: 701px) {
  .studio-dialog[open] {
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    height: min(900px, 95dvh);
  }
  .studio-dialog .studio-work { min-height: 0; align-items: stretch; }
  .studio-dialog .studio-tools { align-content: start; overflow: auto; min-height: 0; }
  .studio-dialog .studio-paper { min-height: 0; display: flex; align-items: center; justify-content: center; }
  .studio-dialog .studio-paper svg { height: 100%; max-height: none; }
}
