/* Living World panel: island cards, server tabs, get help, inbox and the ticket desk. Colours come from the shared tokens. */
.isle { display: block; width: 100%; height: 132px; border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; image-rendering: pixelated;
  background: linear-gradient(var(--sky-night-top), var(--sky-night-bottom)); }
:root[data-theme="light"] .isle { background: linear-gradient(var(--sky-day-top), var(--sky-day-bottom)); }
/* Pages space their sections; inside the panel the grids do it. */
.view [id^="lw-"] > section.panel:first-child, .view .lw-inbox section.panel, .view .ticket-layout > section.panel, .view .ticket-side-col > section.panel, .view #tab-console > section.panel, .view #tab-backups > section.panel { margin-top: 0; }
.view #lw-game + section.panel, .view #lw-backups > section.panel:first-child { margin-top: 18px; }
.view > .notice:not(.err):not(.warn) { background: var(--surface); }
.view > .notice + .lw-inbox { margin-top: 14px; }
.lw-gap { margin: 8px 0 14px; }
.lw-wide { width: min(640px, calc(100vw - 32px)); }
.panel-head h2 { min-width: 0; }
.server-head .tabs a { flex: none; }

/* Overview */
.lw-over { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.lw-over > .panel { margin: 0; }
.lw-over > .panel + .panel { margin-top: 0; }
.lw-power .panel-body { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; min-height: 132px; }
.lw-bigpower { width: 96px; height: 96px; display: grid; place-content: center; justify-items: center; gap: 4px; border-radius: var(--radius); border: var(--pixel) solid var(--ok); background: var(--inset); color: var(--text); font: 700 14px var(--font-ui); cursor: pointer; }
.lw-bigpower .icon { width: 28px; height: 28px; color: var(--ok); }
.lw-bigpower.on { border-color: var(--btn-line); }
.lw-bigpower.on .icon { color: var(--muted); }
.lw-bigpower:hover { background: var(--surface); }
.lw-addr { margin: 6px 0 18px; overflow-wrap: anywhere; }
.lw-addr code { font-family: var(--font-mono); font-size: 16px; }
.lw-graph-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.lw-graph-head b { font-family: var(--font-head); font-size: 22px; }
.lw-graph svg { display: block; width: 100%; height: 64px; }
.lw-graph .line { fill: none; stroke: var(--emerald); stroke-width: 2; vector-effect: non-scaling-stroke; }
.lw-graph .area { fill: color-mix(in srgb, var(--emerald) 16%, transparent); }
.lw-helpcard p { margin: 6px 0 14px; }

/* Settings rows and switches */
.lw-set { display: flex; align-items: center; justify-content: space-between; gap: 14px 24px; flex-wrap: wrap; padding: 14px 0; border-top: 1px solid var(--line); }
.lw-set:first-child { border-top: 0; padding-top: 0; }
.lw-set .hint { margin-top: 2px; }
.lw-set .seg { flex-wrap: wrap; max-width: 100%; }
.lw-num { max-width: 340px; }
.lw-num .input { min-width: 90px; }
.lw-switch { position: relative; flex: none; width: 52px; height: 30px; padding: 0; border: 1px solid var(--btn-line); border-radius: var(--radius-sm); background: var(--inset); cursor: pointer; }
.lw-switch i { position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 5px; background: var(--muted); transition: transform var(--t-fast) var(--ease-out); }
.lw-switch[aria-checked="true"] { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 22%, var(--inset)); }
.lw-switch[aria-checked="true"] i { transform: translateX(22px); background: var(--ok); }
.lw-switch:disabled, .seg button:disabled { opacity: .55; cursor: not-allowed; }
.lw-switch:focus-visible, .lw-bigpower:focus-visible, .lw-file:focus-visible, .lw-crumbs button:focus-visible, .lw-tile:focus-visible, .lw-face:focus-visible, .lw-row:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
progress { width: 100%; height: 12px; margin-bottom: 12px; accent-color: var(--emerald); }

/* Files */
.lw-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 14px; font-family: var(--font-mono); font-size: 14px; }
.lw-crumbs button { min-height: 30px; padding: 0 6px; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.lw-files li { padding: 6px 0; }
.lw-file { flex: 1; min-width: 0; min-height: 36px; display: flex; align-items: center; gap: 10px; border: 0; background: none; color: var(--text); font: 500 14px var(--font-mono); text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.lw-file:disabled { color: var(--muted); cursor: default; }
.lw-file .icon { flex: none; color: var(--muted); }
.lw-edit { min-height: 52vh; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.55; white-space: pre; overflow: auto; tab-size: 4; }

/* Get help */
.lw-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.lw-tile { min-height: 92px; padding: 12px; border: 1px solid var(--btn-line); border-radius: var(--radius); background: var(--inset); color: var(--text); font: 700 15px var(--font-ui); text-align: left; cursor: pointer; }
.lw-tile small { display: block; margin-top: 4px; color: var(--muted); font-weight: 400; font-size: 13px; }
.lw-tile:hover, .lw-tile[aria-pressed="true"] { border-color: var(--text); background: var(--surface); }
.lw-arts details { border-top: 1px solid var(--line); padding: 10px 0; }
.lw-arts summary { cursor: pointer; font-weight: 600; }
.lw-arts p { margin: 8px 0 10px; color: var(--muted); }

/* Inbox */
.lw-inbox { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 18px; align-items: start; }
.lw-rail { display: flex; flex-direction: column; gap: 2px; padding: 8px; }
.lw-rail button { display: flex; justify-content: space-between; gap: 8px; min-height: 38px; align-items: center; padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); font: 500 14px var(--font-ui); cursor: pointer; text-align: left; }
.lw-rail button:hover { background: var(--inset); }
.lw-rail button[aria-pressed="true"] { background: var(--inset); box-shadow: inset var(--pixel) 0 0 var(--emerald); }
.lw-rail b { color: var(--muted); font-family: var(--font-mono); font-weight: 500; }
.lw-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--text); text-decoration: none; }
.lw-row:first-child { border-top: 0; }
.lw-row[aria-current="true"] { background: var(--inset); box-shadow: inset var(--pixel) 0 0 var(--diamond); }
.lw-row .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lw-row .s { grid-column: 2; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lw-prio { justify-self: start; font: 600 12px var(--font-mono); padding: 3px 7px; border: 1px solid var(--btn-line); border-radius: 6px; }
.lw-prio.p1 { border-color: var(--lava); box-shadow: inset 3px 0 0 var(--lava); }
.lw-prio.p2 { border-color: var(--maint); box-shadow: inset 3px 0 0 var(--maint); }
.lw-sla { font: 500 12px var(--font-mono); color: var(--muted); white-space: nowrap; padding: 3px 7px; border-radius: 6px; border: 1px solid transparent; }
.lw-sla.late { color: var(--text); border-color: var(--lava); background: color-mix(in srgb, var(--lava) 18%, transparent); }
.lw-sla.soon { color: var(--text); border-color: var(--maint); }
.lw-keys { font-size: 13px; color: var(--muted); padding: 12px 4px; }
.lw-keys kbd { font-family: var(--font-mono); font-size: 12px; padding: 1px 6px; border: 1px solid var(--btn-line); border-radius: 5px; color: var(--text); }

/* Ticket */
.msg-context { align-self: stretch; border: 1px dashed var(--btn-line); border-radius: var(--radius-sm); padding: 10px 12px; }
.msg-context summary { cursor: pointer; font-weight: 600; }
.msg-context pre { margin-top: 10px; max-height: 340px; overflow: auto; font: 12.5px/1.5 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-action { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.msg-action .hint { margin: 0; }
.msg-action span { overflow-wrap: anywhere; }
.msg.note .msg-body { border: 1px dashed var(--maint); background: color-mix(in srgb, var(--maint) 10%, var(--surface)); }
.lw-desk { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.lw-tail { max-height: 220px; overflow: auto; margin: 10px 0; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--inset); font: 12px/1.5 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.lw-side details { border-top: 1px solid var(--line); padding: 10px 0; }
.lw-side summary { cursor: pointer; font-weight: 600; }
.lw-faces { display: flex; gap: 10px; margin-top: 10px; }
.lw-face { width: 72px; padding: 8px 4px; border: 1px solid var(--btn-line); border-radius: var(--radius); background: var(--inset); color: var(--text); font: 500 13px var(--font-ui); cursor: pointer; }
.lw-face svg { display: block; width: 40px; height: 40px; margin: 0 auto 4px; shape-rendering: crispEdges; }
.lw-face[aria-pressed="true"] { border-color: var(--emerald); box-shadow: inset 0 0 0 1px var(--emerald); }

/* Billing and Account (the customer's own) */
.view .lw-billhero { display: grid; grid-template-columns: minmax(180px, 280px) 1fr; align-items: center; overflow: hidden; margin: 0 0 24px; }
.lw-billhero .isle { height: 100%; min-height: 132px; border-bottom: 0; border-right: 1px solid var(--line); border-radius: 0; }
.lw-herotext { font-family: var(--font-head); font-weight: 700; font-size: 26px; line-height: 1.2; margin-bottom: 6px; }
.lw-bill .bill-card { border-top: var(--pixel) solid var(--maint); }
.lw-bill .section-gap { margin-top: 32px; }
.lw-bill > section.panel { margin-top: 12px; }
.lw-account { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.view .lw-account > section.panel { margin: 0; }
.lw-block > .panel-head { box-shadow: inset 0 var(--pixel) 0 var(--grass); border-radius: var(--radius) var(--radius) 0 0; }
.lw-account > section:nth-child(odd) { grid-column: 1; }
.lw-account > section:nth-child(even) { grid-column: 2; }

@media (max-width: 900px) {
  .lw-account { grid-template-columns: minmax(0, 1fr); }
  .view .lw-account > section.panel { grid-column: 1; }
  .view .lw-billhero { grid-template-columns: minmax(0, 1fr); }
  .lw-billhero .isle { border-right: 0; border-bottom: 1px solid var(--line); }
  .lw-over { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .lw-inbox { grid-template-columns: minmax(0, 1fr); }
  .lw-rail { flex-direction: row; overflow-x: auto; }
  .lw-rail button { flex: none; }
}
@media (max-width: 560px) {
  .lw-tiles { grid-template-columns: 1fr 1fr; }
  .lw-row { grid-template-columns: 40px minmax(0, 1fr); padding: 12px; }
  .lw-row .lw-sla { grid-column: 2; justify-self: start; }
  .lw-set .seg button { padding: 0 9px; }
}
@media (prefers-reduced-motion: reduce) { .lw-switch i { transition: none; } }

/* My HR pay stub page (printable) */
.hr-stub { max-width: 640px; margin: 24px auto; padding: 0 16px; }
.hr-stub td.num { text-align: right; font-family: 'IBM Plex Mono', monospace; }
.hr-stub tr.strong td { font-weight: 700; }
@media print { .hr-stub .no-print { display: none; } }
