@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600&display=swap');

:root{
  --forest:#1c2e28;
  --green:#4f7d62;
  --green-dark:#35513a;
  --lime:#c8daac;
  --amber:#bb955d;
  --stone:#9b9c89;
  --paper:#f7f8f4;
  --panel:#fff;
  --ink:#24342b;
  --muted:#7c857a;
  --line:#e3e7dd;
  --soft:#eef2e9;
  --danger:#a44b3d;
  --lift:0 1px 2px #1c2e280a,0 6px 20px #1c2e280d;
  font-family:'DM Sans',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  font-size:14px;
  line-height:1.45;
  color:var(--ink);
}
*{box-sizing:border-box}
body{margin:0;background:var(--paper)}
h1,h2,h3,p,ul,dl,dd{margin:0;padding:0}
ul{list-style:none}
img{display:block;max-width:100%}
button,input,select,textarea{font:inherit;color:inherit}
button{background:none;border:0;cursor:pointer;padding:0}
:focus-visible{outline:2px solid var(--green);outline-offset:2px}
.icon{width:18px;height:18px}
.muted{color:var(--muted)}
.small{font-size:12px}

/* Header */
.bar{display:flex;align-items:center;gap:32px;height:52px;padding:0 24px;background:var(--forest);color:#dfe6dc;position:sticky;top:0;z-index:10}
.wordmark{font-weight:600;letter-spacing:-.2px;color:#fff}
.bar nav{display:flex;gap:4px;height:100%}
.bar nav button{height:100%;padding:0 12px;color:#a5b0a2;border-bottom:2px solid transparent}
.bar nav button:hover{color:#fff}
.bar nav button[aria-current]{color:#fff;border-bottom-color:var(--lime)}
.bar-button{margin-left:auto;padding:6px 14px;border:1px solid #3d5246;border-radius:6px;color:#fff}
.bar-button:hover{background:#263b31}

main{max-width:1180px;margin:0 auto;padding:28px 24px 64px}
.title-row{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:20px}
h1{font-size:22px;font-weight:600;letter-spacing:-.3px}
.meta{color:var(--muted);margin-top:2px}
h2{font-size:15px;font-weight:600}
h3{font-size:13px;font-weight:600}
.link{color:var(--green-dark);font-weight:500;text-decoration:underline;text-underline-offset:3px;text-decoration-color:var(--line)}
.link:hover{text-decoration-color:currentColor}

.panel{background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:18px;box-shadow:var(--lift)}
.panel>h2,.panel>h3{margin-bottom:12px}
.section-head{display:flex;align-items:baseline;gap:12px;margin:28px 0 12px}
.section-head:first-child{margin-top:0}

/* Plan */
.plan{display:grid;grid-template-columns:minmax(0,1fr) 380px;gap:20px;align-items:start}
.map{padding:18px;background-color:#fbfcf9;background-image:radial-gradient(#dfe5d9 1px,transparent 1.2px);background-size:18px 18px}
.map-head{display:flex;align-items:center;gap:14px;margin-bottom:6px}
.map-icon{display:flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:12px;background:#fff;border:1px solid var(--line);color:var(--green-dark);box-shadow:var(--lift)}
.map-icon .glyph{width:22px;height:22px}
.map-head h2{font-size:17px}
.map-head p{font-size:13px;color:var(--muted)}
.map svg{display:block;width:100%;height:auto}
.stage{fill:#e4ebdd;stroke:#d3dccb}
.stage-art,.audience{color:#8a9a88}
.stage-label,.audience-label{text-anchor:middle;font-size:16px;font-weight:500;fill:#8a9a88}
.audience,.audience-label{color:#a3ae9f;fill:#a3ae9f}
.cone-s1{stop-color:#c9a26a}
.cone-s5{stop-color:#6f9a78}
.marker{cursor:grab;color:var(--green-dark);touch-action:none}
.dragging .marker{cursor:grabbing}
.marker .m{transform:scale(1.3)}
.marker.s1{color:#9a7440}
.marker .rig{fill:currentColor}
.marker .rig .legs{fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
.marker .pill{fill:currentColor}
.marker .model{fill:#fff;text-anchor:middle;font-size:13px;font-weight:600;letter-spacing:.2px}
.marker .badge circle{fill:#fff;stroke:var(--line);stroke-width:1;filter:url(#lift)}
.marker .badge svg{color:currentColor}
.marker .card{fill:#fff;stroke:var(--line);stroke-width:1;filter:url(#lift)}
.marker.selected .card{stroke:currentColor;stroke-width:1.6}
.marker .lens{text-anchor:middle;font-size:15px;font-weight:600;fill:var(--ink)}
.marker .exp{text-anchor:middle;font-size:13px;fill:var(--muted);font-variant-numeric:tabular-nums}
.marker:focus-visible{outline:none}
.marker:focus-visible .card{stroke:currentColor;stroke-dasharray:4 3}
.legend{display:flex;flex-wrap:wrap;align-items:center;gap:10px 18px;margin-top:8px;padding:12px 16px;font-size:12.5px;color:var(--ink);background:#fff;border:1px solid var(--line);border-radius:12px}
.legend span{display:flex;align-items:center;gap:7px}
.legend .glyph{width:17px;height:17px;color:var(--ink)}
.legend-gap{flex:0 0 1px;align-self:stretch;background:var(--line)}
.dot{width:10px;height:10px;border-radius:50%;display:inline-block;background:var(--stone)}
.dot.s1{background:#9a7440}
.dot.s5{background:var(--green-dark)}

.inspector{padding:0;overflow:hidden}
.inspector-head{display:flex;align-items:center;gap:12px;padding:20px 18px 26px;color:#fff;background:linear-gradient(120deg,#22392f 0%,#2d4a3a 55%,#1f3229 100%);position:relative}
.inspector-head::after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:14px;background:#fff;border-radius:16px 16px 0 0}
.num-badge{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;background:#b58d54;color:#fff;font-size:15px;font-weight:600;flex-shrink:0}
.num-badge.small{width:22px;height:22px;font-size:11px;margin-right:10px;vertical-align:middle;background:var(--stone)}
.num-badge.small.green{background:var(--green)}
.num-badge.small.amber{background:var(--amber)}
.cam-name{flex:1;min-width:0;font-size:19px;font-weight:600;color:#fff;border:0;border-bottom:1px solid transparent;padding:4px 0;background:none}
.cam-name:hover,.cam-name:focus{border-bottom-color:#ffffff55;outline:none}
.step{display:flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:9px;border:1px solid #ffffff30;background:#ffffff14;color:#fff;flex-shrink:0}
.step:hover{background:#ffffff26}
.step .glyph{width:16px;height:16px}
.inspector .fields{padding:6px 18px 20px}

.fields,.form{display:grid;grid-template-columns:1fr 1fr;gap:16px 14px}
.field{display:flex;flex-direction:column;gap:7px;min-width:0}
.field>span{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--ink);font-weight:500}
.field>span .glyph{width:18px;height:18px;color:var(--green-dark)}
.field.wide,.actions.wide{grid-column:1/-1}
.field input:not([type=checkbox]),.field select,.field textarea,.copy input{width:100%;height:42px;padding:0 12px;border:1px solid var(--line);border-radius:10px;background:#fff;box-shadow:0 1px 2px #1c2e280a;font-size:14.5px}
.field textarea{height:auto;padding:10px 12px;resize:vertical}
.field input:focus,.field select:focus,.field textarea:focus{outline:none;border-color:var(--green)}
.field.check{flex-direction:row;align-items:center;gap:10px;height:28px}
.field.check>.glyph{width:18px;height:18px;color:var(--green-dark)}
.field.check span{color:var(--ink);font-size:14px}
input[type=checkbox]{accent-color:var(--green-dark);width:18px;height:18px;margin:0}
.prefixed{display:flex;align-items:center;border:1px solid var(--line);border-radius:10px;height:42px;padding-left:12px;background:#fff;box-shadow:0 1px 2px #1c2e280a}
.prefixed:focus-within{border-color:var(--green)}
.prefixed span{color:var(--muted)}
.field .prefixed input{border:0;height:40px;padding-left:2px;box-shadow:none}
.notes{margin-top:20px}
.notes p{white-space:pre-line;color:var(--ink)}

/* Equipment */
.gear-group{margin-bottom:28px}
.gear-group>h3{font-size:14px;margin-bottom:12px}
.gear{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:16px}
.gear-card{background:#fff;border:1px solid var(--line);border-radius:14px;overflow:hidden;box-shadow:var(--lift);display:flex;flex-direction:column}
.gear-photo{display:block;width:100%;aspect-ratio:4/3;background:var(--soft);overflow:hidden}
.gear-photo img{width:100%;height:100%;object-fit:cover;transition:transform .25s}
button.gear-photo:hover img{transform:scale(1.03)}
.gear-photo.product{background:#fff;border-bottom:1px solid var(--soft)}
.gear-photo.product img{object-fit:contain;padding:14px}

.gear-photo.empty{display:flex;align-items:center;justify-content:center;color:#b3bdaf}
.gear-photo.empty .glyph{width:40px;height:40px;stroke-width:1.2}
.gear-info{display:flex;flex-wrap:wrap;align-items:flex-start;align-content:flex-start;gap:10px;padding:12px 14px;flex:1}
.item{display:flex;flex-direction:column;flex:1;min-width:0}
.item>span{font-weight:500}
.item small{color:var(--muted);font-size:12px}
.gear-note{display:block;flex-basis:100%;padding:6px 9px;border-radius:8px;background:#f3efe4;color:#6e5532;font-style:normal;font-size:12.5px;line-height:1.35}
.usage{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums;background:var(--soft);border-radius:999px;padding:2px 8px}
.usage.over{color:#fff;background:var(--danger);font-weight:600}
.icon-button{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:6px;color:var(--muted);flex-shrink:0}
button.icon-button:hover{background:var(--soft);color:var(--ink)}

/* Settings */
.defaults{display:grid;grid-template-columns:repeat(3,1fr);padding:0;margin-bottom:12px}
.iso-tip{margin:0 0 16px;padding:12px 16px;border-radius:12px;background:#f3efe4;color:#6e5532;font-size:13.5px}
.iso-tip strong{color:#5a4426;font-weight:600}
.defaults>*{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 4px;padding:16px 18px;border-left:1px solid var(--line)}
.defaults>:first-child{border-left:0}
.defaults span{width:100%;font-size:12px;color:var(--muted)}
.defaults strong,.defaults input{font-size:22px;font-weight:500;font-variant-numeric:tabular-nums}
.defaults input{width:3.2em;field-sizing:content;min-width:2ch;border:0;border-bottom:1px dashed var(--line);padding:0;background:none}
.defaults input:focus{outline:none;border-bottom-color:var(--green)}
.defaults em{font-style:normal;color:var(--muted)}
.settings-cols{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:16px;margin-bottom:16px;align-items:start}
.guide{display:block;width:100%;margin-bottom:10px}
.guide img{border-radius:6px;width:100%}
dl{display:grid;grid-template-columns:auto 1fr;gap:10px 16px}
dt{font-weight:500;white-space:nowrap}
dd{color:var(--muted)}
.table-wrap{overflow-x:auto}
table{width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums}
th{text-align:left;font-weight:500;font-size:12px;color:var(--muted);padding:0 12px 8px 0;border-bottom:1px solid var(--line)}
td{padding:10px 12px 10px 0;border-bottom:1px solid var(--soft);white-space:nowrap}
tr:last-child td{border-bottom:0}

/* Dialog */
dialog{border:0;border-radius:10px;padding:20px;width:min(520px,calc(100vw - 32px));color:var(--ink);box-shadow:0 10px 40px #1c2e2833}
dialog::backdrop{background:#1c2e2866}
.modal-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}
.modal-head h2{font-size:17px}
dialog p{margin-bottom:16px}
.copy{display:flex;gap:8px;margin-bottom:10px}
.copy input{flex:1;min-width:0;color:var(--muted)}
.actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.actions.spread .button{flex:1}
.button{height:36px;padding:0 14px;border:1px solid var(--line);border-radius:6px;font-weight:500;white-space:nowrap;background:#fff}
.button:hover{background:var(--soft)}
.button.primary{background:var(--green-dark);border-color:var(--green-dark);color:#fff}
.button.primary:hover{background:var(--forest)}
.lightbox{width:100%;border-radius:6px}
dialog:has(.lightbox){width:min(960px,calc(100vw - 32px))}

.toast{position:fixed;left:50%;bottom:24px;transform:translate(-50%,12px);background:var(--forest);color:#fff;padding:9px 16px;border-radius:6px;font-size:13px;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;z-index:50}
.toast.visible{opacity:1;transform:translate(-50%,0)}

@media (max-width:860px){
  .plan,.settings-cols{grid-template-columns:1fr}
  .gear{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .gear-info{padding:10px 11px}
  .defaults>*{padding:14px 12px}
  .defaults strong,.defaults input{font-size:19px}
  .inspector{scroll-margin-top:64px}
  .map{padding:12px}
  .map-head{margin-bottom:0}
  .legend .legend-gap{display:none}
}
@media (max-width:560px){
  .bar{gap:12px;padding:0 14px}
  .bar nav button{padding:0 8px}
  .wordmark{display:none}
  main{padding:20px 14px 48px}
  .fields,.form{grid-template-columns:1fr 1fr}
}
@media print{
  .bar,.title-row .link,.icon-button,.toast{display:none}
  body{background:#fff}
  main{padding:0}
  .panel{border-color:#ddd;break-inside:avoid}
}

/* Plan versions */
.title-actions{display:flex;align-items:center;gap:14px;flex-wrap:wrap;justify-content:flex-end}
#plan-status{display:flex;align-items:center;gap:10px}
#plan-status:empty{display:none}
.draft-tag{font-size:12px;font-weight:500;color:#6e5532;background:#f3efe4;border-radius:999px;padding:3px 10px}
.plan-switch{height:34px;padding:0 10px;border:1px solid var(--line);border-radius:9px;background:#fff;font-size:13.5px;max-width:220px}
@media (max-width:560px){.title-row{flex-direction:column;gap:8px}.title-actions{justify-content:flex-start}}
