/* Station dashboard layout. Colours, sizes and type come from /ds/tokens.css; only layout lives here. */
html, body { margin: 0; background: var(--surface-100); }
body { min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); }
[hidden] { display: none !important; }

.page { max-width: 1240px; margin: 0 auto; }
.page-main, .page-side { min-width: 0; }
.page-side:empty { display: none; }

.stack { padding: 0 var(--space-4); display: grid; gap: var(--space-3); }
.stack:empty { display: none; }
.section { padding: var(--space-5) var(--space-4) 0; }
.section--tight { padding-top: var(--space-3); }
.footnote { padding-bottom: var(--space-5); max-width: 1240px; margin: 0 auto; }
.footnote p { margin: 0; }

.install-row { margin-top: var(--space-4); }
.install-row .ds-caption { margin: 0; }
.link-inline { padding: 0 var(--space-1); font-size: 11px; }

.head-actions { display: flex; align-items: center; gap: var(--space-3); }
/* Language switch (ID / EN) with small flag images, same as on the network pages */
.lang-switch button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; }
.lang-switch img { display: block; width: 18px; height: 12px; border-radius: 2px; }

/* Period switch: a small segmented control built from tokens (see design-system README, Additions) */
.period { display: inline-flex; border-radius: var(--radius-pill); box-shadow: inset 0 0 0 1px var(--line-strong); padding: 2px; }
.period button { border: 0; background: transparent; color: var(--ink-muted); font: 600 12px/1 var(--font-sans);
  padding: 7px 12px; border-radius: var(--radius-pill); cursor: pointer; }
.period button[aria-pressed="true"] { background: var(--teal); color: var(--on-teal); }

.ds-tile--flagged .ds-flag { display: block; margin-top: 4px; }
.ds-tile .ds-spark.is-leaf path { stroke: var(--leaf); }
.ds-tile .ds-spark.is-leaf .area { fill: var(--leaf); }
.ds-tile .ds-spark.is-ink path { stroke: var(--ink-muted); }
.ds-tile .ds-spark.is-ink .area { fill: var(--ink-muted); }

.balance-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2);
  font: 600 12px/1.4 var(--font-sans); color: var(--ink-muted); }
.balance-value { font: 600 24px/1.1 var(--font-sans); letter-spacing: -.035em; margin-top: 6px; }
.balance-value small { font-size: 13px; font-weight: 500; color: var(--ink-muted); letter-spacing: 0; }
.balance-sub { font-size: 11px; color: var(--ink-muted); margin-top: 2px; }
.ds-status--neutral { color: var(--ink-muted); }

.sky-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.widget-wide { grid-column: 1 / -1; }
.socket-tag { margin-top: var(--space-2); }
.stack-inner { display: grid; gap: var(--space-3); }
.stack-inner:empty { display: none; }
.reports { display: grid; gap: var(--space-2); }
.report-item { font-size: 13px; }
.report-photo { display: block; max-width: 100%; max-height: 220px; margin-top: var(--space-2); border-radius: var(--radius-sm); }

/* Sticky report button and the report sheet (bottom sheet on phones, dialog on desktop) */
.report-bar { position: sticky; bottom: 0; z-index: 10; display: flex; justify-content: center;
  padding: var(--space-3) var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom));
  background: var(--surface-100); border-top: 1px solid var(--line); margin-top: var(--space-5); }
.sheet-dialog { border: 0; padding: 0; background: transparent; width: 100%; max-width: 480px; margin: auto auto 0; }
.sheet-dialog::backdrop { background: var(--ink); opacity: .35; }
.sheet-dialog .ds-sheet { margin: 0; }
.sheet-intro { margin: 0; font-size: 13px; }
.sheet-actions { display: flex; justify-content: space-between; align-items: center; margin-top: var(--space-4); }
.ds-photo { cursor: pointer; }
.visually-hidden, .honeypot { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (min-width: 720px) {
  .sheet-dialog { margin: auto; }
  .sheet-dialog .ds-sheet { border-radius: var(--radius-lg); }
}

.tide-svg { height: 44px; margin-top: 6px; }
.moon-svg { width: 24px; height: 24px; }
.page-side .section:first-child { padding-top: var(--space-5); }

.chart-card { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-3) var(--space-2); margin-bottom: var(--space-3); }
.chart-head { font: 600 12px/1.4 var(--font-sans); color: var(--ink-muted); padding: 0 var(--space-1); }
.chart { height: 220px; }

@media (min-width: 720px) {
  .ds-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .chart { height: 260px; }
}

@media (min-width: 960px) {
  .page { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--space-5); padding: 0 var(--space-7); }
  .page:has(.page-side:empty) { grid-template-columns: minmax(0, 1fr); max-width: 960px; }
  .ds-station-head, .stack, .section { padding-left: 0; padding-right: 0; }
  .ds-brandbar { padding-left: var(--space-7); padding-right: var(--space-7); }
  .footnote { padding-left: var(--space-7); padding-right: var(--space-7); }
}

/* Installed app: the page is the whole app for this one station */
@media (display-mode: standalone) {
  .page-nav { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
