/* ========================
   RESET
======================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ========================
   DASHBOARD BODY
======================== */
.dashboard-body {
  display: block !important;
  min-height: 100vh;
  color: #222222;
  overflow-x: hidden;
  justify-content: initial !important;
  align-items: initial !important;
}

/* ========================
   OVERLAY NA DASHBOARDZIE
======================== */
.overlay.dashboard {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  padding: 30px 24px 0;
  overflow-x: hidden;
  background-color: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

/* ==========================================================
   SHELL — stała szerokość + równe marginesy
========================================================== */
.dashboard-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

.dashboard-content {
  width: 100%;
}

/* ========================
   GÓRNY WIERSZ
======================== */
.dashboard-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 18px 0;
}

.dashboard-hint {
  flex: 1;
  margin: 0;
  font-family: 'Georgia', serif;
  font-size: 20px;
  line-height: 1.5;
  color: #2d5a40;
}

/* ========================
   TOP ACTIONS
======================== */
.dashboard-top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.mini-button {
  background-color: rgba(255, 255, 255, 0.85);
  color: #000;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Georgia', serif;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mini-button:hover {
  background-color: #f3edc9;
  transform: translateY(-2px);
}

/* ========================
   KARTA Z WYSZUKIWARKAMI
======================== */
.search-container {
  background-color: rgba(233, 242, 236, 0.5);
  padding: 20px;
  border-radius: 16px;
  width: 100%;
  margin-bottom: 22px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.search-hint {
  text-align: center;
  width: 100%;
  margin: 0 0 16px 0;
  font-family: 'Georgia', serif;
  font-size: clamp(16px, 1.2vw, 20px);
  color: #2d5a40;
  line-height: 1.4;
}

/* ========================
   WYSZUKIWARKI
======================== */
.search-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 10px;
}

.search-box {
  flex: 1 1 22%;
  min-width: 200px;
  display: flex;
  flex-direction: column;
}

.search-box label {
  color: #222222;
  font-size: 16px;
  margin-bottom: 8px;
  font-family: 'Georgia', serif;
}

.search-box input {
  padding: 10px 14px;
  font-size: 16px;
  border-radius: 8px;
  border: none;
  font-family: 'Georgia', serif;
}

/* ========================
   PRZYCISK SZUKAJ
======================== */
.search-button-centered {
  margin: 18px auto 0;
  display: flex;
  justify-content: center;
}

.search-button {
  background-color: #2f5d46;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.35);
  padding: 14px 28px;
  font-size: 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
  font-family: 'Georgia', serif;
  box-shadow: 0 12px 26px rgba(0,0,0,0.18);
}

.search-button:hover {
  transform: translateY(-1px);
  filter: brightness(0.98);
}

/* ==========================================================
   HINT NAD KALENDARZEM
========================================================== */
.calendar-hint {
  text-align: center;
  width: 100%;
  margin: 12px 0 10px 0;
  font-family: 'Georgia', serif;
  font-size: clamp(16px, 1.2vw, 20px);
  color: #2d5a40;
  line-height: 1.4;
}

/* ========================
   KALENDARZ + INFORMATOR
======================== */
.calendar-informer-container {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 48px;
  align-items: start;
  margin-top: 10px;
}

@media (max-width: 980px) {
  .calendar-informer-container {
    grid-template-columns: 1fr;
    gap: 18px;
    margin-top: 8px;
  }
}

/* ========================
   KALENDARZ
======================== */
#calendar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 0;
  width: 100%;
  max-width: 420px;
  margin: 0;
}

.calendar-header {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 420px;
  margin: 0 0 6px;
}

.calendar-header button {
  width: 36px;
  height: 36px;
  font-size: 18px;
  border: none;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-header button:hover {
  background: #f0f0f0;
}

#monthYear {
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(20px, 4vw, 32px);
  margin: 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  width: 100%;
  max-width: 420px;
  margin: 0;
}

#calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-top: 10px;
  width: 100%;
  max-width: 420px;
}

.day-name {
  text-align: center;
  font-weight: bold;
  color: #222222;
  padding: 10px 0;
  font-size: 14px;
}

.calendar-day {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px;
  font-weight: bold;
  background-color: #fff;
  border-radius: 6px;
  transition: all 0.2s ease-in-out;
}

.calendar-day.empty {
  background-color: transparent;
  pointer-events: none;
}

.calendar-day.today {
  background-color: #c1f0d5;
  border-radius: 50%;
  box-shadow: 0 0 4px #6fce8f;
}

.calendar-day.selected-day {
  border: 2px solid #6fce8f;
}

/* ========================
   INFORMATOR
======================== */
.herb-informer-block {
  display: flex;
  flex-direction: column;
  max-width: 700px;
  flex: 1;
  min-width: 320px;
}

.herb-date {
  font-size: 30px;
  font-weight: bold;
  color: #222222;
  margin: 0;
  cursor: pointer;
  display: inline-block;
  padding: 0 2px;
  line-height: 1.15;
  border: 2px solid transparent;
  border-radius: 6px;
  transition: all .2s ease;
}

.herb-date:hover,
.herb-date:focus {
  border-color: #85A58E;
  background: rgba(133,165,142,0.10);
  outline: none;
}

.herb-header.herb-name-nav {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 12px;
  width: 520px;
  max-width: 100%;
  margin: 8px 0 6px;
}

.herb-nav-btn {
  background-color: #fff;
  color: #000;
  border: none;
  width: 42px;
  height: 42px;
  font-size: 18px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.herb-nav-btn:hover {
  background-color: #f0f0f0;
}

.herb-name {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: #222222 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.herb-description {
  font-size: 16px;
  line-height: 1.75;
  color: #222222;
  margin: 8px 0 24px;
  text-align: justify;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.herb-description p { margin: 0; }
.herb-description strong { font-weight: 700; }

/* ========================
   FULL-BLEED BANER
======================== */
.herb-bleed {
  position: relative;
  width: 100vw;
  margin: 10px 0 0 calc(50% - 50vw);
  background: transparent;
  border: 0;
}

#herb-bleed-img[hidden] { display: none !important; }

:root { --herb-band-h: 180px; }

.herb-banner {
  width: 100%;
  height: var(--herb-band-h);
  background-repeat: repeat-x;
  background-position: center bottom;
  background-size: auto var(--herb-band-h);
}

/* ========================
   INSTALL BANNER
======================== */
.install-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 14px 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(47, 93, 70, 0.96);
  color: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}

.install-banner.is-hidden {
  display: none !important;
}

.install-banner__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.install-banner__text strong {
  font-size: 15px;
  line-height: 1.2;
}

.install-banner__text span {
  font-size: 13px;
  line-height: 1.35;
  opacity: 0.95;
}

.install-banner__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.install-banner__btn {
  background: #ffffff;
  color: #2f5d46;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.install-banner__btn:hover {
  background: #f3edc9;
}

.install-banner__close {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.install-banner__close:hover {
  background: rgba(255,255,255,0.28);
}

/* ========================
   RESPONSYWNOŚĆ
======================== */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; }

  .overlay.dashboard {
    padding: 20px 16px 0;
  }

  .dashboard-shell {
    padding: 0 8px;
  }

  .dashboard-top-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
  }

  .dashboard-top-actions {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .dashboard-top-actions .mini-button {
    flex: 1 1 140px;
    max-width: 220px;
    text-align: center;
    padding: 8px 12px;
    font-size: 13px;
    white-space: nowrap;
  }

  .dashboard-hint {
    font-size: 15px;
    padding: 0 10px;
  }

  .search-hint {
    font-size: clamp(12px, 3.4vw, 15px);
    margin-bottom: 12px;
    padding: 0 6px;
  }

  .calendar-hint {
    font-size: clamp(12px, 3.4vw, 15px);
    margin: 10px 0 8px 0;
    padding: 0 8px;
  }

  .search-row {
    flex-direction: column;
    gap: 15px;
  }

  .search-box {
    width: 100%;
  }

  .search-button-centered {
    margin-top: 16px;
  }

  .search-button {
    width: min(360px, 100%);
  }

  .calendar-grid,
  #calendar-days {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
  }

  .calendar-day {
    width: 100%;
    aspect-ratio: 1 / 1;
    margin: 0;
    font-size: 1rem;
  }

  .herb-informer-block {
    padding-top: 20px;
    width: 100%;
    min-width: 0;
  }

  .herb-date {
    text-align: center;
  }

  .herb-header.herb-name-nav {
    width: 100%;
    max-width: 100%;
  }

  .herb-bleed {
    width: 100% !important;
    margin: 12px 0 0 0 !important;
    line-height: 0 !important;
    font-size: 0 !important;
  }

  :root { --herb-band-h: 190px; }

  .herb-banner {
    height: var(--herb-band-h);
    background-size: auto 100%;
  }

  .install-banner {
    margin-top: 4px;
  }
}

@media (min-width: 769px) {
  .install-banner {
    display: none !important;
  }
}

/* ========================
   MODAL DISCLAIMER
======================== */
.disclaimer-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 18px;
  padding-top: calc(18px + env(safe-area-inset-top));
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(2px);
}

.disclaimer-modal.is-hidden {
  display: none !important;
}

.disclaimer-box {
  width: min(720px, 100%);
  background: rgba(255,255,255,0.92);
  border-radius: 16px;
  padding: 22px 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  text-align: left;
  border: 1px solid rgba(0,0,0,0.08);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.disclaimer-title {
  margin: 0 0 10px 0;
  font-family: 'Georgia', serif;
  font-size: 22px;
  color: #1a2e4c;
}

.disclaimer-text {
  margin: 0 0 16px 0;
  font-size: 16px;
  line-height: 1.65;
  color: #222;
}

.disclaimer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 768px) {
  .disclaimer-modal {
    align-items: flex-start;
  }

  .disclaimer-box {
    max-width: 520px;
    margin-top: 8px;
  }

  .disclaimer-actions {
    justify-content: center;
  }

  .disclaimer-title {
    font-size: 20px;
  }

  .disclaimer-text {
    font-size: 15px;
  }
}
