:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  background: #f4f6f5;
  color: #1e2a25;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

body.map-is-maximized {
  overflow: hidden;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.panel {
  width: min(760px, 100%);
  background: #ffffff;
  border: 1px solid #d8dfdc;
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 14px 45px rgba(30, 42, 37, 0.08);
}

.site-disclaimer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #d8dfdc;
  color: #53635d;
  font-size: 13px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: #2f7b5f;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 24px;
  font-size: 28px;
  line-height: 1.2;
}

.upload,
.auth,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.debug-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  color: #1e2a25;
  font-weight: 700;
}

.debug-toggle input {
  width: 16px;
  height: 16px;
}

input[type="file"],
input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"] {
  flex: 1 1 280px;
  min-height: 42px;
  border: 1px solid #cdd7d3;
  border-radius: 6px;
  padding: 0 12px;
  font: inherit;
}

input[type="file"] {
  padding-top: 8px;
  padding-bottom: 8px;
}

input[type="file"]::file-selector-button {
  margin: -2px 8px -2px 0;
  min-height: 26px;
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  background: #245f49;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: #1b4938;
}

.planner-panel,
.routes-panel {
  margin-bottom: 16px;
  border: 1px solid #d8dfdc;
  border-radius: 6px;
  overflow: hidden;
}

.planner-panel {
  position: relative;
  z-index: 10;
  padding: 14px;
  overflow: visible;
  background: #f8faf9;
}

.planner-header,
.planner-form {
  display: flex;
  align-items: center;
  gap: 12px;
}

.planner-header {
  justify-content: space-between;
  margin-bottom: 12px;
}

.planner-form {
  flex-wrap: wrap;
}

.planner-row {
  display: flex;
  flex: 1 1 100%;
  gap: 12px;
}

.planner-field {
  position: relative;
  display: block;
  flex: 1 1 210px;
}

.planner-field input,
.planner-form > input {
  flex: 1 1 210px;
  width: 100%;
}

.planner-header h2 {
  margin: 0;
  font-size: 16px;
}

.planner-form button {
  flex: 0 0 auto;
}

.planner-option-title {
  flex: 1 1 100%;
  color: #e7f2ed;
  font-size: 14px;
  font-weight: 800;
}

.planner-options {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.planner-options label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #2f4a3f;
  border-radius: 8px;
  background: #111a16;
  color: #e7f2ed;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.planner-options input {
  width: auto;
  accent-color: #1f6f54;
}

.planner-engine-options {
  margin-top: -4px;
}

.planner-engine-options span {
  color: #c9d7d1;
  font-size: 13px;
  font-weight: 700;
}

.planner-advanced {
  flex: 1 1 100%;
  border: 1px solid #2f4a3f;
  border-radius: 8px;
  padding: 10px;
  background: #111a16;
}

.planner-advanced summary {
  color: #e7f2ed;
  font-weight: 800;
  cursor: pointer;
}

.planner-advanced label {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  color: #e7f2ed;
  font-size: 13px;
  font-weight: 700;
}

.planner-advanced input[type="checkbox"] {
  width: auto;
  accent-color: #1f6f54;
}

.planner-via-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.planner-via-field {
  display: grid !important;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 0 !important;
}

.planner-via-field input {
  width: 100%;
}

.remove-via,
.secondary-button {
  min-height: 0;
  padding: 8px 10px;
}

@media (max-width: 700px) {
  .planner-row {
    flex-direction: column;
  }
}

.planner-suggestions {
  position: absolute;
  right: 0;
  left: 0;
  top: calc(100% + 4px);
  z-index: 100;
  overflow: hidden;
  border: 1px solid #2f4a3f;
  border-radius: 6px;
  background: #111a16;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
}

.planner-suggestions button {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 10px 12px;
  border-radius: 0;
  background: transparent;
  color: #e7f2ed;
  font-weight: 600;
  text-align: left;
}

.planner-suggestions button:hover {
  background: #245f49;
}

.routes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: #f8faf9;
  border-bottom: 1px solid #d8dfdc;
}

.routes-header h2 {
  margin: 0;
  font-size: 16px;
}

.routes-list {
  display: grid;
  gap: 1px;
  background: #d8dfdc;
}

.route-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: #ffffff;
}

.route-item.active {
  border-left: 4px solid #0b3d91;
}

.route-item strong,
.route-item span {
  display: block;
}

.route-item span,
.empty {
  color: #53635d;
  font-size: 13px;
}

.route-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.route-actions button,
.routes-header button {
  min-height: 34px;
  padding: 0 10px;
}

.empty {
  margin: 0;
  padding: 12px;
  background: #ffffff;
}

.route-stats {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid #d8dfdc;
  border-radius: 6px;
  background: #f8faf9;
}

.route-stats h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.route-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.route-stats-grid article {
  min-height: 76px;
  padding: 12px;
  border: 1px solid #d8dfdc;
  border-radius: 6px;
  background: #ffffff;
}

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

.route-stats-grid strong {
  color: #1e2a25;
  font-size: 18px;
  line-height: 1.2;
}

.route-stats-grid span {
  margin-top: 8px;
  color: #53635d;
  font-size: 13px;
}

.route-stats-grid .difficulty {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f3e3d7;
  color: #7c361f;
  font-size: 13px;
}

.route-stats-source {
  margin: 10px 0 0;
  color: #53635d;
  font-size: 12px;
}

.debug-panel {
  margin-bottom: 16px;
}

.debug-panel h2 {
  margin: 0 0 8px;
  font-size: 15px;
}

.debug-panel pre {
  min-height: 180px;
  margin: 0;
  padding: 16px;
  overflow: auto;
  border-radius: 6px;
  background: #111a16;
  color: #e7f2ed;
  white-space: pre-wrap;
}

.map-toolbar {
  margin-top: 16px;
  margin-bottom: 8px;
}

.map-toolbar button {
  min-height: 36px;
  padding: 0 12px;
}

.map-shell {
  position: relative;
}

.map-tools {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 1000;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
}

.map-tools button {
  min-width: 86px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(17, 26, 22, 0.88);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.map-tools button:hover,
.map-tools button.active {
  background: #0b3d91;
}

.map-options {
  position: relative;
}

.map-options-panel {
  position: absolute;
  left: calc(100% + 8px);
  bottom: 0;
  display: grid;
  gap: 10px;
  min-width: 170px;
  max-height: min(70vh, 440px);
  overflow-y: auto;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  background: rgba(17, 26, 22, 0.94);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  color: #ffffff;
}

.map-options-panel label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  cursor: pointer;
}

.map-options-panel input {
  width: 16px;
  height: 16px;
  accent-color: #4fd1b0;
}

.map-options-scope {
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.map-label-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  background: rgba(17, 26, 22, 0.88);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.map-label-toggle input {
  width: 16px;
  height: 16px;
  accent-color: #4fd1b0;
}

.map {
  height: 360px;
  border: 1px solid #2a3933;
  border-radius: 6px;
  overflow: hidden;
  background: #0b1511;
}

.map-shell.is-maximized {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #0b1511;
}

.map-shell.is-maximized .map {
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
}

.map-stats-overlay {
  display: none;
}

.map-shell.is-maximized .map-stats-overlay {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 10001;
  display: block;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(17, 26, 22, 0.94);
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.38);
  color: #ffffff;
}

.map-shell.is-maximized .map-stats-overlay.hidden {
  display: none;
}

.map-shell.is-maximized .map-tools {
  bottom: 126px;
}

.map-shell.is-maximized .map-label-toggle {
  display: flex;
}

.map-shell.is-maximized .map-stats-overlay .route-stats-grid {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
}

.map-shell.is-maximized .map-stats-overlay .route-stats-grid article {
  min-height: auto;
  padding: 0 12px;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  background: transparent;
}

.map-shell.is-maximized .map-stats-overlay .route-stats-grid article:first-child {
  border-left: 0;
}

.map-shell.is-maximized .map-stats-overlay .route-stats-grid strong {
  color: #ffffff;
  font-size: 18px;
}

.map-shell.is-maximized .map-stats-overlay .route-stats-grid span,
.map-shell.is-maximized .map-stats-overlay .route-stats-source {
  color: rgba(255, 255, 255, 0.72);
}

.map-close {
  position: fixed;
  top: 14px;
  left: 50%;
  z-index: 10001;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  transform: translateX(-50%);
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  background: rgba(17, 26, 22, 0.88);
  color: #ffffff;
  font-size: 28px;
  line-height: 1;
}

.map-close:hover {
  background: rgba(27, 73, 56, 0.95);
}

.poi-marker {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: rgba(17, 26, 22, 0.92);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  font-size: 16px;
}

.poi-popup {
  display: grid;
  gap: 4px;
  min-width: 190px;
  color: #1b1f1d;
}

.poi-popup strong {
  font-size: 15px;
}

.poi-popup span,
.poi-popup a {
  font-size: 13px;
  line-height: 1.35;
}

.day-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.day-selector button {
  min-height: 36px;
  background: #eef3f1;
  color: #173228;
  border: 1px solid #cdd7d3;
}

.day-selector button.active {
  background: #0b3d91;
  color: #ffffff;
  border-color: #0b3d91;
}

.hourly-panel {
  margin-top: 12px;
  border: 1px solid #d8dfdc;
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
}

.hourly-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #d8dfdc;
  background: #f8faf9;
}

.hourly-heading h2 {
  margin: 0;
  font-size: 16px;
}

.hourly-heading p {
  margin: 0;
  color: #53635d;
  font-size: 13px;
}

.hourly-table-wrap {
  overflow-x: auto;
}

.hourly-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.hourly-table th,
.hourly-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf1ef;
  text-align: left;
  white-space: nowrap;
}

.hourly-table th {
  color: #42524c;
  font-size: 12px;
  text-transform: uppercase;
}

.hourly-table img {
  width: 28px;
  height: 28px;
  vertical-align: middle;
}

.data-freshness {
  margin: 0;
  padding: 10px 12px;
  color: #53635d;
  font-size: 13px;
  border-top: 1px solid #edf1ef;
  background: #f8faf9;
}

.weather-marker {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid #0b3d91;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.weather-marker img {
  width: 30px;
  height: 30px;
}

.weather-popup h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.weather-popup hr {
  border: 0;
  border-top: 1px solid #d8dfdc;
  margin: 8px 0;
}

.hidden,
.debug-panel.hidden,
.map-close.hidden,
.map-stats-overlay.hidden,
.route-stats.hidden,
.day-selector.hidden,
.hourly-panel.hidden {
  display: none !important;
}

.session {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid #d8dfdc;
  border-radius: 6px;
  background: #f8faf9;
}

.session-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.session-actions button {
  min-height: 34px;
  padding: 0 12px;
}

.admin-panel,
.profile-panel {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid #d8dfdc;
  border-radius: 6px;
  background: #f8faf9;
}

.admin-panel h2,
.profile-header h2 {
  margin: 0;
  font-size: 16px;
}

.admin-panel p {
  margin: 8px 0 0;
  color: #53635d;
}

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

.profile-header button {
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 999px;
}

.profile-form,
.invite-form,
.invite-register {
  display: grid;
  gap: 14px;
}

.profile-form label,
.invite-form label {
  display: grid;
  gap: 6px;
  color: #1e2a25;
  font-weight: 700;
}

.invite-register h2,
.invite-register p {
  margin: 0;
}

.profile-form fieldset {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 10px 0;
  border: 0;
}

.profile-report-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}

.profile-report-toggle input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.profile-form legend {
  margin-bottom: 8px;
  font-weight: 700;
}

.profile-form fieldset label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 6px;
  font-weight: 700;
}

.profile-form fieldset label:hover {
  background: #eef3f1;
}

.profile-form input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: #245f49;
}
