/* LePlan — razporeditev in komponente (ploskost: brez senc, gradientov, okvirjev kartic, barvnih robnih trakov) */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 13px/1.45 var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: transparent; padding: 0; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.num, input[type="text"].num, td.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

#app { display: grid; grid-template-rows: 44px minmax(0, 1fr) 28px; grid-template-columns: minmax(0, 1fr); height: 100%; width: 100%; overflow: hidden; }
/* zgornja vrstica */
#topbar { display: flex; align-items: center; gap: 6px; padding: 0 10px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; background: var(--bg); border-bottom: 1px solid var(--line); min-width: 0; }
.brand { font-weight: 700; letter-spacing: -.02em; font-size: 15px; margin-right: 6px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.brand i { width: 14px; height: 14px; background: var(--accent); display: inline-block; border-radius: 3px; }
#projName { background: transparent; border: 0; padding: 5px 7px; border-radius: var(--radius); width: 150px; min-width: 60px; font-weight: 500; }
#projName:hover, #projName:focus { background: var(--panel); }
.sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; flex: none; }
.spacer { flex: 1; min-width: 4px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: var(--radius); background: var(--panel); color: var(--ink); white-space: nowrap; transition: background var(--t); min-height: 30px; }
.btn:hover { background: var(--panel-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; } .btn.ghost:hover { background: var(--panel); }
.btn.on, .btn[aria-pressed="true"] { background: var(--accent-soft-2); color: var(--accent); font-weight: 600; }
.btn.danger { color: var(--err); }
.btn.sm { padding: 3px 8px; min-height: 26px; font-size: 12px; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.ic { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.seg { display: inline-flex; background: var(--panel); border-radius: var(--radius); padding: 2px; gap: 2px; }
.seg button { padding: 4px 10px; border-radius: 4px; min-height: 26px; transition: background var(--t); }
.seg button[aria-pressed="true"], .seg button.on { background: var(--bg); font-weight: 600; color: var(--accent); }
select, input[type="text"], input[type="search"], input[type="number"], textarea { background: var(--panel); border: 0; border-radius: var(--radius); padding: 5px 8px; min-height: 28px; width: 100%; transition: background var(--t); }
select { width: auto; cursor: pointer; }
input:hover, select:hover, textarea:hover { background: var(--panel-2); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
input[type="range"] { accent-color: var(--accent); width: 100%; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 15px; height: 15px; }
.save { font-size: 11.5px; color: var(--ink-3); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.save.error { color: var(--err); } .save.dirty { color: var(--warn); }
/* glavno območje */
#main { position: relative; display: grid; grid-template-columns: var(--lw, 264px) minmax(0, 1fr) var(--rw, 330px); min-height: 0; transition: grid-template-columns var(--t); }
#main.noleft { --lw: 0px; } #main.noright { --rw: 0px; }
.side { background: var(--panel); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
#left { border-right: 1px solid var(--line); } #right { border-left: 1px solid var(--line); }
#main.noleft #left, #main.noright #right { display: none; }
.tabs { display: flex; gap: 2px; padding: 8px 8px 0; }
.tabs button { padding: 6px 9px; border-radius: 5px 5px 0 0; color: var(--ink-3); font-weight: 500; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); background: var(--bg); font-weight: 600; }
.pane { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px; background: var(--bg); min-height: 0; }
details > summary + * { margin-top: 4px; }
.pane .fgrid input { min-width: 0; }
.pane h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 18px 0 8px; font-weight: 600; }
.pane h3:first-child { margin-top: 0; }
.row { display: flex; gap: 8px; align-items: center; margin: 5px 0; }
.row > label { flex: 0 0 96px; color: var(--ink-3); font-size: 12px; }
.row > .grow { flex: 1; min-width: 0; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; }
.fgrid label { display: block; color: var(--ink-3); font-size: 11.5px; margin-bottom: 2px; }
.unit { color: var(--ink-3); font-size: 11.5px; margin-left: 3px; }
.item-list { list-style: none; margin: 0; padding: 0; }
.item-list li > button { width: 100%; text-align: left; padding: 7px 8px; border-radius: var(--radius); display: flex; justify-content: space-between; gap: 8px; align-items: baseline; transition: background var(--t); }
.item-list li > button:hover { background: var(--panel); }
.item-list li > button.on { background: var(--accent-soft); color: var(--accent); }
.item-list small { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 10px; font-size: 11px; background: var(--panel-2); color: var(--ink-2); white-space: nowrap; }
.chip.est { background: var(--accent-soft); color: var(--accent); } .chip.ok { background: var(--panel-2); color: var(--ok); } .chip.nd { background: var(--warn-soft); color: var(--warn); }
.chip.err { background: var(--err-soft); color: var(--err); } .chip.warn { background: var(--warn-soft); color: var(--warn); }
.note { color: var(--ink-3); font-size: 12px; margin: 6px 0; }
.banner { background: var(--accent-soft); color: var(--ink); padding: 8px 10px; border-radius: var(--radius); font-size: 12px; margin-bottom: 10px; }
.banner.warn { background: var(--warn-soft); } .banner.err { background: var(--err-soft); }
details { margin: 8px 0; } summary { cursor: pointer; color: var(--ink-2); font-weight: 500; padding: 4px 0; }
.lib-group { margin-bottom: 10px; } .lib-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.lib-grid button { text-align: left; padding: 8px; border-radius: var(--radius); background: var(--panel); transition: background var(--t); }
.lib-grid button:hover { background: var(--accent-soft-2); }
.lib-grid small { display: block; color: var(--ink-3); font-variant-numeric: tabular-nums; }
/* platno */
#stage { position: relative; background: var(--canvas); min-width: 0; min-height: 0; overflow: hidden; }
#plan { width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; cursor: default; }
#plan.pan { cursor: grab; } #plan.panning { cursor: grabbing; } #plan.tool-draw { cursor: crosshair; }
#toolstrip { position: absolute; left: 10px; top: 10px; display: flex; flex-direction: column; gap: 2px; background: var(--bg); padding: 4px; border-radius: 8px; }
#toolstrip .btn { padding: 0; width: 34px; height: 34px; justify-content: center; background: transparent; }
#toolstrip .btn:hover { background: var(--panel); } #toolstrip .btn.on { background: var(--accent-soft-2); }
#zoomstrip { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 2px; background: var(--bg); padding: 4px; border-radius: 8px; }
#zoomstrip .btn { padding: 0; width: 32px; height: 32px; justify-content: center; background: transparent; } #zoomstrip .btn:hover { background: var(--panel); }
#modeBanner { position: absolute; left: 56px; top: 10px; right: 56px; pointer-events: none; display: flex; justify-content: center; }
#modeBanner span { background: var(--accent); color: var(--accent-ink); padding: 5px 12px; border-radius: 14px; font-weight: 600; font-size: 12px; pointer-events: auto; }
#busy { position: absolute; left: 56px; bottom: 10px; background: var(--bg); padding: 4px 10px; border-radius: 12px; color: var(--ink-2); font-size: 12px; }
#hint { position: absolute; left: 56px; bottom: 44px; color: var(--ink-3); font-size: 11.5px; pointer-events: none; }
/* statusna vrstica */
#status { min-width: 0; display: flex; align-items: center; gap: 14px; padding: 0 12px; background: var(--bg); border-top: 1px solid var(--line); font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
#status button { color: var(--ink-2); padding: 2px 6px; border-radius: 4px; } #status button:hover { background: var(--panel); }
#status .issues { font-weight: 600; color: var(--ink); }
/* plošče in okna */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .42); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { background: var(--bg); color: var(--ink); border-radius: 10px; width: min(880px, 100%); max-height: 92vh; display: flex; flex-direction: column; }
.modal.wide { width: min(1100px, 100%); } .modal.narrow { width: min(520px, 100%); }
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 8px; } .modal header h2 { margin: 0; font-size: 16px; letter-spacing: -.01em; }
.modal .body { padding: 6px 18px 14px; overflow: auto; flex: 1; min-height: 0; } .modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 18px 14px; flex-wrap: wrap; }
.menu { position: fixed; background: var(--bg); border-radius: 8px; padding: 4px; z-index: 60; min-width: 210px; outline: 1px solid var(--line); }
.menu button { display: flex; width: 100%; text-align: left; padding: 7px 10px; border-radius: 5px; gap: 8px; align-items: center; } .menu button:hover { background: var(--panel); } .menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.menu .kbd { margin-left: auto; color: var(--ink-3); font-size: 11px; }
#issuePanel { position: absolute; left: 56px; right: 10px; bottom: 36px; max-height: 46%; background: var(--bg); border-radius: 8px; display: flex; flex-direction: column; outline: 1px solid var(--line); z-index: 5; }
#issuePanel header { display: flex; align-items: center; gap: 8px; padding: 8px 12px; flex-wrap: wrap; } #issuePanel .list { overflow: auto; padding: 0 6px 8px; }
.iss { display: grid; grid-template-columns: 82px 1fr; gap: 8px; padding: 8px 8px; border-radius: var(--radius); cursor: pointer; text-align: left; width: 100%; transition: background var(--t); }
.iss:hover { background: var(--panel); } .iss b { font-weight: 600; } .iss p { margin: 2px 0 0; color: var(--ink-3); font-size: 12px; }
.sev { font-weight: 600; font-size: 11px; display: inline-flex; gap: 4px; align-items: center; height: 18px; } .sev.error { color: var(--err); } .sev.warning { color: var(--warn); } .sev.info { color: var(--ink-3); } .sev.nodata { color: var(--warn); } .sev.exception { color: var(--accent); }
table { border-collapse: collapse; width: 100%; } th { text-align: left; font-weight: 600; font-size: 11.5px; color: var(--ink-3); padding: 5px 8px; } td { padding: 5px 8px; vertical-align: top; } tbody tr:nth-child(odd) { background: var(--panel); }
.toast { position: fixed; left: 50%; bottom: 44px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 80; max-width: 80vw; font-size: 12.5px; }
.pages { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; } .pages figure { margin: 0; background: var(--panel); padding: 8px; border-radius: 6px; } .pages figcaption { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; max-width: 260px; }
.pages .pv { background: #fff; width: 260px; } .pages .pv svg { width: 100%; height: auto; display: block; }
.tilt-svg { width: 100%; background: var(--panel); border-radius: 6px; }
.photos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; } .photos-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; display: block; }
.photos-grid button { position: relative; } .photos-grid .cover { outline: 2px solid var(--accent); border-radius: 6px; }
.drawer-btn { display: none; }
.sel-handle { fill: var(--bg); stroke: var(--accent); }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 5px; }
@media (max-width: 1000px) {
  #main { grid-template-columns: minmax(0, 1fr); } #stage { grid-column: 1; grid-row: 1; }
  #status span:nth-child(n+3) { display: none; } #status .issues { display: inline; }
  .btn.hide-xs, #topbar .btn span.hide-sm { display: none; }
  #left, #right { position: absolute; top: 0; bottom: 0; width: min(330px, 92vw); z-index: 10; transform: translateX(-102%); transition: transform var(--t); display: flex !important; }
  #right { right: 0; transform: translateX(102%); } #left { left: 0; }
  #main.showleft #left, #main.showright #right { transform: none; }
  .drawer-btn { display: inline-flex; } #projName { width: 110px; } .hide-sm { display: none !important; } .save { max-width: 120px; }
  #toolstrip { flex-direction: row; top: auto; bottom: 10px; left: 10px; } #hint, #busy { display: none; }
  #issuePanel { left: 8px; right: 8px; bottom: 54px; }
}
@media (max-width: 600px) { #projName, .save, .brand { display: none; } #zoomstrip { bottom: 58px; } }
