.rail { overflow: auto; }
#routes { overflow: visible; }
.rail-title { font-size: 14px; font-weight: 600; padding: 14px 14px 6px; }
.views { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.view-btn {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-left: 3px solid transparent;
  background: none;
  padding: 6px 14px 6px 11px;
  font-size: 14px;
  cursor: pointer;
}
.view-btn:hover { background: var(--linen); }
.view-btn.is-current { background: var(--brass-tint); border-left-color: var(--brass); font-weight: 500; }

.controls { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: end; }
.controls .field { min-width: 150px; }
.controls .field.grow { flex: 1 1 220px; }
.controls .check { height: 36px; }
.field label > span:first-child { font-weight: 500; }

.calls { margin-top: 14px; display: grid; gap: 4px; }
.calls:empty { display: none; }
.calls-title { font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.call {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 1px solid #E2E9EB;
  border-radius: 6px;
  background: #F8FAFA;
  padding: 5px 10px;
  font-size: 13px;
  cursor: pointer;
}
.call:hover { border-color: var(--petrol); }
.call code { font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }

.view-body { margin-top: 18px; display: grid; gap: 22px; min-width: 0; }
.view-body:empty { display: none; }
.block { min-width: 0; }
.block h3 { font-size: 15px; font-weight: 600; margin: 0 0 8px; display: flex; gap: 10px; align-items: center; }
.block > .quiet { margin-bottom: 8px; }
.table-wrap.free { max-height: none; overflow-x: auto; }
.detail { border-top: 1px solid var(--line); padding-top: 18px; display: grid; gap: 14px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.tile {
  border: 1px solid var(--line);
  border-left: 4px solid var(--petrol);
  border-radius: 6px;
  padding: 10px 12px;
  display: grid;
  gap: 2px;
  align-content: start;
}
.tile-value { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.tile-label { font-size: 13px; color: var(--ink); }
.tile-hint { font-size: 12px; color: var(--muted); }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.bar { display: inline-block; height: 8px; border-radius: 4px; background: var(--brass); vertical-align: middle; }
.tick { display: inline-block; width: 16px; height: 16px; border: 1.5px solid var(--ink); border-radius: 3px; }
.task-title { display: block; font-weight: 500; }

.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 18px; margin: 0; }
.facts dt { font-size: 12.5px; color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid textarea { min-height: 72px; }

.plan { border-collapse: separate; border-spacing: 0; font-size: 12.5px; width: max-content; min-width: 100%; }
.plan th, .plan td {
  border-bottom: 1px solid #E7ECEE;
  border-right: 1px solid #E7ECEE;
  padding: 5px 8px;
  white-space: nowrap;
  min-width: 76px;
}
.plan thead th { background: var(--paper); font-weight: 500; color: var(--muted); text-align: center; }
.plan thead th:first-child, .plan tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--paper);
  text-align: left;
  font-weight: 500;
  color: var(--ink);
}
.plan tbody th small { display: block; font-weight: 400; color: var(--muted); }
.plan tbody th.sub { font-weight: 400; padding-left: 20px; }
.plan .type-row th, .plan .type-row td { background: #F3F6F7; }
.plan thead th.today { background: var(--brass-tint); color: var(--ink); }
.plan .num { text-align: right; font-family: var(--mono); font-size: 12px; }
.plan .num small { display: block; color: var(--muted); font-family: var(--sans); }
.plan .closed { color: var(--err); }
.plan .stay {
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--petrol-tint);
  border-left: 3px solid var(--petrol);
}
.plan .s-checkin { background: #DDF1E7; border-left-color: var(--ok); }
.plan .s-checkout { background: #E7ECEE; border-left-color: var(--muted); }
.plan .blocked {
  background: repeating-linear-gradient(45deg, #F3F6F7, #F3F6F7 6px, #E2E9EB 6px, #E2E9EB 12px);
  color: var(--muted);
}

@media print {
  html, body { height: auto; }
  body { display: block; background: #fff; }
  .desk, .rail, #response, .no-print, .calls { display: none; }
  .workspace { display: block; }
  main { overflow: visible; padding: 0; }
  .panel { border: 0; padding: 0; }
  .tile { break-inside: avoid; }
  .quick { font-size: 11.5px; }
}
