.agas-taxi {
  --agas-ink: #0f1c17;
  --agas-muted: #5d6b64;
  --agas-line: #e3ece7;
  --agas-accent: #16a34a;
  --agas-accent-dark: #0f7a38;
  --agas-danger: #dc2626;
  max-width: 760px;
  margin: 0 auto;
  padding: 1.6rem;
  color: var(--agas-ink);
  background: #fff;
  border: 1px solid var(--agas-line);
  border-radius: 24px;
  box-shadow: 0 30px 70px rgba(12, 60, 35, .14);
  font-family: inherit;
  -webkit-font-smoothing: antialiased;
}

.agas-taxi *, .agas-taxi *::before, .agas-taxi *::after { box-sizing: border-box; }

.agas-taxi__head { margin-bottom: 1.5rem; }
.agas-taxi__head h2 { margin: .35rem 0 .55rem; font-size: clamp(1.6rem, 4.5vw, 2.4rem); line-height: 1.08; font-weight: 800; letter-spacing: -.02em; }
.agas-taxi__head p { margin: 0; color: var(--agas-muted); font-size: 1rem; line-height: 1.5; }
.agas-taxi__eyebrow {
  display: inline-block; padding: .3rem .7rem;
  color: var(--agas-accent-dark); background: rgba(22, 163, 74, .12);
  border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
}

.agas-taxi__form { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.agas-taxi__form label { display: block; }
.agas-taxi__form label > span { display: block; margin: 0 0 .4rem; font-size: .9rem; font-weight: 700; }
.agas-taxi small { color: var(--agas-muted); font-weight: 400; }
.agas-taxi__wide { grid-column: 1 / -1; }
.agas-taxi__section-label { grid-column: 1 / -1; margin: .4rem 0 -.2rem; font-size: .95rem; font-weight: 800; color: #0f7a38; letter-spacing: .01em; }
.agas-taxi__breakdown { list-style: none; margin: .6rem 0 0; padding: .6rem .8rem; border: 1px solid #e2e8f0; border-radius: 12px; background: #f8fafc; }
.agas-taxi__breakdown li { display: flex; justify-content: space-between; gap: 1rem; padding: .25rem 0; font-size: .9rem; color: #475569; }
.agas-taxi__breakdown li b { color: #0f172a; font-weight: 700; }
.agas-taxi__breakdown-total { border-top: 1px dashed #cbd5e1; margin-top: .25rem; padding-top: .45rem !important; font-size: 1rem !important; color: #0f172a !important; }
.agas-taxi__breakdown-total b { color: #0f7a38 !important; }

.agas-taxi input, .agas-taxi select, .agas-taxi textarea {
  width: 100%; min-height: 54px; padding: .8rem 1rem;
  color: var(--agas-ink); background: #f8faf9;
  border: 1.5px solid #d6e1db; border-radius: 14px;
  font-family: inherit; font-size: 16px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.agas-taxi textarea { resize: vertical; min-height: 84px; }
.agas-taxi input:focus, .agas-taxi select:focus, .agas-taxi textarea:focus {
  outline: none; background: #fff; border-color: var(--agas-accent); box-shadow: 0 0 0 4px rgba(22, 163, 74, .15);
}
.agas-taxi input::placeholder, .agas-taxi textarea::placeholder { color: #9aa8a1; }

/* Przełącznik: na teraz / na godzinę */
.agas-taxi__when-label { display: block; margin: 0 0 .4rem; font-size: .9rem; font-weight: 700; }
.agas-taxi__toggle { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.agas-taxi__toggle-btn {
  min-height: 54px; padding: .7rem 1rem;
  background: #f8faf9; color: var(--agas-ink);
  border: 1.5px solid #d6e1db; border-radius: 14px;
  font: inherit; font-weight: 700; cursor: pointer; line-height: 1.2;
  transition: border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}
.agas-taxi__toggle-btn small { display: block; font-weight: 400; font-size: .78rem; color: inherit; opacity: .8; }
.agas-taxi__toggle-btn.is-active {
  background: rgba(22, 163, 74, .12); color: var(--agas-accent-dark);
  border-color: var(--agas-accent); box-shadow: 0 0 0 3px rgba(22, 163, 74, .12);
}
.agas-taxi__when-field[hidden] { display: none !important; }

.agas-taxi__actions { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-top: .2rem; }
.agas-taxi__button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 56px; padding: .8rem 1.5rem;
  color: #fff !important; background: var(--agas-accent);
  border: 0; border-radius: 14px; font: inherit; font-size: 1.02rem; font-weight: 800;
  text-decoration: none !important; cursor: pointer;
  box-shadow: 0 12px 24px rgba(22, 163, 74, .26);
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}
.agas-taxi__button:hover { background: var(--agas-accent-dark); transform: translateY(-2px); box-shadow: 0 16px 30px rgba(22, 163, 74, .32); }
.agas-taxi__button:active { transform: translateY(0); }
.agas-taxi__button:disabled { opacity: .6; cursor: wait; transform: none; box-shadow: none; }
.agas-taxi__button--secondary { color: var(--agas-accent-dark) !important; background: #fff; border: 1.5px solid var(--agas-accent); box-shadow: none; }
.agas-taxi__button--secondary:hover { color: #fff !important; background: var(--agas-accent); box-shadow: 0 12px 24px rgba(22, 163, 74, .22); }
.agas-taxi__button--danger { background: #fff; color: var(--agas-danger) !important; border: 1.5px solid var(--agas-danger); box-shadow: none; }
.agas-taxi__button--danger:hover { background: var(--agas-danger); color: #fff !important; box-shadow: 0 12px 24px rgba(220, 38, 38, .22); }

.agas-taxi__order { width: 100%; margin-top: 1.1rem; }

.agas-taxi__whatsapp { width: 100%; margin-top: .4rem; background: #25d366; box-shadow: 0 12px 24px rgba(37, 211, 102, .3); }
.agas-taxi__whatsapp:hover { background: #1ebe5a; box-shadow: 0 16px 30px rgba(37, 211, 102, .36); }
.agas-taxi__whatsapp::before { content: ""; width: 22px; height: 22px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M.057 24l1.687-6.163a11.867 11.867 0 01-1.587-5.946C.16 5.335 5.495 0 12.05 0a11.817 11.817 0 018.413 3.488 11.824 11.824 0 013.48 8.414c-.003 6.557-5.338 11.892-11.893 11.892a11.9 11.9 0 01-5.688-1.448L.057 24zm6.597-3.807c1.676.995 3.276 1.591 5.392 1.592 5.448 0 9.886-4.434 9.889-9.885.002-5.462-4.415-9.89-9.881-9.892-5.452 0-9.887 4.434-9.889 9.884a9.86 9.86 0 001.515 5.26l-.999 3.648 3.973-1.207zm11.387-5.464c-.074-.124-.272-.198-.57-.347-.297-.149-1.758-.868-2.031-.967-.272-.099-.47-.149-.669.149-.198.297-.768.967-.941 1.165-.173.198-.347.223-.644.074-.297-.149-1.255-.462-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.074-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51l-.57-.01c-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.095 3.2 5.076 4.487.709.306 1.263.489 1.694.626.712.226 1.36.194 1.872.118.571-.085 1.758-.719 2.006-1.413.247-.694.247-1.289.173-1.413z'/%3E%3C/svg%3E") center / contain no-repeat; }

.agas-taxi__status { margin: .2rem 0 0; min-height: 1.2em; color: var(--agas-muted); font-size: .92rem; }
.agas-taxi__status.is-error { color: #c0392b; font-weight: 600; }
.agas-taxi__status.is-loading { color: var(--agas-accent-dark); font-weight: 600; }

/* Mapa */
.agas-taxi__map {
  width: 100%; height: 280px; margin-bottom: 1.1rem;
  border-radius: 16px; overflow: hidden; border: 1.5px solid var(--agas-line);
  background: #eef4f1; z-index: 0;
}
.agas-taxi__map .leaflet-control-attribution { font-size: 9px; }

/* Wynik / karty */
.agas-taxi__result { margin-top: 1.5rem; padding: 1.3rem; background: #f4fbf7; border: 1.5px solid #cdeede; border-radius: 18px; }
.agas-taxi__result[hidden] { display: none; }
.agas-taxi__result-grid, .agas-taxi__status-card .agas-taxi__result-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
.agas-taxi__result-grid > div span { display: block; margin-bottom: .25rem; color: var(--agas-muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.agas-taxi__result-grid > div strong { font-size: 1.2rem; font-weight: 800; }
.agas-taxi__price { grid-column: 1 / -1; padding-top: .8rem; margin-top: .2rem; border-top: 1.5px solid #cdeede; }
.agas-taxi__price strong { color: var(--agas-accent-dark); font-size: 1.8rem !important; }
.agas-taxi__route { margin: 1rem 0 0; color: var(--agas-muted); font-size: .9rem; line-height: 1.45; }
.agas-taxi__disclaimer { display: block; margin-top: .9rem; color: var(--agas-muted); font-size: .82rem; line-height: 1.45; }
.agas-taxi__credit { margin: 1.2rem 0 0; color: #9aa8a1; font-size: .68rem; text-align: center; line-height: 1.4; }

/* Status card */
.agas-taxi__status-card { padding: 1.3rem; background: #f4fbf7; border: 1.5px solid #cdeede; border-radius: 18px; }
.agas-taxi__status-badge {
  display: block; margin-bottom: 1.1rem; padding: .9rem 1.1rem; border-radius: 14px;
  font-weight: 800; font-size: 1.05rem; text-align: center; line-height: 1.35;
  background: #fef3c7; color: #92400e;
}
.agas-taxi__status-badge.is-accepted { background: #dcfce7; color: #166534; }
.agas-taxi__status-badge.is-declined { background: #fee2e2; color: #991b1b; }
.agas-taxi__status-badge.is-pending { background: #fef3c7; color: #92400e; }
.agas-taxi__driver-msg { margin: 1rem 0 0; padding: .9rem 1.1rem; background: #fff; border-left: 4px solid var(--agas-accent); border-radius: 10px; color: var(--agas-ink); font-style: italic; }
.agas-taxi__status-card .agas-taxi__button--secondary { margin-top: .6rem; width: 100%; }

/* Panel akceptacji */
.agas-taxi__detail { display: grid; gap: .55rem; margin-bottom: .3rem; }
.agas-taxi__row { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem .2rem; border-bottom: 1px dashed #cdeede; }
.agas-taxi__row span { color: var(--agas-muted); font-size: .85rem; font-weight: 600; }
.agas-taxi__row strong { text-align: right; }
.agas-taxi__status-card label { display: block; margin-top: 1rem; }
.agas-taxi__status-card label > span { display: block; margin: 0 0 .4rem; font-size: .9rem; font-weight: 700; }
.agas-taxi__status-card .agas-taxi__actions { margin-top: 1.1rem; }
.agas-taxi__status-card .agas-taxi__order, .agas-taxi__status-card .agas-taxi__button--danger { width: auto; flex: 1; margin-top: 0; }

@media (min-width: 680px) {
  .agas-taxi { padding: 2.5rem; }
  .agas-taxi__form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agas-taxi__result-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .agas-taxi__price { grid-column: auto; padding-top: 0; margin-top: 0; border-top: 0; }
  .agas-taxi__map { height: 340px; }
}

/* Atrybut hidden musi mieć pierwszeństwo nad display przycisków/pól */
.agas-taxi [hidden] { display: none !important; }

/* Przycisk instalacji aplikacji */
.agas-taxi__install {
  width: 100%; margin-top: .6rem;
  background: #0b1220; color: #fff;
  border: none;
}
.agas-taxi__install:hover { background: #1e293b; }
.agas-taxi__button--ghost {
  background: transparent; color: var(--agas-muted);
  border: 1.5px solid var(--agas-line);
}
.agas-taxi__button--ghost:hover { background: #f4f6f5; color: var(--agas-ink); }

/* Panel kierowcy */
.agas-taxi__push { padding: 1.1rem 1.2rem; margin-bottom: 1.3rem; background: #f4fbf7; border: 1.5px solid #cdeede; border-radius: 16px; }
.agas-taxi__push .agas-taxi__button { width: 100%; }
.agas-taxi__push-state { margin: .8rem 0 0; color: var(--agas-muted); font-size: .9rem; text-align: center; }
.agas-taxi__push-state.is-error { color: #c0392b; font-weight: 600; }
.agas-taxi__orders { display: grid; gap: .7rem; }
.agas-taxi__order-item {
  display: block; padding: 1rem 1.1rem; background: #fff; color: var(--agas-ink) !important;
  border: 1.5px solid var(--agas-line); border-left-width: 5px; border-radius: 14px;
  text-decoration: none !important; transition: transform .12s ease, box-shadow .12s ease;
}
.agas-taxi__order-item:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(12, 60, 35, .1); }
.agas-taxi__order-item.is-pending { border-left-color: #f59e0b; }
.agas-taxi__order-item.is-accepted { border-left-color: var(--agas-accent); }
.agas-taxi__order-item.is-declined { border-left-color: #dc2626; opacity: .7; }
.agas-taxi__order-top { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-bottom: .35rem; }
.agas-taxi__order-top strong { font-size: 1.05rem; }
.agas-taxi__order-badge { padding: .15em .6em; border-radius: 999px; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.agas-taxi__order-badge.is-pending { background: #fef3c7; color: #92400e; }
.agas-taxi__order-badge.is-accepted { background: #dcfce7; color: #166534; }
.agas-taxi__order-badge.is-declined { background: #fee2e2; color: #991b1b; }
.agas-taxi__order-meta { color: var(--agas-muted); font-size: .88rem; line-height: 1.5; }
.agas-taxi__order-meta strong { color: var(--agas-accent-dark); }

/* Tryb pełnoekranowy */
body.agas-taxi-standalone {
  margin: 0; min-height: 100vh;
  background: linear-gradient(135deg, #0f7a38 0%, #16a34a 45%, #0b3d24 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.agas-taxi-stage { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: clamp(1rem, 4vw, 3rem); }
.agas-taxi-standalone .agas-taxi { width: 100%; margin: 0; }
