:root {
  color-scheme: light;
  --bg: #f7f8f6;
  --surface: #ffffff;
  --surface-soft: #f0f5f0;
  --text: #15231e;
  --muted: #65736d;
  --border: #dce4df;
  --accent: #128c5d;
  --accent-strong: #075e45;
  --accent-soft: #dff5e9;
  --warning: #c77a14;
  --warning-soft: #fff1d8;
  --shadow: 0 20px 50px rgba(27, 46, 39, 0.1);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(223, 245, 233, 0.85), rgba(247, 248, 246, 0) 330px),
    var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.pwa-update-button {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  min-height: 32px;
  max-width: min(132px, calc(100vw - 20px));
  padding: 0 11px;
  border: 1px solid rgba(7, 94, 69, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--accent-strong);
  box-shadow: 0 10px 26px rgba(27, 46, 39, 0.12);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.pwa-update-button.has-update,
.pwa-update-button.is-checking {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #ffffff;
}

.pwa-update-button:active {
  transform: translateX(-50%) translateY(1px);
}

.app-shell {
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 44px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 8px 0 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark,
.panel-icon {
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid rgba(18, 140, 93, 0.2);
  border-radius: var(--radius);
}

.brand-mark {
  width: 44px;
  height: 44px;
}

.brand-mark svg,
.panel-icon svg,
.button svg,
.link-box svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand strong {
  display: block;
  font-size: 17px;
  letter-spacing: 0;
}

.brand small,
.phone-top small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topnav a {
  padding: 9px 12px;
  border-radius: var(--radius);
  color: #405047;
  font-size: 14px;
}

.topnav a:hover {
  background: rgba(255, 255, 255, 0.72);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: end;
  margin-bottom: 14px;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(30px, 3.1vw, 40px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero p {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.mode-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 16px;
  background: var(--warning-soft);
  border: 1px solid rgba(199, 122, 20, 0.2);
  border-radius: var(--radius);
  color: #67400d;
  font-size: 14px;
  line-height: 1.45;
}

.dot {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--warning);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(340px, 1fr) minmax(300px, 0.8fr);
  gap: 16px;
  align-items: stretch;
}

.panel,
.phone-panel,
.operator-strip,
.steps article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel {
  padding: 22px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.panel-heading h2,
.operator-strip h2,
.steps h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}

.panel-heading p,
.operator-strip p,
.steps p,
.fine-print {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.panel-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
}

label {
  display: block;
  margin-top: 14px;
}

label span,
.label {
  display: block;
  margin-bottom: 7px;
  color: #5b6963;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  outline: none;
}

input,
select {
  height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 84px;
  resize: vertical;
  padding: 12px;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(18, 140, 93, 0.65);
  box-shadow: 0 0 0 3px rgba(18, 140, 93, 0.12);
}

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

.button-row {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.button,
.link-box button,
.phone-input button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0;
}

.button {
  padding: 0 16px;
}

.button.primary {
  color: #fff;
  background: var(--text);
}

.button.ghost {
  color: var(--text);
  background: var(--surface-soft);
}

.button.whatsapp {
  width: 100%;
  margin-top: 14px;
  color: #fff;
  background: var(--accent);
}

.button:hover,
.link-box button:hover,
.phone-input button:hover {
  transform: translateY(-1px);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius);
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 800;
}

.request-card {
  padding: 18px;
  background: #14231d;
  border-radius: var(--radius);
  color: #fff;
}

.request-card .label {
  color: rgba(255, 255, 255, 0.62);
}

.request-card strong {
  display: block;
  font-size: 40px;
  line-height: 1;
}

.request-card p {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.4;
}

.message-preview {
  margin-top: 14px;
  padding: 14px;
  background: #f8faf8;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

pre {
  max-height: 172px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  color: #26332d;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
}

.link-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
}

.link-box span {
  min-height: 44px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 13px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.link-box button {
  width: 44px;
  color: var(--text);
  background: var(--surface-soft);
}

.phone-panel {
  padding: 14px;
  background: #dce8e1;
}

.phone {
  display: flex;
  min-height: 100%;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid rgba(21, 35, 30, 0.16);
  border-radius: 18px;
  background: #f6efe6;
}

.phone-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  background: #fff;
  border-bottom: 1px solid #e6e1d9;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(7, 94, 69, 0.9), rgba(18, 140, 93, 0.66)),
    url("data:image/svg+xml,%3Csvg width='72' height='72' viewBox='0 0 72 72' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 45c8-17 21-25 39-25 3 0 5 2 5 5v16c0 4-3 7-7 7H18c-5 0-8 1-6-3Z' fill='white' fill-opacity='.72'/%3E%3Cpath d='M23 40h25' stroke='%23075e45' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-size: cover;
}

.chat-window {
  display: flex;
  min-height: 420px;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 18px 14px;
  background:
    linear-gradient(rgba(246, 239, 230, 0.88), rgba(246, 239, 230, 0.88)),
    radial-gradient(circle at 10px 10px, rgba(21, 35, 30, 0.08) 2px, transparent 2px);
  background-size: auto, 22px 22px;
}

.bubble {
  max-width: 88%;
  padding: 12px 13px;
  border-radius: 12px;
  color: #1d2c26;
  font-size: 14px;
  line-height: 1.42;
  white-space: pre-wrap;
}

.bubble.inbound {
  align-self: flex-start;
  background: #fff;
  border-top-left-radius: 3px;
}

.bubble.outbound {
  align-self: flex-end;
  background: #dcf8c6;
  border-top-right-radius: 3px;
}

.bubble.operator {
  align-self: flex-start;
  background: #fff7df;
  border-top-left-radius: 3px;
}

.phone-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  background: #fff;
}

.phone-input span {
  min-height: 40px;
  padding: 11px 12px;
  border-radius: 999px;
  background: #f1f3f2;
  color: var(--muted);
  font-size: 13px;
}

.phone-input button {
  min-height: 40px;
  padding: 0 12px;
  color: #fff;
  background: var(--accent-strong);
  font-size: 13px;
}

.operator-strip {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 18px;
  margin-top: 16px;
  padding: 20px;
}

.operator-table {
  display: grid;
  gap: 8px;
}

.request-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 130px 110px;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fafcfa;
  font-size: 14px;
}

.request-row strong {
  font-size: 15px;
}

.request-row span {
  color: var(--muted);
}

.request-row button {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.request-row.done {
  opacity: 0.62;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.steps article {
  padding: 18px;
  box-shadow: none;
}

.steps article span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  margin-bottom: 18px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--accent-strong);
  font-weight: 900;
}

.queue-page {
  background:
    linear-gradient(180deg, rgba(223, 245, 233, 0.95), rgba(247, 248, 246, 0) 360px),
    var(--bg);
}

.queue-shell {
  width: min(980px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 42px;
}

.queue-topbar,
.queue-hero,
.queue-grid,
.queue-actions {
  display: grid;
  gap: 16px;
}

.queue-topbar {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  margin-bottom: 26px;
}

.queue-source-link {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.74);
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 800;
}

.queue-hero {
  grid-template-columns: minmax(0, 1fr) 260px;
  align-items: end;
  margin-bottom: 16px;
}

.queue-kicker {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 900;
}

.queue-hero h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(34px, 5.3vw, 58px);
  line-height: 0.98;
  letter-spacing: 0;
}

.queue-hero p {
  max-width: 690px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.queue-status-card,
.queue-card,
.queue-actions,
.queue-note {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.queue-status-card {
  padding: 20px;
}

.queue-status-card span,
.queue-message span,
.queue-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.queue-status-card strong {
  display: block;
  margin-top: 12px;
  font-size: 30px;
  line-height: 1.05;
}

.queue-status-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}

.queue-grid {
  grid-template-columns: 1.1fr 1fr 1fr;
  margin-bottom: 16px;
}

.queue-card {
  min-height: 190px;
  padding: 20px;
}

.queue-card-primary {
  background: #14231d;
  color: #fff;
}

.queue-card-primary span,
.queue-card-primary p {
  color: rgba(255, 255, 255, 0.7);
}

.queue-card strong {
  display: block;
  margin-top: 18px;
  font-size: 64px;
  line-height: 0.9;
}

.queue-card p {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.queue-actions {
  grid-template-columns: minmax(0, 1fr) 250px;
  padding: 18px;
}

.queue-message {
  min-width: 0;
}

.queue-message pre {
  max-height: 260px;
  margin-top: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8faf8;
}

.queue-buttons {
  display: grid;
  align-content: start;
  gap: 10px;
}

.queue-buttons .button {
  width: 100%;
}

.queue-note {
  margin-top: 16px;
  padding: 16px;
  box-shadow: none;
}

.queue-note strong {
  display: block;
  color: var(--warning);
}

.queue-note p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.border-page {
  background:
    linear-gradient(180deg, rgba(223, 245, 233, 0.92), rgba(247, 248, 246, 0) 360px),
    var(--bg);
}

.border-shell {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 42px;
}

.border-compact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.border-compact-header h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: 0;
}

.border-card,
.crossing-detail,
.direction-panel,
.border-empty {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.border-detail-label,
.border-card-country,
.border-card-checked,
.border-facts dt,
.direction-panel span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.border-updated {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  text-align: right;
}

.border-updated strong {
  color: var(--text);
}

.weather-link,
.prayer-link {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid rgba(21, 35, 30, 0.2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.76);
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.weather-link.is-loaded,
.prayer-link.is-loaded {
  background: #fff;
}

.weather-icon-slot,
.prayer-icon-slot {
  display: inline-grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--accent-strong);
}

.weather-icon-slot svg,
.prayer-icon-slot svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.weather-temp,
.prayer-widget-text {
  min-width: 0;
  white-space: nowrap;
}

.weather-link.is-loaded .weather-temp {
  min-width: 28px;
  font-size: 14px;
}

.prayer-link.is-loaded .prayer-widget-text {
  font-size: 14px;
}

.weather-sun {
  color: #d98200;
}

.weather-partly {
  color: #b97912;
}

.weather-cloud,
.weather-fog {
  color: #5f6f76;
}

.weather-rain {
  color: #1677a5;
}

.weather-snow {
  color: #3f85b5;
}

.weather-storm {
  color: #6d55a8;
}

.weather-link:hover {
  border-color: rgba(21, 35, 30, 0.5);
  transform: translateY(-1px);
}

.border-toolbar {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-bottom: 12px;
}

.border-filter {
  flex: 1 1 0;
  min-width: 0;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  color: #405047;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.border-filter.is-active {
  border-color: rgba(7, 94, 69, 0.34);
  background: var(--text);
  color: #fff;
}

.home-location-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 2px solid rgba(21, 35, 30, 0.42);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 10px 30px rgba(27, 46, 39, 0.08);
}

.home-location-panel.is-ready {
  border-color: rgba(7, 94, 69, 0.34);
  background: rgba(230, 244, 236, 0.9);
}

.home-location-panel.is-error {
  border-color: rgba(199, 122, 20, 0.38);
  background: rgba(255, 241, 216, 0.9);
}

.home-location-copy {
  min-width: 0;
}

.home-location-copy span {
  display: block;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.home-location-copy strong {
  display: block;
  margin-top: 3px;
  font-size: 17px;
  line-height: 1.15;
}

.home-location-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.home-location-button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(7, 94, 69, 0.26);
  border-radius: var(--radius);
  background: #14231d;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.home-location-panel.is-ready .home-location-button {
  background: #fff;
  color: var(--accent-strong);
}

.home-location-panel.is-error .home-location-button {
  background: #67400d;
}

.home-location-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.border-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.border-card {
  border: 2px solid rgba(21, 35, 30, 0.48);
  display: grid;
  min-height: 184px;
  gap: 12px;
  padding: 18px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}

.border-card:hover {
  border-color: rgba(21, 35, 30, 0.76);
  transform: translateY(-1px);
}

.border-card-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.border-card-checked {
  flex: 0 0 auto;
  color: #405047;
  font-size: 12px;
}

.border-card-section {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.border-card-meta + .border-card-section {
  padding-top: 0;
  border-top: 0;
}

.border-card-section strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
  line-height: 1.15;
}

.border-card-section b,
.direction-panel strong {
  justify-self: start;
  padding: 6px 9px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 13px;
}

.border-card-section b.is-muted,
.direction-panel strong.is-muted {
  background: #edf1ee;
  color: #6b7771;
}

.border-card-community {
  display: block;
  padding: 10px 11px;
  border: 1px solid rgba(7, 94, 69, 0.16);
  border-radius: var(--radius);
  background: rgba(230, 244, 236, 0.72);
  color: #365248;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.crossing-shell {
  width: min(760px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 42px;
}

.crossing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.detail-back {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  font-weight: 800;
}

.crossing-detail {
  padding: 20px;
}

.crossing-detail h1 {
  margin: 8px 0 0;
  font-size: clamp(32px, 7vw, 48px);
  line-height: 1.02;
}

.crossing-detail p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.direction-panels {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.direction-panel {
  display: grid;
  gap: 9px;
  padding: 16px;
  box-shadow: none;
}

.direction-panel h2 {
  margin: 0;
  font-size: 27px;
  line-height: 1.08;
}

.community-panel {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid rgba(7, 94, 69, 0.2);
  border-radius: var(--radius);
  background: rgba(230, 244, 236, 0.78);
}

.community-panel[hidden] {
  display: none;
}

.community-panel span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.community-panel strong {
  color: var(--text);
  font-size: 18px;
}

.community-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.border-warning {
  padding: 12px;
  border-radius: var(--radius);
  background: var(--warning-soft);
  color: #67400d !important;
  font-size: 14px;
}

.border-empty {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  padding: 18px;
}

.border-empty span {
  color: var(--muted);
}

.home-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.nearby-entry,
.trip-entry {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 2px solid rgba(21, 35, 30, 0.52);
  border-radius: var(--radius);
}

.nearby-entry {
  background: #14231d;
  color: #fff;
}

.trip-entry {
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
}

.nearby-entry:hover,
.trip-entry:hover {
  border-color: rgba(21, 35, 30, 0.78);
  transform: translateY(-1px);
}

.nearby-entry span,
.trip-entry span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.nearby-entry span {
  color: rgba(255, 255, 255, 0.72);
}

.trip-entry span {
  color: var(--muted);
}

.nearby-entry strong,
.trip-entry strong {
  flex: 0 0 auto;
  font-size: 15px;
  line-height: 1.15;
}

.nearby-page {
  background:
    linear-gradient(180deg, rgba(223, 245, 233, 0.9), rgba(247, 248, 246, 0) 360px),
    var(--bg);
}

.nearby-shell {
  width: min(1040px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 42px;
}

.nearby-topbar,
.nearby-hero,
.nearby-layout {
  display: grid;
  gap: 14px;
}

.nearby-topbar {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  margin-bottom: 14px;
}

.nearby-hero {
  grid-template-columns: minmax(0, 1fr) 330px;
  align-items: end;
  margin-bottom: 14px;
}

.nearby-kicker {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 900;
}

.nearby-hero h1 {
  margin: 0;
  font-size: clamp(40px, 7vw, 72px);
  line-height: 0.96;
  letter-spacing: 0;
}

.nearby-hero p {
  max-width: 620px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.nearby-card,
.nearby-locator,
.nearby-action {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.nearby-locator {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.nearby-locator span,
.nearby-card-heading span,
.nearby-facts dt,
.nearby-action span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.nearby-locator strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 20px;
}

.nearby-locator p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.nearby-primary-button,
.nearby-secondary-button,
.nearby-primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #14231d;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 900;
}

.nearby-primary-button,
.nearby-primary-link {
  background: #14231d;
  color: #fff;
}

.nearby-primary-button:disabled {
  opacity: 0.68;
  cursor: wait;
}

.nearby-secondary-button {
  width: 100%;
  margin-top: 12px;
  background: #f4f7f5;
  color: #405047;
}

.nearby-primary-link.is-disabled,
.nearby-action.is-disabled,
#openCurrentMap.is-disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

.nearby-layout {
  grid-template-columns: minmax(300px, 0.78fr) minmax(320px, 1fr);
  align-items: start;
}

.nearby-layout-single {
  grid-template-columns: minmax(0, 1fr);
}

.nearby-card {
  padding: 18px;
}

.nearby-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.nearby-card-heading a,
.nearby-card-heading small {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 900;
}

.nearby-facts {
  display: grid;
  gap: 10px;
  margin: 0;
}

.nearby-facts div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8faf8;
}

.nearby-facts dd {
  min-width: 0;
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  font-weight: 900;
}

.nearby-form {
  margin-top: 14px;
}

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

.nearby-stack {
  display: grid;
  gap: 14px;
}

.nearby-weather-card,
.nearby-prayer-card {
  min-height: 154px;
}

.nearby-weather-card strong,
.nearby-prayer-card strong {
  display: block;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.05;
}

.nearby-weather-card p,
.nearby-prayer-card p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.nearby-actions {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.nearby-action {
  display: grid;
  min-height: 108px;
  align-content: space-between;
  gap: 10px;
  padding: 14px;
  border: 2px solid rgba(21, 35, 30, 0.38);
  box-shadow: none;
}

.nearby-action:hover {
  border-color: rgba(21, 35, 30, 0.72);
  transform: translateY(-1px);
}

.nearby-action strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
  line-height: 1.1;
}

.nearby-note {
  margin: 14px 0 0;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--warning-soft);
  color: #67400d;
  font-size: 14px;
  line-height: 1.5;
}

.widget-page {
  min-height: 100vh;
}

.widget-shell {
  min-height: 100vh;
  padding-bottom: 32px;
}

.widget-hero {
  display: grid;
  gap: 12px;
  min-height: 42vh;
  align-content: center;
  margin-bottom: 14px;
  padding: clamp(22px, 6vw, 54px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.weather-detail-hero {
  background:
    linear-gradient(135deg, rgba(255, 247, 208, 0.88), rgba(224, 242, 241, 0.68)),
    var(--surface);
}

.prayer-detail-hero {
  background:
    linear-gradient(135deg, rgba(223, 245, 233, 0.9), rgba(230, 236, 255, 0.7)),
    var(--surface);
}

.widget-hero h1 {
  margin: 0;
  font-size: clamp(56px, 14vw, 136px);
  line-height: 0.92;
  letter-spacing: 0;
}

.widget-hero p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.45;
}

.widget-status {
  min-height: 24px;
  font-weight: 800;
}

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

.widget-metric,
.widget-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.widget-metric {
  display: grid;
  gap: 10px;
  min-height: 118px;
  align-content: space-between;
  padding: 16px;
}

.widget-metric span,
.widget-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.widget-metric strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: clamp(22px, 4vw, 34px);
  line-height: 1.05;
}

.widget-panel {
  padding: 18px;
}

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

.widget-list div {
  display: grid;
  grid-template-columns: minmax(120px, 0.48fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.widget-list div:last-child {
  border-bottom: 0;
}

.widget-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  text-align: right;
  font-size: 21px;
  font-weight: 900;
}

.trip-page {
  background:
    linear-gradient(180deg, rgba(223, 245, 233, 0.9), rgba(247, 248, 246, 0) 380px),
    var(--bg);
}

.trip-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 42px;
}

.trip-topbar,
.trip-hero,
.trip-layout {
  display: grid;
  gap: 14px;
}

.trip-topbar {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  margin-bottom: 14px;
}

.trip-top-actions {
  display: flex;
  gap: 8px;
}

.trip-small-button,
.trip-text-button,
.trip-primary-button {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 900;
}

.trip-small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  font-size: 13px;
}

.trip-text-button {
  min-height: 32px;
  padding: 0 10px;
  background: #f4f7f5;
  color: #405047;
  font-size: 12px;
}

.trip-primary-button {
  width: 100%;
  min-height: 46px;
  margin-top: 14px;
  border-color: #14231d;
  background: #14231d;
  color: #fff;
}

.trip-hero {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
  align-items: end;
  margin-bottom: 14px;
}

.trip-hero h1 {
  margin: 0;
  font-size: clamp(38px, 7vw, 68px);
  line-height: 0.96;
  letter-spacing: 0;
}

.trip-hero p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.trip-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.trip-hero-stats article,
.trip-card,
.trip-log-item,
.trip-empty {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.trip-hero-stats article {
  min-width: 0;
  padding: 14px;
}

.trip-hero-stats span,
.trip-card-heading span,
.trip-summary-list dt,
.trip-export-box span,
.trip-log-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.trip-hero-stats strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  margin-top: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 21px;
  line-height: 1.05;
}

.trip-mileage-card {
  margin-bottom: 14px;
  box-shadow: none;
}

.trip-mileage-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.42fr);
  gap: 10px;
  align-items: end;
}

.trip-mileage-form label {
  margin-top: 0;
}

.trip-mileage-form .trip-primary-button {
  margin-top: 0;
}

.trip-mileage-help {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.trip-layout {
  grid-template-columns: minmax(260px, 0.75fr) minmax(360px, 1fr) minmax(280px, 0.8fr);
  align-items: start;
}

.trip-card {
  padding: 18px;
}

.trip-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.trip-card-heading strong {
  font-size: 15px;
}

.trip-form label {
  margin-top: 12px;
}

.trip-grid-2,
.trip-grid-3 {
  display: grid;
  gap: 10px;
}

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

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

.trip-setup-card .trip-grid-2 {
  grid-template-columns: 1fr;
}

.trip-segmented {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 14px;
}

.trip-segmented button {
  min-width: 0;
  min-height: 38px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8faf8;
  color: #405047;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.trip-segmented button.is-active {
  border-color: #14231d;
  background: #14231d;
  color: #fff;
}

.event-fields {
  display: none;
}

.event-fields.is-active {
  display: block;
}

.trip-check {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8faf8;
}

.trip-check input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.trip-check span {
  margin: 0;
  color: #405047;
  font-size: 13px;
  font-weight: 800;
}

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

.trip-summary-list div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8faf8;
}

.trip-summary-list dd {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.15;
}

.trip-export-box {
  margin-top: 12px;
}

.trip-export-box pre {
  max-height: 220px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8faf8;
}

.trip-status {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.trip-log-section {
  margin-top: 14px;
  box-shadow: none;
}

.trip-log {
  display: grid;
  gap: 10px;
}

.trip-log-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 14px;
  box-shadow: none;
}

.trip-log-item strong {
  display: block;
  margin-top: 5px;
  font-size: 17px;
}

.trip-log-item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.trip-log-item button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(199, 122, 20, 0.24);
  border-radius: var(--radius);
  background: var(--warning-soft);
  color: #67400d;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.trip-empty {
  display: grid;
  gap: 5px;
  padding: 18px;
  box-shadow: none;
}

.trip-empty span {
  color: var(--muted);
}

@media (max-width: 1120px) {
  .hero,
  .workspace,
  .operator-strip,
  .nearby-layout,
  .nearby-hero,
  .trip-layout,
  .trip-hero {
    grid-template-columns: 1fr;
  }

  .phone {
    min-height: 540px;
  }
}

@media (max-width: 860px) {
  .queue-topbar,
  .queue-hero,
  .queue-grid,
  .queue-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 1380px);
    padding-top: 12px;
  }

  .topbar,
  .topnav,
  .button-row,
  .trip-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .trip-topbar {
    display: flex;
  }

  .trip-top-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .topnav a {
    text-align: center;
  }

  .hero h1 {
    font-size: 36px;
  }

  .hero p {
    font-size: 16px;
  }

  .grid-2,
  .steps,
  .request-row {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 16px;
  }

  .request-card strong {
    font-size: 34px;
  }

  .queue-shell {
    width: min(100% - 20px, 980px);
    padding-top: 12px;
  }

  .queue-topbar {
    align-items: stretch;
  }

  .queue-source-link {
    text-align: center;
  }

  .queue-hero h1 {
    font-size: 40px;
  }

  .queue-card {
    min-height: 150px;
  }

  .border-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 12px;
  }

  .border-compact-header h1 {
    font-size: 22px;
  }

  .border-updated {
    font-size: 12px;
  }

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

  .home-actions,
  .nearby-actions,
  .nearby-grid-2,
  .widget-grid {
    grid-template-columns: 1fr;
  }

  .home-location-panel {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .home-location-button {
    width: 100%;
  }

  .nearby-shell {
    width: min(100% - 20px, 1040px);
    padding-top: 12px;
  }

  .nearby-topbar {
    grid-template-columns: 1fr;
  }

  .nearby-hero h1 {
    font-size: 46px;
  }

  .nearby-action {
    min-height: 84px;
  }

  .widget-hero {
    min-height: 38vh;
    padding: 22px;
  }

  .widget-hero h1 {
    font-size: clamp(48px, 18vw, 76px);
  }

  .widget-list div {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .widget-list dd {
    text-align: left;
  }

  .trip-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 12px;
  }

  .trip-hero h1 {
    font-size: 44px;
  }

  .trip-hero-stats,
  .trip-mileage-form,
  .trip-grid-2,
  .trip-grid-3 {
    grid-template-columns: 1fr;
  }

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

  .trip-card {
    padding: 15px;
  }

  .trip-log-item {
    grid-template-columns: 1fr;
  }

  .border-card {
    min-height: 160px;
  }

  .direction-panel h2 {
    font-size: 23px;
  }

  .crossing-shell {
    width: min(100% - 20px, 760px);
    padding-top: 12px;
  }
}
