/* =========================================================
   AURA DESK STYLES
   Layout: a living sky (real sun, moon and stars) behind a
   6-column grid of tiles. Warm paper tiles by day, deep
   indigo tiles by night. One accent: marigold.
   1. Colours and fonts      6. Widgets
   2. Sky                    7. Dialogs and forms
   3. Splash and log in      8. The live call
   4. Header and search      9. Toast
   5. Grid, tiles, editing  10. Phones and reduced motion
   ========================================================= */

/* 1. Colours and fonts ------------------------------------ */
:root {
  --font-display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  --tile: #FFFBF3;
  --tile-2: #F5EEE1;
  --ink: #1E1A15;
  --ink-2: #6E665B;
  --line: rgba(60, 42, 15, .11);
  --shadow: 0 1px 0 rgba(255, 255, 255, .75) inset, 0 16px 34px -18px rgba(42, 30, 10, .42);
  --accent: #F5A524;
  --accent-ink: #965400;
  --accent-soft: rgba(245, 165, 36, .17);
  --on-accent: #2A1800;
  --danger: #D23F35;
  --good: #2F9E5B;
  --sky-ink: #0E2238;
  --sky-ink-2: rgba(14, 34, 56, .74);
  --glass: rgba(255, 255, 255, .58);
  --glass-line: rgba(255, 255, 255, .78);
  --scrim: rgba(14, 18, 36, .45);
  --sky-base: #A8D2F2;
  --aqi-1: #2F9E5B; --aqi-2: #85B437; --aqi-3: #CFA514; --aqi-4: #E5802A; --aqi-5: #D8432F; --aqi-6: #8E2A21;
  --radius: 22px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --tile: #161A31;
  --tile-2: #1F2442;
  --ink: #EEF0FA;
  --ink-2: #A4A9C8;
  --line: rgba(238, 240, 250, .09);
  --shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 20px 44px -20px rgba(0, 0, 0, .8);
  --accent: #F7B13C;
  --accent-ink: #F7B13C;
  --accent-soft: rgba(247, 177, 60, .16);
  --danger: #F2685B;
  --good: #5CC487;
  --sky-ink: #F4F2FF;
  --sky-ink-2: rgba(244, 242, 255, .76);
  --glass: rgba(22, 26, 49, .55);
  --glass-line: rgba(255, 255, 255, .15);
  --scrim: rgba(4, 6, 16, .64);
  --aqi-1: #4CC27B; --aqi-2: #A6D057; --aqi-3: #EBCB45; --aqi-4: #F29A4A; --aqi-5: #F06A5D; --aqi-6: #D0574B;
  color-scheme: dark;
}
/* The sky for each part of the day (after the theme, so dawn can use light text) */
:root[data-phase="day"]   { --sky: linear-gradient(180deg, #78B4E6 0%, #A6D1F1 46%, #DDEEF9 100%); --sky-base: #DDEEF9; }
:root[data-phase="dawn"]  { --sky: linear-gradient(180deg, #46578F 0%, #C4869C 52%, #F6C08E 100%); --sky-base: #F6C08E; --sky-ink: #FFF8F0; --sky-ink-2: rgba(255, 248, 240, .82); --glass: rgba(40, 30, 60, .32); --glass-line: rgba(255, 255, 255, .3); }
:root[data-phase="dusk"]  { --sky: linear-gradient(180deg, #212A5A 0%, #8B4C7C 52%, #EF946A 100%); --sky-base: #EF946A; }
:root[data-phase="night"] { --sky: linear-gradient(180deg, #070B1F 0%, #121A42 55%, #262B5C 100%); --sky-base: #262B5C; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--sky-base);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* 2. Sky -------------------------------------------------- */
.sky { position: fixed; inset: 0; z-index: 0; background: var(--sky); overflow: hidden; }
.stars { position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s ease; }
.stars i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #FFFFFF; }
:root[data-phase="night"] .stars { opacity: 1; }
:root[data-phase="dusk"] .stars { opacity: .4; }
.orbiter {
  position: absolute;
  left: var(--ox, 78%);
  top: var(--oy, 22%);
  width: 150px; height: 150px;
  translate: -50% -50%;
  border-radius: 50%;
  transition: left 2s ease, top 2s ease, opacity 1s ease;
  background: radial-gradient(circle, #FFF9DE 0 18%, #FFD978 29%, rgba(255, 205, 110, .32) 46%, rgba(255, 205, 110, 0) 68%);
}
:root[data-phase="dawn"] .orbiter { background: radial-gradient(circle, #FFF1D6 0 17%, #FFB977 29%, rgba(255, 160, 110, .3) 46%, rgba(255, 160, 110, 0) 68%); }
:root[data-phase="dusk"] .orbiter { background: radial-gradient(circle, #FFE5BE 0 17%, #FF9B60 29%, rgba(255, 128, 80, .3) 46%, rgba(255, 128, 80, 0) 68%); }
/* The moon: a small bright disc with a soft halo, so its light shows even behind a tile */
:root[data-phase="night"] .orbiter {
  width: 180px; height: 180px;
  background: radial-gradient(circle, #FFFDF3 0 15%, #E9E3CD 19%, rgba(233, 227, 205, .2) 22%, rgba(233, 227, 205, .08) 40%, rgba(233, 227, 205, 0) 66%);
}

/* 3. Splash and log in ------------------------------------ */
.wordmark { display: inline-flex; align-items: center; gap: 11px; font: 800 1.9rem/1 var(--font-display); letter-spacing: -.035em; }
.wm-orb, .orb {
  display: block;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FFF4D2 0%, #F7B13C 33%, #E8577F 70%, #6A3CC8 100%);
}
.wm-orb { width: 26px; height: 26px; box-shadow: 0 0 18px 4px rgba(247, 177, 60, .38); }
.splash { position: fixed; inset: 0; z-index: 5; display: grid; place-items: center; color: var(--sky-ink); transition: opacity .4s ease; }
.splash.is-gone { opacity: 0; pointer-events: none; }
.login {
  position: relative; z-index: 2;
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  padding-block: 28px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.login-card {
  width: min(420px, 100%);
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 28px;
  display: flex; flex-direction: column; gap: 14px;
}
.login-tag { margin: -4px 0 6px; color: var(--ink-2); font-size: 1rem; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-error { margin: 0; min-height: 1.2em; color: var(--danger); font-size: .88rem; font-weight: 600; }
.login-switch { margin: 0; text-align: center; color: var(--ink-2); font-size: .92rem; }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-2); font-size: .8rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.link { border: 0; background: none; padding: 0; color: var(--accent-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* 4. Header and search ------------------------------------ */
.app {
  position: relative; z-index: 1;
  max-width: 1220px;
  margin: 0 auto;
  padding-block: 30px 40px;
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
}
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--sky-ink); }
.hello { min-width: 0; }
.hello h1 { margin: 0; font: 760 clamp(1.75rem, 1.15rem + 2.2vw, 2.75rem)/1.04 var(--font-display); letter-spacing: -.028em; text-wrap: balance; }
.hello p { margin: 7px 0 0; color: var(--sky-ink-2); font-size: 1.02rem; font-weight: 500; }
.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 40px; padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  color: var(--sky-ink);
  font-weight: 650; font-size: .92rem;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: background .2s ease, transform .1s ease;
}
.pill:active { transform: translateY(1px); }
.pill-accent { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.pill-round { width: 40px; padding: 0; justify-content: center; }
.pill[aria-pressed="true"] { background: var(--ink); color: var(--tile); border-color: transparent; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid var(--glass-line);
  background: linear-gradient(135deg, #F7B13C, #E8577F);
  color: #FFFFFF;
  font: 750 1rem/1 var(--font-display);
  display: grid; place-items: center;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.search {
  margin: 24px auto 20px;
  max-width: 640px;
  display: flex; align-items: center; gap: 10px;
  height: 54px; padding: 0 18px;
  border-radius: 999px;
  background: var(--tile);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--ink-2);
}
.search:focus-within { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; color: var(--ink); font-size: 1.03rem; font-weight: 500; }
.search input::placeholder { color: var(--ink-2); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { font: 650 .74rem/1 var(--font-body); border: 1px solid var(--line); border-radius: 6px; padding: 3px 7px; color: var(--ink-2); }
.edit-hint {
  margin: -6px auto 16px; width: fit-content; max-width: 100%;
  padding: 7px 14px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--glass-line);
  color: var(--sky-ink); font-size: .86rem; font-weight: 600; text-align: center;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.foot { margin-top: 28px; text-align: center; color: var(--sky-ink-2); font-size: .85rem; }
.foot p { margin: 0; }
.foot-credit { margin-top: 4px !important; font-size: .76rem; }
.foot span { font-weight: 700; color: var(--sky-ink); }
.foot a { font-weight: 650; text-underline-offset: 3px; }

/* 5. Grid, tiles, editing --------------------------------- */
.grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: 174px;
  grid-auto-flow: row dense;
  gap: 16px;
}
.tile {
  position: relative;
  grid-column: span var(--w, 1);
  grid-row: span var(--h, 1);
  min-width: 0;
  display: flex; flex-direction: column;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--tile);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--ink);
  overflow: hidden;
}
.tile-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 20px; margin-bottom: 10px; }
.tile-label { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-meta { font-size: .76rem; font-weight: 650; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tile-btn {
  width: 28px; height: 28px; border-radius: 9px; border: 0;
  display: grid; place-items: center;
  background: transparent; color: var(--ink-2);
}
.tile-btn:hover { background: var(--tile-2); color: var(--ink); }
.tile-btn .icon { width: 16px; height: 16px; }
.state-note { margin: auto 0; color: var(--ink-2); font-size: .86rem; text-align: center; }
.state-note button { margin-top: 6px; }
.skeleton { border-radius: 10px; background: linear-gradient(90deg, var(--tile-2) 0%, var(--line) 50%, var(--tile-2) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.tile-remove {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  width: 28px; height: 28px; border-radius: 50%; border: 0;
  display: none; place-items: center;
  background: var(--ink); color: var(--tile);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}
.tile-remove .icon { width: 15px; height: 15px; stroke-width: 2.6; }
.tile-grip {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  width: 30px; height: 30px; border-radius: 50%;
  display: none; place-items: center; padding: 0;
  border: 1px solid var(--line);
  background: var(--tile-2); color: var(--ink-2);
  cursor: grab; touch-action: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
}
.tile-grip .icon { width: 16px; height: 16px; }
.is-editing .tile { cursor: grab; user-select: none; -webkit-user-select: none; animation: wiggle 2.8s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -.41s); }
.is-editing .tile-body, .is-editing .tile-head > *:not(.tile-label) { pointer-events: none; }
.is-editing .tile-remove, .is-editing .tile-grip { display: grid; }
.is-editing .tile-head { padding-left: 34px; }
.is-editing .tile:focus-visible { outline-offset: 3px; }
.tile.is-dragging { cursor: grabbing; z-index: 30; animation: none; scale: 1.04; box-shadow: 0 34px 70px -24px rgba(0, 0, 0, .6); transition: scale .15s ease, box-shadow .15s ease; }
.tile.is-new { animation: arrive .7s cubic-bezier(.2, .8, .2, 1); }
@keyframes wiggle { 0%, 100% { rotate: -.32deg; } 50% { rotate: .32deg; } }
@keyframes arrive { from { scale: .85; opacity: 0; } to { scale: 1; opacity: 1; } }

/* 6. Widgets ---------------------------------------------- */
/* Clock */
.w-clock .tile-body { align-items: center; justify-content: center; gap: 7px; }
.clock-svg { width: 90px; height: 90px; }
.clock-face { fill: var(--tile-2); stroke: var(--line); stroke-width: 1; }
.clock-tick { stroke: var(--ink-2); stroke-width: 1.3; stroke-linecap: round; }
.clock-tick.major { stroke: var(--ink); stroke-width: 2.4; }
.hand-h { stroke: var(--ink); stroke-width: 3.8; stroke-linecap: round; }
.hand-m { stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; }
.hand-s { stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; }
.clock-pin { fill: var(--accent); }
.clock-time { font: 720 1.08rem/1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.clock-zone { margin-top: -3px; font-size: .76rem; color: var(--ink-2); }

/* Weather */
.wx { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 14px; align-items: center; }
.wx-now { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wx-row { display: flex; align-items: center; gap: 8px; }
.wx-temp { font: 760 3rem/.95 var(--font-display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.wx-big-icon { width: 40px; height: 40px; }
.wx-cond { font-weight: 650; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wx-feels { font-size: .78rem; line-height: 1.35; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wx-hours { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding: 10px 6px; border-radius: 16px; background: var(--tile-2); }
.wx-hour { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.wx-hour small { font-size: .7rem; font-weight: 650; color: var(--ink-2); white-space: nowrap; }
.wx-hour b { font: 700 .92rem/1 var(--font-display); font-variant-numeric: tabular-nums; }
.wx-icon { width: 26px; height: 26px; }
.wxi-sun { fill: #F7B13C; }
.wxi-ray { stroke: #F7B13C; stroke-width: 2; stroke-linecap: round; }
.wxi-moon { fill: #E7E1C8; }
:root[data-theme="light"] .wxi-moon { fill: #8C8FB8; }
.wxi-cloud { fill: #FFFFFF; stroke: #9AA4B8; stroke-width: 1.4; }
:root[data-theme="dark"] .wxi-cloud { fill: #CBD2E6; stroke: #8D97B6; }
.wxi-drop { stroke: #4C8FDB; stroke-width: 2; stroke-linecap: round; }
.wxi-bolt { fill: #F5A524; }
.wxi-snow { fill: #8DB8E8; }
.wxi-fog { stroke: #9AA4B8; stroke-width: 2; stroke-linecap: round; }
.wx-place { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.wx-place .icon { width: 13px; height: 13px; }

/* Air quality */
.w-aqi .tile-body { align-items: center; justify-content: center; gap: 2px; }
.aqi-gauge { height: 58px; width: auto; max-width: 100%; flex: none; overflow: visible; }
.aqi-needle { stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; transform-origin: 60px 58px; transition: rotate 1.4s cubic-bezier(.2, .9, .25, 1.1); }
.aqi-hub { fill: var(--ink); }
.aqi-read { display: flex; align-items: baseline; gap: 7px; }
.aqi-num { font: 800 1.6rem/1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.aqi-cat { font-size: .84rem; font-weight: 750; }
.aqi-note { font-size: .74rem; color: var(--ink-2); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* Tasks */
.task-list { list-style: none; margin: 0; padding: 0; flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 2px; scrollbar-width: thin; }
.task { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 12px; transition: opacity .3s ease; }
.task:hover { background: var(--tile-2); }
.task-check {
  width: 22px; height: 22px; flex: none; border-radius: 50%;
  border: 2px solid var(--ink-2); background: transparent;
  display: grid; place-items: center; padding: 0;
  transition: background .2s ease, border-color .2s ease;
}
.task-check .icon { width: 13px; height: 13px; stroke-width: 3; opacity: 0; transform: scale(.5); transition: opacity .2s ease, transform .25s cubic-bezier(.3, 1.6, .5, 1); color: var(--on-accent); }
.task.is-done .task-check { background: var(--accent); border-color: var(--accent); }
.task.is-done .task-check .icon { opacity: 1; transform: scale(1); }
.task-text { flex: 1; min-width: 0; font-weight: 550; overflow-wrap: anywhere; transition: color .3s ease; }
.task.is-done .task-text { color: var(--ink-2); text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--accent); }
.task-del { opacity: 0; }
.task:hover .task-del, .task-del:focus-visible { opacity: 1; }
.task-add { margin-top: 8px; display: flex; gap: 8px; }
.task-add input { flex: 1; min-width: 0; height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--tile-2); color: var(--ink); }
.task-add button { width: 40px; height: 40px; border-radius: 12px; border: 0; display: grid; place-items: center; background: var(--ink); color: var(--tile); }
.empty-tasks { margin: auto; color: var(--ink-2); font-size: .9rem; text-align: center; }

/* Notes */
.notes-area {
  flex: 1; min-height: 0; width: 100%;
  resize: none; border: 0; outline: none;
  background: transparent; color: var(--ink);
  font-size: .95rem; line-height: 26px;
  background-image: repeating-linear-gradient(180deg, transparent 0 25px, var(--line) 25px 26px);
  background-attachment: local;
  padding: 0 2px;
}
.notes-area::placeholder { color: var(--ink-2); }

/* Focus timer */
.w-focus .tile-body { flex-direction: row; align-items: center; justify-content: center; gap: 14px; }
.ring { position: relative; width: 92px; height: 92px; flex: none; }
.ring svg { width: 100%; height: 100%; rotate: -90deg; }
.ring-track { fill: none; stroke: var(--tile-2); stroke-width: 7; }
.ring-fill { fill: none; stroke: var(--accent); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset .4s linear; }
.ring-text { position: absolute; inset: 0; display: grid; place-items: center; font: 760 1.2rem/1 var(--font-display); font-variant-numeric: tabular-nums; }
.focus-ctrls { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.round-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); }
.round-btn .icon { width: 20px; height: 20px; }
.round-btn.small { width: 34px; height: 34px; background: var(--tile-2); color: var(--ink-2); }
.round-btn.small .icon { width: 16px; height: 16px; }
.w-focus.is-break .ring-fill { stroke: var(--good); }

/* Countdown */
.cd { flex: 1; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.cd-big { font: 800 2.7rem/1 var(--font-display); letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.cd-big small { font-size: .45em; letter-spacing: 0; color: var(--ink-2); font-weight: 700; margin-left: 4px; }
.cd-title { margin-top: 8px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-date { font-size: .78rem; color: var(--ink-2); }
.cd-form { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.cd-form input { height: 32px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--tile-2); color: var(--ink); font-size: .88rem; min-width: 0; width: 100%; }
.cd-form button { height: 30px; border-radius: 9px; border: 0; background: var(--ink); color: var(--tile); font-weight: 700; font-size: .85rem; }

/* Shortcuts */
.sc-grid { list-style: none; margin: 0; padding: 0; flex: 1; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; align-content: center; }
.sc { position: relative; min-width: 0; }
.sc a { display: flex; flex-direction: column; align-items: center; gap: 7px; text-decoration: none; padding: 6px 2px; border-radius: 14px; }
.sc a:hover { background: var(--tile-2); }
.sc-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #FFFFFF; font: 760 1.15rem/1 var(--font-display); box-shadow: 0 6px 14px -8px rgba(0, 0, 0, .5); }
.sc-name { max-width: 100%; font-size: .7rem; font-weight: 650; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-del { position: absolute; top: -2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: 0; display: none; place-items: center; background: var(--ink); color: var(--tile); padding: 0; }
.sc-del .icon { width: 11px; height: 11px; stroke-width: 3; }
.w-shortcuts.is-managing .sc-del { display: grid; }
.sc-form { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 6px; align-content: center; }
.sc-form input { height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--tile-2); color: var(--ink); min-width: 0; font-size: .88rem; }
.sc-form button { height: 36px; padding: 0 12px; border-radius: 10px; border: 0; background: var(--ink); color: var(--tile); font-weight: 700; font-size: .85rem; }

/* Tech news */
.w-news .tile-head { margin-bottom: 6px; }
.news-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.news-item { display: flex; flex-direction: column; gap: 0; padding: 2px 6px; margin: 0 -6px; border-radius: 10px; text-decoration: none; min-width: 0; }
.news-item:hover { background: var(--tile-2); }
.news-title { font-size: .88rem; font-weight: 650; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.news-meta { font-size: .72rem; line-height: 1.3; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.news-meta b { color: var(--accent-ink); font-weight: 700; }

/* Battery */
.w-battery .tile-body { align-items: center; justify-content: center; gap: 8px; }
.w-battery .ring { width: 80px; height: 80px; }
.w-battery .ring-text { font-size: 1.1rem; }
.bat-status { font-size: .78rem; color: var(--ink-2); text-align: center; }
.w-battery.is-low .ring-fill { stroke: var(--danger); }
.w-battery.is-charging .ring-fill { stroke: var(--good); }

/* The AI voice assistant tile */
.w-aura {
  background: radial-gradient(130% 95% at 25% 10%, #3D3184 0%, #1D1D4B 55%, #101230 100%);
  color: #F5F2FF;
  border-color: rgba(255, 255, 255, .08);
}
.w-aura .tile-label { color: rgba(245, 242, 255, .7); }
.w-aura .tile-body { justify-content: space-between; }
.aura-top { display: flex; align-items: center; justify-content: space-between; }
.w-aura .orb { width: 42px; height: 42px; box-shadow: 0 0 26px 6px rgba(247, 177, 60, .38); animation: breathe 3.4s ease-in-out infinite; }
.live-badge { display: inline-flex; align-items: center; gap: 6px; font-size: .68rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: rgba(245, 242, 255, .8); }
.live-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #5CE08B; box-shadow: 0 0 0 3px rgba(92, 224, 139, .22); }
.aura-name { margin: 0; font: 760 1.25rem/1.1 var(--font-display); letter-spacing: -.02em; }
.aura-sub { margin: 2px 0 0; font-size: .78rem; color: rgba(245, 242, 255, .72); }
.call-btn {
  margin-top: 10px; width: 100%; height: 38px;
  border-radius: 999px; border: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: #F7B13C; color: #2A1800;
  font-weight: 760; font-size: .92rem;
}
.call-btn .icon { width: 16px; height: 16px; }
@keyframes breathe { 0%, 100% { scale: 1; } 50% { scale: 1.08; } }

/* 7. Dialogs and forms ------------------------------------ */
dialog {
  width: min(540px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 0; border: 0; border-radius: 26px;
  background: var(--tile); color: var(--ink);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .65);
  overflow: auto;
}
dialog::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.dlg { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dlg-title { margin: 0; font: 760 1.4rem/1.1 var(--font-display); letter-spacing: -.02em; }
.dlg-text { margin: 0; color: var(--ink-2); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.icon-btn { width: 36px; height: 36px; border-radius: 11px; border: 0; display: grid; place-items: center; background: var(--tile-2); color: var(--ink-2); }
.icon-btn:hover { color: var(--ink); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 16px;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--tile-2); color: var(--ink);
  font-weight: 650; font-size: .92rem; white-space: nowrap;
}
.btn .icon { width: 16px; height: 16px; }
.btn-ink { background: var(--ink); color: var(--tile); border-color: transparent; }
.btn-big { width: 100%; height: 48px; border-radius: 14px; font-size: 1rem; }
.btn:disabled { opacity: .55; cursor: default; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: .85rem; font-weight: 650; color: var(--ink-2); }
.field input, .input {
  width: 100%; height: 44px; padding: 0 13px;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--tile-2); color: var(--ink);
  font-size: 1rem; font-weight: 500;
}
.input-name { width: min(220px, 100%); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.set-block { display: flex; flex-direction: column; gap: 10px; padding: 13px 0 0; border-top: 1px solid var(--line); }
.set-label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.set-label small { color: var(--ink-2); font-size: .82rem; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--tile-2); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 7px 13px; border-radius: 9px; font-weight: 650; font-size: .86rem; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--tile); color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .14); }
.city-row { display: flex; gap: 8px; flex-wrap: wrap; }
.city-row .input { flex: 1 1 180px; }
.city-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.city-results:empty { display: none; }
.city-results button { width: 100%; text-align: left; border: 0; border-radius: 10px; padding: 9px 12px; background: var(--tile-2); }
.city-results button:hover { background: var(--accent-soft); }
.city-results small { color: var(--ink-2); }
.city-now { margin: 0; font-size: .86rem; color: var(--ink-2); }
.city-now strong { color: var(--ink); }
.add-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.add-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: var(--tile-2); }
.add-ico { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font: 760 1rem/1 var(--font-display); }
.add-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.add-text small { color: var(--ink-2); font-size: .82rem; }
.add-empty { margin: 4px 0; color: var(--ink-2); }

/* 8. The live call ---------------------------------------- */
dialog.call {
  width: 100vw; height: 100vh; height: 100dvh;
  max-width: 100vw; max-height: 100dvh;
  margin: 0; border-radius: 0;
  background: radial-gradient(120% 80% at 50% 28%, #2C256A 0%, #131535 55%, #07081A 100%);
  color: #F5F2FF;
}
dialog.call::backdrop { background: #07081A; }
.call-inner {
  min-height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center;
  padding-block: max(32px, env(safe-area-inset-top, 0px)) max(32px, env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.call-kicker { margin: 0 0 8px; font-size: .74rem; font-weight: 750; letter-spacing: .24em; text-transform: uppercase; color: rgba(245, 242, 255, .62); }
.call-orb { position: relative; width: 240px; height: 240px; display: grid; place-items: center; margin-bottom: 6px; }
.call-orb .orb { position: relative; z-index: 1; width: 150px; height: 150px; box-shadow: 0 0 90px 24px rgba(247, 177, 60, .32); animation: breathe 3.6s ease-in-out infinite; }
.call-orb .ring { position: absolute; inset: 45px; border-radius: 50%; border: 2px solid rgba(247, 177, 60, .5); opacity: 0; animation: ripple 3.6s ease-out infinite; }
.call-orb .r2 { animation-delay: 1.2s; }
.call-orb .r3 { animation-delay: 2.4s; }
.call[data-state="connecting"] .ring { animation-duration: 2s; }
.call[data-state="live"] .orb { animation-duration: 2s; }
.call[data-talking="true"] .orb { animation-duration: 1.1s; }
.call[data-talking="true"] .ring { animation-duration: 1.7s; }
.call[data-state="error"] .orb, .call[data-state="ended"] .orb { animation: none; filter: saturate(.35) brightness(.8); }
.call[data-state="error"] .ring, .call[data-state="ended"] .ring { animation: none; opacity: 0; }
@keyframes ripple { 0% { scale: .9; opacity: .6; } 100% { scale: 1.75; opacity: 0; } }
.call-name { margin: 0; font: 780 2.5rem/1 var(--font-display); letter-spacing: -.035em; }
.call-status { margin: 0; font-size: 1.05rem; font-weight: 600; color: rgba(245, 242, 255, .86); max-width: 34ch; }
.call-timer { margin: 0; font: 700 1.15rem/1 var(--font-display); font-variant-numeric: tabular-nums; color: rgba(245, 242, 255, .7); }
.call-hint { margin: 4px 0 0; font-size: .92rem; color: rgba(245, 242, 255, .58); max-width: 32ch; }
.call-actions { margin-top: 26px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.call-share-btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 58px; padding: 0 24px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .24);
  background: rgba(255, 255, 255, .1); color: #FFFFFF;
  font-weight: 760; font-size: 1.02rem;
}
.call-share-btn .icon { width: 21px; height: 21px; }
.call-share-btn[aria-pressed="true"] { background: #F7B13C; border-color: transparent; color: #2A1800; }
.call-share {
  position: relative; margin-top: 12px;
  width: min(380px, 84vw); aspect-ratio: 16 / 9;
  border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .2);
  background: #000000;
  box-shadow: 0 20px 44px -20px rgba(0, 0, 0, .9);
}
.call-share video { display: block; width: 100%; height: 100%; object-fit: contain; }
.call-share-label {
  position: absolute; left: 10px; top: 10px;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; border-radius: 999px;
  background: rgba(7, 8, 26, .72); color: #FFFFFF;
  font-size: .74rem; font-weight: 700;
}
.call-share-label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #F2685B; box-shadow: 0 0 0 3px rgba(242, 104, 91, .25); }
/* While sharing, the orb gets smaller so the screen preview fits */
.call.is-sharing .call-orb { width: 150px; height: 150px; }
.call.is-sharing .call-orb .orb { width: 92px; height: 92px; box-shadow: 0 0 60px 14px rgba(247, 177, 60, .3); }
.call.is-sharing .call-orb .ring { inset: 29px; }
.call.is-sharing .call-name { font-size: 2rem; }
.call-end {
  display: inline-flex; align-items: center; gap: 10px;
  height: 58px; padding: 0 30px; border-radius: 999px; border: 0;
  background: #E5484D; color: #FFFFFF;
  font-weight: 760; font-size: 1.02rem;
  box-shadow: 0 16px 34px -14px rgba(229, 72, 77, .8);
}
.call-end .icon { width: 22px; height: 22px; rotate: 135deg; }
.call[data-state="error"] .call-end, .call[data-state="ended"] .call-end { background: rgba(255, 255, 255, .14); box-shadow: none; }
.call[data-state="error"] .call-end .icon, .call[data-state="ended"] .call-end .icon { display: none; }

/* 9. Toast ------------------------------------------------ */
.toast {
  position: fixed; left: 50%; z-index: 60;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  translate: -50% 16px; opacity: 0;
  max-width: calc(100vw - 32px);
  padding: 11px 18px; border-radius: 999px;
  background: var(--ink); color: var(--tile);
  font-size: .9rem; font-weight: 650;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .5);
  pointer-events: none;
  transition: opacity .25s ease, translate .25s ease;
}
.toast.show { opacity: 1; translate: -50% 0; }

/* 10. Phones, tablets and reduced motion ------------------ */
@media (max-width: 1080px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .app { padding-block: 22px 32px; }
  .top { align-items: flex-start; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 172px; gap: 12px; }
  .tile { padding: 14px; border-radius: 20px; }
  .wx-temp { font-size: 2.5rem; }
  .wx-hours { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .wx-hour:nth-child(5) { display: none; }
  .sc-icon { width: 40px; height: 40px; border-radius: 13px; }
  .sc-name { font-size: .66rem; }
  .aqi-gauge { height: 54px; }
  .search { height: 50px; margin-top: 18px; }
  .search kbd { display: none; }
}
@media (max-width: 420px) {
  .pill-accent span { display: none; }
  .pill-accent { width: 40px; padding: 0; justify-content: center; }
  .w-focus .tile-body { gap: 10px; }
  .ring { width: 84px; height: 84px; }
}
@media (prefers-reduced-motion: reduce) {
  .is-editing .tile, .w-aura .orb, .call-orb .orb, .call-orb .ring, .skeleton, .tile.is-new { animation: none !important; }
  .orbiter, .aqi-needle, .ring-fill { transition: none; }
}
