:root {
  color-scheme: light;
  --paper: #f6f4ed;
  --white: #fffdf8;
  --ink: #142d2b;
  --muted: #53645f;
  --line: #d8ddd2;
  --teal: #21564e;
  --deep: #173a36;
  --soft: #e7eee3;
  --accent: #e5b65e;
  --radius: 15px;
  --marker-x: 57.6968%;
  --marker-y: 54.4118%;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.45;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
:focus-visible { outline: 3px solid #a75810; outline-offset: 3px; }
[hidden] { display: none !important; }
.shell { width: min(calc(100% - 64px), 1450px); margin-inline: auto; }
.masthead { background: var(--white); border-bottom: 1px solid var(--line); }
.masthead-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 15px; font-weight: 750; white-space: nowrap; line-height: 1.15; }
.brand small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 550; }
.brand-mark { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 9px; background: var(--deep); color: #f8f2da; }
.brand-mark svg { width: 26px; }
.primary-nav { display: flex; align-items: center; gap: 4px; }
.primary-nav a { padding: 8px 14px; border-radius: 7px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 620; }
.primary-nav a:hover, .primary-nav a[aria-current="page"] { background: var(--soft); color: var(--deep); }
.access-mode { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; font-weight: 630; }
.access-mode select { min-height: 36px; }
input, select { min-width: 0; padding: 7px 10px; border: 1px solid #b8c6bb; border-radius: 7px; color: var(--ink); background: var(--white); }
select { padding-right: 24px; }
main { padding-block: 28px 20px; min-height: calc(100vh - 118px); }
h1, h2, h3, p, figure { margin: 0; }
h1 { font-size: clamp(27px, 4vw, 38px); letter-spacing: -.042em; line-height: 1.13; }
h2 { font-size: 20px; letter-spacing: -.022em; line-height: 1.25; }
h3 { font-size: 15px; letter-spacing: -.01em; }
p { text-wrap: pretty; }
.meta, .muted, .hint { color: var(--muted); }
.meta { font-size: 12px; font-weight: 620; }
.hint { font-size: 13px; }
.crumb { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 8px; color: var(--muted); font-size: 13px; text-decoration: none; }
.crumb:hover { color: var(--deep); text-decoration: underline; }
.crumb svg { width: 15px; height: 15px; }
.view-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 20px; }
.view-heading .meta { margin-top: 6px; }
.heading-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.button, .icon-button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 38px; padding: 7px 12px; border: 1px solid #becbbf; border-radius: 8px; color: var(--ink); background: var(--white); text-decoration: none; font-size: 13px; line-height: 1.18; font-weight: 690; white-space: nowrap; }
.button:hover:not(:disabled), .icon-button:hover:not(:disabled) { border-color: #829d91; background: #edf2e9; }
.button svg, .icon-button svg { flex: 0 0 17px; width: 17px; height: 17px; }
.button.primary { color: #fffdf4; background: var(--teal); border-color: var(--teal); }
.button.primary:hover:not(:disabled) { background: var(--deep); border-color: var(--deep); }
.button.full { width: 100%; }
.button.subtle { border-color: transparent; background: transparent; }
.icon-button { min-width: 35px; min-height: 34px; padding: 4px; }
.status { display: inline-flex; align-items: center; gap: 7px; margin-right: 4px; font-size: 12px; font-weight: 650; color: var(--muted); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #538267; }
.status[data-state="dirty"]::before { background: #a65a18; }
.status[data-state="readonly"]::before { background: #61706d; }
.panel, .library-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.library-heading { margin-bottom: 24px; }
.library-heading p { margin-top: 7px; color: var(--muted); font-size: 14px; }
.library-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.library-main { min-width: 0; }
.search-label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 720; }
.search-field { position: relative; margin-bottom: 16px; }
.search-field svg { position: absolute; top: 12px; left: 12px; width: 19px; height: 19px; color: var(--muted); pointer-events: none; }
.search-field input { width: 100%; min-height: 43px; padding-left: 39px; }
.library-card { width: 100%; overflow: hidden; padding: 0; text-align: left; color: var(--ink); }
.library-card:hover { border-color: #7e9b8f; }
.library-card[aria-pressed="true"] { border-color: #5b8879; box-shadow: 0 0 0 1px #5b8879; }
.library-cover { display: grid; place-items: center; min-height: 160px; max-height: 340px; overflow: hidden; background: #e1e7dc; }
.library-cover img { width: 100%; height: min(34vh, 330px); object-fit: contain; }
.library-card-body { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 17px 20px; }
.library-card-body svg { flex: 0 0 20px; width: 20px; height: 20px; color: var(--teal); }
.library-card-body .meta { display: block; margin-top: 4px; }
.alternative-group { border: 0; margin: 0; padding: 0; min-width: 0; }
.library-option { display: grid; width: 100%; grid-template-columns: 20px 1fr; gap: 10px; align-items: center; margin-bottom: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.library-option:has(input:checked) { background: #eff3e9; border-color: #8ea69a; }
.library-option input { accent-color: var(--teal); margin: 0; }
.library-option span > small { display: block; color: var(--muted); font-size: 12px; }
.library-panel { margin-top: 67px; padding: 18px; }
.library-panel h2 { margin: 3px 0 16px; }
.library-panel .button { margin-top: 10px; }
.empty { padding: 26px; border: 1px dashed #b5c3b7; border-radius: 12px; background: #fbfaf5; text-align: center; }
.empty .button { margin-top: 13px; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 312px); align-items: start; gap: 17px; }
.drawing-panel { min-width: 0; overflow: hidden; }
.toolstrip, .stage-footer, .inspect-switch { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 10px 13px; }
.toolstrip, .inspect-switch { border-bottom: 1px solid var(--line); }
.toolstrip .button, .inspect-switch .button { min-height: 34px; font-size: 12px; }
.button[aria-pressed="true"] { color: var(--deep); background: #e3ede0; border-color: #8ba99a; }
.divider { width: 1px; height: 22px; margin-inline: 4px; background: var(--line); }
.spacer { flex: 1; }
.stage { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; min-height: min(43vh, 420px); padding: 13px; background: #e4e9de; }
.image-wrap { position: relative; max-width: 100%; width: max-content; line-height: 0; }
.image-wrap img { width: auto; height: auto; max-height: min(52vh, 540px); object-fit: contain; }
.marker { position: absolute; top: var(--marker-y); left: var(--marker-x); transform: translate(-50%, -50%); display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 2px solid var(--white); border-radius: 50%; background: var(--deep); color: white; font-size: 11px; font-weight: 790; box-shadow: 0 1px 6px #142d2b88; }
.marker[aria-pressed="true"] { border-color: var(--deep); background: #f2c671; color: #24322c; box-shadow: 0 0 0 3px #fffdf8, 0 1px 8px #142d2b94; }
.marker::after { position: absolute; content: ""; left: calc(50% - 2px); top: -7px; width: 5px; height: 4px; border-radius: 1px; background: var(--deep); transform: rotate(var(--bearing, 0deg)); transform-origin: 2px 23px; }
.stage-footer { min-height: 47px; justify-content: space-between; font-size: 12px; color: var(--muted); }
.stage-footer strong { color: var(--ink); }
.context-panel { overflow: hidden; }
.context-section { padding: 16px; }
.context-section + .context-section { border-top: 1px solid var(--line); }
.context-section h2 { margin-top: 3px; }
.context-section h3 { margin-bottom: 9px; }
.context-section .hint { margin-top: 5px; }
.location-row { display: flex; gap: 9px; align-items: center; width: 100%; padding: 9px; border: 1px solid #b7c8ba; background: #eef3e9; border-radius: 8px; text-align: left; color: var(--ink); font-size: 13px; }
.location-row:hover { background: #e2ede0; }
.location-row .dot-label { background: #dce9db; flex: 0 0 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; font-size: 11px; font-weight: 770; }
.location-row small { display: block; font-size: 11px; color: var(--muted); }
.controls-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.controls-grid label { font-size: 12px; font-weight: 690; }
.controls-grid input { display: block; margin-top: 4px; width: 100%; }
.transform-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.fields-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 11px 0 0; }
.fields-summary div { padding: 7px 8px; background: #f1f3ec; border-radius: 7px; }
.fields-summary dt { color: var(--muted); font-size: 11px; }
.fields-summary dd { margin: 2px 0 0; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.context-section > .button { margin-top: 12px; }
.context-list { margin: 11px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 13px; }
.context-list li + li { margin-top: 9px; }
.context-list strong { display: block; color: var(--ink); font-size: 13px; }
.inspect-scene { min-height: min(47vh, 440px); }
.inspect-scene img { max-height: min(53vh, 545px); }
.review-summary { min-width: 0; overflow: hidden; }
.review-summary .section-head { padding: 17px 18px; display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.review-image { display: grid; place-items: center; padding: 10px; background: #e4e9de; }
.review-image img { max-height: min(38vh, 400px); }
.review-summary .change-log { padding: 16px 18px; display: flex; gap: 13px 22px; flex-wrap: wrap; }
.change-log span { color: var(--muted); font-size: 13px; }
.change-log strong { color: var(--ink); }
.handoff-list { margin: 13px 0 0; padding: 0; list-style: none; }
.handoff-list li { padding: 10px 0; border-top: 1px solid var(--line); }
.handoff-list li strong { display: block; font-size: 13px; }
.handoff-list li span { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.footer { display: flex; justify-content: space-between; gap: 15px; padding-block: 9px 13px; color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 2; translate: 0 -200%; padding: 8px 11px; border-radius: 5px; background: var(--white); }
.skip-link:focus { translate: 0; }
@media (max-width: 920px) {
  .shell { width: calc(100% - 36px); }
  .workspace-grid { grid-template-columns: minmax(0, 1fr) 245px; gap: 12px; }
  .library-grid { grid-template-columns: minmax(0, 1fr) 270px; gap: 15px; }
}
@media (max-width: 680px) {
  .shell { width: calc(100% - 26px); }
  .masthead-inner { flex-wrap: wrap; gap: 4px 8px; padding-block: 8px; }
  .primary-nav { order: 3; width: 100%; }
  .primary-nav a { flex: 1; text-align: center; }
  .view-heading { align-items: start; flex-direction: column; gap: 9px; margin-bottom: 13px; }
  .workspace-grid, .library-grid { grid-template-columns: minmax(0, 1fr); }
  .library-panel { margin-top: 0; }
  .stage { min-height: 0; }
  .access-mode > span { display: none; }
  main { padding-top: 18px; }
}
