:root{--bg:#eef1ed;--surface:#fff;--surface2:#f6f7f4;--ink:#18221d;--muted:#68736c;--line:#d9dfda;--accent:#176b51;--accent2:#d9efe7;--danger:#a33c32;--shadow:0 12px 32px rgba(24,34,29,.08)}
[data-theme=dark]{--bg:#111814;--surface:#19231e;--surface2:#202d26;--ink:#eef5f0;--muted:#9eaaa2;--line:#34443b;--accent:#6fd0ac;--accent2:#214638;--danger:#ff8f83;--shadow:0 12px 32px rgba(0,0,0,.22)}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:14px/1.45 Inter,Segoe UI,Arial,sans-serif}.topbar{height:82px;padding:0 24px;display:flex;align-items:center;gap:22px;background:var(--surface);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:10}.brand{display:flex;align-items:center;gap:8px;min-width:254px}.brand-logo{display:block;width:112px;height:78px;object-fit:contain}.brand-credits{white-space:nowrap}.brand small{display:block;color:var(--muted);font-size:10px}.topbar nav{display:flex;align-self:stretch}.nav-btn{border:0;border-radius:0;background:none;padding:0 18px;border-bottom:3px solid transparent;color:var(--muted);font-weight:600}.nav-btn.active{color:var(--accent);border-bottom-color:var(--accent)}.header-actions{margin-left:auto;display:flex;gap:8px}.app-shell{max-width:1600px;margin:auto;padding:20px;display:grid;grid-template-columns:360px minmax(0,1fr);gap:20px}.sidebar{display:flex;flex-direction:column;gap:14px}.panel,.canvas-card,.data-card{background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow)}.panel{padding:18px}.panel.compact{padding:15px}.panel-title{display:flex;align-items:center;justify-content:space-between;gap:12px}.panel h2,.data-card h2{font-size:15px;margin:0 0 13px;letter-spacing:.02em}.panel-title h2{margin:0}.badge{background:var(--accent2);color:var(--accent);padding:3px 8px;border-radius:99px;font-size:12px;font-weight:700}button,.button{font:inherit;border:1px solid var(--line);border-radius:8px;padding:8px 11px;background:var(--surface2);color:var(--ink);cursor:pointer;font-weight:600}button:hover,.button:hover{border-color:var(--accent)}button.primary,.button.primary{background:var(--accent);border-color:var(--accent);color:#fff}.ghost{background:transparent}.danger{color:var(--danger)}.icon-btn{font-size:18px;padding:6px 10px}.full{width:100%;margin-top:12px}.button-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.file-label input{display:none}.hint{font-size:12px;color:var(--muted);margin:9px 0 0}.segmented{display:flex;background:var(--surface2);border-radius:9px;padding:3px;margin:14px 0}.segmented button{flex:1;border:0;background:transparent;padding:7px}.segmented button.active{background:var(--surface);color:var(--accent);box-shadow:0 1px 4px #0002}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.form-grid label,.control-list>label{display:flex;flex-direction:column;gap:4px;color:var(--muted);font-size:12px}input,select{width:100%;border:1px solid var(--line);border-radius:7px;padding:8px;background:var(--surface);color:var(--ink);font:inherit}input[type=color]{padding:3px;height:37px}.control-list{display:flex;flex-direction:column;gap:9px;margin-top:12px}.control-list .check,.check{flex-direction:row;align-items:center;color:var(--ink);font-size:13px}.check input{width:auto}details{border-top:1px solid var(--line);padding-top:12px;margin-top:12px}summary{font-weight:700;cursor:pointer;margin-bottom:11px}.result{background:var(--accent2);color:var(--ink);padding:9px;border-radius:7px;font-size:12px}.workspace{min-width:0;display:flex;flex-direction:column;gap:18px}.canvas-card{overflow:hidden}.canvas-toolbar{height:58px;display:flex;align-items:center;justify-content:space-between;padding:0 16px;border-bottom:1px solid var(--line)}.canvas-toolbar strong{display:block}.canvas-toolbar span{display:block;font-size:12px;color:var(--muted)}canvas{display:block;width:min(100%,800px);height:auto;aspect-ratio:1;margin:0 auto;background:#fff;touch-action:none}.data-card{padding:16px}.table-wrap{overflow:auto;margin-top:13px;max-height:320px}table{width:100%;border-collapse:collapse;white-space:nowrap}th,td{text-align:left;border-bottom:1px solid var(--line);padding:9px 7px;font-size:12px}th{color:var(--muted);position:sticky;top:0;background:var(--surface)}td input:not([type=checkbox]){padding:5px;min-width:70px}.color-dot{width:15px;height:15px;border-radius:50%;display:inline-block}.empty{text-align:center;padding:35px;color:var(--muted)}.empty span{font-size:38px;color:var(--accent)}.empty strong{display:block;color:var(--ink)}.empty p{margin:4px}.hidden{display:none!important}dialog{max-width:520px;border:0;border-radius:14px;padding:28px;background:var(--surface);color:var(--ink);box-shadow:0 20px 80px #0005}dialog::backdrop{background:#10171399}.dialog-close{float:right;border:0;font-size:23px;background:none}#toast{position:fixed;right:20px;bottom:20px;background:#17251f;color:#fff;border-radius:8px;padding:11px 15px;opacity:0;transform:translateY(10px);transition:.2s;pointer-events:none}#toast.show{opacity:1;transform:none}
.subcontrols{margin:2px 0 2px 22px;padding:11px;border-left:3px solid var(--accent2);background:var(--surface2);border-radius:0 8px 8px 0;display:grid;grid-template-columns:1fr 1fr;gap:9px}.subcontrols label{display:flex;flex-direction:column;gap:3px;color:var(--muted);font-size:11px}.subcontrols output{float:right;color:var(--accent);font-weight:700}.subcontrols input[type=range]{padding:0;accent-color:var(--accent)}.cluster-results{margin-top:10px;display:grid;gap:5px}.cluster-item{display:flex;align-items:center;gap:7px;padding:5px 7px;background:var(--surface2);border-radius:6px}.cluster-item i{width:10px;height:10px;border-radius:50%}
.subheading{font-size:12px;margin:14px 0 7px}.fold-tools{display:grid;gap:9px}.fold-method{display:grid;gap:7px;padding:10px;background:var(--surface2);border:1px solid var(--line);border-radius:9px}.fold-method>span{color:var(--muted);font-size:11px}.fold-method>label{display:flex;flex-direction:column;gap:3px;color:var(--muted);font-size:11px}.fold-method button{justify-self:start}.measure-grid{display:grid;grid-template-columns:52px 1fr 1fr;gap:6px;align-items:center}.measure-grid span{font-size:11px;color:var(--muted)}.measure-grid input{min-width:0}.bisector-controls{display:grid;grid-template-columns:1fr 1fr;align-items:end;gap:10px;margin-top:10px;padding:10px;background:var(--surface2);border-radius:8px}.bisector-controls>label:not(.check){display:flex;flex-direction:column;gap:3px;color:var(--muted);font-size:11px}.selection-tools{display:flex;gap:10px;align-items:end;flex-wrap:wrap;margin:12px 0;padding:10px;background:var(--surface2);border-radius:9px}.selection-tools label{display:flex;flex-direction:column;gap:3px;color:var(--muted);font-size:11px}.selection-tools input{width:95px}.color-selection-tools{border:1px solid var(--line)}.color-selection-tools strong{align-self:center;font-size:12px;margin-right:4px}.color-selection-tools select{min-width:180px;border-left:12px solid transparent}.color-selection-tools select.empty{border-left-color:transparent!important}.badge.neutral{background:var(--surface2);color:var(--muted)}#lassoBtn.active{background:var(--accent);border-color:var(--accent);color:#fff}canvas.lasso-active{cursor:crosshair}
.fault-controls{display:grid;gap:12px}.fault-controls>.check{padding:2px 0}.fault-axis-group{padding:11px;background:var(--surface2);border:1px solid var(--line);border-radius:9px}.control-caption{display:block;margin-bottom:8px;color:var(--muted);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em}.axis-checks{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}.axis-option{display:grid;grid-template-columns:auto auto 1fr;align-items:center;gap:7px;padding:8px;background:var(--surface);border:1px solid var(--line);border-radius:7px;cursor:pointer}.axis-option input{width:auto;margin:0}.axis-color{width:10px;height:10px;border-radius:50%;display:inline-block}.axis-color.p{background:#168aad}.axis-color.t{background:#e63946}.axis-color.b{background:#2a9d8f}.fault-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}.shortcut-hint{color:var(--accent);font-size:11px;font-weight:600}.option-note,.field-note{color:var(--muted);font-size:10px}.stress-controls{margin:12px 0;padding:11px;background:var(--surface2);border-radius:8px;display:grid;gap:9px}.stress-controls>label:not(.check){display:flex;flex-direction:column;gap:3px;color:var(--muted);font-size:11px}.stress-scale{display:flex;align-items:center;gap:7px;color:var(--muted);font-size:10px}.stress-scale i{height:8px;flex:1;border-radius:9px;background:linear-gradient(90deg,#243b79,#1ba6a6,#f4d35e,#d62828)}
.permeability-controls{margin:10px 0;padding:10px;border:1px solid var(--line);border-radius:8px}.permeability-controls p{margin:6px 0 0}
.rose-bin-assist{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin:8px 0 10px}.rose-bin-assist span{font-size:11px;color:var(--muted);line-height:1.35}
.wide-dialog{max-width:720px;width:min(720px,calc(100vw - 32px));max-height:85vh;overflow:auto}.help-definitions{display:grid;grid-template-columns:minmax(170px,.8fr) minmax(260px,1.7fr);gap:10px 18px}.help-definitions dt{font-weight:700;color:var(--ink)}.help-definitions dd{margin:0;color:var(--muted);line-height:1.45}.dialog-actions{justify-content:flex-end;margin-top:18px}@media(max-width:600px){.help-definitions{grid-template-columns:1fr}.help-definitions dd{margin-bottom:8px}}
.language-picker{display:flex;align-items:center;gap:6px;font-size:12px}.language-picker select{width:auto;min-width:92px;padding:7px 26px 7px 9px}
.header-link{text-decoration:none;white-space:nowrap}.citation-text{line-height:1.65;padding:14px;background:var(--surface2);border:1px solid var(--line);border-radius:9px;user-select:text}
.termination-controls{margin:12px 0;padding:11px;background:var(--surface2);border-radius:8px;display:grid;gap:9px}.termination-controls label{display:flex;flex-direction:column;gap:3px;color:var(--muted);font-size:11px}.termination-controls input[type=range]{padding:0;accent-color:var(--accent)}.termination-controls output{color:var(--accent);font-weight:700}
.background-image-controls{margin-top:5px;padding:11px;background:var(--surface2);border:1px solid var(--line);border-radius:9px}.background-file{display:inline-block}.background-image-controls #backgroundActiveControls{display:grid;gap:9px;margin-top:10px}.background-image-controls #backgroundActiveControls>label:not(.check){display:flex;flex-direction:column;gap:3px;color:var(--muted);font-size:11px}.background-image-controls input[type=range],.crop-controls input[type=range]{padding:0;accent-color:var(--accent)}.background-image-controls output,.crop-controls output{color:var(--accent);font-weight:700}.crop-dialog{max-width:720px}.crop-dialog canvas{width:min(100%,520px);aspect-ratio:1;margin:12px auto;background:#e5e7eb;border:1px solid var(--line);border-radius:8px;cursor:grab;touch-action:none}.crop-dialog canvas.dragging{cursor:grabbing}.crop-controls{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:12px}.crop-controls label{display:flex;flex-direction:column;gap:4px;color:var(--muted);font-size:11px}
.help-dialog{width:min(1120px,calc(100vw - 30px));max-width:1120px;height:min(780px,calc(100vh - 30px));max-height:none;padding:22px;overflow:hidden}.help-dialog>.dialog-close{position:absolute;top:12px;right:14px}.help-heading{display:flex;justify-content:space-between;align-items:end;padding:0 38px 14px 4px;border-bottom:1px solid var(--line)}.help-heading h2{margin:2px 0 0;font-size:24px}.help-kicker{font-size:10px;letter-spacing:.16em;color:var(--accent);font-weight:800}.help-layout{display:grid;grid-template-columns:245px minmax(0,1fr);height:calc(100% - 116px);min-height:0}.help-nav{padding:15px 14px 15px 0;border-right:1px solid var(--line);overflow:auto;display:flex;flex-direction:column;gap:4px}.help-nav button{border:0;background:transparent;text-align:left;color:var(--muted);font-weight:600;padding:9px 11px}.help-nav button:hover{background:var(--surface2)}.help-nav button.active{background:var(--accent2);color:var(--accent)}.help-content{padding:18px 8px 24px 26px;overflow:auto}.help-content h2{font-size:23px;margin:0 0 6px}.help-content h3{font-size:15px;margin:22px 0 8px}.help-content p{margin:7px 0;color:var(--ink)}.help-content .lead{font-size:15px;color:var(--muted);margin-bottom:16px}.help-content ul,.help-content ol{padding-left:22px}.help-content li{margin:6px 0}.help-content table{margin:12px 0;white-space:normal}.help-content th{position:static}.help-note,.help-tip,.help-warning{padding:11px 13px;border-radius:8px;margin:14px 0}.help-note{background:var(--surface2);border-left:4px solid var(--muted)}.help-tip{background:var(--accent2);border-left:4px solid var(--accent)}.help-warning{background:#fff3cd;color:#593d00;border-left:4px solid #d49b00}.help-keys{display:flex;flex-wrap:wrap;gap:7px;margin:10px 0}.help-keys span{padding:5px 8px;border:1px solid var(--line);border-bottom-width:2px;border-radius:6px;background:var(--surface2);font-size:12px;font-weight:700}.help-footer{height:58px;border-top:1px solid var(--line);display:flex;justify-content:flex-end;align-items:end;gap:8px}.help-footer button:first-child{margin-right:auto}
@media(max-width:900px){.topbar{padding:0 12px;gap:8px}.brand{min-width:0}.brand-logo{width:86px;height:72px}.brand-credits{display:none}.topbar nav{margin-left:auto}.nav-btn{padding:0 10px}.header-actions .ghost{display:none}.app-shell{grid-template-columns:1fr;padding:10px}.sidebar{order:2}.workspace{order:1}.canvas-card{position:relative}.form-grid{grid-template-columns:1fr 1fr}}
@media(max-width:760px){.help-dialog{padding:14px}.help-layout{grid-template-columns:1fr;height:calc(100% - 112px)}.help-nav{border-right:0;border-bottom:1px solid var(--line);padding:8px 0;overflow-x:auto;overflow-y:hidden;flex-direction:row}.help-nav button{white-space:nowrap}.help-content{padding:16px 6px}.help-heading h2{font-size:19px}}
@media(max-width:560px){.brand-logo{width:68px;height:56px}.topbar{height:62px}.nav-btn{font-size:12px;padding:0 7px}.app-shell{padding:6px;gap:10px}.panel,.data-card{border-radius:10px}.canvas-toolbar{height:auto;padding:9px}.canvas-toolbar .button-row{gap:3px}.form-grid{grid-template-columns:1fr}.axis-checks,.fault-actions,.bisector-controls,.crop-controls{grid-template-columns:1fr}}
