/* Layout: blurred header with large title → place/time/date controls → floor plan + seat panel (bottom sheet on phones); tab bar at the bottom on phones.
   Palette: calm neutrals, pastel status fills with deep inks for text. Theme follows time of day (light 7:00–20:00) unless chosen in profile. */
:root {
  --bg: #F4F5F7;
  --surface: #FFFFFF;
  --ink: #23262B;
  --muted: #6B7079;
  --line: #E6E8EC;
  --fill: #ECEEF1;
  --fill-2: #F5F6F8;
  --accent: #4F7FD9;
  --accent-soft: #E3EBFA;
  --free: #CDEAD7; --free-ink: #2E7A50;
  --part: #F6E3BC; --part-ink: #93650F;
  --busy: #F4D2CD; --busy-ink: #A1473D;
  --mine: #D5E2F8; --mine-ink: #2D5BB0;
  --locked: #E4E6EA; --locked-ink: #7B818B;
  --room-a: #F3F7EF;
  --room-b: #EFF3FA;
  --wall: #D3D7DE;
  --decor: #E3E6EA;
  --printer: #DDD5F2;
  --window: #AECBEF;
  --plant: #B9DCC2;
  --av1: #6F8FC4; --av2: #C98078; --av3: #6FA483; --av4: #9A86C6; --av5: #C99B5E; --av6: #5FA3AE;
  --shadow: 0 1px 2px rgba(20,24,32,.05), 0 6px 20px rgba(20,24,32,.06);
  --f-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-app-theme="light"]) {
    --bg: #15171B; --surface: #1F2227; --ink: #E7E9EC; --muted: #9AA0A9; --line: #30343B; --fill: #2A2E34; --fill-2: #24272C;
    --accent: #7FA4EA; --accent-soft: #263552;
    --free: #23402E; --free-ink: #95D6AE; --part: #463920; --part-ink: #EBC57E; --busy: #482B28; --busy-ink: #F2A79E;
    --mine: #233453; --mine-ink: #A3C0F6; --locked: #2C2F35; --locked-ink: #8E949D;
    --room-a: #1B211C; --room-b: #1A1F28; --wall: #3C4048; --decor: #2E3238; --printer: #4A4363; --window: #3B5F8C; --plant: #3D6448;
    --av1: #5E7FB4; --av2: #B4675F; --av3: #5B8F6E; --av4: #8572B3; --av5: #B3874A; --av6: #4D8F99;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"], :root[data-app-theme="dark"] {
  --bg: #15171B; --surface: #1F2227; --ink: #E7E9EC; --muted: #9AA0A9; --line: #30343B; --fill: #2A2E34; --fill-2: #24272C;
  --accent: #7FA4EA; --accent-soft: #263552;
  --free: #23402E; --free-ink: #95D6AE; --part: #463920; --part-ink: #EBC57E; --busy: #482B28; --busy-ink: #F2A79E;
  --mine: #233453; --mine-ink: #A3C0F6; --locked: #2C2F35; --locked-ink: #8E949D;
  --room-a: #1B211C; --room-b: #1A1F28; --wall: #3C4048; --decor: #2E3238; --printer: #4A4363; --window: #3B5F8C; --plant: #3D6448;
  --av1: #5E7FB4; --av2: #B4675F; --av3: #5B8F6E; --av4: #8572B3; --av5: #B3874A; --av6: #4D8F99;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3);
  color-scheme: dark;
}
:root[data-app-theme="light"] {
  --bg: #F4F5F7; --surface: #FFFFFF; --ink: #23262B; --muted: #6B7079; --line: #E6E8EC; --fill: #ECEEF1; --fill-2: #F5F6F8;
  --accent: #4F7FD9; --accent-soft: #E3EBFA;
  --free: #CDEAD7; --free-ink: #2E7A50; --part: #F6E3BC; --part-ink: #93650F; --busy: #F4D2CD; --busy-ink: #A1473D;
  --mine: #D5E2F8; --mine-ink: #2D5BB0; --locked: #E4E6EA; --locked-ink: #7B818B;
  --room-a: #F3F7EF; --room-b: #EFF3FA; --wall: #D3D7DE; --decor: #E3E6EA; --printer: #DDD5F2; --window: #AECBEF; --plant: #B9DCC2;
  --av1: #6F8FC4; --av2: #C98078; --av3: #6FA483; --av4: #9A86C6; --av5: #C99B5E; --av6: #5FA3AE;
  --shadow: 0 1px 2px rgba(20,24,32,.05), 0 6px 20px rgba(20,24,32,.06);
  color-scheme: light;
}

html, body { background: var(--bg); color: var(--ink); }
body {
  font-family: var(--f-ui); font-size: 15px; line-height: 1.4; -webkit-font-smoothing: antialiased; letter-spacing: -.005em;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 48px;
  transition: background-color .4s;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
.wrap { max-width: 1120px; margin: 0 auto; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }

/* header */
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 8;
  margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px)));
  padding: 14px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
}
.top-in { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; gap: 16px; }
.top h1 { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin: 0; flex: 1; min-width: 0; text-wrap: balance; }
.me-btn { width: 36px; height: 36px; border-radius: 50%; color: #FFFFFF; font-size: 13px; font-weight: 600; display: grid; place-items: center; flex: 0 0 auto; }

/* nav: segmented on desktop, tab bar on phones */
.nav { display: inline-flex; background: var(--fill); border-radius: 9px; padding: 2px; gap: 2px; }
.nav.tabbar { display: none; }
.nav button { padding: 6px 13px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.nav button svg { display: none; }
.nav button[aria-current="page"] { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.1); font-weight: 600; }
.badge-n { background: var(--busy-ink); color: #FFFFFF; border-radius: 999px; font-size: 11px; font-weight: 700; min-width: 17px; height: 17px; display: inline-grid; place-items: center; padding: 0 5px; }

/* controls */
.controls { display: grid; gap: 14px; margin: 6px 0 16px; }
.row { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.pill {
  appearance: none; -webkit-appearance: none; background-color: var(--surface); border: 0; border-radius: 10px;
  padding: 8px 30px 8px 12px; font-weight: 500; max-width: 100%; box-shadow: 0 0 0 1px var(--line) inset;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238E8E93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.pill.sm { padding: 6px 26px 6px 10px; font-size: 14px; background-position: right 9px center; }
.time-pair { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.dates { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.dates::-webkit-scrollbar { display: none; }
.day { flex: 0 0 auto; width: 46px; display: grid; justify-items: center; gap: 4px; padding: 4px 0; border-radius: 12px; }
.day .wd { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.day .dn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; }
.day.today .dn { color: var(--accent); font-weight: 600; }
.day[aria-pressed="true"] .dn { background: var(--accent); color: #FFFFFF; font-weight: 600; }
.day:disabled { cursor: default; }
.day:disabled .dn { color: var(--locked-ink); opacity: .55; }
.day .dot { width: 4px; height: 4px; border-radius: 50%; background: transparent; }
.day.hol .dot { background: var(--busy-ink); }

/* layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.card { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); }
.mapcard { padding: 12px; }
.mapcard svg { width: 100%; height: auto; display: block; }
.mapfoot { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 10px 4px 2px; }
.summary { font-weight: 600; font-size: 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.dotc { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.callout { margin-top: 12px; padding: 14px 16px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.callout p { margin: 0; font-size: 14px; color: var(--muted); flex: 1; min-width: 220px; }
.callout b { display: block; font-size: 15px; color: var(--ink); }

/* buttons */
.btn { border-radius: 12px; padding: 11px 18px; font-weight: 600; font-size: 15px; background: var(--fill); color: var(--accent); text-align: center; }
.btn.primary { background: var(--accent); color: #FFFFFF; }
.btn.danger { background: var(--busy); color: var(--busy-ink); }
.btn.block { width: 100%; padding-block: 13px; }
.btn.sm { padding: 7px 12px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: .45; cursor: default; }
.link { color: var(--accent); font-weight: 500; font-size: 14px; padding: 4px 2px; }
.link.danger { color: var(--busy-ink); }

/* plan */
.wall { fill: none; stroke: var(--wall); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.thin { fill: none; stroke: var(--wall); stroke-width: 1.5; }
.jamb { stroke: var(--wall); stroke-width: 2; }
.win-r { fill: var(--window); }
.r-a { fill: var(--room-a); } .r-b { fill: var(--room-b); }
.decor { fill: var(--decor); }
.printer { fill: var(--printer); }
.plant { fill: var(--plant); }
.entry-pill { fill: var(--accent-soft); }
.entry-txt { fill: var(--accent); font: 600 12px var(--f-ui); }
.seat { cursor: pointer; }
.seat .d { stroke-width: 1.5; }
.seat.free .d { fill: var(--free); stroke: color-mix(in srgb, var(--free-ink) 35%, transparent); }
.seat.part .d { fill: var(--part); stroke: color-mix(in srgb, var(--part-ink) 35%, transparent); }
.seat.busy .d { fill: var(--busy); stroke: color-mix(in srgb, var(--busy-ink) 35%, transparent); }
.seat.mine .d { fill: var(--mine); stroke: color-mix(in srgb, var(--mine-ink) 45%, transparent); }
.seat.locked .d, .seat.off .d { fill: var(--locked); stroke: color-mix(in srgb, var(--locked-ink) 30%, transparent); }
.seat .ch { opacity: .75; }
.seat.free .seat-lbl { fill: var(--free-ink); } .seat.part .seat-lbl { fill: var(--part-ink); } .seat.busy .seat-lbl { fill: var(--busy-ink); }
.seat.mine .seat-lbl { fill: var(--mine-ink); } .seat.locked .seat-lbl, .seat.off .seat-lbl { fill: var(--locked-ink); }
.seat.sel .desk { stroke: var(--ink); stroke-width: 3; }
.seat:hover .desk { filter: brightness(.97); }
.seat:focus { outline: none; }
.seat:focus-visible .desk { stroke: var(--accent); stroke-width: 3.5; }
.pin circle { fill: var(--surface); opacity: .92; }
.pin rect { fill: var(--locked-ink); }
.pin path { fill: none; stroke: var(--locked-ink); stroke-width: 1.4; }
.rug { fill: color-mix(in srgb, var(--accent) 9%, transparent); stroke: color-mix(in srgb, var(--accent) 22%, transparent); stroke-width: 1.5; }
.solid { fill: var(--wall); }
.screen-r { fill: var(--locked-ink); }
.board { fill: var(--surface); stroke: var(--wall); stroke-width: 1.5; }
.lamp-in { fill: var(--part); }
.cool { fill: var(--window); }
.gridline { fill: none; stroke: var(--line); stroke-width: 1; }
.guide { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 5 4; }
.lg-ico { color: var(--locked-ink); }
.seat-lbl { font: 700 15px var(--f-ui); pointer-events: none; }
.av-txt { fill: #FFFFFF; font: 600 13px var(--f-ui); pointer-events: none; }
.star { fill: var(--part-ink); font-size: 13px; pointer-events: none; }

/* editor */
.edsvg { touch-action: none; user-select: none; -webkit-user-select: none; }
.ed-item { cursor: grab; }
.ed-item:active { cursor: grabbing; }
.ed-item .d { fill: var(--free); stroke: color-mix(in srgb, var(--free-ink) 35%, transparent); stroke-width: 1.5; }
.ed-item .seat-lbl { fill: var(--free-ink); }
.sel-box { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 6 4; }
.palette { display: flex; flex-wrap: wrap; gap: 6px; }
.pal-cat { display: grid; gap: 6px; }
.ed-sect { display: grid; gap: 6px; }
.tool { font-size: 13.5px; padding: 6px 11px; border-radius: 999px; background: var(--fill); font-weight: 500; }
.tool:hover { background: var(--accent-soft); color: var(--accent); }
.ed-panel { padding: 16px; display: grid; gap: 12px; }
.ed-panel h3 { margin: 0; font-size: 17px; }
.ed-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* seat panel */
.panel { padding: 18px; position: sticky; top: 120px; display: grid; gap: 16px; }
.grabber { display: none; width: 36px; height: 5px; border-radius: 3px; background: var(--locked-ink); opacity: .4; margin: -8px auto 0; }
.ph { display: flex; align-items: flex-start; gap: 10px; }
.ph h2 { font-size: 22px; font-weight: 700; letter-spacing: -.015em; margin: 0; }
.ph .where { color: var(--muted); font-size: 13.5px; margin: 2px 0 0; }
.x { margin-left: auto; width: 30px; height: 30px; border-radius: 50%; background: var(--fill); color: var(--muted); display: grid; place-items: center; flex: 0 0 auto; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12.5px; font-weight: 600; border-radius: 8px; padding: 4px 9px; background: var(--fill-2); color: var(--ink); }
.tl { position: relative; height: 30px; border-radius: 8px; background: var(--fill); overflow: hidden; }
.tl .b { position: absolute; top: 0; bottom: 0; background: var(--busy); color: var(--busy-ink); font-size: 11px; font-weight: 700; display: grid; place-items: center; overflow: hidden; white-space: nowrap; box-shadow: -1px 0 0 var(--surface) inset; }
.tl .b.mine { background: var(--mine); color: var(--mine-ink); }
.tl .b.owner { background: var(--locked); color: var(--locked-ink); }
.tl .f { position: absolute; top: 0; bottom: 0; background: var(--free); box-shadow: -1px 0 0 var(--surface) inset; }
.ticks { position: relative; height: 16px; margin-top: 4px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ticks span { position: absolute; transform: translateX(-50%); }
.ticks span:first-child { transform: none; } .ticks span:last-child { transform: translateX(-100%); }
.list { display: grid; border-radius: 12px; background: var(--fill-2); overflow: hidden; }
.li { display: flex; gap: 12px; align-items: center; padding: 10px 12px; flex-wrap: wrap; }
.li + .li { box-shadow: 0 -1px 0 var(--line); }
.av { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; color: #FFFFFF; font-size: 12px; font-weight: 600; flex: 0 0 auto; }
.li .t { flex: 1; min-width: 0; }
.li .nm { font-weight: 500; }
.li .sb { font-size: 13px; color: var(--muted); }
.li .acts { display: flex; gap: 10px; }
.edit-row { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-left: 44px; }
.sect { display: grid; gap: 10px; }
.sect-h { font-size: 13px; color: var(--muted); font-weight: 500; }
.freeline { font-weight: 600; color: var(--free-ink); font-size: 15px; }
.note { font-size: 14px; color: var(--muted); margin: 0; }
.msg { font-size: 14px; border-radius: 12px; padding: 10px 12px; margin: 0; }
.msg.err { background: var(--busy); color: var(--busy-ink); }
.msg.ok { background: var(--free); color: var(--free-ink); }
.field { display: grid; grid-template-columns: 90px minmax(0, 1fr); align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.field .pill { width: 100%; }
.empty-panel h2 { font-size: 17px; margin: 0 0 4px; }
.empty-panel p { margin: 0; color: var(--muted); font-size: 14px; }
.backdrop { display: none; }

/* pages */
.page { display: grid; gap: 22px; max-width: 720px; margin-top: 6px; }
.page.wide { max-width: none; }
.group { display: grid; gap: 6px; }
.group-h { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding-left: 16px; font-weight: 500; }
.group-f { font-size: 13px; color: var(--muted); padding-inline: 16px; margin: 0; }
.rows { background: var(--surface); border-radius: 14px; overflow: hidden; }
.r { display: flex; gap: 12px; align-items: center; padding: 11px 16px; flex-wrap: wrap; min-height: 44px; }
.r + .r { box-shadow: 0 -1px 0 var(--line); }
.r .t { flex: 1; min-width: 180px; }
.r .tt { font-weight: 500; }
.r .ts { font-size: 13px; color: var(--muted); }
.r input[type="text"], .r input[type="date"], .ed-panel input[type="text"] { background: var(--fill-2); border: 0; border-radius: 9px; padding: 8px 10px; min-width: 0; max-width: 100%; }
.r input.grow { flex: 1; }
.r.warn { background: var(--busy); color: var(--busy-ink); }
.r.warn .ts { color: var(--busy-ink); }
.r.sub-row { background: var(--fill-2); }
.code { font: 13px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--fill); border-radius: 8px; padding: 6px 9px; word-break: break-all; user-select: all; }
.dot-new { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.chip { font-size: 13px; padding: 5px 11px; border-radius: 999px; background: var(--fill-2); font-weight: 500; }
.chip[aria-pressed="true"] { background: var(--accent); color: #FFFFFF; }
.seg { display: inline-flex; background: var(--fill); border-radius: 9px; padding: 2px; flex-wrap: wrap; }
.seg button { padding: 6px 14px; border-radius: 7px; font-size: 14px; font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.1); font-weight: 600; }

/* modal (profile) */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.32); z-index: 40; }
.modal { position: fixed; z-index: 41; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100% - 32px)); padding: 20px; display: grid; gap: 18px; max-height: 85vh; overflow-y: auto; }
.modal h2 { margin: 0; font-size: 20px; }

#toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  background: color-mix(in srgb, var(--ink) 92%, transparent); color: var(--bg); padding: 11px 16px; border-radius: 14px; font-size: 14px;
  max-width: calc(100% - 32px); width: max-content; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
#toast[hidden] { display: none; }
#toast button { color: var(--accent-soft); font-weight: 700; white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 880px) {
  body { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .top h1 { font-size: 28px; }
  .top .nav { display: none; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .nav.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; border-radius: 0; gap: 0; display: flex; justify-content: space-around;
    padding: 6px max(4px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-left, 0px));
    background: color-mix(in srgb, var(--surface) 86%, transparent); box-shadow: 0 -1px 0 var(--line);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  }
  .tabbar button { flex-direction: column; gap: 2px; font-size: 10px; color: var(--muted); padding: 4px 2px; position: relative; flex: 1; min-width: 0; }
  .tabbar button span:not(.badge-n) { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tabbar button svg { display: block; }
  .tabbar button[aria-current="page"] { background: transparent; box-shadow: none; color: var(--accent); }
  .tabbar .badge-n { position: absolute; top: 0; left: calc(50% + 6px); }
  .panel {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 35; max-height: 82vh; overflow-y: auto; border-radius: 16px 16px 0 0;
    padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    transform: translateY(105%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
  }
  .panel.open { transform: none; }
  .grabber { display: block; }
  .backdrop.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.28); z-index: 34; }
  #toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) { .panel, body { transition: none; } }

/* ---- app shell additions (outside the artifact skeleton) ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; padding-top: env(safe-area-inset-top, 0px); }
/* App-like behaviour: no page zoom, no sideways page scroll, no rubber-band when nothing scrolls */
html, body { overflow-x: clip; overscroll-behavior: none; }
body { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
@media (max-width: 880px) { input, select, textarea { font-size: 16px !important; } }
img { max-width: 100%; }
[hidden] { display: none !important; }
.login { min-height: 70vh; min-height: 70dvh; display: grid; place-items: center; }
.login-card { width: min(420px, 100%); padding: 28px 24px; display: grid; gap: 16px; text-align: center; }
.login-card h1 { margin: 0; font-size: 28px; letter-spacing: -.02em; }
.login-card .logo { width: 64px; height: 64px; margin: 0 auto; border-radius: 16px; }
.login-card input { font-size: 18px; text-align: center; letter-spacing: .08em; text-transform: uppercase; padding: 12px; border-radius: 12px; border: 0; background: var(--fill-2); box-shadow: 0 0 0 1px var(--line) inset; }
.banner { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); margin-bottom: 14px; }
.banner p { margin: 0; flex: 1; min-width: 220px; font-size: 14px; }
.banner b { display: block; font-size: 15px; }
.banner .code { display: inline-block; margin-top: 4px; }
.offline { position: fixed; left: 50%; transform: translateX(-50%); top: calc(8px + env(safe-area-inset-top, 0px)); z-index: 70; background: var(--part); color: var(--part-ink); padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.update { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 61; background: var(--surface); box-shadow: var(--shadow); border-radius: 14px; padding: 10px 14px; display: flex; gap: 12px; align-items: center; font-size: 14px; max-width: calc(100% - 32px); }
.link-box { display: grid; gap: 8px; }
@media (max-width: 880px) { .update { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); } }

/* employees grouped by department */
.search { width: 100%; background: var(--surface); border: 0; border-radius: 12px; padding: 10px 14px; box-shadow: 0 0 0 1px var(--line) inset; margin-bottom: 2px; }
.grp-h { background: var(--fill-2); min-height: 38px; padding-block: 8px; }
.grp-h .tt { font-weight: 600; flex: 1; }
.emp-group + .emp-group .grp-h, .emp + .emp .emp-row { box-shadow: 0 -1px 0 var(--line); }
.emp-row { width: 100%; text-align: left; background: none; }
.emp-row:hover { background: var(--fill-2); }
.emp-row .chev { color: var(--locked-ink); font-size: 20px; transition: transform .15s; }
.emp-row[aria-expanded="true"] .chev { transform: rotate(90deg); }
.emp-acts { gap: 8px; }
/* first-run tour */
.tour { text-align: center; gap: 12px; padding: 24px 22px 20px; }
.tour h2 { font-size: 21px; letter-spacing: -.01em; }
.tour .note { font-size: 15px; line-height: 1.45; }
.tour-art { display: grid; place-items: center; min-height: 96px; background: var(--fill-2); border-radius: 14px; padding: 12px; }
.tour-art svg { max-width: 100%; height: auto; font-family: var(--f-ui); }
.tour-dots { display: flex; justify-content: center; gap: 6px; }
.tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--locked); }
.tour-dots i.on { background: var(--accent); width: 18px; border-radius: 3px; }
.tour-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tour-nav .btn.primary { min-width: 120px; }
.add-row input { flex: 1 1 200px; }
.add-row .btn { flex: 0 0 auto; }

/* map zoom */
.mapcard { position: relative; }
.mapwin { overflow: hidden; border-radius: 10px; }
.mapwin svg { touch-action: pan-y; }
.mapcard.zoomed .mapwin svg { touch-action: none; }
.zoom-ctl { position: absolute; top: 18px; right: 18px; display: grid; gap: 1px; background: var(--line); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); z-index: 2; }
.zoom-ctl button { width: 36px; height: 34px; background: var(--surface); color: var(--ink); font-size: 19px; font-weight: 500; display: grid; place-items: center; }
.zoom-ctl button:disabled { color: var(--locked-ink); }
/* scrollbars only where content overflows, thin and quiet */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 40%, transparent); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }
.panel, .modal { overscroll-behavior: contain; }

/* ---- motion & polish: iOS-like curves, quiet transitions, pressed states ---- */
:root { --ease: cubic-bezier(.32, .72, 0, 1); --ease-out: cubic-bezier(.2, .8, .2, 1); }
.top h1 { font-family: -apple-system-headline, -apple-system, BlinkMacSystemFont, "SF Pro Display", var(--f-ui); }
.btn, .chip, .tool, .day, .nav button, .seg button, .x, .link, .zoom-ctl button, .emp-row, .me-btn {
  transition: transform .18s var(--ease-out), background-color .25s, color .25s, box-shadow .25s, opacity .2s;
}
.btn:active:not(:disabled), .chip:active, .tool:active, .seg button:active, .x:active, .zoom-ctl button:active:not(:disabled), .me-btn:active { transform: scale(.96); }
.day:active:not(:disabled) .dn, .nav button:active { transform: scale(.94); }
.day .dn { transition: background-color .3s var(--ease), color .3s, transform .18s var(--ease-out); }
.btn.primary { box-shadow: 0 1px 2px color-mix(in srgb, var(--accent) 30%, transparent), 0 4px 14px color-mix(in srgb, var(--accent) 22%, transparent); }
@media (hover: hover) { .btn.primary:hover:not(:disabled) { filter: brightness(1.05); } .btn:not(.primary):hover:not(:disabled) { background-color: color-mix(in srgb, var(--fill) 70%, var(--accent-soft)); } }
.card { transition: box-shadow .3s; }
:root[data-app-theme="dark"] .card, :root[data-theme="dark"] .card { box-shadow: var(--shadow), 0 0 0 .5px rgba(255,255,255,.06) inset; }

/* plan: colours fade instead of jumping */
.seat .d { transition: fill .35s var(--ease), stroke .35s var(--ease), stroke-width .25s var(--ease); }
.seat-lbl, .star { transition: fill .35s; }
.seat:active .desk { filter: brightness(.94); }
.mapwin svg { animation: fade-in .35s var(--ease) both; }
.tl .b, .tl .f { transition: left .35s var(--ease), width .35s var(--ease), background-color .3s; }

/* screens and panels appear softly */
@keyframes fade-in { from { opacity: 0; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes pop-in { from { opacity: 0; transform: translate(-50%, -48%) scale(.96); } }
@keyframes pop-out { to { opacity: 0; transform: translate(-50%, -49%) scale(.97); } }
@keyframes fade-out { to { opacity: 0; } }
.screen { animation: rise-in .38s var(--ease) backwards; }
.panel-body { display: grid; gap: 16px; animation: rise-in .3s var(--ease) backwards; }
.modal-back { animation: fade-in .25s var(--ease) both; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.modal { animation: pop-in .38s var(--ease) both; }
#overlay.closing .modal { animation: pop-out .2s var(--ease-out) both; }
#overlay.closing .modal-back { animation: fade-out .2s var(--ease-out) both; }
.tour-step { display: grid; gap: 12px; animation: rise-in .32s var(--ease) both; }
.tour-dots i { transition: width .35s var(--ease), background-color .3s; }
.steps { margin: 0; padding-left: 22px; display: grid; gap: 10px; animation: rise-in .3s var(--ease) both; }
.steps li { padding-left: 4px; line-height: 1.45; }
.steps li::marker { color: var(--accent); font-weight: 700; }
.banner, .callout { animation: rise-in .35s var(--ease) backwards; }

/* toast slides up */
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 14px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, 8px); } }
#toast.in { animation: toast-in .38s var(--ease) both; }
#toast.out { animation: toast-out .22s var(--ease-out) both; }
.update:not([hidden]) { animation: toast-in .4s var(--ease) both; }

/* bottom sheet on phones: iOS curve, follows the finger */
@media (max-width: 880px) {
  .panel { transition: transform .5s var(--ease); will-change: transform; }
  .panel.dragging { transition: none; }
  .backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.28); z-index: 34; opacity: 0; pointer-events: none; transition: opacity .4s var(--ease); }
  .backdrop.open { opacity: 1; pointer-events: auto; }
}

/* screen-to-screen cross-fade (View Transitions) */
::view-transition-old(root) { animation: fade-out .18s var(--ease-out) both; }
::view-transition-new(root) { animation: fade-in .28s var(--ease) both; }

/* greeting on launch */
.greet { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; text-align: center; cursor: pointer;
  background: var(--bg); color: var(--ink); animation: fade-in .3s var(--ease) both; }
.greet::before { content: ""; position: absolute; inset: 0; opacity: .9; pointer-events: none;
  background: radial-gradient(120% 70% at 50% 0%, var(--g1) 0%, transparent 62%), radial-gradient(90% 60% at 100% 100%, var(--g2) 0%, transparent 60%); }
.greet.g-morning { --g1: color-mix(in srgb, #F6C98B 45%, transparent); --g2: color-mix(in srgb, #A9C6F2 35%, transparent); }
.greet.g-day { --g1: color-mix(in srgb, #9CC3F5 45%, transparent); --g2: color-mix(in srgb, #BFE3CB 35%, transparent); }
.greet.g-evening { --g1: color-mix(in srgb, #E9A3A0 38%, transparent); --g2: color-mix(in srgb, #A99CE0 35%, transparent); }
.greet.g-night { --g1: color-mix(in srgb, #4E63A8 40%, transparent); --g2: color-mix(in srgb, #2E3F6E 40%, transparent); }
.greet-in { position: relative; display: grid; gap: 10px; justify-items: center; max-width: 420px; }
.greet-in > * { animation: rise-in .6s var(--ease) both; }
.greet-in > :nth-child(2) { animation-delay: .08s; } .greet-in > :nth-child(3) { animation-delay: .16s; }
.greet-logo { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 10px 30px rgba(30,50,90,.18); margin-bottom: 6px; }
.greet h1 { margin: 0; font-size: clamp(32px, 8vw, 44px); line-height: 1.08; letter-spacing: -.03em; font-weight: 700; text-wrap: balance; }
.greet p { margin: 0; font-size: 17px; color: var(--muted); text-wrap: balance; }
.greet-w { display: inline-flex; gap: 8px; align-items: center; min-height: 26px; opacity: 0; transition: opacity .4s var(--ease), transform .4s var(--ease); transform: translateY(4px); color: var(--ink) !important; font-weight: 500; }
.greet-w.on { opacity: .85; transform: none; }
.greet.out { animation: greet-out .5s var(--ease) both; pointer-events: none; }
@keyframes greet-out { to { opacity: 0; transform: scale(1.03); } }
.login-card .hello { margin: -8px 0 0; font-size: 17px; font-weight: 600; color: var(--accent); }

/* feedback */
textarea { font: inherit; color: inherit; width: 100%; background: var(--fill-2); border: 0; border-radius: 12px; padding: 10px 12px; resize: vertical; box-shadow: 0 0 0 1px var(--line) inset; min-height: 84px; }
.fb .t { min-width: 0; display: grid; gap: 6px; }
.fb-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.fb.done .fb-text { color: var(--muted); }
.fb .quote { white-space: pre-wrap; overflow-wrap: anywhere; border-left: 2px solid var(--line); padding-left: 8px; }
.reply { background: var(--accent-soft); border-radius: 12px; padding: 8px 11px; white-space: pre-wrap; overflow-wrap: anywhere; justify-self: start; max-width: 100%; }
.reply-form { display: grid; gap: 8px; }
.fb-acts { gap: 14px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

/* «Как обычно» */
.usual { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 14px 16px; border-radius: 16px; margin-bottom: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface)); box-shadow: var(--shadow); animation: rise-in .35s var(--ease) backwards; }
.usual-t { display: grid; gap: 1px; min-width: 200px; flex: 1; }
.usual-k { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); }
.usual-t b { font-size: 16px; }

/* «Кто рядом» */
.team { margin: -4px 0 14px; display: grid; gap: 8px; }
.team-h { font-size: 13px; font-weight: 600; color: var(--muted); }
.team .note { font-size: 13.5px; }
.mates { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.mates::-webkit-scrollbar { display: none; }
.mate { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 999px; background: var(--surface); box-shadow: 0 0 0 1px var(--line) inset;
  transition: transform .18s var(--ease-out), box-shadow .25s; text-align: left; }
.mate:active { transform: scale(.96); }
.mate.on { box-shadow: 0 0 0 2px var(--accent) inset; }
.mate .av { width: 28px; height: 28px; font-size: 11px; }
.mate-t { display: grid; line-height: 1.15; font-size: 13px; }
.mate-t b { font-weight: 600; }
.mate-t span { color: var(--muted); font-size: 12px; }

/* office pulse: one series, one hue; bars anchored to the baseline with rounded tops */
.pulse { padding: 14px 16px 10px; display: grid; gap: 14px; }
.pulse-hero { display: grid; gap: 1px; }
.pulse-hero b { font-size: 20px; letter-spacing: -.01em; }
.pbars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; align-items: end; }
.pb { display: grid; justify-items: center; gap: 4px; padding: 4px 0; border-radius: 10px; min-width: 0; }
@media (hover: hover) { .pb:hover { background: var(--fill-2); } }
.pb:active { transform: scale(.96); }
.pb-free { font-size: 11px; color: var(--muted); }
.pb-col { height: 96px; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.pb-bar { width: min(26px, 70%); border-radius: 4px 4px 0 0; background: var(--accent); opacity: .85; transition: height .5s var(--ease); }
.pb-d { font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 600; letter-spacing: .03em; }
.pb-n { font-size: 14px; font-weight: 500; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.pb-n.mine { box-shadow: 0 0 0 1.5px var(--accent) inset; color: var(--accent); font-weight: 600; }

/* ===== product polish: navigation, pickers, sheets, responsive ===== */
/* bar: compact title appears when the large title scrolls away (iOS pattern) */
.top { transition: box-shadow .25s, background-color .25s; }
body.scrolled .top { box-shadow: 0 .5px 0 var(--line); }
.top-in { min-height: 40px; position: relative; }
.bar-title { position: absolute; left: 50%; transform: translate(-50%, 4px); font-size: 17px; font-weight: 600; letter-spacing: -.01em; opacity: 0; pointer-events: none;
  transition: opacity .2s var(--ease-out), transform .3s var(--ease); white-space: nowrap; max-width: calc(100% - 120px); overflow: hidden; text-overflow: ellipsis; }
body.scrolled .bar-title { opacity: 1; transform: translate(-50%, 0); }
.top .nav { margin-left: auto; }
.me-btn { margin-left: auto; }
.top .nav + .me-btn { margin-left: 0; }
.top { padding-top: 10px; padding-bottom: 8px; }
.large-title { font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: -.025em; margin: 2px 0 14px; text-wrap: balance; }
@media (min-width: 881px) { .bar-title { display: none; } .large-title { font-size: 32px; margin-top: 8px; } }

/* sections: bold title-case headers instead of shouty caps */
.group-h { text-transform: none; letter-spacing: -.01em; font-size: 20px; font-weight: 700; color: var(--ink); padding-left: 2px; margin: 0 0 4px; }
.group-f { padding-inline: 2px; }
.page { gap: 28px; }

/* pickers */
.pickers { display: flex; gap: 8px; align-items: stretch; min-width: 0; }
.picker { display: flex; align-items: center; gap: 8px; min-width: 0; background: var(--surface); border-radius: 14px; padding: 8px 12px; text-align: left;
  box-shadow: 0 0 0 .5px var(--line) inset, 0 1px 2px rgba(20,24,32,.04); transition: transform .18s var(--ease-out), background-color .2s; }
.picker:active { transform: scale(.98); }
@media (hover: hover) { .picker:hover { background: color-mix(in srgb, var(--surface) 92%, var(--accent)); } }
.place-btn { flex: 1 1 auto; max-width: 420px; }
.pk-t { display: grid; min-width: 0; flex: 1; line-height: 1.2; }
.pk-cap { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-main { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.chev-d { color: var(--muted); flex: 0 0 auto; }
.time-btn { flex: 0 0 auto; font-weight: 600; font-size: 16px; color: var(--ink); }
.time-btn svg { color: var(--accent); }

/* sheets: bottom sheet on phones, dialog on larger screens */
.sheet { gap: 14px; }
.sheet .grabber { display: none; }
.sh-group { display: grid; gap: 6px; }
.sh-h { font-size: 13px; color: var(--muted); font-weight: 600; padding-left: 4px; }
.sheet .rows { background: var(--fill-2); }
.sh-opt { width: 100%; text-align: left; }
.sh-opt[aria-pressed="true"] .tt { color: var(--accent); font-weight: 600; }
.tick { color: var(--accent); font-weight: 700; }
@media (hover: hover) { .sh-opt:hover { background: var(--fill); } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@media (max-width: 880px) {
  .modal { left: 0; right: 0; top: auto; bottom: 0; width: 100%; transform: none; border-radius: 22px 22px 0 0; max-height: 88vh; max-height: 88dvh;
    padding: 10px max(18px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
    animation: sheet-up .45s var(--ease) both; }
  #overlay.closing .modal { animation: sheet-down .25s var(--ease-out) both; }
  .modal .grabber, .sheet .grabber { display: block; margin: 0 auto 2px; }
  .tour { padding-top: 14px; }
}

/* team, usual, legend */
.team-h { font-size: 13px; font-weight: 600; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.team-h .num { background: var(--fill); color: var(--ink); border-radius: 999px; padding: 0 7px; font-size: 12px; line-height: 18px; }
.team .note { font-size: 14px; }
.usual { background: var(--surface); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-radius: 16px; }
.usual-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: 0 0 auto; }
.usual-t { min-width: 0; flex: 1 1 160px; }
.usual-t b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usual-k { font-size: 12px; letter-spacing: 0; text-transform: none; font-weight: 600; }
.usual .row { flex-wrap: nowrap; }
.legend { gap: 4px 14px; font-size: 12px; }
.dotc { width: 9px; height: 9px; border-radius: 50%; }
.lg-free { background: var(--free); box-shadow: 0 0 0 1.5px var(--free-ink) inset; }
.lg-part { background: var(--part); box-shadow: 0 0 0 1.5px var(--part-ink) inset; }
.lg-busy { background: var(--busy); box-shadow: 0 0 0 1.5px var(--busy-ink) inset; }
.lg-mine { background: var(--mine); box-shadow: 0 0 0 1.5px var(--mine-ink) inset; }
.summary { font-weight: 500; color: var(--muted); }
.summary b { color: var(--ink); font-size: 15px; }
.empty-panel { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 18px 8px; color: var(--muted); }
.empty-panel svg { color: var(--locked-ink); margin-bottom: 4px; }
.empty-panel h2 { color: var(--ink); }

/* nothing may push the page wider than the screen */
.screen, .page, .layout > *, .controls, .row > *, .r > *, .ed-panel, .mapcard { min-width: 0; }
.row > .pill, .r > .pill { max-width: 100%; }
.ed-top { flex-wrap: wrap; }
.ed-top .place-btn { flex: 1 1 240px; }
.seg { max-width: 100%; }
.ed-panel { overflow-wrap: anywhere; }
@media (max-width: 880px) {
  .ed-top .btn { flex: 0 0 auto; }
  .tool { font-size: 14px; }
}
@media (max-width: 360px) {
  .large-title { font-size: 30px; }
  .pk-main, .time-btn { font-size: 15px; }
  .day { width: 42px; }
  .nav.tabbar .tabbar button span:not(.badge-n), .tabbar button span:not(.badge-n) { font-size: 9.5px; }
}
.top-in { justify-content: flex-end; min-height: 36px; }
.top .nav { margin-left: 0; }
.me-btn, .top .nav + .me-btn { margin-left: 0; }
.lt-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.lt-row .large-title { margin-bottom: 14px; }
.lt-me { margin-bottom: 12px; }
@media (max-width: 880px) { .top .me-btn { display: none; } .top { padding-top: 6px; padding-bottom: 6px; } }
@media (min-width: 881px) { .lt-me { display: none; } }
.icon-btn { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--fill); color: var(--accent); flex: 0 0 auto; transition: transform .18s var(--ease-out), opacity .2s; }
.icon-btn:active:not(:disabled) { transform: scale(.94); }
.icon-btn:disabled { opacity: .4; cursor: default; }
.ed-top .seg { flex: 0 1 auto; }
@media (max-width: 360px) { .tabbar button span:not(.badge-n) { font-size: 9.5px; } }
.brand { display: none; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; letter-spacing: -.02em; margin-right: auto; }
.brand img { border-radius: 7px; }
@media (min-width: 881px) { .brand { display: flex; } }
@media (max-width: 360px) { .tabbar button span:not(.badge-n) { font-size: 9px; letter-spacing: -.02em; } .tabbar button { padding-inline: 0; } }

/* ===== greeting: live sky by time of day and weather ===== */
.greet { background: var(--sky-a); color: var(--sky-ink); transition: background-color .8s; }
.greet::before { content: none; }
.greet p { color: var(--sky-ink2); }
.greet-w { color: var(--sky-ink) !important; }
.greet-logo { box-shadow: 0 12px 34px rgba(10,20,50,.25); }
.greet h1 { text-shadow: 0 1px 18px rgba(0,0,0,var(--sky-shadow, 0)); }
.sky { position: absolute; inset: 0; overflow: hidden; pointer-events: none;
  background: linear-gradient(180deg, var(--sky-a) 0%, var(--sky-b) 55%, var(--sky-c) 100%); transition: filter 1s; }
.sky::after { content: ""; position: absolute; inset: 0; background: var(--sky-veil, transparent); transition: background-color 1s; }
/* time of day */
.greet.g-morning { --sky-a: #9EC2EE; --sky-b: #D9E3F2; --sky-c: #F7D9BF; --sky-ink: #1E2A3E; --sky-ink2: #3E4C63; --sun: #FFE3B0; --sun-x: 20%; --sun-y: 72%; }
.greet.g-day { --sky-a: #5C9BE6; --sky-b: #9CC5F1; --sky-c: #D8EAFB; --sky-ink: #12253F; --sky-ink2: #2E4A6E; --sun: #FFF4D6; --sun-x: 86%; --sun-y: 26%; }
.greet.g-evening { --sky-a: #34407E; --sky-b: #8B6FA6; --sky-c: #F0A98A; --sky-ink: #FFFFFF; --sky-ink2: rgba(255,255,255,.82); --sun: #FFB98A; --sun-x: 70%; --sun-y: 86%; --sky-shadow: .25; }
.greet.g-night { --sky-a: #0B1430; --sky-b: #1B2650; --sky-c: #2F3B6B; --sky-ink: #FFFFFF; --sky-ink2: rgba(255,255,255,.75); --sun: #E9EEFF; --sun-x: 84%; --sun-y: 28%; --sky-shadow: .3; }
/* weather */
.greet[data-sky="cloud"] .sky, .greet[data-sky="rain"] .sky { filter: saturate(.35) brightness(.92); }
.greet[data-sky="snow"] .sky { filter: saturate(.4) brightness(1.04); }
.greet[data-sky="partly"] .sky { filter: saturate(.8); }
.greet[data-sky="rain"] { --sky-ink: #FFFFFF; --sky-ink2: rgba(255,255,255,.85); --sky-shadow: .25; }
.greet[data-sky="rain"] .sky::after { background: rgba(30,40,60,.28); }
.greet.g-day[data-sky="cloud"], .greet.g-morning[data-sky="cloud"] { --sky-ink: #1E2633; --sky-ink2: #3B4555; }
/* sun / moon glow */
.sky-sun { position: absolute; left: var(--sun-x); top: var(--sun-y); width: 46vmax; height: 46vmax; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--sun) 95%, transparent) 0 5%, color-mix(in srgb, var(--sun) 45%, transparent) 14%, transparent 60%);
  animation: sun-breathe 7s ease-in-out infinite alternate; transition: opacity 1s; }
.greet.g-night .sky-sun { width: 22vmax; height: 22vmax; opacity: .7; }
.greet[data-sky="cloud"] .sky-sun, .greet[data-sky="rain"] .sky-sun, .greet[data-sky="snow"] .sky-sun { opacity: .25; }
@keyframes sun-breathe { to { transform: translate(-50%, -50%) scale(1.08); } }
/* stars only on clear nights */
.sky-stars { position: absolute; inset: 0; opacity: 0; transition: opacity 1s; }
.greet.g-night .sky-stars { opacity: 1; }
.greet.g-night[data-sky="cloud"] .sky-stars, .greet.g-night[data-sky="rain"] .sky-stars, .greet.g-night[data-sky="snow"] .sky-stars { opacity: .15; }
.sky-stars i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #FFFFFF; opacity: var(--o); animation: twinkle var(--t) ease-in-out infinite alternate; }
@keyframes twinkle { to { opacity: .1; } }
/* clouds drift slowly */
.sky-clouds { position: absolute; inset: 0; opacity: .0; transition: opacity 1s; }
.greet[data-sky="partly"] .sky-clouds { opacity: .55; }
.greet[data-sky="cloud"] .sky-clouds, .greet[data-sky="rain"] .sky-clouds, .greet[data-sky="snow"] .sky-clouds { opacity: .9; }
.greet[data-sky="clear"] .sky-clouds { opacity: .18; }
.cl { position: absolute; left: var(--x); top: var(--y); width: calc(60vmax * var(--s)); height: calc(22vmax * var(--s)); border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,255,255,.95), rgba(255,255,255,.55) 55%, rgba(255,255,255,0)); filter: blur(10px);
  animation: drift var(--d) linear infinite; }
.cl:nth-child(even) { opacity: .75; }
.greet.g-night .cl, .greet.g-evening .cl { background: radial-gradient(closest-side, rgba(220,215,240,.75), rgba(200,195,230,.35) 55%, rgba(255,255,255,0)); }
.greet[data-sky="rain"] .cl { background: radial-gradient(closest-side, rgba(150,160,180,.95), rgba(140,150,170,.6) 55%, rgba(140,150,170,0)); }
@keyframes drift { from { transform: translateX(-12vw); } to { transform: translateX(28vw); } }
/* rain */
.sky-rain, .sky-snow { position: absolute; inset: 0; display: none; }
.greet[data-sky="rain"] .sky-rain { display: block; }
.sky-rain i { position: absolute; top: -20%; width: 1.5px; height: 70px; background: linear-gradient(transparent, rgba(255,255,255,.55)); transform: rotate(12deg);
  animation: fall-rain var(--d) linear var(--l) infinite; }
@keyframes fall-rain { to { transform: translate(-22vh, 125vh) rotate(12deg); } }
/* snow */
.greet[data-sky="snow"] .sky-snow { display: block; }
.sky-snow i { position: absolute; top: -5%; width: var(--z); height: var(--z); border-radius: 50%; background: rgba(255,255,255,.9); filter: blur(.5px);
  animation: fall-snow var(--d) linear var(--l) infinite; }
@keyframes fall-snow { 0% { transform: translate(0, 0); } 50% { transform: translate(18px, 55vh); } 100% { transform: translate(-8px, 112vh); } }
.greet-in { z-index: 1; }
@media (prefers-reduced-motion: reduce) { .cl, .sky-rain i, .sky-snow i, .sky-stars i, .sky-sun { animation: none !important; } }

/* greeting layout like a lock screen: date and time on top, greeting in the middle, weather at the bottom */
.greet { grid-template-rows: auto 1fr auto; place-items: stretch; padding: calc(28px + env(safe-area-inset-top, 0px)) 24px calc(34px + env(safe-area-inset-bottom, 0px)); }
.greet-clock { position: relative; z-index: 1; text-align: center; display: grid; gap: 0; animation: rise-in .6s var(--ease) both; }
.gc-date { font-size: 18px; font-weight: 600; letter-spacing: -.01em; color: var(--sky-ink); opacity: .9; }
.gc-time { font-size: clamp(72px, 22vw, 108px); line-height: 1; font-weight: 600; letter-spacing: -.04em; color: var(--sky-ink); opacity: .92;
  font-family: -apple-system, "SF Pro Display", BlinkMacSystemFont, var(--f-ui); margin-top: 2px; }
.greet-in { align-self: center; justify-self: center; gap: 12px; }
.greet-in > :nth-child(3) { animation-delay: .22s; }
.greet-q { font-size: 16px !important; line-height: 1.45; max-width: 30ch; margin-top: 6px !important; color: var(--sky-ink) !important; opacity: .78; font-style: italic; }
.greet > .greet-w { position: relative; z-index: 1; justify-self: center; margin: 0; }
@media (max-height: 620px) { .gc-time { font-size: 64px; } .greet h1 { font-size: 30px; } }
/* realistic sky (WebGL); the CSS sky stays as a fallback */
.sky-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: none; }
.greet.gl .sky-gl { display: block; }
.greet.gl .sky { display: none; }
.greet { grid-template-rows: 1fr auto; }
.greet-in { align-self: center; }
.gc-date { font-size: 15px; font-weight: 600; letter-spacing: .01em; color: var(--sky-ink); opacity: .8; margin-bottom: 4px; }
.greet-clock { display: none; }
.greet h1 { text-shadow: 0 1px 24px rgba(0,0,0,var(--sky-shadow, 0)); }
.greet.gl.g-day, .greet.gl.g-morning { --sky-shadow: .12; }
.fb-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.fb-text.open { display: block; -webkit-line-clamp: unset; }
.group-h .badge-n { vertical-align: 3px; margin-left: 4px; }
.add-row #newName { flex: 2 1 200px; } .add-row #newDir { flex: 1 1 140px; }
.hit { cursor: pointer; }
/* install hint: one quiet line instead of a big banner */
.chip-banner { display: flex; align-items: center; gap: 4px; margin-bottom: 12px; }
.cb-main { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 14px; }
.cb-x { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
/* compact «как обычно» and team strip so the map is on the first screen */
.usual { padding: 10px 12px; margin-bottom: 12px; gap: 10px; }
.usual-ic { width: 32px; height: 32px; }
.usual .row .btn { white-space: nowrap; }
.team { margin: -6px 0 10px; gap: 6px; }
.team-h { font-size: 12.5px; }
.controls { gap: 10px; margin-bottom: 12px; }
.num, .time-btn span, .tt.num, .usual-t .ts { white-space: nowrap; }
.seg { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { white-space: nowrap; flex: 0 0 auto; }
/* toasts move to the top while a sheet is open on a phone, so they never cover the form */
@media (max-width: 880px) {
  body:has(#overlay .modal) #toast, body:has(#panel.open) #toast { bottom: auto; top: calc(10px + env(safe-area-inset-top, 0px)); }
}
.greet.out { animation: fade-out .5s var(--ease) both; }
.greet { overflow: hidden; }
