/* EŞİK portal mockups: panels.css.
   The panels belong to the sheet, they are not cards on it: schedules ruled like a door schedule, title block
   cells, the decision note, revision triangles with the step that set a value, and small drawings (a time strip
   of dimension strings, the levels as datums, line1 as a line map, the seat rows).
   Colours only through the tokens of base.css. Red is only for a no; sill yellow only for the current step and focus. */

/* ---------- frame ---------- */
.pn { container: pn / inline-size; display: flex; flex-direction: column; min-width: 0; color: var(--ink); font-size: var(--fs-body); line-height: 1.4; }
.pn-body { min-width: 0; }
/* the head stays at the top of its scroller, like the title strip of a sheet */
.pn-head { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 6px 0 10px; border-bottom: 1.5px solid var(--ink); background: var(--paper); box-shadow: 0 calc(-1 * var(--pn-pt, 0px)) 0 var(--paper); }
.pn-title { margin: 0; font-size: var(--fs-title); line-height: 1.05; font-weight: 700; font-stretch: var(--wd-word); }
.pn-stamp { justify-self: end; }
.pn-stamp > span { font-size: 11.5px; }
.pn-sum { grid-column: 1 / -1; margin: 4px 0 0; font-size: 14px; line-height: 1.35; color: var(--ink-2); text-wrap: pretty; }
.pn-idq { font-size: 12px; font-weight: 500; color: var(--ink-2); font-stretch: var(--wd-ui); }
.pn-hsrc { grid-column: 1 / -1; margin-top: 2px; }

/* ---------- a section: a schedule folded like a drawing set ---------- */
.pn-sec { border-bottom: 1px solid var(--line); }
.pn-sec > summary { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 0 6px; align-items: baseline; min-height: var(--tap); padding: 11px 0 9px; cursor: pointer; list-style: none; }
.pn-sec > summary::-webkit-details-marker { display: none; }
.pn-sec > summary::before { content: ""; grid-row: 1; width: 0; height: 0; border-style: solid; border-width: 4.5px 0 4.5px 6px; border-color: transparent transparent transparent var(--ink); transition: transform var(--t-ui) var(--ease); }
.pn-sec[open] > summary::before { transform: rotate(90deg); }
.pn-sec-t { grid-column: 2; font-size: 16px; font-weight: 650; font-stretch: 85%; line-height: 1.2; }
.pn-sec-s { grid-column: 2; margin-top: 2px; font-size: 13.5px; line-height: 1.3; color: var(--ink-2); text-wrap: pretty; }
.pn-sec > summary:hover .pn-sec-t { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.pn-sec-b { display: grid; gap: 8px; padding: 0 0 16px; min-width: 0; }

/* the current step: a sill mark, the one accent */
.pn-sill { display: inline-block; flex: none; width: 6px; height: 15px; margin-right: 7px; vertical-align: -2px; background: var(--sill); border: 1.25px solid var(--ink); }

/* ---------- schedules ---------- */
.pn-tw { overflow-x: auto; min-width: 0; }
.pn-t { width: 100%; border-collapse: collapse; font-size: 13.5px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.pn-t th { text-align: left; vertical-align: bottom; padding: 4px 8px 4px 0; border-bottom: 1.5px solid var(--ink); font-size: 12px; font-weight: 600; font-stretch: var(--wd-ui); color: var(--ink-2); }
.pn-t td, .pn-t tbody th { padding: 6px 8px 6px 0; border-bottom: 1px solid var(--tone-2); vertical-align: top; text-align: left; overflow-wrap: anywhere; font-weight: 400; font-size: 13.5px; color: var(--ink); font-stretch: 100%; }
.pn-t th:last-child, .pn-t td:last-child { padding-right: 0; }
.pn-t .n { text-align: right; white-space: nowrap; }
.pn-t .nw { white-space: nowrap; overflow-wrap: normal; }
.pn-key { margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--ink-2); }
.pn-key .pn-state { margin-right: 10px; }
.pn-t th.n { white-space: normal; }
.pn-t tr.is-ended td { color: var(--ink-2); }
.pn-t tr.is-cur > * { background: var(--tone); }
.pn-t tr.is-sum > * { border-top: 1.5px solid var(--ink); border-bottom: 0; font-weight: 650; }
.pn-t tr.is-fail td:first-child, .pn-t tr.is-fault td:first-child { font-weight: 650; }
.pn-capt { caption-side: top; text-align: left; padding: 0 0 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); font-stretch: var(--wd-ui); }
.pn-grp { text-align: center !important; border-bottom: 1px solid var(--line) !important; }
.pn-res { font-weight: 650; white-space: nowrap; }
.pn-res.is-deny { color: var(--red); }
.pn-res.is-nodata { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); }
.pn-list { overflow-wrap: anywhere; }
.pn-cancel { text-decoration: line-through; text-decoration-thickness: 1.5px; }

/* the title block of facts: key over value, ruled cells */
.pn-tb { display: flex; flex-wrap: wrap; margin: 2px 0; border: 1px solid var(--ink); overflow: hidden; font-size: 13.5px; line-height: 1.3; }
.pn-tb > div { flex: 1 1 9.5em; min-width: 0; margin: 0 -1px -1px 0; padding: 5px 8px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.pn-head + .pn-body > .pn-tb:first-child { margin-top: 12px; }
.pn-tb .k { display: block; font-size: 11.5px; color: var(--ink-2); font-stretch: var(--wd-ui); }
.pn-tb .v { font-weight: 550; }

/* the revision triangle with the step that set a value; ink, because red is only for a no */
.pn-rev { display: inline-flex; align-items: center; gap: 2px; margin-left: 4px; vertical-align: 1px; font-size: 11.5px; font-weight: 650; font-stretch: var(--wd-ui); color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pn-tri { width: 11px; height: 10px; fill: var(--paper); stroke: var(--ink-2); stroke-width: 1.2; stroke-linejoin: round; }

/* where a value comes from, quietly */
.pn-src { margin: 0; font-size: 12px; line-height: 1.35; color: var(--ink-2); font-stretch: var(--wd-ui); overflow-wrap: anywhere; }
.pn-code { font-family: var(--font); font-stretch: var(--wd-ui); font-weight: 600; font-variant-numeric: tabular-nums; }
.pn-note { margin: 0; font-size: 12.5px; line-height: 1.35; color: var(--ink-2); }
.pn-cap { margin: 4px 0 0; font-size: 12.5px; font-weight: 600; font-stretch: var(--wd-ui); color: var(--ink-2); }
.pn-sumline { margin: 0; font-size: 14px; }
.pn-sumline .is-deny { color: var(--red); font-weight: 650; }
.pn-quote { margin: 0; }

/* ---------- the decision ---------- */
.pn-dec { display: grid; gap: 8px; }
.pn-dec-h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.pn-dec.is-read .note-word { font-size: 26px; }
.pn-dec .chip { overflow-wrap: anywhere; white-space: normal; }
.pn-at { margin-left: auto; font-size: 13px; color: var(--ink-2); font-stretch: var(--wd-ui); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pn-at time { font-weight: 650; color: var(--ink); }
.pn-more { display: grid; gap: 8px; min-width: 0; }
/* when the decision block scrolls (1024, 1440), a fade and "More below" sit at its foot until its end is in view */
@supports (animation-timeline: scroll()) {
  .pn-dec::after { content: 'More below'; position: sticky; bottom: -18px; z-index: 1; height: 44px; margin-top: -52px; padding-top: 22px; box-sizing: border-box; text-align: right; font-size: 12px; font-weight: 600; font-stretch: var(--wd-ui); color: var(--ink); background: linear-gradient(to bottom, transparent, var(--paper) 55%); pointer-events: none; opacity: 0; animation: pn-cue linear both; animation-timeline: --pn-now; }
  .now { scroll-timeline: --pn-now block; }
  @keyframes pn-cue { 0%, 92% { opacity: 1; } 100% { opacity: 0; } }
}
.pn-who { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.pn-who b { font-weight: 650; }
.pn-log { margin: 0; font-size: 14px; line-height: 1.45; }
.pn-log .pn-v { margin-right: 2px; }
.pn-resp { margin: 0; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.pn-resp b { font-weight: 600; font-variant-numeric: tabular-nums; }
.pn-resp .pn-fail { color: var(--red); font-weight: 650; }
.pn-rk { color: var(--ink-2); font-size: 13px; }
.pn-req { font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.pn-reqb { display: block; margin-top: 1px; }
.pn-reqd > summary { cursor: pointer; list-style-position: inside; margin: -10px 0; padding: 10px 0; min-height: 44px; box-sizing: border-box; overflow-wrap: anywhere; }
.pn-reqd > summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.pn-reqd .pn-reqb { margin: 4px 0 0; }
.pn-sofar { font-size: 12.5px; color: var(--ink-2); }
.pn-ledger th[scope="row"] { font-weight: 400; }

/* the word and the rule chip inside rows */
.pn-v { display: inline-flex; align-items: baseline; gap: 6px; }
.pn-w { font-weight: 700; font-stretch: 80%; }
.pn-v.is-deny .pn-w { color: var(--red); }

/* ---------- rows of steps: the way, the decisions at a place ---------- */
.pn-rows { list-style: none; margin: 0; padding: 0; }
.pn-row { position: relative; display: grid; grid-template-columns: 2.9em minmax(0, 1fr) auto; gap: 1px 10px; align-items: baseline; width: 100%; min-height: var(--tap); padding: 7px 2px 7px 14px; border: 0; border-bottom: 1px solid var(--tone-2); background: none; color: inherit; font: inherit; font-size: 14px; line-height: 1.3; text-align: left; cursor: pointer; }
.pn-static .pn-row { cursor: default; }
button.pn-row:hover { background: var(--tone); }
.pn-row:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; box-shadow: inset 0 0 0 5px var(--sill); }
.r-t { font-weight: 600; font-stretch: 85%; font-variant-numeric: tabular-nums; }
.r-p { min-width: 0; overflow-wrap: anywhere; }
.r-who { color: var(--ink-2); }
.r-d { display: contents; }
.r-v { justify-self: end; white-space: nowrap; }
.r-r { grid-column: 2 / -1; font-size: 13px; color: var(--ink-2); text-wrap: pretty; }
.pn-row.is-ev { padding-left: 28px; }
.pn-row.is-ev .r-p { color: var(--ink-2); }
.pn-row.is-cur { background: var(--tone); }
.pn-row.is-cur::before { content: ""; position: absolute; left: 3px; top: 11px; width: 5px; height: 15px; background: var(--sill); border: 1.25px solid var(--ink); }
.pn-row.is-ev.is-cur::before { left: 15px; }
.pn-cols { grid-column: 1 / -1; display: grid; grid-template-columns: 2.9em minmax(0, 1fr) auto; gap: 0 10px; padding: 8px 2px 0 14px; font-size: 12px; font-weight: 600; font-stretch: var(--wd-ui); color: var(--ink-2); }
.pn-spacer { list-style: none; }
.pn-mach { list-style: none; margin: 0; padding: 0; }
/* the scroller of a list snaps to whole rows, under the sticky head (classes set by panels.js on the nearest scroller) */
.pn-rows > li, .pn-sec { scroll-margin-top: var(--pn-hh, 0px); }
.pn-snap { scroll-snap-type: y mandatory; }
.pn-snap > :first-child, .pn-snap .pn-rows > li:not(.pn-spacer) { scroll-snap-align: start; }
.pn-snapp { scroll-snap-type: y proximity; }
.pn-snapp > :first-child, .pn-snapp .pn-sec, .pn-snapp .pn-rows > li:not(.pn-spacer) { scroll-snap-align: start; }

/* ids that open a thing, and links to a step: text links with a tall hit area */
.pn-id, .pn-link { display: inline; margin: -14px -2px; padding: 14px 2px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: var(--line); }
.pn-id:hover, .pn-link:hover { text-decoration-color: var(--ink); }

/* a choice between buildings */
.pn-toggle { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; }

/* ---------- the IFC check ---------- */
.pn-rules { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.pn-rule { border-bottom: 1px solid var(--tone-2); }
.pn-rule-h { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 8px; align-items: baseline; padding: 7px 0; font-size: 13.5px; line-height: 1.3; }
.pn-rule details > summary { min-height: var(--tap); cursor: pointer; list-style: none; }
.pn-rule details > summary::-webkit-details-marker { display: none; }
.pn-rule details > summary:hover .pn-rt { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.pn-rt { min-width: 0; }
.pn-rm, .pn-rc { grid-column: 2 / -1; font-size: 12px; color: var(--ink-2); font-stretch: var(--wd-ui); }
.pn-rc::before { content: ""; display: inline-block; width: 0; height: 0; margin-right: 5px; vertical-align: 1px; border-style: solid; border-width: 4px 0 4px 5px; border-color: transparent transparent transparent var(--ink-2); transition: transform var(--t-ui) var(--ease); }
.pn-rule details[open] .pn-rc::before { transform: rotate(90deg); }
.pn-items { margin: 0 0 8px; padding: 0 0 0 16px; font-size: 12.5px; line-height: 1.35; color: var(--ink-2); overflow-wrap: anywhere; }
.pn-items b { color: var(--ink); font-weight: 600; }

/* ---------- states that read without colour: small swatches of the drawing's hatches ---------- */
.pn-state { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.pn-state.is-deny { color: var(--red); font-weight: 600; }
.pn-sw { flex: none; width: 20px; height: 10px; overflow: visible; vertical-align: -1px; }
.pn-s-maint { fill: url(#pn-p-maint) var(--tone-2); stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 1.5; }
.pn-s-fault { fill: url(#pn-p-fault) var(--tone-2); stroke: var(--red); stroke-width: 1.2; }
.pn-s-full { fill: url(#pn-p-full) var(--tone-2); stroke: var(--ink-2); stroke-width: 1; }
.pn-s-use { fill: url(#pn-p-use) var(--tone); stroke: var(--ink-2); stroke-width: 1; }
.pn-s-standby { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 6 3; }
.pn-s-open { stroke: var(--ink); stroke-width: 2; }
.pn-s-nodata { fill: none; stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 2.5 2; }
.pn-s-x { fill: none; stroke: var(--ink); stroke-width: 1.3; }
.pn-pt-ink { stroke: var(--ink); stroke-width: 1; }
.pn-pt-ink2 { stroke: var(--ink-2); stroke-width: 1; }
.pn-pt-red { stroke: var(--red); stroke-width: 1.1; }
.pn-pt-dot { fill: var(--ink-2); }

/* ---------- drawings inside the panels ---------- */
.pn-strip, .pn-levels, .pn-line, .pn-seats { display: block; width: 100%; height: auto; max-width: 100%; overflow: visible; }
.pn-strip text, .pn-levels text, .pn-line text, .pn-seats text { font-family: var(--font); font-stretch: var(--wd-label); font-size: 11px; font-weight: 500; fill: var(--ink); paint-order: stroke; stroke: var(--paper); stroke-width: 3px; stroke-linejoin: round; }
.pn-strip .m, .pn-levels .m, .pn-line .m, .pn-seats .m { fill: var(--ink-2); }
.pn-strip .rd, .pn-levels .rd, .pn-line .rd { fill: var(--red); font-weight: 650; }
.pn-strip .ln, .pn-levels .lv { font-size: 12px; font-weight: 650; }
.pn-strip .ax { stroke: var(--ink-2); stroke-width: 1; }
.pn-strip .gd { stroke: var(--tone-2); stroke-width: 1; }
.pn-strip .sp { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.pn-strip .sp.dn { stroke: var(--red); stroke-dasharray: 4 3; }
.pn-strip .sp.nx { stroke: var(--ink-2); stroke-dasharray: 1.5 2.5; }
.pn-strip .ex { stroke: var(--ink); stroke-width: 1; }
.pn-strip .tk { fill: none; stroke: var(--ink); stroke-width: 1.3; }
.pn-strip .ex.dn, .pn-strip .tk.dn { stroke: var(--red); }
.pn-strip .bd { stroke: var(--ink-2); stroke-width: 1; }
.pn-strip .bd-maint { fill: url(#pn-p-maint) var(--tone-2); }
.pn-strip .bd-use { fill: url(#pn-p-use) var(--tone); }
.pn-strip .bd-fault { fill: url(#pn-p-fault) var(--tone-2); stroke: var(--red); }
.pn-strip .now { stroke: var(--sill); stroke-width: 4; }
.pn-strip .now-i { stroke: var(--ink); stroke-width: 1; }

.pn-levels .dt { stroke: var(--line); stroke-width: .9; stroke-dasharray: 14 3 2 3; }
.pn-levels .el { fill: var(--paper); stroke: var(--ink); stroke-width: 1.1; }
.pn-levels .tr { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.pn-levels .brk { fill: none; stroke: var(--red); stroke-width: 1.5; }
.pn-levels .nd { fill: var(--paper); stroke: var(--ink); stroke-width: 1.3; }
.pn-levels .lk { fill: none; stroke: var(--ink-2); stroke-width: 1; }
.pn-levels .bx { fill: var(--paper); stroke: var(--ink); stroke-width: 1.2; }
.pn-levels .id, .pn-line .id { font-weight: 650; font-variant-numeric: tabular-nums; }

.pn-line .stp { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 2 2; }
.pn-line .tl { stroke: var(--ink); stroke-width: 2.4; }
.pn-line .is-standby .tl { stroke-dasharray: 10 5; }
.pn-line .is-stopped .tl { stroke: var(--ink-2); stroke-dasharray: 2 3; }
.pn-line .tb { stroke-width: 1.2; }
.pn-line .is-maintenance .tb { fill: url(#pn-p-maint) var(--tone-2); stroke: var(--ink); stroke-dasharray: 5 2; }
.pn-line .is-fault .tb { fill: url(#pn-p-fault) var(--tone-2); stroke: var(--red); }
.pn-line .tx { fill: none; stroke: var(--red); stroke-width: 1.6; }
.pn-line .is-stopped .tx { stroke: var(--ink); }
.pn-line .kl { fill: var(--paper); stroke: var(--ink); stroke-width: 1.2; }
.pn-line .uw { fill: none; stroke: var(--ink); stroke-width: 1.2; }
.pn-line .gp:not(.is-end):not(.is-split) .uw { stroke-dasharray: 3 3; }
.pn-line .is-split .uw { stroke-width: 3.2; stroke-linecap: round; }
.pn-line .kl.is-maint { fill: url(#pn-p-maint) var(--tone-2); }
.pn-line .kl.is-full { fill: url(#pn-p-full) var(--tone-2); }

.pn-seats .seat { fill: var(--ink); }
.pn-seats .seat.is-held { fill: var(--paper); stroke: var(--ink); stroke-width: 1.6; }
.pn-seats .bar { stroke: var(--ink); stroke-width: 2.2; }

/* ---------- empty, loading and error ---------- */
.pn .pstate { margin: 8px 0 0; }
.pn-empty p { margin: 0; }
.pn-empty .muted { margin-top: 2px; font-size: 13.5px; }
.pn-ghost { display: grid; gap: 0; margin-top: 14px; }
.pn-ghost i { display: block; height: 30px; border-bottom: 1px dashed var(--line); }
.pn-ghost i:first-child { height: 20px; border-bottom: 1.5px solid var(--line); }
.pn-err .btn { margin-top: 6px; }

/* ---------- narrow panels: a phone, or the panel column at 1100 to 1279 ---------- */
@container pn (max-width: 380px) {
  .pn-row, .pn-cols { grid-template-columns: 2.7em minmax(0, 1fr); }
  .pn-row .r-d { display: block; grid-column: 2; }
  .pn-row .r-v { display: inline-flex; margin-right: 6px; }
  .pn-row .r-r { display: inline; }
  .pn-cols span:last-child { display: none; }
  .pn-title { font-size: 22px; }
  .pn-t, .pn-t td, .pn-t tbody th { font-size: 13px; }
}
@container pn (min-width: 600px) {
  .pn-tb { grid-template-columns: repeat(auto-fill, minmax(11em, 1fr)); }
  .pn-sec-b { gap: 10px; }
}

/* ---------- phone: the decision stays up in the bottom sheet, its details open with the handle ---------- */
@media (max-width: 639.98px) {
  .side[data-open="false"] .pn-dec .pn-more { display: none; }
  .pn-dec .note-word { font-size: 24px; }
  .pn-dec .note-reason { font-size: 16px; }
  .pn-at { font-size: 12px; }
}
.bsheet:not([data-open="true"]) .pn-dec .pn-more { display: none; }

@media (forced-colors: active) {
  .pn-sill, .pn-row.is-cur::before { background: Highlight; border-color: CanvasText; }
  .pn-tri { stroke: CanvasText; }
}
