/* Morning cards, the diary's painting and Listen, Get notified, the install chip and the offline
   label (public/morning.js, public/pwa.js). app.css tokens only, so both themes follow. Cards are
   solid (glass stays on navigation); motion is transform/opacity and off with reduced motion. */

/* ── Bolt's morning cards ── */
.morning { margin: 16px 0 0; }
.morning[hidden] { display: none; }
.mc-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 4px 8px; }
.mc-title { display: flex; align-items: center; gap: 8px; margin: 0; font: 600 var(--fs-md) var(--ff-body); color: var(--ink); }
.mc-bolt { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--copper-wash); color: var(--copper); }
.mc-bolt svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.mc-when { font-size: var(--fs-sm); color: var(--ink-3); white-space: nowrap; }
.mc-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; list-style: none; outline: none; }
/* with the diary: it leads on the left over two rows, the others in a 2 x 2 grid beside it */
.mc-row.has-diary { grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr)); grid-auto-flow: row dense; }
.mc-row.has-diary.few { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.mc-row:focus-visible { outline: 2px solid var(--copper-2); outline-offset: 4px; border-radius: var(--r-card); }
.mc-card { position: relative; display: flex; flex-direction: column; min-height: 168px; border-radius: var(--r-card); background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.mc-in { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 16px 16px 8px; }
.mc-label { margin: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--copper); }
.mc-head { margin: 2px 0 0; font-family: var(--ff-display); font-size: var(--fs-3xl); font-weight: 500; line-height: 1.05; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; font-variation-settings: 'opsz' 72; }
.mc-head small { margin-left: 4px; font-size: var(--fs-lg); letter-spacing: 0; color: var(--ink-2); font-family: var(--ff-body); font-weight: 600; }
.mc-line { margin: 4px 0 0; font-size: var(--fs-sm); line-height: 1.45; color: var(--ink-2); }
.mc-gold .mc-label { color: var(--copper-light); }
.mc-gold { border-color: var(--copper-3); }
.mc-hours { width: 100%; height: auto; margin-top: 8px; display: block; }
.mc-hours rect { fill: var(--sand-2); }
.mc-hours rect.on { fill: var(--copper-2); }
.mc-hours text { font: 500 9px var(--ff-body); fill: var(--ink-3); }
/* the diary leads: its painting on top, the first line in the diary's typeface */
.mc-diary { grid-row: span 2; }
.mc-art { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; object-fit: cover; background: var(--sand); }
.mc-quote { margin: 4px 0 0; font-family: var(--ff-display); font-size: var(--fs-lg); line-height: 1.4; color: var(--ink); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; font-variation-settings: 'opsz' 24; }
.mc-label time { color: var(--ink-3); font-weight: 500; }
.mc-diary[data-open="1"] .mc-quote { display: block; -webkit-line-clamp: unset; white-space: pre-line; }
.mc-diary.mc-short .mc-read { display: none; }
.mc-acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 4px; }
.mc-acts svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.mc-acts .bd-listen svg path:only-child { fill: currentColor; stroke-width: 1.2; }
.mc-acts .bd-listen[aria-pressed="true"] svg path { fill: none; stroke-width: 2.4; }
.mc-diary.share-target { outline: 2px solid var(--copper-2); outline-offset: 3px; }
/* one diary: while the lead card is the diary, the plain diary card stays out */
.bolt-diary.bd-replaced { display: none !important; }
.mc-read { align-self: flex-start; border: 0; background: none; min-height: 44px; padding: 4px 0; font: 600 var(--fs-sm) var(--ff-body); color: var(--copper); cursor: pointer; text-decoration: underline; text-decoration-color: var(--copper-3); text-underline-offset: 3px; }
/* feedback */
.mc-fb { display: flex; align-items: center; gap: 4px; padding: 4px 8px 8px 16px; border-top: 1px solid var(--line); }
.mc-fb-q { flex: 1; font-size: var(--fs-xs); color: var(--ink-3); }
.mc-thumb { display: grid; place-items: center; width: 44px; height: 40px; border: 0; border-radius: var(--r-ctl); background: none; color: var(--ink-3); cursor: pointer; transition: color .2s, background-color .2s, transform .2s var(--spring); }
.mc-thumb svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.mc-thumb:hover:not(:disabled) { color: var(--copper); background: var(--well); }
.mc-thumb:active:not(:disabled) { transform: scale(.9); }
.mc-thumb[aria-pressed="true"] { color: var(--copper); background: var(--copper-wash); }
.mc-thumb:disabled { cursor: default; }
.mc-thumb:disabled:not([aria-pressed="true"]) { opacity: .45; }
.mc-thumb:focus-visible, .mc-read:focus-visible { outline: 2px solid var(--copper-2); outline-offset: 2px; }
.mc-dots { display: none; }
.mc-enter .mc-card { animation: mc-in .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes mc-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.morning + .bolt-diary { margin-top: 12px; }

/* phones: one row that swipes sideways, each card snapping into place, with dots */
@media (max-width: 700px) {
  .mc-row { display: flex; align-items: flex-start; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none;
    margin: 0 calc(-1 * var(--gutter, 16px)); padding: 2px var(--gutter, 16px) 8px; scroll-padding-inline: var(--gutter, 16px); }
  .mc-row::-webkit-scrollbar { display: none; }
  .mc-card { flex: 0 0 76%; scroll-snap-align: start; min-height: 0; }
  .mc-diary { flex-basis: 84%; }
  .mc-diary .mc-art { aspect-ratio: 2 / 1; }
  .mc-diary .mc-quote { -webkit-line-clamp: 3; font-size: var(--fs-base); }
  .mc-card:not(.mc-diary) { min-height: 210px; }
  .mc-diary .mc-in { padding-top: 12px; }
  .mc-dots { display: flex; justify-content: center; gap: 6px; padding-top: 4px; }
  .mc-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); transition: background-color .2s, transform .2s; }
  .mc-dots i.on { background: var(--copper-2); transform: scale(1.25); }
  .mc-head { font-size: var(--fs-2xl); }
}

/* ── the diary card: painting, Listen, Get notified ── */
.bd-art { margin: 4px 0 12px; border-radius: var(--r-ctl); overflow: hidden; background: var(--sand); aspect-ratio: 16 / 9; max-width: 520px; }
.bolt-diary:not([data-open="1"]) .bd-art { display: none; } /* the cards above already show it; it opens with the entry */
.bd-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bd-listen svg, .bd-notify svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.bd-listen svg path:only-child { fill: currentColor; stroke-width: 1.2; }
.bd-listen[aria-pressed="true"] { border-color: var(--copper-2); color: var(--copper); }
.bd-listen[aria-pressed="true"] svg path { fill: none; stroke-width: 2.4; }
.bd-sent { border-radius: 4px; transition: background-color .25s, color .25s; }
.bd-speaking .bd-sent { color: var(--ink-2); }
.bd-speaking .bd-sent.on { color: var(--ink); background: var(--copper-wash); box-shadow: 0 0 0 3px var(--copper-wash); }

/* ── Get notified (the Display popover) ── */
.acct-menu { max-height: calc(100dvh - var(--dock-h) - 48px - env(safe-area-inset-bottom, 0px)); overflow-y: auto; overscroll-behavior: contain; }
.am-notify { margin-top: 8px; padding: 12px 4px 4px; border-top: 1px solid var(--line); border-radius: var(--r-ctl); transition: background-color .4s; }
.am-notify[hidden] { display: none; }
.am-notify.nt-flash { background: var(--copper-wash); }
.nt-h { margin: 0 0 4px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.nt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 4px 0; cursor: pointer; }
.nt-l { font-size: var(--fs-md); color: var(--ink); line-height: 1.3; }
.nt-l small { display: block; font-size: var(--fs-xs); color: var(--ink-3); }
.nt-note { margin: 4px 0 0; font-size: var(--fs-xs); line-height: 1.45; color: var(--ink-3); }
.switch { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 44px; height: 26px; border-radius: var(--r-pill); background: var(--sand-2); border: 1px solid var(--line-2); cursor: pointer; transition: background-color .2s, border-color .2s; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink-3); box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .25s var(--spring); }
.switch:checked { background: var(--copper-2); border-color: var(--copper-2); }
.switch:checked::after { transform: translateX(18px); background: var(--on-accent); }
.switch:disabled { opacity: .5; cursor: default; }
.switch:focus-visible { outline: 2px solid var(--copper-2); outline-offset: 2px; }

/* ── install chip (once, dismissible) ── */
.install-chip { position: fixed; z-index: 66; left: 50%; bottom: calc(var(--dock-h) + 24px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: var(--r-pill);
  background: var(--paper); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); transform: translate(-50%, 12px); opacity: 0; transition: opacity .25s, transform .3s var(--ease); }
.install-chip.in { opacity: 1; transform: translate(-50%, 0); }
.install-chip button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; border: 0; background: none; border-radius: var(--r-pill); cursor: pointer; color: var(--ink); font: 600 var(--fs-sm) var(--ff-body); }
.ic-go { padding: 0 12px 0 12px; }
.ic-go svg { width: 17px; height: 17px; fill: none; stroke: var(--copper); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic-x { width: 40px; justify-content: center; color: var(--ink-3) !important; }
.ic-x svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.install-chip button:hover { background: var(--well); }
.install-chip button:focus-visible { outline: 2px solid var(--copper-2); outline-offset: 1px; }
@media (min-width: 1024px) { .install-chip { bottom: 24px; } }

/* ── offline: the last saved numbers ── */
.offline-banner { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; padding: 8px 12px; border-radius: var(--r-pill); width: fit-content; max-width: 100%;
  background: var(--well); border: 1px dashed var(--line-2); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.offline-banner[hidden] { display: none; }
.offline-banner svg { width: 17px; height: 17px; flex: none; fill: none; stroke: var(--copper); stroke-width: 1.8; stroke-linecap: round; }
html.is-offline .link-chip { opacity: .7; }

/* installed (standalone): keep clear of the notch and the rounded corners */
@media (display-mode: standalone) {
  body { padding-top: env(safe-area-inset-top, 0px); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
}

@media (prefers-reduced-motion: reduce) {
  .mc-enter .mc-card { animation: none; }
  .mc-thumb, .switch::after, .install-chip, .bd-sent, .am-notify, .mc-dots i { transition: none; }
}
html.rm .mc-enter .mc-card { animation: none; }
