/* ============================================================
   CSS CUSTOM PROPERTIES
   Dark "split-flap board" aesthetic with a warm amber accent
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Syne:wght@600;700;800&display=swap');

:root {
  --bg:       #0a0c10;
  --s1:       #10131c;
  --s2:       #181c28;
  --s3:       #1f2436;
  --border:   #252c42;
  --txt:      #d8dce8;
  --dim:      #606880;
  --amber:    #f5a623;
  --amber2:   #e8921a;
  --green:    #30d16a;
  --red:      #f06060;
  --blue:     #5b9cf6;
  --font-ui:  'Syne', sans-serif;
  --font-mono:'DM Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--txt);
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.025) 1px, transparent 0);
  background-size: 32px 32px;
}

a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: var(--s3);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--amber);
}

header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,12,16,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 22px;
  height: 56px;
  display: flex; align-items: center; gap: 14px;
}

.h-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-ui);
  font-weight: 800; font-size: 18px; letter-spacing: -.01em;
  user-select: none;
}

.h-logo svg { flex-shrink: 0; }

.h-logo-text {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.h-logo-text span:last-child {
  color: var(--amber);
}

.h-meta {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--dim);
  transition: color .2s ease;
  min-width: 0;
}

.h-meta-meta-warn { color: var(--amber); }
.h-meta-meta-alert { color: var(--red); }

.h-actions { display: flex; align-items: center; gap: 7px; }

.ring-wrap {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  cursor: default;
}

#ring { transform: rotate(-90deg); display: block; }
#ring-bg { fill: none; stroke: var(--border); stroke-width: 2.5; }
#ring-fg {
  fill: none; stroke: var(--amber); stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 75.4;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.25s linear;
}

.btn {
  cursor: pointer; border-radius: 8px;
  font-family: var(--font-ui); font-size: 13px; font-weight: 600;
  border: 1px solid var(--border); background: var(--s2); color: var(--txt);
  padding: 5px 13px; display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}

.btn:hover          { background: var(--s3); border-color: var(--amber); color: var(--amber); }
.btn:disabled       { cursor: default; opacity: .45; }
.btn:disabled:hover { background: var(--s2); border-color: var(--border); color: var(--txt); }
.btn-sq             { width: 32px; height: 32px; padding: 0; justify-content: center; font-size: 15px; }
.btn-primary        { background: var(--amber); border-color: var(--amber); color: #0a0c10; }
.btn-primary:hover  { background: var(--amber2); border-color: var(--amber2); color: #0a0c10; }
.btn-ghost-red      { background: transparent; border-color: transparent; color: var(--dim); }
.btn-ghost-red:hover{ background: rgba(240,96,96,.12); border-color: var(--red); color: var(--red); }
.btn-install        { padding-inline: 10px; }

.update-toast {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 180;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(245,166,35,.35);
  border-radius: 12px;
  background: rgba(16,19,28,.96);
  box-shadow: 0 16px 36px rgba(0,0,0,.35);
  backdrop-filter: blur(12px);
}

.update-toast[hidden] {
  display: none;
}

.update-toast-text {
  font-size: 12px;
  color: var(--txt);
  white-space: nowrap;
}

.btn-update-toast {
  padding-inline: 10px;
  min-height: 30px;
  font-size: 12px;
}

.search-shell {
  width: min(560px, 100%);
}

.search-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-body #qs-res {
  display: none;
  margin-top: 0;
}

#overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.65); z-index: 100;
}

#overlay.open { display: block; }

#drawer {
  position: fixed; right: 0; top: 0; bottom: 0;
  width: 370px; max-width: 100vw;
  background: var(--s1);
  border-left: 1px solid var(--border);
  z-index: 101;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
}

#overlay.open #drawer { transform: translateX(0); }

.d-head {
  padding: 0 18px; height: 56px; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; font-size: 15px; letter-spacing: .01em;
}

.d-body {
  flex: 1; overflow-y: auto; padding: 20px;
  display: flex; flex-direction: column; gap: 24px;
}

.sec h4 {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--dim); margin-bottom: 10px;
}

.sec-note {
  font-family: var(--font-mono);
  font-size: 12px; color: var(--dim); line-height: 1.6;
  margin-top: 8px;
}

.sec-note a { color: var(--amber); }

.app-disclaimer {
  margin-top: auto;
  padding-top: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.5;
  color: rgba(96,104,128,.85);
}

.density-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.density-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.density-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--dim);
}

.profile-switcher {
  margin-bottom: 8px;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-profile-action {
  padding: 5px 10px;
  font-size: 12px;
}

.row-inp { display: flex; gap: 8px; }

.inp {
  flex: 1; padding: 8px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--s2); color: var(--txt);
  font-family: var(--font-mono); font-size: 13px; outline: none;
  transition: border-color .15s;
}

.inp:focus { border-color: var(--amber); }
.inp::placeholder { color: var(--dim); }

#s-res {
  display: none; margin-top: 8px;
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
}

.s-section + .s-section {
  border-top: 1px solid var(--border);
}

.s-section-title {
  padding: 8px 12px 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--dim);
  background: rgba(14,17,25,.92);
}

.s-item {
  padding: 9px 13px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}

.s-item:last-child { border-bottom: none; }
.s-item:hover:not(.s-hint) { background: var(--s2); }
.s-name { font-size: 13px; font-weight: 600; }
.s-id   { font-family: var(--font-mono); font-size: 11px; color: var(--dim); margin-top: 2px; }
.s-hint { color: var(--dim); font-size: 13px; cursor: default; }
.s-line-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: transparent;
  color: var(--txt);
  border: 0;
}
.s-line-chip {
  flex-shrink: 0;
}
.s-line-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.s-line-copy .s-name,
.s-line-copy .s-id {
  display: block;
  line-height: 1.25;
}
.s-already { color: var(--dim); }
.s-already .s-name::after { content: ' ✓'; color: var(--green); }

.s-group {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(18,22,32,.72);
}

.s-group:last-child {
  border-bottom: none;
}

.s-group-head {
  margin-bottom: 8px;
}

.s-group-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.s-option {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(37,44,66,.9);
  background: rgba(24,28,40,.86);
  color: var(--txt);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}

.s-option:hover {
  border-color: var(--amber);
  background: rgba(31,36,52,.92);
}

.s-option-tracked {
  color: var(--dim);
}

.s-option-main {
  display: block;
  font-size: 12px;
  font-weight: 700;
}

.s-option-sub {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--dim);
}

.sl-row {
  display: flex; flex-direction: column; gap: 10px;
  padding: 9px 11px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--s2);
  margin-bottom: 8px;
  transition: border-color .15s;
}

.sl-row:last-child { margin-bottom: 0; }
.sl-row:hover { border-color: var(--s3); }
.sl-top  { display: flex; align-items: center; gap: 10px; }
.sl-info { flex: 1; min-width: 0; }
.sl-actions { display: flex; align-items: center; gap: 6px; }
.sl-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-id   { font-family: var(--font-mono); font-size: 10.5px; color: var(--dim); }
.sl-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.sl-filter-note {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--dim);
}

.line-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  cursor: pointer;
  min-width: 34px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  transition: background .15s, border-color .15s, color .15s, opacity .15s;
}

.line-chip:hover {
  border-color: var(--chip-bg, var(--amber));
  color: var(--txt);
}

.line-chip.active {
  background: var(--chip-bg, var(--amber));
  border-color: var(--chip-bg, var(--amber));
  color: var(--chip-fg, #0a0c10);
}

.line-chip-muted { color: var(--txt); }

.legend {
  display: flex; gap: 16px; flex-wrap: wrap;
}

.legend-item {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 12px; color: var(--dim);
}

.ldot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

#board {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
  gap: 14px;
  align-items: start;
}

.empty {
  grid-column: 1 / -1; text-align: center;
  padding: 80px 20px; color: var(--dim);
}

.empty .emo  { font-size: 48px; margin-bottom: 16px; line-height: 1; }
.empty h2    { font-size: 20px; font-weight: 700; color: var(--txt); margin-bottom: 8px; }
.empty p     { font-size: 14px; line-height: 1.6; margin-bottom: 20px;
               max-width: 300px; margin-inline: auto; color: var(--dim); }

.card {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
  transition: border-color .2s;
}

.card:hover { border-color: var(--s3); }

.card-hd {
  padding: 12px 15px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}

.card-head-btn {
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.card-head-btn:hover .card-name {
  color: var(--amber);
}

.card-name {
  font-size: 14px; font-weight: 700; letter-spacing: .01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.dep {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 15px;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}

.dep:last-child  { border-bottom: none; }
.dep:hover       { background: var(--s2); }

.badge {
  width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; letter-spacing: -.03em;
  font-family: var(--font-mono);
  line-height: 1;
  text-align: center;
}

.badge-btn {
  cursor: pointer;
  border: none;
  transition: transform .12s ease, filter .12s ease;
}

.badge-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.dep-info-btn {
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.dep-info-btn:hover .dep-dir {
  color: var(--amber);
}

.day-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 140;
  background: rgba(4, 6, 10, .84);
  backdrop-filter: blur(10px);
  padding: 18px;
}

.day-modal.open { display: block; }

.day-shell {
  width: min(980px, 100%);
  max-height: calc(100vh - 36px);
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(16,19,28,.98), rgba(10,12,16,.98));
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
}

.day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.day-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.day-date-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.day-date-input {
  width: 144px;
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.btn-day-date {
  padding-inline: 10px;
  font-size: 12px;
}

.day-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.day-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
  line-height: 1;
  text-align: center;
}

.day-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.day-subtitle {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--dim);
}

.day-body {
  padding: 20px;
  overflow-y: auto;
}

.day-panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(16,19,28,.72);
  padding: 16px 18px;
}

.day-status {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--dim);
  line-height: 1.7;
}

.day-status-err { color: #e0904a; }

.stop-badge {
  background: var(--s3);
  color: var(--amber);
}

.stop-sheet-meta {
  margin-bottom: 12px;
}

.stop-sheet-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stop-sheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.stop-line-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stop-line-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stop-line-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -.03em;
  flex-shrink: 0;
  line-height: 1;
  text-align: center;
}

.stop-line-copy {
  min-width: 0;
}

.stop-line-title {
  font-size: 13px;
  font-weight: 700;
}

.stop-line-sub {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--dim);
  line-height: 1.35;
}

.stop-line-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-stop-line {
  padding-inline: 10px;
  font-size: 12px;
}

.stop-sheet-panel {
  padding: 0;
}

.stop-sheet-list .dep:last-child {
  border-bottom: none;
}

.line-sheet-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.line-sheet-meta {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(37,44,66,.72);
}

.line-sheet-directions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.line-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(96,104,128,.35);
  border-top-color: var(--amber);
  flex-shrink: 0;
  animation: spin .8s linear infinite;
}

.line-stop-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid rgba(37,44,66,.72);
}

.line-stop-row:first-child {
  border-top: none;
  padding-top: 0;
}

.line-stop-open {
  width: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  border: none;
  background: transparent;
  color: var(--txt);
  cursor: pointer;
  transition: background .12s ease;
}

.line-stop-open:hover {
  color: var(--amber);
}

.line-stop-open-static {
  cursor: default;
}

.line-stop-open-static:hover {
  color: var(--txt);
}

.line-stop-open-inline {
  min-width: 0;
}

.line-stop-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.line-stop-code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--dim);
}

.line-stop-times {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.line-stop-empty {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--dim);
}

.line-time-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(37,44,66,.9);
  background: rgba(20,24,35,.82);
  color: var(--txt);
  cursor: pointer;
  font-family: var(--font-mono);
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.line-time-copy {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
}

.line-time-chip:hover {
  border-color: var(--amber);
  color: var(--amber);
}

.line-time-chip-urgent {
  border-color: rgba(248,179,81,.45);
}

.line-time-main {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.line-time-sub {
  font-size: 11px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.line-time-chip .dot {
  width: 5px;
  height: 5px;
}

.day-groups {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.day-groups-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.day-groups-split .day-group:nth-child(odd) {
  padding-right: 18px;
}

.day-groups-split .day-group:nth-child(even) {
  padding-left: 18px;
  border-left: 1px solid rgba(37,44,66,.72);
}

.day-groups-split .day-group:nth-child(-n+2) {
  border-top: none;
  padding-top: 0;
}

.day-group {
  width: 100%;
  padding: 14px 0;
  border-top: 1px solid rgba(37,44,66,.72);
}

.day-group:first-child {
  border-top: none;
  padding-top: 0;
}

.day-group-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}

.layout-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(24,28,40,.88);
}

.layout-btn {
  cursor: pointer;
  min-width: 78px;
  height: 30px;
  padding: 0 12px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  transition: background .15s, color .15s;
}

.layout-btn:hover { color: var(--txt); }

.layout-btn.active {
  background: var(--amber);
  color: #0a0c10;
}

.layout-btn:disabled {
  cursor: default;
  color: var(--dim);
  opacity: .5;
}

.layout-toggle.is-disabled {
  opacity: .6;
}

.day-hours {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.day-hours-rows .day-hour {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: start;
  border-top: 1px solid rgba(37,44,66,.6);
  padding: 9px 0;
}

.day-hours-rows .day-hour:first-child {
  border-top: none;
  padding-top: 0;
}

.day-hours-columns {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  align-items: start;
  justify-items: start;
  justify-content: start;
  gap: 0;
  overflow-x: auto;
  width: fit-content;
  max-width: 100%;
  padding: 2px 0 8px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.day-hours-columns::-webkit-scrollbar {
  height: 8px;
}

.day-hours-columns::-webkit-scrollbar-track {
  background: transparent;
}

.day-hours-columns::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

.day-hours-columns .day-hour {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-self: start;
  gap: 6px;
  padding: 0 8px;
  border-left: 1px solid rgba(37,44,66,.7);
  border-top: none;
  scroll-snap-align: start;
}

.day-hours-columns .day-hour:first-child {
  border-left: none;
  padding-left: 0;
}

.day-hours-columns .day-hour:last-child {
  padding-right: 0;
}

.day-hour-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: .04em;
  line-height: 1.2;
}

.day-times {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.day-hours-columns .day-times {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 5px;
}

.day-hours-columns .time-chip {
  min-width: 0;
  width: auto;
}

.time-chip {
  display: inline-block;
  min-width: 44px;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--txt);
  font-variant-numeric: tabular-nums;
}

.dep-info    { flex: 1; min-width: 0; }
.dep-dir     { font-size: 13px; font-weight: 600;
               white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dep-mode    { font-size: 11px; color: var(--dim); margin-top: 2px;
               font-family: var(--font-mono); }

.dep-t       { text-align: right; flex-shrink: 0; min-width: 52px; }
.dep-rel     {
  font-size: 15px; font-weight: 700;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
}

.dep-abs     { font-size: 11px; color: var(--dim); font-family: var(--font-mono); margin-top: 1px; }
.dep-urgent  { color: var(--amber) !important; }

.dot         { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.dot-rt      { background: var(--green); }
.dot-th      { background: var(--border); }

.card-msg     { padding: 18px 15px; text-align: center; font-size: 13px; color: var(--dim); }
.card-msg-err { color: #e0904a; font-family: var(--font-mono); font-size: 12px; }

.sk {
  background: linear-gradient(90deg, var(--s2) 25%, var(--s3) 50%, var(--s2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@media (max-width: 500px) {
  #board   { padding: 12px; gap: 12px; }
  #drawer  { width: 100vw; }
  header   { padding: 0 12px; gap: 10px; height: 54px; }
  .day-modal { padding: 0; }
  .day-shell {
    max-height: 100vh;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  .day-head,
  .day-body { padding: 16px; }
  .day-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .day-head-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .day-date-tools {
    width: 100%;
    flex-wrap: wrap;
  }
  .day-groups-split {
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  .day-groups-split .day-group:nth-child(odd),
  .day-groups-split .day-group:nth-child(even) {
    padding-left: 0;
    padding-right: 0;
    border-left: none;
  }
  .day-groups-split .day-group:nth-child(n+2) {
    border-top: 1px solid rgba(37,44,66,.72);
    padding-top: 14px;
  }
  .drawer-layout-btn {
    min-width: 70px;
    flex: 1;
  }
  .btn-install {
    padding-inline: 8px;
    font-size: 12px;
  }
  .h-logo {
    gap: 8px;
    font-size: 15px;
  }
  .h-logo svg {
    width: 18px;
    height: 18px;
  }
  .h-logo-text {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    line-height: .84;
  }
  .h-meta {
    font-size: 10px;
    line-height: 1.05;
    text-align: center;
  }
  .h-actions {
    gap: 5px;
  }
  .h-actions .btn-sq {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }
  .ring-wrap {
    width: 28px;
    height: 28px;
  }
  .line-time-chip {
    align-items: flex-start;
    min-height: auto;
    padding-block: 5px;
  }
  .line-time-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    line-height: 1.05;
  }
  .line-time-chip .dot {
    margin-top: 3px;
  }

  body.mobile-compact header {
    height: 48px;
    padding: 0 8px;
    gap: 8px;
  }
  body.mobile-compact .h-logo {
    gap: 7px;
    font-size: 13px;
  }
  body.mobile-compact .h-logo svg {
    width: 16px;
    height: 16px;
  }
  body.mobile-compact .h-logo-text {
    line-height: .82;
  }
  body.mobile-compact .h-meta {
    max-width: 82px;
    font-size: 9px;
    line-height: 1.02;
  }
  body.mobile-compact .h-actions {
    gap: 4px;
  }
  body.mobile-compact .h-actions .btn-sq {
    width: 28px;
    height: 28px;
    font-size: 13px;
  }
  body.mobile-compact .ring-wrap {
    width: 24px;
    height: 24px;
  }
  body.mobile-compact #board {
    padding: 8px;
    gap: 8px;
  }
  body.mobile-compact .card {
    border-radius: 12px;
  }
  body.mobile-compact .card-hd {
    padding: 8px 11px;
  }
  body.mobile-compact .card-name {
    font-size: 13px;
  }
  body.mobile-compact .dep {
    gap: 8px;
    padding: 6px 10px;
  }
  body.mobile-compact .badge {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    font-size: 10px;
  }
  body.mobile-compact .dep-dir {
    font-size: 12px;
  }
  body.mobile-compact .dep-mode {
    display: none;
  }
  body.mobile-compact .dep-t {
    min-width: 46px;
  }
  body.mobile-compact .dep-rel {
    font-size: 13px;
  }
  body.mobile-compact .dep-abs {
    font-size: 10px;
    margin-top: 0;
  }
  body.mobile-compact .dot {
    width: 5px;
    height: 5px;
  }
  body.mobile-compact .card-msg {
    padding: 14px 10px;
    font-size: 12px;
  }
  body.day-mobile-compact .day-head,
  body.day-mobile-compact .day-body {
    padding: 12px;
  }
  body.day-mobile-compact .day-head {
    gap: 10px;
  }
  body.day-mobile-compact .day-head-actions {
    gap: 6px;
    align-items: stretch;
  }
  body.day-mobile-compact .day-date-tools {
    gap: 6px;
  }
  body.day-mobile-compact .day-date-input {
    width: 132px;
    height: 28px;
    padding: 0 8px;
    font-size: 11px;
  }
  body.day-mobile-compact .btn-day-date {
    padding-inline: 8px;
    font-size: 11px;
  }
  body.day-mobile-compact .day-meta {
    gap: 9px;
  }
  body.day-mobile-compact .stop-sheet-meta {
    margin-bottom: 10px;
  }
  body.day-mobile-compact .stop-sheet-lines {
    gap: 6px;
  }
  body.day-mobile-compact .stop-sheet-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 10px;
  }
  body.day-mobile-compact .stop-line-card {
    gap: 10px;
  }
  body.day-mobile-compact .stop-line-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 10px;
  }
  body.day-mobile-compact .stop-line-title {
    font-size: 12px;
  }
  body.day-mobile-compact .stop-line-sub {
    font-size: 9px;
  }
  body.day-mobile-compact .stop-line-actions {
    gap: 6px;
  }
  body.day-mobile-compact .btn-stop-line {
    padding-inline: 8px;
    font-size: 11px;
  }
  body.day-mobile-compact .line-sheet-list {
    gap: 0;
  }
  body.day-mobile-compact .line-sheet-meta {
    margin-bottom: 10px;
    padding-bottom: 10px;
  }
  body.day-mobile-compact .line-sheet-directions {
    gap: 6px;
  }
  body.day-mobile-compact .line-stop-row {
    gap: 10px;
    padding: 10px 0;
  }
  body.day-mobile-compact .line-stop-times {
    gap: 6px;
  }
  body.day-mobile-compact .line-time-chip {
    min-height: auto;
    padding: 4px 8px;
    gap: 6px;
  }
  body.day-mobile-compact .line-stop-open {
    gap: 3px;
  }
  body.day-mobile-compact .line-stop-name {
    font-size: 13px;
  }
  body.day-mobile-compact .line-stop-code {
    font-size: 10px;
  }
  body.day-mobile-compact .line-time-main {
    font-size: 11px;
  }
  body.day-mobile-compact .line-time-sub {
    font-size: 10px;
  }
  body.day-mobile-compact .day-badge {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    font-size: 11px;
  }
  body.day-mobile-compact .day-title {
    font-size: 15px;
  }
  body.day-mobile-compact .day-subtitle {
    margin-top: 2px;
    font-size: 11px;
  }
  body.day-mobile-compact .day-panel {
    padding: 10px 12px;
    border-radius: 12px;
  }
  body.day-mobile-compact .day-group {
    padding: 10px 0;
  }
  body.day-mobile-compact .day-groups-split .day-group:nth-child(n+2) {
    padding-top: 10px;
  }
  body.day-mobile-compact .day-group-title {
    font-size: 13px;
    margin-bottom: 8px;
  }
  body.day-mobile-compact .day-layout-toggle {
    gap: 2px;
    padding: 3px;
  }
  body.day-mobile-compact .day-layout-btn {
    min-width: 56px;
    height: 26px;
    padding: 0 8px;
    font-size: 10px;
  }
  body.day-mobile-compact .day-hours-rows .day-hour {
    grid-template-columns: 40px 1fr;
    gap: 8px;
    padding: 6px 0;
  }
  body.day-mobile-compact .day-hours-columns {
    grid-auto-columns: max-content;
    padding: 1px 0 6px;
  }
  body.day-mobile-compact .day-hours-columns .day-hour {
    min-width: 0;
    gap: 4px;
    padding: 0 6px;
  }
  body.day-mobile-compact .day-hours-columns .day-hour:last-child {
    padding-right: 0;
  }
  body.day-mobile-compact .day-hour-label {
    font-size: 10px;
  }
  body.day-mobile-compact .day-times {
    gap: 4px 8px;
  }
  body.day-mobile-compact .day-hours-columns .day-times {
    gap: 2px;
  }
  body.day-mobile-compact .time-chip {
    min-width: 38px;
    font-size: 11px;
    line-height: 1.35;
  }
  body.day-mobile-compact .day-hours-columns .time-chip {
    min-width: 0;
  }

  body.day-mobile-dense .day-head,
  body.day-mobile-dense .day-body {
    padding: 9px;
  }
  body.day-mobile-dense .day-head {
    gap: 8px;
  }
  body.day-mobile-dense .day-head-actions {
    gap: 4px;
    align-items: stretch;
  }
  body.day-mobile-dense .day-date-tools {
    gap: 4px;
  }
  body.day-mobile-dense .day-date-input {
    width: 120px;
    height: 26px;
    padding: 0 7px;
    font-size: 10px;
  }
  body.day-mobile-dense .btn-day-date {
    padding-inline: 7px;
    font-size: 10px;
  }
  body.day-mobile-dense .day-meta {
    gap: 7px;
  }
  body.day-mobile-dense .stop-sheet-meta {
    margin-bottom: 8px;
  }
  body.day-mobile-dense .stop-sheet-lines {
    gap: 5px;
  }
  body.day-mobile-dense .stop-sheet-grid {
    grid-template-columns: 1fr;
    gap: 7px;
    margin-bottom: 8px;
  }
  body.day-mobile-dense .stop-line-card {
    gap: 8px;
  }
  body.day-mobile-dense .stop-line-badge {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 10px;
  }
  body.day-mobile-dense .stop-line-title {
    font-size: 11px;
  }
  body.day-mobile-dense .stop-line-sub {
    font-size: 9px;
  }
  body.day-mobile-dense .stop-line-actions {
    gap: 5px;
  }
  body.day-mobile-dense .btn-stop-line {
    padding-inline: 7px;
    font-size: 10px;
  }
  body.day-mobile-dense .line-sheet-list {
    gap: 0;
  }
  body.day-mobile-dense .line-sheet-meta {
    margin-bottom: 8px;
    padding-bottom: 8px;
  }
  body.day-mobile-dense .line-sheet-directions {
    gap: 5px;
  }
  body.day-mobile-dense .line-stop-row {
    gap: 8px;
    padding: 8px 0;
  }
  body.day-mobile-dense .line-stop-times {
    gap: 5px;
  }
  body.day-mobile-dense .line-time-chip {
    min-height: auto;
    padding: 3px 7px;
    gap: 5px;
  }
  body.day-mobile-dense .line-stop-open {
    gap: 2px;
  }
  body.day-mobile-dense .line-stop-name {
    font-size: 12px;
  }
  body.day-mobile-dense .line-stop-code {
    font-size: 9px;
  }
  body.day-mobile-dense .line-time-main {
    font-size: 10px;
  }
  body.day-mobile-dense .line-time-sub {
    font-size: 9px;
  }
  body.day-mobile-dense .day-badge {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    font-size: 10px;
  }
  body.day-mobile-dense .day-title {
    font-size: 14px;
    line-height: 1.15;
  }
  body.day-mobile-dense .day-subtitle {
    margin-top: 1px;
    font-size: 10px;
  }
  body.day-mobile-dense .day-panel {
    padding: 8px 9px;
    border-radius: 10px;
  }
  body.day-mobile-dense .day-group {
    padding: 8px 0;
  }
  body.day-mobile-dense .day-groups-split .day-group:nth-child(n+2) {
    padding-top: 8px;
  }
  body.day-mobile-dense .day-group-title {
    font-size: 12px;
    margin-bottom: 6px;
  }
  body.day-mobile-dense .day-layout-toggle {
    gap: 2px;
    padding: 2px;
  }
  body.day-mobile-dense .day-layout-btn {
    min-width: 48px;
    height: 24px;
    padding: 0 6px;
    font-size: 9px;
  }
  body.day-mobile-dense .day-hours-rows .day-hour {
    grid-template-columns: 34px 1fr;
    gap: 6px;
    padding: 4px 0;
  }
  body.day-mobile-dense .day-hours-columns {
    grid-auto-columns: max-content;
    padding: 0 0 5px;
  }
  body.day-mobile-dense .day-hours-columns .day-hour {
    min-width: 0;
    gap: 3px;
    padding: 0 5px;
  }
  body.day-mobile-dense .day-hours-columns .day-hour:last-child {
    padding-right: 0;
  }
  body.day-mobile-dense .day-hour-label {
    font-size: 9px;
  }
  body.day-mobile-dense .day-times {
    gap: 3px 6px;
  }
  body.day-mobile-dense .day-hours-columns .day-times {
    gap: 1px;
  }
  body.day-mobile-dense .time-chip {
    min-width: 32px;
    font-size: 10px;
    line-height: 1.2;
  }
  body.day-mobile-dense .day-hours-columns .time-chip {
    min-width: 0;
  }
}
