/* Meeting Mode screen */

.mtg { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; overflow: hidden; background: var(--bg); animation: fade .6s var(--calm); }
.mtg.compact { position: relative; inset: auto; min-height: 430px; border-radius: 0; }

/* blurred impression of a screen: shapes only, never real content */
.mtg-ghost { position: absolute; inset: 0; pointer-events: none; }
.g-blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: drift 40s ease-in-out infinite alternate; }
.g1 { width: 46vmax; height: 46vmax; left: -12vmax; top: -14vmax; background: #b9d4c4; }
.g2 { width: 38vmax; height: 38vmax; right: -10vmax; top: 8vh; background: #c9d9ee; animation-delay: -10s; }
.g3 { width: 34vmax; height: 34vmax; left: 20vw; bottom: -18vmax; background: #f0dcb4; animation-delay: -20s; }
.g4 { width: 26vmax; height: 26vmax; right: 12vw; bottom: -6vmax; background: #efc9c9; opacity: .4; animation-delay: -30s; }
@keyframes drift { to { transform: translate(4vmax, 3vmax) scale(1.06); } }
.g-frame { position: absolute; left: 50%; top: 10vh; width: min(760px, 86vw); transform: translateX(-50%); display: grid; gap: 18px; filter: blur(22px); opacity: .55; }
.g-card { display: block; height: 240px; border-radius: 28px; background: color-mix(in srgb, var(--surface) 80%, #b9d4c4); }
.g-row { display: block; height: 46px; border-radius: 16px; background: color-mix(in srgb, var(--surface) 85%, transparent); }
.g-row.short { width: 60%; }
[data-theme="dark"] .g-blob, .mtg.dark .g-blob { opacity: .22; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .g-blob { opacity: .22; } }

.mtg-center { position: relative; display: grid; justify-items: center; text-align: center; padding: 24px; }
.mtg-clock { display: grid; justify-items: center; }
.mtg-time { font-family: var(--serif); font-size: clamp(88px, 14vw, 168px); font-weight: 500; line-height: .95; letter-spacing: -.035em; font-variant-numeric: tabular-nums; color: var(--ink); }
.mtg-time[data-ampm]:not([data-ampm=""])::after { content: attr(data-ampm); font-family: var(--font); font-size: .16em; font-weight: 600; letter-spacing: .06em; margin-left: .35em; color: var(--ink-3); vertical-align: .9em; }
.mtg-date { margin-top: 14px; font-size: 17px; color: var(--ink-2); }
.mtg-weather { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 30px; margin-top: 10px; font-size: 15.5px; color: var(--ink-2); flex-wrap: wrap; }
.mw-icon { font-size: 20px; }
.mw-dot { color: var(--ink-3); }
.mw-link { border: 0; background: none; padding: 2px 4px; color: var(--ink-3); font-size: 13.5px; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.mw-link:hover { color: var(--ink-2); }
.mw-input { height: 32px; width: 170px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: color-mix(in srgb, var(--surface) 80%, transparent); font-size: 13.5px; outline: none; }
.mw-input:focus { border-color: var(--ink-3); }
.mw-note { color: var(--ink-3); font-size: 13.5px; }
.mw-note.full { flex-basis: 100%; }
/* city suggestions, under the box you are typing in */
.city-pick { position: relative; display: inline-block; }
.city-list { position: absolute; left: 50%; top: calc(100% + 6px); z-index: 5; width: max-content; min-width: 100%; max-width: min(320px, 86vw); transform: translateX(-50%); margin: 0; padding: 6px; list-style: none; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); }
.city-list li { display: flex; align-items: baseline; gap: 8px; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-size: 13.5px; color: var(--ink); }
.city-list li b { font-weight: 600; white-space: nowrap; }
.city-list li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-3); font-size: 13px; }
.city-list li:hover, .city-list li[aria-selected="true"] { background: var(--surface-2); }
.settings .city-list { left: auto; right: 0; transform: none; }

.mtg-switch { display: grid; justify-items: center; gap: 12px; margin-top: 56px; }
.ms-label { font-size: 13px; font-weight: 700; letter-spacing: .22em; color: var(--ink-2); }
.ms-hint { margin: 2px 0 0; font-size: 14px; color: var(--ink-2); animation: fade .4s var(--ease); }

/* the big slider */
.ms-track {
  --p: 0; position: relative; width: 320px; height: 72px; border-radius: 999px; padding: 6px; cursor: grab; touch-action: none; user-select: none;
  background: color-mix(in srgb, var(--surface) 75%, transparent); border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .06), 0 18px 40px -20px rgba(40, 30, 10, .35); backdrop-filter: blur(10px);
  transition: background .3s;
}
.ms-track:active { cursor: grabbing; }
.ms-track.on { background: color-mix(in srgb, var(--accent) calc(18% + (1 - var(--p)) * 16%), var(--surface)); }
.ms-track:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.ms-knob {
  position: absolute; left: 6px; top: 6px; width: 60px; height: 60px; border-radius: 999px; display: grid; grid-auto-flow: column; place-content: center; gap: 4px;
  background: var(--btn); box-shadow: 0 6px 16px -4px rgba(0, 0, 0, .35); z-index: 1;
}
.ms-knob i { width: 3px; height: 16px; border-radius: 2px; background: color-mix(in srgb, var(--btn-ink) 55%, transparent); }
.ms-text { position: absolute; top: 50%; transform: translateY(-50%); font-size: 18px; font-weight: 700; letter-spacing: .14em; transition: opacity .2s; }
.ms-on { right: 32px; color: var(--ink); opacity: calc(1 - var(--p) * 1.6); }
.ms-off { left: 30px; color: var(--ink-3); opacity: calc(var(--p) * 1.6 - .6); }
.ms-track:not(.on) .ms-on { opacity: 0; }
.ms-track.shake { animation: shake .45s var(--ease); }
@keyframes shake { 20% { transform: translateX(6px); } 40% { transform: translateX(-4px); } 60% { transform: translateX(3px); } 80% { transform: translateX(-1px); } }

/* compact (popup) */
.mtg.compact .mtg-time { font-size: 64px; }
.mtg.compact .mtg-date { font-size: 14px; margin-top: 8px; }
.mtg.compact .mtg-weather { font-size: 13.5px; }
.mtg.compact .mtg-switch { margin-top: 28px; gap: 10px; }
.mtg.compact .ms-track { width: 250px; height: 60px; }
.mtg.compact .ms-knob { width: 48px; height: 48px; }
.mtg.compact .ms-text { font-size: 15px; }
.mtg.compact .g-frame { display: none; }

/* page wiring: in Meeting Mode the page shows the meeting screen and nothing else */
body.meeting-mode > :not(#meetingSlot):not(.keep-in-meeting):not(script) { display: none !important; }

.reduce-motion .g-blob { animation: none; }
@media (prefers-reduced-motion: reduce) { .g-blob { animation: none; } }

/* ---------- the evening screen ---------- */
body.evening-mode .backdrop { z-index: 160; }
body.evening-mode .toasts { z-index: 170; }
html:has(body.evening-mode) > nudge-float { display: none !important; }
body.evening-mode { overflow: hidden; }

/* a dusk palette of its own (a night palette in dark mode) */
.eve, .eve-card {
  --sky1: #ebe3f2; --sky2: #f6ddd2; --sky3: #f7cdb3;
  --orb1: #fff6ea; --orb2: #ffc59a; --glow: rgba(255, 178, 128, .42);
  --hill1: #dcc7d6; --hill2: #c9b0c6;
  --eink: #3a3043; --eink2: #6a5d72; --eink3: #8c7f93;
}
[data-theme="dark"] .eve, [data-theme="dark"] .eve-card {
  --sky1: #0f1326; --sky2: #1c1a35; --sky3: #2c2342;
  --orb1: #f6f3ff; --orb2: #c3b9ea; --glow: rgba(185, 170, 255, .22);
  --hill1: #211e38; --hill2: #16152b;
  --eink: #f2eefb; --eink2: #bfb7d6; --eink3: #8b85a6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .eve, :root:not([data-theme="light"]) .eve-card {
    --sky1: #0f1326; --sky2: #1c1a35; --sky3: #2c2342;
    --orb1: #f6f3ff; --orb2: #c3b9ea; --glow: rgba(185, 170, 255, .22);
    --hill1: #211e38; --hill2: #16152b;
    --eink: #f2eefb; --eink2: #bfb7d6; --eink3: #8b85a6;
  }
}

.eve {
  position: fixed; inset: 0; z-index: 130; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(180deg, var(--sky1) 0%, var(--sky2) 58%, var(--sky3) 100%);
  color: var(--eink); animation: fade 1.2s var(--calm) both;
}
.eve-sky { position: absolute; inset: 0; pointer-events: none; }

/* the sun (or moon) sets behind the hills and breathes: 4s in, 6s out */
.eve-orb {
  --d: min(34vmin, 300px);
  position: absolute; left: 50%; bottom: 11vh; width: var(--d); height: var(--d); margin-left: calc(var(--d) / -2); border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, var(--orb1) 0 30%, var(--orb2) 68%, transparent 70%);
  box-shadow: 0 0 90px 30px var(--glow), 0 0 240px 90px var(--glow);
  animation: eveBreathe 10s ease-in-out infinite, eveRise 2.4s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes eveBreathe { 0%, 100% { transform: scale(.9); opacity: .82; } 40% { transform: scale(1.06); opacity: 1; } }
@keyframes eveRise { from { translate: 0 60px; } }
.eve-hills { position: absolute; left: 0; right: 0; bottom: 0; height: 32vh; }
.eve-hills svg { display: block; width: 100%; height: 100%; }
.eve-hills .far { fill: var(--hill1); }
.eve-hills .near { fill: var(--hill2); }

/* stars only come out at night */
.eve-stars i {
  position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; opacity: 0;
  left: calc(4% + var(--i) * 5.4%); top: calc(6% + mod(var(--i) * 37, 34) * 1%);
}
[data-theme="dark"] .eve-stars i { animation: twinkle 7s ease-in-out infinite; animation-delay: calc(var(--i) * -.8s); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .eve-stars i { animation: twinkle 7s ease-in-out infinite; animation-delay: calc(var(--i) * -.8s); } }
@keyframes twinkle { 50% { opacity: .7; } }

.eve-center { position: absolute; top: 13vh; left: 0; right: 0; display: grid; justify-items: center; text-align: center; padding: 0 24px; }
.eve-center > * { animation: rise 1s cubic-bezier(.22, 1, .36, 1) both; }
.eve-center > :nth-child(2) { animation-delay: .12s; }
.eve-center > :nth-child(3) { animation-delay: .24s; }
.eve-center > :nth-child(4) { animation-delay: .6s; }
.eve-hello { margin: 0; font-family: var(--serif); font-size: clamp(40px, 6.2vw, 76px); font-weight: 500; letter-spacing: -.025em; line-height: 1.05; color: var(--eink); }
.eve-bye { margin: 12px 0 0; font-size: clamp(16px, 1.6vw, 19px); color: var(--eink2); }
.eve-stats { display: flex; margin-top: 36px; }
.eve-stat { display: grid; justify-items: center; gap: 2px; padding: 0 28px; }
.eve-stat + .eve-stat { border-left: 1px solid color-mix(in srgb, var(--eink) 14%, transparent); }
.eve-stat b { font-family: var(--serif); font-size: 36px; font-weight: 500; line-height: 1.1; color: var(--eink); font-variant-numeric: tabular-nums; }
.eve-stat span { font-size: 13px; letter-spacing: .03em; color: var(--eink2); }
.eve-quiet { margin: 30px 0 0; font-size: 15px; color: var(--eink2); }

/* a whisper of a breathing guide, in step with the orb */
/* sits on the sun itself: breathe with it */
.eve-breathe { position: absolute; left: 50%; bottom: calc(11vh + min(34vmin, 300px) * .52); width: 160px; height: 18px; margin: 0 0 0 -80px; text-align: center; font-size: 13px; letter-spacing: .24em; color: #6d5f78; animation: fade 1.2s var(--calm) 1.4s both; }
.eve-breathe span { position: absolute; inset: 0; opacity: 0; }
.eve-breathe .in { animation: breatheIn 10s ease-in-out infinite; }
.eve-breathe .out { animation: breatheOut 10s ease-in-out infinite; }
@keyframes breatheIn { 0%, 36% { opacity: 1; } 42%, 96% { opacity: 0; } 100% { opacity: 1; } }
@keyframes breatheOut { 0%, 38% { opacity: 0; } 46%, 92% { opacity: 1; } 98%, 100% { opacity: 0; } }

.eve-links { position: absolute; left: 0; right: 0; bottom: 26px; display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 26px; animation: fade 1s var(--calm) 1s both; }
.eve-link { border: 0; background: none; padding: 4px 2px; font: 500 13px var(--font); color: var(--eink2); cursor: pointer; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; transition: color .3s var(--calm), text-decoration-color .3s var(--calm); }
.eve-link:hover { color: var(--eink); text-decoration-color: currentColor; }
.eve-link:focus-visible { outline: 2px solid var(--eink2); outline-offset: 3px; border-radius: 6px; }

@media (max-height: 620px) {
  .eve-center { top: 8vh; }
  .eve-hello { font-size: clamp(34px, 5vw, 56px); }
  .eve-stats { margin-top: 20px; }
  .eve-orb { --d: min(26vmin, 190px); bottom: 10vh; }
  .eve-breathe { bottom: calc(10vh + min(26vmin, 190px) * .52); }
}

.reduce-motion .eve-orb, .reduce-motion .eve-stars i { animation: none; }
.reduce-motion .eve-breathe { display: none; }
@media (prefers-reduced-motion: reduce) { .eve-orb, .eve-stars i { animation: none; } .eve-breathe { display: none; } }

/* the popup's small version: the same sky in a card */
.eve-card {
  position: relative; overflow: hidden; display: grid; justify-items: start; gap: 4px; padding: 22px 22px 18px; border-radius: var(--r-xl);
  background: linear-gradient(180deg, var(--sky1), var(--sky3)); color: var(--eink);
}
.eve-card-orb { position: absolute; right: -30px; top: -30px; width: 96px; height: 96px; border-radius: 50%; background: radial-gradient(circle, var(--orb1) 0 30%, var(--orb2) 68%, transparent 70%); box-shadow: 0 0 60px 20px var(--glow); pointer-events: none; }
.eve-card h2 { position: relative; margin: 0; padding-right: 48px; font-family: var(--serif); font-size: 24px; font-weight: 500; color: var(--eink); }
.eve-card .eve-bye { position: relative; margin: 0; font-size: 14px; }
.eve-card .eve-stats { position: relative; margin-top: 14px; }
.eve-card .eve-stat { justify-items: start; padding: 0 16px; }
.eve-card .eve-stat:first-child { padding-left: 0; }
.eve-card .eve-stat b { font-size: 22px; }
.eve-card .eve-stat span { font-size: 12px; }
.eve-card .eve-quiet { position: relative; margin: 10px 0 0; font-size: 13.5px; }
.eve-card .eve-links { position: relative; left: auto; right: auto; bottom: auto; justify-content: flex-start; gap: 4px 16px; margin-top: 14px; animation: none; }
.eve-card .eve-link { font-size: 13px; padding: 2px 0; }

/* While the evening screen is up, the page underneath is not drawn at all. Otherwise it shows
   through for a moment while the screen fades in. */
body.evening-mode > :not(#eveningSlot):not(.backdrop):not(.toasts):not(.bloom-veil):not(script) { visibility: hidden; }

/* ---------- a day off: a bright, still scene ---------- */
.eve.offday, .eve-card.offday {
  --sky1: #e6f0f3; --sky2: #f2f2e8; --sky3: #f5ebd6;
  --orb1: #fffbea; --orb2: #ffe08f; --glow: rgba(255, 210, 110, .34);
  --hill1: #d3e3c9; --hill2: #bcd3b2;
  --eink: #2f3a33; --eink2: #5b6a60; --eink3: #849087;
  --offcard: rgba(255, 252, 238, .6); --offchip: rgba(255, 252, 238, .5);
}
[data-theme="dark"] .eve.offday, [data-theme="dark"] .eve-card.offday {
  --sky1: #121a22; --sky2: #18222a; --sky3: #1f2a2c;
  --orb1: #fbf6e3; --orb2: #e6d39a; --glow: rgba(230, 210, 150, .16);
  --hill1: #1c2a24; --hill2: #15211c;
  --eink: #eef3ee; --eink2: #b7c4ba; --eink3: #86948a; --offcard: rgba(255, 255, 255, .06); --offchip: rgba(255, 255, 255, .08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .eve.offday, :root:not([data-theme="light"]) .eve-card.offday {
    --sky1: #121a22; --sky2: #18222a; --sky3: #1f2a2c;
    --orb1: #fbf6e3; --orb2: #e6d39a; --glow: rgba(230, 210, 150, .16);
    --hill1: #1c2a24; --hill2: #15211c;
    --eink: #eef3ee; --eink2: #b7c4ba; --eink3: #86948a; --offcard: rgba(255, 255, 255, .06); --offchip: rgba(255, 255, 255, .08);
  }
}
/* the sun stays high in the corner: it is the middle of the day */
.eve.offday .eve-orb { --d: min(16vmin, 140px); left: auto; right: 10vw; bottom: auto; top: 9vh; margin-left: 0; background: radial-gradient(circle, var(--orb1) 0 34%, var(--orb2) 69%, transparent 71%); box-shadow: 0 0 70px 24px var(--glow); }
/* A long greeting ("Happy Wednesday, Alexandra") wraps before it reaches the sun instead of running into it. */
.eve.offday .eve-hello { max-width: calc(100vw - 2 * (10vw + min(16vmin, 140px) + 20px)); text-wrap: balance; }
/* On a narrow window there is no room beside the greeting, so the sun sits small above it. */
@media (max-width: 820px) {
  .eve.offday .eve-orb { --d: 56px; right: auto; left: 50%; margin-left: -28px; top: 3vh; }
  .eve.offday .eve-center { top: calc(3vh + 76px); }
  .eve.offday .eve-hello { max-width: none; }
}
.off-idea { display: grid; justify-items: center; gap: 4px; margin-top: 30px; padding: 18px 26px 12px; width: min(560px, 92vw); box-sizing: border-box; border-radius: 22px; background: var(--offcard); }
.off-k { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--eink3); }
.off-idea-text { margin: 2px 0 0; font-family: var(--serif); font-size: clamp(19px, 2vw, 24px); font-weight: 500; line-height: 1.3; color: var(--eink); }
.off-mine-wrap { display: grid; justify-items: center; gap: 10px; margin-top: 24px; }
.off-mine { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; max-width: min(620px, 92vw); }
.off-chip { display: inline-flex; align-items: center; gap: 2px; height: 32px; padding: 0 4px 0 13px; border-radius: 99px; background: var(--offchip); font-size: 13.5px; color: var(--eink); }
.off-x { display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 99px; background: none; color: var(--eink3); font-size: 16px; line-height: 1; cursor: pointer; }
.off-x:hover { color: var(--eink); background: color-mix(in srgb, var(--eink) 8%, transparent); }
.off-add { height: 32px; width: 210px; padding: 0 14px; border-radius: 99px; border: 1px dashed color-mix(in srgb, var(--eink) 28%, transparent); background: transparent; color: var(--eink); font: inherit; font-size: 13.5px; outline: none; }
.off-add::placeholder { color: var(--eink3); }
.off-add:focus { border-style: solid; border-color: color-mix(in srgb, var(--eink) 40%, transparent); }
.off-next { margin: 26px 0 0; font-size: 13px; color: var(--eink3); }
.eve-card.offday .off-idea { width: 100%; justify-items: start; margin-top: 12px; padding: 12px 14px 8px; border-radius: 16px; position: relative; }
.eve-card.offday .off-idea-text { font-size: 17px; }
@media (max-height: 700px) { .off-idea { margin-top: 18px; } .off-mine-wrap { margin-top: 14px; } .off-next { margin-top: 14px; } }

/* The idea and the movie for tonight, side by side on a wide screen, one above the other on a narrow one. */
.off-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; width: min(900px, 92vw); margin-top: 30px; }
.off-cards .off-idea { width: auto; margin-top: 0; align-content: start; }
.off-movie-line { margin: 0 0 2px; max-width: 42ch; font-size: 13.5px; line-height: 1.45; color: var(--eink2); }
@media (max-width: 760px) { .off-cards { grid-template-columns: 1fr; } }
@media (max-height: 700px) { .off-cards { margin-top: 18px; } }

/* Your two lists on a day off, side by side like the cards above them. */
.off-lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 28px; width: min(900px, 92vw); margin-top: 24px; align-items: start; }
.off-lists .off-mine-wrap { margin-top: 0; }
.off-from { display: inline-block; padding: 2px 10px; border-radius: 99px; background: var(--offchip); font-size: 12px; color: var(--eink2); }
.off-from-slot:empty { display: none; }
@media (max-width: 760px) { .off-lists { grid-template-columns: 1fr; } }
@media (max-height: 700px) { .off-lists { margin-top: 14px; } }
