* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { background: #fff; font-family: 'DM Sans', sans-serif; color: #13243A; }
svg { display: inline-block; vertical-align: -0.15em; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(19,36,58,0.15); border-radius: 0; }
::-webkit-scrollbar-track { background: transparent; }
input, select, button { font-family: inherit; }
.sc-ink-search::placeholder { color: rgba(255,255,255,0.45); }
.sc-weather-popover {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .16s ease, transform .16s ease;
  background: #fff;
  color: #13243A;
  border: 1px solid rgba(19,36,58,0.14);
  border-radius: 6px;
  padding: 20px 22px;
  box-shadow: 0 22px 58px rgba(19,36,58,0.28);
}
.sc-weather-popover::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 26px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-left: 1px solid rgba(19,36,58,0.14);
  border-top: 1px solid rgba(19,36,58,0.14);
  transform: rotate(45deg);
}
.sc-weather-chip:hover .sc-weather-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
@keyframes scfade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scslidein { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: translateX(0); } }
@keyframes scpip  { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes sctoast { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================================
   Mobile (≤ 820px). The app builds inline styles in JS; these rules override
   the desktop multi-column layouts by stacking the tagged grid containers and
   resizing modals. The compact header, bottom tab bar and FAB are rendered in
   app.js behind an isMobile flag.
   ============================================================================ */
@media (max-width: 820px) {
  /* Collapse the multi-column tab layouts into a single scrolling column. */
  .sc-3col, .sc-2col { display: flex !important; flex-direction: column !important; overflow: visible !important; }
  .sc-3col > div, .sc-2col > div {
    width: 100% !important; height: auto !important; overflow: visible !important;
    border-left: none !important; border-right: none !important;
  }
  /* Calendar: month/list first, then filters, then the season rail. */
  .sc-3col > div:nth-child(1) { order: 2; border-top: 1px solid rgba(19,36,58,0.1) !important; padding: 16px !important; }
  .sc-3col > div:nth-child(2) { order: 1; }
  .sc-3col > div:nth-child(3) { order: 3; border-top: 1px solid rgba(19,36,58,0.1) !important; }
  /* Conflicts / Results / Associations: content first, filter rail below. */
  .sc-2col > div:nth-child(1) { order: 2; border-top: 1px solid rgba(19,36,58,0.1) !important; padding: 16px !important; }
  .sc-2col > div:nth-child(2) { order: 1; padding: 18px 16px !important; }

  .sc-main { padding: 18px 16px !important; }
  .sc-admin-main { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
  .sc-admin-main > div:last-child { min-width: 600px; }

  .sc-cal-head { flex-wrap: wrap !important; gap: 12px !important; align-items: flex-start !important; padding: 16px 16px 0 !important; }
  .sc-gridpad { padding: 0 12px 18px !important; }
  .sc-listwrap { margin: 0 12px !important; padding: 0 12px 20px !important; }
  .sc-featured { margin: 0 16px 18px !important; }
  .sc-monthcell { min-height: 60px !important; padding: 5px 5px !important; min-width: 0 !important; }

  /* Card / stat grids → single (or paired) column. */
  .sc-cards { grid-template-columns: 1fr !important; }
  .sc-stat5 { grid-template-columns: repeat(2, 1fr) !important; }
  .sc-stat5 > div { border-right: none !important; border-bottom: 1px solid rgba(19,36,58,0.1) !important; }
  .sc-statcols { grid-template-columns: 1fr !important; }

  /* Modals fit the viewport; the detail panel becomes a full-screen sheet. */
  .sc-modal { width: calc(100vw - 24px) !important; max-width: 440px !important; max-height: 86vh !important; overflow-y: auto !important; }
  .sc-detail-overlay { justify-content: stretch !important; align-items: stretch !important; }
  .sc-detail-panel { width: 100% !important; }
}
