    :root {
      --bg: #0c1222;
      --bg-2: #101827;
      --surface: rgba(255, 255, 255, 0.08);
      --surface-2: rgba(255, 255, 255, 0.12);
      --surface-strong: rgba(255, 255, 255, 0.94);
      --line: rgba(255, 255, 255, 0.14);
      --line-dark: rgba(15, 23, 42, 0.12);
      --text: #f8fafc;
      --text-dark: #101828;
      --muted: #aeb9cc;
      --muted-dark: #667085;
      --brand: #7c3aed;
      --brand-2: #06b6d4;
      --brand-3: #22c55e;
      --warning: #f59e0b;
      --danger: #ef4444;
      --radius-lg: 28px;
      --radius-md: 20px;
      --radius-sm: 14px;
      --shadow: 0 24px 80px rgba(0, 0, 0, 0.26);
      --shadow-soft: 0 16px 42px rgba(15, 23, 42, 0.16);
    }

    * { box-sizing: border-box; }
    html { min-height: 100%; scroll-behavior: smooth; touch-action: manipulation; }
    body {
      margin: 0;
      min-height: 100%;
      font-family: Inter, Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      color: var(--text);
      background:
        radial-gradient(900px 520px at 10% -10%, rgba(124, 58, 237, 0.42), transparent 60%),
        radial-gradient(820px 460px at 95% 0%, rgba(6, 182, 212, 0.34), transparent 55%),
        radial-gradient(700px 500px at 50% 105%, rgba(34, 197, 94, 0.18), transparent 62%),
        linear-gradient(145deg, var(--bg) 0%, var(--bg-2) 100%);
      overflow-x: hidden;
      touch-action: manipulation;
      padding-bottom: env(safe-area-inset-bottom);
    }
    body::before {
      content: "";
      position: fixed;
      inset: 0;
      pointer-events: none;
      opacity: 0.14;
      background-image:
        linear-gradient(to right, rgba(255,255,255,0.18) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.14) 1px, transparent 1px);
      background-size: 42px 42px;
      mask-image: radial-gradient(circle at top, black, transparent 75%);
      animation: gridDrift 34s linear infinite;
    }
    body::after {
      content: "";
      position: fixed;
      inset: -18% -22%;
      pointer-events: none;
      z-index: 0;
      background:
        radial-gradient(34% 30% at 15% 22%, rgba(124,58,237,0.22), transparent 70%),
        radial-gradient(30% 28% at 82% 18%, rgba(6,182,212,0.18), transparent 72%),
        radial-gradient(38% 32% at 56% 88%, rgba(34,197,94,0.12), transparent 72%);
      filter: blur(24px);
      animation: bgFloat 20s ease-in-out infinite alternate;
    }
    a { color: inherit; }
    .hidden { display: none !important; }
    .shell {
      width: min(1180px, calc(100% - 28px));
      margin: 0 auto;
      padding: calc(16px + env(safe-area-inset-top)) 0 calc(36px + env(safe-area-inset-bottom));
      position: relative;
      z-index: 1;
    }
    .topbar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 14px;
      margin-bottom: 18px;
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: rgba(255,255,255,0.07);
      backdrop-filter: blur(20px);
      box-shadow: 0 12px 34px rgba(0,0,0,0.16);
      transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
      animation: floatIn .42s cubic-bezier(.2,.7,.2,1) both;
    }
    .topbar:active {
      transform: translateY(1px);
    }
    .brand {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
    }
    .brand-mark {
      width: 42px;
      height: 42px;
      border-radius: 16px;
      display: grid;
      place-items: center;
      font-weight: 900;
      letter-spacing: -0.08em;
      background: linear-gradient(135deg, #ffffff 0%, #c7d2fe 100%);
      color: #111827;
      box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4), 0 10px 28px rgba(124,58,237,0.32);
    }
    .brand-title { font-weight: 900; letter-spacing: -0.04em; line-height: 1.05; }
    .brand-sub { color: var(--muted); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .top-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
    .icon-button {
      width: 42px;
      min-width: 42px;
      height: 42px;
      min-height: 42px;
      padding: 0;
      border-radius: 12px;
      display: inline-grid;
      place-items: center;
      font-size: 21px;
      line-height: 1;
      letter-spacing: 0;
    }
    .sync-state {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      min-height: 34px;
      padding: 7px 10px;
      border: 1px solid rgba(255,255,255,0.14);
      border-radius: 12px;
      background: rgba(255,255,255,0.07);
      color: var(--muted);
      font-size: 12px;
      font-weight: 800;
      letter-spacing: 0;
      white-space: nowrap;
    }
    .sync-state::before {
      content: "";
      width: 7px;
      height: 7px;
      flex: 0 0 7px;
      border-radius: 50%;
      background: #94a3b8;
      box-shadow: 0 0 0 3px rgba(148,163,184,0.14);
    }
    .sync-state.syncing::before {
      background: #38bdf8;
      box-shadow: 0 0 0 3px rgba(56,189,248,0.16);
      animation: syncPulse 1s ease-in-out infinite;
    }
    .sync-state.ready::before {
      background: #34d399;
      box-shadow: 0 0 0 3px rgba(52,211,153,0.15);
    }
    .sync-state.error {
      color: #fecaca;
      border-color: rgba(248,113,113,0.26);
      background: rgba(127,29,29,0.2);
    }
    .sync-state.error::before {
      background: #f87171;
      box-shadow: 0 0 0 3px rgba(248,113,113,0.15);
    }
    .mode-switch {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 10px;
      border-radius: 14px;
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid var(--line);
      color: var(--text);
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.02em;
    }
    .mode-switch select {
      min-width: 148px;
      border: 1px solid rgba(255,255,255,0.2);
      border-radius: 10px;
      background: rgba(15, 23, 42, 0.35);
      color: var(--text);
      font-weight: 700;
      min-height: 36px;
      padding: 0 10px;
    }
    .mode-switch option {
      color: #101828;
      background: #ffffff;
    }
    .panel {
      border: 1px solid var(--line);
      border-radius: var(--radius-lg);
      background: linear-gradient(180deg, rgba(255,255,255,0.13), rgba(255,255,255,0.075));
      backdrop-filter: blur(24px);
      box-shadow: var(--shadow);
      overflow: hidden;
      animation: floatIn .36s cubic-bezier(.2,.7,.2,1) both;
    }
    .hero {
      display: grid;
      grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
      gap: 18px;
      padding: 24px;
      align-items: stretch;
    }
    .hero-copy {
      min-height: 320px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      gap: 18px;
      padding: 24px;
      border-radius: 24px;
      background:
        radial-gradient(420px 260px at 0% 0%, rgba(124,58,237,0.42), transparent 62%),
        linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.06));
      border: 1px solid var(--line);
    }
    .eyebrow {
      display: inline-flex;
      width: fit-content;
      align-items: center;
      gap: 8px;
      padding: 7px 11px;
      border-radius: 999px;
      border: 1px solid rgba(255,255,255,0.18);
      background: rgba(255,255,255,0.08);
      color: #dbeafe;
      font-size: 12px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.08em;
    }
    .headline {
      margin: 16px 0 10px;
      max-width: 640px;
      font-size: clamp(34px, 6vw, 70px);
      line-height: 0.92;
      letter-spacing: -0.075em;
      font-weight: 900;
    }
    .gradient-text {
      background: linear-gradient(110deg, #ffffff 0%, #c4b5fd 38%, #67e8f9 78%, #bbf7d0 100%);
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
    }
    .lead {
      max-width: 620px;
      margin: 0;
      color: #cbd5e1;
      font-size: 15px;
      line-height: 1.7;
    }
    .auth-box {
      padding: 22px;
      border-radius: 24px;
      background: var(--surface-strong);
      color: var(--text-dark);
      box-shadow: var(--shadow-soft);
    }
    .section-title { margin: 0 0 6px; font-size: 20px; line-height: 1.15; letter-spacing: -0.03em; }
    .section-sub { margin: 0; color: var(--muted-dark); font-size: 13px; line-height: 1.5; }
    .form-grid { display: grid; gap: 10px; margin-top: 14px; }
    .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
    label.field { display: grid; gap: 7px; flex: 1 1 210px; }
    .field span { color: var(--muted-dark); font-size: 12px; font-weight: 800; }
    input, textarea, button, select {
      font: inherit;
      min-height: 50px;
      border-radius: 15px;
    }
    input, textarea, select {
      width: 100%;
      border: 1px solid #d0d5dd;
      background: #ffffff;
      color: #111827;
      padding: 12px 13px;
      outline: none;
      transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
    }
    input:focus, textarea:focus, select:focus {
      border-color: #8b5cf6;
      box-shadow: 0 0 0 4px rgba(139,92,246,0.16);
    }
    input[readonly] {
      background: #f2f4f7;
      color: #667085;
      cursor: not-allowed;
    }
    textarea { resize: vertical; min-height: 110px; line-height: 1.55; }
    button {
      border: 0;
      padding: 0 16px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      cursor: pointer;
      font-weight: 900;
      letter-spacing: -0.02em;
      color: white;
      background: linear-gradient(135deg, var(--brand), var(--brand-2));
      box-shadow: 0 14px 26px rgba(124,58,237,0.24);
      transition: transform .14s ease, filter .14s ease, box-shadow .14s ease;
    }
    button:hover { transform: translateY(-1px); filter: saturate(1.08); box-shadow: 0 18px 34px rgba(124,58,237,0.28); }
    button:active { transform: translateY(0); }
    button.secondary {
      color: #111827;
      background: #ffffff;
      border: 1px solid #d0d5dd;
      box-shadow: none;
    }
    button.ghost {
      color: #e5e7eb;
      background: rgba(255,255,255,0.08);
      border: 1px solid var(--line);
      box-shadow: none;
    }
    button.danger { background: linear-gradient(135deg, #ef4444, #f97316); }
    .status {
      margin-top: 12px;
      padding: 12px 13px;
      border-radius: 16px;
      border: 1px solid rgba(6,182,212,0.25);
      background: rgba(6,182,212,0.10);
      color: #cffafe;
      font-size: 13px;
      font-weight: 750;
      line-height: 1.45;
    }
    .auth-box .status { color: #155e75; background: #ecfeff; border-color: #a5f3fc; }
    .status.error, .auth-box .status.error { color: #991b1b; background: #fef2f2; border-color: #fecaca; }
    .draft-status {
      min-height: 20px;
      color: #64748b;
      font-size: 12px;
      font-weight: 750;
      line-height: 1.45;
      letter-spacing: 0;
    }
    .draft-status.saving { color: #0369a1; }
    .draft-status.saved { color: #047857; }
    .draft-status.restored { color: #6d28d9; }
    .toast-host {
      position: fixed;
      top: calc(env(safe-area-inset-top) + 12px);
      left: 50%;
      transform: translateX(-50%);
      z-index: 9999;
      pointer-events: none;
      width: min(92vw, 560px);
      display: grid;
      justify-items: center;
      gap: 8px;
    }
    .toast {
      opacity: 0;
      transform: translateY(-12px) scale(0.98);
      transition: opacity 0.2s ease, transform 0.2s ease;
      border-radius: 14px;
      padding: 12px 14px;
      border: 1px solid rgba(6, 182, 212, 0.28);
      background: rgba(15, 23, 42, 0.95);
      color: #e2f9ff;
      font-size: 13px;
      font-weight: 800;
      box-shadow: 0 14px 34px rgba(2, 6, 23, 0.42);
      text-align: center;
      backdrop-filter: blur(10px);
      width: fit-content;
      max-width: 100%;
      white-space: pre-wrap;
      word-break: break-word;
    }
    .toast.show {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
    .toast.error {
      border-color: rgba(248, 113, 113, 0.45);
      background: rgba(127, 29, 29, 0.95);
      color: #fee2e2;
    }
    .register-block {
      margin-top: 14px;
      padding-top: 14px;
      border-top: 1px solid #eaecf0;
    }
    .progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 12px; }
    .step-pill {
      padding: 9px 10px;
      border-radius: 999px;
      text-align: center;
      font-size: 12px;
      font-weight: 900;
      background: #f2f4f7;
      color: #667085;
      border: 1px solid #eaecf0;
    }
    .step-pill.active { color: #5b21b6; background: #f5f3ff; border-color: #ddd6fe; }
    .review {
      margin-top: 12px;
      padding: 13px;
      border-radius: 16px;
      background: #f8fafc;
      border: 1px solid #e5e7eb;
      color: #344054;
      white-space: pre-wrap;
      font-size: 13px;
      line-height: 1.6;
    }
    .app-layout { display: grid; grid-template-columns: 300px minmax(0,1fr); gap: 16px; }
    .sidebar {
      position: sticky;
      top: 12px;
      align-self: start;
      padding: 16px;
      border: 1px solid var(--line);
      border-radius: var(--radius-lg);
      background: rgba(255,255,255,0.08);
      backdrop-filter: blur(24px);
      box-shadow: var(--shadow-soft);
    }
    .profile-card { display: grid; gap: 12px; }
    .avatar-row { display: flex; gap: 12px; align-items: center; min-width: 0; }
    .avatar {
      width: 64px; height: 64px; flex: 0 0 64px;
      display: grid; place-items: center;
      border-radius: 22px;
      background: linear-gradient(135deg, #ffffff 0%, #c4b5fd 45%, #67e8f9 100%);
      color: #111827;
      font-size: 26px;
      font-weight: 900;
      box-shadow: 0 18px 38px rgba(6,182,212,0.2);
    }
    .avatar.has-image {
      background-size: cover;
      background-position: center;
      color: transparent;
      text-shadow: none;
    }
    .avatar-actions {
      display: flex;
      gap: 8px;
      margin-top: 8px;
      flex-wrap: wrap;
    }
    .profile-name { margin: 0; font-size: 18px; font-weight: 900; letter-spacing: -0.04em; overflow-wrap: anywhere; }
    .profile-sub { margin-top: 4px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
    .badge {
      width: fit-content;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 7px 10px;
      border-radius: 999px;
      background: rgba(255,255,255,0.09);
      border: 1px solid var(--line);
      color: #e5e7eb;
      font-size: 12px;
      font-weight: 850;
    }
    .nav { display: grid; gap: 7px; margin-top: 14px; }
    .nav button { justify-content: flex-start; width: 100%; min-height: 50px; padding: 0 14px; border-radius: 14px; }
    .nav button.active { background: linear-gradient(135deg, rgba(124,58,237,0.95), rgba(6,182,212,0.92)); color: #fff; }
    .content { display: grid; gap: 16px; min-width: 0; }
    .content-card {
      padding: 18px;
      border: 1px solid var(--line);
      border-radius: var(--radius-lg);
      background: rgba(255,255,255,0.92);
      color: var(--text-dark);
      box-shadow: var(--shadow-soft);
      overflow: hidden;
    }
    .content-card.dark {
      background: linear-gradient(135deg, rgba(17,24,39,0.94), rgba(30,41,59,0.9));
      color: #fff;
      border-color: rgba(255,255,255,0.16);
    }
    .card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
    .card-head h2, .card-head h3 { margin: 0; line-height: 1.12; letter-spacing: -0.04em; }
    .card-head p { margin: 6px 0 0; color: var(--muted-dark); font-size: 13px; line-height: 1.5; }
    .dark .card-head p { color: #cbd5e1; }
    .card-head .card-toggle {
      width: 36px;
      min-width: 36px;
      height: 36px;
      min-height: 36px;
      padding: 0;
      font-size: 18px;
      line-height: 1;
      letter-spacing: 0;
      border-radius: 10px;
      font-weight: 800;
      border: 1px solid #d0d5dd;
      background: #fff;
      color: #344054;
      box-shadow: none;
      flex: 0 0 36px;
    }
    .content-card.collapsible.collapsed > :not(.card-head) { display: none !important; }
    .content-card.collapsible.collapsed .card-head { margin-bottom: 0; }
    .kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
    .kpi {
      padding: 14px;
      border-radius: 20px;
      border: 1px solid #e5e7eb;
      background: linear-gradient(180deg, #ffffff, #f8fafc);
      min-width: 0;
      transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
    }
    .kpi:hover {
      transform: translateY(-1px);
      box-shadow: 0 12px 24px rgba(15,23,42,0.1);
      border-color: #d0d5dd;
    }
    .kpi .label { color: var(--muted-dark); font-size: 12px; font-weight: 800; }
    .kpi .value { margin-top: 7px; font-size: 21px; line-height: 1.1; font-weight: 900; letter-spacing: -0.04em; overflow-wrap: anywhere; }
    .content-card.dark .kpi {
      border-color: rgba(255,255,255,0.16);
      background: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.08));
      color: #ffffff;
      box-shadow: none;
    }
    .content-card.dark .kpi:hover {
      border-color: rgba(255,255,255,0.26);
      box-shadow: 0 12px 26px rgba(0,0,0,0.18);
    }
    .content-card.dark .kpi .label { color: #cbd5e1; }
    .content-card.dark .kpi .value { color: #ffffff; }
    .items { display: grid; gap: 10px; }
    .group-heading {
      margin: 14px 2px 4px;
      font-size: 12px;
      font-weight: 900;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--muted-dark);
    }
    .item {
      padding: 14px;
      border-radius: 20px;
      border: 1px solid #e5e7eb;
      background: #fff;
      display: grid;
      gap: 10px;
      transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
    }
    .item:hover {
      transform: translateY(-1px);
      border-color: #d0d5dd;
      box-shadow: 0 10px 20px rgba(15,23,42,0.08);
    }
    .admin-user-item.active {
      border-color: #7c3aed;
      box-shadow: 0 10px 26px rgba(124,58,237,0.16);
      background: linear-gradient(180deg, #faf5ff, #ffffff);
    }
    .admin-user-inline {
      padding: 12px;
      border-radius: 14px;
      border: 1px solid #e5e7eb;
      background: #f8fafc;
      display: grid;
      gap: 8px;
    }
    .admin-user-inline .item-meta {
      margin-top: 0;
    }
    .customer-apply-card {
      position: relative;
      background:
        radial-gradient(360px 170px at 96% 0%, rgba(6, 182, 212, 0.18), transparent 70%),
        linear-gradient(180deg, #ffffff, #f8fafc);
    }
    .customer-apply-note {
      display: grid;
      gap: 8px;
      padding: 14px;
      border-radius: 18px;
      border: 1px solid #dbeafe;
      background: linear-gradient(135deg, #eff6ff, #ffffff);
      color: #1e3a8a;
      font-size: 13px;
      line-height: 1.55;
      font-weight: 760;
    }
    .customer-candidate {
      border-color: #dbeafe;
      background: linear-gradient(180deg, #ffffff, #f8fbff);
    }
    .customer-candidate-pending {
      border-color: #38bdf8;
      box-shadow: 0 14px 34px rgba(14, 165, 233, 0.14);
    }
    .decision-box {
      padding: 10px 12px;
      border-radius: 14px;
      background: #f8fafc;
      border: 1px solid #e5e7eb;
      color: #475467;
      font-size: 12px;
      line-height: 1.45;
    }
    .item.priority-request {
      border-color: #f59e0b;
      background: linear-gradient(180deg, #fff9eb, #ffffff);
      box-shadow: 0 12px 30px rgba(245,158,11,0.18);
    }
    .item.due-calm {
      border-color: #bfdbfe;
      background: linear-gradient(180deg, #eff6ff, #ffffff);
    }
    .item.due-soon {
      border-color: #facc15;
      background: linear-gradient(180deg, #fefce8, #ffffff);
      box-shadow: 0 12px 28px rgba(250,204,21,0.14);
    }
    .item.due-today {
      border-color: #fb923c;
      background: linear-gradient(180deg, #fff7ed, #ffffff);
      box-shadow: 0 14px 32px rgba(251,146,60,0.18);
    }
    .item.due-critical {
      border-color: #f97316;
      background: linear-gradient(180deg, #ffedd5, #fff7ed);
      box-shadow: 0 16px 36px rgba(249,115,22,0.24);
    }
    .item.due-overdue {
      border-color: #4f46e5;
      background: linear-gradient(180deg, #eef2ff, #f8fafc);
      box-shadow: 0 16px 34px rgba(79,70,229,0.18);
    }
    .item.urgent-fire {
      position: relative;
      overflow: hidden;
      border-color: #ef4444;
      background:
        radial-gradient(260px 120px at 94% 0%, rgba(251,113,133,0.36), transparent 70%),
        linear-gradient(180deg, #fff1f2, #fff7ed);
      box-shadow: 0 18px 44px rgba(239,68,68,0.28);
      animation: urgentPulse 1.45s ease-in-out infinite alternate;
    }
    .item.urgent-fire > * {
      position: relative;
      z-index: 1;
    }
    .item.urgent-fire::after {
      content: "🔥";
      position: absolute;
      right: 14px;
      bottom: 10px;
      font-size: 30px;
      opacity: 0.22;
      pointer-events: none;
      transform: rotate(-10deg);
      z-index: 0;
    }
    .item.request-swipe-card {
      touch-action: pan-y;
      will-change: transform;
    }
    .item.request-swipe-card.dragging {
      transition: none;
      box-shadow: 0 18px 38px rgba(15,23,42,0.18);
    }
    .swipe-hint {
      display: flex;
      justify-content: space-between;
      gap: 10px;
      font-size: 12px;
      font-weight: 900;
      color: #475467;
    }
    .swipe-accept { color: #047857; }
    .swipe-skip { color: #9f1239; }
    @keyframes urgentPulse {
      from { box-shadow: 0 16px 38px rgba(239,68,68,0.22); }
      to { box-shadow: 0 22px 52px rgba(249,115,22,0.34); }
    }
    .item.priority-person {
      border-color: #10b981;
      background: linear-gradient(180deg, #ecfdf5, #ffffff);
    }
    .item.clickable { cursor: pointer; transition: transform 0.16s ease, box-shadow 0.16s ease; }
    .item.clickable:active { transform: scale(0.995); }
    .item.clickable:hover { box-shadow: 0 8px 24px rgba(15,23,42,0.12); }
    .person {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
    }
    .person.callable {
      cursor: pointer;
    }
    .person.callable .item-title {
      text-decoration: underline;
      text-decoration-style: dotted;
      text-underline-offset: 3px;
      text-decoration-color: rgba(2, 132, 199, 0.45);
    }
    .person.callable:active {
      opacity: 0.8;
    }
    .person-avatar {
      width: 38px;
      height: 38px;
      border-radius: 12px;
      flex: 0 0 38px;
      display: grid;
      place-items: center;
      background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
      color: #0f172a;
      font-weight: 900;
      font-size: 13px;
      overflow: hidden;
    }
    .person-avatar.has-image {
      background-size: cover;
      background-position: center;
      color: transparent;
    }
    .item-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
    .item-title { font-weight: 900; letter-spacing: -0.03em; overflow-wrap: anywhere; }
    .item-meta { color: var(--muted-dark); font-size: 12px; line-height: 1.45; margin-top: 4px; overflow-wrap: anywhere; }
    .chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
    .chip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 9px; border-radius: 999px; background: #f2f4f7; color: #344054; font-size: 12px; font-weight: 850; border: 0; text-decoration: none; line-height: 1.2; }
    button.chip { min-height: auto; width: auto; box-shadow: none; cursor: pointer; }
    .chip.good { background: #ecfdf3; color: #027a48; }
    .chip.warn { background: #fffaeb; color: #b54708; }
    .chip.bad { background: #fef3f2; color: #b42318; }
    .chip.tag { background: #eef4ff; color: #3538cd; }
    .chip.due-calm { background: #eff6ff; color: #1d4ed8; }
    .chip.due-soon { background: #fefce8; color: #a16207; }
    .chip.due-today { background: #fff7ed; color: #c2410c; }
    .chip.due-critical { background: #ffedd5; color: #c2410c; }
    .chip.due-overdue { background: #eef2ff; color: #4338ca; }
    .empty { padding: 18px; border-radius: 20px; border: 1px dashed #d0d5dd; color: var(--muted-dark); text-align: center; background: #f8fafc; }
    .tab-view { display: grid; gap: 16px; }
    .tab-view.tab-enter .content-card {
      animation: cardIn .34s cubic-bezier(.18,.72,.2,1) both;
    }
    .tab-view.tab-enter .content-card:nth-of-type(2) { animation-delay: .04s; }
    .tab-view.tab-enter .content-card:nth-of-type(3) { animation-delay: .08s; }
    .tab-view.tab-enter .content-card:nth-of-type(4) { animation-delay: .12s; }
    .tab-view.tab-enter .content-card:nth-of-type(5) { animation-delay: .16s; }
    .app-layout.app-mount .sidebar {
      animation: cardIn .34s cubic-bezier(.18,.72,.2,1) both;
    }
    .app-layout.app-mount .content-card {
      animation: cardIn .34s cubic-bezier(.18,.72,.2,1) both;
    }
    .app-layout.app-mount .content-card:nth-of-type(2) { animation-delay: .04s; }
    .app-layout.app-mount .content-card:nth-of-type(3) { animation-delay: .08s; }
    .app-layout.app-mount .content-card:nth-of-type(4) { animation-delay: .12s; }
    .split { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
    .toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
    .partner-tabs-card { padding: 10px 12px; }
    .partner-tabs {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 8px;
    }
    .partner-tabs button {
      min-height: 40px;
      border-radius: 12px;
      font-weight: 800;
    }
    .partner-tabs button.active {
      border-color: rgba(56, 189, 248, 0.75);
      background: linear-gradient(120deg, rgba(99, 102, 241, 0.92), rgba(14, 165, 233, 0.92));
      color: #fff;
    }
    .code-input { font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; text-align: center; }
    .about-preview {
      margin-top: 10px;
      padding: 14px;
      border-radius: 20px;
      background: #f8fafc;
      border: 1px solid #e5e7eb;
      color: #344054;
      white-space: pre-wrap;
      line-height: 1.6;
    }
    .loading-skeleton {
      position: relative;
      overflow: hidden;
      background: #f2f4f7;
      color: transparent !important;
    }
    .loading-skeleton::after {
      content: "";
      position: absolute;
      inset: 0;
      transform: translateX(-100%);
      background: linear-gradient(90deg, transparent, rgba(255,255,255,0.7), transparent);
      animation: shimmer 1.4s infinite;
    }
    .map-picker-overlay {
      position: fixed;
      inset: 0;
      z-index: 10020;
      display: grid;
      place-items: center;
      padding: 14px;
      background: rgba(2, 6, 23, 0.62);
      backdrop-filter: blur(3px);
    }
    .map-picker {
      width: min(980px, calc(100vw - 20px));
      max-height: calc(100vh - 24px);
      overflow: hidden;
      display: grid;
      grid-template-rows: auto auto auto minmax(260px, 1fr) auto;
      gap: 10px;
      padding: 14px;
      border-radius: 18px;
      background: #ffffff;
      border: 1px solid #d0d5dd;
      box-shadow: 0 26px 60px rgba(2, 6, 23, 0.38);
    }
    .map-picker-head {
      display: flex;
      gap: 10px;
      align-items: center;
      justify-content: space-between;
    }
    #mapPickerCanvas {
      width: 100%;
      min-height: 260px;
      height: min(58vh, 520px);
      border-radius: 14px;
      border: 1px solid #d0d5dd;
      overflow: hidden;
      background: #f2f4f7;
    }
    .map-picker-footer {
      display: grid;
      gap: 8px;
    }
    .hint-strip {
      padding: 12px 14px;
      border-radius: 16px;
      border: 1px solid rgba(125, 211, 252, 0.34);
      background: rgba(2, 132, 199, 0.16);
      color: #e0f2fe;
      font-size: 13px;
      line-height: 1.45;
      white-space: pre-wrap;
    }
    .onboarding-overlay {
      position: fixed;
      inset: 0;
      z-index: 10040;
      display: grid;
      place-items: center;
      padding: 14px;
      background: rgba(2, 6, 23, 0.66);
      backdrop-filter: blur(4px);
    }
    .onboarding-card {
      width: min(680px, calc(100vw - 20px));
      border-radius: 18px;
      border: 1px solid var(--line);
      background: rgba(15, 23, 42, 0.96);
      color: #f8fafc;
      box-shadow: 0 28px 64px rgba(2, 6, 23, 0.52);
      padding: 16px;
      display: grid;
      gap: 12px;
    }
    .onboarding-step {
      color: #bae6fd;
      font-size: 12px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.07em;
    }
    .onboarding-body {
      margin: 0;
      color: #e2e8f0;
      font-size: 14px;
      line-height: 1.55;
      white-space: pre-wrap;
    }
    .onboarding-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      justify-content: space-between;
      align-items: center;
    }
    .onboarding-actions .row {
      margin-left: auto;
    }
    @keyframes shimmer { 100% { transform: translateX(100%); } }
    @keyframes cardIn {
      from { opacity: 0; transform: translateY(10px) scale(0.992); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }
    @keyframes floatIn {
      from { opacity: 0; transform: translateY(8px); }
      to { opacity: 1; transform: translateY(0); }
    }
    @keyframes bgFloat {
      0% { transform: translate3d(0, 0, 0) scale(1); }
      100% { transform: translate3d(1.5%, -1.2%, 0) scale(1.04); }
    }
    @keyframes gridDrift {
      0% { transform: translate3d(0, 0, 0); }
      100% { transform: translate3d(-32px, -18px, 0); }
    }
    @keyframes syncPulse {
      0%, 100% { opacity: 0.55; transform: scale(0.9); }
      50% { opacity: 1; transform: scale(1.12); }
    }
    @media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
    @media (max-width: 980px) {
      .hero { grid-template-columns: 1fr; }
      .app-layout { grid-template-columns: 1fr; }
      .sidebar { position: relative; top: 0; }
      .nav { grid-template-columns: repeat(3, 1fr); }
      .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    }
    @media (max-width: 640px) {
      .shell { width: min(100% - 12px, 1180px); padding-top: calc(10px + env(safe-area-inset-top)); }
      .topbar { border-radius: 22px; align-items: flex-start; flex-direction: column; gap: 10px; }
      .top-actions, .top-actions button, .top-actions .mode-switch, .row button, .toolbar button { width: 100%; }
      .top-actions { justify-content: flex-start; }
      .top-actions .sync-state { flex: 1 1 auto; justify-content: center; }
      .top-actions .icon-button { width: 42px; flex: 0 0 42px; }
      .hero, .hero-copy, .auth-box, .content-card, .sidebar { padding: 14px; border-radius: 22px; }
      .headline { font-size: clamp(36px, 15vw, 52px); }
      .progress { grid-template-columns: 1fr; }
      .nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        position: sticky;
        top: calc(env(safe-area-inset-top) + 8px);
        z-index: 7;
        padding: 8px;
        border-radius: 16px;
        background: rgba(15, 23, 42, 0.62);
        backdrop-filter: blur(14px);
      }
      .nav button {
        min-height: 48px;
        font-size: 13px;
        padding: 0 8px;
        justify-content: center;
      }
      .split { grid-template-columns: 1fr; }
      .partner-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
      .kpi { padding: 10px; border-radius: 16px; }
      .kpi .label { font-size: 11px; }
      .kpi .value { margin-top: 4px; font-size: 18px; }
      #statsGrid.kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
      .card-head { flex-direction: column; }
      input, textarea, select, button { width: 100%; }
      button:hover { transform: none; box-shadow: none; filter: none; }
      .map-picker {
        width: 100%;
        max-height: calc(100vh - 16px);
        border-radius: 14px;
        padding: 10px;
      }
      #mapPickerCanvas {
        height: min(52vh, 420px);
      }
      .onboarding-card {
        width: 100%;
        border-radius: 14px;
        padding: 12px;
      }
      .onboarding-actions {
        flex-direction: column;
        align-items: stretch;
      }
      .onboarding-actions .row {
        margin-left: 0;
        width: 100%;
      }
    }

/* --------------------------------------------------------------------------
   PROART / PRODUCTION FIELDBOOK
   Mobile-first visual system. The legacy selectors above stay as a safety net
   for dynamically generated cards; this layer deliberately redefines the UI.
   -------------------------------------------------------------------------- */

:root {
  --bg: #f2efe6;
  --bg-2: #e8e3d7;
  --surface: #fffdf7;
  --surface-2: #f7f3e9;
  --surface-strong: #fffdf7;
  --line: #d8d2c4;
  --line-dark: #c4bdaf;
  --text: #181a17;
  --text-dark: #181a17;
  --muted: #77786f;
  --muted-dark: #65675f;
  --brand: #d13c26;
  --brand-2: #c9f05d;
  --brand-3: #49bdc8;
  --warning: #9a5b00;
  --danger: #9e2c45;
  --ink: #181a17;
  --ink-2: #30332d;
  --paper: #fffdf7;
  --paper-soft: #f7f3e9;
  --canvas: #f2efe6;
  --coral: #d13c26;
  --coral-dark: #ad2f1d;
  --lime: #c9f05d;
  --cyan: #49bdc8;
  --success: #19704d;
  --focus: #117c88;
  --radius-lg: 26px;
  --radius-md: 19px;
  --radius-sm: 13px;
  --shadow: 0 18px 52px rgba(46, 42, 32, 0.12);
  --shadow-soft: 0 8px 26px rgba(46, 42, 32, 0.08);
  --display-font: "Unbounded", "Arial Black", system-ui, sans-serif;
  --body-font: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { -webkit-tap-highlight-color: transparent; }

html {
  background: var(--canvas);
  color-scheme: light;
  scroll-padding-bottom: 110px;
}

body {
  color: var(--ink);
  font-family: var(--body-font);
  background:
    radial-gradient(650px 440px at 4% 3%, rgba(201, 240, 93, 0.22), transparent 68%),
    radial-gradient(720px 500px at 96% 1%, rgba(73, 189, 200, 0.14), transparent 66%),
    var(--canvas);
}

body::before {
  z-index: 0;
  opacity: 0.38;
  background-image:
    linear-gradient(to right, rgba(24, 26, 23, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(24, 26, 23, 0.055) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 58%);
  animation: none;
}

body::after {
  inset: 0 auto 0 calc(50% + 584px);
  width: 1px;
  z-index: 0;
  background: rgba(24, 26, 23, 0.08);
  filter: none;
  animation: none;
}

::selection { color: var(--ink); background: var(--lime); }

a { color: var(--focus); text-underline-offset: 3px; }

.shell {
  width: min(1180px, calc(100% - 32px));
  padding: calc(14px + env(safe-area-inset-top)) 0 calc(36px + env(safe-area-inset-bottom));
}

.topbar {
  min-height: 66px;
  margin-bottom: 18px;
  padding: 10px 12px;
  border: 1px solid var(--line-dark);
  border-radius: 20px;
  background: rgba(255, 253, 247, 0.94);
  box-shadow: 0 3px 0 rgba(24, 26, 23, 0.08);
  backdrop-filter: none;
  animation: none;
}

.topbar:active { transform: none; }

.brand { gap: 11px; }

.brand-mark {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1.5px solid var(--ink);
  border-radius: 13px;
  color: var(--ink);
  background: var(--coral);
  box-shadow: 3px 3px 0 var(--ink);
}

.brand-mark::after {
  content: "";
  position: absolute;
  top: -4px;
  right: -4px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--lime);
}

.brand-mark svg { width: 32px; height: 32px; }

.brand-title {
  color: var(--ink);
  font-family: var(--display-font);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.055em;
}

.brand-sub {
  color: var(--muted-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.top-actions { flex-wrap: nowrap; }

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 20px;
}

.sync-state {
  min-height: 38px;
  border-color: var(--line);
  border-radius: 11px;
  background: var(--paper-soft);
  color: var(--muted-dark);
  font-size: 11px;
  letter-spacing: 0.01em;
}

.sync-state::before { background: #8c8d84; box-shadow: 0 0 0 3px rgba(140, 141, 132, 0.16); }
.sync-state.syncing::before { background: var(--cyan); box-shadow: 0 0 0 3px rgba(73, 189, 200, 0.16); }
.sync-state.ready::before { background: var(--success); box-shadow: 0 0 0 3px rgba(25, 112, 77, 0.14); }
.sync-state.error { color: #912525; border-color: #e5aaa2; background: #fff1ec; }
.sync-state.error::before { background: var(--danger); }

.mode-switch {
  min-height: 42px;
  padding: 5px 7px 5px 10px;
  border-color: var(--line);
  border-radius: 12px;
  background: var(--paper-soft);
  color: var(--muted-dark);
}

.mode-switch select {
  min-height: 44px;
  border-color: var(--line-dark);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
}

.panel {
  border: 1px solid var(--ink);
  border-radius: 30px;
  background: var(--paper);
  box-shadow: 6px 7px 0 rgba(24, 26, 23, 0.94), var(--shadow);
  backdrop-filter: none;
  animation: fieldbookReveal .38s cubic-bezier(.2,.72,.2,1) both;
}

.hero {
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr);
  gap: 0;
  padding: 0;
}

.hero-copy {
  position: relative;
  min-height: 590px;
  padding: 44px 40px 34px;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 28px 0 0 28px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px),
    var(--ink);
  background-size: 34px 34px, 34px 34px, auto;
}

.hero-copy::before {
  content: "CREW / CALL SHEET / 01";
  position: absolute;
  right: 24px;
  bottom: 22px;
  z-index: 0;
  color: rgba(255, 255, 255, 0.34);
  font-family: var(--display-font);
  font-size: 9px;
  letter-spacing: .08em;
  writing-mode: vertical-rl;
}

.hero-copy::after {
  content: "";
  position: absolute;
  right: -72px;
  top: 82px;
  width: 235px;
  height: 235px;
  border: 36px solid var(--coral);
  border-radius: 50%;
  opacity: .92;
  transform: rotate(-14deg);
}

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

.eyebrow {
  padding: 7px 10px;
  border: 1px solid rgba(201, 240, 93, .72);
  border-radius: 7px;
  background: rgba(201, 240, 93, .12);
  color: var(--lime);
  font-family: var(--display-font);
  font-size: 9px;
  letter-spacing: .04em;
}

.headline {
  max-width: 670px;
  margin: 24px 0 18px;
  color: #fffdf7;
  font-family: var(--display-font);
  font-size: clamp(38px, 5.3vw, 66px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.065em;
}

.gradient-text {
  color: var(--lime);
  background: none;
  -webkit-text-fill-color: currentColor;
}

.lead {
  max-width: 540px;
  color: #d7d8d0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.65;
}

.hero-copy > .chip-row { padding-right: 30px; }
.hero-copy .chip { border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.08); color: #fff; }
.hero-copy .chip.good { border-color: rgba(201,240,93,.58); background: rgba(201,240,93,.12); color: var(--lime); }
.hero-copy .chip.warn { border-color: rgba(230,74,47,.6); background: rgba(230,74,47,.16); color: #ffab98; }

.auth-box {
  padding: 38px 34px;
  border-radius: 0 28px 28px 0;
  background: var(--paper);
  box-shadow: none;
}

.section-title,
.card-head h2,
.card-head h3 {
  font-family: var(--display-font);
  font-weight: 700;
  letter-spacing: -.045em;
}

.section-title { margin-bottom: 8px; font-size: 20px; }
.section-sub { color: var(--muted-dark); font-size: 13px; line-height: 1.55; }

.form-grid { gap: 11px; margin-top: 16px; }
.row { gap: 9px; }
label.field { gap: 7px; }
.field span { color: var(--ink-2); font-size: 11px; font-weight: 800; letter-spacing: .02em; }

input,
textarea,
button,
select { min-height: 48px; border-radius: 13px; }

input,
textarea,
select {
  border: 1px solid var(--line-dark);
  background: #fffefa;
  color: var(--ink);
  padding: 12px 13px;
  font-size: 15px;
}

input::placeholder,
textarea::placeholder { color: #98998f; opacity: 1; }

input:hover,
textarea:hover,
select:hover { border-color: #9d978a; }

input:focus,
textarea:focus,
select:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(73, 189, 200, 0.25);
  background: #fff;
}

input[readonly] { border-style: dashed; background: #eeeae0; color: var(--muted-dark); }
textarea { min-height: 116px; }

button {
  border: 1px solid var(--ink);
  padding: 0 16px;
  color: #fff;
  background: var(--coral);
  box-shadow: 0 3px 0 var(--ink);
  font-weight: 800;
  letter-spacing: -.025em;
  transition: transform .14s ease, box-shadow .14s ease, background-color .14s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: none;
  background: #bd341f;
  box-shadow: 0 5px 0 var(--ink);
}

button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
button:disabled { cursor: not-allowed; opacity: .55; transform: none; box-shadow: none; }

button.secondary {
  border-color: var(--line-dark);
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 2px 0 var(--line-dark);
}

button.secondary:hover { border-color: var(--ink); background: var(--paper-soft); box-shadow: 0 3px 0 var(--ink); }

button.secondary[data-user-request-respond],
button.secondary[data-worker-shift-action="finish-self"],
button.secondary[data-partner-open-request] {
  border-color: var(--ink);
  color: #fff;
  background: var(--coral);
  box-shadow: 0 3px 0 var(--ink);
}

button.secondary[data-partner-response-action="select"],
button.secondary[data-partner-assignment-action="mark_paid"] {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--lime);
  box-shadow: 0 3px 0 var(--ink);
}

button.ghost {
  border-color: var(--line);
  color: var(--ink);
  background: transparent;
  box-shadow: none;
}

button.danger { color: #fff; background: var(--danger); }

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

.status {
  border-color: rgba(73, 189, 200, .42);
  border-radius: 13px;
  background: rgba(73, 189, 200, .12);
  color: #dffcff;
}

.auth-box .status { color: #175c64; background: #e8f9f8; border-color: #a4dcd9; }
.status.error,
.auth-box .status.error { color: #8c2821; background: #fff0ea; border-color: #edb3a5; }

.draft-status { color: var(--muted-dark); font-size: 11px; }
.draft-status.saving { color: #236d75; }
.draft-status.saved { color: var(--success); }
.draft-status.restored { color: #9b431e; }

.register-block { border-top-color: var(--line); }
.progress { gap: 6px; }
.step-pill {
  border-color: var(--line);
  border-radius: 9px;
  background: var(--paper-soft);
  color: var(--muted-dark);
  font-size: 10px;
}
.step-pill.active { color: var(--ink); background: var(--lime); border-color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }

.review,
.about-preview,
.decision-box,
.admin-user-inline {
  border-color: var(--line);
  border-radius: 15px;
  background: var(--paper-soft);
  color: var(--ink-2);
}

.app-layout { grid-template-columns: 270px minmax(0, 1fr); gap: 18px; }

.sidebar {
  top: calc(12px + env(safe-area-inset-top));
  padding: 11px;
  border: 1px solid var(--line-dark);
  border-radius: 25px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  backdrop-filter: none;
}

.profile-card {
  gap: 11px;
  padding: 17px;
  border: 1px solid var(--ink);
  border-radius: 19px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(201,240,93,.1), transparent 42%),
    var(--ink);
}

.avatar {
  width: 58px;
  height: 58px;
  flex-basis: 58px;
  border: 1.5px solid #fff;
  border-radius: 16px;
  background: var(--lime);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--coral);
  font-family: var(--display-font);
  font-size: 20px;
}

.avatar-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 1px; }
.avatar-actions button { min-height: 44px; padding: 0 8px; border-color: rgba(255,255,255,.24); color: #fff; background: rgba(255,255,255,.08); box-shadow: none; font-size: 10px; }
.avatar-actions button:hover { border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.14); box-shadow: none; }
.profile-name { color: #fff; font-family: var(--display-font); font-size: 15px; line-height: 1.2; }
.profile-sub { color: #bfc2b8; font-size: 11px; line-height: 1.4; }
.badge { border-color: rgba(255,255,255,.18); border-radius: 7px; background: rgba(255,255,255,.08); color: var(--lime); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.profile-card .status { margin-top: 0; color: #d9faf7; }

.nav { gap: 4px; margin-top: 9px; }
.nav button {
  min-height: 47px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--muted-dark);
  background: transparent;
  box-shadow: none;
  font-size: 12px;
}
.nav button:hover { transform: none; border-color: var(--line); background: var(--paper-soft); box-shadow: none; }
.nav button.active { border-color: var(--ink); color: var(--ink); background: var(--lime); box-shadow: 2px 2px 0 var(--ink); }

.nav-icon { width: 22px; height: 22px; display: grid; place-items: center; flex: 0 0 22px; }
.nav-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.content { gap: 14px; }

.hint-strip {
  padding: 11px 13px 11px 38px;
  border: 1px solid var(--line-dark);
  border-radius: 14px;
  background: var(--paper);
  color: var(--muted-dark);
  box-shadow: 0 2px 0 rgba(24,26,23,.08);
  font-size: 12px;
}

.hint-strip::before {
  content: "↳";
  position: absolute;
  margin-left: -24px;
  color: #237983;
  font-size: 18px;
  font-weight: 900;
  line-height: .8;
}

.content-card {
  padding: 20px;
  border: 1px solid var(--line-dark);
  border-radius: 24px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.content-card.dark {
  position: relative;
  border-color: var(--ink);
  color: #fff;
  background:
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    var(--ink);
  background-size: 28px 28px, 28px 28px, auto;
  overflow: hidden;
}

.content-card.dark::after {
  content: "";
  position: absolute;
  right: -42px;
  top: -52px;
  width: 148px;
  height: 148px;
  border: 24px solid var(--coral);
  border-radius: 50%;
  opacity: .84;
  pointer-events: none;
}

.content-card.dark > * { position: relative; z-index: 1; }
.card-head { gap: 14px; margin-bottom: 16px; }
.card-head h2 { font-size: 22px; }
.card-head h3 { font-size: 17px; }
.card-head p { max-width: 680px; color: var(--muted-dark); font-size: 12px; line-height: 1.55; }
.dark .card-head p { color: #c7c9c1; }

.card-head .card-toggle {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  border-color: var(--line-dark);
  border-radius: 10px;
  background: var(--paper-soft);
  color: var(--ink);
}

.kpi-grid { gap: 9px; }
.kpi {
  position: relative;
  padding: 15px;
  border-color: var(--line);
  border-radius: 16px;
  background: var(--paper-soft);
  box-shadow: none;
}
.kpi::before { content: ""; display: block; width: 24px; height: 3px; margin-bottom: 10px; border-radius: 99px; background: var(--coral); }
.kpi:nth-child(3n+2)::before { background: var(--cyan); }
.kpi:nth-child(3n+3)::before { background: var(--lime); }
.kpi:hover { transform: none; border-color: var(--line-dark); box-shadow: none; }
.kpi .label { color: var(--muted-dark); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .045em; }
.kpi .value { margin-top: 5px; color: var(--ink); font-family: var(--display-font); font-size: 18px; line-height: 1.18; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.content-card.dark .kpi { border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.075); }
.content-card.dark .kpi::before { background: var(--lime); }
.content-card.dark .kpi:nth-child(3n+2)::before { background: var(--coral); }
.content-card.dark .kpi .label { color: #bfc2b8; }
.content-card.dark .kpi .value { color: #fff; }
.content-card.dark .kpi:hover { border-color: rgba(255,255,255,.24); box-shadow: none; }

.items { gap: 9px; }
.group-heading { color: var(--muted-dark); font-family: var(--display-font); font-size: 9px; letter-spacing: .06em; }

.item {
  position: relative;
  gap: 11px;
  padding: 15px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--ink);
  border-radius: 17px;
  background: #fffefa;
  box-shadow: 0 2px 0 rgba(24,26,23,.07);
}
.item:hover { transform: none; border-color: var(--line-dark); border-left-color: var(--ink); box-shadow: 0 3px 0 rgba(24,26,23,.1); }
.item.clickable:active { transform: translateY(1px); }
.item.clickable:hover { box-shadow: 0 3px 0 rgba(24,26,23,.1); }
.item-title { color: var(--ink); font-family: var(--body-font); font-size: 14px; font-weight: 800; line-height: 1.35; letter-spacing: -.025em; }
.item-meta { color: var(--muted-dark); font-size: 11px; line-height: 1.5; }
.item-top > :first-child { min-width: 0; flex: 1 1 auto; }

.request-vitals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.request-vitals > div {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-soft);
}

.request-vitals > div:only-child { grid-column: 1 / -1; }

.request-vitals span {
  display: block;
  color: var(--muted-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.request-vitals strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-family: var(--display-font);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.04em;
}

.request-meta-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 10px;
  margin-top: 4px;
  color: var(--muted-dark);
  font-size: 12px;
  line-height: 1.45;
}

.request-meta-stack > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.request-role-block {
  display: grid;
  gap: 7px;
  padding-top: 2px;
}

.request-role-heading {
  color: var(--muted-dark);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.request-role-list { display: grid; gap: 7px; }

.request-role-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-soft);
}

.request-role-name {
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.request-role-meta {
  margin-top: 3px;
  color: var(--muted-dark);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.request-role-action {
  width: auto;
  min-width: 108px;
  max-width: 156px;
  padding-inline: 12px;
  overflow-wrap: anywhere;
}

.person-avatar { border: 1px solid var(--line-dark); border-radius: 11px; background: var(--lime); color: var(--ink); }
.person.callable { min-height: 44px; }

.item.priority-request,
.item.priority-person { border-color: #abd355; border-left-color: #7f9d37; background: #fbffe9; box-shadow: 0 2px 0 rgba(90,114,36,.12); }
.item.due-calm { border-color: #b9dce0; border-left-color: var(--cyan); background: #f5ffff; }
.item.due-soon { border-color: #dfc777; border-left-color: #c99822; background: #fffbeb; box-shadow: none; }
.item.due-today,
.item.due-critical { border-color: #eba88e; border-left-color: var(--coral); background: #fff5ef; box-shadow: none; }
.item.due-overdue { border-color: #b6a8d8; border-left-color: #6e56a2; background: #f8f5ff; box-shadow: none; }
.item.urgent-fire {
  border-color: #e28d7c;
  border-left-color: var(--danger);
  background: #fff0ea;
  box-shadow: 0 3px 0 rgba(180,47,47,.14);
  animation: none;
}
.item.urgent-fire::after { right: 12px; bottom: 8px; font-size: 24px; opacity: .15; }
.item.request-swipe-card.dragging { box-shadow: 0 8px 22px rgba(24,26,23,.16); }

.chip-row { gap: 6px; }
.chip {
  min-height: 26px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper-soft);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}
.chip.good { border-color: #b8d68a; background: #f1f9df; color: #356221; }
.chip.warn { border-color: #e0c170; background: #fff8df; color: #7b5006; }
.chip.bad { border-color: #e5aaa2; background: #fff0ea; color: #912525; }
.chip.tag { border-color: #afd9dd; background: #edfafa; color: #1e6870; }
.chip.due-calm { background: #edfafa; color: #1e6870; }
.chip.due-soon { background: #fff8df; color: #7b5006; }
.chip.due-today,
.chip.due-critical { background: #fff0ea; color: #9c371f; }
.chip.due-overdue { background: #f2eefb; color: #5c448a; }
a.chip,
button.chip { min-height: 44px; }

.empty {
  padding: 20px 16px;
  border-color: var(--line-dark);
  border-radius: 16px;
  background: var(--paper-soft);
  color: var(--muted-dark);
  font-size: 12px;
}

.swipe-hint { color: var(--muted-dark); font-size: 10px; }
.swipe-accept { color: var(--success); }
.swipe-skip { color: var(--danger); }

.customer-apply-card { background: var(--paper); }
.customer-apply-note { border-color: #afd9dd; border-radius: 15px; background: #edfafa; color: #285b60; }
.customer-candidate { border-color: var(--line); background: #fffefa; }
.customer-candidate-pending { border-color: var(--cyan); box-shadow: 0 3px 0 rgba(73,189,200,.2); }
.admin-user-item.active { border-color: var(--coral); border-left-color: var(--coral); background: #fff5ef; box-shadow: 0 3px 0 rgba(230,74,47,.16); }

.partner-tabs-card { padding: 8px; }
.partner-tabs { gap: 6px; }
.partner-tabs button { min-height: 44px; border-color: transparent; border-radius: 11px; color: var(--muted-dark); background: transparent; box-shadow: none; font-size: 11px; }
.partner-tabs button:hover { transform: none; border-color: var(--line); background: var(--paper-soft); box-shadow: none; }
.partner-tabs button.active { border-color: var(--ink); color: var(--ink); background: var(--lime); box-shadow: 2px 2px 0 var(--ink); }

.toolbar { gap: 7px; }
.toolbar button { min-height: 44px; font-size: 11px; }

details { border-radius: 15px; }
summary { min-height: 44px; padding: 11px 2px; color: var(--ink); font-family: var(--display-font); font-size: 12px; list-style-position: inside; }

.loading-skeleton { background: #e9e5da; }
.loading-skeleton::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent); }

.toast-host { top: calc(env(safe-area-inset-top) + 10px); }
.toast {
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 8px 24px rgba(24,26,23,.26);
  backdrop-filter: none;
}
.toast.error { border-color: #e5aaa2; background: #7f2424; color: #fff; }

.map-picker-overlay,
.onboarding-overlay { background: rgba(24,26,23,.7); backdrop-filter: none; }
.map-picker { border-color: var(--ink); border-radius: 23px; background: var(--paper); box-shadow: 5px 6px 0 var(--ink), 0 22px 60px rgba(0,0,0,.25); }
#mapPickerCanvas { border-color: var(--line-dark); border-radius: 15px; background: var(--paper-soft); }
.onboarding-card { border-color: var(--ink); border-radius: 22px; background: var(--ink); box-shadow: 5px 6px 0 var(--coral), 0 22px 60px rgba(0,0,0,.28); }
.onboarding-step { color: var(--lime); font-family: var(--display-font); font-size: 9px; }
.onboarding-body { color: #d7d8d0; }

.tab-view.tab-enter .content-card,
.app-layout.app-mount .sidebar,
.app-layout.app-mount .content-card { animation-name: fieldbookReveal; animation-duration: .28s; }

@keyframes fieldbookReveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { min-height: 420px; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.16); border-radius: 28px 28px 0 0; }
  .auth-box { border-radius: 0 0 28px 28px; }
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { position: relative; top: 0; display: grid; grid-template-columns: minmax(250px, .7fr) minmax(0, 1.3fr); gap: 10px; align-items: start; }
  .nav { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 52px; margin-top: 0; align-self: start; }
  .nav button { justify-content: center; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  html { scroll-padding-bottom: 100px; }
  body::after { display: none; }

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

  .topbar {
    position: sticky;
    top: calc(6px + env(safe-area-inset-top));
    z-index: 30;
    min-height: 64px;
    margin: 0 8px 12px;
    padding: 8px;
    border-radius: 17px;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .brand { flex: 1 1 auto; }
  .brand-mark { width: 40px; height: 40px; flex-basis: 40px; border-radius: 12px; box-shadow: 2px 2px 0 var(--ink); }
  .brand-mark svg { width: 29px; height: 29px; }
  .brand-title { font-size: 13px; }
  .brand-sub { display: none; }

  .top-actions { width: auto; flex: 0 0 auto; justify-content: flex-end; gap: 6px; }
  .top-actions button,
  .top-actions .mode-switch { width: auto; }
  .top-actions .sync-state { width: 38px; min-width: 38px; flex: 0 0 38px; justify-content: center; padding: 0; font-size: 0; }
  .top-actions .icon-button { width: 44px; height: 44px; flex-basis: 44px; }
  .mode-switch { max-width: 132px; padding-left: 6px; }
  .mode-switch span { display: none; }
  .mode-switch select { min-width: 0; max-width: 118px; font-size: 11px; }

  .panel { margin: 0 8px; border-radius: 24px; box-shadow: 4px 5px 0 var(--ink), 0 14px 34px rgba(46,42,32,.12); }
  .hero { display: grid; gap: 0; padding: 0; }
  .hero-copy {
    min-height: 250px;
    padding: 24px 18px 21px;
    border-radius: 22px 22px 0 0;
    background-size: 28px 28px, 28px 28px, auto;
  }
  .hero-copy::after { right: -64px; top: 46px; width: 174px; height: 174px; border-width: 27px; opacity: .72; }
  .hero-copy::before { right: 12px; bottom: 14px; font-size: 7px; }
  .eyebrow { font-size: 8px; }
  .headline { max-width: 340px; margin: 17px 0 13px; font-size: clamp(27px, 8.8vw, 38px); line-height: 1.07; letter-spacing: -.06em; }
  .lead { max-width: 335px; font-size: 12px; line-height: 1.58; }
  .hero-copy > .chip-row { display: none; }
  .auth-box { padding: 21px 16px 23px; border-radius: 0 0 22px 22px; }
  .section-title { font-size: 17px; }
  .section-sub { font-size: 12px; }
  input,
  textarea,
  select { font-size: 16px; }

  .progress { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .step-pill { padding: 8px 4px; font-size: 9px; }

  .app-layout { display: block; }
  .sidebar { display: contents; }
  .profile-card { margin: 0 8px 12px; padding: 16px; border-radius: 20px; }
  .profile-card .avatar-row { padding-right: 2px; }
  .avatar { width: 54px; height: 54px; flex-basis: 54px; }
  .avatar-actions button { min-height: 44px; }

  body[data-app-mode="user"][data-active-tab]:not([data-active-tab="overview"]):not([data-active-tab="profile"]) .profile-card,
  body[data-app-mode="customer"] .profile-card,
  body[data-app-mode="admin"] .profile-card { display: none; }

  .nav {
    position: fixed;
    top: auto;
    left: 50%;
    right: auto;
    bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 90;
    width: min(520px, calc(100% - 16px));
    min-height: 70px;
    margin: 0;
    padding: 6px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-auto-rows: 58px;
    gap: 2px;
    border: 1px solid var(--line-dark);
    border-radius: 20px;
    background: rgba(255, 253, 247, .97);
    box-shadow: 0 5px 0 var(--ink), 0 14px 34px rgba(24,26,23,.16);
    transform: translateX(-50%);
  }

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

  body[data-app-mode="customer"] .partner-tabs-card {
    position: fixed;
    left: 50%;
    bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 90;
    width: min(520px, calc(100% - 16px));
    margin: 0;
    padding: 6px;
    border-color: var(--line-dark);
    border-radius: 20px;
    background: rgba(255, 253, 247, .97);
    box-shadow: 0 5px 0 var(--ink), 0 14px 34px rgba(24,26,23,.16);
    transform: translateX(-50%);
  }

  body[data-app-mode="customer"] .partner-tabs {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
    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-width: 0;
    min-height: 58px;
    padding: 5px 3px;
    border: 0;
    border-radius: 14px;
    box-shadow: none;
    font-size: 9.5px;
    line-height: 1.2;
  }

  body[data-app-mode="customer"] .partner-tabs button.active {
    color: var(--ink);
    background: var(--lime);
    box-shadow: inset 0 0 0 1px var(--ink);
  }

  .nav button,
  .nav button:hover,
  .nav button.active {
    width: 100%;
    min-width: 0;
    min-height: 58px;
    padding: 4px 2px 3px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    border: 0;
    border-radius: 14px;
    color: var(--muted-dark);
    background: transparent;
    box-shadow: none;
  }

  .nav button.active { color: var(--ink); }
  .nav-icon { width: 34px; height: 29px; flex-basis: 29px; border-radius: 10px; }
  .nav button.active .nav-icon { color: #fff; background: var(--coral); box-shadow: 2px 2px 0 var(--ink); }
  .nav-icon svg { width: 20px; height: 20px; }
  .nav-label { max-width: 100%; overflow: visible; text-overflow: clip; font-size: 11px; font-weight: 800; letter-spacing: -.025em; }

  .content { margin: 0 8px; gap: 11px; padding-bottom: 7px; }
  body[data-app-mode="user"] .content { padding-bottom: 11px; }
  .hint-strip { padding: 10px 12px 10px 34px; border-radius: 13px; font-size: 11px; }
  .hint-strip::before { margin-left: -21px; }
  .tab-view { gap: 11px; }
  .content-card { padding: 16px; border-radius: 20px; }
  .content-card.dark { min-height: 0; padding: 20px 16px; }
  .content-card.dark::after { right: -45px; top: -48px; width: 130px; height: 130px; border-width: 21px; }
  .card-head { flex-direction: column; gap: 10px; margin-bottom: 13px; }
  .card-head h2 { font-size: 19px; line-height: 1.2; }
  .card-head h3 { font-size: 15px; line-height: 1.3; }
  .card-head p { font-size: 11px; }
  .card-head .toolbar { width: 100%; }
  .card-head .card-toggle { width: 44px; min-width: 44px; height: 44px; min-height: 44px; }

  .split { grid-template-columns: 1fr; gap: 10px; }
  .kpi-grid,
  #statsGrid.kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .kpi { min-height: 94px; padding: 12px; border-radius: 14px; }
  .kpi::before { margin-bottom: 8px; }
  .kpi .label { font-size: 11px; }
  .kpi .value { font-size: 15px; }

  .item { padding: 13px; border-radius: 15px; }
  .item-top { gap: 8px; }
  .item-title { font-size: 14px; }
  .item-meta { font-size: 12px; }
  .person { align-items: flex-start; }

  .toolbar { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar > input,
  .toolbar > select { grid-column: 1 / -1; }
  .toolbar > button { width: 100%; min-width: 0; padding: 0 9px; line-height: 1.2; }
  .toolbar > button:only-child { grid-column: 1 / -1; }
  .row { align-items: stretch; }
  .row > input,
  .row > textarea,
  .row > select { flex: 1 1 100%; }
  .row button { width: auto; flex: 1 1 132px; }

  .partner-tabs-card { padding: 7px; }
  .partner-tabs {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(102px, 1fr);
    grid-template-columns: none;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }
  .partner-tabs::-webkit-scrollbar { display: none; }
  .partner-tabs button { width: 100%; min-height: 44px; }

  #tab-requests > .content-card,
  #tab-shifts > .content-card {
    padding: 6px 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  .map-picker-overlay,
  .onboarding-overlay { align-items: end; padding: 8px; }
  .map-picker { width: 100%; max-height: calc(100dvh - 16px); padding: 11px; border-radius: 20px; box-shadow: 3px 4px 0 var(--ink); }
  #mapPickerCanvas { height: min(48dvh, 390px); }
  .onboarding-card { width: 100%; padding: 16px; border-radius: 20px; box-shadow: 3px 4px 0 var(--coral); }
  .onboarding-actions { align-items: stretch; }
  .onboarding-actions .row { width: 100%; margin-left: 0; }
}

@media (max-width: 360px) {
  .topbar { margin-inline: 6px; }
  .top-actions { gap: 4px; }
  .panel,
  .profile-card,
  .content { margin-inline: 6px; }
  .headline { font-size: 26px; }
  .auth-box,
  .content-card { padding-inline: 14px; }
  #tab-requests > .content-card,
  #tab-shifts > .content-card { padding-inline: 0; }
  .nav { width: calc(100% - 12px); }
  .nav-label { font-size: 10px; }
  .nav-icon { width: 31px; }
  .kpi { min-height: 90px; }
  .kpi .value { font-size: 14px; }
  .chip { font-size: 10px; }
  .item-top { flex-direction: column; align-items: stretch; }
  .item-top > .chip { align-self: flex-start; }
  .request-meta-stack { display: grid; gap: 2px; }
  .request-role-row { grid-template-columns: 1fr; }
  .request-role-action { width: 100%; max-width: none; }
}

@media (max-width: 700px) and (max-height: 540px) {
  .nav,
  body[data-app-mode="customer"] .partner-tabs-card {
    bottom: calc(4px + env(safe-area-inset-bottom));
    min-height: 58px;
    padding: 5px;
    border-radius: 16px;
  }
  .nav { grid-auto-rows: 48px; }
  .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: 48px; }
  .nav-icon { height: 22px; flex-basis: 22px; }
  .nav-label { font-size: 10px; }
  .shell { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .content { padding-bottom: 0; }
  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; }
  body:has(input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):focus, textarea:focus) .shell { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
}

@media (min-width: 701px) and (max-width: 900px) and (max-height: 540px) {
  .app-layout { display: block; }
  .sidebar { display: contents; }
  .profile-card { display: none; }
  .nav {
    position: fixed;
    top: auto;
    left: 50%;
    right: auto;
    bottom: calc(4px + env(safe-area-inset-bottom));
    z-index: 90;
    width: min(520px, calc(100% - 12px));
    min-height: 58px;
    margin: 0;
    padding: 5px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-auto-rows: 48px;
    gap: 2px;
    border: 1px solid var(--line-dark);
    border-radius: 16px;
    background: rgba(255, 253, 247, .97);
    box-shadow: 0 4px 0 var(--ink), 0 12px 28px rgba(24,26,23,.16);
    transform: translateX(-50%);
  }
  body[data-app-mode="customer"] .nav,
  body[data-app-mode="admin"] .nav { display: none; }
  .nav button,
  .nav button:hover,
  .nav button.active {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 3px 2px;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    border: 0;
    border-radius: 12px;
    color: var(--muted-dark);
    background: transparent;
    box-shadow: none;
  }
  .nav-icon { width: 30px; height: 22px; flex-basis: 22px; border-radius: 8px; }
  .nav button.active .nav-icon { color: #fff; background: var(--coral); box-shadow: 1px 2px 0 var(--ink); }
  .nav-label { font-size: 10px; }
  .shell { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .content { padding-bottom: 0; }
  body:has(input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):focus, textarea:focus) .nav { display: none; }
  body:has(input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):focus, textarea:focus) .shell { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
}

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