/* Frog Night mobile shell — touch-first, single column */
:root {
  --bg: #000010;
  --surface: #161410;
  --surface2: #1e1b16;
  --border: #2e2a22;
  --text: #e8e0cc;
  --muted: #7a7060;
  --amber: #d4883a;
  --amber2: #f0a84a;
  --green: #5a9e6a;
  --teal: #4a8e8a;
  --red: #c06050;
  --cream: #c8b88a;
  --header-h: 52px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'IBM Plex Mono', monospace;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  padding-bottom: calc(var(--safe-bottom) + 12px);
  line-height: 1.5;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

input, textarea, select, option, [contenteditable='true'] {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

.m-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--header-h);
  padding: 10px 16px;
  background: rgba(22, 21, 19, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(92, 90, 88, 0.25);
}

.m-header-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
}

.m-header-title {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--amber2);
}

.m-header-menu {
  position: relative;
  flex: 1;
  min-width: 0;
}

.m-header-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 6px 8px 6px 0;
  border: none;
  background: transparent;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  color: inherit;
  border-radius: 6px;
}

.m-header-menu-trigger:focus-visible {
  outline: 2px solid rgba(212, 168, 90, 0.55);
  outline-offset: 2px;
}

.m-header-menu-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 18px;
  height: 14px;
  flex-shrink: 0;
}

.m-header-menu-icon span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--amber2);
  border-radius: 1px;
  transition: transform 0.22s ease, opacity 0.18s ease, width 0.22s ease;
  transform-origin: center;
}

.m-header-menu.is-open .m-header-menu-icon span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.m-header-menu.is-open .m-header-menu-icon span:nth-child(2) {
  opacity: 0;
  width: 0;
}

.m-header-menu.is-open .m-header-menu-icon span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.m-header-menu-scrim {
  position: fixed;
  inset: 0;
  z-index: 29;
  background: rgba(0, 0, 8, 0.42);
  border: none;
  margin: 0;
  padding: 0;
  cursor: default;
}

.m-header-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 31;
  min-width: min(220px, calc(100vw - 32px));
  padding: 6px;
  border-radius: 10px;
  border: 1px solid rgba(92, 90, 88, 0.35);
  background: rgba(18, 17, 14, 0.98);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.m-menu-item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.m-menu-item:hover,
.m-menu-item:focus-visible {
  background: rgba(212, 168, 90, 0.1);
  outline: none;
}

.m-menu-item.active {
  color: var(--amber2);
  background: rgba(212, 168, 90, 0.14);
}

.m-panel {
  display: none;
  padding: 16px;
  animation: mFadeIn 0.25s ease;
}

.m-panel.active {
  display: block;
}

@keyframes mFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.m-lead {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.55;
}

.m-page-h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 10px;
  color: var(--cream);
}

.m-page-h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 400;
  margin: 0 0 8px;
  color: var(--cream);
}

.m-prose h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 400;
  margin: 18px 0 8px;
  color: var(--cream);
}

.m-prose h2:first-child {
  margin-top: 0;
}

.m-section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--amber);
  margin: 20px 0 10px;
}

/* Location search */
.m-loc-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.m-input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

.m-input:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 2px rgba(212, 136, 58, 0.2);
}

.m-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(212, 136, 58, 0.35), rgba(212, 136, 58, 0.15));
  color: var(--amber2);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  touch-action: manipulation;
  min-height: 44px;
}

.m-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.m-btn--ghost {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
}

.m-btn--block {
  width: 100%;
  margin-top: 8px;
}

.m-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.m-results {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--surface);
}

.m-result {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.m-result:last-child { border-bottom: none; }

.m-result:active { background: var(--surface2); }

.m-result-name { font-size: 14px; color: var(--text); }

.m-result-detail {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.m-selloc {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid rgba(212, 168, 90, 0.25);
  margin-bottom: 12px;
}

.m-selloc-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.m-selloc-name {
  font-size: 15px;
  color: var(--amber2);
  margin-top: 4px;
}

.m-selloc-coords {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.m-status {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin: 10px 0;
}

.m-status--loading { background: var(--surface2); color: var(--muted); }

.m-status--error {
  background: rgba(192, 96, 80, 0.15);
  color: var(--red);
  border: 1px solid rgba(192, 96, 80, 0.3);
}

.m-status[hidden] { display: none !important; }

/* Forecast output */
.m-forecast-hero {
  padding: 16px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(28, 27, 26, 0.95), rgba(14, 13, 10, 0.98));
  border: 1px solid rgba(212, 168, 90, 0.2);
  margin-bottom: 16px;
}

.m-forecast-hero h2 {
  font-size: 14px;
  color: var(--amber2);
  margin-bottom: 8px;
  font-weight: 500;
}

.m-forecast-hero p {
  font-size: 13px;
  color: var(--text);
}

.m-forecast-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.6;
}

.m-wstrip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  margin-bottom: 16px;
  scrollbar-width: thin;
}

.m-wday {
  flex: 0 0 72px;
  padding: 10px 8px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
}

.m-wday.today {
  border-color: rgba(212, 168, 90, 0.5);
  background: rgba(212, 136, 58, 0.12);
}

.m-wday.selected {
  box-shadow: 0 0 0 2px var(--amber);
}

.m-wday-label {
  font-size: 9px;
  color: var(--muted);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-wday-icon { font-size: 18px; line-height: 1; }

.m-wday-hi { font-size: 13px; margin-top: 4px; }

.m-wday-lo {
  font-size: 11px;
  color: var(--muted);
}

.m-species-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.m-scard {
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
}

.m-scard-bar {
  height: 3px;
}

.m-scard-body {
  display: flex;
  gap: 12px;
  padding: 12px;
}

.m-scard-img {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface2);
}

.m-scard-main { flex: 1; min-width: 0; }

.m-scard-name {
  font-size: 14px;
  font-weight: 500;
}

.m-scard-latin {
  font-size: 10px;
  color: var(--muted);
  font-style: italic;
  margin-top: 2px;
}

.m-scard-pct {
  font-size: 22px;
  font-weight: 500;
  margin-top: 6px;
}

.m-scard-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 12px;
}

.m-scard-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.m-scard-dot.pulse {
  animation: mPulse 1.4s ease infinite;
}

@keyframes mPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.15); }
}

.m-scard-offseason-note {
  font-size: 10px;
  line-height: 1.45;
  color: #7ec48c;
  margin: 4px 0 0 18px;
}

.m-scard-note {
  font-size: 10px;
  color: var(--muted);
  margin-top: 6px;
}

.m-scard--dim { opacity: 0.5; }

/* Field guide */
.m-fg-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.m-fg-card {
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
}

.m-fg-card summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
  touch-action: manipulation;
}

.m-fg-card summary::-webkit-details-marker { display: none; }

.m-fg-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.m-fg-summary-text { flex: 1; min-width: 0; }

.m-fg-name { font-size: 14px; }

.m-fg-latin {
  font-size: 10px;
  color: var(--muted);
  font-style: italic;
}

.m-fg-chevron {
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.2s;
}

.m-fg-card[open] .m-fg-chevron { transform: rotate(180deg); }

.m-fg-detail {
  padding: 0 12px 12px;
  border-top: 1px solid var(--border);
}

.m-fg-desc {
  font-size: 13px;
  color: var(--text);
  margin: 12px 0;
  line-height: 1.55;
}

.m-fg-audio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.m-fg-audio-btn {
  flex: 1;
  min-width: 120px;
}

/* About / More */
.m-prose {
  font-size: 14px;
  line-height: 1.6;
}

.m-prose h2 {
  font-size: 16px;
  color: var(--amber2);
  margin: 20px 0 8px;
}

.m-prose p { margin-bottom: 12px; }

.m-link-card {
  display: block;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--amber2);
  text-decoration: none;
  margin-top: 12px;
  font-size: 14px;
}

.m-link-card:active { background: var(--surface); }

.m-hidden { display: none !important; }

.m-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: mSpin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
}

@keyframes mSpin { to { transform: rotate(360deg); } }

@media (min-width: 600px) {
  .m-panel { max-width: 520px; margin: 0 auto; }
}
