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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #000;
  color: #fff;
  overflow: hidden;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: #000;
  border-bottom: 1px solid #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1000;
}

.topbar h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
}

.status-pill {
  font-size: 11px;
  padding: 4px 8px;
  border: 1px solid #fff;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.status-pill.offline {
  background: #fff;
  color: #000;
}

#app {
  position: absolute;
  top: 52px;
  bottom: 64px;
  left: 0;
  right: 0;
  overflow-y: auto;
}

.view {
  display: none;
  min-height: 100%;
  padding: 16px;
}

.view.active {
  display: block;
}

/* Map view */
#view-map {
  padding: 0;
}

#map {
  width: 100%;
  height: 60vh;
  background: #000;
}

.spot-list {
  padding: 12px 16px 16px;
}

.spot-list h3 {
  font-size: 13px;
  color: #fff;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  border-bottom: 1px solid #333;
  padding-bottom: 6px;
}

.spot-item {
  background: #000;
  border: 1px solid #fff;
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.spot-item:active {
  background: #fff;
  color: #000;
}

.spot-item .name {
  font-weight: 700;
}

.spot-item .beach {
  font-size: 12px;
  opacity: 0.6;
}

.difficulty-pill {
  border: 1px solid #fff;
  color: #fff;
  font-size: 12px;
  padding: 4px 10px;
  font-weight: 700;
}

/* Forecast */
.back-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 14px;
  padding: 4px 0;
  margin-bottom: 12px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#forecast-title {
  font-size: 22px;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.meta-row {
  opacity: 0.6;
  font-size: 13px;
  margin-bottom: 16px;
}

.forecast-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.forecast-card {
  background: #000;
  border: 1px solid #fff;
}

.forecast-day-head {
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr auto auto auto 20px;
  gap: 12px;
  align-items: center;
  cursor: pointer;
}

.forecast-card .date {
  font-weight: 700;
}

.forecast-card .metric {
  text-align: center;
  font-size: 12px;
  opacity: 0.7;
}

.forecast-card .metric strong {
  display: block;
  font-size: 15px;
  color: #fff;
  font-weight: 700;
  opacity: 1;
}

.chevron {
  text-align: center;
  transition: transform 0.15s;
  opacity: 0.7;
}

.forecast-card.expanded .chevron {
  transform: rotate(180deg);
}

/* Hourly rollout */
.hourly {
  display: none;
  border-top: 1px solid #333;
  padding: 4px 14px 10px;
}

.forecast-card.expanded .hourly {
  display: block;
}

.hour-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid #1a1a1a;
  text-align: right;
}

.hour-row .hour {
  text-align: left;
  opacity: 0.7;
}

.hour-row.hour-head {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.5;
  border-bottom: 1px solid #333;
}

.forecast-error {
  border: 1px solid #fff;
  color: #fff;
  padding: 16px;
  text-align: center;
}

/* Buttons */
.primary-btn {
  width: 100%;
  background: #fff;
  color: #000;
  border: 1px solid #fff;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: background 0.12s, color 0.12s;
}

.primary-btn:active {
  background: #000;
  color: #fff;
}

.primary-btn.danger {
  background: #000;
  color: #fff;
}

.primary-btn.danger:active {
  background: #fff;
  color: #000;
}

/* Active session */
.active-card {
  background: #000;
  border: 1px solid #fff;
  padding: 24px;
  text-align: center;
}

.active-card h2 {
  font-size: 24px;
  margin-bottom: 12px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.active-card .meta {
  font-size: 14px;
  opacity: 0.7;
  margin-bottom: 4px;
}

.timer-wrap {
  margin: 24px 0;
}

.timer-label {
  display: block;
  font-size: 11px;
  letter-spacing: 3px;
  opacity: 0.5;
  margin-bottom: 4px;
}

.timer {
  font-size: 48px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #fff;
}

.empty {
  text-align: center;
  opacity: 0.5;
  padding: 40px 16px;
}

/* Form */
.log-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.log-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.log-form input,
.log-form select,
.log-form textarea {
  background: #000;
  border: 1px solid #fff;
  color: #fff;
  padding: 12px;
  font-size: 16px;
  font-family: inherit;
  text-transform: none;
}

.log-form input:focus,
.log-form select:focus,
.log-form textarea:focus {
  outline: 2px solid #fff;
  outline-offset: -1px;
}

.star-rating {
  display: flex;
  gap: 6px;
  font-size: 32px;
  cursor: pointer;
  user-select: none;
}

.star-rating span {
  color: #444;
  transition: color 0.1s;
}

.star-rating span.filled {
  color: #fff;
}

/* History */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.stat-box {
  background: #000;
  border: 1px solid #fff;
  padding: 12px 8px;
  text-align: center;
}

.stat-num {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  word-break: break-word;
}

.stat-lbl {
  font-size: 11px;
  opacity: 0.6;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  background: #000;
  border: 1px solid #fff;
  padding: 12px 14px;
  cursor: pointer;
}

.history-item .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.history-item .spot {
  font-weight: 700;
}

.history-item .date {
  font-size: 12px;
  opacity: 0.6;
}

.history-item .stars {
  color: #fff;
  font-size: 14px;
}

.history-item .details {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #333;
  font-size: 13px;
  line-height: 1.5;
}

.history-item.expanded .details {
  display: block;
}

.history-item .details .label {
  color: #fff;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 6px;
  opacity: 0.6;
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: #000;
  border-top: 1px solid #fff;
  display: flex;
  z-index: 1000;
}

.nav-btn {
  flex: 1;
  background: none;
  border: none;
  border-right: 1px solid #333;
  color: #666;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: color 0.12s, background 0.12s;
}

.nav-btn:last-child {
  border-right: none;
}

.nav-btn.active {
  color: #000;
  background: #fff;
}

/* Leaflet overrides — keep monochrome */
.leaflet-container {
  background: #000;
}

.leaflet-popup-content-wrapper {
  background: #000;
  color: #fff;
  border-radius: 0;
  border: 1px solid #fff;
}

.leaflet-popup-tip {
  background: #000;
  border: 1px solid #fff;
}

.leaflet-popup-content {
  margin: 12px 14px;
  font-size: 14px;
}

.leaflet-popup-content strong {
  color: #fff;
  font-size: 16px;
  display: block;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.popup-btn {
  background: #fff;
  color: #000;
  border: none;
  padding: 6px 10px;
  font-weight: 700;
  margin-top: 8px;
  cursor: pointer;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.leaflet-container a.leaflet-popup-close-button {
  color: #fff;
}

.leaflet-bar a,
.leaflet-bar a:hover {
  background: #000;
  color: #fff;
  border-bottom: 1px solid #333;
  border-radius: 0;
}

/* Desaturate the map tiles to fit the B/W theme */
.leaflet-tile {
  filter: grayscale(1) contrast(1.1);
}
