/* ============================================================
   AZO Tagesplaner — v1.25.0
   ============================================================ */

:root {
  --azo-tp-green: #2D5A3D;
  --azo-tp-green-dark: #1F4430;
  --azo-tp-beige: #FAF8F4;
  --azo-tp-white: #FFFFFF;
  --azo-tp-text: #1A1915;
  --azo-tp-muted: #6B6B63;
  --azo-tp-border: rgba(0, 0, 0, 0.08);
  --azo-tp-gold: #FFC700;
  --azo-tp-warn: #D97706;
  --azo-tp-error: #9B2C2C;
}

/* Hidden-Attribut respektieren */
.azo-tp-stops-empty[hidden],
.azo-tp-search[hidden],
.azo-tp-start-address[hidden],
.azo-tp-result-empty[hidden],
.azo-tp-result-loading[hidden],
.azo-tp-result-error[hidden],
.azo-tp-result-ok[hidden] {
  display: none !important;
}

/* ============================================================
   Page-Layout
   ============================================================ */

.azo-tp-page {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.azo-tp-hero {
  padding: 48px 0 24px;
}

.azo-tp-hero-inner {
  max-width: 720px;
}

.azo-tp-eyebrow {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--azo-tp-beige);
  color: var(--azo-tp-green-dark);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}

.azo-tp-title {
  font-family: 'Cabinet Grotesk', 'DM Sans', sans-serif;
  font-weight: 800;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--azo-tp-text);
  margin: 0 0 12px;
}

.azo-tp-title em {
  font-family: 'Instrument Serif', 'Playfair Display', serif;
  font-style: italic;
  font-weight: 400;
  color: var(--azo-tp-green);
}

.azo-tp-lead {
  font-size: 17px;
  color: var(--azo-tp-muted);
  margin: 0;
  max-width: 560px;
}

.azo-tp-layout {
  display: grid;
  grid-template-columns: minmax(340px, 420px) 1fr;
  gap: 32px;
  margin-top: 16px;
  align-items: start;
}

@media (max-width: 960px) {
  .azo-tp-layout {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Konfig-Spalte (links)
   ============================================================ */

.azo-tp-config {
  background: var(--azo-tp-white);
  border: 1px solid var(--azo-tp-border);
  border-radius: 20px;
  padding: 28px;
  position: sticky;
  top: 24px;
}

@media (max-width: 960px) {
  .azo-tp-config {
    position: static;
  }
}

.azo-tp-section {
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--azo-tp-border);
}

.azo-tp-section:last-of-type {
  border-bottom: 0;
  margin-bottom: 20px;
}

.azo-tp-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.azo-tp-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Cabinet Grotesk', 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 17px;
  margin: 0;
  color: var(--azo-tp-text);
}

.azo-tp-section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--azo-tp-green);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.azo-tp-section-hint {
  font-size: 13px;
  color: var(--azo-tp-muted);
}

/* Stops-Liste */
.azo-tp-stops-empty {
  background: var(--azo-tp-beige);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  font-size: 14px;
  color: var(--azo-tp-muted);
}

.azo-tp-stops-empty p {
  margin: 0 0 12px;
}

.azo-tp-stops-empty-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.azo-tp-stops {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.azo-tp-stop {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--azo-tp-border);
  border-radius: 12px;
}

.azo-tp-stop-num {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--azo-tp-green);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.azo-tp-stop-body {
  min-width: 0;
}

.azo-tp-stop-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--azo-tp-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.azo-tp-stop-meta {
  font-size: 12px;
  color: var(--azo-tp-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.azo-tp-stop-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.azo-tp-stop-btn {
  appearance: none;
  border: 0;
  background: transparent;
  width: 24px;
  height: 20px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 11px;
  color: var(--azo-tp-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.azo-tp-stop-btn:hover {
  background: var(--azo-tp-beige);
  color: var(--azo-tp-green);
}

.azo-tp-stop-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.azo-tp-stop-btn--remove {
  color: var(--azo-tp-error);
  font-size: 14px;
  width: 24px;
  height: 24px;
  margin-top: 2px;
}

.azo-tp-stop-stay {
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid var(--azo-tp-border);
  border-radius: 8px;
  background: #fff;
  grid-column: 2 / -1;
  margin-top: 4px;
  justify-self: start;
  color: var(--azo-tp-muted);
}

.azo-tp-stop-stay select {
  appearance: none;
  border: 0;
  background: transparent;
  font-size: inherit;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  padding-right: 14px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><path d='M2 4l3 3 3-3' stroke='%236B6B63' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right center;
}

/* Add-Button */
.azo-tp-add-btn {
  appearance: none;
  border: 2px dashed var(--azo-tp-border);
  background: transparent;
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--azo-tp-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.azo-tp-add-btn:hover {
  border-color: var(--azo-tp-green);
  color: var(--azo-tp-green);
}

.azo-tp-add-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--azo-tp-green);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
}

.azo-tp-add-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Suche */
.azo-tp-search {
  margin-top: 10px;
  padding: 12px;
  background: var(--azo-tp-beige);
  border-radius: 12px;
}

.azo-tp-search-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--azo-tp-border);
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  box-sizing: border-box;
}

.azo-tp-search-input:focus {
  outline: 2px solid var(--azo-tp-green);
  outline-offset: 1px;
  border-color: transparent;
}

.azo-tp-search-results {
  margin-top: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.azo-tp-search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.azo-tp-search-result:hover {
  background: #fff;
}

.azo-tp-search-result__img {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #ddd;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.azo-tp-search-result__body {
  min-width: 0;
  flex: 1;
}

.azo-tp-search-result__title {
  font-weight: 600;
  font-size: 14px;
  color: var(--azo-tp-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.azo-tp-search-result__meta {
  font-size: 12px;
  color: var(--azo-tp-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.azo-tp-search-result--disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.azo-tp-search-hint {
  padding: 10px;
  font-size: 13px;
  color: var(--azo-tp-muted);
  text-align: center;
}

/* Startpunkt */
.azo-tp-start-modes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.azo-tp-start-opt {
  cursor: pointer;
}

.azo-tp-start-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.azo-tp-start-opt-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--azo-tp-border);
  border-radius: 12px;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.azo-tp-start-opt:hover .azo-tp-start-opt-inner {
  border-color: var(--azo-tp-green);
}

.azo-tp-start-opt input:checked + .azo-tp-start-opt-inner {
  border-color: var(--azo-tp-green);
  background: rgba(45, 90, 61, 0.04);
}

.azo-tp-start-opt-ico {
  font-size: 22px;
  flex-shrink: 0;
}

.azo-tp-start-opt-inner strong {
  display: block;
  font-size: 14px;
  color: var(--azo-tp-text);
}

.azo-tp-start-opt-inner small {
  display: block;
  font-size: 12px;
  color: var(--azo-tp-muted);
  margin-top: 2px;
}

.azo-tp-start-address {
  margin-top: 10px;
}

/* Datum/Zeit */
.azo-tp-datetime {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.azo-tp-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--azo-tp-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.azo-tp-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--azo-tp-border);
  border-radius: 10px;
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  color: var(--azo-tp-text);
  box-sizing: border-box;
}

.azo-tp-input:focus {
  outline: 2px solid var(--azo-tp-green);
  outline-offset: 1px;
  border-color: transparent;
}

/* CTA */
.azo-tp-cta {
  appearance: none;
  border: 0;
  width: 100%;
  padding: 16px 20px;
  background: var(--azo-tp-green);
  color: #fff;
  border-radius: 12px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.18s ease, transform 0.1s ease;
}

.azo-tp-cta:hover:not(:disabled) {
  background: var(--azo-tp-green-dark);
}

.azo-tp-cta:active:not(:disabled) {
  transform: scale(0.99);
}

.azo-tp-cta:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.azo-tp-cta-icon {
  font-size: 20px;
}

.azo-tp-fineprint {
  text-align: center;
  font-size: 12px;
  color: var(--azo-tp-muted);
  margin: 12px 0 0;
}

/* ============================================================
   Ergebnis-Spalte (rechts)
   ============================================================ */

.azo-tp-result {
  background: var(--azo-tp-white);
  border: 1px solid var(--azo-tp-border);
  border-radius: 20px;
  padding: 28px;
  min-height: 600px;
}

.azo-tp-result-empty,
.azo-tp-result-loading,
.azo-tp-result-error {
  text-align: center;
  padding: 80px 20px;
}

.azo-tp-result-empty-icon,
.azo-tp-result-error-icon {
  font-size: 64px;
  opacity: 0.5;
  margin-bottom: 16px;
}

.azo-tp-result-empty h2 {
  font-family: 'Cabinet Grotesk', 'DM Sans', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--azo-tp-text);
  margin: 0 0 8px;
}

.azo-tp-result-empty p,
.azo-tp-result-error p {
  color: var(--azo-tp-muted);
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}

.azo-tp-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--azo-tp-border);
  border-top-color: var(--azo-tp-green);
  border-radius: 999px;
  margin: 0 auto 16px;
  animation: azo-tp-spin 0.8s linear infinite;
}

@keyframes azo-tp-spin {
  to { transform: rotate(360deg); }
}

.azo-tp-result-error h3 {
  font-size: 20px;
  color: var(--azo-tp-error);
  margin: 0 0 8px;
}

/* Zusammenfassung */
.azo-tp-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 560px) {
  .azo-tp-summary {
    grid-template-columns: repeat(2, 1fr);
  }
}

.azo-tp-summary-item {
  background: var(--azo-tp-beige);
  padding: 12px;
  border-radius: 12px;
  text-align: center;
}

.azo-tp-summary-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--azo-tp-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.azo-tp-summary-item strong {
  font-size: 18px;
  font-weight: 700;
  color: var(--azo-tp-text);
  font-family: 'Cabinet Grotesk', 'DM Sans', sans-serif;
}

/* Karte */
.azo-tp-map {
  width: 100%;
  height: 380px;
  border-radius: 14px;
  overflow: hidden;
  background: #eee;
  margin-bottom: 24px;
  border: 1px solid var(--azo-tp-border);
}

/* Timeline */
.azo-tp-timeline {
  position: relative;
  padding-left: 28px;
  margin-bottom: 24px;
}

.azo-tp-timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: var(--azo-tp-border);
}

.azo-tp-tl-item {
  position: relative;
  padding: 14px 0;
}

.azo-tp-tl-item::before {
  content: '';
  position: absolute;
  left: -23px;
  top: 18px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--azo-tp-green);
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px var(--azo-tp-border);
}

.azo-tp-tl-item--start::before,
.azo-tp-tl-item--end::before {
  background: var(--azo-tp-gold);
}

.azo-tp-tl-time {
  font-size: 13px;
  font-weight: 700;
  color: var(--azo-tp-green);
  margin-bottom: 4px;
}

.azo-tp-tl-title {
  font-family: 'Cabinet Grotesk', 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--azo-tp-text);
  margin: 0 0 4px;
}

.azo-tp-tl-title a {
  color: inherit;
  text-decoration: none;
}

.azo-tp-tl-title a:hover {
  color: var(--azo-tp-green);
}

.azo-tp-tl-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--azo-tp-muted);
  margin-top: 4px;
}

.azo-tp-tl-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.azo-tp-tl-drive {
  position: relative;
  padding: 10px 0;
  margin-left: 0;
  font-size: 13px;
  color: var(--azo-tp-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.azo-tp-tl-drive::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: var(--azo-tp-green);
  background-image: repeating-linear-gradient(to bottom, transparent, transparent 3px, var(--azo-tp-green) 3px, var(--azo-tp-green) 7px);
}

.azo-tp-tl-drive-icon {
  font-size: 14px;
}

/* Öffnungszeiten-Status */
.azo-tp-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
}

.azo-tp-status--open {
  background: rgba(45, 90, 61, 0.1);
  color: var(--azo-tp-green-dark);
}

.azo-tp-status--closed {
  background: rgba(217, 119, 6, 0.12);
  color: var(--azo-tp-warn);
}

.azo-tp-status--unknown {
  background: rgba(0, 0, 0, 0.05);
  color: var(--azo-tp-muted);
}

/* Actions */
.azo-tp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--azo-tp-border);
}

.azo-tp-btn {
  appearance: none;
  border: 1px solid var(--azo-tp-border);
  background: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--azo-tp-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.azo-tp-btn:hover {
  border-color: var(--azo-tp-green);
  color: var(--azo-tp-green);
}

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

.azo-tp-btn--primary:hover {
  background: var(--azo-tp-green-dark);
  border-color: var(--azo-tp-green-dark);
  color: #fff;
}

.azo-tp-btn--ghost {
  background: transparent;
}

/* ============================================================
   Toast (reused from Merkliste)
   ============================================================ */
.azo-tp-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: var(--azo-tp-text);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 10000;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}

.azo-tp-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.azo-tp-toast--warn { background: #8B4513; }

@media (min-width: 768px) {
  .azo-tp-toast {
    bottom: 32px;
    left: auto;
    right: 32px;
    transform: translate(0, 20px);
  }
  .azo-tp-toast.is-visible {
    transform: translate(0, 0);
  }
}

/* ============================================================
   Print
   ============================================================ */
@media print {
  .azo-hf-header,
  .azo-hf-footer,
  .azo-tp-config,
  .azo-tp-actions,
  .azo-tp-hero {
    display: none !important;
  }
  .azo-tp-layout {
    grid-template-columns: 1fr;
  }
  .azo-tp-result {
    border: 0;
    padding: 0;
  }
  .azo-tp-map {
    height: 260px;
    page-break-inside: avoid;
  }
  .azo-tp-tl-item {
    page-break-inside: avoid;
  }
}
