:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --panel: #ffffff;
  --panel-soft: #edf4ef;
  --text: #17211b;
  --muted: #68736c;
  --line: #d9e2db;
  --green: #137a4b;
  --green-soft: #dff2e8;
  --blue: #245b8f;
  --blue-soft: #e0edf8;
  --red: #a93d32;
  --red-soft: #f7e4e1;
  --amber: #9a6a13;
  --amber-soft: #f8edcd;
  --shadow: 0 18px 45px rgba(41, 60, 49, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.logged-out .app-shell,
.logged-in .login-screen,
[hidden] {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
  background: var(--bg);
}

.registration-screen {
  min-height: 100vh;
  padding: 22px;
  background: var(--bg);
}

.registration-layout {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  gap: 18px;
  margin: 0 auto;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.registration-card,
.account-list-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.registration-card {
  display: grid;
  gap: 14px;
  padding: 24px;
}

.registration-card h1,
.account-list-head h2 {
  margin: 0;
}

.registration-back {
  display: inline-flex;
  width: fit-content;
}

.role-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.secondary-button {
  min-height: 44px;
  border: 1px solid var(--green);
  border-radius: 6px;
  background: #fff;
  color: var(--green);
  font-weight: 800;
}

.registration-message {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.registration-message.success {
  color: var(--green);
}

.account-list-panel {
  min-width: 0;
  overflow: hidden;
}

.account-list-head {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
}

.account-row:last-child {
  border-bottom: 0;
}

.account-row strong,
.account-row span {
  display: block;
}

.account-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.account-role {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.login-card h1 {
  margin-bottom: 8px;
}

.login-button {
  min-height: 46px;
  border: 1px solid var(--green);
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
}

.login-help,
.login-error {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

.login-help {
  color: var(--muted);
}

.login-error {
  min-height: 18px;
  color: var(--red);
  font-weight: 700;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.mobile-nav,
.back-button {
  display: none;
}

.back-button.registration-back {
  display: inline-flex;
}

.admin-panel {
  display: none;
}

.admin-mode .admin-panel {
  display: block;
}

.admin-mode .itinerary-panel,
.admin-mode .workspace,
.admin-mode .mobile-nav {
  display: none;
}

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

.admin-head h2,
.admin-user h3,
.admin-user p {
  margin: 0;
}

.admin-head h2 {
  font-size: 24px;
}

.admin-total {
  text-align: right;
}

.admin-total strong,
.admin-total span {
  display: block;
}

.admin-total strong {
  color: var(--green);
  font-size: 30px;
}

.admin-total span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.admin-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.admin-users {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.circuit-overview {
  border-bottom: 1px solid var(--line);
}

.circuit-overview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: #f8faf8;
}

.circuit-overview-head h3 {
  margin: 0;
  font-size: 16px;
}

.circuit-overview-head span {
  color: var(--muted);
  font-size: 12px;
}

.circuit-list {
  display: grid;
}

.circuit-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 86px minmax(170px, 220px);
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 8px 18px;
  border-top: 1px solid var(--line);
}

.assignment-select {
  width: 100%;
  height: 38px;
}

.circuit-row:first-child {
  border-top: 0;
}

.circuit-row strong,
.circuit-row small {
  display: block;
}

.circuit-row strong {
  font-size: 14px;
}

.circuit-row small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.circuit-id {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  font-weight: 800;
}

.circuit-id.road {
  background: var(--blue-soft);
  color: var(--blue);
}

.circuit-id.pub {
  background: var(--amber-soft);
  color: var(--amber);
}

.circuit-count,
.circuit-status {
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.circuit-status {
  color: var(--muted);
}

.circuit-status.active {
  color: var(--green);
}

.admin-user {
  min-width: 0;
  padding: 18px;
  border-right: 1px solid var(--line);
}

.admin-user:last-child {
  border-right: 0;
}

.admin-user-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.admin-user-head h3 {
  font-size: 19px;
}

.admin-user-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.admin-user-head > strong {
  color: var(--green);
  font-size: 22px;
  white-space: nowrap;
}

.progress-track {
  height: 9px;
  margin: 16px 0;
  border-radius: 5px;
  background: #e6ebe7;
  overflow: hidden;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.admin-stats div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfb;
}

.admin-stats strong,
.admin-stats span {
  display: block;
}

.admin-stats strong {
  font-size: 19px;
}

.admin-stats span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.day-progress {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.day-progress-item {
  min-width: 0;
  padding: 9px 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f8f7;
  text-align: center;
}

.day-progress-item.started {
  border-color: #d9bb6c;
  background: var(--amber-soft);
}

.day-progress-item.complete {
  border-color: #8bc9a9;
  background: var(--green-soft);
}

.day-progress-item span,
.day-progress-item strong,
.day-progress-item small {
  display: block;
}

.day-progress-item span,
.day-progress-item small {
  color: var(--muted);
  font-size: 10px;
}

.day-progress-item strong {
  margin: 5px 0;
  font-size: 16px;
}

.admin-note {
  margin: 0;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.userbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.userbar strong,
.userbar span {
  display: block;
}

.userbar span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.userbar-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.cycle-control span {
  margin: 0 0 4px;
  font-size: 11px;
}

.cycle-control select {
  width: 245px;
  height: 38px;
}

.history-cycle .cycle-control select {
  border-color: #d9bb6c;
  background: var(--amber-soft);
}

.itinerary-panel {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(46, 67, 55, 0.06);
  overflow: hidden;
}

.itinerary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.itinerary-head h2 {
  margin: 0;
  font-size: 18px;
}

.itinerary-head span {
  color: var(--muted);
  font-size: 13px;
}

.itinerary-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.whole-route-map-link {
  min-height: 38px;
  padding: 0 12px;
  white-space: nowrap;
}

.itinerary-list {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.itinerary-item {
  min-height: 98px;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 10px;
  padding: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  text-align: left;
}

.itinerary-item:last-child {
  border-right: 0;
}

.itinerary-item:hover {
  background: var(--panel-soft);
}

.itinerary-open {
  width: 100%;
  min-height: 78px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-content: start;
  padding: 12px 12px 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.itinerary-day {
  grid-column: 1 / -1;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.itinerary-main {
  min-width: 0;
}

.itinerary-main strong,
.itinerary-main small {
  display: block;
}

.itinerary-main strong {
  font-size: 14px;
  line-height: 1.2;
}

.itinerary-main small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.map-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin: 0;
  border: 1px solid var(--blue);
  border-radius: 6px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.daily-map-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
  gap: 6px;
  margin: 0 12px 12px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(420px, 1.35fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.05;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(46, 67, 55, 0.06);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 9px;
  font-size: 27px;
  line-height: 1;
}

.metric.week-metric {
  grid-column: span 2;
}

.metric.week-metric strong {
  white-space: nowrap;
}

.workspace {
  display: grid;
  grid-template-columns: 430px minmax(0, 1fr);
  min-height: calc(100vh - 160px);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #fbfcfb;
  min-width: 0;
}

.filters {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

label span,
.search span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 11px;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.segmented {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
}

.segmented.active {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.select-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.list-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.venue-list {
  height: calc(100vh - 310px);
  min-height: 480px;
  overflow: auto;
}

.venue-card {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
}

.venue-card:hover,
.venue-card.active {
  background: var(--panel-soft);
}

.venue-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.venue-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.venue-meta {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pill.road {
  background: var(--blue-soft);
  color: var(--blue);
}

.pill.pub {
  background: var(--amber-soft);
  color: var(--amber);
}

.usage {
  min-width: 54px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 800;
}

.usage.full {
  background: var(--red-soft);
  color: var(--red);
}

.detail-panel {
  min-width: 0;
  padding: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f8faf8 100%);
}

.detail-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.detail-header h2 {
  margin: 7px 0 10px;
  font-size: 28px;
  line-height: 1.12;
}

.address {
  color: var(--muted);
  line-height: 1.45;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.action {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  font-weight: 700;
  text-decoration: none;
}

.action,
.machine button,
.segmented,
.venue-card,
.mobile-tab,
.back-button {
  -webkit-tap-highlight-color: transparent;
}

.action.primary {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.action:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
}

.section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.section.full-width {
  grid-column: 1 / -1;
}

.section h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.info-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.info-row {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr);
  gap: 10px;
  font-size: 14px;
}

.info-row dt {
  color: var(--muted);
}

.info-row dd {
  margin: 0;
}

.machines {
  display: grid;
  gap: 10px;
}

.machine {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.machine.recommended {
  border-color: #8bc9a9;
  background: var(--green-soft);
}

.machine.blocked {
  background: #f3f4f3;
  color: #7d857f;
}

.machine-id {
  font-weight: 800;
}

.machine-note {
  color: var(--muted);
  font-size: 13px;
}

.machine button {
  height: 34px;
  border: 1px solid var(--green);
  border-radius: 6px;
  background: #fff;
  color: var(--green);
  font-weight: 800;
}

.machine button:disabled {
  border-color: var(--line);
  color: var(--muted);
}

.history {
  display: grid;
  gap: 8px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.history-item:last-child {
  border-bottom: 0;
}

.empty {
  display: grid;
  min-height: 420px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 980px) {
  .topbar,
  .workspace {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .itinerary-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .itinerary-item {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .venue-list {
    height: auto;
    min-height: 0;
    max-height: 420px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .admin-users {
    grid-template-columns: 1fr;
  }

  .admin-user {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .admin-user:last-child {
    border-bottom: 0;
  }

  .circuit-row {
    grid-template-columns: 34px minmax(0, 1fr) 76px minmax(160px, 190px);
  }
}

@media (max-width: 760px) {
  body {
    background: #ffffff;
  }

  .app-shell {
    min-height: 100vh;
    padding: 0 0 76px;
  }

  .topbar {
    display: block;
    margin: 0;
    padding: 14px 14px 10px;
    border-bottom: 1px solid var(--line);
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 8;
  }

  .userbar {
    align-items: stretch;
    flex-direction: column;
    margin: 0;
    border: 0;
    border-radius: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px 14px;
  }

  .userbar-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .cycle-control select {
    width: 100%;
  }

  .registration-screen {
    padding: 0;
  }

  .registration-layout {
    grid-template-columns: 1fr;
  }

  .registration-card,
  .account-list-panel {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .admin-mode .topbar {
    position: static;
  }

  .admin-mode .summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-panel {
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .admin-head {
    align-items: flex-start;
    padding: 14px;
  }

  .admin-head h2 {
    font-size: 20px;
  }

  .admin-total strong {
    font-size: 24px;
  }

  .admin-total span {
    max-width: 120px;
  }

  .admin-user {
    padding: 14px;
  }

  .day-progress {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .circuit-overview-head {
    display: block;
    padding: 12px 14px;
  }

  .circuit-overview-head span {
    display: block;
    margin-top: 5px;
  }

  .circuit-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 9px 14px;
  }

  .circuit-count {
    text-align: right;
  }

  .circuit-status {
    grid-column: 2 / -1;
    text-align: left;
  }

  .assignment-select {
    grid-column: 2 / -1;
  }

  .userbar .action {
    min-height: 38px;
    padding: 0 10px;
  }

  .eyebrow {
    margin-bottom: 4px;
    font-size: 11px;
  }

  h1 {
    font-size: 22px;
  }

  .summary-grid {
    display: none;
    margin-top: 12px;
  }

  body.view-summary .summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.view-summary .workspace {
    display: none;
  }

  body.view-list .itinerary-panel,
  body.view-detail .itinerary-panel,
  body.view-summary .itinerary-panel {
    display: none;
  }

  body.view-itinerary .workspace,
  body.view-itinerary .summary-grid {
    display: none;
  }

  .itinerary-panel {
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .itinerary-head {
    display: block;
    padding: 14px;
  }

  .itinerary-head h2 {
    font-size: 20px;
  }

  .itinerary-head span {
    display: block;
    margin-top: 6px;
  }

  .itinerary-head-actions {
    align-items: stretch;
    justify-content: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .whole-route-map-link {
    width: 100%;
    margin-top: 0;
  }

  .itinerary-list {
    grid-template-columns: 1fr;
  }

  .itinerary-item {
    min-height: 78px;
    grid-template-rows: auto auto;
    border-bottom: 1px solid var(--line);
  }

  .itinerary-open {
    min-height: 72px;
    grid-template-columns: 70px minmax(0, 1fr) 48px;
    align-items: center;
    align-content: center;
    padding: 12px;
  }

  .itinerary-day {
    grid-column: auto;
    font-size: 12px;
  }

  .map-link {
    min-height: 40px;
  }

  .daily-map-links {
    margin: 0 12px 12px 94px;
  }

  .metric {
    min-height: 72px;
    padding: 12px;
    box-shadow: none;
  }

  .metric strong {
    font-size: 23px;
  }

  .workspace {
    display: block;
    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  body.view-list .detail-panel,
  body.view-detail .sidebar {
    display: none;
  }

  .sidebar {
    border: 0;
    background: #fff;
  }

  .filters {
    padding: 12px 14px;
    background: #fff;
    position: sticky;
    top: 65px;
    z-index: 7;
  }

  input,
  select {
    height: 46px;
    font-size: 16px;
  }

  .filter-row {
    gap: 6px;
  }

  .segmented {
    height: 44px;
    font-size: 14px;
  }

  .select-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .list-head {
    padding: 10px 14px;
    background: #f8faf8;
    font-size: 12px;
  }

  #weekLabel {
    display: none;
  }

  .venue-list {
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
  }

  .venue-card {
    min-height: 82px;
    padding: 14px;
    grid-template-columns: minmax(0, 1fr) 58px;
  }

  .venue-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .venue-title strong {
    white-space: normal;
    font-size: 16px;
    line-height: 1.2;
  }

  .venue-meta {
    font-size: 13px;
  }

  .usage {
    min-width: 50px;
    height: 38px;
    align-self: center;
  }

  .detail-panel {
    min-height: calc(100vh - 141px);
    padding: 14px;
    background: #fff;
  }

  .detail-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px;
    gap: 12px;
    padding-bottom: 14px;
  }

  .back-button {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    margin: 0 0 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--green);
    padding: 0 10px;
    font-weight: 800;
  }

  .detail-header h2 {
    margin: 8px 0;
    font-size: 23px;
  }

  .address {
    font-size: 14px;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .action {
    min-height: 44px;
    justify-content: center;
  }

  #resetVenue {
    grid-column: 1 / -1;
  }

  .detail-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 12px;
  }

  .section {
    padding: 14px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .info-row {
    grid-template-columns: 112px minmax(0, 1fr);
    font-size: 14px;
  }

  .machine {
    grid-template-columns: 58px minmax(0, 1fr) 92px;
    min-height: 62px;
    padding: 10px;
  }

  .machine button {
    height: 42px;
  }

  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 12;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -10px 30px rgba(46, 67, 55, 0.1);
  }

  .mobile-tab {
    min-height: 48px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
  }

  .mobile-tab.active {
    border-color: var(--green);
    background: var(--green-soft);
    color: var(--green);
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding-bottom: 76px;
  }

  .select-grid {
    grid-template-columns: 1fr 1fr;
  }

  .info-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .machine {
    grid-template-columns: 52px minmax(0, 1fr) 84px;
  }
}
