/* MiCash dashboard: the app's dark look, from Core/Theme.swift (Palette dark, CardStyle, CardModifier) and the
   iOS text styles the app uses (sizes at the default text size). Phone ≤ 699px, tablet 700–1099px, computer ≥ 1100px. */
:root {
  --bg: #000;
  --card: rgba(255, 255, 255, .07);            /* frosted glass: the sky and hills show through */
  --card-border: rgba(255, 255, 255, .16);
  --card-shadow: 0 2px 8px rgba(30, 90, 168, .10);
  --heading: #F5F6F7; --text: #D2D5DA; --muted: #8D929A; --border: #252D38;
  --primary: #40B6FF; --primary-top: #70D2FF;   /* Theme.primary and its SwiftUI .gradient top */
  --success: #2FD67A; --danger: #FF6B6B; --warning: #FFCD3C; --info: #7CCBFF; --expense: #5C6670;
  --income-amount: #22B35F; --net-amount: #3FEA8F;
  --sky: #34AAFE; --deep: #0348CA; --link: #34AAFE;
  --separator: rgba(84, 84, 88, .6);
  --fill: rgba(118, 118, 128, .24);             /* iOS control fill (segmented control, search) */
  --radius: 25.6px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --ease: cubic-bezier(.32, .72, 0, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html { background: var(--bg); }
html, body { margin: 0; min-height: 100%; color: var(--text); font: 17px/1.3 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { overflow-x: hidden; }
canvas.sky { position: fixed; inset: 0 auto auto 0; z-index: -1; pointer-events: none; }
a { color: var(--link); text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--heading); }
.ic { display: block; flex: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.tone-success { color: var(--success); } .tone-warning { color: var(--warning); } .tone-danger { color: var(--danger); }
.tone-info { color: var(--info); } .tone-muted { color: var(--muted); } .tone-primary { color: var(--primary); }
.money-in { color: var(--success); } .danger { color: var(--danger); }
.num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- cards (CardModifier) */
.card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 16px; box-shadow: var(--card-shadow); }
.card.flat { border-color: transparent; box-shadow: none; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.cardtitle { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.cardtitle h2 { font-size: 15px; font-weight: 600; }
.cardtitle span { font-size: 12px; color: var(--muted); }
.banner-error { display: flex; gap: 10px; align-items: center; color: var(--danger); font-size: 13px; }

/* ---------------------------------------------------------------- page frame */
.page { max-width: 760px; margin: 0 auto; padding: 12px 16px 128px; }
.page.wide { max-width: 1120px; }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; margin: 0 56px 14px 0; }
.pagehead h1 { font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: .01em; }
.pagehead-tools { display: flex; align-items: center; gap: 10px; }
.loading { display: grid; place-items: center; padding: 64px 0; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .15); border-top-color: var(--muted); animation: spin .8s linear infinite; display: inline-block; }
.spinner.light { width: 20px; height: 20px; border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.caps { font-size: 13px; font-weight: 500; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); margin: 26px 16px 10px; }
.sectionhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 16px 10px; }
.sectionhead h2 { font-size: 20px; font-weight: 600; color: var(--muted); }
.foot { font-size: 12px; color: var(--muted); margin: 10px 16px 0; line-height: 1.4; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); font-size: 15px; }
.empty .ic { margin: 0 auto 4px; color: var(--muted); }
.empty h3 { font-size: 17px; margin: 10px 0 4px; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 17px; color: var(--link); margin: 4px 0 12px -4px; padding: 6px 4px; }

/* ---------------------------------------------------------------- tab bar: floating glass (iOS 26). Phone: bottom. Computer: top. */
.tabbar { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); display: flex; padding: 4px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); width: min(calc(100% - 32px), 420px); height: 64px; border-radius: 32px;
  background: rgba(40, 40, 44, .62); border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 10px 40px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .06);
  -webkit-backdrop-filter: blur(22px) saturate(1.8); backdrop-filter: blur(22px) saturate(1.8); }
.tabbar a { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 28px;
  color: var(--heading); font-size: 10px; font-weight: 500; letter-spacing: -.01em; transition: background .35s var(--ease), color .2s; }
.tabbar a span { white-space: nowrap; }
.tabbar a:hover { background: rgba(255, 255, 255, .06); }
.tabbar a.on { color: var(--primary); background: rgba(0, 0, 0, .38); }
.tabbar .ic { width: 26px; height: 26px; }

/* Profile (top right) */
.profile { position: absolute; z-index: 25; top: 12px; right: max(16px, calc((100vw - 760px) / 2 + 16px)); }
.glass-circle { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--heading);
  background: rgba(40, 40, 44, .55); border: 1px solid rgba(255, 255, 255, .12); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.glass-circle:hover { background: rgba(60, 60, 66, .65); }
.menu { position: absolute; right: 0; top: 52px; width: 280px; padding: 8px; border-radius: 22px; background: rgba(36, 37, 41, .92);
  border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 18px 50px rgba(0, 0, 0, .6); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  animation: pop .22s var(--ease); transform-origin: top right; }
@keyframes pop { from { opacity: 0; transform: scale(.92); } }
.menu-who { display: flex; gap: 12px; align-items: center; padding: 10px 10px 12px; border-bottom: 1px solid var(--separator); margin-bottom: 6px; }
.menu-email { color: var(--heading); font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.menu-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 10px; border: 0; background: none; border-radius: 14px; font-size: 17px; text-align: left; }
.menu-item:hover { background: rgba(255, 255, 255, .07); }
.menu-item.danger { color: var(--danger); }

/* Avatars (PersonAvatar) */
.avatar { --s: 40px; width: var(--s); height: var(--s); flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 600;
  font-size: calc(var(--s) * .36); color: var(--heading); background: rgba(141, 146, 154, .3); }
.avatar.you { color: #fff; background: linear-gradient(180deg, var(--primary-top), var(--primary)); }

/* ---------------------------------------------------------------- sign-in (SignInView): centred in the window */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.auth { width: 100%; max-width: 400px; display: flex; flex-direction: column; align-items: stretch; gap: 20px; text-align: center; }
.mark { width: 72px; height: 72px; border-radius: 16px; margin: 0 auto; box-shadow: 0 8px 30px rgba(3, 72, 202, .35); }
.mark.boot { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .6; } }
.auth h1 { font-size: 34px; line-height: 41px; font-weight: 700; }
.auth p { font-size: 15px; color: var(--muted); line-height: 1.35; }
.fields { padding: 0 16px; text-align: left; }
.field { width: 100%; background: transparent; border: 0; outline: none; color: var(--heading); font-size: 17px; padding: 14px 0; }
.field::placeholder { color: rgba(235, 235, 245, .3); }
.field + .field { border-top: 1px solid var(--separator); }
.field.code { text-align: center; font: 600 26px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .35em; padding: 16px 0; }
.field.code::placeholder { font: 17px var(--font); letter-spacing: 0; }
.auth-error { color: var(--danger); font-size: 13px; }
.btn-gradient { display: flex; align-items: center; justify-content: center; min-height: 50px; padding: 14px; border: 0; border-radius: 10px; color: #fff;
  font-size: 17px; font-weight: 600; background: linear-gradient(135deg, var(--sky), var(--deep)); transition: opacity .2s; }
.btn-gradient:active { opacity: .8; }
.btn-gradient:disabled { opacity: .45; cursor: default; }
.auth-link { background: none; border: 0; color: var(--link); font-size: 15px; font-weight: 600; padding: 4px; }

/* ---------------------------------------------------------------- controls */
.segs { --n: 3; --i: 0; position: relative; display: flex; height: 36px; padding: 2px; border-radius: 18px; background: var(--fill); margin-bottom: 16px; }
.segs-thumb { position: absolute; top: 2px; bottom: 2px; left: 2px; width: calc((100% - 4px) / var(--n)); border-radius: 16px; background: rgba(120, 120, 128, .55);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .12); transform: translateX(calc(100% * var(--i))); transition: transform .35s var(--ease); }
.segs button { position: relative; flex: 1; border: 0; background: none; color: var(--heading); font-size: 15px; font-weight: 500; border-radius: 16px; }
.segs button.on { font-weight: 600; }
.search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 20px; background: var(--fill); margin-bottom: 12px; }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--heading); font-size: 17px; }
.search input::placeholder { color: rgba(235, 235, 245, .45); }
.search .ic { color: rgba(235, 235, 245, .6); }
.search input::-webkit-search-cancel-button { filter: invert(.6); }
.yearmenu { position: relative; display: inline-flex; align-items: center; gap: 4px; color: var(--primary); font-size: 15px; font-weight: 500; cursor: pointer; }
.yearmenu select { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.yearmenu select option { color: #000; }
.tag { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; background: color-mix(in srgb, currentColor 16%, transparent); }
.tag.outline { background: none; border: 1px solid color-mix(in srgb, currentColor 45%, transparent); letter-spacing: .14em; padding: 4px 10px; }
.pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #0b0c0e; background: var(--muted); }
.pill.success { background: var(--success); } .pill.warning { background: var(--warning); } .pill.danger { background: var(--danger); }
.pill.info { background: var(--info); } .pill.primary { background: var(--primary); }
.glass-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 20px; color: var(--heading); font-size: 15px; font-weight: 600;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); }
.glass-btn:hover { background: rgba(255, 255, 255, .15); }

/* ---------------------------------------------------------------- inset lists with a colour rail (TransactionRow, invoice/trip rows) */
.list { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: var(--card-shadow); overflow: hidden; }
.row { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: inherit; min-width: 0; }
.row + .row::before { content: ""; position: absolute; top: 0; left: var(--inset, 48px); right: 16px; height: 1px; background: var(--separator); transform: scaleY(.5); transform-origin: top; }
a.row:hover, button.row:hover { background: rgba(255, 255, 255, .04); }
button.row { width: 100%; border: 0; background: none; text-align: left; }
.rail { width: 4px; align-self: stretch; border-radius: 2px; background: rgba(141, 146, 154, .45); flex: none; }
.rail.success { background: var(--success); } .rail.warning { background: var(--warning); } .rail.danger { background: var(--danger); }
.rail.info { background: var(--info); } .rail.primary { background: var(--primary); } .rail.muted { background: rgba(141, 146, 154, .45); }
.row .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row .t { color: var(--heading); font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px; }
.row .t > .name { overflow: hidden; text-overflow: ellipsis; }
.row .l2 { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; }
.row .l2 > span { overflow: hidden; text-overflow: ellipsis; }
.row .l3 { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.row .l3 > span { overflow: hidden; text-overflow: ellipsis; }
.row .amt { text-align: right; flex: none; }
.row .amt b { display: block; color: var(--heading); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.row .amt small { display: block; font-size: 11px; font-weight: 600; color: var(--info); margin-top: 2px; font-variant-numeric: tabular-nums; }
.row .amt.in b { color: var(--success); }
.row .chev { color: rgba(235, 235, 245, .3); flex: none; }
.listfoot { display: flex; justify-content: center; padding: 16px 0 0; }
.more { border: 0; background: var(--fill); color: var(--heading); font-size: 15px; font-weight: 600; height: 40px; padding: 0 20px; border-radius: 20px; }

/* ---------------------------------------------------------------- home (DashboardView) */
.home { display: grid; gap: 16px; }
.home-side { display: flex; flex-direction: column; gap: 16px; }
.income-card { padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.income-card .cardtitle h2 { font-size: 17px; }
.ring { width: 200px; height: 200px; margin: 0 auto; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 26; }
.ring .arc { transition: stroke-dasharray 1.1s var(--ease), stroke-dashoffset 1.1s var(--ease); }
.ring-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 0 34px; text-align: center; }
.ring-mid span { font-size: 15px; color: var(--muted); }
.ring-mid b { font: 600 22px/1.2 var(--rounded); font-variant-numeric: tabular-nums; white-space: nowrap; }
.legend { display: flex; flex-direction: column; gap: 12px; }
.legend div { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--text); }
.legend i { width: 4px; height: 16px; border-radius: 2px; flex: none; }
.legend b { margin-left: auto; font-weight: 600; color: var(--heading); font-variant-numeric: tabular-nums; }
.navcard { display: flex; align-items: center; gap: 14px; color: inherit; transition: background .2s; }
a.navcard:hover { background: rgba(255, 255, 255, .1); }
.navcard .ic.big { width: 26px; height: 26px; }
.navcard .main { flex: 1; min-width: 0; }
.navcard h3 { font-size: 17px; font-weight: 600; }
.navcard p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.navcard .chev { color: var(--muted); }
.tiles2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { padding: 14px; display: flex; flex-direction: column; gap: 10px; color: inherit; min-width: 0; }
a.stat:hover { background: rgba(255, 255, 255, .1); }
.stat .ic { width: 26px; height: 32px; }
.stat b { font-size: 20px; font-weight: 700; color: var(--heading); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat span { font-size: 12px; color: var(--muted); }
.cats { display: flex; flex-direction: column; gap: 12px; }
.cat-line { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; color: var(--text); margin-bottom: 4px; }
.cat-line b { font-weight: 400; color: var(--heading); font-variant-numeric: tabular-nums; }
.cat-bar { height: 6px; border-radius: 3px; background: rgba(64, 182, 255, .15); overflow: hidden; }
.cat-bar span { display: block; height: 100%; border-radius: 3px; background: var(--primary); transform-origin: left; animation: grow .9s var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } }

/* ---------------------------------------------------------------- invoices */
.tiles3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.sumtile { padding: 14px; min-width: 0; }
@media (max-width: 400px) { .sumtile { padding: 12px; } .tiles3 { gap: 8px; } }
.sumtile .lab { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.sumtile b { display: block; margin: 8px 0 6px; font-size: min(17px, 4.25vw); font-weight: 700; color: var(--heading); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sumtile span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.inv-head { padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.inv-status { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; }
.inv-status .tag { margin-left: auto; }
.inv-head .sub { font-size: 15px; color: var(--muted); }
.inv-amount { font-size: 40px; line-height: 1.15; font-weight: 700; color: var(--heading); letter-spacing: .01em; font-variant-numeric: tabular-nums; margin-top: 6px; }
.inv-tip { font-size: 15px; font-weight: 600; color: var(--info); }
.inv-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.kvlist { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: var(--card-shadow); overflow: hidden; }
.kv { position: relative; display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 13px 16px; font-size: 17px; }
.kv + .kv::before { content: ""; position: absolute; top: 0; left: 16px; right: 16px; height: 1px; background: var(--separator); transform: scaleY(.5); transform-origin: top; }
.kv > span:first-child { color: var(--heading); flex: none; }
.kv > span:last-child { color: var(--muted); text-align: right; overflow-wrap: anywhere; min-width: 0; }
.kv .sub { display: block; font-size: 13px; color: var(--muted); }
.kv.total > span { color: var(--heading); font-weight: 700; }

/* ---------------------------------------------------------------- projects (ProjectsView) */
.pipeline { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 8px; padding: 4px 16px 8px; scroll-snap-type: x proximity; scroll-padding: 0 16px; }
.pipeline::-webkit-scrollbar { display: none; }
.ptile { position: relative; flex: none; border: 0; background: none; padding: 14px 14px 14px 24px; text-align: left; color: var(--heading); scroll-snap-align: start; }
.ptile.first { padding-left: 16px; }
.ptile svg.shape { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.ptile .shape path { fill: var(--card); transition: fill .25s; }
.ptile:hover .shape path { fill: rgba(255, 255, 255, .11); }
.ptile.on { color: #fff; }
.ptile.on .shape path { fill: url(#tile-on); }
.ptile > div { position: relative; width: 96px; display: flex; flex-direction: column; gap: 6px; }
.ptile b { font: 600 30px/1 var(--rounded); font-variant-numeric: tabular-nums; }
.ptile span { font-size: 13px; font-weight: 500; line-height: 16px; height: 32px; overflow: hidden; }
.sortbar { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 12px; }
.sortmenu { position: relative; display: inline-flex; align-items: center; gap: 6px; color: var(--heading); font-size: 17px; font-weight: 600; padding: 6px 0; }
.sortmenu select { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.sortmenu select option { color: #000; }
.arrows { display: flex; align-items: center; justify-content: center; width: 44px; height: 36px; border: 0; background: none; color: var(--heading); }
.arrows .dim { color: rgba(141, 146, 154, .5); }
.arrows .ic { margin: 0 -3px; }
.prow { --inset: 88px; gap: 14px; padding: 12px 16px; }
.cover { width: 58px; height: 58px; border-radius: 10px; object-fit: cover; flex: none; background: rgba(255, 255, 255, .06); display: grid; place-items: center; color: var(--muted); }
.prow .main { gap: 3px; }
.prow .pn { color: var(--heading); font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow .pd { color: var(--text); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow .ps { color: var(--muted); font-size: 15px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: currentColor; }

/* One project (ProjectView): the cover behind the title, then tabs */
.hero { position: relative; margin: -12px -16px 0; min-height: 250px; display: flex; flex-direction: column; justify-content: flex-end;
  background: #111 center / cover no-repeat; color: #fff; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .45), rgba(0, 0, 0, .35) 45%, rgba(0, 0, 0, .8)); }
.hero > * { position: relative; }
.hero-top { display: flex; align-items: center; gap: 8px; padding: 12px 16px 0; margin-bottom: auto; }
.hero-top .glass-circle { flex: none; }
.hero h1 { flex: 1; text-align: center; color: #fff; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 44px 0 0; }
.hero-meta { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 22px 16px 10px; font-size: 15px; color: rgba(255, 255, 255, .9); flex-wrap: wrap; }
.hero-meta .divider { width: 1px; height: 22px; background: rgba(255, 255, 255, .4); }
.stagepill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .15); color: #fff; font-weight: 500; }
.ptabs { display: flex; }
.ptabs a { flex: 1; text-align: center; color: rgba(255, 255, 255, .75); font-size: 17px; padding: 10px 4px 12px; position: relative; }
.ptabs a.on { color: #fff; font-weight: 600; }
.ptabs a.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 2px; background: var(--primary); }
.ptabs a:hover { color: #fff; }
.tabbody { padding-top: 16px; }

/* Activity */
.dayhead { text-align: center; font-size: 13px; font-weight: 500; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); margin: 10px 0 12px; }
.msg { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.msg .card { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.msg .who { font-size: 12px; color: var(--muted); line-height: 1.45; }
.msg h3 { font-size: 17px; font-weight: 600; }
.msg .body { font-size: 17px; color: var(--heading); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.35; }
.msg .foot2 { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.msg.micash .card { background: linear-gradient(135deg, rgba(52, 170, 254, .14), rgba(3, 72, 202, .12)); border-color: rgba(64, 182, 255, .3); }
.msg.micash h3 { display: flex; align-items: center; gap: 8px; }
.msg blockquote { margin: 0; padding: 2px 0 2px 12px; border-left: 3px solid rgba(255, 255, 255, .2); color: var(--text); font-size: 15px; white-space: pre-wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 999px; background: rgba(64, 182, 255, .12); color: var(--heading); font-size: 12px; font-weight: 500; max-width: 100%; }
.chip small { color: var(--muted); font-size: 12px; }
.created { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }

/* Files */
.filecard { display: flex; flex-direction: column; gap: 14px; margin-bottom: 12px; color: inherit; }
a.filecard:hover { background: rgba(255, 255, 255, .1); }
.filecard .top { display: flex; gap: 14px; align-items: flex-start; }
.thumb { width: 88px; height: 62px; border-radius: 10px; object-fit: cover; flex: none; background: rgba(255, 255, 255, .06); display: grid; place-items: center; color: var(--muted); }
.filecard h3 { font-size: 17px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.filecard .pillrow { margin-top: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filecard .bottom { display: flex; justify-content: space-between; gap: 12px; }
.filecard .bottom div:last-child { text-align: right; }
.filecard .k { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.filecard .v { font-size: 17px; color: var(--heading); margin-top: 2px; font-variant-numeric: tabular-nums; }
.emptycard { color: var(--muted); font-size: 17px; }

/* Notes */
.notes-title { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 14px; }
.notes-title h2 { font-size: 34px; font-weight: 700; }
.summary { padding: 20px; margin-bottom: 18px; }
.summary h2 { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.summary .slabel { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 16px 0 4px; }
.summary .sval { font-size: 17px; color: var(--heading); line-height: 1.4; }
.summary .sval .muted { color: var(--muted); }
.summary .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.summary .mail { color: var(--primary); font-size: 12px; margin-left: 4px; cursor: help; vertical-align: 1px; }
.summary .waiting { margin-top: 18px; padding: 14px; border-radius: 18px; background: rgba(255, 205, 60, .08); border: 1px solid rgba(255, 205, 60, .3); }
.summary .waiting .slabel { margin-top: 0; color: var(--warning); }
.summary .prop { padding: 6px 0; font-size: 15px; color: var(--heading); }
.summary .readat { font-size: 12px; color: var(--muted); margin-top: 16px; }
.noteshead { display: flex; justify-content: space-between; align-items: center; margin: 4px 2px 12px; font-size: 17px; color: var(--heading); }
.note { padding: 20px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.note h3 { font-size: 17px; font-weight: 600; }
.note p { font-size: 17px; color: var(--heading); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.35; }
.note time { font-size: 12px; color: var(--muted); }

/* Details */
.people { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; padding: 6px 2px 18px; border-bottom: 1px solid var(--separator); margin-bottom: 20px; }
.people::-webkit-scrollbar { display: none; }
.person { flex: none; width: 96px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.person b { font-size: 15px; font-weight: 600; color: var(--heading); line-height: 1.25; overflow-wrap: anywhere; }
.person span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.person.off { opacity: .5; }
.dfield { margin: 0 2px 20px; }
.dfield span { display: block; font-size: 15px; color: var(--muted); margin-bottom: 4px; }
.dfield b { display: block; font-size: 20px; font-weight: 400; color: var(--heading); overflow-wrap: anywhere; }
.dhead { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 15px; margin: 24px 2px 12px; }
.dcard { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; margin-bottom: 12px; }
.dcard h3 { font-size: 17px; font-weight: 600; }
.dcard p { font-size: 17px; color: var(--text); margin-top: 4px; overflow-wrap: anywhere; }
.dcard .ic { color: var(--muted); }

/* ---------------------------------------------------------------- miles (MileageView) */
.drive { padding: 20px; margin-bottom: 8px; }
.drive h2 { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.drive p { font-size: 15px; color: var(--muted); line-height: 1.4; }
.drive .phone-only { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; min-height: 50px; border-radius: 12px;
  background: rgba(64, 182, 255, .12); color: var(--primary); font-weight: 600; font-size: 15px; }

/* Banner (cover photo, breadcrumb, title), participants bar and underline tabs: project and gallery pages */
.banner { position: relative; height: clamp(260px, 24vw, 380px); border-radius: 22px; overflow: hidden; background: #111 center / cover no-repeat; isolation: isolate;
  display: flex; flex-direction: column; justify-content: space-between; color: #fff; }
.banner::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .45), rgba(0, 0, 0, .35), rgba(0, 0, 0, .8)); }   /* the app's header overlay */
.banner > * { position: relative; }
.crumbs { display: flex; align-items: center; gap: 6px; padding: 22px 28px; font-size: 14px; color: rgba(255, 255, 255, .8); }
.crumbs a { color: rgba(255, 255, 255, .8); } .crumbs a:hover { color: #fff; }
.crumbs span { color: #fff; font-weight: 600; }
.banner-foot { padding: 0 28px 24px; }
.banner h1 { color: #fff; font-size: 34px; line-height: 41px; font-weight: 700; text-shadow: 0 2px 14px rgba(0, 0, 0, .45); }
.banner-meta { display: flex; align-items: center; gap: 12px; margin-top: 6px; font-size: 15px; color: rgba(255, 255, 255, .85); }
.banner-meta b { color: #fff; font-weight: 600; }
.pbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 18px 0 6px; flex-wrap: wrap; }
.plist { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 10px; }
.pp { display: flex; align-items: center; gap: 10px; }
.pp b { display: block; font-size: 14px; font-weight: 600; color: var(--heading); }
.pp small { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pactions { display: flex; gap: 10px; flex-wrap: wrap; }
.dtabs { display: flex; gap: 30px; border-bottom: 1px solid var(--separator); margin: 14px 0 24px; }
.dtabs a { display: flex; align-items: center; gap: 8px; padding: 12px 2px; font-size: 16px; color: var(--muted); position: relative; }
.dtabs a:hover { color: var(--heading); }
.dtabs a.on { color: var(--heading); font-weight: 600; }
.dtabs a.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 2px; background: var(--primary); }
.tabcount { font-size: 11px; font-weight: 700; color: var(--heading); background: rgba(255, 255, 255, .12); border-radius: 9px; padding: 1px 7px; }
@media (max-width: 1099px) {
  .banner { height: 220px; margin: -12px -16px 0; border-radius: 0; }
  .banner h1 { font-size: 26px; line-height: 32px; }
  .crumbs { padding: 16px; } .banner-foot { padding: 0 16px 16px; }
  .dtabs { gap: 22px; margin-bottom: 18px; overflow-x: auto; }
  .pbar { align-items: flex-start; }
}
@media (min-width: 700px) and (max-width: 1099px) { .banner { margin: 0; border-radius: var(--radius); } }

/* ---------------------------------------------------------------- buttons, dialogs */
.icon-btn { position: relative; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: var(--heading);
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); flex: none; }
.icon-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .12); }
.icon-btn.small { width: 36px; height: 36px; }
.icon-btn.danger { color: var(--danger); }
.icon-btn:disabled, .glass-btn:disabled, .btn-primary:disabled, .btn-danger:disabled { opacity: .45; cursor: default; }
.btn-primary, .btn-danger { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border: 0; border-radius: 20px;
  color: #fff; font-size: 15px; font-weight: 600; background: linear-gradient(135deg, var(--sky), var(--deep)); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-danger { background: rgba(255, 107, 107, .16); color: var(--danger); border: 1px solid rgba(255, 107, 107, .35); }
.btn-danger:hover:not(:disabled) { background: rgba(255, 107, 107, .24); }
.glass-btn { cursor: pointer; font-family: inherit; }
.dlg-back { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.dlg { width: min(480px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 20px; background: rgba(30, 31, 35, .97); animation: pop .25s var(--ease); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dlg-head h2 { font-size: 20px; }
.dform { display: flex; flex-direction: column; gap: 8px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.dfield textarea { border-radius: 12px; border: 1px solid var(--card-border); background: rgba(255, 255, 255, .06); color: var(--heading); padding: 10px 12px; font: 15px/1.4 var(--font); resize: vertical; }
.okline { color: var(--success); font-size: 13px; }

/* ---------------------------------------------------------------- galleries */
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.gal-grid .card + .card { margin-top: 0; }
.gal-card { padding: 0; overflow: hidden; color: inherit; display: flex; flex-direction: column; transition: transform .3s var(--ease), background .2s; }
.gal-card:hover { background: rgba(255, 255, 255, .1); transform: translateY(-2px); }
.gal-cover { position: relative; aspect-ratio: 16 / 10; background: rgba(255, 255, 255, .05) center / cover no-repeat; display: grid; place-items: center; color: var(--muted); }
.gal-cover .pill { position: absolute; left: 12px; bottom: 12px; }
.gal-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 3px; }
.gal-body h3 { font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gal-body p { font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gal-body small { font-size: 12px; color: var(--muted); }
.gbanner { height: clamp(200px, 18vw, 280px); border-radius: var(--radius); }
.hero-like { margin-top: 0; }
.bm-link { color: #fff; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .4); text-underline-offset: 3px; }
.gdesk .banner { margin-bottom: 0; }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 38px 20px; border-radius: var(--radius);
  border: 1.5px dashed rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .04); cursor: pointer; transition: background .2s, border-color .2s; }
.drop:hover, .drop.over { background: rgba(64, 182, 255, .1); border-color: var(--primary); }
.drop b { font-size: 20px; color: var(--heading); }
.drop span { font-size: 14px; color: var(--muted); max-width: 520px; }
.drop-ic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: rgba(64, 182, 255, .14); color: var(--primary) !important; margin-bottom: 4px; }
.uplist { margin-top: 8px; }
.uphead { display: flex; align-items: center; justify-content: space-between; }
.uphead .caps { margin-left: 4px; }
.upitem { padding: 12px 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--card-border); margin-bottom: 8px; }
.upline { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; }
.upline b { color: var(--heading); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upline span { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.upbar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .08); margin-top: 8px; overflow: hidden; }
.upbar span { display: block; height: 100%; border-radius: 3px; background: var(--primary); transition: width .3s linear; }
.upitem.done .upbar span { background: var(--success); }
.upitem.done .upline span { color: var(--success); }
.upitem.failed .upbar span { background: var(--danger); }
.upitem.failed .upline span { color: var(--danger); white-space: normal; text-align: right; }
.poster { width: 96px; height: 54px; border-radius: 8px; object-fit: cover; flex: none; background: rgba(255, 255, 255, .06); }
.poster.none { display: grid; place-items: center; color: var(--muted); }
.row.film { gap: 16px; }
.linkbtn { background: none; border: 0; color: var(--link); font-size: 15px; font-weight: 600; padding: 6px 4px; }
.linkbtn.danger { color: var(--danger); }
.uppill { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 19px; background: rgba(64, 182, 255, .14); color: var(--primary);
  font-size: 13px; font-weight: 600; position: relative; overflow: hidden; }
.uppill-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(64, 182, 255, .2); }
.uppill-bar span { display: block; height: 100%; background: var(--primary); }

.capsrow { display: flex; align-items: center; justify-content: space-between; }
.capsrow .linkbtn { display: inline-flex; align-items: center; gap: 4px; margin: 20px 4px 4px 0; }
.film-actions { display: flex; gap: 8px; flex: none; }
.addthumb { border: 1px dashed rgba(255, 255, 255, .25); cursor: pointer; flex-direction: column; gap: 2px; color: var(--muted); }
.addthumb small { font-size: 10px; font-weight: 600; }
.addthumb:hover { border-color: var(--primary); color: var(--primary); }
.settings { display: grid; gap: 16px; align-items: start; }
.settings .card + .card { margin-top: 0; }
.sset { display: flex; flex-direction: column; gap: 8px; padding: 20px; }
.sset h2 { font-size: 17px; font-weight: 600; margin-bottom: 2px; }
.sset-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 8px; }
.sset-foot p { margin-right: auto; }
.srow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; }
.extend { display: inline-flex; gap: 8px; align-items: center; }
.extend select { height: 40px; border-radius: 20px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .1); color: var(--heading); padding: 0 12px; font-size: 15px; color-scheme: dark; }
.danger-zone { border-color: rgba(255, 107, 107, .25); }
.scol { display: flex; flex-direction: column; gap: 16px; }
.scol .card + .card { margin-top: 0; }
@media (min-width: 1100px) { .settings { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* The designer: options on the left, the client's page (scaled) on the right */
.designer { display: grid; gap: 20px; }
.dpanel { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.dpanel > * { flex-shrink: 0; }          /* the panel scrolls; nothing in it (like the cover photo) gets squeezed */
.dpanel .segs { margin-bottom: 6px; }
.dlabel { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 10px; }
.dhint { font-size: 12px; color: var(--muted); }
.drow { display: flex; gap: 12px; }
.coverpick { position: relative; border-radius: 14px; overflow: hidden; cursor: crosshair; }
.coverpick img { display: block; width: 100%; height: auto; }
.focal { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .5); pointer-events: none; }
.coverdrop { display: grid; place-items: center; min-height: 120px; border-radius: 14px; border: 1.5px dashed rgba(255, 255, 255, .22); color: var(--muted); font-size: 14px; cursor: pointer; text-align: center; padding: 16px; }
.coverdrop:hover { border-color: var(--primary); color: var(--heading); }
.dfield { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.dfield input, .dfield select { height: 40px; border-radius: 12px; border: 1px solid var(--card-border); background: rgba(255, 255, 255, .06); color: var(--heading); padding: 0 12px; font-size: 15px; color-scheme: dark; }
.dfield input[type=color] { padding: 4px; width: 80px; }
.dfield select option { color: #000; }
.dcheck { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text); margin-top: 6px; }
.dcheck input { width: 18px; height: 18px; accent-color: var(--primary); }
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.opts.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opt { display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: 14px; border: 1.5px solid transparent; background: rgba(255, 255, 255, .05); color: var(--text); font-size: 12px; font-weight: 500; }
.opt:hover { background: rgba(255, 255, 255, .09); }
.opt[aria-pressed=true] { border-color: var(--primary); color: var(--heading); background: rgba(64, 182, 255, .1); }
.sk { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: 9px; background: #F4F4F4; overflow: hidden; }
.sk .r { position: absolute; border-radius: 2px; background: #C9CCD1; }
.sk .r.img { background: #9EA7B3 center / cover no-repeat; border-radius: 3px; }
.sk .r.bt { background: #3A3D42; border-radius: 3px; }
.sk .r.sh { background: rgba(0, 0, 0, .35); border-radius: 0; }
.sk .r.fr { background: none; border: 1px solid rgba(255, 255, 255, .9); }
.sk .r.w { background: rgba(255, 255, 255, .95); }
.sk .r.blk { background: #B7BCC4; border-radius: 3px; }
.sk .none { position: absolute; inset: 20% 30%; border: 2px dashed #B7BCC4; border-radius: 6px; }
.fontsk { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #161616; }
.fontsk b { font-size: 20px; font-weight: 400; line-height: 1.2; }
.fontsk i { font-style: normal; font-size: 12px; color: #5E5E5E; }
.colorsk { display: flex; }
.colorsk i { flex: 1; }
.colorsk i:last-child { flex: .45; }
.sk.plus { display: grid; place-items: center; background: rgba(255, 255, 255, .08); color: var(--muted); font-size: 13px; }
.dstatus { font-size: 12px; color: var(--muted); min-height: 16px; }
.dpreview { display: flex; flex-direction: column; align-items: center; gap: 12px; min-width: 0; }
.dpreview .devices { width: 240px; margin: 0; }
.frame-area { width: 100%; display: flex; justify-content: center; }
.frame { position: relative; border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 20px 60px rgba(0, 0, 0, .55); border: 1px solid var(--card-border); }
.frame iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; background: #fff; }
.frame-empty { position: absolute; inset: 0; display: grid; place-items: center; background: #1a1b1e; color: var(--muted); font-size: 14px; padding: 20px; text-align: center; }
@media (min-width: 1100px) {
  .designer { grid-template-columns: 380px minmax(0, 1fr); align-items: start; }
  .dpanel { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow: auto; }
  .gal-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
}
@media (min-width: 1700px) { .designer { grid-template-columns: 420px minmax(0, 1fr); } }

/* ---------------------------------------------------------------- tablet */
@media (min-width: 700px) {
  .page { padding: 20px 24px 130px; }
  .pagehead { margin-right: 60px; }
  .hero { margin: 0 0 0; border-radius: var(--radius); min-height: 280px; isolation: isolate; }
  .hero-top { padding: 14px 16px 0; }
  .pipeline { margin: 0 -24px 8px; padding: 4px 24px 8px; scroll-padding: 0 24px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
  .profile { right: max(24px, calc((100vw - 760px) / 2 + 24px)); top: 20px; }
}

/* ---------------------------------------------------------------- computer (≥1100px): HoneyBook-style frame in the app's look.
   A slim icon rail on the left, a top bar (search, bell), wide centred pages; ultrawide gets more room and columns. */
.siderail, .topbar { display: none; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.toolbar .segs, .toolbar .search { margin-bottom: 0; }
.toolbar .segs { flex: 1 1 320px; }
.toolbar .search { flex: 1 1 260px; }
@media (min-width: 1100px) {
  :root { --rail: 84px; }
  body { padding-left: var(--rail); }
  .tabbar, .profile.float { display: none; }
  .siderail { display: flex; position: fixed; z-index: 40; inset: 0 auto 0 0; width: var(--rail); flex-direction: column; align-items: center; gap: 4px; padding: 18px 0 16px;
    background: rgba(10, 11, 14, .78); border-right: 1px solid rgba(255, 255, 255, .07); -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6); }
  .rail-logo { margin-bottom: 18px; }
  .rail-logo img { display: block; border-radius: 9px; box-shadow: 0 6px 20px rgba(3, 72, 202, .35); }
  .siderail > a:not(.rail-logo) { width: 66px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0 8px; border-radius: 16px;
    color: var(--muted); font-size: 10.5px; font-weight: 600; transition: background .25s var(--ease), color .2s; }
  .siderail > a:not(.rail-logo):hover { color: var(--heading); background: rgba(255, 255, 255, .06); }
  .siderail > a.on { color: var(--primary); background: rgba(64, 182, 255, .14); }
  .rail-grow { flex: 1; }
  .profile.side { position: relative; top: auto; right: auto; }
  .rail-me { border: 0; background: none; padding: 4px; border-radius: 50%; }
  .rail-me:hover .avatar { box-shadow: 0 0 0 3px rgba(64, 182, 255, .35); }
  .profile.side .menu { left: 56px; right: auto; top: auto; bottom: 0; transform-origin: bottom left; }

  .topbar { display: flex; position: sticky; top: 0; z-index: 30; height: 68px; align-items: center; justify-content: space-between; gap: 24px; padding: 0 40px;
    background: linear-gradient(180deg, rgba(0, 0, 0, .62), rgba(0, 0, 0, .35)); border-bottom: 1px solid rgba(255, 255, 255, .06);
    -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5); }
  .topsearch { position: relative; width: min(480px, 40vw); }
  .topsearch .search { margin: 0; height: 40px; }
  .topsearch kbd { font: 600 11px var(--font); color: var(--muted); border: 1px solid rgba(255, 255, 255, .18); border-radius: 6px; padding: 1px 6px; }
  .results { position: absolute; top: 48px; left: 0; width: max(100%, 520px); max-height: 70vh; overflow: auto; padding: 8px; border-radius: 20px; background: rgba(30, 31, 35, .96);
    border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 24px 60px rgba(0, 0, 0, .65); animation: pop .2s var(--ease); transform-origin: top left; }
  .res { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; color: inherit; }
  .res.on { background: rgba(64, 182, 255, .14); }
  .res-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .07); color: var(--primary); flex: none; }
  .res-main { min-width: 0; display: flex; flex-direction: column; }
  .res-main b { color: var(--heading); font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .res-main small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .res-empty { padding: 16px; color: var(--muted); font-size: 14px; text-align: center; }
  .topbar-right { display: flex; align-items: center; gap: 12px; }
  .bell { position: relative; }
  .badge-dot { position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--danger); color: #fff;
    font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid #0b0c0e; }
  .notes-menu { width: 400px; max-height: 70vh; overflow: auto; padding: 10px 12px; }
  .menu-title { font-size: 17px; font-weight: 600; color: var(--heading); padding: 6px 4px 8px; }

  .page { max-width: 1320px; padding: 28px 48px 64px; }
  .page.wide { max-width: 1680px; }
  .page.project { max-width: 1520px; }
  .page.narrow { max-width: 920px; }
  .pagehead { margin: 0 0 18px; }

  /* Home: greeting, stats strip, card grid */
  .greeting { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 4px 0 22px; }
  .greet-date { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
  .greeting h1 { font-size: 34px; line-height: 41px; font-weight: 700; }
  .greeting p { font-size: 15px; color: var(--muted); margin-top: 2px; }
  .greet-biz { display: flex; align-items: center; gap: 14px; color: var(--text); font-size: 15px; }
  .greet-biz img { border-radius: 11px; }
  .strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); padding: 0; overflow: hidden; margin-bottom: 20px; }
  .strip-item { display: flex; flex-direction: column; gap: 4px; padding: 22px 26px; color: inherit; position: relative; min-width: 0; }
  .strip-item + .strip-item::before { content: ""; position: absolute; left: 0; top: 22px; bottom: 22px; width: 1px; background: var(--separator); }
  a.strip-item:hover { background: rgba(255, 255, 255, .04); }
  .strip-label { font-size: 13px; color: var(--muted); }
  .strip-item b { font: 500 30px/1.15 var(--rounded); color: var(--heading); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px; }
  .strip-item b.tone-success { color: var(--net-amount); } .strip-item b.tone-warning { color: var(--warning); } .strip-item b.tone-danger { color: var(--danger); } .strip-item b.tone-primary { color: var(--primary); }
  .strip-item small { font-size: 12px; color: var(--muted); }
  .dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 20px; align-items: stretch; }
  .dgrid > .card + .card { margin-top: 0; }
  .panel { padding: 18px 20px 12px; min-height: 280px; display: flex; flex-direction: column; }
  .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
  .panel-head h2 { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
  .panel-head a { font-size: 14px; font-weight: 500; }
  .count { font-size: 12px; font-weight: 700; color: #0b0c0e; background: var(--primary); border-radius: 10px; padding: 1px 7px; }
  .panel-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 15px; padding: 20px; text-align: center; }
  .cal-row, .noterow, .mini-row { position: relative; display: flex; align-items: center; gap: 14px; padding: 11px 4px; color: inherit; border-radius: 12px; }
  .cal-row + .cal-row::before, .noterow + .noterow::before, .mini-row + .mini-row::before { content: ""; position: absolute; top: 0; left: 4px; right: 4px; height: 1px; background: var(--separator); transform: scaleY(.5); }
  a.cal-row:hover, a.noterow:hover, a.mini-row:hover { background: rgba(255, 255, 255, .04); }
  /* The date block: one solid colour, the opposite of the page (white with black text on the dark dashboard). */
  .cal-day { width: 50px; height: 52px; flex: none; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: var(--heading); color: #000; }
  .cal-day b { font: 600 19px/1 var(--rounded); color: #000; }
  .cal-day small { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #000; margin-top: 3px; }
  .cal-main, .note-main, .mini-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
  .cal-main b, .note-main b, .mini-main b { font-size: 15px; font-weight: 600; color: var(--heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cal-main small, .note-main small, .mini-main small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
  .note-ic { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, currentColor 14%, transparent); }
  .noterow time { font-size: 12px; color: var(--muted); flex: none; }
  .noterow:not(.unread) .note-main b { font-weight: 500; color: var(--text); }
  .mini-row .rail { height: 34px; align-self: center; }
  .mini-amt { font-size: 15px; font-weight: 600; color: var(--heading); font-variant-numeric: tabular-nums; }
  .warn-banner { margin-bottom: 16px; }

  /* Tables (Transactions, Invoices, Miles, Projects) */
  .table { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: var(--card-shadow); overflow: hidden; }
  .thead, .tr { display: grid; grid-template-columns: var(--cols); align-items: center; column-gap: 16px; padding: 0 20px; }
  .thead { height: 44px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--separator); }
  .tr { position: relative; min-height: 58px; padding-top: 10px; padding-bottom: 10px; font-size: 14px; color: var(--text); }
  .tr + .tr::before { content: ""; position: absolute; top: 0; left: 20px; right: 20px; height: 1px; background: var(--separator); transform: scaleY(.5); }
  a.tr:hover { background: rgba(255, 255, 255, .04); }
  .tr > * { min-width: 0; }
  .tr .rail { height: 32px; align-self: center; }
  .r { text-align: right; justify-self: end; }
  .cell-main { display: flex; flex-direction: column; gap: 2px; }
  .cell-main b { font-size: 15px; font-weight: 600; color: var(--heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cell-main small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cell-cat, .cell-acc { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
  .cell-cat { font-weight: 600; font-size: 13px; }
  .cell-cat > span, .cell-acc > span:first-child { overflow: hidden; text-overflow: ellipsis; }
  .amt-cell { font-size: 15px; font-weight: 600; color: var(--heading); font-variant-numeric: tabular-nums; display: flex; flex-direction: column; align-items: flex-end; }
  .amt-cell.tone-success { color: var(--success); }
  .amt-cell small { font-size: 11px; color: var(--info); font-weight: 600; }
  .txn-table { --cols: 4px 112px minmax(200px, 2fr) minmax(160px, 1.3fr) minmax(170px, 1.3fr) 130px; }
  .inv-table { --cols: 4px minmax(180px, 1.6fr) 170px minmax(170px, 1.2fr) minmax(190px, 1.3fr) 140px; }
  .trip-table { --cols: 4px 150px minmax(170px, 1.4fr) minmax(200px, 1.6fr) 170px 110px; }
  .proj-table { --cols: 44px minmax(220px, 2fr) 190px minmax(170px, 1.1fr) minmax(150px, 1.1fr) minmax(160px, 1.2fr); }
  .cover.sm { width: 44px; height: 44px; border-radius: 9px; }
  .tiles3 { grid-template-columns: repeat(3, minmax(0, 260px)); }
  .pipeline { margin: 0 0 8px; padding: 4px 0 8px; scroll-padding: 0; -webkit-mask-image: none; mask-image: none; }
  .ptile { width: auto !important; flex: 1 1 0; min-width: 100px; padding-right: 12px; }
  .ptile > div { width: auto; }
  .sortbar { margin-top: 6px; }

  /* One project: main + sidebar (the banner, participants and tabs are shared with phones, above) */
  .pcols { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }
  .pside { display: flex; flex-direction: column; gap: 16px; }
  .pside .card + .card { margin-top: 0; }
  .about { padding: 18px 20px 10px; }
  .about h2 { font-size: 17px; font-weight: 600; }
  .about > p { margin: 2px 0 8px; }
  .about-row { position: relative; display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 0; font-size: 14px; }
  .about-row + .about-row::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--separator); transform: scaleY(.5); }
  .about-row span { color: var(--muted); flex: none; }
  .about-row b { color: var(--heading); font-weight: 500; text-align: right; overflow-wrap: anywhere; display: flex; align-items: center; gap: 8px; }
  .pside .summary { margin: 0; }
  .pmain .notes-title h2 { font-size: 22px; }
  .pmain .msg .card { padding: 18px 20px; }
  .ring { width: 220px; height: 220px; }
}
/* 16:9 at 1920 and up: a little more room */
@media (min-width: 1700px) {
  .page { padding-left: 56px; padding-right: 56px; }
  .pcols { grid-template-columns: minmax(0, 1fr) 420px; }
}
/* Ultrawide (2400px+): wider pages, four Home columns, roomier tables */
@media (min-width: 2400px) {
  .page { max-width: 1760px; }
  .page.wide { max-width: 2240px; }
  .page.project { max-width: 1960px; }
  .dgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pcols { grid-template-columns: minmax(0, 1fr) 460px; }
  .strip-item { padding: 26px 32px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
