:root{font-family:system-ui,-apple-system,"Segoe UI",sans-serif;color:#252538;background:#f6f6fa;line-height:1.45;--accent:#503e88;--edge:#dcdbe5;--muted:#625f72;--primary:#513d8a}
*{box-sizing:border-box}
body{margin:0}
[hidden]{display:none!important}
button,a,input,select{font:inherit}
button,.button,select,input:not([type=checkbox]):not([type=radio]){min-height:2.75rem;border:1px solid #c9c7d4;border-radius:.58rem;background:#fff;color:#29283e}
button,.button{padding:.55rem .95rem;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;font-weight:650;line-height:1.25}
button:hover,.button:hover{background:#f3f1f8;border-color:#a297b9}
.primary,.button.primary{background:var(--primary);color:white;border-color:var(--primary)}
.primary:hover,.button.primary:hover{background:#40306e}
.soft{color:#4b387d;background:#f3f0fa;border-color:#d5cde7}
.plain{background:transparent;border-color:transparent}
.danger{color:#913348}
:focus-visible{outline:3px solid #a479db;outline-offset:3px}
.sitebar{background:white;border-bottom:1px solid var(--edge);display:flex;align-items:center;gap:.8rem;min-height:3.75rem;flex-wrap:wrap;padding:.35rem max(1.25rem,calc((100% - 78rem)/2))}
main{width:min(100% - 2.5rem,78rem);margin:auto}
.bar-body{display:contents}
.bar-body nav{margin-inline-end:auto}
.sitebar a[data-hub-account]{margin:0;color:var(--muted);font-size:.94rem}
nav,.language,.actions,.row-tools,.inline-label,.form-foot,.legend{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap}
nav a{color:#50465f;text-decoration:none;font-size:.94rem}nav a:hover{text-decoration:underline}nav span{color:#a19bab}
nav .brand{font-weight:775;color:#382b55;font-size:1.1rem;letter-spacing:-.035em}
.language span,.inline-label,.panel label>span,.color-field legend{font-size:.94rem;font-weight:620}
select{appearance:none;padding:.4rem 2rem .4rem .65rem;background-image:linear-gradient(45deg,transparent 50%,#625b71 51%),linear-gradient(135deg,#625b71 49%,transparent 50%)!important;background-position:right .88rem center,right .63rem center!important;background-size:.25rem .25rem!important;background-repeat:no-repeat!important}
main{padding:1.55rem 0 2.5rem}
.top{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.75rem;margin-bottom:1.05rem}
h1,h2,p,figure{margin:0}h1{font-size:clamp(1.7rem,4vw,2.65rem);line-height:1.12;letter-spacing:-.045em}h2{font-size:1.12rem;letter-spacing:-.02em}
#board{display:grid;gap:.8rem}
.line-card{position:relative;margin:0;background:#fff;border:1px solid var(--edge);border-radius:.9rem;box-shadow:0 3px 13px rgb(33 30 58 / 4%);padding:.8rem 1rem .85rem;min-width:0}
.line-name{font-size:.9rem;font-weight:650;color:#5c536f}
.line-diagram{display:block;width:100%;height:auto;overflow:visible;direction:ltr}
.scale-ink{stroke:#393951;fill:none}.label-guide{stroke:#aaa7ba;stroke-width:1}
.tick-label,.hop-label{font-family:system-ui,sans-serif;font-variant-numeric:tabular-nums;direction:ltr;unicode-bidi:bidi-override}
.tick-label{fill:#333449;font-size:16px}.tick-label.zero{font-weight:700}.hop-label{font-weight:700;font-size:17px}
.legend{gap:.45rem .7rem}.legend:empty{display:none}
.legend .equation-chip{display:inline-flex;align-items:center;font-weight:650;border:1px solid #e0dfe8;border-radius:.43rem;min-height:2.35rem;padding:.28rem .62rem;color:#353244;background:white;font-variant-numeric:tabular-nums;gap:.45rem}
.legend button[aria-pressed=true]{border-color:var(--accent);background:#f5f2fa}
.legend i{display:inline-block;width:.68rem;height:.68rem;border-radius:50%;background:var(--swatch);flex:none}
.legend small{font-size:.78rem;color:var(--muted)}
.edit-icon{font-size:.86rem;color:var(--muted)}
.line-toolbar{display:flex;align-items:center;justify-content:space-between;gap:.65rem 1rem;flex-wrap:wrap;margin-bottom:.75rem}
.line-modes{display:inline-flex;flex-wrap:wrap;gap:.15rem;border:1px solid var(--edge);background:#eeecf4;border-radius:.7rem;margin:0;padding:.18rem}
.line-modes label{position:relative;cursor:pointer}
.line-modes input{position:absolute;opacity:0;width:1px;height:1px}
.line-modes span{display:flex;align-items:center;justify-content:center;min-height:2.65rem;padding:.42rem .85rem;border-radius:.48rem;font-weight:650;color:var(--muted)}
.line-modes input:checked+span{background:var(--primary);color:white}
.line-modes input:focus-visible+span{outline:3px solid #a479db;outline-offset:2px}
.row-tools{gap:.55rem .85rem}
.quick-inputs{display:flex;align-items:end;flex-wrap:wrap;gap:.55rem;margin:0 0 .75rem;padding:.8rem 1rem;background:white;border:1px solid var(--edge);border-radius:.75rem}
.quick-inputs label{display:grid;gap:.2rem;font-size:.94rem;font-weight:620;min-width:0}
.quick-inputs input{width:clamp(6rem,22vw,12rem);max-width:100%;font-size:1rem;font-weight:500}
.minus-sign{display:grid;place-items:center;min-height:2.75rem;color:var(--accent);font-weight:700;font-size:1.4rem}
.board-note{font-size:.94rem;color:var(--muted);margin-top:.45rem}
#settings{margin-top:.9rem}
body.presenting #line-editor,body.paper-view #line-editor{display:none}
#remove-line{margin-inline-start:auto}
.panels{display:grid;grid-template-columns:minmax(15rem,.8fr) minmax(23rem,1.6fr);gap:.85rem;align-items:start}
.panel{display:grid;gap:.75rem;background:white;border:1px solid var(--edge);border-radius:.85rem;padding:1rem 1.15rem}
.fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(7rem,1fr));gap:.55rem}
.fields.pair{grid-template-columns:repeat(2,minmax(0,1fr))}
.panel label:not(.check){display:grid;gap:.25rem;min-width:0}
input[type=text],input[type=number]{width:100%;padding:.48rem .62rem;font-variant-numeric:tabular-nums}
#ticks{max-width:7.25rem}
.panel select{width:100%}
small,#tick-help,[role=status]{color:var(--muted)}#tick-help,[role=status]{font-size:.9rem}#tick-help{margin-top:-.4rem}
[role=status].error{color:#a02b3e;font-weight:600}
.color-field{border:0;margin:0;padding:0}.color-field legend{padding:0;margin-bottom:.15rem}
#colors{display:flex;align-items:center;gap:.25rem;flex-wrap:wrap}
#colors label{display:block;position:relative;cursor:pointer}
#colors input,.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
#colors .chip{width:2.65rem;height:2.65rem;display:grid;place-items:center;border:2px solid transparent;border-radius:.6rem}
.chip::after{content:"";width:1.35rem;height:1.35rem;border-radius:50%;background:var(--swatch);border:1px solid rgb(24 25 35 / 18%)}
#colors input:checked+.chip{border-color:var(--swatch);background:#f7f6fa}
#colors input:focus-visible+.chip{outline:3px solid #a479db;outline-offset:1px}
.check{display:flex;gap:.55rem;align-items:center;min-height:2.3rem}.check input{accent-color:var(--accent);width:1.15rem;height:1.15rem;flex:none}
.form-foot{margin-top:.1rem}
.projection-tools{display:none}
body.presenting{background:#fff}
body.presenting> :not(main),body.presenting main>.top,body.presenting #settings{display:none!important}
body.presenting main{width:100%;min-height:100vh;min-height:100svh;display:flex;flex-direction:column;padding:.55rem clamp(.45rem,2vw,2rem) 1rem}
body.presenting .projection-tools{display:flex;justify-content:flex-end;margin-bottom:.4rem}
body.presenting #board{gap:1rem;margin-block:auto}
body.presenting .line-card{padding:1rem .75rem;box-shadow:none}
body.presenting .legend button{pointer-events:none}
body.presenting .line-name,body.presenting .legend bdi{font-size:clamp(1.1rem,1.8vw,1.6rem)}
@media screen{
  body.paper-view>:not(main),body.paper-view .top .actions,body.paper-view #settings{display:none!important}
  body.paper-view main{width:min(100% - 1rem,297mm);padding:clamp(1rem,3vw,12mm);margin:1rem auto;background:white;box-shadow:0 2px 14px rgb(32 28 48 / 10%)}
  body.paper-view .top{margin-bottom:.35rem}body.paper-view h1{font-size:1.55rem}
  body.paper-view .projection-tools{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.5rem;margin-bottom:.8rem}
  body.paper-view #board{display:block}
  body.paper-view .line-card{border:0;border-radius:0;border-bottom:1px solid #bbb;box-shadow:none;padding:2mm 1mm 3mm;margin-bottom:3mm}
  body.paper-view .legend .equation-chip{border:0;padding:.1rem .4rem;min-height:1.3rem}
}
@media(max-width:740px){.panels{grid-template-columns:1fr}.bar-body,main{width:calc(100% - 1.2rem)}main{padding-top:1rem}.line-card{padding:.65rem .35rem}.line-name,.legend{margin-inline:.32rem}#remove-line{margin-inline-start:0}.language span{display:none}}
@media(max-width:440px){.fields{grid-template-columns:repeat(2,minmax(0,1fr))}.actions{gap:.4rem}.bar-body{gap:.4rem}nav{gap:.35rem}}
@page{size:A4 landscape;margin:12mm}
@media print{
  html,body,body.presenting{background:white}
  body>:not(main),#line-editor,#settings,.top .actions,.projection-tools,body.presenting .projection-tools{display:none!important}
  main,body.presenting main{display:block!important;width:100%;max-width:none;min-height:0;margin:0;padding:0}
  .top,body.presenting main>.top{display:block!important;margin:0 0 4mm}h1{font-size:17pt}
  #board{display:block}
  .line-card,body.presenting .line-card{break-inside:avoid;page-break-inside:avoid;border:0;border-bottom:1px solid #bbb;border-radius:0;box-shadow:none;margin:0 0 3mm;padding:2mm 1mm 3mm;print-color-adjust:exact;-webkit-print-color-adjust:exact}
  .line-diagram{max-height:128mm}
  .legend .equation-chip,.legend button[aria-pressed=true]{padding:.1rem .4rem;min-height:1.3rem;border:0;background:white}
  .line-name,.legend small{color:#30303b}
  .edit-icon{display:none}
}
