/*
 * PROART FLOW V2
 * Product UI layer: neutral surfaces, progressive disclosure, one next action.
 */

:root {
  color-scheme: light;
  --flow-bg: #f4f5f7;
  --flow-surface: #ffffff;
  --flow-surface-soft: #eceef2;
  --flow-surface-muted: #f8f8fa;
  --flow-surface-hover: #fbfbfd;
  --flow-control-hover: #e2e4e9;
  --flow-control-pressed: #d9dce2;
  --flow-input-hover: #e8eaf0;
  --flow-accent-soft: #efedff;
  --flow-text: #15171a;
  --flow-text-2: #676d77;
  --flow-text-3: #6b717c;
  --flow-divider: #e4e6eb;
  --flow-primary: #5b4cf0;
  --flow-primary-hover: #4c3ed7;
  --flow-primary-pressed: #4032be;
  --flow-accent-ink: #5b4cf0;
  --flow-inverse-accent: #4d3dcc;
  --flow-success: #0f7449;
  --flow-success-soft: #e8f7f0;
  --flow-warning: #916000;
  --flow-warning-soft: #fff3d5;
  --flow-danger: #c43a47;
  --flow-danger-soft: #fdecef;
  --flow-info: #1d5fc1;
  --flow-info-soft: #eaf2ff;
  --flow-on-primary: #ffffff;
  --flow-on-success: #ffffff;
  --flow-on-warning: #ffffff;
  --flow-on-danger: #ffffff;
  --flow-on-dark: #ffffff;
  --flow-on-dark-muted: rgba(255,255,255,.68);
  --flow-on-dark-soft: rgba(255,255,255,.9);
  --flow-logo-purple: #6f2bd9;
  --flow-logo-orange: #ff6b00;
  --flow-logo-navy: #0b2857;
  --flow-logo-surface: #ffffff;
  --flow-brand-purple: #6f2bd9;
  --flow-brand-spark: var(--flow-logo-orange);
  --flow-skeleton: #e8eaf0;
  --flow-skeleton-shine: rgba(255,255,255,.72);
  --flow-progress-track: #daddE3;
  --flow-handle: #c9ccd3;
  --flow-muted-marker: #cfd2d8;
  --flow-row-hover: #f2f3f6;
  --flow-toast-bg: #202128;
  --flow-page-glass: rgba(244,245,247,.94);
  --flow-nav-glass: rgba(255,255,255,.94);
  --flow-sheet-glass: rgba(255,255,255,.96);
  --flow-backdrop: rgba(18,19,24,.46);
  --flow-focus-shadow: rgba(91,76,240,.13);
  --flow-danger-focus: rgba(196,58,71,.14);
  --flow-outline-focus: rgba(91,76,240,.25);
  --flow-pattern-dot: rgba(91,76,240,.18);
  --flow-pattern-line: rgba(91,76,240,.075);
  --flow-pattern-glow: rgba(91,76,240,.08);
  --flow-radius-card: 24px;
  --flow-radius-control: 16px;
  --flow-radius-small: 12px;
  --flow-shadow-card: 0 5px 22px rgba(20, 24, 34, .055);
  --flow-shadow-overlay: 0 22px 70px rgba(20, 24, 34, .22);
  --flow-font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Legacy aliases intentionally point at the new semantic system. */
  --bg: var(--flow-bg);
  --panel: var(--flow-surface);
  --paper: var(--flow-surface);
  --paper-soft: var(--flow-surface-muted);
  --ink: var(--flow-text);
  --ink-2: var(--flow-text);
  --muted: var(--flow-text-2);
  --muted-dark: var(--flow-text-2);
  --line: var(--flow-divider);
  --line-dark: var(--flow-divider);
  --primary: var(--flow-primary);
  --coral: var(--flow-primary);
  --danger: var(--flow-danger);
  --success: var(--flow-success);
  --warning: var(--flow-warning);
  --cyan: var(--flow-info);
  --lime: var(--flow-accent-soft);
  --body-font: var(--flow-font);
  --display-font: var(--flow-font);
}

body[data-theme="light"] { color-scheme: light; }
html:has(body[data-theme="dark"]) { background: #0f1117; color-scheme: dark; }

body[data-theme="dark"] {
  color-scheme: dark;
  --flow-bg: #0f1117;
  --flow-surface: #181b23;
  --flow-surface-soft: #252a35;
  --flow-surface-muted: #1e222c;
  --flow-surface-hover: #20242e;
  --flow-control-hover: #2d323e;
  --flow-control-pressed: #353b48;
  --flow-input-hover: #2a303c;
  --flow-accent-soft: #29264a;
  --flow-text: #f4f5f8;
  --flow-text-2: #b9bfca;
  --flow-text-3: #9da5b3;
  --flow-divider: #333846;
  --flow-primary: #6d5cf5;
  --flow-primary-hover: #5f4fe0;
  --flow-primary-pressed: #5142c8;
  --flow-accent-ink: #b1a8ff;
  --flow-inverse-accent: #4d3dcc;
  --flow-success: #58d49a;
  --flow-success-soft: #17382c;
  --flow-warning: #ffd071;
  --flow-warning-soft: #3d321c;
  --flow-danger: #ff8795;
  --flow-danger-soft: #44232b;
  --flow-info: #86b4ff;
  --flow-info-soft: #1c304e;
  --flow-on-primary: #ffffff;
  --flow-on-success: #071b11;
  --flow-on-warning: #231803;
  --flow-on-danger: #250a0f;
  --flow-brand-purple: #b79cff;
  --flow-brand-spark: var(--flow-logo-orange);
  --flow-skeleton: #252a35;
  --flow-skeleton-shine: rgba(255,255,255,.08);
  --flow-progress-track: #383e4c;
  --flow-handle: #596171;
  --flow-muted-marker: #596171;
  --flow-row-hover: #222732;
  --flow-toast-bg: #323744;
  --flow-page-glass: rgba(15,17,23,.94);
  --flow-nav-glass: rgba(24,27,35,.95);
  --flow-sheet-glass: rgba(24,27,35,.97);
  --flow-backdrop: rgba(2,3,6,.72);
  --flow-focus-shadow: rgba(145,132,255,.24);
  --flow-danger-focus: rgba(255,135,149,.25);
  --flow-outline-focus: rgba(145,132,255,.32);
  --flow-pattern-dot: rgba(157,145,255,.22);
  --flow-pattern-line: rgba(157,145,255,.09);
  --flow-pattern-glow: rgba(109,92,245,.14);
  --flow-shadow-card: 0 8px 28px rgba(0,0,0,.25);
  --flow-shadow-overlay: 0 24px 80px rgba(0,0,0,.58);
  --bg: var(--flow-bg);
  --panel: var(--flow-surface);
  --paper: var(--flow-surface);
  --paper-soft: var(--flow-surface-muted);
  --ink: var(--flow-text);
  --ink-2: var(--flow-text);
  --muted: var(--flow-text-2);
  --muted-dark: var(--flow-text-2);
  --line: var(--flow-divider);
  --line-dark: var(--flow-divider);
  --primary: var(--flow-primary);
  --coral: var(--flow-primary);
  --danger: var(--flow-danger);
  --success: var(--flow-success);
  --warning: var(--flow-warning);
  --cyan: var(--flow-info);
  --lime: var(--flow-accent-soft);
}

@media (prefers-color-scheme: dark) {
  html:not(:has(body[data-theme="light"])) { background: #0f1117; color-scheme: dark; }
  body:not([data-theme]) {
    color-scheme: dark;
    --flow-bg: #0f1117;
    --flow-surface: #181b23;
    --flow-surface-soft: #252a35;
    --flow-surface-muted: #1e222c;
    --flow-surface-hover: #20242e;
    --flow-control-hover: #2d323e;
    --flow-control-pressed: #353b48;
    --flow-input-hover: #2a303c;
    --flow-accent-soft: #29264a;
    --flow-text: #f4f5f8;
    --flow-text-2: #b9bfca;
    --flow-text-3: #9da5b3;
    --flow-divider: #333846;
    --flow-primary: #6d5cf5;
    --flow-primary-hover: #5f4fe0;
    --flow-primary-pressed: #5142c8;
    --flow-accent-ink: #b1a8ff;
    --flow-inverse-accent: #4d3dcc;
    --flow-success: #58d49a;
    --flow-success-soft: #17382c;
    --flow-warning: #ffd071;
    --flow-warning-soft: #3d321c;
    --flow-danger: #ff8795;
    --flow-danger-soft: #44232b;
    --flow-info: #86b4ff;
    --flow-info-soft: #1c304e;
    --flow-on-primary: #ffffff;
    --flow-on-success: #071b11;
    --flow-on-warning: #231803;
    --flow-on-danger: #250a0f;
    --flow-brand-purple: #b79cff;
    --flow-brand-spark: var(--flow-logo-orange);
    --flow-skeleton: #252a35;
    --flow-skeleton-shine: rgba(255,255,255,.08);
    --flow-progress-track: #383e4c;
    --flow-handle: #596171;
    --flow-muted-marker: #596171;
    --flow-row-hover: #222732;
    --flow-toast-bg: #323744;
    --flow-page-glass: rgba(15,17,23,.94);
    --flow-nav-glass: rgba(24,27,35,.95);
    --flow-sheet-glass: rgba(24,27,35,.97);
    --flow-backdrop: rgba(2,3,6,.72);
    --flow-focus-shadow: rgba(145,132,255,.24);
    --flow-danger-focus: rgba(255,135,149,.25);
    --flow-outline-focus: rgba(145,132,255,.32);
    --flow-pattern-dot: rgba(157,145,255,.22);
    --flow-pattern-line: rgba(157,145,255,.09);
    --flow-pattern-glow: rgba(109,92,245,.14);
    --flow-shadow-card: 0 8px 28px rgba(0,0,0,.25);
    --flow-shadow-overlay: 0 24px 80px rgba(0,0,0,.58);
    --bg: var(--flow-bg);
    --panel: var(--flow-surface);
    --paper: var(--flow-surface);
    --paper-soft: var(--flow-surface-muted);
    --ink: var(--flow-text);
    --ink-2: var(--flow-text);
    --muted: var(--flow-text-2);
    --muted-dark: var(--flow-text-2);
    --line: var(--flow-divider);
    --line-dark: var(--flow-divider);
    --primary: var(--flow-primary);
    --coral: var(--flow-primary);
    --danger: var(--flow-danger);
    --success: var(--flow-success);
    --warning: var(--flow-warning);
    --cyan: var(--flow-info);
    --lime: var(--flow-accent-soft);
  }
}

html {
  min-width: 320px;
  background: var(--flow-bg);
  color: var(--flow-text);
  font-family: var(--flow-font);
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-padding-bottom: 96px;
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background: var(--flow-bg);
  color: var(--flow-text);
  font-family: var(--flow-font);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.proart-icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.proart-atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.proart-atmosphere::before {
  content: "";
  position: absolute;
  top: -70px;
  right: -45px;
  width: min(48vw, 620px);
  aspect-ratio: 1;
  opacity: .72;
  background:
    radial-gradient(circle, var(--flow-pattern-dot) 0 1.5px, transparent 1.8px) 0 0 / 24px 24px,
    radial-gradient(circle at 52% 44%, var(--flow-pattern-glow), transparent 64%);
  -webkit-mask-image: radial-gradient(circle, #000 0 35%, transparent 72%);
  mask-image: radial-gradient(circle, #000 0 35%, transparent 72%);
}

.proart-atmosphere::after {
  content: "";
  position: absolute;
  left: -150px;
  bottom: 5vh;
  width: 430px;
  height: 230px;
  border: 1px solid var(--flow-pattern-line);
  border-radius: 50%;
  box-shadow: 0 0 0 48px var(--flow-pattern-line), 0 0 0 96px var(--flow-pattern-line);
  opacity: .7;
  transform: rotate(-18deg);
}

.proart-atmosphere span {
  position: absolute;
  width: 9px;
  height: 9px;
  border: 2px solid var(--flow-bg);
  border-radius: 50%;
  background: var(--flow-primary);
  box-shadow: 0 0 0 1px var(--flow-pattern-dot);
}

.proart-atmosphere span:first-child { top: 16%; right: 9%; }
.proart-atmosphere span:last-child { right: 24%; bottom: 14%; width: 7px; height: 7px; opacity: .7; }

body::before,
body::after,
.shell::before,
.shell::after { display: none !important; content: none !important; }

* { box-sizing: border-box; }

button,
input,
select,
textarea { font: inherit; }

button,
[role="button"],
select { -webkit-tap-highlight-color: transparent; }

button {
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--flow-radius-control);
  background: var(--flow-primary);
  color: var(--flow-on-primary);
  box-shadow: none;
  font-weight: 700;
  line-height: 1.15;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease, opacity .16s ease, transform .12s ease;
}

button:hover { border: 0; background: var(--flow-primary-hover); box-shadow: none; transform: none; }
button:active { background: var(--flow-primary-pressed); transform: scale(.985); }
button:disabled { opacity: .48; cursor: not-allowed; transform: none; }

button.secondary,
button.ghost {
  border: 0;
  background: var(--flow-surface-soft);
  color: var(--flow-text);
  box-shadow: none;
}

button.secondary:hover,
button.ghost:hover { border: 0; background: var(--flow-control-hover); color: var(--flow-text); box-shadow: none; }
button.secondary:active,
button.ghost:active { background: var(--flow-control-pressed); }

button.danger,
button.secondary.danger {
  background: var(--flow-danger-soft);
  color: var(--flow-danger);
}

button.danger:hover,
button.secondary.danger:hover { background: var(--flow-danger-soft); color: var(--flow-danger); }

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible,
[tabindex]:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--flow-primary);
  outline-offset: 2px;
}

input,
textarea,
select {
  width: 100%;
  min-height: 50px;
  padding: 13px 15px;
  border: 1px solid transparent;
  border-radius: var(--flow-radius-control);
  outline: none;
  background: var(--flow-surface-soft);
  color: var(--flow-text);
  box-shadow: none;
  font-size: 16px;
  font-weight: 550;
  transition: background-color .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.theme-settings {
  display: grid;
  gap: 14px;
}

.theme-settings-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
}

.theme-settings-head > span:last-child { display: grid; min-width: 0; gap: 2px; }
.theme-settings-head strong { color: var(--flow-text); font-size: 14px; font-weight: 800; }
.theme-settings-head small { color: var(--flow-text-2); font-size: 11px; overflow-wrap: anywhere; }

.theme-preference {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  padding: 5px;
  border-radius: 18px;
  background: var(--flow-surface-soft);
}

button.theme-choice,
button.theme-choice:hover,
button.theme-choice:active {
  min-width: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--flow-text-2);
  box-shadow: none;
  font-size: 11px;
  transform: none;
}

button.theme-choice svg { width: 18px; height: 18px; flex: 0 0 auto; }
button.theme-choice:hover { background: var(--flow-control-hover); color: var(--flow-text); }
button.theme-choice[aria-pressed="true"] {
  border-color: var(--flow-divider);
  background: var(--flow-surface);
  color: var(--flow-accent-ink);
  box-shadow: var(--flow-shadow-card);
}

.flow-inline-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: currentColor;
}

textarea { min-height: 112px; resize: vertical; line-height: 1.5; }

input:hover,
textarea:hover,
select:hover { border-color: transparent; background: var(--flow-input-hover); box-shadow: none; }

input:focus,
textarea:focus,
select:focus {
  border-color: var(--flow-primary);
  background: var(--flow-surface);
  box-shadow: 0 0 0 3px var(--flow-focus-shadow);
}

input::placeholder,
textarea::placeholder { color: var(--flow-text-3); opacity: 1; }

input[readonly] { border: 0; background: var(--flow-surface-muted); color: var(--flow-text-2); }

a { color: var(--flow-accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }

.hidden { display: none !important; }

.shell {
  position: relative;
  z-index: 1;
  width: min(1280px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 18px 24px 36px;
}

.topbar {
  position: relative;
  top: auto;
  z-index: 40;
  min-height: 58px;
  margin: 0 0 18px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.topbar:active { transform: none; }

.brand { gap: 10px; }
.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 0;
  border-radius: 13px;
  background: var(--flow-logo-surface);
  color: var(--flow-logo-purple);
  box-shadow: inset 0 0 0 1px rgba(11,40,87,.09), 0 8px 18px var(--flow-pattern-glow);
  transform: none;
}
.brand-mark::after { display: none; }
.brand-mark svg { width: 33px; height: 33px; }
.brand-title { color: var(--flow-text); font-family: var(--flow-font); font-size: 16px; font-weight: 800; letter-spacing: -.04em; text-transform: none; }
.brand-title::after { display: none; }
.brand-title .brand-pro { color: var(--flow-brand-purple); }
.brand-title .brand-art { color: var(--flow-logo-orange); }
.brand-sub { margin-top: 1px; color: var(--flow-text-2); font-size: 11px; font-weight: 550; letter-spacing: 0; }

.mobile-brandbar { display: none; }

.top-actions { gap: 8px; }
.sync-state {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--flow-surface-soft);
  color: var(--flow-text-2);
  box-shadow: none;
  font-size: 11px;
}
.sync-state.ready { color: var(--flow-success); background: var(--flow-success-soft); }
.sync-state.error { color: var(--flow-danger); background: var(--flow-danger-soft); }
.sync-state.syncing { color: var(--flow-info); background: var(--flow-info-soft); }
.icon-button,
.top-actions .icon-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 14px;
  background: var(--flow-surface);
  color: var(--flow-text);
  box-shadow: var(--flow-shadow-card);
}
.icon-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; }

.mode-switch { border: 0; border-radius: 14px; background: var(--flow-surface); box-shadow: var(--flow-shadow-card); }
.mode-switch span { color: var(--flow-text-2); }
.mode-switch select { min-height: 44px; padding-block: 8px; background: transparent; font-size: 13px; }

/* Auth */
.panel {
  margin: 36px auto 0;
  border: 0;
  border-radius: 30px;
  overflow: hidden;
  background: var(--flow-surface);
  box-shadow: 0 24px 90px rgba(20, 24, 34, .12);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, .92fr);
  gap: 0;
  padding: 0;
}

.hero-copy {
  min-height: 560px;
  padding: 64px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(145deg, #3f31b8 0%, #4d3dcc 58%, #5948d8 100%);
  color: #fff;
  box-shadow: none;
}
.hero-copy::before,
.hero-copy::after { display: none; }
.eyebrow { color: rgba(255,255,255,.9); font-family: var(--flow-font); font-size: 12px; font-weight: 700; letter-spacing: .09em; }
.headline { max-width: 650px; margin: 24px 0 18px; color: #fff; font-family: var(--flow-font); font-size: clamp(38px, 5vw, 68px); font-weight: 800; line-height: 1.02; letter-spacing: -.065em; }
.gradient-text { color: #fff; background: none; -webkit-text-fill-color: currentColor; }
.lead { max-width: 560px; color: rgba(255,255,255,.9); font-size: 16px; line-height: 1.6; }
.hero-copy .chip { border: 0; background: rgba(255,255,255,.13); color: #fff; }
.hero-copy .chip.good,
.hero-copy .chip.warn { border: 0; background: rgba(255,255,255,.13); color: #fff; }
.auth-box { padding: 56px 48px; border: 0; border-radius: 0; background: var(--flow-surface); box-shadow: none; }
.section-title { color: var(--flow-text); font-family: var(--flow-font); font-size: 24px; font-weight: 800; letter-spacing: -.045em; }
.section-sub { margin-top: 7px; color: var(--flow-text-2); font-size: 14px; line-height: 1.5; }
.form-grid { gap: 12px; }
.field { gap: 7px; color: var(--flow-text-2); font-size: 12px; font-weight: 650; }
.progress { gap: 6px; }
.step-pill { min-height: 32px; border: 0; background: var(--flow-surface-soft); color: var(--flow-text-2); font-size: 11px; }
.step-pill.active { background: var(--flow-accent-soft); color: var(--flow-primary); }

/* App shell */
.app-layout {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 18px;
  display: block;
  min-width: 0;
}

.profile-card,
.content-card {
  border: 0;
  border-radius: var(--flow-radius-card);
  background: var(--flow-surface);
  box-shadow: var(--flow-shadow-card);
}

.profile-card { padding: 18px; }
.avatar-row { gap: 11px; }
.avatar {
  width: 50px;
  height: 50px;
  flex-basis: 50px;
  border: 0;
  border-radius: 17px;
  background: var(--flow-accent-soft);
  color: var(--flow-primary);
  box-shadow: none;
  font-size: 18px;
  font-weight: 800;
}
.profile-name { color: var(--flow-text); font-family: var(--flow-font); font-size: 15px; font-weight: 750; letter-spacing: -.025em; }
.profile-sub { color: var(--flow-text-2); font-size: 11px; }
.avatar-actions { gap: 6px; }
.avatar-actions button { min-height: 44px; padding: 0 10px; border-radius: 12px; font-size: 11px; }
.badge { border: 0; border-radius: 999px; background: var(--flow-accent-soft); color: var(--flow-primary); font-size: 10px; }
.status { border: 0; border-radius: 13px; background: var(--flow-surface-soft); color: var(--flow-text-2); font-size: 11px; }
.status.error { background: var(--flow-danger-soft); color: var(--flow-danger); }
.profile-card .status { margin-top: 0; background: var(--flow-surface-soft); color: var(--flow-text-2); }
.auth-box .status { border: 0; background: var(--flow-info-soft); color: var(--flow-info); }
.auth-box .status.error { border: 0; background: var(--flow-danger-soft); color: var(--flow-danger); }

.nav {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 6px;
  border: 0;
  border-radius: 20px;
  background: var(--flow-surface);
  box-shadow: var(--flow-shadow-card);
}
.nav button,
.nav button:hover,
.nav button.active {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  justify-content: flex-start;
  gap: 11px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--flow-text-2);
  box-shadow: none;
  font-size: 13px;
  font-weight: 650;
}
.nav button:hover { background: var(--flow-surface-muted); color: var(--flow-text); }
.nav button.active { background: var(--flow-accent-soft); color: var(--flow-primary); }
.nav-icon { width: 23px; height: 23px; flex-basis: 23px; border: 0; background: none; box-shadow: none; }
.nav button.active .nav-icon { color: var(--flow-primary); background: none; box-shadow: none; }
.nav-icon svg { width: 22px; height: 22px; stroke-width: 1.8; }
.nav-label { color: inherit; font-size: inherit; font-weight: inherit; }

body[data-app-mode="user"] .content {
  width: 100%;
  max-width: 880px;
  justify-self: center;
}

.content {
  min-width: 0;
  margin: 0;
  padding: 0;
  gap: 16px;
}

.hint-strip {
  min-height: 42px;
  padding: 11px 14px 11px 40px;
  border: 0;
  border-radius: 14px;
  background: var(--flow-info-soft);
  color: var(--flow-info);
  box-shadow: none;
  font-size: 12px;
}
.hint-strip::before { margin-left: -24px; color: var(--flow-info); }

.tab-view { gap: 16px; }
.content-card { padding: 24px; }
.content-card.dark {
  min-height: 0;
  padding: 24px;
  border: 0;
  background: var(--flow-surface);
  color: var(--flow-text);
  box-shadow: var(--flow-shadow-card);
}
.content-card.dark::before,
.content-card.dark::after { display: none; }
.content-card.dark .card-head h2,
.content-card.dark .card-head h3,
.content-card.dark .card-head p { color: inherit; }

.card-head { margin-bottom: 18px; gap: 14px; }
.card-head h2,
.card-head h3,
.card-head h4 { color: var(--flow-text); font-family: var(--flow-font); font-weight: 800; letter-spacing: -.045em; }
.card-head h2 { font-size: 26px; line-height: 1.2; }
.card-head h3 { font-size: 20px; line-height: 1.3; }
.card-head p { max-width: 680px; margin-top: 5px; color: var(--flow-text-2); font-size: 13px; line-height: 1.5; }
.screen-eyebrow { margin-bottom: 5px; color: var(--flow-primary); font-size: 11px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }

.split { gap: 12px; }
.row { gap: 9px; }
.toolbar { gap: 8px; }
.toolbar button { min-height: 44px; font-size: 12px; }

/* Home */
.home-screen { display: grid; gap: 14px; }
.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 2px 2px;
}
.home-header > div { min-width: 0; }
.home-header h2 { margin: 0; color: var(--flow-text); font-family: var(--flow-font); font-size: 30px; font-weight: 800; line-height: 1.15; letter-spacing: -.055em; }
.home-header h2,
.home-header p { overflow-wrap: anywhere; }
.home-header p { margin: 5px 0 0; color: var(--flow-text-2); font-size: 13px; }
.home-avatar-button,
.home-avatar-button:hover,
.home-avatar-button:active {
  width: 52px;
  height: 52px;
  min-height: 52px;
  flex: 0 0 52px;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  box-shadow: none;
  transform: none;
}
.home-avatar {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  overflow: hidden;
  border-radius: 18px;
  background: var(--flow-accent-soft) center/cover no-repeat;
  color: var(--flow-primary);
  font-size: 18px;
  font-weight: 800;
}
.home-avatar.has-image { color: transparent; }

.home-focus-card {
  position: relative;
  min-height: 218px;
  overflow: hidden;
  padding: 24px;
  border: 0;
  border-radius: 28px;
  background: linear-gradient(145deg, #3f31b8, #4f3fd0 72%, #5c4bdd);
  color: #fff;
  box-shadow: 0 15px 36px rgba(74, 61, 205, .22);
}
.home-focus-card::after {
  content: "";
  position: absolute;
  right: -36px;
  top: -44px;
  width: 170px;
  height: 170px;
  border: 34px solid rgba(255,255,255,.08);
  border-radius: 50%;
  pointer-events: none;
}
.home-focus-card > * { position: relative; z-index: 1; }
.home-focus-loading { min-height: 168px; display: grid; place-items: center; color: rgba(255,255,255,.7); }
.home-focus-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.home-focus-kicker { color: rgba(255,255,255,.9); font-size: 11px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.home-focus-status { min-height: 28px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 999px; background: rgba(255,255,255,.14); color: #fff; font-size: 11px; font-weight: 700; }
.home-focus-card h3 { max-width: 520px; margin: 24px 0 12px; color: #fff; font-family: var(--flow-font); font-size: 27px; font-weight: 800; line-height: 1.15; letter-spacing: -.05em; }
.home-focus-card p { max-width: 540px; margin: 0; color: rgba(255,255,255,.9); font-size: 14px; line-height: 1.5; }
.home-focus-details { display: grid; gap: 4px; color: rgba(255,255,255,.92); font-size: 13px; }
.home-focus-card h3,
.home-focus-card p,
.home-focus-details { overflow-wrap: anywhere; }
.home-focus-link,
.home-focus-card > button:not(.home-focus-link) {
  width: auto;
  min-height: 44px;
  margin-top: 22px;
  padding: 0 15px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: var(--flow-primary);
  box-shadow: none;
  font-size: 13px;
}
.home-focus-link:hover,
.home-focus-card > button:not(.home-focus-link):hover { background: rgba(255,255,255,.9); color: var(--flow-primary); }

.home-quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.home-quick-actions button,
.home-quick-actions button:hover,
.home-quick-actions button:active {
  min-height: 88px;
  padding: 14px;
  justify-content: flex-start;
  gap: 12px;
  border: 0;
  border-radius: 20px;
  background: var(--flow-surface);
  color: var(--flow-text);
  box-shadow: var(--flow-shadow-card);
  text-align: left;
  transform: none;
}
.home-quick-actions button { min-width: 0; }
.home-quick-actions strong { overflow-wrap: anywhere; }
.quick-action-icon { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border-radius: 14px; background: var(--flow-accent-soft); color: var(--flow-primary); }
.quick-action-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.home-quick-actions button > span:last-child { display: grid; min-width: 0; gap: 3px; }
.home-quick-actions strong { font-size: 14px; font-weight: 750; }
.home-quick-actions small { color: var(--flow-text-2); font-size: 11px; font-weight: 550; }

.home-balance-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  border-radius: var(--flow-radius-card);
  background: var(--flow-surface);
  box-shadow: var(--flow-shadow-card);
}
.home-balance-card > div { display: grid; min-width: 0; gap: 3px; }
.home-balance-card span { color: var(--flow-text-2); font-size: 12px; }
.home-balance-card strong { color: var(--flow-text); font-size: clamp(20px, 5vw, 26px); font-weight: 800; letter-spacing: -.05em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.home-balance-card small { color: var(--flow-text-3); font-size: 11px; }
.home-balance-card button { width: auto; min-width: 104px; }

.home-metrics-section { padding: 8px 2px 0; }
.section-heading-inline { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-heading-inline h3 { margin: 0; color: var(--flow-text); font-size: 18px; font-weight: 800; letter-spacing: -.035em; }
.section-heading-inline span { color: var(--flow-text-3); font-size: 11px; }
.home-metrics,
#statsGrid.home-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.home-metrics .kpi {
  min-height: 82px;
  padding: 14px;
  border: 0;
  border-radius: 18px;
  background: var(--flow-surface);
  box-shadow: var(--flow-shadow-card);
}
.home-metrics .kpi::before { display: none; }
.home-metrics .kpi .label { color: var(--flow-text-2); font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.home-metrics .kpi .value { margin-top: 8px; color: var(--flow-text); font-family: var(--flow-font); font-size: 19px; font-weight: 800; letter-spacing: -.04em; }

/* Feed */
.project-feed-screen { padding: 0; background: transparent; box-shadow: none; }
.project-feed-screen > .card-head { margin: 0 0 14px; padding: 2px 2px 0; }
.project-feed-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-bottom: 12px; }
.native-state-control { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; opacity: 0; pointer-events: none; }
.segmented-control { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; min-height: 50px; padding: 3px; border-radius: 15px; background: var(--flow-surface-soft); }
.segmented-control button,
.segmented-control button:hover,
.segmented-control button:active {
  min-height: 44px;
  padding: 0 13px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--flow-text-2);
  box-shadow: none;
  font-size: 13px;
  transform: none;
}
.segmented-control button.active { background: var(--flow-surface); color: var(--flow-text); box-shadow: 0 1px 4px rgba(20,24,34,.08); }
.sort-select { position: relative; display: flex; min-width: 148px; align-items: center; border-radius: 15px; background: var(--flow-surface-soft); color: var(--flow-text-2); }
.sort-select:focus-within {
  background: var(--flow-surface);
  box-shadow: 0 0 0 3px var(--flow-primary);
}
.sort-select > span { position: absolute; left: 13px; z-index: 1; display: grid; place-items: center; pointer-events: none; }
.sort-select > span svg { width: 17px; height: 17px; }
.sort-select select { min-height: 46px; padding: 10px 12px 10px 34px; border: 0; background: transparent; box-shadow: none; font-size: 12px; }

.items { display: grid; gap: 10px; }
.request-feed-note { padding: 2px 2px 4px; color: var(--flow-text-2); font-size: 11px; line-height: 1.5; }
.request-feed-group { display: grid; gap: 9px; }
.request-feed-group + .request-feed-group { margin-top: 12px; padding-top: 15px; border-top: 1px solid var(--flow-divider); }
.request-feed-heading { display: flex; min-height: 26px; align-items: center; justify-content: space-between; gap: 10px; padding: 0 2px; }
.request-feed-heading h3 { margin: 0; color: var(--flow-text); font-size: 13px; font-weight: 800; letter-spacing: 0; }
.request-feed-heading span { min-width: 24px; color: var(--flow-text-2); font-size: 11px; font-weight: 700; text-align: right; }
.request-feed-group.external .request-feed-heading h3 { color: var(--flow-text-2); font-weight: 700; }
.request-feed-items { display: grid; gap: 10px; }
.project-card {
  position: relative;
  display: block;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 22px;
  background: var(--flow-surface);
  box-shadow: var(--flow-shadow-card);
}
.project-card::before,
.project-card::after { display: none !important; }
.project-card:hover { border: 0; box-shadow: 0 7px 26px rgba(20,24,34,.075); transform: none; }
.project-card-hitarea:focus-visible,
.customer-project-hitarea:focus-visible { outline: none; }
.project-card:focus-within,
.customer-project-card:focus-within {
  box-shadow: inset 0 0 0 3px var(--flow-primary), var(--flow-shadow-card);
}
.project-card.urgent-fire,
.project-card.due-today,
.project-card.due-critical,
.project-card.due-soon,
.project-card.priority-request { border: 0; background: var(--flow-surface); box-shadow: var(--flow-shadow-card); }
.project-card.external-request,
.project-card.external-request:hover,
.project-card.external-request.urgent-fire,
.project-card.external-request.due-today,
.project-card.external-request.due-critical,
.project-card.external-request.due-soon,
.project-card.external-request.priority-request {
  border: 1px solid var(--flow-divider);
  background: var(--flow-surface-muted);
  box-shadow: none;
}
.project-card.external-request:focus-within {
  box-shadow: inset 0 0 0 3px var(--flow-primary);
}
.project-card-hitarea,
.project-card-hitarea:hover,
.project-card-hitarea:active {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 17px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--flow-text);
  box-shadow: none;
  text-align: left;
  transform: none;
}
.project-card-top { display: flex; min-height: 24px; align-items: center; justify-content: space-between; gap: 10px; }
.project-card-meta { display: flex; min-width: 0; align-items: center; gap: 8px; }
.project-card-number { flex: 0 0 auto; color: var(--flow-text); font-size: 12px; font-weight: 800; }
.project-card-date { min-width: 0; color: var(--flow-text-2); font-size: 12px; font-weight: 650; overflow-wrap: anywhere; }
.project-card-badge { display: inline-flex; min-height: 25px; align-items: center; padding: 0 9px; border-radius: 999px; background: var(--flow-accent-soft); color: var(--flow-primary); font-size: 10px; font-weight: 750; }
.project-card-badge.urgent { background: var(--flow-danger-soft); color: var(--flow-danger); }
.project-card-badge.response { background: var(--flow-info-soft); color: var(--flow-info); }
.project-card-badge.external { background: var(--flow-surface-soft); color: var(--flow-text-2); }
.project-card h3 { margin: 10px 0 5px; color: var(--flow-text); font-size: 17px; font-weight: 800; line-height: 1.3; letter-spacing: 0; }
.project-card.external-request h3 { font-size: 16px; font-weight: 700; letter-spacing: 0; }
.project-card-location { display: flex; min-width: 0; align-items: flex-start; gap: 6px; color: var(--flow-text-2); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.project-card-location > .flow-inline-icon { margin-top: 1px; color: var(--flow-text-3); }
.project-card-bottom { display: grid; grid-template-columns: minmax(0, 1fr) 30px; gap: 10px; align-items: center; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--flow-divider); }
.project-card-bottom > div { display: grid; min-width: 0; gap: 2px; }
.project-card-bottom strong { overflow: hidden; color: var(--flow-text); font-size: 14px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.project-card-bottom span { overflow: hidden; color: var(--flow-text-2); font-size: 11px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.project-card-capacity { min-width: 42px; text-align: right; }
.project-card-capacity strong { font-size: 15px; }
.project-card-chevron { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--flow-surface-soft); color: var(--flow-text-2) !important; font-size: 23px !important; font-weight: 500 !important; }
.project-card-chevron .flow-inline-icon { width: 15px; height: 15px; }

/* Generic lists and states */
.group-heading { margin: 18px 2px 7px; color: var(--flow-text-2); font-family: var(--flow-font); font-size: 12px; font-weight: 700; letter-spacing: 0; text-transform: none; }
.item {
  gap: 11px;
  padding: 16px;
  border: 0;
  border-radius: 20px;
  background: var(--flow-surface);
  box-shadow: var(--flow-shadow-card);
}
.item:hover { border: 0; box-shadow: var(--flow-shadow-card); transform: none; }
.item::before,
.item::after { display: none !important; }
.item-title { color: var(--flow-text); font-family: var(--flow-font); font-size: 15px; font-weight: 750; letter-spacing: -.025em; }
.item-meta { color: var(--flow-text-2); font-size: 12px; line-height: 1.5; }
.item-top { gap: 10px; }

.chip-row { gap: 6px; }
.chip {
  min-height: 26px;
  padding: 5px 9px;
  border: 0;
  border-radius: 999px;
  background: var(--flow-surface-soft);
  color: var(--flow-text-2);
  font-size: 10px;
  font-weight: 700;
}
a.chip,
button.chip { min-height: 44px; }
.chip.good { border: 0; background: var(--flow-success-soft); color: var(--flow-success); }
.chip.warn { border: 0; background: var(--flow-warning-soft); color: var(--flow-warning); }
.chip.bad { border: 0; background: var(--flow-danger-soft); color: var(--flow-danger); }
.chip.tag { border: 0; background: var(--flow-info-soft); color: var(--flow-info); }

.empty {
  position: relative;
  min-height: 170px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 28px 20px;
  border: 0;
  border-radius: 22px;
  background: var(--flow-surface);
  color: var(--flow-text-2);
  box-shadow: var(--flow-shadow-card);
  font-size: 13px;
  text-align: center;
}
.empty:not(.loading-skeleton)::before {
  content: "";
  width: 66px;
  height: 50px;
  border: 1px solid var(--flow-divider);
  border-radius: 17px;
  background:
    linear-gradient(90deg, var(--flow-primary) 0 62%, var(--flow-brand-spark) 62%) 12px 12px / 42px 4px no-repeat,
    radial-gradient(circle, var(--flow-pattern-dot) 0 3px, transparent 3.5px) 12px 27px / 13px 13px no-repeat,
    linear-gradient(var(--flow-divider), var(--flow-divider)) 31px 28px / 24px 3px no-repeat,
    linear-gradient(var(--flow-divider), var(--flow-divider)) 31px 36px / 16px 3px no-repeat,
    var(--flow-surface-muted);
  box-shadow: 7px 7px 0 var(--flow-accent-soft);
}
.empty:not(.loading-skeleton)::after {
  content: "";
  position: absolute;
  top: calc(50% - 48px);
  left: calc(50% + 25px);
  width: 8px;
  height: 8px;
  border: 2px solid var(--flow-bg);
  border-radius: 3px;
  background: var(--flow-brand-spark);
  box-shadow: 0 0 0 1px var(--flow-divider);
  transform: rotate(45deg);
}
#tab-shifts .empty:not(.loading-skeleton)::before {
  background:
    linear-gradient(var(--flow-primary), var(--flow-primary)) 0 0 / 100% 12px no-repeat,
    radial-gradient(circle, var(--flow-primary) 0 2.5px, transparent 3px) 14px 22px / 15px 15px repeat,
    var(--flow-surface-muted);
  box-shadow: 7px 7px 0 var(--flow-success-soft);
}
#tab-finance .empty:not(.loading-skeleton)::before,
#financeTopupsWrap .empty:not(.loading-skeleton)::before {
  border-radius: 15px;
  background:
    linear-gradient(var(--flow-primary), var(--flow-primary)) 0 12px / 100% 5px no-repeat,
    radial-gradient(circle, var(--flow-brand-spark) 0 4px, transparent 4.5px) 43px 28px / 10px 10px no-repeat,
    linear-gradient(var(--flow-divider), var(--flow-divider)) 12px 30px / 22px 3px no-repeat,
    var(--flow-surface-muted);
  box-shadow: 7px 7px 0 var(--flow-warning-soft);
}
.loading-skeleton { position: relative; overflow: hidden; background: var(--flow-skeleton); color: transparent !important; }
.loading-skeleton::after { background: linear-gradient(90deg, transparent, var(--flow-skeleton-shine), transparent); }

.flow-error-state {
  min-height: 170px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 10px;
  padding: 28px 20px;
  border-radius: 22px;
  background: var(--flow-surface);
  color: var(--flow-text-2);
  box-shadow: var(--flow-shadow-card);
  text-align: center;
}
.flow-error-state strong { color: var(--flow-text); font-size: 16px; font-weight: 800; }
.flow-error-state p { max-width: 34rem; margin: 0; font-size: 13px; line-height: 1.5; }
.flow-error-state button { width: auto; min-width: 128px; margin-top: 2px; }
.flow-error-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--flow-danger-soft);
  color: var(--flow-danger);
  font-size: 22px;
  font-weight: 800;
}

.kpi-grid { gap: 8px; }
.kpi {
  min-height: 90px;
  padding: 14px;
  border: 0;
  border-radius: 18px;
  background: var(--flow-surface-muted);
  box-shadow: none;
}
.kpi::before { display: none; }
.kpi:hover { border: 0; box-shadow: none; transform: none; }
.kpi .label { color: var(--flow-text-2); font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.kpi .value { margin-top: 8px; color: var(--flow-text); font-family: var(--flow-font); font-size: 18px; font-weight: 800; letter-spacing: -.035em; }

.review,
.about-preview,
.customer-apply-note,
.decision-box {
  padding: 14px;
  border: 0;
  border-radius: 16px;
  background: var(--flow-surface-soft);
  color: var(--flow-text-2);
  box-shadow: none;
  font-size: 12px;
}
.draft-status { color: var(--flow-text-3); font-size: 11px; }
.draft-status.saved { color: var(--flow-success); }

/* Profile */
.profile-screen-header { display: flex; align-items: center; gap: 15px; padding: 8px 4px 5px; }
.profile-screen-avatar { display: grid; width: 66px; height: 66px; flex: 0 0 66px; place-items: center; overflow: hidden; border-radius: 22px; background: var(--flow-accent-soft) center/cover no-repeat; color: var(--flow-primary); font-size: 21px; font-weight: 800; }
.profile-screen-avatar.has-image { color: transparent; }
.profile-screen-header h2 { margin: 0; color: var(--flow-text); font-size: 25px; font-weight: 800; line-height: 1.2; letter-spacing: -.05em; }
.profile-screen-header p { margin: 4px 0 0; color: var(--flow-text-2); font-size: 12px; }
.profile-settings-card { padding: 0; overflow: hidden; }
.profile-settings-card > summary { list-style: none; }
.profile-settings-card > summary::-webkit-details-marker { display: none; }
.settings-summary { min-height: 76px; display: grid; grid-template-columns: 42px minmax(0,1fr) 24px; gap: 11px; align-items: center; padding: 14px 16px; cursor: pointer; }
.settings-summary-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 14px; background: var(--flow-accent-soft); color: var(--flow-primary); font-size: 16px; }
.settings-summary-icon svg { width: 21px; height: 21px; }
.settings-summary > span:nth-child(2) { display: grid; gap: 3px; }
.settings-summary strong { color: var(--flow-text); font-size: 14px; font-weight: 750; }
.settings-summary small { color: var(--flow-text-2); font-size: 11px; font-weight: 500; }
.settings-summary > b { color: var(--flow-text-3); font-size: 22px; font-weight: 500; transition: transform .16s ease; }
.settings-summary > b svg { width: 20px; height: 20px; }
.profile-settings-card[open] .settings-summary > b { transform: rotate(90deg); }
.settings-content { padding: 4px 16px 18px; border-top: 1px solid var(--flow-divider); }
.settings-content > .card-head { margin-top: 15px; }
.settings-content > .card-head h2 { font-size: 19px; }

.role-mode-switcher {
  display: grid;
  gap: 12px;
  padding: 18px;
}
.role-mode-switcher > .card-head { margin: 0; }
.role-mode-switcher > .card-head h3 { font-size: 16px; }
.role-mode-switcher > .card-head p { margin-top: 3px; font-size: 12px; }
.role-mode-switcher > .row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  padding: 4px;
  border-radius: 17px;
  background: var(--flow-surface-soft);
}
.role-mode-switcher [data-switch-app-mode],
.role-mode-switcher [data-switch-app-mode]:hover,
.role-mode-switcher [data-switch-app-mode]:active {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 6px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--flow-text-2);
  box-shadow: none;
  font-size: 11px;
  line-height: 1.2;
  overflow-wrap: anywhere;
  transform: none;
}
.role-mode-switcher [data-switch-app-mode].active,
.role-mode-switcher [data-switch-app-mode].active:hover,
.role-mode-switcher [data-switch-app-mode].active:active {
  background: var(--flow-surface);
  color: var(--flow-primary);
  box-shadow: 0 2px 8px rgba(20,24,34,.07);
  opacity: 1;
  cursor: default;
}
.account-logout,
.account-logout:hover,
.account-logout:active {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 18px;
  background: var(--flow-surface);
  color: var(--flow-danger);
  box-shadow: var(--flow-shadow-card);
  transform: none;
}

/* Shifts */
#tab-shifts > .content-card,
#tab-finance > .content-card {
  padding: 0;
  background: transparent;
  box-shadow: none;
}
#tab-shifts > .content-card > .card-head,
#tab-finance > .content-card > .card-head { padding: 2px 2px 0; }
#shiftsList .item { padding: 18px; border-radius: 22px; }
#shiftsList .toolbar { margin-top: 2px !important; }
#shiftsList [data-worker-shift-action="finish-self"] { border: 0; background: var(--flow-primary); color: var(--flow-on-primary); box-shadow: none; }
button.secondary[data-partner-assignment-action="mark_paid"] { border: 0; background: var(--flow-success); color: var(--flow-on-success); box-shadow: none; }
.shift-card {
  padding: 20px;
  border-radius: 24px;
  background: var(--flow-surface);
  box-shadow: var(--flow-shadow-card);
}
.shift-card.is-active { background: var(--flow-surface); }
.shift-card.is-past { padding-block: 17px; box-shadow: 0 3px 14px rgba(20,24,34,.04); }
.shift-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--flow-text-2); font-size: 11px; font-weight: 650; }
.shift-card h3 { margin: 16px 0 11px; color: var(--flow-text); font-size: 19px; font-weight: 800; line-height: 1.25; letter-spacing: -.04em; }
.shift-card-meta { display: grid; gap: 7px; color: var(--flow-text-2); font-size: 12px; }
.shift-card-meta span { display: flex; align-items: flex-start; gap: 7px; }
.shift-card-meta .flow-inline-icon { margin-top: 1px; color: var(--flow-accent-ink); }
.shift-card > .item-meta { margin-top: 9px; }
.shift-progress { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 7px; margin-top: 18px; }
.shift-progress::before { content: ""; position: absolute; left: 9%; right: 9%; top: 5px; height: 2px; background: var(--flow-divider); }
.shift-progress span { position: relative; padding-top: 17px; color: var(--flow-text-3); font-size: 11px; font-weight: 650; text-align: center; }
.shift-progress span::before { content: ""; position: absolute; left: 50%; top: 0; width: 11px; height: 11px; border: 3px solid var(--flow-surface); border-radius: 50%; background: var(--flow-muted-marker); box-shadow: 0 0 0 1px var(--flow-divider); transform: translateX(-50%); }
.shift-progress span.active { color: var(--flow-primary); }
.shift-progress span.active::before { background: var(--flow-primary); box-shadow: 0 0 0 2px rgba(91,76,240,.16); }
.shift-progress span.done { color: var(--flow-success); }
.shift-progress span.done::before { background: var(--flow-success); }
.shift-card-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.shift-card-facts span { min-height: 28px; display: inline-flex; align-items: center; padding: 0 9px; border-radius: 999px; background: var(--flow-surface-soft); color: var(--flow-text-2); font-size: 10px; font-weight: 650; }
.shift-card-facts span.danger { background: var(--flow-danger-soft); color: var(--flow-danger); }
.shift-card-actions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; margin-top: 14px; }
.shift-card-actions button { width: 100%; min-width: 0; }
.shift-card-actions button:only-child { grid-column: 1 / -1; }

/* Wallet */
#financeSummary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 12px !important;
}
.finance-balance-card {
  min-height: 172px;
  display: grid;
  align-content: end;
  gap: 3px;
  padding: 22px;
  border-radius: 26px;
  background: linear-gradient(145deg, #17181d, #25262d);
  color: #fff;
  box-shadow: 0 14px 34px rgba(20,24,34,.16);
}
.finance-balance-card span { color: rgba(255,255,255,.62); font-size: 12px; }
.finance-balance-card strong { margin: 8px 0 2px; font-size: clamp(26px, 6vw, 34px); font-weight: 800; line-height: 1.12; letter-spacing: -.06em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.finance-balance-card small { color: rgba(255,255,255,.58); font-size: 11px; }
.finance-balance-total { min-width: 150px; display: grid; align-content: end; gap: 5px; padding: 20px; border-radius: 24px; background: var(--flow-accent-soft); color: var(--flow-primary); }
.finance-balance-total span { font-size: 11px; }
.finance-balance-total strong { font-size: 18px; font-weight: 800; letter-spacing: -.04em; }
#financeList,
#financeTopupsWrap { gap: 0; overflow: hidden; border-radius: 22px; background: var(--flow-surface); box-shadow: var(--flow-shadow-card); }
.transaction-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 11px; align-items: center; min-height: 70px; padding: 12px 16px; }
.transaction-row + .transaction-row { border-top: 1px solid var(--flow-divider); }
.transaction-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 14px; background: var(--flow-surface-soft); color: var(--flow-text-2); font-size: 16px; font-weight: 750; }
.transaction-icon.positive { background: var(--flow-success-soft); color: var(--flow-success); }
.transaction-icon.negative { background: var(--flow-danger-soft); color: var(--flow-danger); }
.transaction-icon .flow-inline-icon { width: 18px; height: 18px; }
.transaction-copy { display: grid; min-width: 0; gap: 3px; }
.transaction-copy strong { overflow: hidden; color: var(--flow-text); font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.transaction-copy small { color: var(--flow-text-3); font-size: 11px; }
.transaction-amount { font-size: 13px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.transaction-amount.positive { color: var(--flow-success); }
.transaction-amount.negative { color: var(--flow-text); }

/* Partner */
.partner-tabs-card { padding: 5px; }
.partner-tabs { gap: 3px; }
.partner-tabs button,
.partner-tabs button:hover,
.partner-tabs button.active {
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--flow-text-2);
  box-shadow: none;
  font-size: 12px;
}
.partner-tabs button.active { background: var(--flow-accent-soft); color: var(--flow-primary); }
.partner-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.partner-tabs button > svg { width: 18px; height: 18px; flex: 0 0 18px; }
.partner-section { scroll-margin-top: 20px; }
.person-avatar { border: 0; border-radius: 15px; background: var(--flow-accent-soft); color: var(--flow-primary); }
.customer-candidate,
.priority-person,
.priority-request,
.admin-user-item.active { border: 0; background: var(--flow-surface); box-shadow: var(--flow-shadow-card); }
.item.priority-person { border: 0; background: var(--flow-surface); box-shadow: inset 0 0 0 1px rgba(91,76,240,.16), var(--flow-shadow-card); }

.customer-home-section { display: grid; gap: 14px; padding: 0; background: transparent; box-shadow: none; }
.customer-home-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 6px 2px 2px; }
.customer-home-header > div { min-width: 0; }
.customer-home-header h2 { margin: 0; color: var(--flow-text); font-size: 28px; font-weight: 800; line-height: 1.15; letter-spacing: -.055em; }
.customer-home-header h2,
.customer-home-header p { overflow-wrap: anywhere; }
.customer-home-header p { margin: 5px 0 0; color: var(--flow-text-2); font-size: 13px; }
.customer-home-header > button { width: auto; min-width: 132px; }
.customer-home-stats { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.customer-home-stats .kpi { background: var(--flow-surface); box-shadow: var(--flow-shadow-card); }
.customer-home-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.customer-home-actions button,
.customer-home-actions button:hover,
.customer-home-actions button:active { min-height: 78px; display: grid; grid-template-columns: minmax(0,1fr) 20px; align-content: center; gap: 2px 8px; padding: 13px 15px; border-radius: 20px; background: var(--flow-surface); color: var(--flow-text); box-shadow: var(--flow-shadow-card); text-align: left; transform: none; }
.customer-home-actions strong { font-size: 14px; font-weight: 750; }
.customer-home-actions small { color: var(--flow-text-2); font-size: 11px; }
.customer-home-actions span { grid-column: 2; grid-row: 1 / 3; align-self: center; color: var(--flow-text-3); font-size: 23px; }
.customer-home-actions span svg { width: 20px; height: 20px; }
.customer-profile-settings { overflow: hidden; border: 0; border-radius: 22px; background: var(--flow-surface); box-shadow: var(--flow-shadow-card); }
.customer-profile-settings > summary { list-style: none; }
.customer-profile-settings > summary::-webkit-details-marker { display: none; }

body.partner-flow-open { overflow: hidden; }
.partner-create-flow {
  position: fixed;
  inset: 20px;
  z-index: 210;
  width: min(720px, calc(100% - 40px));
  height: min(900px, calc(100dvh - 40px));
  display: grid;
  grid-template-rows: auto auto minmax(0,1fr) auto;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border-radius: 30px;
  background: var(--flow-bg);
  box-shadow: var(--flow-shadow-overlay);
  animation: flowSheetIn .24s cubic-bezier(.2,.8,.2,1) both;
}
.flow-page-header { min-height: 76px; display: grid; grid-template-columns: 44px minmax(0,1fr) auto; gap: 13px; align-items: center; padding: 11px 18px 8px; background: var(--flow-page-glass); backdrop-filter: blur(16px); }
.flow-page-header > div { display: grid; gap: 2px; }
.flow-page-header span { color: var(--flow-text-2); font-size: 10px; font-weight: 650; }
.flow-page-header h2 { margin: 0; color: var(--flow-text); font-size: 21px; font-weight: 800; letter-spacing: -.04em; }
.flow-draft-indicator { min-height: 28px; display: inline-flex; align-items: center; padding: 0 9px; border-radius: 999px; background: var(--flow-surface-soft); color: var(--flow-text-2) !important; }
.flow-progress { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; padding: 0 18px 11px; background: var(--flow-page-glass); }
.flow-progress span { height: 4px; border-radius: 999px; background: var(--flow-progress-track); transition: background-color .16s ease; }
.flow-progress span.active { background: var(--flow-primary); }
.partner-create-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px; }
.partner-create-step { max-width: 620px; margin: 0 auto; }
.flow-step-heading { margin-bottom: 18px; }
.flow-step-heading h3 { margin: 0; color: var(--flow-text); font-size: 24px; font-weight: 800; letter-spacing: -.05em; }
.flow-step-heading p { margin: 6px 0 0; color: var(--flow-text-2); font-size: 13px; }
.role-form-list { display: grid; gap: 10px; }
.role-form-row { display: grid; grid-template-columns: minmax(130px,1fr) minmax(100px,.8fr) minmax(100px,.8fr); gap: 10px; align-items: end; padding: 14px; border-radius: 20px; background: var(--flow-surface); box-shadow: var(--flow-shadow-card); }
.role-form-row > strong { align-self: center; color: var(--flow-text); font-size: 14px; font-weight: 750; }
.role-form-row input { background: var(--flow-surface-soft); }
.flow-calc-preview { margin-top: 12px; padding: 16px; border-radius: 18px; background: var(--flow-accent-soft); color: var(--flow-primary); font-size: 14px; font-weight: 750; }
.flow-toggle { min-height: 72px; display: grid; grid-template-columns: 24px minmax(0,1fr); gap: 12px; align-items: center; padding: 13px 14px; border-radius: 18px; background: var(--flow-surface); box-shadow: var(--flow-shadow-card); cursor: pointer; }
.flow-toggle input { width: 22px; height: 22px; min-height: 22px; margin: 0; accent-color: var(--flow-primary); }
.flow-toggle > span { display: grid; gap: 3px; }
.flow-toggle strong { color: var(--flow-text); font-size: 13px; font-weight: 750; }
.flow-toggle small { color: var(--flow-text-2); font-size: 11px; }
.flow-toggle.urgent input { accent-color: var(--flow-danger); }
.flow-page-footer { min-height: 76px; display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--flow-divider); background: var(--flow-sheet-glass); backdrop-filter: blur(16px); }
.flow-page-footer button { width: auto; min-width: 126px; }
.flow-page-footer #partnerCreateBackBtn { margin-right: auto; }

.customer-project-card { overflow: hidden; border-radius: 22px; background: var(--flow-surface); box-shadow: var(--flow-shadow-card); }
.customer-project-hitarea,
.customer-project-hitarea:hover,
.customer-project-hitarea:active { display: block; width: 100%; min-height: 0; padding: 17px; border: 0; border-radius: 0; background: transparent; color: var(--flow-text); box-shadow: none; text-align: left; transform: none; }
.customer-project-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--flow-text-2); font-size: 11px; font-weight: 650; }
.customer-project-status { min-height: 26px; display: inline-flex; align-items: center; padding: 0 9px; border-radius: 999px; background: var(--flow-accent-soft); color: var(--flow-primary); font-size: 10px; font-weight: 750; }
.customer-project-card.is-urgent .customer-project-status { background: var(--flow-danger-soft); color: var(--flow-danger); }
.customer-project-card h3 { margin: 12px 0 6px; color: var(--flow-text); font-size: 17px; font-weight: 800; line-height: 1.28; letter-spacing: -.035em; }
.customer-project-location { display: flex; align-items: flex-start; gap: 6px; color: var(--flow-text-2); font-size: 12px; }
.customer-project-location { min-width: 0; overflow-wrap: anywhere; }
.customer-project-location > .flow-inline-icon { margin-top: 1px; color: var(--flow-accent-ink); }
.customer-project-progress { height: 5px; margin-top: 16px; overflow: hidden; border-radius: 999px; background: var(--flow-surface-soft); }
.customer-project-progress span { display: block; height: 100%; border-radius: inherit; background: var(--flow-primary); }
.customer-project-bottom { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)) 28px; gap: 9px; align-items: center; margin-top: 12px; color: var(--flow-text-2); font-size: 10px; }
.customer-project-bottom > span { display: grid; gap: 2px; }
.customer-project-bottom strong { color: var(--flow-text); font-size: 13px; font-weight: 750; }
.customer-project-bottom > b { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: var(--flow-surface-soft); color: var(--flow-text-2); font-size: 21px; font-weight: 500; }
.customer-project-bottom > b .flow-inline-icon { width: 14px; height: 14px; }

.partner-page-backdrop {
  position: fixed;
  inset: 0;
  z-index: 204;
  display: none;
  background: var(--flow-backdrop);
  backdrop-filter: blur(5px);
}
body.partner-project-open .partner-page-backdrop { display: block; }
body.partner-flow-open .partner-page-backdrop { z-index: 209; display: block; }
#partnerRequestManageCard { display: none; }
.partner-project-close { display: none; }
body.partner-project-open { overflow: hidden; }
body.partner-project-open #partnerRequestManageCard {
  display: block;
  position: fixed;
  inset: 20px;
  z-index: 205;
  width: min(760px, calc(100% - 40px));
  max-height: calc(100dvh - 40px);
  margin: auto !important;
  overflow-y: auto;
  border-radius: 30px;
  background: var(--flow-bg);
  box-shadow: var(--flow-shadow-overlay);
  animation: flowSheetIn .22s cubic-bezier(.2,.8,.2,1) both;
}
body.partner-project-open #partnerRequestManageCard .partner-project-close { position: sticky; top: 0; z-index: 3; display: grid; margin: 0 0 0 auto; }
body.partner-project-open #partnerRequestManageCard > .card-head { margin-top: -40px; padding-right: 52px; }
body.partner-project-open #partnerRequestSelectedMeta { white-space: pre-line; }
.candidate-row { padding: 16px; border-radius: 22px; background: var(--flow-surface); box-shadow: var(--flow-shadow-card); }
.candidate-row.is-favorite { box-shadow: inset 0 0 0 1px rgba(91,76,240,.16), var(--flow-shadow-card); }
.candidate-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.candidate-top .person { min-width: 0; }
.candidate-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.candidate-about { margin: 11px 0 0; color: var(--flow-text-2); font-size: 12px; line-height: 1.5; }
.candidate-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)) 46px; gap: 7px; margin-top: 13px; }
.candidate-actions button { width: 100%; min-width: 0; padding-inline: 10px; font-size: 11px; }
.candidate-more { width: 46px !important; min-width: 46px !important; padding: 0 !important; font-size: 14px !important; letter-spacing: .12em; }

/* Details / bottom sheets */
body.sheet-open { overflow: hidden; }
.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: end center;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: var(--flow-backdrop);
  backdrop-filter: blur(5px);
  animation: flowFadeIn .18s ease both;
}
.detail-sheet {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  max-height: min(92dvh, 940px);
  overflow: hidden;
  border-radius: 30px 30px 0 0;
  background: var(--flow-bg);
  box-shadow: var(--flow-shadow-overlay);
  animation: flowSheetIn .24s cubic-bezier(.2,.8,.2,1) both;
}
.sheet-handle { width: 38px; height: 4px; margin: 9px auto 3px; border-radius: 999px; background: var(--flow-handle); }
.detail-sheet-header { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 18px 8px; }
.sheet-title { color: var(--flow-text-2); font-size: 12px; font-weight: 700; }
.sheet-close,
.sheet-close:hover,
.sheet-close:active { width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; background: var(--flow-surface); color: var(--flow-text); box-shadow: none; font-size: 24px; font-weight: 450; transform: none; }
.detail-sheet-content { max-height: calc(min(92dvh, 940px) - 70px); overflow-y: auto; overscroll-behavior: contain; padding: 0 16px calc(24px + env(safe-area-inset-bottom)); }
.project-detail-hero { padding: 18px 18px 21px; border-radius: 25px; background: var(--flow-surface); box-shadow: var(--flow-shadow-card); }
.project-detail-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--flow-text-2); font-size: 11px; font-weight: 650; }
.project-detail-status span:last-child { color: var(--flow-primary); }
.project-detail-hero h2 { margin: 18px 0 16px; color: var(--flow-text); font-family: var(--flow-font); font-size: 28px; font-weight: 800; line-height: 1.15; letter-spacing: -.055em; }
.project-detail-hero h2 { overflow-wrap: anywhere; }
.project-detail-meta { display: grid; gap: 8px; color: var(--flow-text-2); font-size: 13px; }
.project-detail-meta span { display: flex; align-items: flex-start; gap: 8px; }
.project-detail-meta .flow-inline-icon { margin-top: 2px; color: var(--flow-accent-ink); }
.project-detail-vitals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.project-detail-vitals > div { display: grid; gap: 4px; padding: 17px; border-radius: 20px; background: var(--flow-surface); box-shadow: var(--flow-shadow-card); }
.project-detail-vitals span { color: var(--flow-text-2); font-size: 11px; }
.project-detail-vitals strong { color: var(--flow-text); font-size: 20px; font-weight: 800; letter-spacing: -.04em; }
.project-detail-section { margin-top: 10px; padding: 18px; border-radius: 22px; background: var(--flow-surface); box-shadow: var(--flow-shadow-card); }
.project-detail-section h3 { margin: 0 0 12px; color: var(--flow-text); font-size: 16px; font-weight: 800; letter-spacing: -.03em; }
.project-detail-section p { margin: 0; color: var(--flow-text-2); font-size: 13px; line-height: 1.6; white-space: pre-line; }
.project-detail-section .item-meta { margin: 0; color: var(--flow-text-2); }
.detail-role-list { display: grid; gap: 7px; }
.detail-role-option,
.detail-role-option:hover,
.detail-role-option:active {
  width: 100%;
  min-height: 66px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 13px;
  border: 0;
  border-radius: 16px;
  background: var(--flow-surface-soft);
  color: var(--flow-text);
  box-shadow: none;
  text-align: left;
  transform: none;
}
.detail-role-option:not(.is-static):hover { background: var(--flow-accent-soft); }
.detail-role-option > span:first-child { display: grid; min-width: 0; gap: 3px; }
.detail-role-option strong { color: var(--flow-text); font-size: 14px; font-weight: 750; }
.detail-role-option small { color: var(--flow-text-2); font-size: 11px; }
.detail-role-pay { display: flex; align-items: center; gap: 8px; color: var(--flow-primary); font-size: 12px; font-weight: 750; white-space: nowrap; }
.detail-role-pay b { display: inline-flex; min-height: 32px; align-items: center; justify-content: center; padding: 0 10px; border-radius: 8px; background: var(--flow-primary); color: #fff; font-size: 11px; font-weight: 750; letter-spacing: 0; }
.detail-role-option.is-static .detail-role-pay { color: var(--flow-text-2); }
.detail-role-option.is-static .detail-role-pay b { display: none; }
.project-detail-map { margin-top: 10px; }
.project-detail-map .chip { width: 100%; min-height: 48px; justify-content: center; background: var(--flow-info-soft); color: var(--flow-info); }

/* One accessible action sheet for confirmations and short forms. */
.action-sheet-overlay { z-index: 360; }
.action-sheet {
  width: min(560px, 100%);
  max-height: min(92dvh, 760px);
  background: var(--flow-surface);
}
.action-sheet-header { align-items: flex-start; padding: 8px 18px 12px; }
.action-sheet-heading { min-width: 0; padding-top: 5px; }
.action-sheet-heading h2 {
  margin: 0;
  color: var(--flow-text);
  font: 800 22px/1.18 var(--flow-font);
  letter-spacing: -.045em;
}
.action-sheet-heading p {
  max-width: 46ch;
  margin: 7px 0 0;
  color: var(--flow-text-2);
  font: 500 13px/1.5 var(--flow-font);
}
.action-sheet-form {
  display: grid;
  min-height: 0;
  max-height: calc(min(92dvh, 760px) - 70px);
  grid-template-rows: minmax(0, auto) auto auto;
}
.action-sheet-fields {
  display: grid;
  gap: 15px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 18px 4px;
}
.action-sheet-fields:empty { display: none; }
.action-sheet-field {
  display: grid;
  min-width: 0;
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
}
.action-sheet-field-label {
  color: var(--flow-text);
  font: 700 13px/1.35 var(--flow-font);
}
.action-sheet-field input,
.action-sheet-field textarea {
  width: 100%;
  min-height: 50px;
  padding: 13px 14px;
  border: 1px solid var(--flow-divider);
  border-radius: 15px;
  outline: none;
  background: var(--flow-surface-muted);
  color: var(--flow-text);
  box-shadow: none;
  font: 600 15px/1.4 var(--flow-font);
}
.action-sheet-field textarea { min-height: 92px; resize: vertical; }
.action-sheet-field input:focus,
.action-sheet-field textarea:focus {
  border-color: var(--flow-primary);
  background: var(--flow-surface);
  box-shadow: 0 0 0 3px var(--flow-focus-shadow);
}
.action-sheet-field input[aria-invalid="true"],
.action-sheet-field textarea[aria-invalid="true"] {
  border-color: var(--flow-danger);
  box-shadow: 0 0 0 3px var(--flow-danger-focus);
}
.action-sheet-field-help,
.action-sheet-field-error {
  color: var(--flow-text-2);
  font: 500 11px/1.45 var(--flow-font);
}
.action-sheet-field-error { color: var(--flow-danger); font-weight: 650; }
.action-sheet-rating {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}
.action-sheet-rating-option {
  position: relative;
  display: grid;
  min-width: 44px;
  min-height: 58px;
  place-items: center;
  gap: 0;
  padding: 6px 2px;
  border: 1px solid var(--flow-divider);
  border-radius: 15px;
  background: var(--flow-surface-muted);
  color: var(--flow-text-3);
  cursor: pointer;
}
.action-sheet-rating-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.action-sheet-rating-option span { font-size: 21px; line-height: 1; }
.action-sheet-rating-option small { color: inherit; font: 700 10px/1 var(--flow-font); }
.action-sheet-rating-option:has(input:checked) {
  border-color: var(--flow-primary);
  background: var(--flow-accent-soft);
  color: var(--flow-primary);
}
.action-sheet-rating-option:has(input:focus-visible) {
  outline: 3px solid var(--flow-outline-focus);
  outline-offset: 2px;
}
.action-sheet-choice {
  display: grid;
  gap: 8px;
}
.action-sheet-choice-option {
  position: relative;
  display: grid;
  min-height: 62px;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border: 1px solid var(--flow-divider);
  border-radius: 15px;
  background: var(--flow-surface-muted);
  color: var(--flow-text);
  cursor: pointer;
}
.action-sheet-choice-option input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--flow-primary);
}
.action-sheet-choice-option > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}
.action-sheet-choice-option strong {
  overflow-wrap: anywhere;
  font: 750 14px/1.3 var(--flow-font);
  letter-spacing: 0;
}
.action-sheet-choice-option small {
  color: var(--flow-text-2);
  font: 500 11px/1.4 var(--flow-font);
}
.action-sheet-choice-option:has(input:checked) {
  border-color: var(--flow-primary);
  background: var(--flow-accent-soft);
}
.action-sheet-choice-option:has(input:focus-visible) {
  outline: 3px solid var(--flow-outline-focus);
  outline-offset: 2px;
}
.action-sheet-error {
  margin: 12px 18px 0;
  padding: 11px 13px;
  border-radius: 13px;
  background: var(--flow-danger-soft);
  color: var(--flow-danger);
  font: 650 12px/1.45 var(--flow-font);
}
.action-sheet-actions {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 8px;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--flow-divider);
  background: color-mix(in srgb, var(--flow-surface) 94%, transparent);
  backdrop-filter: blur(10px);
}
.action-sheet-actions button,
.action-sheet-actions button:hover,
.action-sheet-actions button:active {
  width: 100%;
  min-height: 50px;
  margin: 0;
  border-radius: 15px;
  transform: none;
}
.action-sheet-submit.tone-danger,
.action-sheet-submit.tone-danger:hover,
.action-sheet-submit.tone-danger:active { background: var(--flow-danger); color: var(--flow-on-danger); }
.action-sheet-submit.tone-positive,
.action-sheet-submit.tone-positive:hover,
.action-sheet-submit.tone-positive:active { background: var(--flow-success); color: var(--flow-on-success); }
.action-sheet-submit.tone-warning,
.action-sheet-submit.tone-warning:hover,
.action-sheet-submit.tone-warning:active { background: var(--flow-warning); color: var(--flow-on-warning); }
.action-sheet[aria-busy="true"] { cursor: wait; }
.action-sheet button:disabled,
.action-sheet input:disabled,
.action-sheet textarea:disabled { cursor: wait; opacity: .62; }

/* Group responses */
.context-hint {
  margin: 9px 0 0;
  padding-left: 10px;
  border-left: 2px solid var(--flow-divider);
  color: var(--flow-text-2);
  font: 500 11px/1.5 var(--flow-font);
  letter-spacing: 0;
}
.partner-group-hint { max-width: 66ch; }
.response-group-overlay {
  --response-group-viewport-top: 0px;
  --response-group-viewport-left: 0px;
  --response-group-viewport-width: 100vw;
  --response-group-viewport-height: 100dvh;
  inset: auto;
  top: var(--response-group-viewport-top);
  left: var(--response-group-viewport-left);
  width: var(--response-group-viewport-width);
  height: var(--response-group-viewport-height);
  z-index: 340;
}
.response-group-sheet {
  display: grid;
  width: min(620px, 100%);
  max-height: min(var(--response-group-viewport-height), 860px);
  grid-template-rows: auto auto minmax(0, 1fr);
}
.response-group-meta {
  max-width: 46ch;
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  color: var(--flow-text-2);
  font: 500 11px/1.4 var(--flow-font);
}
.response-group-form {
  display: grid;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}
.response-group-scroll {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 15px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 4px 18px 12px;
}
.response-group-section-head {
  display: flex;
  min-height: 28px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  color: var(--flow-text);
  font: 700 13px/1.3 var(--flow-font);
}
.response-group-section-head span {
  color: var(--flow-text-2);
  font-size: 11px;
}
.response-group-selected,
.response-group-results,
.response-group-candidates {
  display: grid;
  min-width: 0;
  gap: 6px;
}
.response-group-candidates {
  min-height: 70px;
}
.response-group-person {
  display: grid;
  min-height: 58px;
  grid-template-columns: 38px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  border-bottom: 1px solid var(--flow-divider);
}
.response-group-person:last-child { border-bottom: 0; }
.response-group-person > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.response-group-person strong {
  overflow-wrap: anywhere;
  color: var(--flow-text);
  font: 700 13px/1.3 var(--flow-font);
}
.response-group-person small {
  overflow-wrap: anywhere;
  color: var(--flow-text-2);
  font: 500 10px/1.35 var(--flow-font);
}
.response-group-person .icon-button {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
}
.response-group-person .icon-button svg { width: 19px; height: 19px; }
.response-group-search {
  display: grid;
  gap: 6px;
  color: var(--flow-text);
  font: 700 12px/1.3 var(--flow-font);
}
.response-group-search input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--flow-divider);
  border-radius: 14px;
  background: var(--flow-surface-muted);
}
.response-group-search-hint {
  margin: -8px 0 0;
  color: var(--flow-text-2);
  font: 500 10px/1.45 var(--flow-font);
  letter-spacing: 0;
}
.response-group-actions {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 8px;
  padding: 12px 18px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--flow-divider);
  background: color-mix(in srgb, var(--flow-bg) 94%, transparent);
  backdrop-filter: blur(10px);
}
.response-group-actions button { width: 100%; min-height: 49px; }
.response-group-overlay.is-keyboard-open .sheet-handle,
.response-group-overlay.is-keyboard-open .context-hint,
.response-group-overlay.is-keyboard-open .response-group-search-hint {
  display: none;
}
.response-group-overlay.is-keyboard-open .detail-sheet-header {
  min-height: 48px;
  padding-top: 2px;
  padding-bottom: 4px;
}
.response-group-overlay.is-keyboard-open .response-group-scroll {
  gap: 10px;
  padding-top: 0;
}
.empty.compact { min-height: 64px; padding: 18px 10px; }
.worker-group-activity { margin-bottom: 14px; }
.worker-group-section {
  display: grid;
  gap: 8px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--flow-divider);
}
.worker-group-list,
.worker-group-members { display: grid; gap: 7px; }
.worker-group-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--flow-divider);
  border-radius: 8px;
  background: var(--flow-surface);
}
.worker-group-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.worker-group-card-head > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}
.worker-group-card-head strong {
  overflow-wrap: anywhere;
  color: var(--flow-text);
  font: 750 14px/1.3 var(--flow-font);
}
.worker-group-card-head span:not(.chip) {
  color: var(--flow-text-2);
  font: 500 11px/1.4 var(--flow-font);
}
.worker-group-member {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.worker-group-member > span {
  display: grid;
  min-width: 0;
}
.worker-group-member strong {
  overflow-wrap: anywhere;
  color: var(--flow-text);
  font: 650 12px/1.35 var(--flow-font);
}
.worker-group-member small {
  color: var(--flow-text-2);
  font: 500 10px/1.35 var(--flow-font);
}
.worker-group-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.worker-group-actions:has(> :only-child) { grid-template-columns: 1fr; }
.worker-group-actions button { width: 100%; min-width: 0; }
.worker-group-expiry {
  margin: 0;
  color: var(--flow-text-2);
  font: 500 11px/1.4 var(--flow-font);
}
.partner-response-group {
  border: 1px solid var(--flow-divider);
  border-radius: 8px;
}
.partner-group-heading > div { min-width: 0; }
.partner-group-warning {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 12px 13px;
  border: 1px solid color-mix(in srgb, var(--flow-warning) 42%, transparent);
  border-radius: 8px;
  background: var(--flow-warning-soft);
  color: var(--flow-text);
}
.partner-group-warning strong { font: 750 13px/1.35 var(--flow-font); }
.partner-group-warning span { font: 600 12px/1.45 var(--flow-font); }
.partner-group-warning small { color: var(--flow-text-2); font: 600 11px/1.35 var(--flow-font); }
.partner-group-members {
  display: grid;
  margin-top: 12px;
  border-top: 1px solid var(--flow-divider);
}
.partner-group-member {
  display: grid;
  gap: 7px;
  padding: 11px 0;
  border-bottom: 1px solid var(--flow-divider);
}
.partner-group-member .person {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}
.partner-group-member .person > div:last-child {
  display: grid;
  min-width: 0;
}
.partner-group-member strong {
  overflow-wrap: anywhere;
  font: 700 12px/1.35 var(--flow-font);
}
.partner-group-member small {
  color: var(--flow-text-2);
  font: 500 10px/1.35 var(--flow-font);
}
.partner-group-member-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.partner-group-member-actions button {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 10px;
}
.partner-group-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.partner-group-actions button:first-child:last-child { grid-column: 1 / -1; }
.response-group-notice { border: 1px solid var(--flow-divider); }

@media (max-width: 430px) {
  .action-sheet-header { padding-inline: 15px; }
  .action-sheet-heading h2 { font-size: 20px; }
  .action-sheet-fields { padding-inline: 15px; }
  .action-sheet-actions { padding-inline: 15px; }
  .response-group-scroll,
  .response-group-actions { padding-inline: 15px; }
  .response-group-actions,
  .worker-group-actions,
  .partner-group-actions { grid-template-columns: 1fr; }
  #responseGroupCancelBtn { display: none; }
}

/* Overlays, toast, details */
.map-picker-overlay,
.onboarding-overlay { background: var(--flow-backdrop); backdrop-filter: blur(5px); }
.map-picker,
.onboarding-card { border: 0; border-radius: 26px; background: var(--flow-surface); box-shadow: var(--flow-shadow-overlay); }
.onboarding-card { color: var(--flow-text); }
.onboarding-body { color: var(--flow-text-2); }
.onboarding-step { color: var(--flow-primary); font-family: var(--flow-font); }
#mapPickerCanvas { border: 0; border-radius: 18px; }
.toast-host { top: auto; bottom: calc(84px + env(safe-area-inset-bottom)); }
.toast { border: 0; border-radius: 15px; background: var(--flow-toast-bg); color: var(--flow-on-dark); box-shadow: var(--flow-shadow-overlay); backdrop-filter: none; }
.toast.error { border: 0; background: var(--flow-danger); color: var(--flow-on-primary); }
details { border: 0; border-radius: 18px; background: var(--flow-surface-muted); }
summary { min-height: 48px; padding: 14px; color: var(--flow-text); font-family: var(--flow-font); font-size: 13px; font-weight: 750; }

@keyframes flowFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes flowSheetIn { from { transform: translateY(26px); opacity: .7; } to { transform: translateY(0); opacity: 1; } }
@keyframes flowReveal { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

.tab-view.tab-enter { animation: flowReveal .2s ease both; }
.tab-view.tab-enter .content-card,
.app-layout.app-mount .sidebar,
.app-layout.app-mount .content-card { animation: none; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { min-height: 380px; padding: 48px; }
  .auth-box { padding: 38px; }
  .app-layout { grid-template-columns: 200px minmax(0, 1fr); gap: 15px; }
  .profile-card { padding: 14px; }
}

@media (max-width: 700px) {
  html { scroll-padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  body { font-size: 14px; }
  body.is-authorized .topbar { display: none; }

  .shell {
    width: 100%;
    padding: calc(10px + env(safe-area-inset-top)) 0 calc(88px + env(safe-area-inset-bottom));
  }

  .topbar { min-height: 52px; margin: 0 16px 12px; padding: 0; }
  .brand-mark { width: 38px; height: 38px; flex-basis: 38px; border-radius: 12px; }
  .brand-title { font-size: 15px; }
  .brand-sub { display: none; }
  .sync-state.ready { display: none; }
  .top-actions .sync-state { width: auto; min-width: 0; padding: 0 10px; font-size: 10px; }

  .panel { margin: 0 12px; border-radius: 26px; }
  .hero { display: grid; }
  .hero-copy { min-height: 290px; padding: 32px 22px; border-radius: 0; }
  .headline { margin: 22px 0 15px; font-size: clamp(34px, 10vw, 44px); }
  .lead { font-size: 14px; }
  .hero-copy > .chip-row { display: none; }
  .auth-box { padding: 28px 20px 26px; }

  .app-layout { display: block; }
  .sidebar { display: contents; }
  .profile-card { display: none !important; }
  .content {
    margin: 0;
    padding-top: 0;
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: 0;
    padding-left: max(16px, env(safe-area-inset-left));
    gap: 12px;
  }
  .hint-strip { display: none; }
  .tab-view { gap: 12px; }
  .content-card { padding: 18px; border-radius: 22px; }
  .card-head { margin-bottom: 14px; }
  .card-head h2 { font-size: 27px; }
  .card-head h3 { font-size: 19px; }

  .nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 100;
    width: 100%;
    min-height: calc(67px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-auto-rows: 62px;
    gap: 0;
    margin: 0;
    padding-top: 4px;
    padding-right: max(7px, env(safe-area-inset-right));
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: max(7px, env(safe-area-inset-left));
    border: 0;
    border-top: 1px solid var(--flow-divider);
    border-radius: 0;
    background: var(--flow-nav-glass);
    box-shadow: var(--flow-shadow-card);
    backdrop-filter: blur(18px);
    transform: none;
  }

  body[data-app-mode="customer"] .nav,
  body[data-app-mode="admin"] .nav { display: none; }

  .nav button,
  .nav button:hover,
  .nav button.active {
    min-height: 62px;
    padding: 5px 2px 4px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    border-radius: 12px;
    background: transparent;
    color: var(--flow-text-3);
    font-size: 11px;
  }
  .nav button.active { background: transparent; color: var(--flow-primary); }
  .nav-icon { width: 27px; height: 27px; flex-basis: 27px; }
  .nav-icon svg { width: 23px; height: 23px; }
  .nav-label { font-size: 11px; font-weight: 650; }

  .home-screen { gap: 12px; }
  .home-header { padding-top: 2px; }
  .home-header h2 { font-size: 27px; }
  .home-focus-card { min-height: 205px; padding: 21px; border-radius: 25px; }
  .home-focus-card h3 { margin-top: 22px; font-size: 24px; }
  .home-quick-actions { gap: 8px; }
  .home-quick-actions button { min-height: 82px; padding: 12px; gap: 9px; }
  .quick-action-icon { width: 38px; height: 38px; flex-basis: 38px; }
  .home-balance-card { padding: 17px; border-radius: 22px; }
  .home-balance-card strong { font-size: 23px; }
  .home-balance-card button { min-width: 94px; min-height: 44px; }
  .home-metrics .kpi { min-height: 76px; padding: 12px; border-radius: 17px; }
  .home-metrics .kpi .value { font-size: 17px; }

  .project-feed-screen { padding: 0; }
  .project-feed-screen > .card-head { margin-bottom: 12px; }
  .project-feed-controls { grid-template-columns: minmax(0, 1fr) 46px; }
  .sort-select { width: 46px; min-width: 46px; height: 46px; }
  .sort-select > span { inset: 0; display: grid; place-items: center; font-size: 17px; }
  .sort-select select { position: absolute; inset: 0; width: 46px; min-height: 46px; padding: 0; opacity: 0; cursor: pointer; }
  .project-card-hitarea { padding: 16px; }

  #tab-shifts > .content-card,
  #tab-finance > .content-card { padding: 0; }
  #tab-profile > .content-card { padding: 18px; }
  #financeSummary { grid-template-columns: 1fr; }
  .finance-balance-card { min-height: 175px; }
  .finance-balance-total { min-width: 0; min-height: 78px; align-content: center; padding: 15px 18px; }
  #tab-finance .card-head .toolbar { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
  #tab-finance .card-head .toolbar button { width: 100%; min-width: 0; padding: 0 8px; font-size: 11px; }

  body[data-app-mode="customer"] .partner-tabs-card {
    position: fixed;
    inset: auto 0 0;
    z-index: 100;
    width: 100%;
    min-height: calc(67px + env(safe-area-inset-bottom));
    margin: 0;
    padding-top: 4px;
    padding-right: max(7px, env(safe-area-inset-right));
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: max(7px, env(safe-area-inset-left));
    border: 0;
    border-top: 1px solid var(--flow-divider);
    border-radius: 0;
    background: var(--flow-nav-glass);
    box-shadow: var(--flow-shadow-card);
    backdrop-filter: blur(18px);
    transform: none;
  }
  body[data-app-mode="customer"] .partner-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; overflow: visible; }
  body[data-app-mode="customer"] .partner-tabs button,
  body[data-app-mode="customer"] .partner-tabs button:hover,
  body[data-app-mode="customer"] .partner-tabs button.active { min-height: 62px; flex-direction: column; gap: 2px; padding: 5px 3px; border: 0; border-radius: 12px; background: transparent; color: var(--flow-text-3); box-shadow: none; font-size: 11px; }
  body[data-app-mode="customer"] .partner-tabs button > svg { width: 22px; height: 22px; flex-basis: 22px; }
  body[data-app-mode="customer"] .partner-tabs button.active { color: var(--flow-primary); }

  .customer-home-section { padding: 0; }
  .customer-home-header { align-items: center; }
  .customer-home-header h2 { font-size: 26px; }
  .customer-home-header > button { min-width: 118px; padding-inline: 13px; font-size: 12px; }
  .customer-home-stats .kpi { min-height: 78px; padding: 12px; }
  .customer-home-actions button { min-height: 74px; }
  .partner-section:not(.customer-home-section) { padding: 17px; }

  .partner-create-flow {
    inset: 0;
    width: 100%;
    height: 100dvh;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .flow-page-header {
    padding-top: calc(9px + env(safe-area-inset-top));
    padding-right: max(18px, env(safe-area-inset-right));
    padding-left: max(18px, env(safe-area-inset-left));
  }
  .partner-create-body {
    padding-top: 16px;
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: 16px;
    padding-left: max(16px, env(safe-area-inset-left));
  }
  .flow-page-footer {
    padding-right: max(18px, env(safe-area-inset-right));
    padding-left: max(18px, env(safe-area-inset-left));
  }
  .role-form-row { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 13px; }
  .role-form-row > strong { grid-column: 1 / -1; }
  body.partner-flow-open .partner-tabs-card { visibility: hidden; }
  body.partner-project-open .partner-tabs-card { visibility: hidden; }
  body.partner-project-open #partnerRequestManageCard {
    inset: 0;
    width: 100%;
    max-height: 100dvh;
    min-height: 100dvh;
    padding-top: calc(12px + env(safe-area-inset-top));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
    padding-left: max(16px, env(safe-area-inset-left));
    border-radius: 0;
    box-shadow: none;
  }

  body.sheet-open .nav,
  body.sheet-open .partner-tabs-card { visibility: hidden; }

  .detail-sheet-header {
    padding-right: max(18px, env(safe-area-inset-right));
    padding-left: max(18px, env(safe-area-inset-left));
  }
  .detail-sheet-content {
    padding-right: max(16px, env(safe-area-inset-right));
    padding-left: max(16px, env(safe-area-inset-left));
  }

  .map-picker-overlay,
  .onboarding-overlay { align-items: end; padding: 0; }
  .map-picker,
  .onboarding-card { width: 100%; max-height: 94dvh; border-radius: 28px 28px 0 0; }
  .toast-host {
    right: 10px;
    left: 10px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    width: auto;
    transform: none;
  }
}

@media (max-width: 360px) {
  .content {
    padding-right: max(12px, env(safe-area-inset-right));
    padding-left: max(12px, env(safe-area-inset-left));
  }
  .home-header h2 { font-size: 24px; }
  .home-avatar-button,
  .home-avatar { width: 48px; height: 48px; flex-basis: 48px; border-radius: 16px; }
  .home-focus-card { min-height: 196px; padding: 18px; }
  .home-focus-card h3 { font-size: 22px; }
  .home-quick-actions button { min-height: 78px; padding: 10px; }
  .home-quick-actions small { display: none; }
  .quick-action-icon { width: 35px; height: 35px; flex-basis: 35px; }
  .home-balance-card { align-items: flex-end; }
  .home-balance-card button { min-width: 82px; padding-inline: 10px; }
  .home-metrics .kpi { padding: 10px; }
  .home-metrics .kpi .label { font-size: 10px; }
  .home-metrics .kpi .value { font-size: 15px; }
  .segmented-control button { padding-inline: 8px; font-size: 12px; }
  .project-card-bottom { grid-template-columns: minmax(0, 1fr) 28px; }
  .detail-sheet-content {
    padding-right: max(12px, env(safe-area-inset-right));
    padding-left: max(12px, env(safe-area-inset-left));
  }
  .project-detail-hero { padding: 17px; }
  .project-detail-hero h2 { font-size: 25px; }
  .project-detail-vitals > div { padding: 14px; }
  .project-detail-vitals strong { font-size: 17px; }
  .detail-role-option { grid-template-columns: minmax(0, 1fr); }
  .detail-role-pay { justify-content: space-between; }
}

@media (max-width: 700px) and (max-height: 540px) {
  .nav,
  body[data-app-mode="customer"] .partner-tabs-card { min-height: calc(58px + env(safe-area-inset-bottom)); padding-top: 2px; }
  .nav { grid-auto-rows: 54px; }
  .nav button,
  .nav button:hover,
  .nav button.active,
  body[data-app-mode="customer"] .partner-tabs button,
  body[data-app-mode="customer"] .partner-tabs button:hover,
  body[data-app-mode="customer"] .partner-tabs button.active { min-height: 54px; }
  .nav-icon { height: 23px; flex-basis: 23px; }
  .nav-label { font-size: 11px; }
  .shell { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  body:has(input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):focus, textarea:focus) .nav,
  body[data-app-mode="customer"]:has(input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):focus, textarea:focus) .partner-tabs-card { display: none; }
}

@media (min-width: 701px) and (max-width: 900px) and (max-height: 540px) {
  .app-layout { grid-template-columns: 170px minmax(0,1fr); }
  .profile-card { display: none; }
  .sidebar { top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* A throttled Telegram webview can pause entry animations on their first
   frame. Keep operational layers fully usable even while backgrounded. */
.partner-create-flow,
body.partner-project-open #partnerRequestManageCard,
.sheet-backdrop,
.detail-sheet,
.tab-view.tab-enter,
.admin-workspace-section.tab-enter {
  animation: none !important;
  opacity: 1;
  transform: none;
}

/* Admin workspace V2 */
.admin-workspace {
  position: relative;
  display: grid;
  gap: 14px;
  min-width: 0;
}

.admin-workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 7px 3px 2px;
}

.admin-workspace-header h2,
.admin-section-heading h2 {
  margin: 0;
  color: var(--flow-text);
  font-family: var(--flow-font);
  font-size: 31px;
  font-weight: 800;
  line-height: 1.13;
  letter-spacing: -.055em;
}

.admin-workspace-header p,
.admin-section-heading p {
  margin: 5px 0 0;
  color: var(--flow-text-2);
  font-size: 13px;
}

.admin-refresh-button {
  width: auto;
  min-width: 126px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.admin-refresh-button > svg { width: 19px; height: 19px; flex: 0 0 19px; }

.admin-workspace-nav {
  position: sticky;
  top: 10px;
  z-index: 55;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--flow-divider);
  border-radius: 21px;
  background: var(--flow-nav-glass);
  box-shadow: var(--flow-shadow-card);
  backdrop-filter: blur(18px);
}

.admin-workspace-nav button,
.admin-workspace-nav button:hover,
.admin-workspace-nav button:active {
  position: relative;
  min-width: 0;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 10px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--flow-text-2);
  box-shadow: none;
  font-size: 12px;
  font-weight: 700;
  transform: none;
}

.admin-workspace-nav button.active,
.admin-workspace-nav button.active:hover,
.admin-workspace-nav button.active:active {
  background: var(--flow-accent-soft);
  color: var(--flow-primary);
}

.admin-nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  flex: 0 0 24px;
  place-items: center;
}

.admin-nav-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-nav-badge {
  position: absolute;
  top: 5px;
  right: 8px;
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid var(--flow-surface);
  border-radius: 999px;
  background: var(--flow-danger);
  color: var(--flow-on-danger);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}

.admin-workspace-section {
  min-width: 0;
  display: grid;
  gap: 14px;
  scroll-margin-top: 86px;
  animation: flowReveal .2s ease both;
}

.admin-home-hero {
  position: relative;
  min-height: 276px;
  display: grid;
  align-content: end;
  overflow: hidden;
  padding: 28px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 92% 5%, rgba(126,111,255,.48), transparent 31%),
    linear-gradient(145deg, #17181e 0%, #252631 100%);
  color: #fff;
  box-shadow: 0 17px 42px rgba(20,24,34,.17);
}

.admin-home-hero::after {
  content: "";
  position: absolute;
  top: -84px;
  right: -55px;
  width: 210px;
  height: 210px;
  border: 42px solid rgba(255,255,255,.055);
  border-radius: 50%;
}

.admin-home-hero > * { position: relative; z-index: 1; }

.admin-home-state {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.68);
  font-size: 11px;
  font-weight: 700;
}

.admin-live-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #76e6b1;
  box-shadow: 0 0 0 4px rgba(118,230,177,.12);
}

.admin-home-hero h3 {
  margin: 18px 0 7px;
  color: #fff;
  font-size: 27px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.055em;
}

.admin-home-hero > p {
  max-width: 690px;
  margin: 0;
  color: rgba(255,255,255,.64);
  font-size: 13px;
}

.admin-home-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 22px;
}

.admin-home-stats > div {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 17px;
  background: rgba(255,255,255,.075);
}

.admin-home-stats .loading-skeleton { grid-column: 1 / -1; min-height: 64px; border: 0; }
.admin-home-stats span { color: rgba(255,255,255,.56); font-size: 10px; }
.admin-home-stats strong { overflow: hidden; color: #fff; font-size: 18px; font-weight: 800; letter-spacing: -.035em; text-overflow: ellipsis; }

.admin-home-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.admin-home-actions button,
.admin-home-actions button:hover,
.admin-home-actions button:active {
  min-height: 92px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 24px;
  gap: 12px;
  align-items: center;
  padding: 15px 17px;
  border: 0;
  border-radius: 23px;
  background: var(--flow-surface);
  color: var(--flow-text);
  box-shadow: var(--flow-shadow-card);
  text-align: left;
  transform: none;
}

.admin-home-actions button:hover { background: var(--flow-surface-hover); }
.admin-home-actions button > span:nth-child(2) { display: grid; min-width: 0; gap: 3px; }
.admin-home-actions strong { font-size: 15px; font-weight: 780; }
.admin-home-actions small { overflow: hidden; color: var(--flow-text-2); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.admin-home-actions button > b { color: var(--flow-text-3); font-size: 25px; font-weight: 500; }
.admin-home-actions button > b svg { width: 20px; height: 20px; }

.admin-home-action-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: var(--flow-accent-soft);
  color: var(--flow-primary);
  font-size: 19px;
  font-weight: 750;
}
.admin-home-action-icon svg { width: 23px; height: 23px; }

.admin-home-action-icon.decisions { background: var(--flow-warning-soft); color: var(--flow-warning); }
.admin-home-action-icon.people { background: var(--flow-info-soft); color: var(--flow-info); }
.admin-home-action-icon.more { background: var(--flow-success-soft); color: var(--flow-success); }

.admin-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 6px 3px 3px;
}

.admin-section-heading > button { width: auto; min-width: 118px; }

.admin-filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  padding: 5px;
  border-radius: 20px;
  background: var(--flow-surface);
  box-shadow: var(--flow-shadow-card);
}

.admin-filter-bar select {
  min-width: 0;
  min-height: 46px;
  border-radius: 15px;
  background: var(--flow-surface-muted);
  font-size: 13px;
}

.admin-projects-list { gap: 9px; }

#tab-admin .admin-request-card {
  padding: 18px;
  border: 0;
  border-radius: 22px;
  background: var(--flow-surface);
  box-shadow: var(--flow-shadow-card);
}

#tab-admin .admin-request-card > .request-vitals { margin-top: 14px; }

#tab-admin .admin-request-card > .toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--flow-divider);
}

#tab-admin .admin-request-card > .toolbar button { min-height: 44px; }

.admin-create-card {
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: var(--flow-surface);
  box-shadow: var(--flow-shadow-card);
  scroll-margin-top: 92px;
}

.admin-create-card > summary {
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  gap: 3px 12px;
  padding: 15px 18px;
  list-style: none;
  cursor: pointer;
}

.admin-create-card > summary::-webkit-details-marker { display: none; }
.admin-create-card > summary::after { content: "+"; grid-column: 2; grid-row: 1 / 3; align-self: center; color: var(--flow-primary); font-size: 26px; font-weight: 500; }
.admin-create-card[open] > summary::after { content: "−"; }
.admin-create-card > summary span { color: var(--flow-text); font-size: 15px; font-weight: 780; }
.admin-create-card > summary small { color: var(--flow-text-2); font-size: 11px; font-weight: 500; }

.admin-create-form {
  gap: 10px;
  padding: 18px;
  border-top: 1px solid var(--flow-divider);
}

.admin-create-total {
  min-height: 56px;
  display: flex;
  align-items: center;
  padding: 12px 15px;
  border-radius: 16px;
  background: var(--flow-accent-soft);
  color: var(--flow-primary);
  font-size: 13px;
  font-weight: 750;
}

.admin-create-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.admin-create-options label { min-height: 52px; display: flex; align-items: center; gap: 9px; padding: 10px 13px; border-radius: 16px; background: var(--flow-surface-soft); color: var(--flow-text); font-size: 12px; font-weight: 650; cursor: pointer; }
.admin-create-options input { width: 20px; min-width: 20px; min-height: 20px; height: 20px; margin: 0; padding: 0; accent-color: var(--flow-primary); }

.admin-subtabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 18px;
  background: var(--flow-skeleton);
}

.admin-subtabs button,
.admin-subtabs button:hover,
.admin-subtabs button:active {
  min-width: 0;
  min-height: 46px;
  padding: 8px 12px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--flow-text-2);
  box-shadow: none;
  font-size: 12px;
  transform: none;
}

.admin-subtabs button.active,
.admin-subtabs button.active:hover,
.admin-subtabs button.active:active { background: var(--flow-surface); color: var(--flow-text); box-shadow: 0 2px 9px rgba(20,24,34,.07); }
.admin-subtabs button span { margin-left: 3px; color: var(--flow-text-3); font-size: 10px; }

.admin-decision-panel,
.admin-people-panel,
.admin-analytics-card,
.admin-system-card { margin: 0 !important; padding: 20px; }

.admin-decision-filters { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(150px, .45fr); width: min(520px, 100%); }
.admin-decision-filters input { min-width: 0 !important; }

#tab-admin .items { gap: 8px; }
#tab-admin .items > .item {
  padding: 17px;
  border: 0;
  border-radius: 20px;
  background: var(--flow-surface-muted);
  box-shadow: none;
}

#tab-admin .items > .item:hover { border: 0; background: var(--flow-row-hover); box-shadow: none; }
#tab-admin .items > .item.customer-candidate-pending { box-shadow: inset 3px 0 0 var(--flow-warning); }
#tab-admin .items > .item .toolbar { margin-top: 12px; }
#tab-admin .items > .item .toolbar button { min-height: 44px; }

#adminUserDetails { margin-top: 10px !important; white-space: pre-line; }
#adminUserBottomActions { margin-top: 9px !important; }

.admin-full-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.admin-full-stats .kpi { background: var(--flow-surface-muted); }

.admin-system-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.admin-system-card > div { display: flex; align-items: center; gap: 14px; }
.admin-system-card h3 { margin: 0; color: var(--flow-text); font-size: 15px; font-weight: 780; }
.admin-system-card p { margin: 4px 0 0; color: var(--flow-text-2); font-size: 11px; }
.admin-system-card > button { width: auto; min-width: 132px; }
.admin-system-icon { width: 46px; height: 46px; display: grid; flex: 0 0 46px; place-items: center; border-radius: 15px; background: var(--flow-accent-soft); color: var(--flow-primary); font-size: 20px; }
.admin-system-icon svg { width: 23px; height: 23px; }

.admin-detail-empty > span:first-child {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--flow-accent-soft);
  color: var(--flow-primary);
}
.admin-detail-empty > span:first-child svg { width: 24px; height: 24px; }

@media (max-width: 980px) {
  .admin-workspace-nav button { gap: 5px; padding-inline: 6px; font-size: 11px; }
  .admin-full-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-decision-panel > .card-head { align-items: stretch; flex-direction: column; }
  .admin-decision-filters { width: 100%; }
}

@media (min-width: 701px) and (max-width: 900px) {
  body[data-app-mode="admin"] .app-layout { display: block; }
  body[data-app-mode="admin"] .sidebar { display: none; }
  body[data-app-mode="admin"] .content { width: 100%; max-width: none; }
}

@media (max-width: 700px) {
  body[data-app-mode="admin"] .shell { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  body[data-app-mode="admin"] .content {
    padding-right: max(14px, env(safe-area-inset-right));
    padding-left: max(14px, env(safe-area-inset-left));
  }
  .admin-workspace { gap: 12px; }
  .admin-workspace-header { padding: 1px 2px 0; }
  .admin-workspace-header h2,
  .admin-section-heading h2 { font-size: 27px; }
  .admin-workspace-header p,
  .admin-section-heading p { font-size: 12px; }
  .admin-refresh-button { width: 46px; min-width: 46px; height: 46px; min-height: 46px; padding: 0; border-radius: 15px; }
  .admin-refresh-button > span:last-child { display: none; }

  .admin-workspace-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 110;
    min-height: calc(67px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    padding-top: 4px;
    padding-right: max(5px, env(safe-area-inset-right));
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: max(5px, env(safe-area-inset-left));
    border: 0;
    border-top: 1px solid var(--flow-divider);
    border-radius: 0;
    background: var(--flow-nav-glass);
    box-shadow: var(--flow-shadow-card);
    transform: none;
  }

  .admin-workspace-nav button,
  .admin-workspace-nav button:hover,
  .admin-workspace-nav button:active,
  .admin-workspace-nav button.active,
  .admin-workspace-nav button.active:hover,
  .admin-workspace-nav button.active:active {
    min-width: 0;
    min-height: 62px;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 4px 1px 3px;
    border-radius: 12px;
    background: transparent;
    color: var(--flow-text-3);
    font-size: 11px;
  }

  .admin-workspace-nav button.active,
  .admin-workspace-nav button.active:hover,
  .admin-workspace-nav button.active:active { color: var(--flow-primary); }
  .admin-nav-icon { width: 27px; height: 27px; flex-basis: 27px; }
  .admin-nav-icon svg { width: 23px; height: 23px; }
  .admin-nav-badge { top: 3px; right: calc(50% - 24px); }

  .admin-workspace-section { gap: 12px; scroll-margin-top: 12px; }
  .admin-home-hero { min-height: 250px; padding: 21px; border-radius: 26px; }
  .admin-home-hero h3 { margin-top: 17px; font-size: 24px; }
  .admin-home-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 18px; }
  .admin-home-stats > div { padding: 11px 12px; }
  .admin-home-stats strong { font-size: 16px; }
  .admin-home-actions { gap: 8px; }
  .admin-home-actions button,
  .admin-home-actions button:hover,
  .admin-home-actions button:active { min-height: 88px; grid-template-columns: 42px minmax(0, 1fr) 18px; gap: 9px; padding: 12px; border-radius: 21px; }
  .admin-home-action-icon { width: 42px; height: 42px; border-radius: 14px; }
  .admin-home-actions strong { font-size: 13px; }
  .admin-home-actions small { font-size: 11px; }

  .admin-section-heading { align-items: center; padding-top: 1px; }
  .admin-section-heading > button { min-width: 106px; min-height: 44px; padding-inline: 12px; font-size: 11px; }
  .admin-filter-bar { gap: 5px; padding: 4px; border-radius: 18px; }
  .admin-filter-bar select { min-height: 44px; padding-inline: 11px 30px; font-size: 11px; }
  #tab-admin .admin-request-card { padding: 16px; border-radius: 21px; }
  #tab-admin .admin-request-card > .toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #tab-admin .admin-request-card > .toolbar button { width: 100%; min-width: 0; padding-inline: 8px; font-size: 10px; }
  .admin-create-card { border-radius: 22px; }
  .admin-create-form { padding: 15px; }
  .admin-create-options { grid-template-columns: 1fr; }

  .admin-subtabs { border-radius: 16px; }
  .admin-subtabs button,
  .admin-subtabs button:hover,
  .admin-subtabs button:active { min-height: 44px; padding-inline: 7px; font-size: 11px; }
  .admin-decision-panel,
  .admin-people-panel,
  .admin-analytics-card,
  .admin-system-card { padding: 16px; border-radius: 22px; }
  .admin-decision-filters { grid-template-columns: 1fr; }
  #tab-admin .items > .item { padding: 15px; border-radius: 18px; }
  #tab-admin .items > .item .toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #tab-admin .items > .item .toolbar button { width: 100%; min-width: 0; padding-inline: 8px; font-size: 10px; }
  #adminUserBottomActions { display: grid; grid-template-columns: 1fr; }
  .admin-full-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-full-stats .kpi { min-height: 82px; padding: 12px; }
  .admin-system-card { align-items: stretch; flex-direction: column; }
  .admin-system-card > button { width: 100%; }

  body[data-app-mode="admin"]:has(input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):focus, textarea:focus) .admin-workspace-nav { display: none; }
}

@media (max-width: 360px) {
  body[data-app-mode="admin"] .content { padding-inline: 12px; }
  .admin-workspace-header h2,
  .admin-section-heading h2 { font-size: 25px; }
  .admin-home-hero { min-height: 238px; padding: 18px; }
  .admin-home-hero h3 { font-size: 22px; }
  .admin-home-actions { grid-template-columns: 1fr; }
  .admin-home-actions button,
  .admin-home-actions button:hover,
  .admin-home-actions button:active { min-height: 78px; }
  .admin-workspace-nav button,
  .admin-workspace-nav button:hover,
  .admin-workspace-nav button:active,
  .admin-workspace-nav button.active { font-size: 11px; }
  .admin-filter-bar { grid-template-columns: 1fr; }
  .admin-section-heading > button { min-width: 92px; }
  .admin-subtabs button,
  .admin-subtabs button:hover,
  .admin-subtabs button:active { font-size: 10px; }
}

@media (max-width: 700px) and (max-height: 540px) {
  .admin-workspace-nav { min-height: calc(58px + env(safe-area-inset-bottom)); padding-top: 2px; }
  .admin-workspace-nav button,
  .admin-workspace-nav button:hover,
  .admin-workspace-nav button:active,
  .admin-workspace-nav button.active { min-height: 54px; }
  .admin-nav-icon { height: 23px; flex-basis: 23px; }
  body[data-app-mode="admin"] .shell { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
}

/* ROLE UPGRADES: customer identity, honest team progress, admin master-detail */
.identity-avatar {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  border-radius: 17px;
  background: var(--flow-accent-soft);
  color: var(--flow-accent-ink);
  font-size: 15px;
  font-weight: 850;
  letter-spacing: -.04em;
}

.identity-avatar-small { width: 38px; height: 38px; flex-basis: 38px; border-radius: 13px; font-size: 12px; }
.admin-detail-avatar { width: 52px; height: 52px; flex-basis: 52px; border-radius: 18px; font-size: 16px; }
.identity-tone-0 { background: var(--flow-accent-soft); color: var(--flow-accent-ink); }
.identity-tone-1 { background: var(--flow-info-soft); color: var(--flow-info); }
.identity-tone-2 { background: var(--flow-success-soft); color: var(--flow-success); }
.identity-tone-3 { background: var(--flow-warning-soft); color: var(--flow-warning); }
.identity-tone-4 { background: var(--flow-danger-soft); color: var(--flow-danger); }

.customer-brand-identity {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  padding: 13px;
  border: 1px solid var(--flow-divider);
  border-radius: 20px;
  background: var(--flow-surface-muted);
}

.customer-brand-identity > div:nth-child(2) { display: grid; min-width: 0; gap: 2px; }
.customer-brand-identity strong { overflow: hidden; color: var(--flow-text); font-size: 14px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.customer-brand-identity span:not(.customer-brand-status) { color: var(--flow-text-2); font-size: 11px; overflow-wrap: anywhere; }
.customer-brand-status { display: inline-flex; min-height: 28px; align-items: center; padding: 0 10px; border-radius: 999px; background: var(--flow-success-soft); color: var(--flow-success); font-size: 10px; font-weight: 750; }

.customer-project-heading { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; align-items: center; margin-top: 12px; }
.customer-project-heading .customer-project-avatar { width: 38px; height: 38px; flex-basis: 38px; border-radius: 13px; font-size: 12px; }
.customer-project-heading h3 { min-width: 0; margin: 0; }
.customer-project-progress.is-unknown {
  background: repeating-linear-gradient(135deg, var(--flow-surface-soft) 0 8px, var(--flow-divider) 8px 10px);
}
.customer-project-progress.is-unknown span { width: 0 !important; background: transparent; }
.customer-project-role-progress { display: flex; gap: 6px; margin-top: 9px; overflow-x: auto; scrollbar-width: none; }
.customer-project-role-progress::-webkit-scrollbar { display: none; }
.customer-project-role-progress > span {
  display: inline-flex;
  min-height: 27px;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--flow-surface-soft);
  color: var(--flow-text-2);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.customer-project-role-progress b { color: var(--flow-text); font-weight: 750; }
.customer-project-role-progress.is-empty { color: var(--flow-text-3); font-size: 10px; }

.admin-split-layout,
.admin-list-pane { min-width: 0; }

.admin-detail-pane { display: none; margin-top: 12px; scroll-margin-top: 14px; }
.admin-user-inline { display: none !important; }
.admin-split-open { display: inline-flex; }

.admin-list-pane .admin-project-actions > button:not(.admin-split-open) { display: none; }
.admin-list-pane .admin-project-actions { display: block !important; }
.admin-list-pane .admin-project-actions .admin-split-open { width: 100%; }
.admin-list-pane .admin-partner-item .item-top > .toolbar > button:not(.admin-split-open) { display: none; }
.admin-list-pane .customer-candidate > .toolbar:not(.admin-split-toolbar),
.admin-list-pane [data-admin-profile-decision-card] > .toolbar:not(.admin-split-toolbar) { display: none; }
.admin-list-pane .admin-split-toolbar,
.admin-list-pane .admin-split-toolbar .admin-split-open { display: block; width: 100%; }

.admin-person-heading { display: flex; min-width: 0; align-items: center; gap: 10px; }
.admin-person-heading > div { min-width: 0; }
.admin-list-pane .item.is-selected { box-shadow: inset 3px 0 0 var(--flow-primary); }

.admin-detail-pane {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--flow-divider);
  border-radius: var(--flow-radius-card);
  background: var(--flow-surface);
  box-shadow: var(--flow-shadow-card);
}

.admin-mobile-detail-close { display: none; }

.admin-detail-empty { display: grid; min-height: 220px; place-items: center; align-content: center; gap: 7px; padding: 24px; color: var(--flow-text-2); text-align: center; }
.admin-detail-empty > span { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 17px; background: var(--flow-surface-soft); color: var(--flow-primary); font-size: 22px; }
.admin-detail-empty > span svg { width: 24px; height: 24px; }
.admin-detail-empty strong { color: var(--flow-text); font-size: 15px; }
.admin-detail-empty p { max-width: 250px; margin: 0; font-size: 11px; }

.admin-detail-content { display: grid; gap: 14px; min-width: 0; }
.admin-detail-heading { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.admin-detail-heading > div { min-width: 0; }
.admin-detail-heading > div > span { color: var(--flow-text-3); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.admin-detail-heading h3 { margin: 2px 0 0; color: var(--flow-text); font-size: 18px; font-weight: 820; line-height: 1.25; letter-spacing: -.035em; overflow-wrap: anywhere; }
.admin-detail-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.admin-detail-meta > span { display: inline-flex; min-height: 30px; align-items: center; gap: 6px; padding: 0 10px; border-radius: 999px; background: var(--flow-surface-soft); color: var(--flow-text-2); font-size: 10px; overflow-wrap: anywhere; }

.admin-detail-progress { display: grid; gap: 8px; padding: 13px; border-radius: 17px; background: var(--flow-surface-muted); }
.admin-detail-progress > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.admin-detail-progress span { color: var(--flow-text-2); font-size: 11px; }
.admin-detail-progress strong { color: var(--flow-text); font-size: 14px; font-weight: 800; }
.admin-detail-progress .customer-project-progress { margin-top: 0; }

.admin-detail-section { display: grid; gap: 8px; padding-top: 13px; border-top: 1px solid var(--flow-divider); }
.admin-detail-section h4 { margin: 0; color: var(--flow-text); font-size: 12px; font-weight: 800; }
.admin-detail-section p { margin: 0; color: var(--flow-text-2); font-size: 11px; white-space: pre-line; overflow-wrap: anywhere; }
.admin-detail-role { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 11px; border-radius: 14px; background: var(--flow-surface-muted); }
.admin-detail-role > span { display: grid; min-width: 0; gap: 2px; }
.admin-detail-role strong { color: var(--flow-text); font-size: 11px; }
.admin-detail-role small { color: var(--flow-text-2); font-size: 9px; }
.admin-detail-role > b { flex: 0 0 auto; color: var(--flow-text); font-size: 10px; font-weight: 750; text-align: right; }

.admin-detail-responses { display: grid; gap: 7px; }
.admin-detail-response { display: flex; min-width: 0; align-items: center; gap: 9px; padding: 9px; border-radius: 14px; background: var(--flow-surface-muted); }
.admin-detail-response > span:last-child { display: grid; min-width: 0; gap: 1px; }
.admin-detail-response strong { color: var(--flow-text); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-detail-response small { color: var(--flow-text-2); font-size: 9px; }
.admin-detail-load { width: 100%; }

.admin-detail-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.admin-detail-metrics > div { display: grid; gap: 2px; padding: 12px; border-radius: 16px; background: var(--flow-surface-muted); }
.admin-detail-metrics span,
.admin-detail-metrics small { color: var(--flow-text-2); font-size: 9px; }
.admin-detail-metrics strong { color: var(--flow-text); font-size: 18px; font-weight: 820; }
.admin-detail-card { margin: 0; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; }
#adminUserDetails { margin-top: 0 !important; padding: 0; white-space: normal; }
#adminUserBottomActions { display: grid; grid-template-columns: 1fr; gap: 8px; padding-top: 14px; border-top: 1px solid var(--flow-divider); }

@media (min-width: 768px) {
  .admin-split-layout {
    display: grid;
    grid-template-columns: minmax(290px, .88fr) minmax(340px, 1.12fr);
    gap: 16px;
    align-items: start;
  }

  .admin-detail-pane,
  #adminPeopleDetailPane {
    display: block;
    position: sticky;
    top: 88px;
    max-height: calc(100dvh - 112px);
    margin-top: 0;
    overflow: auto;
    overscroll-behavior: contain;
  }

  .admin-split-open { display: inline-flex; }
  .admin-list-pane .item { cursor: default; }
  .admin-detail-pane .admin-project-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-detail-pane .admin-project-actions button { width: 100%; min-width: 0; }
}

@media (max-width: 767px) {
  body.admin-mobile-detail-open { overflow: hidden; }
  .admin-detail-pane.is-mobile-open {
    position: fixed;
    inset: 0;
    z-index: 280;
    width: 100%;
    max-width: none;
    max-height: 100dvh;
    display: block;
    margin: 0;
    overflow: auto;
    overscroll-behavior: contain;
    padding-top: max(14px, env(safe-area-inset-top));
    padding-right: max(14px, env(safe-area-inset-right));
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
    padding-left: max(14px, env(safe-area-inset-left));
    border: 0;
    border-radius: 0;
    background: var(--flow-bg);
    box-shadow: none;
  }
  .admin-mobile-detail-close,
  .admin-mobile-detail-close:hover,
  .admin-mobile-detail-close:active {
    position: sticky;
    top: 0;
    z-index: 3;
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 14px;
    background: var(--flow-sheet-glass);
    color: var(--flow-text);
    box-shadow: var(--flow-shadow-card);
    backdrop-filter: blur(18px);
    transform: none;
  }
  .admin-mobile-detail-back-icon { width: 17px; height: 17px; transform: rotate(180deg); }
  .admin-detail-heading { grid-template-columns: 48px minmax(0, 1fr); }
  .admin-detail-heading > :last-child:not(div) { grid-column: 1 / -1; justify-self: start; }
}

@media (min-width: 1180px) {
  .admin-split-layout { grid-template-columns: minmax(330px, .8fr) minmax(430px, 1.2fr); gap: 20px; }
}

@media (max-width: 420px) {
  .customer-brand-identity { grid-template-columns: 44px minmax(0, 1fr); }
  .customer-brand-identity .identity-avatar { width: 44px; height: 44px; flex-basis: 44px; border-radius: 15px; }
  .customer-brand-status { display: none; }
}

/* Brand ink is intentionally brighter than the filled action color in dark mode. */
.step-pill.active,
.badge,
.nav button.active,
.nav button.active .nav-icon,
.screen-eyebrow,
.quick-action-icon,
.project-card-badge,
.profile-screen-avatar,
.settings-summary-icon,
.shift-card-meta .flow-inline-icon,
.shift-progress span.active,
.finance-balance-total,
.partner-tabs button.active,
.person-avatar,
.flow-calc-preview,
.customer-project-status,
.customer-project-location > .flow-inline-icon,
.project-detail-status span:last-child,
.project-detail-meta .flow-inline-icon,
.detail-role-pay,
.action-sheet-rating-option:has(input:checked),
.onboarding-step,
.admin-workspace-nav button.active,
.admin-home-action-icon,
.admin-create-card > summary::after,
.admin-system-icon,
.admin-detail-empty > span:first-child {
  color: var(--flow-accent-ink);
}

.home-focus-link,
.home-focus-card > button:not(.home-focus-link),
.home-focus-card > button:not(.home-focus-link):hover { color: var(--flow-inverse-accent); }

::selection { background: var(--flow-accent-soft); color: var(--flow-text); }

@media (max-width: 700px) {
  .proart-atmosphere::before { right: -115px; width: 410px; opacity: .48; }
  .proart-atmosphere::after { left: -240px; opacity: .38; }
  .proart-atmosphere span:last-child { display: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .flow-page-header,
  .flow-page-footer,
  .nav,
  .partner-tabs-card,
  .admin-workspace-nav { backdrop-filter: none; }
}

/* Quiet, semantic feedback shared by worker, customer and admin actions. */
[data-ui-state],
.is-ui-success,
.is-ui-warning,
.is-ui-error {
  --flow-ui-state: var(--flow-info);
  --flow-ui-state-soft: var(--flow-info-soft);
  animation: flowStateConfirm .72s ease-out both;
}

[data-ui-state="success"],
.is-ui-success { --flow-ui-state: var(--flow-success); --flow-ui-state-soft: var(--flow-success-soft); }
[data-ui-state="warning"],
.is-ui-warning { --flow-ui-state: var(--flow-warning); --flow-ui-state-soft: var(--flow-warning-soft); }
[data-ui-state="error"],
.is-ui-error { --flow-ui-state: var(--flow-danger); --flow-ui-state-soft: var(--flow-danger-soft); }

button[data-ui-state],
input[data-ui-state],
textarea[data-ui-state],
select[data-ui-state],
.item[data-ui-state],
.content-card[data-ui-state],
.action-sheet[data-ui-state] {
  box-shadow: 0 0 0 3px var(--flow-ui-state-soft), inset 0 0 0 1px var(--flow-ui-state);
}

.connectivity-banner {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  z-index: 520;
  width: min(560px, calc(100% - 28px));
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 42px 10px 16px;
  border: 1px solid var(--flow-divider);
  border-radius: 16px;
  background: var(--flow-sheet-glass);
  color: var(--flow-text);
  box-shadow: var(--flow-shadow-overlay);
  backdrop-filter: blur(18px);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  transform: translateX(-50%);
}
.connectivity-banner[hidden] { display: none; }
.connectivity-banner::before {
  content: "";
  position: absolute;
  right: 17px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--flow-ui-state, var(--flow-info));
  box-shadow: 0 0 0 4px var(--flow-ui-state-soft, var(--flow-info-soft));
}
.connectivity-banner[data-state="offline"] { --flow-ui-state: var(--flow-warning); --flow-ui-state-soft: var(--flow-warning-soft); }
.connectivity-banner[data-state="reconnecting"] { --flow-ui-state: var(--flow-info); --flow-ui-state-soft: var(--flow-info-soft); }
.connectivity-banner[data-state="error"] { --flow-ui-state: var(--flow-danger); --flow-ui-state-soft: var(--flow-danger-soft); }
.connectivity-banner[data-state="online"] { --flow-ui-state: var(--flow-success); --flow-ui-state-soft: var(--flow-success-soft); }

@keyframes flowStateConfirm {
  0% { filter: saturate(1); }
  38% { filter: saturate(1.16); }
  100% { filter: saturate(1); }
}

@media (max-width: 700px) {
  .connectivity-banner { top: max(8px, env(safe-area-inset-top)); width: calc(100% - 20px); padding-left: 13px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  [data-ui-state],
  .is-ui-success,
  .is-ui-warning,
  .is-ui-error { animation: none !important; transition: none !important; }
  .connectivity-banner { transition: none !important; }
}

body[data-motion-state="paused"] *,
body[data-motion-state="paused"] *::before,
body[data-motion-state="paused"] *::after { animation-play-state: paused !important; }

.card-toggle-icon { width: 19px; height: 19px; transition: transform .16s ease; }
.card-toggle.is-expanded .card-toggle-icon { transform: rotate(-90deg); }

@media (max-width: 700px) {
  input,
  textarea,
  select { font-size: 16px !important; }

  .mobile-brandbar {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 9px;
    margin: -2px 2px 13px;
  }
  .mobile-brand-mark {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--flow-logo-surface);
    box-shadow: inset 0 0 0 1px rgba(11,40,87,.09), var(--flow-shadow-card);
  }
  .mobile-brand-mark svg { width: 31px; height: 31px; }
  .mobile-brand-copy { display: grid; min-width: 0; gap: 0; }
  .mobile-brand-copy strong { color: var(--flow-brand-purple); font-size: 15px; font-weight: 850; line-height: 1.1; letter-spacing: -.045em; }
  .mobile-brand-copy strong b { color: var(--flow-logo-orange); font-weight: inherit; }
  .mobile-brand-copy small { color: var(--flow-text-3); font-size: 9px; font-weight: 650; letter-spacing: .015em; }
}

.admin-automation-tools {
  display: grid;
  gap: 16px;
}
.admin-automation-tools.hidden { display: none; }
.admin-automation-tools .content-card { margin: 0; }
.admin-automation-tools #adminExternalSourcesList { margin-top: 14px; }
.admin-automation-tools .chip input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  margin: 0;
}
.response-contact-access {
  display: grid;
  justify-items: start;
  gap: 10px;
}
.response-contact-access p {
  margin: 0;
  color: var(--flow-text-2);
  line-height: 1.5;
}

/* External-response analytics is an unframed workspace, not another settings card. */
.admin-external-analytics {
  min-width: 0;
  display: grid;
  gap: 18px;
  padding: 24px 3px;
  border-top: 1px solid var(--flow-divider);
  border-bottom: 1px solid var(--flow-divider);
}
.admin-external-analytics-head {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.admin-external-analytics-head h3 {
  margin: 3px 0 0;
  color: var(--flow-text);
  font-size: 22px;
  font-weight: 820;
  line-height: 1.2;
  letter-spacing: 0;
}
.admin-external-analytics-head p {
  margin: 5px 0 0;
  color: var(--flow-text-2);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0;
}
.admin-analytics-export,
.admin-analytics-export:hover,
.admin-analytics-export:active {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 8px;
  transform: none;
}
.admin-analytics-export svg { width: 20px; height: 20px; }

.admin-analytics-filters {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.admin-analytics-filters label,
.admin-analytics-dates label {
  min-width: 0;
  display: grid;
  gap: 5px;
}
.admin-analytics-filters label > span,
.admin-analytics-dates label > span {
  color: var(--flow-text-2);
  font-size: 10px;
  font-weight: 760;
  line-height: 1.2;
  letter-spacing: 0;
}
.admin-analytics-filters select,
.admin-analytics-dates input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border-radius: 8px;
}
.admin-analytics-dates {
  width: min(440px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: -8px;
}
.admin-analytics-dates.hidden { display: none; }

.admin-analytics-summary {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.admin-analytics-metric {
  min-width: 0;
  min-height: 88px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--flow-divider);
  border-radius: 8px;
  background: var(--flow-surface-muted);
}
.admin-analytics-metric span {
  color: var(--flow-text-2);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
.admin-analytics-metric strong {
  color: var(--flow-text);
  font-size: 20px;
  font-weight: 830;
  line-height: 1;
  letter-spacing: 0;
}
.admin-analytics-metric[data-tone="success"] { border-color: color-mix(in srgb, var(--flow-success) 30%, var(--flow-divider)); }
.admin-analytics-metric[data-tone="warning"] { border-color: color-mix(in srgb, var(--flow-warning) 32%, var(--flow-divider)); }
.admin-analytics-metric[data-tone="info"] { border-color: color-mix(in srgb, var(--flow-info) 30%, var(--flow-divider)); }

.admin-analytics-funnel {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.admin-analytics-funnel-item {
  min-width: 0;
  display: grid;
  gap: 7px;
}
.admin-analytics-funnel-copy {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.admin-analytics-funnel-copy span {
  min-width: 0;
  color: var(--flow-text-2);
  font-size: 11px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.admin-analytics-funnel-copy strong {
  flex: 0 0 auto;
  color: var(--flow-text);
  font-size: 13px;
  font-weight: 820;
}
.admin-analytics-progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--flow-progress-track);
}
.admin-analytics-progress > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--flow-info);
}
.admin-analytics-funnel-item[data-tone="success"] .admin-analytics-progress > span { background: var(--flow-success); }
.admin-analytics-funnel-item[data-tone="warning"] .admin-analytics-progress > span { background: var(--flow-warning); }

.admin-analytics-block {
  min-width: 0;
  display: grid;
  gap: 11px;
  padding-top: 15px;
  border-top: 1px solid var(--flow-divider);
}
.admin-analytics-block-head {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.admin-analytics-block-head h4 {
  min-width: 0;
  margin: 0;
  color: var(--flow-text);
  font-size: 14px;
  font-weight: 810;
  line-height: 1.3;
  letter-spacing: 0;
}
.admin-analytics-block-head span {
  color: var(--flow-text-3);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.3;
  text-align: right;
}
.admin-analytics-trend {
  min-width: 0;
  height: 188px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(36px, 1fr);
  align-items: end;
  gap: 7px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 8px 2px 3px;
}
.admin-analytics-trend-day {
  height: 174px;
  min-width: 36px;
  display: grid;
  grid-template-rows: 18px minmax(90px, 1fr) 17px;
  align-items: end;
  gap: 4px;
  text-align: center;
}
.admin-analytics-trend-day b {
  color: var(--flow-text);
  font-size: 10px;
  font-weight: 780;
  line-height: 1;
}
.admin-analytics-trend-day > span {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-bottom: 1px solid var(--flow-divider);
}
.admin-analytics-trend-day i {
  width: min(22px, 72%);
  min-height: 3px;
  display: block;
  border-radius: 4px 4px 1px 1px;
  background: var(--flow-info);
}
.admin-analytics-trend-day:nth-child(3n + 2) i { background: var(--flow-success); }
.admin-analytics-trend-day:nth-child(3n + 3) i { background: var(--flow-warning); }
.admin-analytics-trend-day small {
  color: var(--flow-text-3);
  font-size: 9px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}
.admin-analytics-breakdowns {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.admin-analytics-rows,
.admin-analytics-requests {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 6px;
}
.admin-analytics-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--flow-divider);
}
.admin-analytics-row:last-child { border-bottom: 0; }
.admin-analytics-row > span { min-width: 0; display: grid; gap: 3px; }
.admin-analytics-row strong {
  min-width: 0;
  color: var(--flow-text);
  font-size: 12px;
  font-weight: 770;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.admin-analytics-row small {
  color: var(--flow-text-2);
  font-size: 10px;
  line-height: 1.35;
}
.admin-analytics-row > b {
  color: var(--flow-text);
  font-size: 12px;
  font-weight: 820;
  white-space: nowrap;
}
.admin-analytics-request,
.admin-analytics-request:hover,
.admin-analytics-request:active {
  width: 100%;
  min-width: 0;
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--flow-divider);
  border-radius: 8px;
  background: var(--flow-surface);
  color: var(--flow-text);
  text-align: left;
  transform: none;
}
.admin-analytics-request:hover { background: var(--flow-surface-hover); }
.admin-analytics-request > span { min-width: 0; display: grid; gap: 3px; }
.admin-analytics-request strong {
  min-width: 0;
  font-size: 12px;
  font-weight: 780;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.admin-analytics-request small {
  min-width: 0;
  color: var(--flow-text-2);
  font-size: 10px;
  font-weight: 620;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.admin-analytics-request > b {
  color: var(--flow-text);
  font-size: 12px;
  font-weight: 820;
  white-space: nowrap;
}
.admin-analytics-request svg {
  width: 17px;
  height: 17px;
  color: var(--flow-text-3);
}
.admin-analytics-note {
  margin: -2px 0 0;
  color: var(--flow-text-3);
  font-size: 10px;
  line-height: 1.5;
}

@media (max-width: 820px) {
  .admin-analytics-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-analytics-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-analytics-breakdowns { grid-template-columns: 1fr; gap: 16px; }
}

@media (max-width: 520px) {
  .admin-external-analytics { gap: 16px; padding-block: 20px; }
  .admin-external-analytics-head h3 { font-size: 19px; }
  .admin-analytics-filters { grid-template-columns: 1fr; }
  .admin-analytics-dates { width: 100%; }
  .admin-analytics-funnel { grid-template-columns: 1fr; gap: 11px; }
  .admin-analytics-request,
  .admin-analytics-request:hover,
  .admin-analytics-request:active {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }
  .admin-analytics-request > b { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 350px) {
  .admin-analytics-summary { grid-template-columns: 1fr; }
  .admin-analytics-dates { grid-template-columns: 1fr; }
}
