:root,
:root[data-theme=dark] {
  color-scheme: dark;
  --bg: #101624;
  --surface: #192234;
  --surface-raised: #202c42;
  --ink: #f1f5fd;
  --muted: #9baac2;
  --line: #2a354b;
  --blue: #609dff;
  --blue-soft: #223650;
  --action-ink: #08162b;
  --shadow: 0 12px 32px #090c1538;
  --radius: 19px;
}
:root[data-theme=light] {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-raised: #edf2f8;
  --ink: #111933;
  --muted: #66738a;
  --line: #dbe3ed;
  --blue: #1876ff;
  --blue-soft: #edf4ff;
  --action-ink: #fff;
  --shadow: 0 10px 30px #23304c12;
}
:root { --topbar-height: 60px; --safe-top: env(safe-area-inset-top, 0px); }
body { padding-top: 0; }
.imprez-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: calc(var(--topbar-height) + var(--safe-top));
  padding: var(--safe-top) 0 0;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 91%, transparent);
  backdrop-filter: blur(14px);
}
.imprez-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px 7px clamp(12px, 2.1vw, 30px);
  min-height: 42px;
  color: var(--ink);
  border-radius: 0 999px 999px 0;
  font-size: 1.5rem;
  letter-spacing: -.055em;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
}
.imprez-brand img { flex: none; width: 40px; height: 40px; object-fit: contain; }
.brand-short { display: none; }
.brand-compact .brand-full { display: none; }
.brand-compact .imprez-brand img { width: 25px; height: 25px; }
.brand-compact .brand-short { display: block; }
.brand-compact .imprez-brand {
  min-width: 54px;
  min-height: 38px;
  padding: 7px 15px 7px 11px;
  background: var(--surface);
  color: var(--ink);
  font-size: 1.05rem;
}
.workspace, .workspace.focus-mode, .landing { max-width: none; margin: 0; }
.view, .app-page, .public-view { max-width: none; min-width: 0; }
.view { padding-inline: clamp(14px, 2.5vw, 44px); }
.workspace-header { justify-content: flex-end; padding: 14px clamp(14px, 2.5vw, 44px); }
.focus-mode .view, .public-view { padding-bottom: 35px; }
.landing { padding-inline: clamp(18px, 3.4vw, 56px); }
.landing-header { justify-content: flex-end; padding: 16px 0 0; }
.landing-main { padding-top: clamp(24px, 4vw, 62px); }
.landing-main h1 span { color: var(--blue); }
.preview-sidebar, :root[data-theme=dark] .preview-sidebar,
.search-box, :root[data-theme=dark] .search-box { background: var(--surface-raised); }
.avatar, :root[data-theme=dark] .avatar { background: var(--blue-soft); color: var(--blue); }
.feature-card, :root[data-theme=dark] .feature-card { background: var(--blue-soft); color: var(--ink); }
.feature-card p, :root[data-theme=dark] .feature-card p { color: var(--muted); }
.notice, :root[data-theme=dark] .notice { background: var(--blue-soft); color: var(--ink); border-color: var(--line); }
.button.primary { background: var(--blue); border-color: var(--blue); color: var(--action-ink); box-shadow: none; }
.button, .pill, .chip { border-radius: 999px; }
.bottom-nav a.active .icon { filter: none; }
:where(button, a, input, select, textarea, [tabindex]):focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
@media (min-width: 900px) {
  .bottom-nav {
    top: calc(var(--topbar-height) + var(--safe-top));
    left: env(safe-area-inset-left, 0px);
    padding-top: 23px;
  }
  .launcher-grid {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 27px 18px;
  }
}
.launcher-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.launcher-tools .search-box { flex: 1 1 180px; margin: 0; }
.launcher-tools .field { margin: 0; }
.launcher-tools select { min-width: 140px; }
.launcher-grid .empty-state { grid-column: 1 / -1; }
.launcher-order-list { display: grid; gap: 9px; }
.launcher-order-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(72px, 92px); align-items: center; gap: 12px; }
.launcher-order-row .field { margin: 0; }
.launcher-order-row input { width: 100%; }

/* Dialog header and actions stay in place while the middle scrolls. */
.sheet {
  width: min(560px, calc(100% - 18px));
  max-width: none;
  max-height: calc(100dvh - 26px - var(--safe-top));
  height: auto;
  padding: 0;
  border-radius: 22px;
  inset: auto 0 max(9px, env(safe-area-inset-bottom)) 0;
  margin: 0 auto;
  background: var(--surface);
  box-shadow: 0 20px 90px #0007;
  overflow: hidden;
}
.sheet[open] { display: flex; flex-direction: column; }
.sheet::backdrop { background: #080c16cc; backdrop-filter: blur(4px); }
.sheet-handle { flex: none; margin: 9px auto 0; background: var(--line); }
.sheet-heading {
  flex: none;
  margin: 0;
  padding: 13px 17px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.sheet-heading .icon-button { width: 42px; height: 42px; flex: none; border: 1px solid var(--line); }
.sheet-body { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 16px 18px 20px; }
.sheet.has-actions .sheet-body { padding-bottom: 91px; }
.sheet-actions {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  gap: 6px;
  max-height: 52%;
  padding: 10px 14px 12px;
  background: linear-gradient(transparent, var(--surface) 24%);
  pointer-events: none;
}
.sheet-actions > * { margin: 0; pointer-events: auto; }
.sheet-actions [role=alert] { max-height: 5em; overflow: auto; }
.sheet-actions .button { min-height: 44px; box-shadow: 0 4px 15px #0004; }
@media (min-width: 600px) {
  .sheet { inset: 0; margin: auto; max-height: min(88dvh, 850px); }
  .sheet-heading { padding-inline: 22px; }
  .sheet-body { padding-inline: 23px; }
  .sheet-actions { padding-inline: 20px; }
}
.launcher-tools select,
.launcher-order-row input {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 42px;
  padding: 8px 12px;
}
.launcher-order-row .app-row { padding: 8px 0; border: 0; }
.sheet-actions[hidden] { display: none; }
.pointer-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 31;
  max-width: min(220px, 55vw);
  padding: 9px 14px;
  border-radius: 12px;
  background: var(--blue);
  color: var(--action-ink);
  box-shadow: var(--shadow);
  pointer-events: none;
  overflow-wrap: anywhere;
}
.is-dragging { opacity: .45; }
.settings-account-id { max-width: 52%; overflow-wrap: anywhere; text-align: end; }
.sheet:has(.sheet-actions [role=alert]:not([hidden])) .sheet-body { padding-bottom: 155px; }

.app-icon { --tile-accent: var(--blue); }
.app-icon.mail { --tile-accent: #69b5ff; }
.app-icon.messages { --tile-accent: #a2aaff; }
.app-icon.todos { --tile-accent: #e9b966; }
.app-icon.kanban { --tile-accent: #b49bff; }
.app-icon.products { --tile-accent: #72bfdb; }
.app-icon, .app-icon:is(.mail, .messages, .todos, .kanban, .products) {
  background: color-mix(in srgb, var(--tile-accent) 15%, var(--surface));
  color: color-mix(in srgb, var(--tile-accent) 82%, var(--ink));
  border: 1px solid color-mix(in srgb, var(--tile-accent) 23%, var(--line));
  box-shadow: none;
}
:root[data-theme=light] .app-icon { color: color-mix(in srgb, var(--tile-accent) 33%, var(--ink)); }
.toast { background: var(--surface-raised); color: var(--ink); border: 1px solid var(--line); }
.board-tabs button.active { border-color: var(--blue); }
@media (max-width: 599px) {
  .launcher-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 19px 9px; padding: 17px 0 30px; }
  .launcher-app { font-size: .8rem; gap: 7px; }
  .launcher-app .app-icon { width: 65px; height: 65px; border-radius: 20px; }
  .launcher-app .app-icon .icon { width: 31px; height: 31px; }
}
/* The guest pages show registry data, while private content stays in the vault. */
.boot-status { margin: 20px; }
.boot-status p { margin-bottom: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.public-nav { display: flex; justify-content: flex-end; gap: 5px; padding-block: 20px 4px; }
.public-nav a { display: inline-flex; align-items: center; gap: 12px; min-height: 43px; padding: 10px 17px; border: 1px solid transparent; border-radius: 999px; color: var(--muted); font-size: .82rem; }
.public-nav a > span:first-child { font-size: .6rem; font-variant-numeric: tabular-nums; opacity: .7; }
.public-nav a.active { background: var(--surface); color: var(--ink); border-color: var(--line); }
.public-nav a:hover { color: var(--ink); }
.welcome-main { display: grid; gap: 36px; align-items: center; padding: 40px 0; }
.welcome-copy h1 { font-size: clamp(2.7rem, 5.9vw, 6.9rem); max-width: 12ch; line-height: 1.015; letter-spacing: -.064em; margin: 24px 0; text-wrap: balance; }
.welcome-copy .hero-copy { max-width: 45ch; color: var(--muted); font-size: .96rem; line-height: 1.8; margin-bottom: 26px; }
.welcome-note { color: var(--muted); font-size: .73rem; margin-top: 18px; }
.home-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin: 35px 0 0; padding: 23px 0 0; border-top: 1px solid var(--line); max-width: 530px; }
.home-metrics > div { display: flex; flex-direction: column-reverse; gap: 8px; }
.home-metrics dt { font-size: .62rem; color: var(--muted); }
.home-metrics dd { margin: 0; font-size: 2rem; font-weight: 600; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.data-overview { min-width: 0; padding: 24px 20px 12px; border: 1px solid var(--line); border-radius: 26px; background: linear-gradient(145deg, #1b2940, #141c2e 70%); box-shadow: 0 24px 70px #060b1840; }
.data-overview-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.data-overview-heading .page-kicker { font-size: .54rem; letter-spacing: .15em; margin-bottom: 9px; }
.data-overview h2 { font-size: 1.05rem; font-weight: 550; margin: 0; color: var(--ink); }
.data-logo { width: 62px; height: 62px; object-fit: contain; flex: none; }
.data-network { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 88px 20px; padding: 24px 0; margin: 16px 0; background-image: radial-gradient(#609dff29 1px, transparent 1px); background-size: 17px 17px; }
.data-network::before, .data-network::after { content: ''; position: absolute; top: 50%; left: 10%; width: 80%; height: 1px; background: linear-gradient(90deg,transparent,#609dff99,transparent); transform: rotate(30deg); pointer-events: none; }
.data-network::after { transform: rotate(-30deg); }
.network-chip { position: relative; z-index: 1; justify-self: center; display: flex; align-items: center; gap: 9px; padding: 10px 13px; border: 1px solid #36486c; border-radius: 12px; font-size: .71rem; background: #1b2840; box-shadow: 0 8px 20px #09112250; }
.network-chip > span { color: #9fbbff; font-size: 1.1rem; }
.network-hub { z-index: 2; position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); display: grid; place-content: center; text-align: center; width: 88px; height: 88px; background: #223858; border: 1px solid #609dff80; box-shadow: 0 0 0 9px #609dff08, 0 0 40px #609dff15; border-radius: 26px; color: #d6e5ff; font-size: 2rem; font-weight: 700; letter-spacing: -.07em; }
.network-hub > span { font-size: .38rem; letter-spacing: .13em; color: #a1b5d5; margin-top: 2px; }
.registry-breakdown { border-top: 1px solid var(--line); padding-top: 20px; }
.registry-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 15px; }
.registry-heading h3 { font-size: .74rem; font-weight: 550; margin: 0; }
.registry-heading > span { color: var(--muted); font-size: .61rem; }
.registry-breakdown table { border-collapse: collapse; width: 100%; font-size: .65rem; table-layout: fixed; }
.registry-breakdown th { width: 38%; font-weight: 400; color: var(--muted); text-align: left; }
.registry-breakdown td { padding: 7px 0; }
.registry-breakdown td:last-child { width: 30px; text-align: right; color: #c3d6ff; font-variant-numeric: tabular-nums; }
.registry-breakdown progress { display: block; width: 100%; height: 5px; overflow: hidden; border: 0; border-radius: 99px; background: #27334a; accent-color: #8f9fff; }
.registry-breakdown progress::-webkit-progress-bar { background: #27334a; border-radius: 99px; }
.registry-breakdown progress::-webkit-progress-value { background: linear-gradient(90deg,#609dff,#a2aaff); border-radius: 99px; }
.registry-breakdown progress::-moz-progress-bar { background: #92a6ff; border-radius: 99px; }
.data-source { display: flex; align-items: flex-start; gap: 7px; color: #8fa3c1; font-size: .53rem; line-height: 1.6; margin: 18px 0 5px; }
.data-source .status-dot { margin-top: 4px; width: 4px; height: 4px; }
.welcome-blocks { display: grid; gap: 12px; margin: 12px 0 35px; }
.welcome-blocks article { padding: 23px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.welcome-blocks article .page-kicker { color: #8daeff; display: block; margin-bottom: 30px; }
.welcome-blocks h2 { font-size: 1.05rem; font-weight: 550; }.welcome-blocks p { color: var(--muted); font-size: .82rem; line-height: 1.7; max-width: 50ch; margin: 0; }
.public-apps-main { padding: 55px 0 70px; min-height: 65dvh; }
.public-apps-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; margin: 18px 0; }
.public-apps-heading h1 { font-size: clamp(2.4rem,5.1vw,5.2rem); line-height: 1.06; max-width: 12ch; margin: 0; }
.public-apps-main > .hero-copy { font-size: .9rem; color: var(--muted); max-width: 48ch; margin-bottom: 36px; }
.public-app-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,330px),1fr)); gap: 16px; }
.public-app-card { display: flex; flex-direction: column; color: var(--ink); padding: 26px; border: 1px solid var(--line); border-radius: 23px; background: var(--surface); transition: border-color .15s, transform .15s; }
.public-app-card:hover { border-color: var(--blue); transform: translateY(-2px); }
.public-app-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 27px; }
.public-app-card-top .pill { font-size: .52rem; background: var(--blue-soft); color: var(--blue); }
.public-app-card .app-icon { width: 62px; height: 62px; border-radius: 18px; }
.public-app-card h2 { font-size: 1.45rem; margin-bottom: 9px; }.public-app-card p { font-size: .85rem; color: var(--muted); margin-bottom: 30px; }
.public-app-open { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; font-size: .83rem; color: var(--blue); padding-top: 18px; border-top: 1px solid var(--line); }
.public-app-open .icon { width: 18px; height: 18px; }
.invite-entry input { font-size: .82rem; }
@media (min-width: 900px) {
  .welcome-main { grid-template-columns: 1.1fr 1fr; gap: clamp(35px,5.5vw,100px); padding-block: 50px 65px; min-height: 700px; }
  .data-overview { padding: 30px 30px 18px; }
  .data-network { gap: 106px 20px; margin-block: 25px; }
  .network-hub { width: 96px; height: 96px; }
  .data-logo { width: 75px; height: 75px; }
  .welcome-blocks { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .home-metrics { margin-top: 42px; }
  .home-metrics dd { font-size: 2.65rem; }
}
@media (prefers-reduced-motion: reduce) { .public-app-card { transition: none; } }

.outbound-arrow { display: block; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.public-apps-heading > .pill { background: var(--blue-soft); color: var(--blue); }

/* Modal scroll stays inside the sheet; the underlying document keeps its offset. */
html { scrollbar-gutter: stable; }
html.modal-open { overflow: hidden; overscroll-behavior: none; }
html.modal-open body { overflow: hidden; overscroll-behavior: none; }
.home-more { margin: 0 0 24px; }
.home-more summary { list-style: none; width: fit-content; cursor: pointer; gap: 25px; }
.home-more summary::-webkit-details-marker { display: none; }
.home-more[open] summary { margin-bottom: 10px; }
.home-more[open] summary span { transform: rotate(45deg); }
.pwa-settings { margin-top: 26px; }
.pwa-settings > h2 { font-size: 1rem; }
.pwa-settings > p { font-size: .8rem; }
.pwa-settings-actions { display: flex; flex-wrap: wrap; gap: 9px; margin: 14px 0; }
.pwa-settings-actions .button { font-size: .8rem; }
.pwa-settings[data-state=offline] [data-pwa-text] { color: #e8b76e; }
.pwa-settings[data-state=conflict] [data-pwa-text] { color: #ec8ea4; }
