* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: system-ui, -apple-system, sans-serif;
  background: #fdf4e3;
}

body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
}

/* ── Header ─────────────────────────────────────────── */

#header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px;
}

#brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.app-name {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(100deg, #e8600a, #f5a623);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.beta-badge {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #e8600a;
  background: #fde8d0;
  border-radius: 4px;
  padding: 2px 6px;
}

/* ── Header quote ───────────────────────────────────── */

#header-quote {
  display: none;
  font-size: 0.8rem;
  font-style: italic;
  color: #c07830;
  text-align: center;
  flex: 1;
  padding: 0 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 600px) {
  #header-quote { display: block; }
}

/* ── Time picker ─────────────────────────────────────── */

#time-picker-wrap {
  position: relative;
}

#time-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1.5px solid #f5d08a;
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #7a4a00;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 1px 4px rgba(230,120,0,.1);
}

#time-btn:hover {
  background: #fffbf2;
  border-color: #f5a623;
}

.chevron {
  font-size: 0.65rem;
  color: #f5a623;
  margin-left: 2px;
}

#time-popup {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border: 1.5px solid #f5d08a;
  border-radius: 14px;
  padding: 14px 16px 12px;
  min-width: 220px;
  box-shadow: 0 4px 20px rgba(230,120,0,.15);
  z-index: 3000;
  display: none;
  flex-direction: column;
  gap: 10px;
}

#slider-time-display {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #7a4a00;
  letter-spacing: 0.02em;
}

#slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

#time-slider {
  flex: 1;
  accent-color: #f5a623;
  cursor: pointer;
}

#reset-now-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fde8d0;
  border: none;
  border-radius: 8px;
  width: 30px;
  height: 30px;
  color: #e8600a;
  cursor: pointer;
  padding: 0;
}

#reset-now-btn:hover {
  background: #fcd4aa;
}

/* ── Map ─────────────────────────────────────────────── */

#map {
  flex: 1;
  min-height: 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(180,90,0,.13);
  border: 2px solid rgba(245,160,35,.25);
}

/* ── Sun direction indicator ─────────────────────────── */

#sun-indicator {
  position: fixed;
  font-size: 64px;
  line-height: 1;
  pointer-events: none;
  z-index: 2000;
  transform: translate(-50%, -50%);
  display: none;
}

#sun-indicator.animate {
  transition: left 2s linear, top 2s linear;
}

#sun-indicator::before {
  content: '';
  position: absolute;
  width: 320px;
  height: 320px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255, 210, 60, 0.55) 0%,
    rgba(255, 180, 20, 0.25) 35%,
    transparent 65%
  );
  z-index: -1;
  pointer-events: none;
}

/* ── Bottom sheet ────────────────────────────────────── */

#sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(80,30,0,.35);
  z-index: 3500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
#sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

#sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -4px 32px rgba(180,90,0,.18);
  z-index: 4000;
  max-height: 75vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.32,1,.23,1);
}
#sheet.open {
  transform: translateY(0);
}

#sheet-handle {
  width: 36px;
  height: 4px;
  background: #f5d08a;
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
}

#sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px 18px 8px;
  flex-shrink: 0;
  border-bottom: 1px solid #fdf0d8;
}

#sheet-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #2a1500;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

#sheet-address {
  font-size: 0.8rem;
  color: #b07040;
  margin-top: 3px;
}

#sheet-close {
  background: #fde8d0;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 0.8rem;
  cursor: pointer;
  color: #e8600a;
  flex-shrink: 0;
  margin-left: 10px;
  font-weight: 700;
}
#sheet-close:hover { background: #fcd4aa; }

#sheet-body {
  overflow-y: auto;
  padding: 14px 18px 28px;
  flex: 1;
}

/* ── Status badge ──── */

.sheet-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 18px;
}
.status-sunny  { background: linear-gradient(110deg, #fff3c4, #ffe8a0); color: #a05800; }
.status-coming { background: linear-gradient(110deg, #ffe8d0, #ffd4b0); color: #c04000; }
.status-none   { background: #f4f0ec; color: #888; }
.status-icon   { font-size: 1.4rem; }

/* ── Sheet sections ── */

.sheet-section {
  margin-bottom: 20px;
}

.section-title {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #f5a623;
  margin-bottom: 10px;
}

.no-sun-msg {
  font-size: 0.85rem;
  color: #bbb;
}

/* ── Sun timeline ──── */

.tl-wrap {
  user-select: none;
}

.tl-bar {
  position: relative;
  height: 14px;
  background: #f5ede0;
  border-radius: 7px;
  overflow: hidden;
}

.tl-segment {
  position: absolute;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, #f5a623, #ffcc44);
  border-radius: 4px;
}

.tl-now {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: #c04000;
  border-radius: 1px;
  transform: translateX(-50%);
}

.tl-axis {
  position: relative;
  height: 16px;
  margin-top: 4px;
}
.tl-axis span {
  position: absolute;
  transform: translateX(-50%);
  font-size: 0.65rem;
  color: #c8a87a;
}

.tl-window-labels {
  position: relative;
  height: 20px;
}
.tl-window-label {
  position: absolute;
  transform: translateX(-50%);
  font-size: 0.72rem;
  font-weight: 700;
  color: #d07000;
  white-space: nowrap;
}

/* ── Opening hours ─── */

.hours-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hours-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: #b09070;
  padding: 4px 0;
  border-bottom: 1px solid #fdf0e0;
}
.hours-row:last-child { border-bottom: none; }

.hours-today {
  color: #2a1500;
  font-weight: 700;
}

.hours-day {
  min-width: 90px;
}
