/* hyper-ish kit — the shared look of the hyper-ish.com tools.
   Extracted from Eddy (the reference app). Tokens first; every colour in the
   chrome reads them, and --accent is set at runtime by accent.js.
   App-specific rules belong in the app's own stylesheet, after this one.
   Conventions the rules assume: #app > #toolcol, #rail (#sheetgrip,
   #railscroll, #railfoot), #view; #export is the accent button in the foot,
   #copy the plain one under it; .filerow pairs Save/Load; buttons carry
   <span class="long"> and <span class="short"> labels for compact screens. */
:root {
  --ink: #0d1013;
  --panel: #14181d;
  --line: #232a31;
  --line-soft: #1d2329; /* quieter rule for nested folds */
  --raise: #1b2128;
  --text: #c8d0d6;
  --dim: #6f7d88;
  --accent: #7fd4c1;
  --warn: #d98a5c;
  --danger: #d95c5c;
  --sheet: 46vh;
}
/* The hidden attribute always wins. Panels such as #keyhelp set their own
   display, which would otherwise keep a "hidden" panel covering the page. */
[hidden] {
  display:none!important;
}
* {
  box-sizing:border-box;
}
html,body {
  margin:0;
  height:100%;
  overflow:hidden;
  background:var(--ink);
  color:var(--text);
  font:12px/1.5 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  -webkit-text-size-adjust:100%;
}
#app {
  display:flex;
  height:100%;
}
#rail {
  user-select:none;
  -webkit-user-select:none;
  width:300px;
  flex:none;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  background:var(--panel);
  border-right:1px solid var(--line);
  padding-top:env(safe-area-inset-top);
}
#app.railhidden #rail {
  display:none;
}
#railscroll {
  flex:1 1 auto;
  overflow-y:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  padding:16px 16px 24px;
}
#railfoot {
  flex:none;
  padding:10px 16px calc(10px + env(safe-area-inset-bottom));
  border-top:1px solid var(--line);
  background:var(--panel);
}
#docnamerow {
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:8px;
}
#docnamerow>span {
  flex:none;
  font-size:10px;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:var(--dim);
}
#docname {
  flex:1 1 auto;
  min-width:0;
  padding:5px 7px;
  background:var(--raise);
  color:var(--text);
  border:1px solid var(--line);
  border-radius:3px;
  font:inherit;
  font-size:11px;
}
#docname:hover {
  border-color:var(--accent);
}
#docname:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:1px;
}
#railfoot button {
  margin:0;
  text-align:center;
  padding:9px;
  font-weight:600;
  letter-spacing:.04em;
  background:var(--accent);
  color:var(--ink);
  border-color:var(--accent);
}
#railfoot button:hover {
  background:color-mix(in srgb, var(--accent) 78%, #fff);
  border-color:color-mix(in srgb, var(--accent) 78%, #fff);
  color:var(--ink);
}
#railfoot button:active {
  background:color-mix(in srgb, var(--accent) 84%, #000);
  border-color:color-mix(in srgb, var(--accent) 84%, #000);
}
#railfoot button:focus-visible {
  outline:2px solid var(--text);
  outline-offset:2px;
}
h1 {
  margin:0 0 2px;
  font-size:12px;
  font-weight:600;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:var(--text);
}
.group {
  margin-bottom:20px;
}
.grouphead {
  display:block;
  margin-bottom:8px;
  padding-bottom:5px;
  font-size:10px;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:var(--dim);
  border-bottom:1px solid var(--line);
}
.row {
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  margin-top:10px;
}
.row label {
  flex:1;
  min-width:0;
  color:var(--text);
}
.row output {
  flex:none;
  margin-left:8px;
  color:var(--accent);
  font-variant-numeric:tabular-nums;
}
input[type=range] {
  display:block;
  width:100%;
  margin:2px 0 4px;
  accent-color:var(--accent);
  position:relative;
  z-index:1;
}
.tip {
  margin:2px 0 12px;
  font-size:10px;
  line-height:1.5;
  color:var(--dim);
}
button {
  display:block;
  width:100%;
  text-align:left;
  background:var(--raise);
  color:var(--text);
  border:1px solid var(--line);
  border-radius:3px;
  padding:7px 9px;
  margin-bottom:6px;
  cursor:pointer;
  font:inherit;
}
button:hover {
  border-color:var(--accent);
  color:#fff;
}
button:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:1px;
}
button[aria-pressed=true] {
  background:var(--accent);
  border-color:var(--accent);
  color:var(--ink);
  font-weight:600;
}
button:disabled,button:disabled[aria-pressed=true],.btnrow button:disabled,.btnrow button:disabled[aria-pressed=true],button[aria-disabled=true] {
  background:transparent;
  border-color:var(--line);
  border-style:dashed;
  color:var(--dim);
  font-weight:400;
  opacity:.5;
  cursor:not-allowed;
}
button:disabled:hover,button:disabled[aria-pressed=true]:hover,button[aria-disabled=true]:hover {
  border-color:var(--line);
  color:var(--dim);
}
select {
  flex:none;
  max-width:60%;
  background:var(--raise);
  color:var(--text);
  border:1px solid var(--line);
  border-radius:3px;
  padding:4px 6px;
  font:inherit;
  cursor:pointer;
}
select:hover {
  border-color:var(--accent);
  color:#fff;
}
select:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:1px;
}
select option {
  background:var(--panel);
  color:var(--text);
}
.btnrow {
  display:flex;
  flex-wrap:wrap;
  gap:4px;
  margin:6px 0;
}
.btnrow>* {
  margin:0;
}
.btnrow button {
  width:auto;
  flex:1 0 auto;
  min-width:46px;
  text-align:center;
  padding:5px 4px;
}
.btnrow.history {
  margin:0 0 12px;
  padding-bottom:12px;
  border-bottom:1px solid var(--line);
}
.btnrow.history .arrow {
  font-size:2em;
  line-height:0;
  margin-right:6px;
  transform:translateY(-.025em);
  display:inline-block;
  vertical-align:middle;
}
.btnrow button[data-risky=true] {
  color:var(--dim);
  border-style:dashed;
}
#view {
  flex:1;
  position:relative;
  min-width:0;
  overflow:hidden;
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition:none!important;
  }
}
.fold {
  margin:0 0 8px;
  padding:0 9px;
  border:1px solid var(--line);
  border-radius:3px;
  background:#1b212866;
}
.fold>summary {
  position:relative;
  cursor:pointer;
  list-style:none;
  margin:0 -9px;
  padding:7px 26px 7px 9px;
  color:var(--text);
  font-size:11px;
  letter-spacing:.1em;
  text-transform:uppercase;
  user-select:none;
}
.fold>summary::-webkit-details-marker {
  display:none;
}
.fold>summary:after {
  content:"+";
  position:absolute;
  right:9px;
  top:50%;
  transform:translateY(-50%);
  color:var(--dim);
  font-size:12px;
  line-height:1;
  pointer-events:none;
}
.fold[open]>summary:after {
  content:"−";
}
.fold>summary:hover {
  color:var(--accent);
}
.fold[open]>summary {
  border-bottom:1px solid var(--line);
}
.fold[open] {
  padding-bottom:9px;
}
.fold>.tip:last-child {
  margin-bottom:2px;
}
.fold .row {
  margin-top:8px;
}
.layer.off>summary {
  color:var(--dim);
  text-decoration:line-through;
}
.layer.off>*:not(summary) {
  opacity:.45;
}
.layer .btnrow button {
  min-width:0;
  padding:4px 2px;
  font-size:10px;
}
.btnrow>label {
  flex:none;
  align-self:center;
  color:var(--text);
  white-space:nowrap;
}
.btnrow input[type=text] {
  flex:1;
  min-width:0;
  background:var(--raise);
  color:var(--text);
  border:1px solid var(--line);
  border-radius:3px;
  padding:5px 6px;
  font:inherit;
  font-variant-numeric:tabular-nums;
}
.btnrow input[type=text]:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:1px;
}
.kindsel {
  flex:1 1 auto;
  max-width:none;
}
.btnrow.wrap button {
  flex:1 0 44%;
}
.btnrow.wrap button.wide {
  flex:1 0 100%;
}
.btnrow button.clears:hover,.btnrow button.clears:focus-visible {
  border-color:var(--danger);
  color:var(--danger);
}
.btnrow button.clears:focus-visible {
  outline-color:var(--danger);
}
.tip.alias {
  color:var(--warn);
}
.row output[data-edited=true]:before {
  content:"•";
  margin-right:4px;
  color:var(--dim);
}
.pow {
  position:relative;
  display:inline-block;
  flex:none;
  width:11px;
  height:11px;
  min-height:0;
  padding:0;
  margin:0;
  vertical-align:middle;
  border-radius:2px;
  background:var(--raise);
  border:1px solid var(--line);
  cursor:pointer;
}
.fold>summary .pow {
  margin-right:8px;
}
.pow[aria-pressed=true],[aria-pressed=true]>.pow {
  background:var(--accent);
  border-color:var(--accent);
}
.pow[aria-pressed=true]:before,.pow[aria-pressed=true]:after,[aria-pressed=true]>.pow:before,[aria-pressed=true]>.pow:after {
  content:"";
  position:absolute;
  top:50%;
  left:50%;
  width:9px;
  height:1px;
  background:var(--ink);
  pointer-events:none;
}
.pow[aria-pressed=true]:before,[aria-pressed=true]>.pow:before {
  transform:translate(-50%,-50%) rotate(45deg);
}
.pow[aria-pressed=true]:after,[aria-pressed=true]>.pow:after {
  transform:translate(-50%,-50%) rotate(-45deg);
}
.pow:hover,button:hover>.pow {
  border-color:var(--accent);
}
.pow:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:2px;
}
#notice {
  position:absolute;
  top:12px;
  left:50%;
  transform:translate(-50%);
  z-index:3;
  padding:5px 11px;
  max-width:60%;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  background:#0d1013d1;
  border:1px solid var(--line);
  border-radius:4px;
  color:var(--dim);
  font-size:11px;
  pointer-events:none;
}
#notice[hidden] {
  display:none;
}
.iconrow {
  display:flex;
  gap:4px;
  margin:8px 0 4px;
}
.layer .btnrow button.icon,.layer .iconrow button,button.icon {
  flex:0 0 auto;
  width:30px;
  height:26px;
  min-height:0;
  padding:0;
  margin:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-family:system-ui,-apple-system,Segoe UI Symbol,sans-serif;
  font-size:14px;
  line-height:1;
}
.layer .btnrow button.icon:disabled,.layer .iconrow button:disabled,button.icon:disabled {
  opacity:.3;
}
.fold.submask {
  margin:10px 0 4px;
  background:transparent;
  border-color:var(--line-soft);
}
.fold.submask>summary {
  padding:5px 26px 5px 8px;
  font-size:10px;
  letter-spacing:.16em;
  color:var(--dim);
}
.fold.submask>summary:hover {
  color:var(--accent);
}
.fold.submask[open]>summary {
  color:var(--text);
}
.fold.submask>summary:after {
  right:8px;
  font-size:11px;
}
.fold>summary .eye {
  float:right;
  margin-right:16px;
  width:22px;
  height:18px;
  font-size:11px;
}
.fold>summary .eye[aria-pressed=true] {
  background:var(--accent);
  border-color:var(--accent);
  color:var(--ink);
}
.layer.k-warp {
  --k: #9db4e8;
  --kw: rgba(157, 180, 232, .06);
}
.layer.k-noise {
  --k: #e3c88a;
  --kw: rgba(227, 200, 138, .06);
}
.layer.k-filter {
  --k: #c9a8d4;
  --kw: rgba(201, 168, 212, .06);
}
.layer.k-sim {
  --k: #7fc7c0;
  --kw: rgba(127, 199, 192, .06);
}
.layer.k-field {
  --k: #e3c88a;
  --kw: rgba(227, 200, 138, .06);
}
.layer.k-pattern {
  --k: #e8a49b;
  --kw: rgba(232, 164, 155, .06);
}
.layer.k-dist {
  --k: #93b4e0;
  --kw: rgba(147, 180, 224, .06);
}
.layer.k-erode {
  --k: #c9a8d4;
  --kw: rgba(201, 168, 212, .06);
}
.layer[class*=k-] {
  border-left:2px solid var(--k);
}
.layer[class*=k-]>summary {
  color:var(--k);
}
.layer[class*=k-][open] {
  background:var(--kw);
}
.layer[class*=k-][open]>summary {
  border-bottom-color:var(--k);
}
.layer[class*=k-]>summary:after {
  color:var(--k);
}
.layer.off[class*=k-] {
  border-left-color:var(--line);
  background:transparent;
}
.layer.off[class*=k-]>summary,.layer.off[class*=k-]>summary:after {
  color:var(--dim);
}
.fold.section {
  border-left:3px solid var(--sc, var(--line));
  margin-bottom:10px;
}
.fold.section>summary {
  color:var(--text);
  font-weight:500;
}
.fold.section[data-s="0"] {
  --sc: var(--dim);
}
.fold.section[data-s="1"] {
  --sc: #d98a8a;
}
.fold.section[data-s="2"] {
  --sc: #8fc78f;
}
.fold.section[data-s="3"] {
  --sc: #8fb0d9;
}
.fold.section[data-s="4"] {
  --sc: #c4ccd2;
}
.fold.section.off>summary {
  opacity:.5;
}
.fold.section.off>summary .pow {
  opacity:1;
}
.fold.section.off>*:not(summary) {
  opacity:.45;
}
.fold.addkind>summary {
  color:var(--dim);
  font-size:12px;
}
.fold.addkind[open]>summary {
  color:var(--text);
}
.tip.snapped,.tip.notile {
  color:var(--warn);
}
.fold.subfold>summary {
  font-size:9px;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--dim);
}
.fold.subfold[open]>summary,.fold.subfold>summary:hover {
  color:var(--text);
}
.layer.k-blur {
  --k: #a8cfa0;
  --kw: rgba(168, 207, 160, .06);
}
.layer.k-group {
  --k: #c9a8d4;
  --kw: rgba(201, 168, 212, .06);
}
.fold.layer.member>summary {
  font-size:11px;
}
.lede {
  margin:0 0 12px;
  font-size:10px;
  line-height:1.55;
  color:var(--dim);
}
#helpbtn {
  position:absolute;
  left:42px;
  top:12px;
  z-index:4;
  width:26px;
  height:26px;
  padding:0;
  margin:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#14181dd1;
  border:1px solid var(--line);
  border-radius:3px;
  color:var(--dim);
  font-family:system-ui,-apple-system,Segoe UI Symbol,sans-serif;
  font-size:12px;
  line-height:1;
  cursor:pointer;
}
#helpbtn:hover,#helpbtn[aria-expanded=true] {
  color:var(--accent);
  border-color:var(--accent);
}
#keyhelp {
  position:absolute;
  inset:0;
  z-index:20;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#06080a9e;
  cursor:pointer;
}
#keyhelp>div {
  max-width:340px;
  max-height:84%;
  overflow-y:auto;
  padding:16px 18px;
  background:#14181dfa;
  border:1px solid var(--line);
  border-radius:4px;
  box-shadow:0 10px 30px #00000080;
  cursor:default;
}
#keyhelp h2 {
  margin:0 0 12px;
  font-size:11px;
  font-weight:600;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:var(--text);
}
#keyhelp h3 {
  margin:14px 0 5px;
  font-size:9px;
  font-weight:400;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--dim);
}
#keyhelp h3:first-of-type {
  margin-top:0;
}
#keyhelp dl {
  margin:0;
  display:grid;
  grid-template-columns:max-content 1fr;
  gap:3px 14px;
  font-size:11px;
  line-height:1.5;
}
#keyhelp dt {
  color:var(--accent);
  white-space:nowrap;
}
#keyhelp dd {
  margin:0;
  color:var(--dim);
}
#keyhelp>div {
  position:relative;
}
#keyhelp .close {
  position:sticky;
  top:0;
  float:right;
  width:22px;
  height:22px;
  min-width:0;
  margin:-4px -6px 0 8px;
  padding:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  line-height:1;
  color:var(--dim);
  background:var(--raise);
  border:1px solid var(--line);
  border-radius:3px;
  opacity:.9;
}
#keyhelp .close:hover { color:var(--text); border-color:var(--accent);
}
#tooltip {
  position:fixed;
  z-index:40;
  max-width:268px;
  padding:9px 11px;
  background:#1b2128fa;
  color:var(--text);
  border-left:2px solid var(--accent);
  border-radius:3px;
  font-size:11px;
  line-height:1.55;
  box-shadow:0 6px 20px #00000073;
  opacity:0;
  visibility:hidden;
  transition:opacity .12s;
  pointer-events:none;
}
#tooltip.on {
  opacity:1;
  visibility:visible;
}
#railfoot #tipstoggle,#tipstoggle {
  display:flex;
  width:auto;
  font-weight:400;
  text-align:left;
  align-items:center;
  gap:6px;
  margin:12px 0 0;
  padding:0;
  background:none;
  border:0;
  color:var(--dim);
  font-size:10px;
  letter-spacing:.04em;
  cursor:pointer;
}
#railfoot #tipstoggle:hover,#tipstoggle:hover {
  background:none;
  border:0;
  color:var(--text);
}
#railfoot #tipstoggle:active,#railfoot #tipstoggle:focus-visible {
  background:none;
  border:0;
}
#railfoot #tipstoggle:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:2px;
}
.ctlsep {
  border-top:1px solid var(--line);
  margin:12px 0 8px;
}
#toolcol {
  width:34px;
  flex:none;
  display:flex;
  flex-direction:column;
  gap:2px;
  padding:8px 0;
  background:var(--panel);
  border-right:1px solid var(--line);
  padding-top:calc(8px + env(safe-area-inset-top));
}
#app.railhidden #toolcol {
  display:none;
}
#toolcol button {
  width:26px;
  height:26px;
  margin:0 4px;
  padding:0;
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--dim);
  background:none;
  border:1px solid transparent;
  border-radius:3px;
}
#toolcol button:hover {
  color:var(--text);
  background:var(--raise);
  border-color:var(--line);
}
#toolcol button[aria-pressed=true] {
  color:var(--ink);
  background:var(--accent);
  border-color:var(--accent);
}
#toolcol button svg {
  width:16px;
  height:16px;
  display:block;
}
#toolcol .ctlsep {
  margin:4px 8px;
}
.layer.k-fill {
  --k:#c9a8d4;
}
.layer.k-image {
  --k:#e3c88a;
}
.layer.k-shape {
  --k:#e8a49b;
}
.fold>summary[data-sel=true] {
  background:color-mix(in srgb, var(--k, var(--accent)) 14%, transparent);
}
input[type=color].swatch {
  flex:none;
  width:34px;
  height:17px;
  padding:0;
  border:1px solid var(--line);
  border-radius:2px;
  background:none;
  cursor:pointer;
}
input[type=color].swatch::-webkit-color-swatch-wrapper {
  padding:1px;
}
input[type=color].swatch::-webkit-color-swatch {
  border:none;
  border-radius:1px;
}
input[type=color].swatch:focus-visible {
  outline:1px solid var(--accent);
  outline-offset:1px;
}
.row.numrow {
  gap:8px;
}
label.scrub {
  cursor:ew-resize;
  touch-action:none;
}
label.scrub:hover {
  color:var(--accent);
}
input.num {
  flex:none;
  width:76px;
  text-align:right;
  font:inherit;
  font-variant-numeric:tabular-nums;
  color:var(--accent);
  background:var(--raise);
  border:1px solid var(--line);
  border-radius:2px;
  padding:2px 6px;
}
input.num:focus-visible {
  outline:none;
  border-color:var(--accent);
}
.fold.submask .iconrow {
  margin:6px 0 2px;
}
.fold.submask.off>summary {
  color:var(--dim);
  text-decoration:line-through;
}
.fold.submask.off>*:not(summary) {
  opacity:.45;
}
.layer.k-adjust {
  --k:#a8cfa0;
}
button.swatch {
  flex:none;
  width:34px;
  height:17px;
  min-width:0;
  padding:0;
  margin:0;
  border:1px solid var(--line);
  border-radius:2px;
  cursor:pointer;
}
button.swatch:hover {
  border-color:var(--accent);
}
.picker {
  position:fixed;
  z-index:30;
  width:224px;
  padding:10px;
  background:#14181dfa;
  border:1px solid var(--line);
  border-radius:4px;
  box-shadow:0 10px 30px #00000080;
  user-select:none;
  -webkit-user-select:none;
}
.picker-svwrap, .picker-huewrap {
  position:relative;
  border:1px solid var(--line);
  border-radius:3px;
  overflow:visible;
  cursor:crosshair;
  touch-action:none;
}
.picker-svwrap {
  height:140px;
  margin-bottom:8px;
}
.picker-huewrap {
  height:12px;
  margin-bottom:10px;
}
.picker-sv, .picker-hue {
  display:block;
  width:100%;
  height:100%;
  border-radius:2px;
}
.picker-knob {
  position:absolute;
  width:10px;
  height:10px;
  margin:-5px 0 0 -5px;
  border:2px solid #fff;
  border-radius:50%;
  box-shadow:0 0 0 1px #0d1013;
  pointer-events:none;
}
.picker-knob.hue {
  top:50%;
  width:6px;
  height:16px;
  margin:-8px 0 0 -3px;
  border-radius:2px;
}
.picker-row {
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:6px;
}
.picker-preview {
  flex:none;
  width:34px;
  height:22px;
  border:1px solid var(--line);
  border-radius:2px;
}
.picker-hex {
  flex:1;
  min-width:0;
  font:inherit;
  font-variant-numeric:tabular-nums;
  text-transform:uppercase;
  color:var(--accent);
  background:var(--raise);
  border:1px solid var(--line);
  border-radius:2px;
  padding:3px 6px;
}
.picker-hex:focus-visible {
  outline:none;
  border-color:var(--accent);
}
.picker-head {
  margin:8px 0 5px;
  font-size:9px;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:var(--dim);
}
.picker-grid {
  display:grid;
  grid-template-columns:repeat(8, 1fr);
  gap:4px;
}
.picker-swatch {
  width:100%;
  aspect-ratio:1;
  min-width:0;
  padding:0;
  margin:0;
  border:1px solid var(--line);
  border-radius:2px;
  cursor:pointer;
}
.picker-swatch:hover {
  border-color:var(--accent);
}
.picker-swatch[aria-pressed=true] {
  outline:2px solid var(--accent);
  outline-offset:1px;
}
.picker-tool {
  flex:none;
  width:26px;
  height:22px;
  min-width:0;
  padding:0;
  margin:0;
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--dim);
  background:var(--raise);
  border:1px solid var(--line);
  border-radius:2px;
}
.picker-tool:hover { color:var(--text); border-color:var(--accent);
}
.picker-tool[aria-pressed=true] { color:var(--ink); background:var(--accent); border-color:var(--accent);
}
.picker-tool svg { width:14px; height:14px;
}
.picker-swatch.add {
  background:var(--raise);
  color:var(--dim);
  font-size:13px;
  line-height:1;
  display:flex;
  align-items:center;
  justify-content:center;
}
.picker-swatch.add:hover { color:var(--accent);
}
.layer.k-adjust[data-mod="blur"] { --k:#93b4e0;
}
.fold.layer.dragging { opacity:.4;
}
.fold>summary[data-drop="above"] { box-shadow:inset 0 2px 0 var(--accent);
}
.fold>summary[data-drop="below"] { box-shadow:inset 0 -2px 0 var(--accent);
}
.fold>summary[data-drop="into"] { background:color-mix(in srgb, var(--accent) 18%, transparent);
}
.fold.layer>summary {
  display:flex;
  align-items:center;
  gap:8px;
}
.fold.layer>summary .alias {
  margin:0;
  flex:none;
}
.fold.layer>summary .lname {
  flex:1 1 auto;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.fold.channels { margin-top:10px;
}
.tip.byline { margin:8px 0 0;
}
.tip.byline+.tip.byline { margin-top:3px;
}
.tip.byline+.tip.byline.kofi { margin-top:12px;
}
.tip.byline a { color:var(--dim); text-decoration:underline; text-underline-offset:2px; text-decoration-color:var(--line);
}
.tip.byline a:hover { color:var(--accent); text-decoration-color:var(--accent);
}
.tip.byline a:focus-visible { outline:2px solid var(--accent); outline-offset:2px;
}
.group.credits .tip a { color:var(--dim); text-decoration:underline; text-underline-offset:2px; text-decoration-color:var(--line);
}
.group.credits .tip a:hover { color:var(--accent); text-decoration-color:var(--accent);
}
#railfoot button#copy {
  margin-top:6px;
  padding:6px 9px;
  font-weight:400;
  letter-spacing:0;
  background:var(--raise);
  color:var(--text);
  border-color:var(--line);
}
#railfoot button#copy:hover { background:var(--raise); border-color:var(--accent); color:#fff;
}
.fold.layer>summary input.lname-edit {
  flex:1 1 auto;
  min-width:0;
  font:inherit;
  font-size:11px;
  letter-spacing:.06em;
  text-transform:none;
  color:var(--text);
  background:var(--raise);
  border:1px solid var(--accent);
  border-radius:2px;
  padding:1px 5px;
  margin:-2px 0;
}
.fold>summary[data-sel=secondary] { background:color-mix(in srgb, var(--k, var(--accent)) 7%, transparent); box-shadow:inset 2px 0 0 var(--accent);
}
.btnrow.alignrow { gap:3px;
}
.btnrow.alignrow button.icon { flex:1 1 0; width:auto; min-width:0; font-size:13px;
}
:root { --checker: repeating-conic-gradient(#2a3139 0 25%, #1b2128 0 50%) 0 0 / 10px 10px;
}
.layer.k-generator { --k:#9db4e8; --kw:rgba(157,180,232,.06);
}
.row:has(> button.swatch) { align-items:center; gap:8px;
}
.row:has(> button.swatch) > label { flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.row:has(> button.swatch) > output { flex:none; margin-left:0;
}
.row.toggled > .pow { flex:none; margin-right:0;
}
.row.toggled.off > label, .row.toggled.off > output { color:var(--dim);
}
.row.toggled.off > button.swatch { opacity:.35;
}
button.powtoggle {
  display:flex;
  width:auto;
  align-items:center;
  gap:6px;
  margin:10px 0 2px;
  padding:0;
  background:none;
  border:0;
  color:var(--dim);
  font-size:11px;
  font-weight:400;
  text-align:left;
  cursor:pointer;
}
button.powtoggle:hover { background:none; border:0; color:var(--text);
}
button.powtoggle:focus-visible { outline:2px solid var(--accent); outline-offset:2px;
}
button.powtoggle[aria-pressed=true] { background:none; color:var(--text); font-weight:400;
}
button.powtoggle + button.powtoggle { margin-top:6px;
}
input.num.wide { width:auto; flex:1 1 auto; min-width:0; text-align:left;
}
.layer.k-text { --k:#c4ccd2; --kw:rgba(196,204,210,.06);
}
.tip.byline.kofi a { display:inline-flex; align-items:center; gap:5px;
}
svg.kofi-cup { flex:none; width:13px; height:13px;
}
.tip.versionline {
  margin:14px 0 0;
  font-size:9px;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:var(--dim);
  font-variant-numeric:tabular-nums;
}
.tip.versionline #version { text-transform:none; letter-spacing:.06em;
}
#railfoot .filerow { margin:0 0 6px; gap:6px;
}
#railfoot .filerow button {
  flex:1 1 0;
  padding:6px 9px;
  font-weight:400;
  letter-spacing:0;
  background:var(--raise);
  color:var(--text);
  border-color:var(--line);
}
#railfoot .filerow button:hover { background:var(--raise); border-color:var(--accent); color:#fff;
}
#railfoot .filerow button:active { background:var(--raise); border-color:var(--accent);
}
#modchips, .grip { display:none;
}
#modchips {
  position:absolute;
  left:calc(12px + env(safe-area-inset-left));
  top:50%;
  transform:translateY(-50%);
  z-index:6;
  flex-direction:column;
  gap:6px;
}
#modchips button {
  width:auto;
  margin:0;
  min-width:54px;
  min-height:38px;
  padding:6px 10px;
  text-align:center;
  background:#14181de6;
  border-color:var(--line);
  color:var(--text);
  font-size:12px;
}
#modchips button[aria-pressed=true] {
  background:var(--accent);
  border-color:var(--accent);
  color:var(--ink);
  font-weight:600;
}
@media (pointer: coarse) {
  #modchips { display:flex;
  }
  .fold.layer>summary .grip {
    display:inline-flex;
    order:-1;
    align-items:center;
    justify-content:center;
    flex:none;
    width:40px;
    min-height:44px;
    margin:-7px 0 -7px -9px;
    border-right:1px solid var(--line);
    font-size:20px;
    color:var(--dim);
    touch-action:none;
  }
  .fold.layer>summary {
    min-height:48px;
    padding-right:44px;
    font-size:13px;
    gap:10px;
  }
  .fold.layer>summary .alias { font-size:11px;
  }
  .fold.layer>summary:after { right:4px; width:36px; text-align:center; font-size:18px;
  }
  .fold.layer>summary .pow { width:20px; height:20px; margin-right:2px;
  }
  .fold.layer>summary .pow[aria-pressed=true]:before,
  .fold.layer>summary .pow[aria-pressed=true]:after { width:14px; height:2px;
  }
  [data-tip], #toolcol button, .fold.layer>summary { -webkit-touch-callout:none;
  }
  #toolcol { width:46px;
  }
  #toolcol button { width:38px; height:38px;
  }
  #toolcol button svg { width:20px; height:20px;
  }
  #rail button, #railfoot button { min-height:38px;
  }
  .btnrow button { padding:8px 6px;
  }
  button.swatch { width:40px; height:28px;
  }
  input[type=range] { height:28px;
  }
  input.num, select, #docname { min-height:34px; font-size:13px;
  }
  .fold>summary { min-height:40px;
  }
  button.powtoggle { min-height:36px;
  }
}
#sheetgrip, #railfoot .short { display:none;
}
html.compact .lede { display:none;
}
html.compact #railfoot .long { display:none;
}
html.compact #railfoot .short { display:inline;
}
html.compact #railfoot {
  display:flex;
  gap:6px;
  padding:8px 10px calc(8px + env(safe-area-inset-bottom));
}
html.compact #railfoot .filerow { display:contents;
}
html.compact #railfoot button,
html.compact #railfoot .filerow button,
html.compact #railfoot button#copy {
  flex:1 1 0;
  min-width:0;
  margin:0;
  padding:8px 4px;
  min-height:38px;
  font-size:12px;
  letter-spacing:0;
}
html.compact #filegroup #docnamerow { margin:4px 0 10px;
}
html.compact #filegroup #tipstoggle { margin:10px 0 0;
}
html.compact #railscroll { padding:12px 12px 20px;
}
@media (max-height: 560px) {
  #rail { width:260px;
  }
  #toolcol { gap:0; padding-top:calc(4px + env(safe-area-inset-top)); padding-left:env(safe-area-inset-left); width:auto;
  }
  #toolcol button { width:32px; height:32px; margin:0 4px;
  }
  #toolcol button svg { width:17px; height:17px;
  }
  #toolcol .ctlsep { margin:2px 8px;
  }
}
html.sheet #app { display:block;
}
html.sheet #view { position:fixed; inset:0;
}
html.sheet #rail {
  position:fixed;
  left:0; right:0; bottom:0;
  z-index:10;
  width:auto;
  height:var(--sheet-h, 50vh);
  padding-top:0;
  border-right:none;
  border-top:1px solid var(--line);
  border-radius:12px 12px 0 0;
  box-shadow:0 -8px 24px #00000066;
}
html.sheet #rail.settling { transition:height .18s ease-out;
}
html.sheet #sheetgrip {
  display:flex;
  flex:none;
  order:0;
  height:22px;
  align-items:center;
  justify-content:center;
  touch-action:none;
  cursor:grab;
}
html.sheet #sheetgrip span {
  width:40px;
  height:4px;
  border-radius:2px;
  background:var(--line);
}
html.sheet #railfoot {
  order:1;
  border-top:none;
  border-bottom:1px solid var(--line);
  padding:2px 10px 8px;
}
html.sheet #railscroll { order:2; padding-bottom:calc(20px + env(safe-area-inset-bottom));
}
html.sheet[data-sheet=peek] #railscroll { visibility:hidden;
}
html.sheet[data-sheet=peek] #railfoot { border-bottom:none; padding-bottom:calc(8px + env(safe-area-inset-bottom));
}
html.sheet #railtoggle { display:none;
}
html.sheet #toolcol {
  position:fixed;
  left:50%;
  transform:translateX(-50%);
  bottom:calc(var(--sheet-h, 50vh) + 8px);
  z-index:9;
  flex-direction:row;
  align-items:center;
  width:auto;
  max-width:calc(100vw - 16px);
  overflow-x:auto;
  gap:2px;
  padding:3px 4px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#14181de6;
}
html.sheet #rail.settling ~ #toolcol, html.sheet #toolcol { transition:none;
}
html.sheet #toolcol button { width:38px; height:38px; margin:0; flex:none;
}
html.sheet #toolcol .ctlsep { width:1px; height:24px; margin:0 3px; border:none; background:var(--line); flex:none;
}
html.sheet #modchips {
  top:auto;
  left:8px;
  right:8px;
  transform:none;
  bottom:calc(var(--sheet-h, 50vh) + 64px);
  flex-direction:row;
  flex-wrap:wrap;
  justify-content:center;
  pointer-events:none;
}
html.sheet #modchips button { pointer-events:auto;
}
html.sheet[data-sheet=full] #toolcol, html.sheet[data-sheet=full] #modchips { display:none;
}
html.sheet #helpbtn { left:10px; top:calc(10px + env(safe-area-inset-top)); width:34px; height:34px;
}
html.sheet #notice { top:calc(52px + env(safe-area-inset-top)); max-width:90%;
}
@media (max-width: 520px) {
  .picker {
    left:8px !important;
    right:8px;
    top:auto !important;
    bottom:calc(8px + env(safe-area-inset-bottom));
    width:auto;
  }
  .picker canvas.picker-sv, .picker canvas.picker-hue { width:100%;
  }
  #keyhelp>div { max-width:calc(100vw - 24px);
  }
}
html.compact #railscroll h1 { margin-bottom:8px;
}
#modchips[hidden] { display:none !important;
}
#modchips button { min-width:0; white-space:nowrap;
}
@media (pointer: coarse) {
  #helpbtn { width:34px; height:34px;
  }
}
#keyhelp section[data-for=touch] { display:none;
}
html.touchonly #keyhelp section[data-for=keys] { display:none;
}
html.touchonly #keyhelp section[data-for=touch] { display:block;
}
.picker-swatch.removable { outline:2px dashed var(--danger); outline-offset:1px;
}
.accentrow { display:flex; gap:8px; margin:8px 0 4px;
}
.accentrow .accentswatch {
  width:16px; height:16px; min-width:0; min-height:0;
  margin:0; padding:0;
  border-radius:50%;
  background:var(--sw);
  border:1px solid #00000066;
  cursor:pointer;
}
.accentrow .accentswatch:hover { box-shadow:0 0 0 2px var(--panel), 0 0 0 3px var(--sw);
}
.accentrow .accentswatch[aria-checked=true] { box-shadow:0 0 0 2px var(--panel), 0 0 0 4px var(--sw);
}
.accentrow .accentswatch:focus-visible { outline:2px solid var(--text); outline-offset:3px;
}
@media (pointer: coarse) {
  .accentrow { gap:14px;
  }
  #rail .accentrow .accentswatch { width:26px; height:26px; min-height:0;
  }
}
