:root {
  color-scheme: light;
  --bg: #f8f9fc;
  --surface: #fff;
  --ink: #1b1c31;
  --muted: #686b83;
  --soft: #84869c;
  --line: #e9e9f2;
  --purple: #6d4ce8;
  --purple-dark: #5936d7;
  --purple-pale: #f0ebff;
  --cash: #c6b7fd;
  --radius: 16px;
  --shadow: 0 2px 5px #29234b04;
  --sidebar: 234px;
  font: 16px/1.5 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--bg); }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
a { color: var(--purple-dark); text-decoration: none; }
button:disabled { opacity: .52; cursor: not-allowed; }
:focus-visible { outline: 3px solid #997df9; outline-offset: 3px; }
svg { display: inline-block; flex: 0 0 auto; vertical-align: middle; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, strong { font-weight: 700; }
.muted { color: var(--muted); }
.skip { position: fixed; z-index: 30; top: 12px; left: 12px; padding: 10px 16px; color: white; background: var(--purple-dark); border-radius: 8px; transform: translateY(-180%); }
.skip:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.center-actions { text-align: center; padding: 0 20px 28px; }

.shell { min-height: 100vh; }
.sidebar { display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: var(--sidebar); padding: 22px 15px 16px; background: var(--surface); border-right: 1px solid var(--line); z-index: 10; overflow-y: auto; }
.side-brand { display: flex; justify-content: space-between; align-items: center; padding: 0 8px; margin-bottom: 29px; }
.brand { display: inline-flex; gap: 10px; align-items: center; font-size: 29px; font-weight: 790; letter-spacing: -.055em; line-height: 1; color: #1f1a34; }
.brand img { display: block; box-shadow: 0 5px 11px #7353e52d; border-radius: 11px; }
.brand-accent { color: var(--purple); }
.workspace { display: flex; align-items: center; gap: 10px; padding: 10px 9px; border: 1px solid #ebe7f7; border-radius: 12px; background: #fbfaff; margin-bottom: 28px; }
.workspace-icon { display: grid; flex: 0 0 35px; width: 35px; height: 35px; place-items: center; color: var(--purple-dark); background: #eee8ff; border-radius: 9px; }
.workspace-copy { display: grid; min-width: 0; gap: 2px; }
.workspace-copy strong { font-size: .8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-copy small, .profile small { font-size: .75rem; line-height: 1.2; color: var(--muted); }
.nav-caption { color: #74768c; font-size: .67rem; font-weight: 750; letter-spacing: .11em; margin: 0 0 8px 11px; }
.nav-caption.second { margin-top: 26px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 11px; min-height: 44px; color: #565973; border-radius: 9px; margin: 3px 0; font-size: .9rem; font-weight: 560; transition: color .18s, background .18s, transform .18s; }
.nav-link:hover { color: var(--purple-dark); background: #f7f4ff; transform: translateX(2px); }
.nav-link.selected { color: #5f3ede; background: #eee9ff; font-weight: 720; }
.side-bottom { margin-top: auto; padding-top: 28px; }
.demo-panel { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; padding: 13px; background: linear-gradient(135deg, #f5f0ff, #f8f6ff); border: 1px solid #ece5ff; border-radius: 13px; }
.demo-icon { display: grid; place-items: center; width: 30px; height: 30px; background: #ebe2ff; border-radius: 8px; color: var(--purple-dark); }
.demo-panel strong { font-size: .82rem; }
.demo-panel button, .demo-panel a { display: inline-flex; gap: 6px; align-items: center; border: 0; padding: 0; background: transparent; font-weight: 650; color: var(--purple-dark); font-size: .75rem; text-align: left; }
.demo-panel button:hover, .demo-panel a:hover { text-decoration: underline; }
.side-bottom-line { display: flex; gap: 7px; align-items: center; margin: 16px 5px 1px; color: var(--muted); font-size: .75rem; }
.side-bottom-line span { width: 7px; height: 7px; border-radius: 50%; background: #4bb391; }
.main-shell { margin-left: var(--sidebar); }
.topbar { height: 69px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 30px; background: var(--surface); border-bottom: 1px solid var(--line); }
.top-start, .top-end { display: flex; align-items: center; gap: 13px; min-width: 0; }
.top-search { display: flex; align-items: center; gap: 9px; width: min(33vw, 330px); min-height: 39px; padding: 0 10px; color: #6b6d83; border: 1px solid #eeedf4; border-radius: 9px; background: #f9f9fc; font-size: .825rem; text-align: left; transition: border-color .18s, background .18s; }
.top-search:hover { border-color: #dcd0fb; background: #faf7ff; }
.top-search span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
kbd { margin-left: auto; display: inline-flex; align-items: center; min-height: 21px; border: 1px solid #e8e6f0; border-radius: 5px; color: #6c6c83; background: white; font: 600 .69rem 'Segoe UI', sans-serif; white-space: nowrap; padding: 0 5px; }
.top-divider { height: 30px; width: 1px; background: #eae9f2; }
.profile { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); border: 0; background: none; border-radius: 9px; padding: 4px; text-align: left; white-space: nowrap; }
.profile:hover { background: #f7f4ff; }
.profile > span:not(.avatar) { display: grid; gap: 2px; }
.profile strong { font-size: .84rem; line-height: 1.25; }
.profile > svg { color: #787a91; margin-left: 4px; }
.icon-button { display: inline-grid; place-items: center; background: white; border: 1px solid #eae8f2; border-radius: 9px; width: 38px; height: 38px; padding: 0; color: #5f617a; position: relative; transition: color .18s, border-color .18s, background .18s; }
.icon-button:hover, .icon-button.subtle:hover { color: var(--purple-dark); border-color: #e4d9ff; background: #f7f3ff; }
.icon-button.subtle { border-color: transparent; background: transparent; }
.notification > span { width: 7px; height: 7px; background: #8664f4; border-radius: 50%; position: absolute; top: 7px; right: 8px; box-shadow: 0 0 0 2px white; }
.mobile-only, .compact-only, .nav-shade { display: none; }

.avatar { display: inline-grid; flex: 0 0 auto; place-items: center; width: 35px; height: 35px; border-radius: 50%; background: #eae1ff; color: #6344c8; font-weight: 750; font-size: .74rem; letter-spacing: -.035em; }
.avatar-1 { color: #9d4171; background: #fbe2ee; }
.avatar-2 { color: #276ab1; background: #dcecff; }
.avatar-3 { color: #267a64; background: #d9f5ea; }
.avatar-4 { color: #a55c18; background: #fff0d8; }
.content { max-width: 1660px; margin: 0 auto; padding: 25px 30px 40px; outline: none; }
.page-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 22px; }
.page-header h1 { font-size: clamp(1.82rem, 2.5vw, 2.12rem); line-height: 1.18; letter-spacing: -.047em; font-weight: 770; }
.page-header p { font-size: .92rem; color: var(--muted); margin-top: 5px; }
.page-actions, .inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.button, .date-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 12px; color: #4f5069; background: #fff; border: 1px solid #e7e6f0; border-radius: 8px; font-size: .86rem; font-weight: 650; text-align: center; white-space: nowrap; transition: background .18s, border-color .18s, color .18s, transform .18s, box-shadow .18s; }
.date-button { padding: 0 12px; font-weight: 550; }
.button:hover { border-color: #d8cafd; color: var(--purple-dark); background: #faf7ff; }
.button:active:not(:disabled) { transform: translateY(1px) scale(.98); }
.button.primary { color: #fff; background: var(--purple); border-color: var(--purple); box-shadow: 0 3px 6px #6546d422; padding-inline: 14px; }
.button.primary:hover { color: #fff; background: var(--purple-dark); border-color: var(--purple-dark); box-shadow: 0 5px 10px #6546d42f; }
.button.small { min-height: 34px; padding-inline: 9px; font-size: .78rem; }
.text-button { border: 0; padding: 0; background: none; color: var(--purple-dark); font-weight: 680; }
.text-button:hover { text-decoration: underline; }

.hero { position: relative; isolation: isolate; display: grid; align-items: center; min-height: 168px; overflow: hidden; margin-bottom: 19px; border-radius: 17px; color: white; background: linear-gradient(102deg, #623ddb, #7248ec 63%, #663be2); box-shadow: 0 6px 18px #6543d324; }
.hero-copy { position: relative; z-index: 2; padding: 24px 27px; max-width: 68%; }
.hero h2 { font-size: clamp(1.55rem, 2.4vw, 2.08rem); line-height: 1.16; font-weight: 760; letter-spacing: -.038em; margin: 8px 0 8px; }
.hero p { font-size: .93rem; color: #f0e9ff; }
.hero-art { position: absolute; right: 7%; top: 50%; width: clamp(265px, 29vw, 324px); transform: translateY(-49%); z-index: 1; mask-image: radial-gradient(ellipse 48% 49% at 55% 50%, #000 60%, transparent 100%); animation: float-books 8s ease-in-out infinite alternate; }
.hero-lines { position: absolute; width: 470px; height: 470px; top: -148px; right: -136px; border-radius: 50%; opacity: .37; background: repeating-radial-gradient(circle, transparent 0 20px, #e4d2ff57 21px 22px, transparent 23px 32px); transform: rotate(-15deg) scaleY(.72); }
.wave { display: inline-block; transform-origin: 72% 80%; font-size: .85em; animation: wave 1.2s ease 550ms 1 both; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 19px; }
.stat-card, .panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.stat-card { text-align: left; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-height: 136px; padding: 15px 15px 13px; transition: border-color .2s, box-shadow .2s, translate .2s; }
.stat-card:hover { translate: 0 -3px; border-color: #ddd0ff; box-shadow: 0 8px 22px #43337c12; }
.stat-card:nth-child(2) { --reveal-delay: 60ms; }
.stat-card:nth-child(3) { --reveal-delay: 105ms; }
.stat-card:nth-child(4) { --reveal-delay: 150ms; }
.tile { flex: 0 0 auto; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; }
.violet { color: #6746e4; background: #efe9ff; }
.mint { color: #16896b; background: #def7ed; }
.peach { color: #b7641b; background: #fff0df; }
.blue { color: #3973d6; background: #e6efff; }
.lilac { color: #7652cc; background: #f0eaff; }
.stat-copy { display: grid; gap: 1px; }
.stat-label { color: #646780; font-size: .84rem; font-weight: 600; }
.stat-copy > strong { font-size: clamp(1.5rem, 2.24vw, 1.94rem); font-weight: 760; line-height: 1.18; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.stat-detail { margin-top: 3px; color: var(--muted); line-height: 1.35; font-size: .75rem; }
.metric-good, .metric-warm { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; }
.metric-good { color: #197d5e; }
.metric-warm { color: #a65b1d; }

.analytics { display: grid; grid-template-columns: minmax(0, 1.86fr) minmax(0, 1fr); gap: 16px; margin-bottom: 19px; }
.analytics > .panel { padding: 17px 18px 15px; }
.panel-heading { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.panel-heading h2, .section-header h2, .settings-panel h2 { font-size: 1.13rem; line-height: 1.26; letter-spacing: -.025em; }
.panel-heading p, .settings-panel > p { margin-top: 4px; color: var(--muted); font-size: .81rem; }
.select { display: inline-flex; position: relative; flex: 0 0 auto; }
.select select { appearance: none; display: block; width: 100%; min-height: 34px; padding: 0 30px 0 9px; border: 1px solid #e8e7f0; border-radius: 8px; background: #fff; color: #50526c; font-size: .77rem; font-weight: 620; cursor: pointer; }
.select > svg { pointer-events: none; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.chart { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 6px; min-height: 171px; margin-top: 22px; }
.axis { position: relative; display: flex; height: 148px; flex-direction: column; justify-content: space-between; color: var(--muted); font-size: .69rem; text-align: right; transform: translateY(-8px); font-variant-numeric: tabular-nums; }
.plot-area { position: relative; }
.gridlines { display: flex; height: 135px; position: absolute; top: 0; inset-inline: 0; flex-direction: column; justify-content: space-between; pointer-events: none; }
.gridlines span { border-top: 1px dashed #e9e7f3; }
.gridlines span:last-child { border-color: #e6e2f0; border-top-style: solid; }
.bars { display: grid; grid-template-columns: repeat(var(--groups), minmax(0, 1fr)); }
.bar-group { position: relative; display: flex; align-items: center; flex-direction: column; gap: 5px; min-width: 0; }
.bar-pair { position: relative; background: transparent; border: 0; width: 100%; max-width: 76px; height: 135px; display: flex; align-items: flex-end; justify-content: center; gap: 4px; padding: 0 3px; border-radius: 7px; }
.bar { display: block; width: min(39%, 17px); height: var(--amount); border-radius: 4px 4px 0 0; transform-origin: bottom; animation: bar-rise .65s cubic-bezier(.2,.78,.24,1.08) var(--delay) both; }
.online { background: var(--purple); }
.cash { background: var(--cash); }
.bar-pair:hover .bar, .bar-pair:focus-visible .bar { filter: saturate(1.4) brightness(.97); }
.bar-label { color: var(--muted); font-size: .73rem; line-height: 1.25; white-space: nowrap; }
.bar-tooltip { position: absolute; z-index: 3; opacity: 0; pointer-events: none; bottom: 76%; left: 50%; transform: translate(var(--tooltip-x, -50%), 5px); background: #2d2448; color: white; text-align: left; white-space: nowrap; padding: 6px 9px; border-radius: 7px; font-size: .69rem; box-shadow: 0 5px 12px #26163a24; transition: opacity .14s, transform .14s; }
.bar-pair:hover .bar-tooltip, .bar-pair:focus .bar-tooltip { opacity: 1; transform: translate(var(--tooltip-x, -50%), 0); }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; color: var(--muted); font-size: .75rem; }
.legend > span { display: flex; align-items: center; gap: 6px; }
.legend i { height: 9px; width: 9px; border-radius: 3px; }
.breakdown { --reveal-delay: 100ms; }
.breakdown .icon-button { width: 31px; height: 29px; }
.donut { width: 116px; height: 116px; margin: 12px auto 9px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(from -89deg, var(--purple) 0 var(--ratio), var(--cash) var(--ratio) calc(100% * var(--has-data)), #eeeaf9 0deg); animation: donut-appear .7s .16s both; }
.donut-hole { width: 87px; height: 87px; display: flex; flex-direction: column; justify-content: center; align-items: center; border-radius: 50%; background: white; }
.donut-hole strong { line-height: 1.04; font-size: 1.5rem; letter-spacing: -.04em; }
.donut-hole span { color: var(--muted); font-size: .65rem; margin-top: 4px; }
.breakdown-rows { display: grid; }
.breakdown-row { display: grid; gap: 8px; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; padding: 6px 0; }
.breakdown-row + .breakdown-row { border-top: 1px solid #eeedf4; }
.breakdown-row .tile { height: 31px; width: 31px; border-radius: 8px; }
.breakdown-row strong { display: block; color: #282941; font-size: .81rem; line-height: 1.25; }
.breakdown-row small { display: block; color: var(--muted); font-size: .71rem; margin-top: 2px; }
.recent .panel-heading { padding: 17px 18px 13px; }
.recent .button { min-height: 34px; }

.table-scroll { overflow-x: auto; }
.records-scroll { container-type: inline-size; }
.record-label, .invoice-action > span { display: none; }
table { border-collapse: collapse; width: 100%; white-space: nowrap; text-align: left; font-size: .84rem; }
thead { background: #faf9fd; color: #626580; font-size: .77rem; }
th { text-align: left; font-weight: 640; padding: 10px 12px; }
td { padding: 8px 12px; border-bottom: 1px solid #f0eff6; color: #585b74; }
th:first-child, td:first-child { padding-left: 18px; }
th:last-child, td:last-child { padding-right: 18px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfbff; }
td strong, .cell-person strong { color: var(--ink); font-weight: 650; }
.cell-person, .cell-icon { display: inline-flex; align-items: center; gap: 8px; }
.cell-person small { display: block; color: var(--muted); font-size: .74rem; }
.invoice-link { color: var(--purple-dark); font-weight: 590; }
.invoice-link:hover { text-decoration: underline; }
.chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 20px; font-size: .73rem; font-weight: 700; padding: 3px 8px; line-height: 1.4; white-space: nowrap; }
.chip > span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.green { background: #e5f8ef; color: #187450; }
.chip.amber { background: #fff0db; color: #9c5711; }
.chip.red { background: #ffe9ec; color: #a83048; }
.chip.gray { background: #efedf5; color: #5e5b70; }

@container (max-width: 700px) {
  .records-table { display: block; position: relative; white-space: normal; }
  .records-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .records-table tbody { display: grid; gap: 8px; padding: 8px; background: #f8f9fc; }
  .records-table tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 14px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: white; }
  .records-table tbody td { padding: 0; min-width: 0; border: 0; overflow-wrap: anywhere; }
  .records-table tbody :is(.record-primary, .record-wide, .record-action) { grid-column: 1 / -1; }
  .records-table tbody .record-primary { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .records-table tbody .record-action { justify-self: start; }
  .records-table .record-label { display: block; color: var(--muted); font-size: .75rem; font-weight: 630; margin-bottom: 2px; }
  .records-table .chip { white-space: normal; }
  .records-table .record-action .button { min-height: 44px; }
  .records-table .invoice-action { display: inline-flex; gap: 6px; width: auto; height: auto; min-height: 44px; padding: 0 10px; border-color: var(--line); color: var(--purple-dark); font-weight: 650; }
  .records-table .invoice-action > span { display: inline; }
}

.table-tools { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 17px; }
.table-tools .select { margin-left: auto; min-width: 125px; }
.search-box { display: flex; align-items: center; gap: 8px; border: 1px solid #e8e5ef; border-radius: 9px; color: var(--muted); background: #fff; padding-left: 10px; min-width: 0; }
.search-box:focus-within { border-color: #9579fb; box-shadow: 0 0 0 2px #ebe2ff; }
.search-box input { border: 0; outline: 0; background: transparent; color: var(--ink); min-width: 0; width: 100%; padding: 8px 10px 8px 0; font-size: .87rem; }
.table-tools .search-box { width: min(100%, 340px); }
.pagination, .pagination > div { display: flex; align-items: center; gap: 8px; }
.pagination { border-top: 1px solid var(--line); justify-content: space-between; padding: 12px 17px; font-size: .8rem; color: var(--muted); }
.pagination .icon-button { width: 32px; height: 32px; }
.empty { display: grid; justify-items: center; gap: 8px; padding: 38px 18px; text-align: center; }
.empty h3 { font-size: 1.08rem; }
.empty p { max-width: 380px; color: var(--muted); font-size: .9rem; }

.discover-hero { min-height: 205px; }
.discover-hero .hero-art { right: 7%; }
.discovery-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.button.hero-secondary { color: white; background: #ffffff16; border-color: #ffffff66; }
.button.hero-secondary:hover { background: #ffffff28; border-color: #fff; }
.discovery-heading { flex-wrap: wrap; align-items: center; }
.discovery-count { color: var(--muted); font-size: .83rem; margin-top: 4px; }
.discovery-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.distance-tag { position: absolute; right: 8px; top: 8px; font-size: .73rem; font-weight: 750; color: #45336c; background: #fff; border-radius: 20px; padding: 3px 8px; box-shadow: 0 2px 6px #33245e17; }
.library-map { height: clamp(260px, 50vw, 430px); overflow: hidden; margin-bottom: 14px; }
.library-map[hidden] { display: none; }
.area-autocomplete { margin-bottom: 14px; border-bottom: 1px solid var(--line); padding-bottom: 14px; color: var(--muted); font-size: .85rem; }
.area-autocomplete p { margin: 0 0 6px; color: var(--ink); font-weight: 650; }
.area-autocomplete gmp-place-autocomplete { display: block; width: 100%; }
.section-header { margin: 23px 0 12px; display: flex; justify-content: space-between; align-items: end; gap: 12px; }
.section-header > span { color: var(--muted); font-size: .85rem; }
.library-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.library-card { overflow: hidden; display: grid; grid-template-rows: auto 1fr; transition: translate .25s, box-shadow .25s; }
.library-card:hover { translate: 0 -4px; box-shadow: 0 8px 25px #40286613; }
.library-card:nth-child(3n+2) { --reveal-delay: 60ms; }
.library-card:nth-child(3n) { --reveal-delay: 120ms; }
.library-cover { position: relative; display: grid; place-items: center; overflow: hidden; height: 98px; background: #e6dcff; color: #6847d6; }
.cover-1 { background: #d7f3e8; color: #167a65; }
.cover-2 { background: #ffebda; color: #ad5a34; }
.cover-3 { background: #dceaff; color: #396dbb; }
.library-orb { position: absolute; width: 250px; height: 250px; top: -55px; transform: rotate(-22deg) scaleY(.64); background: repeating-radial-gradient(circle, transparent 0 10px, currentColor 11px 12px, transparent 13px 19px); opacity: .12; border-radius: 50%; }
.library-cover-icon { display: grid; width: 57px; height: 57px; place-items: center; position: relative; border-radius: 16px; background: #ffffff90; box-shadow: 0 8px 16px #37245b16; transform: rotate(-7deg); }
.library-cover-icon svg { width: 33px; height: 33px; }
.library-body { display: grid; grid-template-rows: auto auto 1fr auto; gap: 7px; padding: 14px; }
.library-location { color: var(--muted); font-size: .82rem; display: flex; gap: 6px; align-items: flex-start; }
.library-location > svg { color: var(--purple-dark); margin-top: 2px; }
.library-location address { font-style: normal; overflow-wrap: anywhere; }
.library-location address span { display: block; color: var(--ink); font-weight: 650; white-space: pre-line; }
.map-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; margin-top: 3px; }
.map-link:hover { text-decoration: underline; }
.library-body h3, .membership-card h2 { font-size: 1.06rem; letter-spacing: -.019em; }
.library-body > p { color: var(--muted); font-size: .84rem; }
.library-footer { display: flex; gap: 5px; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 11px; margin-top: 5px; }
.library-footer > span { font-size: .75rem; color: var(--muted); }
.library-footer strong { color: var(--ink); font-size: 1rem; }
.membership-card { padding: 17px; }
.membership-top, .plan-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.membership-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 0; margin: 11px 0; border-block: 1px solid var(--line); }
.membership-card dt { font-size: .78rem; color: var(--muted); }
.membership-card dd { margin: 3px 0 0; font-weight: 700; font-size: .88rem; }

.settings-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 15px; align-items: start; }
.settings-panel { padding: 19px; }
.settings-panel > .tile { margin-bottom: 10px; }
.settings-panel form, .gateway-status { margin-top: 15px; }
.settings-panel .inline-actions { margin-top: 12px; }
.settings-panel .notice { margin-top: 14px; }
.plan-summary { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 18px; margin-bottom: 16px; }
.plan-summary > div { display: flex; align-items: center; gap: 11px; }
.plan-summary h2, .guide-step h2 { font-size: 1.04rem; letter-spacing: -.02em; }
.plan-summary p { color: var(--muted); font-size: .83rem; }
.pricing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pricing-card { padding: 20px; }
.pricing-yearly { border-color: #d9cafc; background: linear-gradient(145deg, #fff 60%, #f6f0ff); --reveal-delay: 55ms; }
.pricing-card h2 { font-size: 1.18rem; letter-spacing: -.025em; }
.plan-price { color: var(--muted); margin-top: 4px; }
.plan-price strong { font-size: clamp(1.8rem, 4vw, 2.45rem); color: var(--ink); letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.pricing-card > p.muted { font-size: .87rem; }
.pricing-card .button { margin-top: 15px; }
.savings { color: #197d5e; background: #e4f8ee; border-radius: 20px; font-size: .75rem; font-weight: 700; padding: 4px 9px; }
.pricing-notice, .plan-included { margin-top: 16px; }
.plan-included > p { margin-top: 10px; }
.plan-features { display: grid; gap: 7px; padding: 10px 0; margin: 3px 0 0; list-style: none; border-bottom: 1px solid var(--line); font-size: .88rem; }
.plan-features svg { margin-right: 3px; color: #198364; }
.guide-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 12px; margin: 0; padding: 0; list-style: none; }
.guide-step { display: flex; align-items: flex-start; gap: 12px; padding: 17px; }
.guide-step p { margin-top: 5px; font-size: .9rem; color: var(--muted); }
.guide-link { display: inline-block; font-size: .85rem; font-weight: 700; margin-top: 8px; }
.guide-link:hover { text-decoration: underline; }
.notice { border-radius: 9px; color: #4d3e80; background: #f4efff; padding: 9px 10px; font-size: .8rem; }

.stack-form { display: grid; gap: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: grid; align-content: start; gap: 5px; min-width: 0; color: #42445d; font-size: .86rem; font-weight: 650; }
.field input, .field textarea { width: 100%; min-width: 0; border: 1px solid #e7e4f0; border-radius: 8px; padding: 9px 11px; min-height: 41px; color: var(--ink); background: white; font-weight: 400; }
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus { outline: 2px solid #e4d9ff; outline-offset: 0; border-color: #9478f6; }
.field input[readonly] { background: #faf9fd; }
.field input::placeholder { color: #777990; }
.location-section { min-width: 0; margin: 0; padding: 11px; border: 1px solid #e7def8; border-radius: 9px; background: #fcfaff; }
.location-section legend, .location-section summary { color: #493a73; font-size: .86rem; font-weight: 700; }
.location-section legend { padding-inline: 4px; }
.location-section summary { cursor: pointer; }
.location-section[open] > summary { margin-bottom: 10px; }
.location-fields { display: grid; gap: 9px; }
.field-help { font-size: .78rem; }
.entrance-coordinates { display: grid; gap: 7px; border-top: 1px solid #e7def8; padding-top: 10px; }
.entrance-coordinates .button { justify-self: start; white-space: normal; text-align: left; }
.check-field { display: flex; gap: 7px; align-items: center; color: #4a4c64; font-size: .86rem; }
.check-field input { accent-color: var(--purple); width: 16px; height: 16px; }
.settings-panel form > .button { justify-self: start; }
.form-error { color: #a62f4b; font-size: .84rem; }
.form-error[hidden] { display: none; }
dialog { color: var(--ink); border: 1px solid var(--line); border-radius: 16px; padding: 20px; width: min(460px, calc(100% - 28px)); max-height: calc(100% - 28px); box-shadow: 0 22px 80px #2012413d; }
dialog[open] { animation: dialog-in .25s cubic-bezier(.2,.8,.3,1) both; }
dialog::backdrop { background: #25203868; backdrop-filter: blur(3px); }
.dialog-head { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; margin-bottom: 15px; }
.dialog-head h2 { font-size: 1.23rem; line-height: 1.2; letter-spacing: -.03em; }
.dialog-head p { color: var(--muted); font-size: .85rem; margin-top: 5px; }
.dialog-head .icon-button { margin: -5px -5px 0 0; width: 31px; height: 31px; }
.dialog-actions, .profile-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 7px; }
.confirm-box { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid #efeaf9; border-radius: 10px; background: #faf8ff; font-size: .84rem; }
.confirm-box > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.confirm-box small { display: block; color: var(--muted); font-size: .75rem; overflow-wrap: anywhere; }
.success-box { display: grid; justify-items: center; gap: 6px; padding: 6px 0 12px; text-align: center; }
.success-box strong { font-size: 1.12rem; }
.success-box p, dialog .muted { font-size: .87rem; color: var(--muted); }
.search-dialog-form { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
#search-results { margin-top: 12px; }
#search-results h3 { color: var(--muted); font-size: .79rem; font-weight: 700; margin: 8px 0 4px; }
.search-result, .notification-list button { display: flex; width: 100%; align-items: center; gap: 8px; text-align: left; color: var(--ink); border: 0; border-radius: 8px; background: transparent; padding: 6px; font-size: .86rem; }
.search-result:hover, .notification-list button:hover { background: #f8f4ff; }
.search-result > svg:last-child, .notification-list button > svg:last-child { margin-left: auto; color: var(--soft); }
.search-result small, .notification-list small { display: block; color: var(--muted); font-size: .75rem; }
.notification-list { display: grid; gap: 5px; }
.profile-actions { margin-top: 13px; }
.toasts { display: grid; gap: 7px; position: fixed; right: 18px; bottom: 18px; z-index: 25; max-width: min(360px, calc(100vw - 36px)); }
.toast { display: flex; align-items: center; gap: 8px; padding: 9px 13px 9px 9px; border: 1px solid #eae5f5; border-radius: 10px; background: white; box-shadow: 0 9px 24px #30255123; font-size: .86rem; font-weight: 600; animation: dialog-in .24s both; }
.toast > span { display: grid; place-items: center; flex: 0 0 27px; height: 27px; border-radius: 8px; color: #18845e; background: #e0f7ec; }
.toast.info > span { color: var(--purple-dark); background: var(--purple-pale); }
.boot { min-height: 250px; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--muted); }
#app > .boot { min-height: 100vh; }
.boot-mark { width: 24px; height: 24px; border: 3px solid #e8e0ff; border-top-color: var(--purple); border-radius: 50%; animation: spin .65s linear infinite; }

.auth-shell { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); min-height: 100vh; background: #fff; }
.auth-story { position: sticky; top: 0; height: 100vh; min-height: 520px; display: flex; flex-direction: column; position: relative; overflow: hidden; isolation: isolate; color: white; background: linear-gradient(138deg, #633bde, #7850ee 65%, #673ce4); padding: max(28px, 5vw); }
.auth-story .brand { color: white; position: relative; z-index: 2; }
.auth-story .brand-accent { color: #decfff; }
.auth-story .brand img { box-shadow: 0 0 0 1px #ede0ff71; }
.auth-story-copy { position: relative; z-index: 2; margin-top: clamp(38px, 9vh, 100px); }
.auth-story-copy h2 { font-size: clamp(2.4rem, 5.7vw, 5rem); line-height: 1.03; letter-spacing: -.065em; font-weight: 780; }
.auth-story-copy p { max-width: 360px; margin-top: 12px; font-size: 1.06rem; color: #f2eaff; }
.auth-art { width: min(90%, 650px); position: absolute; right: 0; bottom: 0; mask-image: radial-gradient(ellipse 50% 52% at 54% 52%, #000 57%, transparent 100%); animation: auth-float 7s ease-in-out infinite alternate; }
.auth-content { display: grid; place-items: center; padding: 25px; }
.auth-card { width: min(100%, 420px); }
.auth-card h1 { font-size: 2rem; line-height: 1.16; letter-spacing: -.04em; }
.auth-card > p { color: var(--muted); font-size: .9rem; margin: 6px 0 15px; }
.auth-mobile-brand { display: none; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; gap: 4px; background: #f2eff9; border-radius: 9px; }
.segmented button { display: flex; border: 0; background: none; justify-content: center; align-items: center; gap: 5px; color: #63617b; padding: 7px 5px; border-radius: 6px; font-size: .86rem; font-weight: 650; }
.segmented button[aria-pressed="true"] { background: white; color: var(--purple-dark); box-shadow: 0 1px 4px #30264d14; }
.auth-roles { margin-bottom: 12px; }
.auth-methods { width: min(210px, 100%); }
.auth-methods button { padding: 4px; font-size: .77rem; }
.password-field { position: relative; }
.password-field input { padding-right: 44px; }
.password-field .icon-button { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); }
.forgot { justify-self: end; font-size: .79rem; }
.auth-card .auth-switch { margin: 13px 0; text-align: center; }
.signup-trial { margin-bottom: 13px; }
.signup-trial p { margin-top: 3px; }
.demo-signin { width: 100%; }

.reveal { animation: reveal .47s cubic-bezier(.23,.68,.33,1) var(--reveal-delay, 0ms) both; }
@keyframes reveal { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@keyframes bar-rise { from { transform: scaleY(.02); opacity: .28; } to { transform: scaleY(1); opacity: 1; } }
@keyframes donut-appear { from { transform: scale(.84) rotate(-13deg); opacity: .2; } to { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes float-books { from { transform: translateY(-49%); } to { transform: translateY(-52%); } }
@keyframes auth-float { from { transform: translateY(0); } to { transform: translateY(-10px); } }
@keyframes wave { 0%,100% { rotate: 0deg; } 18%,53% { rotate: 14deg; } 36%,70% { rotate: -9deg; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 1500px) { .hero { min-height: 185px; } .stat-card { min-height: 145px; } }
@media (max-width: 1100px) {
  :root { --sidebar: 205px; }
  .topbar { padding-inline: 20px; }
  .content { padding-inline: 20px; }
  .analytics { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .stats { gap: 10px; }
  .stat-card { padding: 13px 10px; }
  .stat-detail { font-size: .7rem; }
  .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 850px) {
  :root { --sidebar: min(280px, calc(100vw - 42px)); }
  .main-shell { margin-left: 0; }
  .sidebar { transform: translateX(-100%); transition: transform .24s ease; visibility: hidden; overscroll-behavior: contain; padding-top: max(18px, env(safe-area-inset-top)); padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .nav-open .sidebar { transform: translateX(0); visibility: visible; }
  .nav-shade { position: fixed; inset: 0; border: 0; background: #261a4c5e; z-index: 9; }
  .nav-open .nav-shade { display: block; }
  body:has(.nav-open) { overflow: hidden; }
  .mobile-only { display: inline-grid; }
  .top-search { width: min(50vw, 330px); }
  .analytics { grid-template-columns: minmax(0, 1fr) minmax(0, .65fr); }
  .auth-story { padding: 32px 22px; }
}
@media (max-width: 600px) {
  .topbar { position: sticky; top: 0; z-index: 8; height: auto; min-height: 58px; gap: 6px; padding: calc(7px + env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 7px max(10px, env(safe-area-inset-left)); }
  .top-start { gap: 7px; flex: 1; }
  .top-end { gap: 3px; flex: 0 0 auto; }
  .compact-only { display: inline-grid; }
  .mobile-wordmark { display: block; color: var(--ink); font-size: 1.17rem; font-weight: 780; line-height: 1.1; letter-spacing: -.045em; overflow-wrap: anywhere; }
  .top-divider, .top-search, .profile > span:not(.avatar), .profile > svg { display: none; }
  .topbar .icon-button, .topbar .profile { width: 44px; height: 44px; flex: 0 0 44px; justify-content: center; }
  .topbar .profile .avatar { width: 35px; height: 35px; }
  .side-brand .icon-button { width: 44px; height: 44px; }
  .demo-panel button, .demo-panel a { min-height: 38px; }
  .content { padding: 17px max(11px, env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) max(11px, env(safe-area-inset-left)); }
  .page-header { align-items: flex-start; margin-bottom: 15px; gap: 10px; }
  .page-header > div { min-width: 0; overflow-wrap: anywhere; }
  .page-header p { font-size: .85rem; }
  .page-actions { gap: 6px; }
  .button, .button.small, .recent .button, .date-button, .select select, .segmented button { min-height: 44px; }
  .page-actions .button, .inline-actions .button { white-space: normal; max-width: 100%; }
  .hero { margin-bottom: 12px; min-height: 147px; }
  .hero-copy { padding: 17px 13px; max-width: 86%; overflow-wrap: anywhere; }
  .hero h2 { font-size: 1.5rem; }
  .hero p { font-size: .81rem; }
  .hero-art { width: 200px; right: -47px; opacity: .38; }
  .hero-lines { right: -245px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 12px; }
  .stat-card { min-height: 119px; border-radius: 12px; padding: 10px; overflow-wrap: anywhere; }
  .stat-copy { min-width: 0; }
  .stat-copy > strong { font-size: clamp(1.25rem, 6vw, 1.55rem); }
  .tile { width: 33px; height: 33px; }
  .analytics { grid-template-columns: 1fr; gap: 10px; margin-bottom: 12px; }
  .analytics > .panel, .recent .panel-heading, .settings-panel { padding: 13px 11px; }
  .panel-heading { flex-wrap: wrap; align-items: center; }
  .panel-heading > div { min-width: 0; }
  .panel-heading h2 { font-size: 1.05rem; }
  .panel-heading p { font-size: .76rem; }
  .breakdown .icon-button { width: 44px; height: 44px; }
  .chart { grid-template-columns: 35px minmax(0, 1fr); margin-top: 18px; }
  .bar-label { font-size: .65rem; }
  .bar-pair { gap: 2px; padding-inline: 2px; }
  .bar-group:nth-child(-n+2) .bar-tooltip { left: 0; --tooltip-x: 0%; }
  .bar-group:nth-last-child(-n+2) .bar-tooltip { left: auto; right: 0; --tooltip-x: 0%; }
  .chart-many-months .bar-group:nth-child(even):not(:last-child) .bar-label { visibility: hidden; }
  .table-tools, .pagination { padding-inline: 10px; }
  .table-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .table-tools .search-box { width: 100%; }
  .table-tools .select { grid-column: 1 / -1; width: 100%; margin: 0; min-width: 0; }
  .pagination { flex-wrap: wrap; }
  .pagination > div { margin-left: auto; }
  .pagination .icon-button { width: 44px; height: 44px; }
  .library-grid, .settings-grid, .pricing-grid, .guide-steps { grid-template-columns: 1fr; }
  .library-body h3, .membership-card h2, .guide-step > div, .plan-summary > div { min-width: 0; overflow-wrap: anywhere; }
  .library-footer .button { white-space: normal; }
  .discover-hero { min-height: 180px; }
  .discover-hero .hero-copy { max-width: 100%; }
  .discover-hero .hero-art { right: -45px; }
  .discovery-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .discovery-actions .button { white-space: normal; padding: 6px 8px; }
  .discovery-heading { align-items: start; }
  .discovery-filters { width: 100%; }
  .discovery-filters .select { min-width: 0; }
  .field input, .field textarea, .search-box input, .select select { font-size: 1rem; }
  .field input, .field textarea { min-height: 44px; }
  .check-field { min-height: 44px; }
  .check-field input { flex: 0 0 16px; }
  dialog { padding: 14px; max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; }
  .dialog-head .icon-button { width: 44px; height: 44px; }
  .dialog-actions > .button { flex: 1 1 auto; white-space: normal; }
  .confirm-box { flex-wrap: wrap; overflow-wrap: anywhere; }
  .search-dialog-form { grid-template-columns: minmax(0, 1fr) auto; }
  .search-result, .notification-list button { min-height: 44px; overflow-wrap: anywhere; }
  .toasts { bottom: calc(12px + env(safe-area-inset-bottom)); }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-story { display: none; }
  .auth-content { padding: max(20px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
  .auth-mobile-brand { display: block; margin-bottom: 18px; }
  .auth-card h1 { font-size: 1.65rem; }
}
@media (max-width: 420px) {
  .form-row { grid-template-columns: 1fr; }
  .settings-panel form > .button { justify-self: stretch; }
  .dialog-actions { gap: 6px; }
}
@media (max-width: 350px) {
  .discovery-actions { grid-template-columns: 1fr; }
  .page-header .date-button, .page-header .button { padding-inline: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
