@font-face {
  font-family: "Familjen Grotesk"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(../fonts/familjen-grotesk-latin.woff2) format("woff2");
}
/* contekansipil — style */
:root {
  --accent: #0073ff;
  --accent-600: #005fd4;
  --accent-50: #eaf3ff;
  --accent-100: #d3e6ff;
  --ink: #282c33;
  --ink-2: #475569;
  --ink-3: #8592a3;
  --line: #e2e8ef;
  --line-2: #d3dbe4;
  --bg: #f4f6f9;
  --panel: #ffffff;
  --canvas: #fbfcfd;
  --danger: #c2410c;
  --warn: #b45309;
  --ok: #15803d;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 14px rgba(16,24,40,.07);
  --shadow-lg: 0 12px 40px rgba(16,24,40,.18);
  --thumb-member: #5b7d99;
  --thumb-node: #1f6fae;
  --thumb-load: #e8875b;
  --display: "Familjen Grotesk", "Segoe UI", system-ui, sans-serif;
  /* --mono: dulu monospace; kini Segoe UI di seluruh aplikasi (angka tabular agar tetap rata) */
  --mono: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { display: flex; background: var(--bg); font-size: 13px; overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; color: inherit; }
.mono { font-family: var(--mono); }
.spacer { flex: 1; }
[hidden] { display: none !important; }
svg.ic { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[data-icon] { display: inline-flex; }

/* ---------- Header ---------- */
.topbar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--panel); border-bottom: 1px solid var(--line); min-height: 58px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--accent); padding-right: 6px; }
.brand-logo { width: 30px; height: 30px; }
.brand-name { font-size: 19px; color: var(--ink); letter-spacing: -.2px; }
.brand-name b { color: var(--accent); }
.app-title { padding: 0 14px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.app-title .t1 { font: 600 15px var(--display); }
.app-title .t2 { color: var(--ink-3); font-size: 11.5px; }
.project { display: flex; flex-direction: column; padding-left: 4px; }
.project-name { border: 1px solid transparent; background: transparent; font-weight: 700; font-size: 14px; padding: 2px 6px; border-radius: 6px; width: 230px; }
.project-name:hover { border-color: var(--line); }
.project-name:focus { outline: none; border-color: var(--accent); background: #fff; }
.save-status { display: flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 11px; padding-left: 7px; }
.save-status .dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }
.save-status.dirty .dot { background: #f59e0b; }

.btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px; border: 1px solid var(--line-2); border-radius: 9px; background: #fff; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.btn:hover { background: #f7f9fb; border-color: #c5ced9; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-600); }
.btn.run { height: 40px; padding: 0 18px; font-size: 14px; }
.btn.small { height: 30px; padding: 0 10px; font-size: 12px; }
.btn.danger { color: var(--danger); }
.btn .chev svg { width: 13px; height: 13px; }
.seg { display: inline-flex; background: #eef2f6; border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 13px; border-radius: 7px; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: #fff; color: var(--accent-600); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg.small button { padding: 4px 10px; font-size: 12px; }

.menu-wrap { position: relative; }
.menu { position: absolute; top: 42px; left: 0; z-index: 50; min-width: 250px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; display: none; }
.menu.open { display: block; }
.menu button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 7px; }
.menu button:hover { background: var(--accent-50); color: var(--accent-600); }
.menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }
.menu-label { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .5px; padding: 4px 10px; font-weight: 600; }

/* ---------- Layout ---------- */
.main { flex: 1; display: flex; min-height: 0; position: relative; }
.sidebar { width: 78px; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: stretch; padding: 10px 6px; gap: 4px; }
.sidebar button { position: relative; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 2px; border-radius: 9px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.sidebar button svg.ic { width: 22px; height: 22px; }
.sidebar button:hover { background: #f1f5f8; }
.sidebar button.on { background: var(--accent-50); color: var(--accent-600); }
.sidebar .count { position: absolute; top: 3px; right: 12px; min-width: 18px; height: 18px; border-radius: 9px; background: #475569; color: #fff; font-size: 10.5px; font-style: normal; display: grid; place-items: center; padding: 0 4px; }
.sidebar .count.zero { background: #b8c2ce; }
.side-sep { height: 1px; background: var(--line); margin: 6px 8px; }

.workspace { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.toolbar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--bg); }
.tool-group { display: flex; align-items: center; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 3px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.tool-group button { display: inline-flex; align-items: center; gap: 6px; height: 32px; border: 1px solid transparent; background: none; padding: 0 10px; border-radius: 7px; font-weight: 600; color: var(--ink-2); font-size: 12.5px; }
.tool-group button:hover { background: #f2f5f8; }
.tool-group button.on { background: var(--accent-50); color: var(--accent-600); border-color: var(--accent-100); }
.tool-group button.icon-only { padding: 0 8px; }
.tool-group button:disabled { opacity: .35; cursor: default; background: none; }
.zoom-val { min-width: 48px; text-align: center; font-weight: 600; color: var(--ink-2); font-size: 12px; }

.canvas-wrap { flex: 1; position: relative; margin: 0 12px; border: 1px solid var(--line); border-radius: 12px 12px 0 0; background: var(--canvas); overflow: hidden; }
#canvas { width: 100%; height: 100%; display: block; user-select: none; touch-action: none; }
#canvas[data-tool="node"], #canvas[data-tool="member"] { cursor: crosshair; }
#canvas[data-tool="support"], #canvas[data-tool="load"] { cursor: copy; }
#canvas[data-tool="erase"] { cursor: not-allowed; }
#canvas[data-tool="pan"], #canvas.panning { cursor: grab; }
#canvas[data-tool="mirror"] { cursor: col-resize; }

.statusbar { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 14px; margin: 0 12px 10px; background: #fff; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 12px 12px; color: var(--ink-2); font-size: 12px; }
.hint-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* ---------- SVG ---------- */
.grid-minor { stroke: #edf1f5; stroke-width: 1; }
.grid-major { stroke: #dfe5ec; stroke-width: 1; }
.grid-axis { stroke: #c4cdd8; stroke-width: 1.2; }
.hit { stroke: transparent; fill: transparent; stroke-width: 14; cursor: pointer; }
.hit-area { fill: transparent; stroke: none; cursor: pointer; }
.node { fill: #fff; stroke: #1e293b; stroke-width: 2.4; cursor: pointer; }
.node.sel { stroke: var(--accent); fill: var(--accent-100); stroke-width: 3; }
.node.hov { stroke: var(--accent-600); }
.release { fill: #fff; stroke: #1e293b; stroke-width: 1.6; }
.member { cursor: pointer; }
.support { cursor: pointer; }
.lbl { font-size: 11px; fill: #334155; font-family: "Segoe UI", system-ui, sans-serif; pointer-events: none; }
.lbl.node-id, .lbl.mem-id { font-weight: 700; font-size: 11.5px; fill: #334155; }
.lbl.mem-id.faded { fill: #94a3b8; }
.lbl.mono { font-family: var(--mono); font-size: 10.5px; fill: #64748b; }
.lbl.halo { paint-order: stroke; stroke: var(--canvas); stroke-width: 3.5px; stroke-linejoin: round; }
.lbl.load-lbl { font-weight: 600; font-size: 11px; }
.lbl.res-lbl { font-weight: 700; font-size: 11px; font-family: var(--mono); }
.load { cursor: pointer; }
.preview-line { stroke: var(--accent); stroke-width: 3; stroke-dasharray: 6 5; }
.ghost-line { stroke: var(--accent); stroke-width: 3; opacity: .45; }
.cursor-dot { fill: none; stroke: var(--accent); stroke-width: 2; }
.cursor-dot.on-node { fill: var(--accent-100); stroke-width: 2.5; }
.sel-box { fill: rgba(15,139,141,.08); stroke: var(--accent); stroke-dasharray: 4 3; }
.mirror-axis { stroke: #d946ef; stroke-width: 1.5; stroke-dasharray: 8 5; }
.probe-dot { fill: #111827; }
.axis-t { font: 600 11px "Segoe UI", sans-serif; fill: #d63c3c; }

/* ---------- Overlay di kanvas ---------- */
.tool-options, .selection-bar, .results-bar { position: absolute; top: 12px; left: 12px; display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 6px 8px; box-shadow: var(--shadow); z-index: 5; flex-wrap: wrap; max-width: calc(100% - 24px); }
.selection-bar { top: auto; bottom: 14px; left: 50%; transform: translateX(-50%); }
.selection-bar .sb-count { font-weight: 700; padding: 0 8px; border-right: 1px solid var(--line); }
.selection-bar button, .tool-options .opt-btn { border: 0; background: none; padding: 6px 9px; border-radius: 7px; font-weight: 600; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }
.selection-bar button:hover, .tool-options .opt-btn:hover { background: #f1f5f8; }
.tool-options .opt-btn.on { background: var(--accent-50); color: var(--accent-600); }
.tool-options .opt-btn.danger { color: var(--danger); }
.tool-options .opt-label { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .4px; padding: 0 4px; }
.tool-options .opt-sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 2px; }
.tool-options label { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--ink-2); }
.tool-options input[type=number], .tool-options input[type=text] { width: 76px; }
.sup-ic { width: 26px; height: 24px; }
.results-bar .rb-title { font-weight: 700; padding: 0 6px; }
.results-bar label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink-2); font-size: 12px; }
.results-bar input[type=range] { width: 100px; accent-color: var(--accent); }
.stale-badge { position: absolute; top: 64px; left: 12px; background: #fff7ed; color: var(--warn); border: 1px solid #fed7aa; padding: 5px 10px; border-radius: 8px; font-weight: 600; font-size: 12px; z-index: 4; }
.axis-ind { position: absolute; left: 6px; bottom: 4px; pointer-events: none; }
.tooltip { position: fixed; z-index: 60; background: #0f172a; color: #e2e8f0; padding: 8px 10px; border-radius: 8px; font-size: 12px; pointer-events: none; box-shadow: var(--shadow-lg); font-family: var(--mono); line-height: 1.5; }
.tooltip b { color: #fff; font-family: "Segoe UI", sans-serif; }
.tooltip .tN { color: #93c5fd; } .tooltip .tV { color: #86efac; } .tooltip .tM { color: #d8b4fe; } .tooltip .tD { color: #5eead4; }
.empty-hint { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); text-align: center; color: var(--ink-3); line-height: 1.7; pointer-events: none; }
.empty-hint .eh-title { font: 600 19px var(--display); color: var(--ink-2); margin-bottom: 4px; }

/* ---------- Panels ---------- */
.drawer, .props { position: absolute; top: 8px; bottom: 10px; z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.drawer { left: 86px; width: 470px; }
.props { right: 14px; width: 330px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.panel-body { flex: 1; overflow: auto; padding: 12px 14px; }
.icon-btn { border: 0; background: none; padding: 5px; border-radius: 6px; color: var(--ink-3); display: inline-flex; }
.icon-btn:hover { background: #f1f5f8; color: var(--ink); }
.icon-btn.danger:hover { color: var(--danger); background: #fff1ec; }

.field { display: grid; grid-template-columns: 112px 1fr; align-items: center; gap: 8px; margin-bottom: 8px; }
.field > span:first-child { color: var(--ink-2); font-weight: 600; font-size: 12px; }
.field .unit { color: var(--ink-3); font-size: 11.5px; margin-left: 6px; white-space: nowrap; }
.field .inp-u { display: flex; align-items: center; }
input.inp, select.inp { width: 100%; height: 32px; padding: 0 9px; border: 1px solid var(--line-2); border-radius: 7px; background: #fff; }
input.inp:focus, select.inp:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-50); }
input.inp.sm { height: 28px; }
input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; }
.check { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-weight: 600; color: var(--ink-2); }
.sec-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3); margin: 16px 0 8px; display: flex; align-items: center; justify-content: space-between; }
.sec-title:first-child { margin-top: 2px; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; font-size: 12.5px; }
.kv > :nth-child(odd) { color: var(--ink-2); }
.kv > :nth-child(even) { font-family: var(--mono); text-align: right; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; font-weight: 600; color: var(--ink-2); }
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent-50); border-color: var(--accent); color: var(--accent-600); }
.muted { color: var(--ink-3); }
.note { font-size: 12px; color: var(--ink-3); line-height: 1.5; margin: 6px 0; }
.load-item { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 5px; cursor: pointer; }
.load-item:hover { border-color: var(--accent); }
.mini-plot { width: 100%; height: 78px; display: block; margin-bottom: 4px; }
.mini-plot-lbl { font-size: 11.5px; font-weight: 700; display: flex; justify-content: space-between; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
table.tbl th { position: sticky; top: -12px; background: #f7f9fb; text-align: left; font-weight: 700; color: var(--ink-2); padding: 7px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1; }
table.tbl td { padding: 5px 6px; border-bottom: 1px solid #eef2f6; white-space: nowrap; }
table.tbl td.num { font-family: var(--mono); text-align: right; }
table.tbl tr.clickable { cursor: pointer; }
table.tbl tr.clickable:hover td { background: var(--accent-50); }
table.tbl tr.sel td { background: var(--accent-50); }
table.tbl input.inp { height: 26px; padding: 0 5px; width: 74px; }
table.tbl select.inp { height: 26px; padding: 0 4px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: -4px 0 10px; }
.tabs button { border: 0; background: none; padding: 8px 10px; font-weight: 600; color: var(--ink-3); border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--accent-600); border-bottom-color: var(--accent); }
.empty { color: var(--ink-3); text-align: center; padding: 26px 8px; line-height: 1.6; }
.row-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.38); z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop.open { display: flex; }
.modal { background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); width: 520px; max-width: 100%; max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.modal.wide { width: 920px; }
.modal-head { padding: 16px 20px 12px; font-size: 16px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.modal-body { padding: 16px 20px; overflow: auto; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.secpick { display: grid; grid-template-columns: 300px 1fr; gap: 18px; min-height: 420px; }
.secpick .list { border: 1px solid var(--line); border-radius: 9px; overflow: auto; height: 360px; }
.secpick .list button { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid #f0f3f6; background: none; padding: 7px 10px; font-family: var(--mono); font-size: 12px; }
.secpick .list button:hover { background: #f5f8fa; }
.secpick .list button.on { background: var(--accent-50); color: var(--accent-600); font-weight: 700; }
.secpick .preview { display: grid; grid-template-columns: 190px 1fr; gap: 16px; align-items: start; }
.secpick .preview svg { width: 190px; height: 190px; background: #f7f9fb; border: 1px solid var(--line); border-radius: 9px; }
.sec-shape { fill: #cbd5e1; stroke: #334155; stroke-width: 1.2; vector-effect: non-scaling-stroke; fill-rule: evenodd; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

/* ---------- Toast ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { background: #0f172a; color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); max-width: 420px; font-weight: 500; line-height: 1.45; animation: tin .18s ease-out; }
.toast.err { background: #991b1b; }
.toast.warn { background: #92400e; }
.toast.ok { background: #115e59; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 1100px) {
  .app-title, .brand-name { display: none; }
  .tool-group button { font-size: 0; gap: 0; }
  .tool-group button svg { margin: 0; }
  .zoom-val { font-size: 12px; }
}
.drawer-open .tool-options, .drawer-open .results-bar, .drawer-open .stale-badge { left: 476px; }

/* ---------- Layar awal ---------- */
.start-screen { position: absolute; inset: 0; z-index: 90; background: rgba(244,246,249,.97); overflow: auto; display: flex; justify-content: center; padding: 36px 24px; }
.start-box { width: 100%; max-width: 1260px; }
.start-head { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.start-head .brand-wordmark { height: 32px; width: auto; display: block; }
.start-title { flex: 1; border-left: 1px solid var(--line-2); padding-left: 20px; }
.start-title h1 { margin: 0; font: 600 24px/1.15 var(--display); letter-spacing: -.01em; }
.start-title p { margin: 3px 0 0; color: var(--ink-3); font-size: 13.5px; }
.start-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.start-card { display: flex; flex-direction: column; text-align: left; padding: 0; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; overflow: hidden; transition: border-color .12s, box-shadow .12s, transform .12s; }
.start-card:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); }
.start-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sc-thumb { background: #f1f6fa; aspect-ratio: 2 / 1; display: flex; align-items: center; justify-content: center; }
.sc-thumb .thumb { width: 100%; height: 100%; display: block; }
.sc-body { padding: 16px 20px 20px; }
.sc-title { font: 600 17px var(--display); color: var(--ink); }
.sc-desc { margin-top: 6px; color: var(--ink-3); font-size: 13px; line-height: 1.5; }
.start-card.blank .sc-thumb { background: repeating-linear-gradient(0deg, transparent 0 19px, #e3ebf2 19px 20px), repeating-linear-gradient(90deg, transparent 0 19px, #e3ebf2 19px 20px), #f7fafc; }
.sc-blank { width: 54px; height: 54px; border-radius: 50%; border: 2px dashed var(--accent); background: #fff; display: flex; align-items: center; justify-content: center; color: var(--accent); }
.sc-blank svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.start-card.blank .sc-title { color: var(--accent-600); }
.start-card.resume { border-color: var(--accent-100); }
.start-card.resume .sc-thumb { background: var(--accent-50); }

/* ---------- Navigasi aplikasi (sidebar kiri) ---------- */
.appnav { width: 256px; flex: none; display: flex; flex-direction: column; background: var(--bg); border-right: 1px solid var(--line); padding: 16px 12px 12px; overflow: hidden auto; transition: width .16s ease; }
.nav-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 2px 18px 8px; min-height: 46px; }
.nav-brand { display: flex; align-items: center; min-width: 0; }
.nav-logo { height: 26px; width: auto; display: block; }
.nav-mark { display: none; width: 40px; height: 40px; place-items: center; border: 0; border-radius: 10px; background: none; }
.nav-mark img { height: 24px; width: auto; display: block; }
.nav-mark:hover { background: rgba(40,44,51,.06); }
.nav-icon-btn { border: 0; background: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--ink-2); flex: none; }
.nav-icon-btn:hover { background: rgba(40,44,51,.06); color: var(--ink); }
.nav-ic { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.nav-group { padding: 10px 0; border-top: 1px solid var(--line); }
.nav-head + .nav-group { border-top: 0; padding-top: 0; }
.nav-group-h { display: flex; align-items: center; gap: 6px; width: 100%; height: 30px; padding: 0 10px; border: 0; background: none; color: var(--ink-3); font-size: 12.5px; white-space: nowrap; text-align: left; }
.nav-group-h:hover { color: var(--ink-2); }
.nav-caret { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.nav-group.closed .nav-caret { transform: rotate(-90deg); }
.nav-group.closed .nav-list { display: none; }
.nav-list { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.nav-list > button, .nav-list > a { display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 10px; border: 1px solid transparent; border-radius: 10px; background: none; font-size: 14px; color: var(--ink-2); text-align: left; text-decoration: none; white-space: nowrap; }
.nav-list > button:hover, .nav-list > a:hover { background: rgba(40,44,51,.05); color: var(--ink); }
.nav-list > button.on { background: var(--panel); border-color: var(--line); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(16,24,40,.05); }
.nav-list > button.on .nav-ic { color: var(--accent); }
.nav-group-end { border-top: 1px solid var(--line); padding-bottom: 0; }
.nav-foot { display: flex; align-items: center; gap: 11px; padding: 10px 11px 2px; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.nav-foot .nav-ic { width: 15px; height: 15px; }
.nav-user { gap: 10px; padding: 12px 4px 2px 6px; color: var(--ink); }
.nav-avatar { width: 30px; height: 30px; border-radius: 50%; flex: none; object-fit: cover; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; }
.nav-user-text { min-width: 0; flex: 1; line-height: 1.25; }
.nav-user-text b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.nav-user-text small { display: block; font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; }
.nav-user .nav-icon-btn .nav-ic { width: 18px; height: 18px; }
.appnav.collapsed { width: 64px; padding-left: 10px; padding-right: 10px; }
.appnav.collapsed .nav-label, .appnav.collapsed .nav-group-h, .appnav.collapsed .nav-brand, .appnav.collapsed #navToggle { display: none; }
.appnav.collapsed .nav-mark { display: grid; }
.appnav.collapsed .nav-head { flex-direction: column; padding: 2px 0 12px; gap: 12px; }
.appnav.collapsed .nav-group.closed .nav-list { display: flex; }
.appnav.collapsed .nav-list > button, .appnav.collapsed .nav-list > a { justify-content: center; padding: 0; }
.appnav.collapsed .nav-foot { justify-content: center; padding-left: 0; padding-right: 0; }

/* ---------- Halaman ---------- */
.app-pages { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.page { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.page-calc { overflow: auto; }
.calc-head { display: flex; align-items: center; gap: 14px; padding: 22px 32px 18px; background: var(--panel); border-bottom: 1px solid var(--line); }
.calc-ic { width: 46px; height: 46px; border-radius: 12px; background: var(--accent-50); color: var(--accent-600); display: grid; place-items: center; }
.calc-ic .nav-ic { width: 26px; height: 26px; }
.calc-head h1 { margin: 0; font: 600 24px/1.15 var(--display); letter-spacing: -.01em; }
.calc-head p { margin: 3px 0 0; color: var(--ink-3); font-size: 13.5px; }
.calc-body { padding: 28px 32px; }
.calc-empty { max-width: 560px; border: 1px dashed var(--line-2); border-radius: 14px; background: var(--panel); padding: 26px 28px; }
.ce-title { font: 600 17px var(--display); }
.calc-empty p { margin: 8px 0 0; color: var(--ink-2); line-height: 1.6; }

/* ---------- Kalkulator ---------- */
.calc-body.calc-layout { display: grid; grid-template-columns: minmax(330px, 400px) minmax(0, 1fr); gap: 22px; align-items: start; padding: 22px 28px 40px; }
@media (max-width: 1100px) { .calc-body.calc-layout { grid-template-columns: 1fr; } }
.calc-form { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 0; }
.cf-card, .res-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.cf-title, .res-title { font-weight: 700; font-size: 13px; margin-bottom: 8px; color: var(--ink); }
.cf-title:empty { display: none; }
.cf-rows { display: flex; flex-direction: column; gap: 4px; }
.cf-row { display: grid; grid-template-columns: 46px 1fr 104px 42px; align-items: center; gap: 6px; font-size: 12.5px; }
.cf-sym { font-family: "Cambria Math", "Times New Roman", serif; font-style: italic; font-size: 14px; color: var(--accent-600); }
.cf-label { color: var(--ink-2); }
.cf-unit { color: var(--ink-3); font-size: 11.5px; }
.cf-in { height: 30px; border: 1px solid var(--line-2); border-radius: 7px; padding: 0 8px; background: #fff; width: 100%; min-width: 0; }
.cf-in.num { text-align: right; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.cf-in.text { text-align: left; font-family: inherit; }
.cf-in:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-50); }
.cf-in.bad { border-color: var(--danger); background: #fff5f0; }
select.cf-in { padding: 0 4px; }
.cf-row select.cf-in { grid-column: 3 / 5; }
.cf-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.cf-table th { text-align: left; font-weight: 600; color: var(--ink-3); padding: 2px 3px; font-size: 11.5px; }
.cf-table td { padding: 2px 3px; }
.cf-table .cf-idx { color: var(--ink-3); width: 18px; }
.cf-table .cf-ro { color: var(--ink-3); text-align: center; }
.cf-x { border: 0; background: none; color: var(--ink-3); font-size: 16px; width: 22px; }
.cf-x:hover { color: var(--danger); }
.cf-add, .cf-reset { margin-top: 8px; border: 1px dashed var(--line-2); background: none; border-radius: 8px; height: 30px; color: var(--accent-600); font-weight: 600; font-size: 12px; width: 100%; }
.cf-reset { color: var(--ink-3); }
.cf-add:hover, .cf-reset:hover { background: var(--accent-50); }
.cf-adv { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.cf-adv summary { cursor: pointer; font-weight: 700; font-size: 13px; }
.cf-adv .cf-card { border: 0; padding: 8px 0 0; }

.calc-out { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.res-sum { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.rm-label { color: var(--ink-3); font-size: 12px; }
.rm-val { font-size: 26px; font-weight: 800; letter-spacing: -.5px; color: var(--ink); }
.rm-val.small { font-size: 16px; font-weight: 700; letter-spacing: 0; }
.rm-sub { color: var(--ink-2); font-size: 12.5px; margin-top: 2px; }
.res-chips { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.chip { display: inline-flex; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.chip.ok { background: #e7f6ec; color: var(--ok); }
.chip.ng { background: #fdecec; color: #b42318; }
.res-warn { margin-top: 10px; background: #fff8e6; border: 1px solid #f3d38a; color: #7a4d00; border-radius: 8px; padding: 8px 10px; font-size: 12.5px; line-height: 1.5; }
.res-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; align-items: start; }
.res-grid2.pm { grid-template-columns: minmax(300px, 1.3fr) minmax(240px, 1fr); }
@media (max-width: 700px) { .res-grid2.pm { grid-template-columns: 1fr; } }
.steps-wrap { overflow-x: auto; }
.steps { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.steps td { padding: 5px 6px; border-top: 1px solid var(--line); vertical-align: top; }
.steps .st-sym { font-family: "Cambria Math", "Times New Roman", serif; font-style: italic; font-size: 14px; color: var(--accent-600); white-space: nowrap; width: 64px; }
.steps .st-desc { color: var(--ink-2); }
.steps .st-f { color: var(--ink-3); font-size: 12px; }
.steps .st-v { text-align: right; font-family: var(--mono); white-space: nowrap; font-weight: 600; }
.steps .st-u { color: var(--ink-3); width: 54px; }
.steps .st-ok { color: var(--ok); } .steps .st-bad { color: #b42318; }
.steps tr.st-ng td { background: #fff4f2; }
.mini { border-collapse: collapse; font-size: 12.5px; width: 100%; margin-bottom: 8px; }
.mini th { text-align: left; color: var(--ink-3); font-weight: 600; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.mini td { padding: 4px 6px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.mini tr.hl td { background: var(--accent-50); font-weight: 600; }
.mini tr.bad td { background: #fff4f2; color: #b42318; }
.mini-note { color: var(--ink-3); font-size: 11.5px; line-height: 1.5; margin-top: 4px; }
.draw { width: 100%; max-width: 420px; height: auto; display: block; }
.dr-slab { fill: #eef4f8; stroke: #9fb3c4; }
.dr-bar { stroke: #b8c7d4; stroke-width: 1; }
.dr-edge-c { stroke: var(--accent-600); stroke-width: 5; }
.dr-edge-s { stroke: #64748b; stroke-width: 1.5; stroke-dasharray: 5 4; }
.dr-t { font-size: 11px; fill: var(--ink-2); }
.dr-t.b { font-weight: 700; fill: var(--ink); }
.dr-conc { fill: #eef1f4; stroke: #64748b; stroke-width: 1.5; }
.dr-stir { fill: none; stroke: #94a3b8; stroke-width: 1.6; }
.dr-rebar { fill: #1f2937; }
.chart .ch-grid { stroke: #edf1f5; } .chart .ch-axis { stroke: #94a3b8; }
.chart .ch-t { font-size: 10.5px; fill: var(--ink-3); } .chart .ch-t.b { font-weight: 600; fill: var(--ink-2); }
.chart .ch-nom { fill: none; stroke: #94a3b8; stroke-width: 1.4; stroke-dasharray: 5 4; }
.chart .ch-phi { fill: none; stroke: var(--accent); stroke-width: 2.2; }
.chart .ch-bal { fill: #fff; stroke: var(--accent-600); stroke-width: 1.5; }
.chart .ch-load.ok { fill: #16a34a; stroke: #fff; stroke-width: 1; }
.chart .ch-load.ng { fill: #dc2626; stroke: #fff; stroke-width: 1; }
.chart .ch-legend { fill: rgba(255,255,255,.92); stroke: var(--line); }
.cf-table td:nth-child(2) .cf-in.text { min-width: 104px; }

/* ---------- Tab kalkulator tiang ---------- */
.calc-body:not(.calc-layout) { padding: 0 0 40px; }
.calc-tabs { display: flex; gap: 4px; padding: 14px 28px 0; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 2; }
.calc-tabs button { border: 0; background: none; padding: 9px 14px 11px; font-weight: 600; color: var(--ink-3); border-bottom: 2.5px solid transparent; }
.calc-tabs button.on { color: var(--accent-600); border-bottom-color: var(--accent); }
.calc-tabs button:hover { color: var(--ink); }
.calc-pane.calc-layout { display: grid; grid-template-columns: minmax(330px, 400px) minmax(0, 1fr); gap: 22px; align-items: start; padding: 22px 28px 0; }
.calc-pane[hidden] { display: none !important; }
@media (max-width: 1100px) { .calc-pane.calc-layout { grid-template-columns: 1fr; } }
.draw.wide { max-width: 560px; }
.btn-draw { margin-top: 4px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font-weight: 700; border-radius: 999px; padding: 6px 14px; font-size: 12.5px; }
.btn-draw:hover { background: var(--accent-600); }

/* ---------- Penampil gambar kerja ---------- */
.dv { position: fixed; inset: 0; z-index: 120; background: #3b4250; display: flex; flex-direction: column; }
.dv[hidden] { display: none; }
.dv-bar { display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.dv-title { font-size: 14px; white-space: nowrap; }
.dv-title span { color: var(--ink-3); }
.dv-fields { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; min-width: 0; }
.dv-fields .cf-in { width: 128px; height: 30px; }
.dv-actions { display: flex; gap: 6px; }
.dv-stage { flex: 1; overflow: auto; display: flex; justify-content: center; align-items: flex-start; padding: 20px; }
.dv-paper svg { display: block; background: #fff; box-shadow: 0 10px 40px rgba(0,0,0,.45); }

/* ---------- Pratinjau 3D ---------- */
.v3d { position: relative; height: 440px; border-radius: 10px; overflow: hidden; background: #f6f8fa; border: 1px solid var(--line); }
.v3d canvas { display: block; cursor: grab; touch-action: none; }
.v3d canvas:active { cursor: grabbing; }
.v3d-bar { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; pointer-events: none; }
.v3d-bar > * { pointer-events: auto; }
.v3d-bar label, .v3d-bar button { background: rgba(255,255,255,.92); border: 1px solid var(--line-2); border-radius: 7px; padding: 3px 8px; font-size: 11.5px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 4px; }
.v3d-bar button:hover { border-color: var(--accent); color: var(--accent-600); }
.v3d-op input { width: 70px; }
.v3d-legend { position: absolute; left: 8px; bottom: 8px; background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font-size: 11.5px; display: flex; flex-direction: column; gap: 2px; color: var(--ink-2); max-width: calc(100% - 16px); }
.v3d-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.v3d-hint { position: absolute; right: 8px; bottom: 8px; font-size: 11px; color: var(--ink-3); background: rgba(255,255,255,.8); padding: 2px 6px; border-radius: 6px; }
.v3d-msg { padding: 40px; text-align: center; color: var(--ink-3); }
@media (max-width: 700px) { .v3d { height: 340px; } .v3d-hint { display: none; } }

/* ---------- Perbandingan qa ---------- */
.qa-bars { display: flex; flex-direction: column; gap: 8px; }
.qa-row { display: grid; grid-template-columns: 170px 1fr 92px; gap: 10px; align-items: center; font-size: 12.5px; color: var(--ink-2); }
.qa-track { height: 14px; background: #eef2f6; border-radius: 7px; overflow: hidden; }
.qa-fill { display: block; height: 100%; background: #94a3b8; border-radius: 7px; }
.qa-row.on .qa-fill { background: var(--accent); }
.qa-row.on { color: var(--ink); font-weight: 700; }
.qa-val { text-align: right; font-family: var(--mono); }
.btn-draw[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Garis ukur pratinjau 2D ---------- */
.draw .dm line { stroke: #1d4ed8; stroke-width: 0.9; }
.draw .dm line.tick { stroke-width: 1.4; }
.draw .dm text, .draw .dm-t { fill: #1d4ed8; font-size: 10.5px; }
.draw .dm.ld circle { fill: #1d4ed8; }

.dv-pages { display: flex; gap: 4px; }
/* ---------- Daftar besi bersketsa ---------- */
.bbs-wrap { overflow-x: auto; }
table.bbs { border-collapse: collapse; font-size: 12px; width: 100%; }
table.bbs th { background: #eef1f4; color: var(--ink-2); font-weight: 600; padding: 4px 6px; border: 1px solid var(--line); font-size: 11.5px; }
table.bbs td { padding: 3px 6px; border: 1px solid var(--line); text-align: center; font-variant-numeric: tabular-nums; }
table.bbs td.num { text-align: right; font-family: var(--mono); font-size: 11.5px; }
table.bbs td.b { font-weight: 700; }
table.bbs td.bbs-zone { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11px; color: var(--ink-2); background: #f7f9fb; white-space: nowrap; }
table.bbs td.bbs-skc { padding: 2px; width: 96px; }
table.bbs .bbs-sk { width: 92px; height: 40px; display: block; }
table.bbs tr.bbs-total td { background: var(--accent-50); font-weight: 700; text-align: right; }

/* ---------- Label 3D & portal 3D ---------- */
.v3d-lbls { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.v3d-lbl { position: absolute; left: 0; top: 0; font: 600 12px var(--mono); white-space: nowrap;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 2px #fff; will-change: transform; }
.frame3d { position: absolute; inset: 0; z-index: 4; background: #f6f8fa; }
.frame3d .v3d { height: 100%; border: 0; border-radius: 0; }
.frame3d .v3d-bar { top: auto; bottom: 40px; left: auto; right: 8px; justify-content: flex-end; }
.results-bar .seg button[data-v3] { min-width: 34px; }
.cf-link { border-color: var(--accent); background: var(--accent-50); }
.cf-link .cf-link-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); }

.v3d-dg select { font: inherit; border: 0; background: transparent; color: var(--ink-1, #1e293b); font-weight: 600; }
.v3d-tip { color: var(--ink-3); font-style: italic; }
.send-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---------- Tumpuan & beban (kalkulator) ---------- */
.lc-card .lc-mode { margin: 2px 0 8px; display: flex; }
.lc-card .lc-mode button { flex: 1; }
.lc-note { font-size: 11.5px; color: var(--ink-3); margin-top: 6px; line-height: 1.45; }
.lc-table { margin-top: 8px; }
.lc-table td { vertical-align: middle; }
.lc-table select.cf-in { width: 100%; min-width: 0; padding: 3px 4px; font-size: 12px; }
.lc-table .lc-case { width: 74px; }
.lc-table .lc-val { white-space: nowrap; }
.lc-table .lc-val .cf-unit { margin-left: 3px; }
.lc-table .lc-pos { white-space: nowrap; }
.lc-table .lc-slider { display: block; width: 100%; min-width: 80px; accent-color: var(--accent); margin-top: 2px; }
.lc-table .lc-full { color: var(--ink-3); font-size: 11.5px; font-style: italic; }
.lc-table .lc-dash { margin: 0 2px; color: var(--ink-3); }
.lc-chart { width: 100%; max-width: 680px; height: auto; display: block; margin-top: 6px; }
.lc-table .lc-case { width: 52px; }
table.lc-combos td.b { font-weight: 700; color: var(--accent-600); }
