:root {
  color-scheme: light;
  --bg: #FAF4EC;
  --card: #FFFFFF;
  --border: #EDE2D4;
  --ink: #3D3229;
  --text-2: #6B5F51;
  --muted: #8C7F70;
  --error: #C0392B;
  --accent: #3A7CA5;
  --accent-hover: #2E6383;
  --accent-tint: #E1EDF4;
  --accent-line: #BFD9E8;
  --shadow-card: 0 2px 10px rgba(60,40,20,0.06);
  --focus-ring: 0 0 0 3px rgba(58,124,165,0.18);
  --radius-card: 20px;
  --radius-pill: 999px;
  --radius-icon: 14px;
  --font: "Nunito", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  padding: 40px 20px;
}

header,
main {
  max-width: 680px;
  margin: 0 auto;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.app-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-icon);
  flex-shrink: 0;
}

.app-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}

.app-subtitle {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.section-title {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 800;
}

.map-card {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 22px;
  box-shadow: var(--shadow-card);
}

.add-section {
  margin-bottom: 24px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 8px;
}

.add-section .field-label {
  margin-top: 14px;
}

.add-section .field-label:first-of-type {
  margin-top: 0;
}

.map-input,
textarea,
select {
  width: 100%;
  font-family: var(--font);
  font-size: 16px;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.map-input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

.error-msg {
  color: var(--error);
  font-size: 13px;
  margin: 8px 0 0;
}

.btn-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.primary-btn,
.secondary-btn {
  font-family: var(--font);
  font-size: 15px;
  font-weight: 800;
  border-radius: var(--radius-pill);
  padding: 14px 18px;
  cursor: pointer;
  width: 100%;
}

.primary-btn {
  border: none;
  background: var(--accent);
  color: #fff;
}

.primary-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.secondary-btn {
  background: var(--card);
  color: var(--accent-hover);
  border: 1.5px solid var(--accent-line);
}

.secondary-btn:hover:not(:disabled) {
  background: var(--accent-tint);
}

.primary-btn:focus-visible,
.secondary-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.time-group {
  margin-bottom: 22px;
}

.time-group:last-child {
  margin-bottom: 0;
}

.route-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.route-card {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
}

.route-text {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.route-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.route-actions button {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  background: var(--card);
  border: 1.5px solid var(--border);
  color: var(--text-2);
}

.route-actions .edit-btn:hover {
  border-color: var(--accent-line);
  color: var(--accent-hover);
  background: var(--accent-tint);
}

.route-actions .delete-btn:hover {
  border-color: var(--error);
  color: var(--error);
  background: rgba(192, 57, 43, 0.08);
}

.route-edit-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.route-edit-form textarea {
  font-size: 14px;
}

.route-edit-actions {
  display: flex;
  gap: 8px;
}

.route-edit-actions button {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 800;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.route-edit-actions .save-btn {
  border: none;
  background: var(--accent);
  color: #fff;
}

.route-edit-actions .save-btn:hover {
  background: var(--accent-hover);
}

.route-edit-actions .cancel-btn {
  background: var(--card);
  border: 1.5px solid var(--border);
  color: var(--text-2);
}

.empty-state {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 30px 16px;
}

.empty-illustration {
  width: 64px;
  height: 64px;
  margin-bottom: 10px;
}

.empty-state p {
  margin: 0;
}
