/* EŞİK portal mockups, base.css: the look of the "Kesit" (section) language.
   The whole EŞİK as one section drawing: graphite on a white sheet, one signal colour for a no (redline),
   sill yellow only at thresholds, the current step and the focus ring.

   Fonts: Archivo by Omnibus-Type, variable (wdth 62..125, wght 100..900), SIL OFL 1.1, see ../fonts/OFL.txt.
   Drawing parts: 1 unit = 1 cm and every stroke is non-scaling, so stroke widths and dashes below are screen px.
   Notes for the camera and the pattern defs are at the end of this file. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("../fonts/archivo-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("../fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- tokens: light sheet (default) ---------- */
:root {
  --paper: #FAFAFA;     /* the sheet */
  --ink: #1D1F22;       /* graphite: text, cut lines, poche */
  --ink-2: #50555C;     /* seen lines, second text */
  --line: #7A8088;      /* hairlines, datums, hidden lines; never small text */
  --hatch: #8A9097;     /* ground and material hatches */
  --tone: #EFF0F0;      /* shared rooms, panels, hover */
  --tone-2: #E2E4E4;    /* fallback fill for EŞİK structures and full */
  --red: #C42B1C;       /* the redline: deny, fault, alarm, silent */
  --sill: #F2B705;      /* thresholds, the current step, focus; always with an ink outline on paper */
  --on-ink: #FAFAFA;    /* text on an ink fill */

  /* halftone context: everything outside the step's place, about a quarter of the ink */
  --ctx-ink: #BCBDBE;
  --ctx-line: #D3D4D5;
  --ctx-tone: #F4F5F5;
  --ctx-red: #E4A7A1;
  --ctx-sill: #F6DC8C;

  --font: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --wd-display: 72%;    /* the clock */
  --wd-word: 76%;       /* Allow, Deny, titles */
  --wd-label: 86%;      /* lettering in the drawing */
  --wd-ui: 88%;         /* chips, buttons, small ui */
  --wd-text: 100%;      /* reading text */

  --fs-time: 56px;
  --fs-word: 30px;
  --fs-title: 26px;
  --fs-reason: 18px;
  --fs-body: 16px;
  --fs-says: 15px;
  --fs-small: 13px;
  --fs-tiny: 12px;

  /* drawing lettering: two sizes and one weight, plus the place titles (screen px, scaled by --u) */
  --lb: 12.5;           /* every label */
  --lb-2: 14.5;         /* a label that names a place part: a unit, a stop, a level */
  --lb-title: 24;       /* the title of a place: Nordic, line1, the terraced block */
  --lb-word: 21;        /* Allow or Deny in a note on the drawing */
  --lw: 560;            /* the one weight of drawing labels */
  --lb-s: var(--lb);    /* older names, kept for the parts */
  --lb-b: var(--lb-2);
  --lb-l: var(--lb-2);

  --w-cut: 2px;
  --w-view: 1px;
  --w-hid: 1px;
  --w-lead: 1px;
  --w-trace: 1.1px;
  --w-way: 2.1px;
  --w-ground: 2.4px;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r-ctl: 6px;
  --r-chip: 2px;
  --tap: 44px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --t-ui: 200ms;
  color-scheme: light;
}

/* ---------- tokens: dark sheet ---------- */
[data-theme="dark"] {
  --paper: #141618;
  --ink: #E4E6E8;
  --ink-2: #A9AEB4;
  --line: #8C9299;
  --hatch: #6B7178;
  --tone: #1D2023;
  --tone-2: #262A2E;
  --red: #FF7A66;
  --on-ink: #141618;
  --ctx-ink: #4E5052;
  --ctx-line: #3A3D40;
  --ctx-tone: #191B1D;
  --ctx-red: #723E37;
  --ctx-sill: #785F10;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #141618; --ink: #E4E6E8; --ink-2: #A9AEB4; --line: #8C9299; --hatch: #6B7178;
    --tone: #1D2023; --tone-2: #262A2E; --red: #FF7A66; --on-ink: #141618;
    --ctx-ink: #4E5052; --ctx-line: #3A3D40; --ctx-tone: #191B1D; --ctx-red: #723E37; --ctx-sill: #785F10;
    color-scheme: dark;
  }
}

/* ---------- drawing colours ----------
   Every drawing class reads these. .ctx sets them to the halftone, .in-focus sets them back to full ink. */
:root, .in-focus, .ctx .in-focus {
  --d-ink: var(--ink);
  --d-ink-2: var(--ink-2);
  --d-line: var(--line);
  --d-tone: var(--tone);
  --d-tone-2: var(--tone-2);
  --d-red: var(--red);
  --d-sill: var(--sill);
  --d-lbl: inline;
  --d-ground: url(#esik-p-ground) var(--tone);
  --d-esik: url(#esik-p-esik) var(--tone-2);
  --d-maint: url(#esik-p-maint) var(--tone-2);
  --d-fault: url(#esik-p-fault) var(--tone-2);
  --d-full: url(#esik-p-full) var(--tone-2);
}

/* halftone context: the player puts .ctx on every part, group or actor outside the step's place, and .in-focus on the
   focus ids, the ids the step sets or unsets, the trace target and the step's actors (also inside a .ctx group).
   In context the lines and fills drop to about a quarter of the ink, hatches go flat and every label hides,
   except a place title (.lbl.title). Full ink stays for the focus, so its marks keep 3:1 and more. */
.ctx {
  --d-ink: var(--ctx-ink);
  --d-ink-2: var(--ctx-ink);
  --d-line: var(--ctx-line);
  --d-tone: var(--ctx-tone);
  --d-tone-2: var(--ctx-tone);
  --d-red: var(--ctx-red);
  --d-sill: var(--ctx-sill);
  --d-lbl: none;
  --d-ground: var(--ctx-tone);
  --d-esik: var(--ctx-tone);
  --d-maint: var(--ctx-tone);
  --d-fault: var(--ctx-red);
  --d-full: var(--ctx-tone);
}

/* ---------- page ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--ink); text-underline-offset: 2px; }
a:hover { color: var(--ink-2); }
code, .code { font-family: var(--font); font-stretch: var(--wd-ui); font-weight: 600; font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tab { font-variant-numeric: tabular-nums; }

/* focus ring: 2px ink inside, sill yellow outside; works on both sheets */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; box-shadow: 0 0 0 5px var(--sill); }

/* ---------- drawing: line weights (non-scaling) ---------- */
.cut, .view, .hid, .lead, .datum, .trace, .way, .gline {
  fill: none;
  vector-effect: non-scaling-stroke;
  stroke-linecap: butt;
  stroke-linejoin: miter;
}
.cut   { stroke: var(--d-ink);   stroke-width: var(--w-cut); }               /* what the cut plane goes through */
.view  { stroke: var(--d-ink-2); stroke-width: var(--w-view); }              /* seen beyond the cut */
.hid   { stroke: var(--d-line);  stroke-width: var(--w-hid); stroke-dasharray: 5 3; } /* hidden, or not drawn yet */
.lead  { stroke: var(--d-ink);   stroke-width: var(--w-lead); }              /* leaders and dimensions */
.datum { stroke: var(--d-line);  stroke-width: .9px; stroke-dasharray: 14 3 2 3; }   /* level lines in the sky */
.gline { stroke: var(--d-ink);   stroke-width: var(--w-ground); }            /* the ground and the street */

/* ---------- drawing: fills (after the strokes, so class="cut unit" is a cut outline with the unit fill) ---------- */
.unit   { fill: var(--paper); }               /* a unit: private, clickable */
.hall   { fill: var(--paper); }               /* circulation stays white and is named */
.shared { fill: var(--d-tone); }              /* common rooms: garage, delivery room, basement */
.esik   { fill: var(--d-esik); }              /* what EŞİK adds: modules, stations, hangar, robobus */
.ground { fill: var(--d-ground); }            /* earth: diagonal hatch with dots */
.poche  { fill: var(--d-ink); }               /* cut solids: walls, slabs, tunnel shell */
.void   { fill: var(--paper); }               /* knock out what is behind */
.rail   { fill: var(--d-ink); stroke: var(--d-ink); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.glass  { fill: none; stroke: var(--d-ink-2); stroke-width: 1px; vector-effect: non-scaling-stroke; }

/* checkpoint: the sill mark, always yellow with an ink outline */
.sill { fill: var(--d-sill); stroke: var(--d-ink); stroke-width: 1.4px; vector-effect: non-scaling-stroke; }
.sill.is-shut, .is-alarm .sill, .is-closed > .sill { fill: var(--d-red); }

/* ---------- drawing: lettering ----------
   --u = the size of one screen px in local units, set by the camera on the sheet svg, for example "0.42px".
   Then calc(var(--u) * 12.5) is 12.5 screen px at every zoom. Two sizes and one weight; place titles are bigger. */
.lbl {
  display: var(--d-lbl);
  font-family: var(--font);
  font-stretch: var(--wd-label);
  font-weight: var(--lw);
  fill: var(--d-ink);
  font-size: calc(var(--u, 1px) * var(--lb));
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: calc(var(--u, 1px) * 3.5);
  stroke-linejoin: round;
}
.lbl.s { font-size: calc(var(--u, 1px) * var(--lb)); }
.lbl.b, .lbl.l, .lbl.big { font-size: calc(var(--u, 1px) * var(--lb-2)); }
.lbl.m { fill: var(--d-ink-2); }
.lbl.id { font-variant-numeric: tabular-nums; }
.lbl.r { fill: var(--d-red); }
.lbl.title {
  display: inline;                                /* a place title shows also in the halftone */
  font-size: calc(var(--u, 1px) * var(--lb-title));
  font-weight: 700;
  font-stretch: var(--wd-word);
  fill: var(--ink);
  stroke-width: calc(var(--u, 1px) * 5);
}
/* level of detail: the camera sets data-lod-show="1|2|3" on the sheet; labels with a higher data-lod hide */
[data-lod-show="1"] [data-lod="2"], [data-lod-show="1"] [data-lod="3"], [data-lod-show="2"] [data-lod="3"] { display: none; }

/* ---------- states ----------
   The film puts the state class on the element with the API id. If that element is a group,
   its main shape carries .body; base.css restyles .body. Every state has a cue without colour
   (hatch, dash, cross or word); colour comes second.
   Optional children a part can draw:
     .show-in / .show-out        the two positions of a tray, box or lid (out shows only with is-out)
     .show-closed / .show-open   the two positions of a door, shutter or lap bar (open shows only with is-open)
     .mk-x                       a cross, shown with is-closed and is-fault
     .mk-word data-for="is-..."  a word, shown only with that state (space separated list allowed) */
.show-out, .show-open, .mk-x, .mk-word { display: none; }
.is-out .show-out, .is-out.show-out { display: inline; }
.is-out .show-in, .is-out.show-in { display: none; }
.is-open .show-open, .is-open.show-open { display: inline; }
.is-open .show-closed, .is-open.show-closed { display: none; }
.is-closed .mk-x, .is-fault .mk-x { display: inline; }
.mk-x { fill: none; stroke: var(--d-ink); stroke-width: 1.6px; vector-effect: non-scaling-stroke; }
.is-fault .mk-x { stroke: var(--d-red); }
.mk-word { font-family: var(--font); font-stretch: var(--wd-label); font-weight: var(--lw); fill: var(--d-ink);
  font-size: calc(var(--u, 1px) * var(--lb)); paint-order: stroke; stroke: var(--paper); stroke-width: calc(var(--u, 1px) * 3.5); }
.is-out .mk-word[data-for~="is-out"], .is-in .mk-word[data-for~="is-in"], .is-full .mk-word[data-for~="is-full"],
.is-closed .mk-word[data-for~="is-closed"], .is-open .mk-word[data-for~="is-open"],
.is-maintenance .mk-word[data-for~="is-maintenance"], .is-standby .mk-word[data-for~="is-standby"],
.is-fault .mk-word[data-for~="is-fault"], .is-silent .mk-word[data-for~="is-silent"],
.is-booked .mk-word[data-for~="is-booked"], .is-alarm .mk-word[data-for~="is-alarm"],
.is-charging .mk-word[data-for~="is-charging"] { display: var(--d-lbl); }
.is-fault .mk-word, .is-silent .mk-word, .is-alarm .mk-word { fill: var(--d-red); }

.is-out.body, .is-out > .body { stroke: var(--d-ink); stroke-width: 2px; }
.is-full.body, .is-full > .body { fill: var(--d-full); }                                            /* dots: full */
.is-closed.body, .is-closed > .body { stroke: var(--d-ink); stroke-width: 2.6px; }                 /* heavy edge + cross */
.is-maintenance.body, .is-maintenance > .body { fill: var(--d-maint); stroke-dasharray: 8 3; }     /* ink hatch */
.is-standby.body, .is-standby > .body { stroke-dasharray: 12 5; stroke-width: 1.4px; }            /* long dash: waiting */
.is-fault.body, .is-fault > .body { fill: var(--d-fault); stroke: var(--d-red); stroke-width: 2px; } /* red cross hatch */
.is-silent.body, .is-silent > .body { stroke: var(--d-red); stroke-width: 2px; stroke-dasharray: 2 3; } /* dotted: no keepalive */
.is-booked.body, .is-booked > .body { stroke: var(--d-ink); stroke-width: 2px; stroke-dasharray: 8 2 2 2; } /* dash dot: held */
.is-alarm.body, .is-alarm > .body { stroke: var(--d-red); stroke-width: 3px; }                     /* plus a cloud, see .cloud */

/* ---------- the way, the trace, the current step ---------- */
.way { stroke: var(--d-ink); stroke-width: var(--w-way); stroke-dasharray: 7 4; stroke-linecap: round; stroke-linejoin: round; }
.way.is-jump { stroke: var(--d-ink-2); stroke-width: 1.1px; stroke-dasharray: 2 4; }
.way.is-skip { stroke: var(--d-red); stroke-width: 1.4px; stroke-dasharray: 2 4; }
.way-node { fill: var(--paper); stroke: var(--d-ink); stroke-width: 1.2px; vector-effect: non-scaling-stroke; }

.trace { stroke: var(--ink); stroke-width: var(--w-trace); stroke-dasharray: 3 3; }               /* a request going down the levels */
.trace-node { fill: var(--paper); stroke: var(--ink); stroke-width: 1.2px; vector-effect: non-scaling-stroke; } /* an asked level */
.trace-node.is-decided { fill: var(--ink); }                                                       /* the level that decided */
.trace-chev { fill: none; stroke: var(--ink); stroke-width: 1.1px; vector-effect: non-scaling-stroke; } /* direction: down */
.trace-dot { fill: var(--ink); }                                                                   /* the moving request */

.cur-ring { fill: none; stroke: var(--sill); stroke-width: 4px; vector-effect: non-scaling-stroke; }
.cur-ring-in { fill: none; stroke: var(--ink); stroke-width: 1.3px; vector-effect: non-scaling-stroke; }
.cur-ring-in.is-deny { stroke: var(--red); stroke-width: 1.6px; }
.grip { fill: var(--paper); stroke: var(--ink); stroke-width: 1.3px; vector-effect: non-scaling-stroke; } /* selection, like CAD grips */
.cloud { fill: none; stroke: var(--red); stroke-width: 1.6px; vector-effect: non-scaling-stroke; }    /* revision cloud: a state changed here */
.rev-tri { fill: var(--paper); stroke: var(--red); stroke-width: 1.3px; vector-effect: non-scaling-stroke; }

/* machines and people: public sign figures; machines have a square head, people a round one.
   An actor outside the step gets .ctx: a halftone mark without its label. */
.fig { fill: var(--d-ink); }
.fig.is-person > .head { rx: 50%; }
.fig-lbl { display: var(--d-lbl); font-family: var(--font); font-stretch: var(--wd-label); font-weight: var(--lw); fill: var(--d-ink);
  font-size: calc(var(--u, 1px) * var(--lb)); paint-order: stroke; stroke: var(--paper); stroke-width: calc(var(--u, 1px) * 3.5); }
.seat { fill: var(--d-ink); }
.seat.is-held { fill: var(--paper); stroke: var(--d-ink); stroke-width: 1.4px; vector-effect: non-scaling-stroke; }

/* hit targets on the drawing: a transparent box, a hover tint, a halo for the keyboard */
.hit { cursor: pointer; outline: none; }
.hit .hr { fill: transparent; }
.hit:hover .hr, .hit.is-sel .hr { fill: color-mix(in oklab, var(--ink) 7%, transparent); }
.hit .halo, .hit .halo2 { fill: none; stroke: none; vector-effect: non-scaling-stroke; }
.hit:focus-visible .halo { stroke: var(--sill); stroke-width: 5px; }
.hit:focus-visible .halo2 { stroke: var(--ink); stroke-width: 1.6px; }

/* ---------- decision note on the drawing (svg): always full ink, it is the focus ---------- */
.snote-box { fill: var(--paper); }
.snote-word { font-family: var(--font); font-stretch: var(--wd-word); font-weight: 700; fill: var(--ink); font-size: calc(var(--u, 1px) * var(--lb-word)); }
.snote-chip { fill: var(--paper); stroke: var(--ink); stroke-width: 1.3px; vector-effect: non-scaling-stroke; }
.snote-chip-t { font-family: var(--font); font-stretch: var(--wd-ui); font-weight: 650; fill: var(--ink); font-size: calc(var(--u, 1px) * var(--lb)); font-variant-numeric: tabular-nums; }
.snote-reason { font-family: var(--font); font-weight: 400; fill: var(--ink); font-size: calc(var(--u, 1px) * var(--lb-2)); }
.snote-meta { font-family: var(--font); font-stretch: var(--wd-label); font-weight: 500; fill: var(--ink-2); font-size: calc(var(--u, 1px) * var(--lb)); } /* decided, asked */
.snote.is-deny .snote-word, .snote.is-deny .snote-chip-t { fill: var(--red); }
.snote.is-deny .snote-chip { stroke: var(--red); }

/* ---------- decision note in the panels (html): word + rule chip + reason ---------- */
.note { display: grid; gap: var(--s2); }
.note-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.note-word { font-size: var(--fs-word); line-height: 1; font-weight: 700; font-stretch: var(--wd-word); }
.chip {
  display: inline-block; border: 1.5px solid var(--ink); border-radius: var(--r-chip); padding: 2px 7px;
  font-weight: 650; font-stretch: var(--wd-ui); font-size: 14px; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.chip.sm { font-size: 12px; padding: 0 5px; }
.is-deny .note-word, .note-word.is-deny, .word.is-deny { color: var(--red); }
.is-deny .chip, .chip.is-deny { border-color: var(--red); color: var(--red); }
.note-reason { margin: 0; font-size: var(--fs-reason); line-height: 1.35; text-wrap: pretty; }
.note-says { margin: 0; font-size: var(--fs-says); color: var(--ink-2); text-wrap: pretty; }
.note-meta { margin: 0; font-size: var(--fs-small); color: var(--ink-2); font-stretch: 92%; }
.note-meta b { color: var(--ink); font-weight: 600; }

/* level chain in html: nation1 > region1 > city1 > district1, the decider bold */
.chain { display: flex; flex-wrap: wrap; gap: 4px 6px; font-size: var(--fs-small); color: var(--ink-2); font-stretch: var(--wd-ui); }
.chain .is-decided { color: var(--ink); font-weight: 700; }

/* ---------- title block and the sample stamp ---------- */
.tblock { display: grid; grid-template-columns: auto auto; border: 1px solid var(--ink); font-size: var(--fs-tiny); font-stretch: var(--wd-ui); line-height: 1.25; }
.tblock > div { padding: 4px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tblock > div:nth-child(2n) { border-right: 0; }
.tblock .k { display: block; color: var(--ink-2); font-size: 11px; }
.stamp { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 11.5px; }
.stamp > span { flex: none; border: 1.5px solid var(--ink); padding: 1px 6px; outline: 1px solid var(--ink); outline-offset: 2px; margin: 3px; font-size: 12.5px; }

/* ---------- buttons and toggles ---------- */
.btn {
  min-width: var(--tap); min-height: var(--tap); padding: 0 12px;
  display: inline-grid; place-items: center; gap: 6px; grid-auto-flow: column;
  border: 1.5px solid var(--ink); border-radius: var(--r-ctl); background: var(--paper); color: var(--ink);
  font-weight: 650; font-stretch: var(--wd-ui); font-size: 15px; cursor: pointer;
  transition: background-color var(--t-ui) var(--ease), color var(--t-ui) var(--ease);
}
.btn:hover { background: var(--tone); }
.btn[aria-pressed="true"], .btn[aria-current="true"] { background: var(--ink); color: var(--on-ink); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: default; }
.btn svg { width: 14px; height: 14px; fill: currentColor; }
.btn.ghost { border-color: transparent; }

/* ---------- bottom sheet (phone) ---------- */
.bsheet {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
  max-height: calc(100dvh - 120px); display: flex; flex-direction: column;
  background: var(--paper); border-top: 1.5px solid var(--ink); box-shadow: 0 -6px 18px rgb(0 0 0 / .08);
  padding-bottom: env(safe-area-inset-bottom);
  transition: transform 220ms var(--ease);
}
.bsheet-handle {
  display: flex; justify-content: center; align-items: center; gap: 8px; width: 100%; min-height: var(--tap);
  border: 0; border-bottom: 1px solid var(--tone); background: none; color: var(--ink-2);
  font-size: var(--fs-small); font-weight: 600; font-stretch: var(--wd-ui); cursor: pointer;
}
.bsheet-handle::before { content: ""; width: 36px; height: 4px; border-radius: 2px; background: var(--line); }
.bsheet-body { overflow: auto; overscroll-behavior: contain; min-height: 0; }
.bsheet:not([data-open="true"]) .bsheet-more { display: none; }

/* ---------- states of a panel: empty, loading, error ---------- */
.pstate { margin: var(--s3) 0 0; padding: 14px; border: 1.5px dashed var(--line); font-size: 15px; }
.pstate p { margin: 0 0 6px; }
.pstate.is-loading { display: flex; gap: 10px; align-items: center; }
.pstate.is-loading::before { content: ""; flex: none; width: 22px; height: 22px; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: esik-spin .9s linear infinite; }
@keyframes esik-spin { to { transform: rotate(1turn); } }

/* small helpers */
.muted { color: var(--ink-2); }
.legend-dash { display: inline-block; width: 18px; border-top: 1.5px dashed var(--line); vertical-align: middle; }
.fade-in { animation: esik-fade .2s var(--ease) both; }
@keyframes esik-fade { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  :root { --paper: #FFFFFF; }
  .bsheet, .btn { display: none; }
}

/* ---------- notes for the camera ----------
   Breakpoints (three layouts, not one squeezed): desktop 1100px and wider, tablet 640 to 1099px, phone under 640px.

   Pattern defs: CSS cannot make svg patterns, so one inline svg in index.html must hold them.
   The fills above fall back to a flat tone if they are missing. Copy this block as it is:

   <svg width="0" height="0" style="position:absolute" aria-hidden="true" focusable="false"><defs>
     <pattern id="esik-p-ground" patternUnits="userSpaceOnUse" width="9" height="9" patternTransform="rotate(45)">
       <line class="pt-ground" x1="0" y1="0" x2="0" y2="9"/><circle class="pt-dot" cx="4.5" cy="4.5" r="0.7"/></pattern>
     <pattern id="esik-p-esik" patternUnits="userSpaceOnUse" width="4" height="4">
       <line class="pt-esik" x1="0" y1="0.5" x2="4" y2="0.5"/></pattern>
     <pattern id="esik-p-maint" patternUnits="userSpaceOnUse" width="6" height="6" patternTransform="rotate(45)">
       <line class="pt-maint" x1="0" y1="0" x2="0" y2="6"/></pattern>
     <pattern id="esik-p-fault" patternUnits="userSpaceOnUse" width="5" height="5" patternTransform="rotate(-45)">
       <line class="pt-fault" x1="0" y1="0" x2="0" y2="5"/><line class="pt-fault" x1="0" y1="2.5" x2="5" y2="2.5"/></pattern>
     <pattern id="esik-p-full" patternUnits="userSpaceOnUse" width="5" height="5">
       <circle class="pt-full" cx="2.5" cy="2.5" r="1"/></pattern>
   </defs></svg>

   The tiles are in user units. Parts draw in cm, so the camera keeps the hatch even on screen by setting
   patternTransform="rotate(45) scale(u)" (rotate(-45) for fault, only scale(u) for esik and full) when the zoom
   changes, with u = local units per screen px (the same value as --u).
   Hatches: ground 45 degrees with dots, maintenance 45 degrees ink, fault red cross, full dots, EŞİK structures
   fine horizontal lines. Keep them apart: a state hatch must never look like a material.
   Patterns live in the defs, so they cannot take the halftone; in a .ctx group every hatch turns into a flat tone. */
.pt-ground { stroke: var(--hatch); stroke-width: .9; }
.pt-dot { fill: var(--hatch); }
.pt-esik { stroke: var(--ink-2); stroke-width: .8; }
.pt-maint { stroke: var(--ink); stroke-width: 1; }
.pt-fault { stroke: var(--red); stroke-width: 1.1; }
.pt-full { fill: var(--ink-2); }
