:root { --ink: #16303a; --sub: #4f6670; --faint: #7f939b; --line: rgba(22,48,58,.09);
  --glass: rgba(236,244,245,.4); --glass2: rgba(250,253,253,.62); --must: #c9563f; --mustbg: rgba(224,122,104,.18);
  --self: #2f7f7c; --selfbg: rgba(95,179,176,.2); --accent: #2f6470; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #c9d8e0; color: var(--ink);
  font-family: "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", system-ui, sans-serif; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.loading { position: fixed; inset: 0; background: linear-gradient(#aac6d6, #d9e4e8); transition: opacity 1s; z-index: 50; pointer-events: none; }
html.ready .loading { opacity: 0; }
.glass { background: var(--glass); backdrop-filter: blur(16px) saturate(1.1); -webkit-backdrop-filter: blur(16px) saturate(1.1);
  border: 1px solid rgba(255,255,255,.55); border-radius: 18px; box-shadow: 0 8px 32px rgba(20,50,60,.12); }

/* left column */
.side { position: fixed; left: 16px; top: 16px; bottom: 16px; width: 210px; padding: 22px 12px; display: flex; flex-direction: column; gap: 4px; z-index: 5; }
.brand { font-size: 30px; font-weight: 700; letter-spacing: .08em; color: #4f8f97; padding: 0 12px 18px; }
.side .nav { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; border: 0; background: none; text-align: left; font-size: 15px; color: var(--ink); text-decoration: none; }
.side .nav:hover { background: rgba(255,255,255,.45); }
.side .nav.on { background: rgba(255,255,255,.7); font-weight: 600; }
.side .nav svg { width: 19px; height: 19px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.side .nav small { display: block; font-size: 11px; color: var(--sub); font-weight: 400; }
.side .nav[disabled] { opacity: .5; cursor: default; }
.side .grow { flex: 1; }

/* top row */
.top { position: fixed; left: 250px; right: 24px; top: 14px; z-index: 4; transition: opacity .8s, transform .8s; }
.hdr { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 10px; }
.hdr h1 { margin: 0; font-size: 30px; letter-spacing: .02em; }
.hdr .sub { margin: 4px 0 0; font-size: 16px; color: var(--sub); }
.hdr .date { margin: 2px 0 0; font-size: 13px; color: var(--faint); }
.acts { display: flex; gap: 12px; align-items: center; }
.calm { border: 1px solid rgba(255,255,255,.7); background: linear-gradient(180deg, rgba(225,244,250,.8), rgba(196,230,240,.7)); border-radius: 14px;
  padding: 5px 18px; text-align: center; box-shadow: 0 6px 20px rgba(60,140,170,.18); }
.calm b { display: block; font-size: 14px; }
.calm span { font-size: 12px; color: var(--sub); }
.calm[aria-pressed="false"] { background: rgba(240,246,247,.7); box-shadow: none; }
.addbtn { border: 0; background: #3f6e74; color: #fff; border-radius: 14px; padding: 10px 18px; font-size: 15px; box-shadow: 0 6px 18px rgba(40,80,90,.25); }
.addbtn:hover { background: #335d63; }

.stats { display: none; gap: 8px; margin: 0; flex-wrap: wrap; align-items: center; }
.stat.date { font-size: 13px; color: var(--ink); font-weight: 600; }
.stat { background: var(--glass2); border-radius: 12px; padding: 7px 14px; font-size: 12px; color: var(--sub); border: 1px solid rgba(255,255,255,.6); }
.stat b { font-size: 18px; color: var(--ink); margin-right: 3px; font-weight: 700; }
.stat.tide .bar { height: 5px; width: 120px; border-radius: 9px; background: rgba(22,48,58,.08); margin-top: 4px; overflow: hidden; }
.stat.tide .bar i { display: block; height: 100%; background: linear-gradient(90deg, #6aa9ad, #2f6470); border-radius: 9px; }
.stat.tide.over .bar i { background: linear-gradient(90deg, #e09a73, var(--must)); }

.row { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.panel { padding: 12px 14px 14px; }
.panel h2 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.panel h2 small { display: inline; margin-left: 8px; font-size: 12px; color: var(--sub); font-weight: 400; margin-top: 2px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.card { background: var(--glass2); border: 1px solid rgba(255,255,255,.7); border-radius: 12px; padding: 9px 12px; text-align: left; box-shadow: 0 2px 10px rgba(20,50,60,.06); }
.card:hover { box-shadow: 0 4px 18px rgba(20,50,60,.12); }
.card .t { font-size: 14px; line-height: 1.45; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badge { display: inline-block; font-size: 11px; padding: 1px 9px; border-radius: 99px; margin-top: 4px; }
.badge.must { color: var(--must); background: var(--mustbg); }
.badge.self { color: var(--self); background: var(--selfbg); }
.card .m { font-size: 12px; color: var(--sub); margin-top: 3px; }
.late { color: var(--must); }
.empty { font-size: 14px; color: var(--sub); padding: 8px 2px; }
.focus .card { min-height: 0; }
.focus .go { display: flex; gap: 8px; margin-top: 8px; }
.btn { border: 0; border-radius: 99px; padding: 7px 14px; font-size: 13px; background: rgba(22,48,58,.07); }
.btn.pri { background: #3f6e74; color: #fff; }

/* text over the water cut-away */
.bedhint { position: fixed; left: 250px; bottom: 26px; z-index: 3; color: #eaf6f6; text-shadow: 0 1px 10px rgba(0,30,40,.45); transition: opacity .8s; }
.bedhint b { display: block; font-size: 18px; font-weight: 600; }
.bedhint span { font-size: 13px; opacity: .9; }
.ticks { position: fixed; right: 24px; bottom: 0; top: 64%; z-index: 3; width: 60px; color: rgba(235,246,246,.85); font-size: 13px; pointer-events: none; transition: opacity .8s; }
.ticks i { position: absolute; right: 0; font-style: normal; text-shadow: 0 1px 6px rgba(0,30,40,.5); }

/* buoy name tags */
#tags { position: fixed; inset: 0; pointer-events: none; z-index: 2; }
.tag { position: absolute; transform: translate(-50%, -100%); pointer-events: auto; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis;
  font-size: 12px; padding: 4px 10px; border-radius: 99px; background: rgba(250,253,253,.86); border: 1px solid rgba(255,255,255,.8); color: var(--ink);
  box-shadow: 0 3px 12px rgba(20,50,60,.12); cursor: pointer; transition: opacity .3s; }
.tag i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.tag.small { font-size: 11px; padding: 3px 8px; opacity: .85; }
.tag.far { opacity: 0; pointer-events: none; }
.tag.urgent { border-color: rgba(224,122,104,.7); box-shadow: 0 0 0 2px rgba(224,122,104,.25), 0 3px 12px rgba(20,50,60,.12); }
.tag.urgent::after { content: ' · ' attr(data-u); color: var(--must); font-size: 11px; }
.tag.hl, .tag:hover { opacity: 1; background: #fff; box-shadow: 0 4px 16px rgba(20,50,60,.2); z-index: 2; }

/* pressing a buoy */
.pop { position: fixed; z-index: 8; width: 290px; padding: 16px; display: none; }
.pop.open { display: block; }
.pop h3 { margin: 0; font-size: 16px; line-height: 1.45; }
.pop .m { font-size: 13px; color: var(--sub); margin-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; }
.pop .go { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* add */
.addbox { position: fixed; left: 50%; top: 22%; transform: translateX(-50%); width: min(560px, calc(100% - 32px)); z-index: 9; padding: 18px; display: none; }
.addbox.open { display: block; }
.addbox form { display: flex; gap: 10px; align-items: center; background: #fff; border-radius: 12px; padding: 6px 6px 6px 14px; border: 1px solid var(--line); }
.addbox input { flex: 1; border: 0; outline: 0; font-size: 16px; padding: 8px 0; min-width: 0; }
.addbox .pv { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--sub); min-height: 22px; }
.addbox .pv span { background: rgba(47,100,112,.1); border-radius: 6px; padding: 2px 8px; }
.addbox p { margin: 10px 2px 0; font-size: 12px; color: var(--faint); }
.scrim { position: fixed; inset: 0; z-index: 7; display: none; }
.scrim.open { display: block; }

/* lakebed view */
.bedview { position: fixed; left: 250px; top: 18px; width: min(520px, calc(100% - 280px)); z-index: 4; opacity: 0; pointer-events: none; transform: translateY(30px); transition: opacity .6s, transform .6s; }
.bedview.on { opacity: 1; pointer-events: auto; transform: none; }
.bedview h1 { margin: 0 0 4px; font-size: 28px; color: #eaf6f6; text-shadow: 0 1px 12px rgba(0,30,40,.5); }
.bedview .sub { margin: 0 0 14px; color: #cfe6e8; font-size: 14px; text-shadow: 0 1px 8px rgba(0,30,40,.5); }
.bedview .list { max-height: 62vh; overflow: auto; padding: 8px 16px; }
.bedview .it { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 2px; border-top: 1px solid var(--line); font-size: 14px; }
.bedview .it:first-child { border-top: 0; }
.bedview .it small { color: var(--sub); display: block; font-size: 12px; }
.away { opacity: 0 !important; pointer-events: none !important; transform: translateY(-30px); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; z-index: 20; display: flex; gap: 14px; align-items: center;
  background: rgba(22,48,58,.92); color: #fff; font-size: 13px; padding: 10px 14px 10px 16px; border-radius: 12px; transition: .25s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { border: 0; background: rgba(255,255,255,.15); color: #fff; border-radius: 8px; padding: 5px 10px; font-size: 12px; }

@media (max-width: 1100px) { .row { grid-template-columns: 1fr; } .focus { display: none; } }
@media (max-width: 820px) {
  .side { display: none; }
  .top, .bedhint, .bedview { left: 14px; right: 14px; width: auto; }
  .hdr { flex-direction: column; align-items: stretch; }
  .cards { grid-template-columns: 1fr; } .cards .card:nth-child(n+2) { display: none; }
  .stat.tide .bar { width: 80px; } .ticks { display: none; }
}

/* lakebed */
#piletags { position: fixed; inset: 0; pointer-events: none; z-index: 2; }
.ptag { position: absolute; transform: translate(-50%, -100%); white-space: nowrap; font-size: 12px; padding: 3px 9px; border-radius: 99px;
  background: rgba(10,40,48,.55); color: #e8f6f6; border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(4px); }
.ptag.today { background: rgba(240,250,250,.9); color: var(--ink); }
.ptag b { font-weight: 700; }
.bedview .levels { display: flex; gap: 6px; margin: 0 0 10px; flex-wrap: wrap; }
.bedview .levels .btn { background: rgba(240,250,250,.75); }
.bedview .levels .btn.pri { background: #3f6e74; color: #fff; }
.bedview .list { max-height: 52vh; }

/* night: dark glass with light text */
html[data-night="1"] { --ink: #e9f2f4; --sub: #b3c5cb; --faint: #8fa3aa; --glass: rgba(18,38,48,.5); --glass2: rgba(32,58,68,.62); }
html[data-night="1"] .glass { border-color: rgba(255,255,255,.12); }
html[data-night="1"] .card { border-color: rgba(255,255,255,.1); }
html[data-night="1"] .side .nav.on, html[data-night="1"] .side .nav:hover { background: rgba(255,255,255,.12); }
html[data-night="1"] .calm { background: rgba(40,70,82,.7); border-color: rgba(255,255,255,.15); }
html[data-night="1"] .btn { background: rgba(255,255,255,.12); }
html[data-night="1"] .btn.pri { background: #4f8a90; }
html[data-night="1"] .tag { background: rgba(28,52,62,.85); border-color: rgba(255,255,255,.15); }

/* axis hint (the lower edge of the surface) */
.axis { position: fixed; right: 24px; top: calc(69.5% - 30px); z-index: 3; display: flex; gap: 10px; pointer-events: none; transition: opacity .8s; }
.axis span { font-size: 11px; color: var(--ink); background: var(--glass2); padding: 3px 10px; border-radius: 99px; border: 1px solid rgba(255,255,255,.5); }
.pop .wt { display: flex; gap: 6px; align-items: center; margin-top: 12px; font-size: 12px; color: var(--sub); }
.pop .wt .btn { padding: 4px 11px; font-size: 12px; }
@media (max-width: 820px) { .axis { display: none; } }

/* top row: greeting + a one-line summary (after the Today screens of Todoist, Linear and Sunsama) */
.greet h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: .02em; color: var(--ink); text-shadow: 0 1px 10px var(--halo); }
.greet .meta { margin: 3px 0 0; font-size: 13px; color: var(--sub); text-shadow: 0 1px 8px var(--halo); }
.greet .meta b { color: var(--ink); font-weight: 600; }
.greet .meta .late { font-weight: 600; }
:root { --halo: rgba(255,255,255,.75); }
html[data-night="1"] { --halo: rgba(0,15,25,.6); }
.acts { gap: 10px; }
.tide { background: var(--glass2); border: 1px solid rgba(255,255,255,.55); border-radius: 12px; padding: 6px 12px; font-size: 12px; color: var(--sub); min-width: 190px; }
.tide b { color: var(--ink); font-weight: 600; }
.tide .bar { height: 5px; border-radius: 9px; background: rgba(22,48,58,.1); margin-top: 4px; overflow: hidden; }
.tide .bar i { display: block; height: 100%; background: linear-gradient(90deg, #6aa9ad, #2f6470); border-radius: 9px; transition: width .6s; }
.tide.over .bar i { background: linear-gradient(90deg, #e09a73, var(--must)); }
.tide.over .rest { color: var(--must); }
.calm { display: flex; align-items: center; gap: 10px; text-align: left; padding: 6px 14px 6px 10px; }
.calm b { font-size: 13px; display: block; }
.calm small { font-size: 11px; color: var(--sub); display: block; }
.calm .sw { width: 34px; height: 20px; border-radius: 99px; background: rgba(22,48,58,.18); position: relative; flex: none; transition: background .3s; }
.calm .sw i { position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: transform .3s cubic-bezier(.3,.7,.3,1); }
.calm[aria-pressed="true"] .sw { background: #4f9aa2; }
.calm[aria-pressed="true"] .sw i { transform: translateX(14px); }
.calm[aria-pressed="false"] { background: var(--glass2); }

/* left column: thin glass; the selected marker slides */
.side { background: rgba(236,244,245,.2); backdrop-filter: blur(14px) saturate(1.35); -webkit-backdrop-filter: blur(14px) saturate(1.35);
  border: 1px solid rgba(255,255,255,.42); box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 8px 32px rgba(20,50,60,.1); }
html[data-night="1"] .side { background: rgba(18,38,48,.28); border-color: rgba(255,255,255,.12); }
.side .nav { position: relative; z-index: 1; }
.side .nav.on, .side .nav.on:hover { background: none; }
.side .ind { position: absolute; left: 12px; right: 12px; top: 0; height: 44px; border-radius: 12px; z-index: 0; pointer-events: none;
  background: rgba(255,255,255,.5); box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 4px 14px rgba(20,50,60,.08);
  transition: transform .5s cubic-bezier(.22,.9,.25,1), height .5s cubic-bezier(.22,.9,.25,1), opacity .3s; }
html[data-night="1"] .side .ind { background: rgba(255,255,255,.14); box-shadow: inset 0 1px 0 rgba(255,255,255,.2); }

/* droplets when coming up to the surface */
.drops { position: absolute; inset: 0; overflow: hidden; pointer-events: none; border-radius: inherit; z-index: 5; }
.drops .sheen { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(200,235,245,.28), rgba(200,235,245,0) 70%); animation: sheen 1.6s ease-out forwards; }
.drops .d { position: absolute; border-radius: 50% 50% 48% 52% / 58% 58% 42% 42%;
  background: radial-gradient(circle at 34% 30%, rgba(255,255,255,.95) 0 14%, rgba(255,255,255,.35) 26%, rgba(170,215,228,.18) 58%, rgba(120,170,190,.28) 100%);
  box-shadow: 0 1px 2px rgba(20,60,75,.25), inset 0 -1px 2px rgba(255,255,255,.5); opacity: 0; animation: drip var(--t) cubic-bezier(.55,0,.85,.4) var(--dl) forwards; }
@keyframes drip { 0% { opacity: 0; transform: translateY(0) scale(.6); } 12% { opacity: .95; transform: translateY(0) scale(1); }
  40% { opacity: .95; transform: translateY(4px) scaleY(1.05); } 100% { opacity: 0; transform: translateY(var(--fall)) scaleY(1.25); } }
@keyframes sheen { from { opacity: 1; } to { opacity: 0; } }
.panel { position: relative; }

/* name tags: placed automatically in free space */
.tag { transform: none; transition: opacity .25s; }
.tag.off { opacity: 0; pointer-events: none; }
#tagSvg { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
#tagLines { fill: none; stroke: rgba(255,255,255,.75); stroke-width: 1.2; transition: opacity .3s; }
html[data-night="1"] #tagLines { stroke: rgba(200,225,230,.5); }

/* a faint glow behind the left column text so it reads on thin glass */
.side .nav, .side .brand { text-shadow: 0 0 8px var(--halo), 0 0 2px var(--halo); }
.side .nav small { color: var(--ink); opacity: .75; }

/* Overview (view from the sky) */
.mapview { position: fixed; left: 250px; top: 18px; z-index: 4; padding: 14px 18px; border-radius: 16px; max-width: 420px;
  background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(255,255,255,.45);
  opacity: 0; pointer-events: none; transform: translateY(-20px); transition: opacity .6s, transform .6s; }
.mapview.on { opacity: 1; pointer-events: auto; transform: none; }
.mapview h1 { margin: 0; font-size: 18px; }
.mapview .sub { margin: 4px 0 10px; font-size: 13px; color: var(--sub); }
.mapview .legend { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--sub); margin-bottom: 10px; }
.mapview .levels { display: flex; gap: 6px; }
.mapview .levels a { text-decoration: none; color: inherit; }
body.map .tag { font-size: 11px; padding: 3px 8px; }
@media (max-width: 820px) { .mapview { left: 14px; right: 14px; max-width: none; } }

.mapview .sub b { color: var(--ink); }

.bedview { width: min(400px, calc(100% - 280px)); }
@media (max-width: 820px) { .bedview .list { max-height: 34vh; } }

/* the lakebed list only shows when asked for */
.bedview .list { display: none; }
.bedview .list.open { display: block; }

@media (max-width: 820px) { .bedview { width: auto; } .bedview h1 { font-size: 22px; } }

/* fade between sky and lakebed */
.fade { position: fixed; inset: 0; z-index: 30; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 40%, #2c5c66, #0d2a33); transition: opacity .38s ease; }
.fade.on { opacity: 1; }

/* no wrapping (buttons, badges and one-line card items) */
.btn, .addbtn, .calm, .calm b, .tide, .nav, .badge, .pop .wt, .levels .btn { white-space: nowrap; }
.addbtn { padding: 9px 16px; font-size: 14px; }
.calm { padding: 8px 14px 8px 10px; }
.calm b { font-size: 13px; }
.tide { min-width: 0; }
.pop { width: auto; min-width: 290px; max-width: 380px; }
.pop .wt, .pop .go { flex-wrap: nowrap; }
.pop .go .btn, .pop .wt .btn { padding: 5px 10px; font-size: 12px; }

/* the focus card fills the panel width */
.focus .card { display: block; width: 100%; }
/* make the left column text a little easier to read (same glass thickness) */
.side .nav { font-weight: 500; }
.side .nav, .side .brand { text-shadow: 0 0 10px var(--halo), 0 0 3px var(--halo), 0 0 1px var(--halo); }
.side .nav small { opacity: .85; }
.ticks { display: none; }

/* hide name tags while moving */
body.moving #tags, body.moving #tagSvg { opacity: 0 !important; transition: opacity .15s; }
#tags, #tagSvg { transition: opacity .35s; }
/* keep the Overview panel short (so it does not cover buoys) */
.mapview { max-width: 560px; padding: 12px 16px; }
.mapview h1 { font-size: 16px; }
.mapview .sub { margin: 4px 0 8px; font-size: 12px; white-space: nowrap; }
.mapview .legend { flex-direction: row; gap: 16px; margin-bottom: 8px; white-space: nowrap; }
/* own = amber (so it does not blend into the lake blue) */
.badge.self { color: #9a6b00; background: rgba(242,177,52,.22); }
html[data-night="1"] .badge.self { color: #f2c35a; }

@media (max-width: 820px) { .mapview .sub, .mapview .legend { white-space: normal; } }

/* ---- one glass style (same values for every panel, card and button) ---- */
:root {
  --g-bg: rgba(238,245,246,.42); --g-bg-strong: rgba(250,253,253,.66); --g-blur: blur(16px) saturate(1.25);
  --g-line: 1px solid rgba(255,255,255,.5); --g-shadow: 0 8px 28px rgba(20,50,60,.10);
  --r-panel: 16px; --r-card: 12px; --r-pill: 999px;
}
html[data-night="1"] { --g-bg: rgba(18,38,48,.48); --g-bg-strong: rgba(32,58,68,.62); --g-line: 1px solid rgba(255,255,255,.12); }
.glass, .side, .mapview, .pop, .addbox, .bedview .list { background: var(--g-bg); backdrop-filter: var(--g-blur); -webkit-backdrop-filter: var(--g-blur);
  border: var(--g-line); border-radius: var(--r-panel); box-shadow: var(--g-shadow); }
.side { background: rgba(238,245,246,.24); }
html[data-night="1"] .side { background: rgba(18,38,48,.3); }
.card, .tide, .calm, .calm[aria-pressed="false"] { background: var(--g-bg-strong); border: var(--g-line); border-radius: var(--r-card); box-shadow: none; }
.addbtn { border-radius: var(--r-card); }
.btn, .tag, .badge { border-radius: var(--r-pill); }

/* ---- text weight: task names clear, extra info small and quiet ---- */
.card .t { font-size: 15px; font-weight: 600; color: var(--ink); }
.card .m { font-size: 12px; color: var(--sub); }
.panel h2 { font-size: 13px; font-weight: 600; color: var(--sub); letter-spacing: .04em; }
.greet h1 { font-size: 22px; }
.greet .meta .late { color: var(--must); }

/* ---- keep the way into the lakebed short ---- */
.bedhint { display: flex; align-items: baseline; gap: 10px; cursor: default; }
.bedhint .arrow { font-size: 16px; opacity: .85; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) { .bedhint .arrow { animation: none; } }

/* sign-in */
.account { padding: 8px 10px 10px; border-top: 1px solid rgba(255,255,255,.35); margin: 6px 2px 4px; }
.account .acct { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.account .acct b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 0 8px var(--halo); }
.account small { display: block; margin-top: 4px; font-size: 11px; color: var(--sub); text-shadow: 0 0 8px var(--halo); }
.linkbtn { border: 0; background: none; color: var(--sub); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; padding: 0; white-space: nowrap; }
.gbtn { display: flex; align-items: center; gap: 8px; width: 100%; justify-content: center; background: rgba(255,255,255,.85); font-size: 13px; padding: 8px 10px; }
.gbtn svg { width: 16px; height: 16px; }
.pop .why { margin-top: 8px; font-size: 11px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- add a task: opens downward from the button with clear text ---- */
.addbox { display: block !important; left: auto; transform: translateY(-10px) scale(.97); transform-origin: top right; opacity: 0; pointer-events: none;
  width: min(540px, calc(100% - 24px)); padding: 16px 16px 14px; transition: opacity .22s ease, transform .26s cubic-bezier(.2,.8,.2,1); }
.addbox.open { opacity: 1; transform: none; pointer-events: auto; }
.addhead { display: flex; justify-content: space-between; align-items: baseline; margin: 0 2px 10px; }
.addhead b { font-size: 15px; color: var(--ink); }
.addhead span { font-size: 11px; color: var(--sub); }
.addhead kbd, .addbox kbd { font: 10px ui-monospace, Consolas, monospace; border: 1px solid rgba(22,48,58,.2); border-radius: 4px; padding: 1px 5px; color: var(--ink); background: rgba(255,255,255,.6); }
.addbox form { background: rgba(255,255,255,.96); border: 1px solid rgba(22,48,58,.12); }
.addbox input { color: #16303a; }
.addbox input::placeholder { color: #6f8288; }
.addbox .pv { min-height: 24px; margin-top: 10px; }
.addbox .pv span { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: rgba(47,100,112,.14); color: #23515b; }
.addbox .pv .c-due { background: rgba(70,120,200,.15); color: #24508f; }
.addbox .pv .c-est { background: rgba(60,150,140,.16); color: #1f6b63; }
.addbox .pv .c-must { background: rgba(224,83,63,.15); color: #b2402d; }
.addbox .pv .c-self { background: rgba(242,177,52,.22); color: #8a5e00; }
.addbox .pv .c-w { background: rgba(40,60,110,.14); color: #263f78; }
.addbox .pv .c-rep { background: rgba(120,90,180,.14); color: #5a3f9a; }
.addbox .quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.addbox .quick button { border: 1px solid rgba(22,48,58,.14); background: rgba(255,255,255,.7); color: var(--ink); font-size: 12px; padding: 4px 10px; border-radius: 999px; }
.addbox .quick button:hover { background: #fff; border-color: rgba(22,48,58,.3); }
html[data-night="1"] .addhead kbd { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); }
html[data-night="1"] .addbox .quick button { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); }
/* the small note under "Lake & settings" in the left column is not shown */
[hidden] { display: none !important; }

/* a just-added task's tag: stands out, then fades after a few seconds */
.tag { transition: opacity .9s ease; }
.tag.fresh { background: #fff; border: 1.5px solid #4f9aa2; box-shadow: 0 0 0 4px rgba(79,154,162,.22), 0 6px 18px rgba(20,50,60,.2); font-weight: 600; z-index: 3; }
html[data-night="1"] .tag.fresh { background: rgba(40,70,82,.95); }
/* long-press ring */
.hold { position: fixed; z-index: 15; width: 54px; height: 54px; margin: -27px 0 0 -27px; pointer-events: none; opacity: 0; transition: opacity .12s; }
.hold svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.hold circle { fill: rgba(255,255,255,.15); stroke: #fff; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 113.1; stroke-dashoffset: 113.1; filter: drop-shadow(0 1px 3px rgba(0,30,40,.4)); }
.hold.on { opacity: 1; }
.hold.on circle { animation: holdfill .7s linear forwards; }
@keyframes holdfill { to { stroke-dashoffset: 0; } }

/* ================================================================
   Layout lines (every part lines up with these)
   · outer margin --edge, spacing --gap; only multiples of 8
   · top band: from the top of the left column (--edge), height --band. Logo, greeting and buttons are centered in it
   · control height --ctl
   · panel top = top of the first menu item in the left column (--edge + --band + --gap)
   · content left edge = right edge of the left column + --gap
   Checked by tools/align-check.js (measured at 1440, 1024 and 768 px)
   ================================================================ */
:root { --edge: 16px; --gap: 16px; --band: 64px; --ctl: 40px; --side-w: 210px; --content-l: calc(var(--edge) + var(--side-w) + var(--gap)); }
.side { top: var(--edge); bottom: var(--edge); left: var(--edge); width: var(--side-w); padding: 0 12px var(--gap); gap: 4px; }
.side .brand { height: var(--band); margin-bottom: calc(var(--gap) - 4px); /* minus the 4px gap to the menu below */ padding: 0 12px; display: flex; align-items: center; line-height: 1; flex: none; }
.top { top: var(--edge); left: var(--content-l); right: var(--edge); }
.hdr { height: var(--band); margin: 0 0 var(--gap); align-items: center; }
.greet h1 { line-height: 1.2; }
.acts { gap: 8px; align-items: center; }
.tide, .calm, .addbtn { height: var(--ctl); box-sizing: border-box; margin: 0; }
.tide { display: block; padding: 6px 12px 0; line-height: 18px; }
.tide .bar { margin-top: 4px; }
.calm { padding-top: 0; padding-bottom: 0; }
.addbtn { display: inline-flex; align-items: center; padding: 0 16px; }
.row { gap: var(--gap); align-items: stretch; }
.panel { padding: 16px; }
.panel h2 { margin: 0 0 8px; line-height: 16px; }
.bedhint { left: var(--content-l); bottom: var(--edge); }
.mapview, .bedview { left: var(--content-l); top: var(--edge); }
.ticks, .axis { right: var(--edge); }
@media (max-width: 820px) { .top, .bedhint, .bedview, .mapview { left: var(--edge); right: var(--edge); } .hdr { height: auto; min-height: var(--band); align-items: stretch; } .acts { justify-content: flex-end; flex-wrap: wrap; } }

/* greeting: on one line with the date, sharing the baseline of the "Umi" logo */
.greet { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.greet h1 { font-size: 24px; line-height: 1; }
.greet .meta { margin: 0; white-space: nowrap; }
/* tide: the box never gets smaller than its text; on narrow screens the "left" part is dropped */
.tide { flex: none; white-space: nowrap; }
@media (max-width: 1180px) { .tide .rest { display: none; } }
.acts { flex: none; }
/* Nagi button in the Overview */
.calm.small { height: 32px; padding: 0 12px 0 8px; gap: 8px; }
.calm.small b { font-size: 12px; }
.side .brand { display: block; line-height: var(--band); }
.greet { position: relative; top: 3.5px; } /* measured with tools/align-check.js to match the Umi baseline */

/* ================================================================ Dive */
.dive { position: fixed; inset: 0; z-index: 12; pointer-events: none; }
.dive > * { pointer-events: auto; }
.dsetup, .drest { position: fixed; top: 50%; left: 50%; width: min(440px, calc(100% - 32px)); padding: 16px; transform: translate(-50%, -46%) scale(.97); opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .3s cubic-bezier(.2,.8,.2,1); }
.dsetup.on, .drest.on { opacity: 1; transform: translate(-50%, -50%); pointer-events: auto; }
.dsetup:not(.on), .drest:not(.on), .dhud:not(.on), .dgauge:not(.on) { pointer-events: none !important; }
.dlab { display: block; font-size: 12px; font-weight: 600; color: var(--sub); margin: 16px 0 8px; }
.dlab select { display: block; width: 100%; margin-top: 8px; height: 40px; border-radius: 10px; border: 1px solid rgba(22,48,58,.14); background: rgba(255,255,255,.95); color: #16303a; font-size: 14px; padding: 0 10px; }
.dmodes { display: flex; gap: 8px; }
.dmodes button { flex: 1; height: 40px; border-radius: 10px; border: 1px solid rgba(22,48,58,.14); background: rgba(255,255,255,.7); color: var(--ink); font-size: 14px; }
.dmodes button.on { background: #3f6e74; color: #fff; border-color: #3f6e74; }
.dnote { font-size: 12px; color: var(--sub); margin: 8px 0 0; line-height: 1.6; }
.dsetup .go, .drest .go { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
/* while diving: hide everything except the time and the task */
body.diving .top, body.diving #tags, body.diving .bedhint, body.diving .mapview, body.diving .bedview { opacity: 0 !important; pointer-events: none !important; }
body.diving .side { opacity: .35; transition: opacity .8s; }
.dhud { position: fixed; left: 50%; bottom: 48px; transform: translate(-50%, 20px); width: min(560px, calc(100% - 32px)); text-align: center; color: #eaf6f6;
  text-shadow: 0 1px 12px rgba(0,20,30,.6); opacity: 0; transition: opacity .8s ease .6s, transform .8s ease .6s; }
.dhud.on { opacity: 1; transform: translate(-50%, 0); }
.dtask { font-size: 15px; font-weight: 600; opacity: .9; }
.dtime { font-size: 64px; font-weight: 300; letter-spacing: .04em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.dsub2 { font-size: 12px; opacity: .75; margin-bottom: 16px; }
.dhud form { margin: 0 0 16px; }
.dhud input { width: 100%; height: 40px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25); background: rgba(10,40,50,.35); color: #fff; padding: 0 16px; font-size: 13px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); text-shadow: none; box-sizing: border-box; }
.dhud input::placeholder { color: rgba(230,245,245,.65); }
.dhud .btn { background: rgba(255,255,255,.16); color: #fff; padding: 8px 24px; }
.dgauge { position: fixed; right: 32px; top: 50%; height: 40vh; width: 4px; transform: translateY(-50%); border-radius: 4px; background: rgba(255,255,255,.18); opacity: 0; transition: opacity .8s ease .6s; }
.dgauge.on { opacity: 1; }
.dgauge i { position: absolute; left: 0; right: 0; top: 0; height: 0; border-radius: 4px; background: linear-gradient(#bfe6ea, #4f9aa2); transition: height 1s linear; }
.dgauge span { position: absolute; right: 12px; bottom: -24px; font-size: 12px; color: #eaf6f6; white-space: nowrap; text-shadow: 0 1px 8px rgba(0,20,30,.6); }
/* decompression: breathing with the waves (4 s in, 4 s out) */
.breath { display: flex; align-items: center; gap: 16px; margin: 8px 0; }
.breath b { font-size: 18px; font-variant-numeric: tabular-nums; }
.breath p { margin: 4px 0 0; font-size: 12px; color: var(--sub); }
.ring { width: 56px; height: 56px; flex: none; border-radius: 50%; border: 2px solid rgba(79,154,162,.35); display: grid; place-items: center; }
.ring i { width: 24px; height: 24px; border-radius: 50%; background: radial-gradient(#bfe6ea, #4f9aa2); animation: breathe 8s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(.8); opacity: .7; } 50% { transform: scale(2); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ring i { animation: none; } }
#dBubbles .bub { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
#dBubbles .bub span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
html[data-night="1"] .dmodes button { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); }
html[data-night="1"] .dlab select { background: rgba(30,55,66,.95); color: #eaf6f6; border-color: rgba(255,255,255,.18); }

/* ---- improvement set 1 ---- */
/* 1: keep "The one for now" at 1100px and below (placed first) */
@media (max-width: 1100px) and (min-width: 821px) {
  .row { grid-template-columns: minmax(0, 1fr) 280px; }
  .row .focus { display: block; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .cards > :nth-child(n+3) { display: none; }
}
@media (max-width: 820px) { .row .focus { display: block; order: -1; } .row .panel:not(.focus) { display: none; } }
/* 4: dim the backdrop of the Dive setup and break */
.dive { transition: background .3s; }
.dive.dim { background: rgba(8,28,36,.38); pointer-events: auto; }
/* 5: delete stays quiet, at the right end */
.pop .go .del { margin-left: auto; color: #b2402d; background: rgba(224,83,63,.08); }
html[data-night="1"] .pop .go .del { color: #ffb3a6; background: rgba(224,83,63,.18); }
/* 14 */
.mapview .calmnote { color: #2f6f78; font-weight: 600; }
html[data-night="1"] .mapview .calmnote { color: #9fd6dc; }
/* 15: no text selection or menu on long-press */
#scene, #tags .tag { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

/* ---- improvement set 2 ---- */
/* 1: phone bottom bar */
.mbar { display: none; }
@media (max-width: 820px) {
  .mbar { display: flex; position: fixed; left: var(--edge); right: var(--edge); bottom: var(--edge); z-index: 6; height: 56px; padding: 4px; border-radius: 16px; }
  .mbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: none; border-radius: 12px; font-size: 11px; color: var(--ink); }
  .mbar button.on { background: rgba(255,255,255,.55); font-weight: 600; }
  .mbar svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  html[data-night="1"] .mbar button { color: #eaf6f6; }
  html[data-night="1"] .mbar button.on { background: rgba(255,255,255,.14); }
  .bedhint { bottom: calc(var(--edge) + 56px + var(--gap)); }
  .dhud { bottom: calc(var(--edge) + 56px + 24px); }
  #envMenu { left: var(--edge) !important; right: var(--edge); bottom: calc(var(--edge) + 56px + 8px) !important; max-height: 70vh; overflow: auto; }
  /* 3: fit the buttons on one line */
  .acts { flex-wrap: nowrap; gap: 8px; }
  .tide { flex: 1 1 auto; min-width: 0; overflow: hidden; }
  .long { display: none; }
  .calm b { font-size: 12px; }
  .addbtn { padding: 0 14px; }
}
.menvacct:empty { display: none; }
.menvacct { margin: 0 0 12px; }
@media (min-width: 821px) { .menvacct { display: none; } }
/* 5, 12: things you can press */
.bedhint { cursor: pointer; }
.greet .linkish { border: 0; background: none; padding: 0; font: inherit; color: var(--must); font-weight: 600; cursor: pointer; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: text-decoration-color .2s; }
.greet .linkish:hover { text-decoration-color: currentColor; }
/* 10 */
html[data-night="1"] #dBubbles .bub { border-color: rgba(255,255,255,.16); }
/* 15: priority cards fill the panel height */
.row .panel:not(.focus) { display: flex; flex-direction: column; }
.row .panel:not(.focus) .cards { flex: 1; align-items: stretch; }
.row .panel:not(.focus) .card { display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 820px) { .row .panel:not(.focus) { display: none; } }
#envMenu .go { flex-wrap: wrap; }

/* ================================================================
   Button and motion rules (docs/ui-review/README.md)
   Roles: primary (dark, one per view) / secondary (white surface + line) / quiet (text only) / danger (quiet + red)
   Choices: segmented toggle (.seg, a white pill slides)   on/off: aria-pressed
   Motion: opening rises from below in 220ms ease-out; closing sinks in 160ms ease-in
   ================================================================ */
:root { --b-h: 36px; --b-r: 10px; --pri: #2f6670; --pri-h: #285962;
  --ease-out: cubic-bezier(.2,.8,.2,1); --ease-in: cubic-bezier(.4,0,1,1); --ease-seg: cubic-bezier(.4,0,.2,1);
  --t-in: 220ms; --t-out: 160ms; --t-seg: 300ms; }
.btn { height: var(--b-h); padding: 0 14px; border-radius: var(--b-r); font-size: 13px; font-weight: 500; line-height: 1; box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; text-decoration: none;
  border: 1px solid rgba(22,48,58,.12); background: rgba(255,255,255,.85); color: var(--ink); box-shadow: none;
  transition: background .15s, border-color .15s, color .15s, transform .12s var(--ease-out); }
.btn:hover { background: #fff; border-color: rgba(22,48,58,.22); }
.btn.pri, .addbtn { background: var(--pri); border: 1px solid transparent; color: #fff; font-weight: 600; box-shadow: 0 1px 0 rgba(255,255,255,.22) inset, 0 2px 6px rgba(20,60,70,.22); }
.btn.pri:hover, .addbtn:hover { background: var(--pri-h); }
.btn.quiet { background: none; border-color: transparent; color: #2f5560; padding: 0 10px; }
.btn.quiet:hover { background: rgba(22,48,58,.07); }
.btn.del { color: #b2402d; }
.btn.del:hover { background: rgba(224,83,63,.09); }
.btn[aria-pressed="true"] { background: #fff; border-color: rgba(47,102,112,.45); color: var(--pri); font-weight: 600; }
.btn:disabled { opacity: .4; cursor: default; }
.addbtn { border-radius: var(--b-r); transition: background .15s, transform .12s var(--ease-out); }
.gbtn { width: 100%; background: #fff; }
.btn:focus-visible, .seg button:focus-visible, .addbtn:focus-visible, .calm:focus-visible { outline: 2px solid #4f9aa2; outline-offset: 2px; }
html[data-night="1"] .btn { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.16); color: #eaf6f6; }
html[data-night="1"] .btn:hover { background: rgba(255,255,255,.2); }
html[data-night="1"] .btn.pri { background: #4f8a90; border-color: transparent; color: #fff; }
html[data-night="1"] .btn.quiet { background: none; border-color: transparent; color: #cfe6ea; }
html[data-night="1"] .btn.quiet:hover { background: rgba(255,255,255,.1); }
html[data-night="1"] .btn.del { color: #ffb3a6; }
html[data-night="1"] .btn[aria-pressed="true"] { background: rgba(255,255,255,.9); color: #1d4a52; }
html[data-night="1"] .gbtn { background: #fff; color: #16303a; }
/* pressed: shrink a little */
.btn:active, .addbtn:active, .calm:active, .seg button:active, .side .nav:active, .mbar button:active, .card:active { transform: scale(.97); }

/* segmented toggle: a white pill slides in a grey track */
.seg { position: relative; display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: var(--b-r); background: rgba(22,48,58,.08); max-width: 100%; box-sizing: border-box; }
.seg button { position: relative; z-index: 1; height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: none; font-size: 13px; color: var(--sub); white-space: nowrap; cursor: pointer; transition: color .2s, background .15s, transform .12s var(--ease-out); }
.seg button:hover { color: var(--ink); }
.seg button.on { color: var(--ink); font-weight: 600; }
.seg:not(.ready) button.on { background: #fff; box-shadow: 0 1px 3px rgba(20,50,60,.18); }
.seg-ind { position: absolute; left: 0; top: 0; z-index: 0; border-radius: 8px; background: #fff; box-shadow: 0 1px 3px rgba(20,50,60,.18); pointer-events: none; opacity: 0;
  transition: transform var(--t-seg) var(--ease-seg), width var(--t-seg) var(--ease-seg), height var(--t-seg) var(--ease-seg), opacity .15s; }
.seg.plain button { color: var(--ink); }
.seg.plain button:hover { background: rgba(255,255,255,.75); }
html[data-night="1"] .seg { background: rgba(255,255,255,.1); }
html[data-night="1"] .seg button { color: #b9d3d8; }
html[data-night="1"] .seg button:hover, html[data-night="1"] .seg.plain button { color: #eaf6f6; }
html[data-night="1"] .seg button.on { color: #16303a; }
html[data-night="1"] .seg-ind, html[data-night="1"] .seg:not(.ready) button.on { background: rgba(255,255,255,.92); }
html[data-night="1"] .seg.plain button:hover { background: rgba(255,255,255,.14); }
/* Dive time: full-width toggle */
.seg.dmodes { display: flex; }
.seg.dmodes button { flex: 1; height: 34px; font-size: 14px; border: 0; background: none; }
.seg.dmodes button.on { background: none; color: var(--ink); }
.seg.dmodes:not(.ready) button.on { background: #fff; }

/* card: weight and "farther" side by side */
.pop { width: max-content; min-width: 300px; max-width: min(460px, calc(100vw - 24px)); }
.pop .pair { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 12px; }
.pop .lbl { font-size: 11px; color: var(--sub); margin: 0 0 6px; }
#pop .go { flex-wrap: wrap; gap: 4px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.pop .go .btn { height: 34px; font-size: 13px; padding: 0 12px; }
.pop .go .btn.quiet { padding: 0 8px; }
.pop .go .del { margin-left: auto; background: none; }
html[data-night="1"] #pop .go { border-top-color: rgba(255,255,255,.12); }
.focus .go { gap: 4px; }

/* ---- motion: rise when opening, sink when closing ---- */
.pop { display: block !important; visibility: hidden; opacity: 0; transform: translateY(8px) scale(.98); transform-origin: 50% 100%; pointer-events: none;
  transition: opacity var(--t-out) var(--ease-in), transform var(--t-out) var(--ease-in), visibility 0s linear var(--t-out); }
.pop.open { visibility: visible; opacity: 1; transform: none; pointer-events: auto;
  transition: opacity var(--t-in) var(--ease-out), transform var(--t-in) var(--ease-out), visibility 0s; }
#envMenu { transform-origin: 0 100%; }
.addbox { transform: translateY(8px) scale(.98); transition: opacity var(--t-out) var(--ease-in), transform var(--t-out) var(--ease-in); }
.addbox.open { transform: none; transition: opacity var(--t-in) var(--ease-out), transform var(--t-in) var(--ease-out); }
.dsetup, .drest { transform: translate(-50%, calc(-50% + 8px)) scale(.98); transition: opacity var(--t-out) var(--ease-in), transform var(--t-out) var(--ease-in); }
.dsetup.on, .drest.on { transform: translate(-50%, -50%); transition: opacity var(--t-in) var(--ease-out), transform var(--t-in) var(--ease-out); }
.toast { transition: opacity .4s ease, transform .4s ease; }
.scrim { transition: opacity var(--t-in) var(--ease-out); }
/* no motion when opened from the keyboard */
body.kbd-open .addbox, body.kbd-open .dsetup { transition: none !important; }
/* reduced motion: opacity only */
@media (prefers-reduced-motion: reduce) {
  .pop, .addbox, .dsetup, .drest, .toast { transform: none !important; }
  .dsetup, .drest { transform: translate(-50%, -50%) !important; }
  .pop, .pop.open, .addbox, .addbox.open, .dsetup, .dsetup.on, .drest, .drest.on, .toast { transition: opacity 120ms linear, visibility 0s linear 120ms !important; }
  .seg-ind { transition: none; }
  .btn:active, .addbtn:active, .calm:active, .seg button:active, .card:active { transform: none; }
}
html[data-night="1"] .seg.dmodes button { background: none; border: 0; }

/* badges on cards are only as wide as their text */
.card .badge { align-self: flex-start; }
/* the card and settings are opaque enough to read over the scenery */
#pop, #envMenu { background-color: rgba(244,249,250,.92); }
html[data-night="1"] #pop, html[data-night="1"] #envMenu { background-color: rgba(26,50,60,.94); }
#envMenu p { color: #3d5660 !important; }
html[data-night="1"] #envMenu p { color: #b9d3d8 !important; }
/* keep a long greeting on one line; a date that does not fit ends in "…" */
.greet { flex: 1 1 auto; min-width: 0; white-space: nowrap; }
.greet h1 { flex: none; }
.greet .meta { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* the add button has a full label and a short one for phones (word order differs by language) */
.addbtn .short { display: none; }
@media (max-width: 820px) { .addbtn .long { display: none; } .addbtn .short { display: inline; } }

/* no other priorities today: only "The one for now", across the whole row */
.row.solo { grid-template-columns: 1fr !important; }
.row.solo .panel:not(.focus) { display: none !important; }
.row.solo .focus { display: flex !important; align-items: center; gap: 16px; flex-wrap: wrap; }
.row.solo .focus h2 { flex: 0 0 100%; margin-bottom: 0; }
.row.solo .focus #focus { display: flex; align-items: center; gap: 16px; flex: 1; }
.row.solo .focus #focus .card { flex: 1; }
.row.solo .focus #focus .go { margin: 0; }

/* fold the top panels down to their title line */
.panel h2 { display: flex; align-items: center; gap: 10px; min-height: 16px; }
.panel h2 .sum { display: none; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.panel .fold { margin-left: auto; flex: none; width: 24px; height: 24px; margin-top: -4px; margin-bottom: -4px; border: 0; border-radius: 6px; background: none; color: var(--sub); display: grid; place-items: center; cursor: pointer; }
.panel .fold:hover { background: rgba(22,48,58,.08); color: var(--ink); }
.panel .fold svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .22s var(--ease-out); }
.panel .fold[aria-expanded="false"] svg { transform: rotate(180deg); }
.row.folded .panel > :not(h2) { display: none !important; }
.row.folded .panel h2 { margin: 0; }
.row.folded .panel h2 .sum { display: block; }
.row.folded.solo .focus { display: block !important; }
html[data-night="1"] .panel .fold:hover { background: rgba(255,255,255,.1); }
@media (max-width: 820px) { .row .panel:not(.focus) .fold { display: none; } }
.panel h2 > span:first-child { white-space: nowrap; flex: none; }

/* ================================================================
   UI scale. At 100% browser zoom the panels looked too large on desktop, so everything except the 3D lake
   is drawn at --z (what 75% browser zoom looked like). Phones keep 1. JS converts screen px with ÷ --z (UIZ()).
   ================================================================ */
:root { --z: .75; }
@media (max-width: 820px) { :root { --z: 1; } }
.side, .top, .bedhint, .ticks, .axis, .mapview, .bedview, #pop, #envMenu, .addbox, .scrim, .mbar, .dive, .toast, #tags { zoom: var(--z); }

/* Nagi plan: the reason a buoy stays, the day's message, and suggestions you can tap */
.pop .nagiwhy { color: var(--ink); white-space: normal; }
.pop .nagiwhy b { color: #2f6f78; font-weight: 600; }
html[data-night="1"] .pop .nagiwhy b { color: #9fd6dc; }
.pop .nagisug { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.greet .nagimsg { color: var(--ink); font-weight: 500; }

/* while a buoy is being dragged: a grabbing cursor, and no text selection or page scrolling */
body.dragging, body.dragging #scene { cursor: grabbing !important; user-select: none; }
#scene { touch-action: none; }

/* busyness meter (replaces the tide bar): five steps from Nagi to Storm, filled up to the current one */
.tide .tl { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.tide .tl .rest { margin-left: 10px; color: var(--sub); }
.tide .meter { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; margin-top: 5px; }
.tide .meter i { height: 5px; border-radius: 3px; background: rgba(22,48,58,.1); transition: background .4s; }
.tide .meter i.on:nth-child(1) { background: #8cc7c4; }
.tide .meter i.on:nth-child(2) { background: #6aa9ad; }
.tide .meter i.on:nth-child(3) { background: #4f8f9a; }
.tide .meter i.on:nth-child(4) { background: #d98a5f; }
.tide .meter i.on:nth-child(5) { background: var(--must); }
.tide.busy-rough b, .tide.busy-storm b { color: #c0603f; }
html[data-night="1"] .tide .meter i { background: rgba(255,255,255,.14); }
html[data-night="1"] .tide .meter i.on:nth-child(1) { background: #8cc7c4; }
html[data-night="1"] .tide .meter i.on:nth-child(2) { background: #6aa9ad; }
html[data-night="1"] .tide .meter i.on:nth-child(3) { background: #5fa3ad; }

/* while Nagi is choosing: a quiet pulse on the greeting line */
.greet .nagimsg.thinking { color: var(--sub); animation: nagiThink 1.6s ease-in-out infinite; }
@keyframes nagiThink { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .greet .nagimsg.thinking { animation: none; } }
