/* CosmicRay observation server: shared styles. No inline styles anywhere (the CSP forbids them). */
:root {
  /* The light "Stardust Notebook" palette of the main site (accel-kitchen2026). There is deliberately no dark
     mode: the site stays light whatever the browser or operating system prefers, like the rest of accel-kitchen. */
  color-scheme: light;
  --paper: #FAF6EB;                 /* cream */
  --card: #FFFDF7;
  --ink: #2A2730; --ink-2: #4F4956; --muted: #6E6776;
  --line: #D8CFB6;                  /* shade */
  --soft: #F2EBD9;                  /* cream-2: table heads, hover */
  --accent: #A3465F;                /* rose, darkened for contrast: links, buttons, headings' rule (white text on it: AA) */
  --accent-ink: #FFFFFF;
  --accent-pale: #FBE8EE;           /* rose-pale */
  --signal: #2E8BA0;                /* the main site's colour for measured / live things: graphs */
  --warn: #A84A37;                  /* coral-2 */
  --ok: #3F7A55;
  --today: #3F7A55; --week: #C98A1A; --idle: #A39CA8;
  --f-head: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); line-height: 1.7;
       font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", "Segoe UI", system-ui, sans-serif; }
a { color: var(--accent); }
a:hover { color: #7E3449; }
.hidden { display: none !important; }

/* Header: the look of the main site (logo, dashed rule, round buttons). It stays on top while scrolling,
   except on a phone, where two rows would eat too much of the screen. */
header.site { position: sticky; top: 0; z-index: 1100; border-bottom: 1px dashed var(--line); background: rgba(250, 246, 235, .88);
              -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
header.site .bar { max-width: 960px; margin: 0 auto; padding: 10px 16px; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
header.site .brand { display: flex; align-items: center; gap: 12px; margin-right: auto; color: var(--ink); text-decoration: none; }
header.site .brand:hover { color: var(--ink); }
header.site .logo { height: 30px; width: auto; display: block; }
header.site .name { padding-left: 12px; border-left: 1px dashed var(--line); font-family: var(--f-head); font-weight: 700; font-size: 1.08rem;
                    line-height: 1.25; letter-spacing: .04em; }
header.site .name small { display: block; font-weight: 400; font-size: .72rem; letter-spacing: .1em; color: var(--muted); }
header.site nav { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font-size: .95rem; }
header.site nav a { color: var(--ink-2); text-decoration: none; padding: 6px 13px; border-radius: 999px; }
header.site nav a:hover { color: var(--accent); background: var(--accent-pale); }
header.site nav a[aria-current="page"] { color: var(--accent); background: var(--accent-pale); font-weight: 700; }
header.site nav a.cta { color: var(--accent-ink); background: var(--accent); font-weight: 700; padding: 7px 18px; }
header.site nav a.cta:hover { background: #7E3449; }
header.site nav a.cta[aria-current="page"] { background: #7E3449; }
header.site nav .who { padding: 2px 11px; border: 1px solid var(--line); border-radius: 999px; font-size: .85rem; color: var(--muted); background: var(--card); }
header.site nav a.quiet { color: var(--muted); }
@media (max-width: 560px) {
  header.site { position: static; }
  header.site .bar { padding: 8px 16px; gap: 6px 12px; }
  header.site .logo { height: 24px; }
  header.site .name { font-size: .98rem; padding-left: 10px; }
  header.site nav { width: 100%; margin-left: -8px; gap: 2px 0; font-size: .9rem; }
  header.site nav a { padding: 5px 8px; }
  header.site nav a.cta { padding: 6px 14px; margin-left: 4px; }
  header.site nav .who { padding: 1px 8px; margin: 0 2px; font-size: .78rem; max-width: 7.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

main { max-width: 960px; margin: 0 auto; padding: 20px 16px 48px; }
h1, h2 { font-family: var(--f-head); line-height: 1.4; }
h1 { font-size: 1.6rem; margin: .2em 0 .4em; }
h2 { font-size: 1.15rem; margin: 1.6em 0 .4em; padding-bottom: 4px; border-bottom: 2px dashed var(--line); }
p.lead { color: var(--muted); margin-top: 0; }
/* Footer: four columns like the main site, two on a tablet, one on a phone. */
footer.site { margin-top: 24px; padding: 36px 16px 28px; border-top: 1px dashed var(--line); background: rgba(242, 235, 217, .55); color: var(--ink-2); font-size: .9rem; }
footer.site .foot-inner { max-width: 960px; margin: 0 auto; }
footer.site .foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 28px; }
footer.site .foot-title { margin: 0 0 8px; font-family: var(--f-head); font-weight: 700; font-size: 1.05rem; color: var(--ink); letter-spacing: .04em; }
footer.site .foot-brand p { margin: 0 0 8px; line-height: 1.8; max-width: 32ch; }
footer.site h4 { margin: 0 0 10px; font-family: var(--f-head); font-size: .95rem; color: var(--accent); letter-spacing: .06em; }
footer.site ul { list-style: none; margin: 0; padding: 0; }
footer.site li { padding: 3px 0; }
footer.site a { color: var(--ink-2); text-decoration: none; }
footer.site a:hover { color: var(--accent); text-decoration: underline; }
footer.site .foot-bottom { margin-top: 28px; padding-top: 16px; border-top: 1px dashed var(--line); font-size: .78rem; letter-spacing: .06em; color: var(--muted); }
@media (max-width: 760px) { footer.site .foot-grid { grid-template-columns: 1fr 1fr; } footer.site .foot-brand { grid-column: 1 / -1; } }
@media (max-width: 340px) { footer.site .foot-grid { grid-template-columns: 1fr; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin: 14px 0; box-shadow: 0 1px 2px rgba(42, 39, 48, .05), 0 10px 24px -14px rgba(42, 39, 48, .25); }
.note { border-left: 4px solid var(--accent); background: var(--card); padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 14px 0; font-size: .92rem; }
.note.warn { border-left-color: var(--warn); }
.msg { margin: 10px 0; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); }
.msg.error { border-color: var(--warn); color: var(--warn); }
.msg.ok { border-color: var(--ok); color: var(--ok); }

form.stack { display: grid; gap: 12px; max-width: 460px; }
label { display: grid; gap: 4px; font-weight: 600; font-size: .92rem; }
label small { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=date], textarea, select {
  font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
textarea { min-height: 5em; resize: vertical; }
label.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
label.check input { margin-top: .45em; }
.honey { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }   /* hidden from people, not from bots */
button, a.btn { font: inherit; cursor: pointer; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
                border-radius: 999px; padding: 8px 20px; font-weight: 700; letter-spacing: .04em; text-decoration: none; display: inline-block; }
button:hover:not(:disabled), a.btn:hover { background: #7E3449; border-color: #7E3449; color: var(--accent-ink); }
button.secondary, a.btn.secondary { background: rgba(255, 255, 255, .5); color: var(--ink); border: 1.5px solid var(--ink); }
button.secondary:hover:not(:disabled), a.btn.secondary:hover { background: #fff; color: var(--ink); border-color: var(--ink); }
button.danger { background: var(--warn); border-color: var(--warn); color: #fff; }
button.danger:hover:not(:disabled) { background: #85382A; border-color: #85382A; color: #fff; }
button:disabled { opacity: .55; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* map page */
.mapwrap { display: grid; grid-template-columns: 1fr 260px; gap: 14px; }
@media (max-width: 760px) { .mapwrap { grid-template-columns: 1fr; } }
/* isolation: the map's own layers use z-index up to 1000; they must stay under the sticky header. */
#map { height: 62vh; min-height: 340px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); isolation: isolate; }
ul.stations { list-style: none; margin: 0; padding: 0; max-height: 62vh; overflow: auto; }
ul.stations li { padding: 6px 4px; border-bottom: 1px solid var(--line); }
.dot { display: inline-block; width: .8em; height: .8em; border-radius: 50%; margin-right: .5em; background: var(--idle); }
.dot.today { background: var(--today); } .dot.week { background: var(--week); }
.legend { font-size: .85rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; }

/* station page */
.charts { display: grid; gap: 14px; }
canvas.chart { width: 100%; height: 220px; display: block; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.stats { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 8px 0 14px; }
.stats b { font-size: 1.3rem; }
table.data { border-collapse: collapse; width: 100%; font-size: .85rem; }
table.data th, table.data td { border: 1px solid var(--line); padding: 3px 8px; text-align: right; }
table.data th { background: var(--soft); }
table.data th:first-child, table.data td:first-child { text-align: left; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.tabs button { padding: 4px 12px; }
.tabs button[aria-pressed=true] { background: var(--ink); color: #fff; }
.rangebox { margin: 10px 0 4px; }
.rangebox .lead { min-height: 1.5em; margin: 0 0 4px; font-size: .9rem; }
canvas.rangebar { width: 100%; height: 64px; display: block; background: var(--card); border: 1px solid var(--line); border-radius: 10px;
                  cursor: crosshair; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
form.range { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; margin: 8px 0; }
form.range label { grid-template-columns: auto auto; align-items: center; gap: 6px; font-weight: 400; }
form.range input[type=date] { width: auto; }
form.range button { padding: 4px 16px; }

/* leaflet bits we rely on */
.leaflet-container { font: inherit; }

/* operator page */
table.admin th, table.admin td { text-align: left; vertical-align: top; }
.badge { display: inline-block; margin-right: 6px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line); font-size: .8rem; }
.badge.ok { border-color: var(--ok); color: var(--ok); }
.badge.warn { border-color: var(--warn); color: var(--warn); }
#detail dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 12px; }
#detail dt { font-weight: 600; } #detail dd { margin: 0; overflow-wrap: anywhere; }
