  :root {
    --bg: #FAFAFA;
    --bg-soft: #F4F4F5;
    --surface: #FFFFFF;
    --surface-2: #F7F7F8;
    --ink: #0D0D0D;
    --ink-2: #2C2C2E;
    --muted: #6B7280;
    --muted-2: #9CA3AF;
    --line: #E8E8E8;
    --line-soft: #F0F0F0;
    --emerald: #1B4332;
    --emerald-2: #2D5240;
    --emerald-soft: #E8EFE9;
    --gold: #B8860B;
    --gold-soft: #F4EBD0;
    --champagne: #C9A96E;
    --burgundy: #8B2635;
    --burgundy-soft: #F4E4E6;
    --cream: #F7F3EC;
    --shadow: 0 1px 2px rgba(20,20,20,.04), 0 4px 12px rgba(20,20,20,.04);
    --shadow-2: 0 4px 12px rgba(20,20,20,.06), 0 12px 32px rgba(20,20,20,.06);
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { height: 100%; }
  body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "cv11", "ss01", "ss03";
  }
  a { color: inherit; text-decoration: none; cursor: pointer; }
  button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
  input, textarea { font-family: inherit; }

  .serif { font-family: 'Inter', system-ui, -apple-system, sans-serif; font-weight: 500; letter-spacing: -0.01em; }

  /* --- App Shell --- */
  .app { display: grid; grid-template-columns: 240px 1fr; height: 100vh; }
  .sidebar {
    background: var(--bg-soft);
    border-right: 1px solid var(--line);
    padding: 24px 16px;
    display: flex; flex-direction: column;
    overflow-y: auto;
  }
  .brand {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px 24px;
  }
  .brand-mark {
    width: 34px; height: 34px;
    background: var(--ink);
    color: var(--cream);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-weight: 600;
    font-size: 18px;
    letter-spacing: -0.02em;
  }
  .brand-name {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.01em;
  }
  .brand-tag {
    font-size: 11px;
    color: var(--muted);
    margin-top: -2px;
  }

  .nav-section {
    margin-top: 8px;
  }
  .nav-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted-2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 12px 10px 8px;
  }
  .nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    color: var(--ink-2);
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 2px;
    transition: background .15s;
  }
  .nav-item:hover { background: rgba(0,0,0,0.035); }
  .nav-item.active { background: var(--ink); color: var(--cream); }
  .nav-item.active .nav-icon { color: var(--cream); }
  .nav-icon { width: 18px; height: 18px; flex-shrink: 0; color: var(--muted); }
  .nav-item.active .nav-icon { color: var(--cream); }
  .nav-badge {
    margin-left: auto;
    background: var(--burgundy);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
  }
  .nav-item.active .nav-badge { background: var(--gold); color: var(--ink); }

  .sidebar-footer {
    margin-top: auto;
    border-top: 1px solid var(--line);
    padding-top: 16px;
  }
  .user-card {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
  }
  .user-card:hover { background: rgba(0,0,0,0.035); }
  .avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--emerald);
    color: var(--cream);
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 12px;
    flex-shrink: 0;
  }
  .avatar-lg { width: 44px; height: 44px; font-size: 15px; }
  .avatar-sm { width: 24px; height: 24px; font-size: 10px; }
  .user-info { flex: 1; min-width: 0; }
  .user-name { font-size: 13px; font-weight: 600; color: var(--ink); }
  .user-role { font-size: 11px; color: var(--muted); }

  /* --- Main --- */
  .main { display: flex; flex-direction: column; overflow: hidden; }
  .topbar {
    height: 64px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    display: flex; align-items: center;
    padding: 0 32px;
    gap: 16px;
  }
  .breadcrumb {
    display: flex; align-items: center; gap: 8px;
    color: var(--muted);
    font-size: 13px;
  }
  .breadcrumb .here { color: var(--ink); font-weight: 600; }
  .breadcrumb svg { width: 14px; height: 14px; }
  .topbar-search {
    margin-left: 24px;
    flex: 1;
    max-width: 360px;
    position: relative;
  }
  .topbar-search input {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 12px 8px 34px;
    font-size: 13px;
    color: var(--ink);
    outline: none;
    transition: border-color .15s;
  }
  .topbar-search input:focus { border-color: var(--emerald); }
  .topbar-search svg {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    width: 14px; height: 14px; color: var(--muted);
  }
  .topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
  .icon-btn {
    width: 36px; height: 36px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--muted);
    transition: background .15s;
  }
  .icon-btn:hover { background: var(--surface-2); color: var(--ink); }
  .icon-btn svg { width: 18px; height: 18px; }
  .date-pill {
    border: 1px solid var(--line);
    background: var(--surface);
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 12px;
    color: var(--ink-2);
    display: flex; align-items: center; gap: 8px;
  }

  .content {
    flex: 1;
    overflow-y: auto;
    padding: 32px 40px 64px;
  }

  /* --- Pages --- */
  .page { display: none; max-width: 1280px; margin: 0 auto; }
  .page.active { display: block; }

  .page-header { margin-bottom: 28px; display: flex; align-items: end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
  .page-title { font-family: 'Inter', system-ui, -apple-system, sans-serif; font-size: 32px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
  .page-sub { color: var(--muted); margin-top: 6px; font-size: 14px; }
  .page-actions { display: flex; gap: 8px; }

  .btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all .15s;
    white-space: nowrap;
  }
  .btn svg { width: 14px; height: 14px; }
  .btn-primary { background: var(--ink); color: var(--cream); }
  .btn-primary:hover { background: var(--emerald); }
  .btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
  .btn-secondary:hover { background: var(--surface-2); border-color: var(--muted-2); }
  .btn-emerald { background: var(--emerald); color: var(--cream); }
  .btn-emerald:hover { background: var(--emerald-2); }
  .btn-ghost { color: var(--muted); }
  .btn-ghost:hover { color: var(--ink); }

  /* --- Cards --- */
  .card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px;
  }
  .card-lg { padding: 24px; }
  .card-hover { transition: border-color .2s, transform .2s; }
  .card-hover:hover { border-color: var(--muted-2); transform: translateY(-1px); cursor: pointer; }

  /* KPI cards */
  .kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
  .kpi {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px 22px;
    position: relative;
    overflow: hidden;
  }
  .kpi-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
  .kpi-head svg { width: 14px; height: 14px; }
  .kpi-icon-wrap {
    width: 28px; height: 28px;
    background: var(--bg-soft);
    border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    color: var(--emerald);
  }
  .kpi-value { font-family: 'Inter', system-ui, -apple-system, sans-serif; font-size: 32px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; color: var(--ink); }
  .kpi-meta { margin-top: 10px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
  .kpi-meta.up { color: var(--emerald); }
  .kpi-meta.down { color: var(--burgundy); }

  /* --- Dashboard layout --- */
  .grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
  .grid-1-1 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

  .section-title {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
  }
  .section-sub { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
  .section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
  .section-head .section-title { margin-bottom: 0; }

  /* Activity feed */
  .activity-item {
    display: flex; gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line-soft);
  }
  .activity-item:last-child { border-bottom: none; }
  .activity-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--emerald);
    margin-top: 6px;
    flex-shrink: 0;
  }
  .activity-dot.gold { background: var(--gold); }
  .activity-dot.burgundy { background: var(--burgundy); }
  .activity-text { font-size: 13.5px; color: var(--ink-2); }
  .activity-text strong { color: var(--ink); font-weight: 600; }
  .activity-time { font-size: 12px; color: var(--muted); margin-top: 2px; }

  /* Priority items */
  .priority-list { display: flex; flex-direction: column; gap: 10px; }
  .priority-item {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    transition: all .15s;
  }
  .priority-item:hover { border-color: var(--emerald); background: var(--surface); }
  .priority-icon {
    width: 36px; height: 36px;
    background: var(--emerald-soft);
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    color: var(--emerald);
    flex-shrink: 0;
  }
  .priority-icon.gold { background: var(--gold-soft); color: var(--gold); }
  .priority-icon.burgundy { background: var(--burgundy-soft); color: var(--burgundy); }
  .priority-icon svg { width: 16px; height: 16px; }
  .priority-content { flex: 1; min-width: 0; }
  .priority-title { font-size: 13.5px; font-weight: 600; color: var(--ink); }
  .priority-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
  .priority-due {
    font-size: 11px; font-weight: 600;
    padding: 4px 8px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink-2);
  }
  .priority-due.warn { background: var(--gold-soft); border-color: var(--gold); color: var(--gold); }
  .priority-due.urgent { background: var(--burgundy-soft); border-color: var(--burgundy); color: var(--burgundy); }

  /* Cases / Kanban */
  .kanban {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
  }
  .kan-col {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    min-height: 600px;
  }
  .kan-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 4px 6px 12px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 12px;
  }
  .kan-title { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.05em; }
  .kan-title svg { width: 14px; height: 14px; color: var(--muted); }
  .kan-count {
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
  }
  .kan-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 12px;
    margin-bottom: 10px;
    transition: all .15s;
  }
  .kan-card:hover { border-color: var(--emerald); transform: translateY(-1px); cursor: pointer; box-shadow: var(--shadow); }
  .kan-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
  .kan-visa { font-size: 11.5px; color: var(--muted); margin: 2px 0 10px; }
  .kan-progress-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 11px; color: var(--muted); }
  .kan-bar { height: 4px; background: var(--line-soft); border-radius: 4px; overflow: hidden; }
  .kan-bar-fill { height: 100%; background: var(--ink); border-radius: 4px; }
  .kan-bar-fill.emerald { background: var(--emerald); }
  .kan-bar-fill.gold { background: var(--gold); }
  .kan-bar-fill.burgundy { background: var(--burgundy); }
  .kan-foot {
    display: flex; align-items: center; gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line-soft);
    font-size: 11px;
    color: var(--muted);
  }
  .kan-foot svg { width: 12px; height: 12px; }
  .pill {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 10.5px; font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: none;
  }
  .pill-warn { background: var(--gold-soft); color: var(--gold); }
  .pill-emerald { background: var(--emerald-soft); color: var(--emerald); }
  .pill-burgundy { background: var(--burgundy-soft); color: var(--burgundy); }
  .pill-neutral { background: var(--bg-soft); color: var(--muted); border: 1px solid var(--line); }

  /* Inbox */
  .inbox-grid {
    display: grid;
    grid-template-columns: 300px 1fr 320px;
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    height: calc(100vh - 180px);
    min-height: 560px;
    max-height: calc(100vh - 180px);
  }
  .inbox-list { border-right: 1px solid var(--line); overflow-y: auto; background: var(--surface-2); min-height: 0; }
  .inbox-list-head { padding: 16px; border-bottom: 1px solid var(--line); }
  .inbox-search {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
  }
  .conv-item {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line-soft);
    display: flex; gap: 12px;
    cursor: pointer;
    transition: background .1s;
  }
  .conv-item:hover { background: var(--surface); }
  .conv-item.active { background: var(--surface); border-left: 3px solid var(--ink); padding-left: 13px; }
  .conv-content { flex: 1; min-width: 0; }
  .conv-name-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
  .conv-name { font-size: 13px; font-weight: 600; color: var(--ink); }
  .conv-time { font-size: 11px; color: var(--muted); }
  .conv-preview { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .conv-tags { margin-top: 6px; display: flex; gap: 4px; }

  .inbox-thread { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
  .thread-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 12px;
    flex-shrink: 0;
  }
  .thread-name { font-size: 15px; font-weight: 600; }
  .thread-sub { font-size: 12px; color: var(--muted); }
  .thread-body { flex: 1 1 auto; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; min-height: 0; }
  .msg { max-width: 78%; }
  .msg-row { display: flex; gap: 10px; align-items: flex-end; }
  .msg-row.me { flex-direction: row-reverse; }
  .msg-bubble {
    padding: 11px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.5;
  }
  .msg-bubble.them { background: var(--surface-2); border: 1px solid var(--line-soft); border-bottom-left-radius: 4px; color: var(--ink); }
  .msg-bubble.me { background: var(--ink); color: var(--cream); border-bottom-right-radius: 4px; }
  .msg-meta { font-size: 11px; color: var(--muted); margin-top: 4px; padding: 0 4px; }
  .msg-row.me .msg-meta { text-align: right; }
  .msg-card {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px;
    font-size: 12.5px;
  }
  .msg-card-title { font-weight: 600; font-size: 12px; margin-bottom: 8px; color: var(--ink); }
  .msg-card-row { display: flex; justify-content: space-between; margin: 4px 0; color: var(--muted); }

  .composer { border-top: 1px solid var(--line); padding: 14px 18px; display: flex; align-items: center; gap: 10px; flex-shrink: 0; background: var(--surface); }
  .composer-input {
    flex: 1;
    border: 1px solid var(--line);
    background: var(--surface-2);
    border-radius: 22px;
    padding: 9px 16px;
    font-size: 13px;
    outline: none;
  }
  .composer-input:focus { border-color: var(--emerald); background: var(--surface); }

  .case-panel { border-left: 1px solid var(--line); background: var(--surface-2); overflow-y: auto; padding: 20px; min-height: 0; }
  .panel-title { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; }
  .panel-section { margin-bottom: 20px; }
  .stage-pill {
    display: inline-block;
    background: var(--bg-soft);
    border: 1px solid var(--gold);
    color: var(--gold);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 10px;
  }
  .progress-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; margin: 8px 0; color: var(--ink-2); }
  .progress-bar { height: 5px; background: var(--line-soft); border-radius: 5px; overflow: hidden; }
  .progress-fill { height: 100%; background: var(--emerald); border-radius: 5px; }

  .checklist-item {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 0;
    font-size: 12.5px;
    color: var(--ink-2);
  }
  .checklist-item svg { width: 14px; height: 14px; flex-shrink: 0; }
  .checklist-item.done { color: var(--emerald); }
  .checklist-item.active { color: var(--ink); font-weight: 600; }
  .checklist-item.pending { color: var(--muted); }

  /* Calls page */
  .calls-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .call-item {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 10px;
    transition: all .15s;
    cursor: pointer;
  }
  .call-item:hover { border-color: var(--emerald); }
  .call-item.active { border-color: var(--ink); background: var(--surface-2); }
  .call-icon {
    width: 40px; height: 40px;
    background: var(--bg-soft);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: var(--emerald);
    flex-shrink: 0;
  }
  .call-icon svg { width: 18px; height: 18px; }
  .call-info { flex: 1; min-width: 0; }
  .call-name-row { display: flex; align-items: center; gap: 8px; }
  .call-name { font-weight: 600; font-size: 13.5px; }
  .call-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
  .call-arrow { color: var(--muted); }

  .summary-block {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 24px;
  }
  .ai-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    color: var(--emerald);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 16px;
    margin-bottom: 12px;
  }
  .ai-badge svg { width: 12px; height: 12px; }
  .summary-section { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
  .summary-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; }
  .summary-row { display: flex; gap: 8px; margin: 6px 0; font-size: 13.5px; color: var(--ink-2); }
  .summary-row strong { color: var(--ink); font-weight: 600; min-width: 100px; }
  .summary-list { list-style: none; padding: 0; }
  .summary-list li {
    position: relative; padding-left: 20px;
    margin: 8px 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.55;
  }
  .summary-list li::before {
    content: ""; position: absolute; left: 4px; top: 9px;
    width: 5px; height: 5px; border-radius: 50%; background: var(--emerald);
  }

  /* Clients table */
  .table-wrap {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
  }
  table { width: 100%; border-collapse: collapse; }
  th, td { text-align: left; padding: 14px 18px; font-size: 13.5px; }
  th {
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
  }
  tbody tr { border-bottom: 1px solid var(--line-soft); transition: background .1s; cursor: pointer; }
  tbody tr:last-child { border-bottom: none; }
  tbody tr:hover { background: var(--surface-2); }

  .client-cell { display: flex; align-items: center; gap: 10px; }
  .client-cell .client-name { font-weight: 600; color: var(--ink); }
  .client-cell .client-email { font-size: 12px; color: var(--muted); }

  /* Drafter */
  .drafter-grid { display: grid; grid-template-columns: 1fr 320px; gap: 16px; }
  .doc {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 48px 56px;
    min-height: 700px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--ink-2);
  }
  .doc h1 { font-family: 'Inter', system-ui, -apple-system, sans-serif; font-size: 24px; font-weight: 600; margin-bottom: 8px; color: var(--ink); letter-spacing: -0.01em; }
  .doc h2 { font-family: 'Inter', system-ui, -apple-system, sans-serif; font-size: 18px; margin: 28px 0 12px; color: var(--ink); font-weight: 600; letter-spacing: -0.01em; }
  .doc p { margin: 12px 0; }
  .doc ul { margin: 12px 0 12px 22px; }
  .doc li { margin: 6px 0; }
  .doc-meta { color: var(--muted); font-size: 13px; margin-bottom: 24px; }

  .ai-panel { display: flex; flex-direction: column; gap: 14px; }
  .ai-panel .card { padding: 18px; }
  .suggestion {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    margin-bottom: 8px;
    transition: border-color .15s;
    cursor: pointer;
  }
  .suggestion:hover { border-color: var(--emerald); background: var(--bg-soft); }
  .suggestion-title { font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
  .suggestion-text { font-size: 12px; color: var(--muted); line-height: 1.5; }

  /* Performance */
  .chart-card { padding: 24px; }
  .chart-head { display: flex; align-items: start; justify-content: space-between; margin-bottom: 18px; }
  .chart-stat { font-family: 'Inter', system-ui, -apple-system, sans-serif; font-size: 28px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
  .legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
  .legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; vertical-align: middle; }

  .breakdown-row { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
  .breakdown-label { width: 120px; font-size: 13px; color: var(--ink-2); }
  .breakdown-bar { flex: 1; height: 8px; background: var(--line-soft); border-radius: 4px; overflow: hidden; }
  .breakdown-fill { height: 100%; background: var(--ink); border-radius: 4px; }
  .breakdown-fill.emerald { background: var(--emerald); }
  .breakdown-fill.gold { background: var(--gold); }
  .breakdown-fill.burgundy { background: var(--burgundy); }
  .breakdown-value { font-size: 13px; font-weight: 600; color: var(--ink); width: 60px; text-align: right; }

  .insight-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px;
    background: var(--surface-2);
  }
  .insight-card.emerald { background: var(--emerald-soft); border-color: var(--emerald); }
  .insight-card.gold { background: var(--gold-soft); border-color: var(--gold); }
  .insight-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
  .insight-text { font-size: 12.5px; color: var(--ink-2); }
  .insight-text strong { color: var(--ink); }

  /* Settings */
  .settings-grid { display: grid; grid-template-columns: 220px 1fr; gap: 24px; }
  .settings-nav { display: flex; flex-direction: column; gap: 4px; }
  .settings-nav-item { padding: 9px 12px; border-radius: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
  .settings-nav-item:hover { background: var(--surface-2); }
  .settings-nav-item.active { background: var(--ink); color: var(--cream); font-weight: 500; }

  .form-row { margin-bottom: 16px; }
  .form-label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
  .form-input, .form-textarea {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13.5px;
    color: var(--ink);
    outline: none;
  }
  .form-input:focus { border-color: var(--emerald); }
  .form-textarea { min-height: 80px; resize: vertical; font-family: inherit; }

  .integrations-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .integ-card {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
  }
  .integ-icon { width: 36px; height: 36px; background: var(--bg-soft); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--emerald); flex-shrink: 0; }
  .integ-info { flex: 1; }
  .integ-name { font-size: 13px; font-weight: 600; }
  .integ-status { font-size: 11.5px; color: var(--muted); }
  .integ-status.on { color: var(--emerald); }

  /* Misc */
  .empty-line { color: var(--muted); font-size: 13px; padding: 20px; text-align: center; }
  .divider { height: 1px; background: var(--line-soft); margin: 16px 0; }

  /* Splash / login */
  .splash {
    position: fixed; inset: 0;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    z-index: 100;
  }
  .splash-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 48px 56px;
    width: 420px;
    box-shadow: var(--shadow-2);
    text-align: center;
  }
  .splash-mark {
    width: 56px; height: 56px;
    background: var(--ink);
    color: var(--cream);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 26px;
    font-weight: 600;
    margin: 0 auto 20px;
  }
  .splash h1 { font-family: 'Inter', system-ui, -apple-system, sans-serif; font-size: 30px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 8px; }
  .splash p { color: var(--muted); margin-bottom: 28px; font-size: 14px; }
  .splash .btn { width: 100%; justify-content: center; padding: 12px; font-size: 14px; }
  .splash-foot { margin-top: 18px; font-size: 12px; color: var(--muted); }

  /* Floating notification */
  .toast {
    position: fixed; bottom: 24px; right: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: var(--shadow-2);
    display: flex; align-items: center; gap: 12px;
    max-width: 360px;
    z-index: 50;
    animation: slideIn .3s ease-out;
  }
  @keyframes slideIn { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
  .toast-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--emerald-soft); color: var(--emerald); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .toast-text { font-size: 13px; }
  .toast-text strong { display: block; margin-bottom: 2px; }

  /* Onboarding tip */
  .tip-banner {
    background: linear-gradient(180deg, var(--emerald-soft), var(--surface));
    border: 1px solid var(--emerald);
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 20px;
    display: flex; align-items: center; gap: 14px;
  }
  .tip-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--emerald); color: var(--cream); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .tip-content { flex: 1; }
  .tip-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
  .tip-text { font-size: 12.5px; color: var(--ink-2); }

  /* ===== AI Drafter Wizard ===== */
  .drafter-wizard { max-width: 880px; margin: 0 auto; }
  .wizard-progress {
    display: flex; align-items: center; gap: 4px;
    margin-bottom: 8px;
  }
  .wizard-step-dot {
    flex: 1;
    height: 3px;
    background: var(--line);
    border-radius: 2px;
    transition: background .3s;
  }
  .wizard-step-dot.done { background: var(--emerald); }
  .wizard-step-dot.active { background: var(--ink); }
  .wizard-progress-label {
    font-size: 11.5px;
    color: var(--muted);
    margin-bottom: 28px;
    font-weight: 500;
    letter-spacing: 0.02em;
  }
  .wizard-state {
    animation: fadeUp .25s ease-out;
  }
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .wizard-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 40px 48px;
  }
  .wizard-tag {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--emerald);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 14px;
  }
  .wizard-tag svg { width: 12px; height: 12px; }
  .wizard-question {
    font-size: 24px;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.01em;
    margin-bottom: 8px;
    line-height: 1.3;
  }
  .wizard-help {
    font-size: 13.5px;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 24px;
  }
  .wizard-input, .wizard-textarea {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 15px;
    color: var(--ink);
    outline: none;
    font-family: inherit;
    transition: border-color .15s;
  }
  .wizard-input:focus, .wizard-textarea:focus { border-color: var(--emerald); }
  .wizard-textarea { min-height: 100px; resize: vertical; line-height: 1.55; }
  .wizard-options {
    display: flex; flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
  }
  .wizard-option {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
    transition: all .15s;
    display: flex; align-items: center; gap: 12px;
    font-size: 14px;
    background: var(--surface);
  }
  .wizard-option:hover { border-color: var(--emerald); background: var(--bg-soft); }
  .wizard-option.selected { border-color: var(--emerald); background: var(--emerald-soft); }
  .wizard-option-radio {
    width: 18px; height: 18px;
    border: 2px solid var(--line);
    border-radius: 50%;
    flex-shrink: 0;
    transition: all .15s;
  }
  .wizard-option.selected .wizard-option-radio {
    border-color: var(--emerald);
    background: radial-gradient(circle, var(--emerald) 38%, transparent 42%);
  }
  .wizard-checkbox {
    width: 18px; height: 18px;
    border: 2px solid var(--line);
    border-radius: 5px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    color: transparent;
  }
  .wizard-option.selected .wizard-checkbox {
    background: var(--emerald);
    border-color: var(--emerald);
    color: white;
  }
  .wizard-option-body { flex: 1; }
  .wizard-option-title { font-weight: 600; font-size: 14px; color: var(--ink); }
  .wizard-option-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
  .wizard-option-tag {
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    background: var(--bg-soft);
    color: var(--muted);
  }
  .wizard-option-tag.warn { background: var(--gold-soft); color: var(--gold); }
  .wizard-option-tag.good { background: var(--emerald-soft); color: var(--emerald); }
  .wizard-buttons {
    display: flex; justify-content: space-between;
    margin-top: 28px;
    align-items: center;
  }
  .wizard-question-counter { font-size: 12px; color: var(--muted); }
  /* Hero start state */
  .wizard-hero {
    text-align: center;
    padding: 48px 0;
  }
  .wizard-hero-title {
    font-size: 38px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 14px;
    color: var(--ink);
  }
  .wizard-hero-sub {
    color: var(--muted);
    margin-bottom: 36px;
    font-size: 16px;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
  }
  .start-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-width: 640px;
    margin: 0 auto;
  }
  .start-option {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 28px 24px;
    text-align: center;
    cursor: pointer;
    transition: all .15s;
  }
  .start-option:hover {
    border-color: var(--emerald);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
  }
  .start-option-icon {
    width: 44px; height: 44px;
    background: var(--emerald-soft);
    color: var(--emerald);
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 14px;
  }
  .start-option-icon svg { width: 20px; height: 20px; }
  .start-option-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
  .start-option-sub { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
  .start-existing {
    margin-top: 24px;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
  }
  .start-existing a { color: var(--emerald); font-weight: 500; }
  /* Parsing animation */
  .parse-stage {
    text-align: center;
    padding: 24px 0 32px;
  }
  .parse-stage-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
  }
  .parse-stage-sub {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 28px;
  }
  .parse-list { max-width: 620px; margin: 0 auto; }
  .parse-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 8px;
    font-size: 13.5px;
    color: var(--muted-2);
    transition: all .3s;
    text-align: left;
  }
  .parse-item.active { color: var(--ink); border-color: var(--emerald); }
  .parse-item.done { color: var(--ink); }
  .parse-item .parse-meta {
    margin-left: auto;
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .parse-item.done .parse-meta { color: var(--emerald); }
  .parse-spinner {
    width: 16px; height: 16px;
    border: 2px solid var(--line);
    border-top-color: var(--emerald);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    flex-shrink: 0;
  }
  @keyframes spin { to { transform: rotate(360deg); } }
  .parse-check {
    width: 18px; height: 18px;
    background: var(--emerald);
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .parse-check svg { width: 10px; height: 10px; }
  .parse-pending {
    width: 16px; height: 16px;
    border: 2px solid var(--line);
    border-radius: 50%;
    flex-shrink: 0;
  }
  /* Profile review */
  .profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .profile-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px;
  }
  .profile-card-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
  }
  .profile-card-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  .profile-card-edit {
    font-size: 12px;
    color: var(--muted);
    cursor: pointer;
  }
  .profile-card-edit:hover { color: var(--emerald); }
  .profile-card-value {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
  }
  .profile-card-sub { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
  /* Criteria grid */
  .criteria-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
  }
  .criterion-card {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    display: flex; align-items: center; justify-content: space-between;
    font-size: 13.5px;
    transition: all .15s;
  }
  .criterion-card.matched {
    border-color: var(--emerald);
    background: var(--emerald-soft);
  }
  .criterion-card.recommended {
    border-color: var(--ink);
    background: var(--surface);
    box-shadow: 0 0 0 2px var(--ink) inset;
    font-weight: 600;
  }
  .criterion-card.dim { opacity: 0.5; }
  .criterion-card .crit-name { flex: 1; }
  .crit-status {
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
  }
  .criterion-card.matched .crit-status {
    background: var(--emerald);
    color: white;
  }
  .criterion-card.recommended .crit-status {
    background: var(--ink);
    color: white;
  }
  /* Generation state */
  .gen-screen {
    text-align: center;
    padding: 24px 0;
  }
  .gen-pulse {
    width: 72px; height: 72px;
    background: var(--emerald);
    color: white;
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 24px;
    animation: pulse 1.8s ease-in-out infinite;
  }
  .gen-pulse svg { width: 30px; height: 30px; }
  @keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(27, 67, 50, 0.35); }
    50% { transform: scale(1.04); box-shadow: 0 0 0 16px rgba(27, 67, 50, 0); }
  }
  .gen-title {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 6px;
  }
  .gen-sub {
    color: var(--muted);
    margin-bottom: 28px;
    font-size: 14px;
  }
  .gen-progress {
    max-width: 520px; margin: 0 auto 24px;
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px 4px;
  }
  .gen-section-row {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px;
    font-size: 13px;
    color: var(--muted-2);
    border-radius: 8px;
  }
  .gen-section-row.active {
    color: var(--ink);
    font-weight: 600;
    background: var(--emerald-soft);
  }
  .gen-section-row.done { color: var(--emerald); }
  .gen-section-icon {
    width: 16px; height: 16px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
  }
  .gen-section-row.active .gen-section-icon .parse-spinner { width: 14px; height: 14px; }
  .gen-section-row .word-count {
    margin-left: auto;
    font-size: 11.5px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
  }
  .gen-section-row.done .word-count { color: var(--emerald); }
  .gen-streaming {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px 22px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    line-height: 1.7;
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
    min-height: 100px;
    max-height: 220px;
    overflow-y: auto;
    color: var(--ink-2);
  }
  .gen-streaming-tag {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
  }
  .gen-cursor {
    display: inline-block;
    width: 8px; height: 14px;
    background: var(--emerald);
    margin-left: 1px;
    animation: blink .8s infinite;
    vertical-align: text-bottom;
  }
  @keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
  }
  .gen-stats {
    display: flex; justify-content: center; gap: 24px;
    margin-top: 20px;
    font-size: 12px;
    color: var(--muted);
  }
  .gen-stat strong {
    color: var(--ink);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
  }
  /* Edit mode for petition */
  .edit-shell {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
  }
  .edit-toolbar {
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    padding: 10px 16px;
    display: flex; align-items: center; gap: 12px;
    position: sticky; top: 0; z-index: 10;
  }
  .edit-toolbar-group { display: flex; align-items: center; gap: 6px; }
  .edit-toolbar-divider { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
  .edit-btn {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
    border-radius: 6px;
    color: var(--ink-2);
    cursor: pointer;
    transition: background .12s;
    font-weight: 600;
    font-size: 13px;
    border: none;
  }
  .edit-btn:hover { background: var(--surface); color: var(--ink); }
  .edit-btn.active { background: var(--ink); color: var(--cream); }
  .edit-btn svg { width: 14px; height: 14px; }
  .edit-track {
    margin-left: auto;
    font-size: 11.5px;
    color: var(--emerald);
    display: flex; align-items: center; gap: 6px;
    font-weight: 600;
  }
  .edit-track-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--emerald); animation: blink 1.5s ease-in-out infinite; }
  .edit-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
  }
  .edit-doc {
    padding: 40px 56px;
    border-right: 1px solid var(--line);
    font-size: 14px;
    line-height: 1.75;
    color: var(--ink-2);
    min-height: 600px;
  }
  .edit-doc h1 { font-size: 22px; font-weight: 600; color: var(--ink); margin-bottom: 8px; letter-spacing: -0.01em; }
  .edit-doc h2 { font-size: 17px; font-weight: 600; color: var(--ink); margin: 24px 0 10px; letter-spacing: -0.01em; }
  .edit-doc p { margin: 10px 0; }
  .edit-block {
    position: relative;
    padding: 8px 12px;
    margin: -8px -12px 4px;
    border-radius: 6px;
    transition: background .15s;
    cursor: text;
  }
  .edit-block:hover { background: var(--bg-soft); }
  .edit-block:focus, .edit-block.editing {
    background: var(--surface);
    outline: 2px solid var(--emerald);
    outline-offset: -2px;
  }
  .edit-block-ins { background: var(--emerald-soft); color: var(--emerald); padding: 0 2px; border-radius: 2px; }
  .edit-block-del { background: var(--burgundy-soft); color: var(--burgundy); text-decoration: line-through; padding: 0 2px; border-radius: 2px; }
  .edit-block-comment {
    position: absolute;
    right: -8px; top: 8px;
    width: 6px; height: 6px;
    background: var(--gold);
    border-radius: 50%;
  }
  .edit-side {
    padding: 24px;
    background: var(--surface-2);
    overflow-y: auto;
  }
  .edit-side-title { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px; }
  .edit-side-nav { margin-bottom: 24px; }
  .edit-nav-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 12.5px;
    color: var(--ink-2);
    cursor: pointer;
    margin-bottom: 2px;
    transition: background .12s;
  }
  .edit-nav-item:hover { background: var(--surface); }
  .edit-nav-item.active { background: var(--ink); color: var(--cream); font-weight: 600; }
  .edit-nav-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--emerald);
    flex-shrink: 0;
  }
  .edit-nav-item .edit-nav-count {
    margin-left: auto;
    font-size: 10.5px;
    background: var(--line);
    color: var(--ink-2);
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 600;
  }
  .edit-nav-item.active .edit-nav-count { background: var(--gold); color: var(--ink); }
  .edit-suggestion {
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 9px;
    padding: 12px 14px;
    margin-bottom: 8px;
    font-size: 12.5px;
  }
  .edit-suggestion-head {
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 4px;
    display: flex; align-items: center; gap: 6px;
  }
  .edit-suggestion-head svg { width: 12px; height: 12px; color: var(--emerald); }
  .edit-suggestion-body { color: var(--muted); line-height: 1.5; margin-bottom: 8px; }
  .edit-suggestion-actions { display: flex; gap: 6px; }
  .edit-pill {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    cursor: pointer;
    border: none;
  }
  .edit-pill.accept { background: var(--emerald); color: white; }
  .edit-pill.dismiss { background: transparent; color: var(--muted); border: 1px solid var(--line); }

  /* Export modal */
  .modal-overlay {
    position: fixed; inset: 0;
    background: rgba(13,13,13,0.4);
    display: none;
    align-items: center; justify-content: center;
    z-index: 200;
    backdrop-filter: blur(4px);
  }
  .modal-overlay.open { display: flex; animation: fadeIn .15s ease-out; }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
  .modal {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    width: 580px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 64px);
    overflow: hidden;
    box-shadow: var(--shadow-2);
    display: flex; flex-direction: column;
    animation: slideUp .2s ease-out;
  }
  @keyframes slideUp { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
  .modal-head {
    padding: 22px 28px 18px;
    border-bottom: 1px solid var(--line);
  }
  .modal-title { font-size: 20px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; margin-bottom: 4px; }
  .modal-sub { font-size: 13px; color: var(--muted); }
  .modal-body { padding: 22px 28px; overflow-y: auto; }
  .modal-foot {
    padding: 16px 28px;
    border-top: 1px solid var(--line);
    display: flex; justify-content: space-between; align-items: center;
    background: var(--surface-2);
  }
  .format-list { display: flex; flex-direction: column; gap: 8px; }
  .format-card {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
    transition: all .15s;
    background: var(--surface);
  }
  .format-card:hover { border-color: var(--emerald); background: var(--bg-soft); }
  .format-card.selected { border-color: var(--emerald); background: var(--emerald-soft); }
  .format-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.02em;
    color: white;
  }
  .format-icon.docx { background: #2B579A; }
  .format-icon.pdf { background: #B30B00; }
  .format-icon.gdocs { background: #1A73E8; }
  .format-icon.email { background: var(--ink); }
  .format-icon.link { background: var(--gold); color: var(--ink); }
  .format-body { flex: 1; min-width: 0; }
  .format-name { font-weight: 600; font-size: 14px; color: var(--ink); }
  .format-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
  .format-radio {
    width: 18px; height: 18px;
    border: 2px solid var(--line);
    border-radius: 50%;
    flex-shrink: 0;
  }
  .format-card.selected .format-radio {
    border-color: var(--emerald);
    background: radial-gradient(circle, var(--emerald) 38%, transparent 42%);
  }
  .modal-options {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line-soft);
  }
  .modal-options-title {
    font-size: 11px; font-weight: 600; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.05em;
    margin-bottom: 10px;
  }
  .modal-option {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--ink-2);
    cursor: pointer;
  }
  .modal-option:hover { background: var(--bg-soft); }
  .modal-option-icon {
    width: 28px; height: 28px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .modal-option-icon.email { background: var(--bg-soft); color: var(--ink-2); }
  .modal-option-icon.link { background: var(--bg-soft); color: var(--ink-2); }
  .modal-option-icon.print { background: var(--bg-soft); color: var(--ink-2); }
  .modal-option-icon svg { width: 14px; height: 14px; }
  .modal-close-x {
    position: absolute;
    top: 18px; right: 18px;
    width: 30px; height: 30px;
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
  }
  .modal-close-x:hover { background: var(--surface-2); color: var(--ink); }
  .modal-close-x svg { width: 16px; height: 16px; }

  /* Export progress (inside modal after click Export) */
  .export-progress {
    display: flex; align-items: center; gap: 14px;
    padding: 18px 16px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-top: 10px;
  }
  .export-progress-icon {
    width: 36px; height: 36px;
    background: var(--emerald-soft);
    color: var(--emerald);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
  }
  .export-progress-body { flex: 1; }
  .export-progress-title { font-weight: 600; font-size: 13px; color: var(--ink); }
  .export-progress-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
  .export-progress-bar { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 8px; }
  .export-progress-fill { height: 100%; background: var(--emerald); border-radius: 4px; transition: width .25s ease-out; }

  /* Call insights card */
  .call-insights {
    background: linear-gradient(180deg, var(--emerald-soft), var(--surface));
    border: 1px solid var(--emerald);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 18px;
  }
  .call-insights-head {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 12px;
  }
  .call-insights-icon {
    width: 32px; height: 32px;
    background: var(--emerald);
    color: white;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .call-insights-icon svg { width: 16px; height: 16px; }
  .call-insights-title { font-weight: 600; font-size: 13.5px; color: var(--ink); }
  .call-insights-sub { font-size: 11.5px; color: var(--muted); }
  .call-insights-list { list-style: none; padding: 0; }
  .call-insights-list li {
    position: relative;
    padding: 6px 0 6px 18px;
    font-size: 13px;
    color: var(--ink-2);
    line-height: 1.55;
  }
  .call-insights-list li::before {
    content: "";
    position: absolute;
    left: 4px; top: 13px;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--emerald);
  }
  .call-insights-list li strong { color: var(--ink); font-weight: 600; }
  .call-insights-quote {
    background: var(--surface);
    border-left: 3px solid var(--emerald);
    padding: 8px 12px;
    margin: 4px 0 4px 18px;
    font-style: italic;
    font-size: 12.5px;
    color: var(--ink-2);
    border-radius: 0 6px 6px 0;
  }

  /* Product picker (3-card home) */
  .product-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
    max-width: 980px;
    margin: 0 auto;
  }
  .product-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 28px 24px;
    text-align: left;
    cursor: pointer;
    transition: all .18s;
    display: flex; flex-direction: column;
  }
  .product-card:hover {
    border-color: var(--emerald);
    transform: translateY(-2px);
    box-shadow: var(--shadow-2);
  }
  .product-icon {
    width: 44px; height: 44px;
    background: var(--emerald-soft);
    color: var(--emerald);
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
  }
  .product-icon svg { width: 22px; height: 22px; }
  .product-card.gold .product-icon { background: var(--gold-soft); color: var(--gold); }
  .product-card.ink .product-icon { background: #EAEAEC; color: var(--ink); }
  .product-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
  }
  .product-sub {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 16px;
    flex: 1;
  }
  .product-cta {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--emerald);
    display: flex; align-items: center; gap: 6px;
  }
  .product-cta svg { width: 12px; height: 12px; }
  .product-card.gold .product-cta { color: var(--gold); }
  .product-card.ink .product-cta { color: var(--ink); }
  .product-meta {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line-soft);
    font-size: 11.5px;
    color: var(--muted);
    display: flex; gap: 12px;
  }
  .product-meta-item { display: flex; align-items: center; gap: 4px; }
  .product-meta-item strong { color: var(--ink); font-weight: 600; }

  /* Form data grid (Form Filler) */
  .form-data-table {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
  }
  .form-data-row {
    display: grid;
    grid-template-columns: 180px 1fr 110px;
    gap: 16px;
    padding: 11px 16px;
    align-items: center;
    font-size: 13px;
    border-bottom: 1px solid var(--line-soft);
  }
  .form-data-row:last-child { border-bottom: none; }
  .form-data-row.head {
    background: var(--surface-2);
    font-weight: 600;
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  .form-data-key { color: var(--muted-2); font-weight: 500; }
  .form-data-val { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
  .form-data-status {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    text-align: center;
  }
  .form-data-status.auto { background: var(--emerald-soft); color: var(--emerald); }
  .form-data-status.needs { background: var(--gold-soft); color: var(--gold); }
  .form-data-status.fail { background: var(--burgundy-soft); color: var(--burgundy); }

  /* Validation list */
  .validate-list {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 6px;
  }
  .validate-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    font-size: 13.5px;
    color: var(--ink-2);
    border-radius: 8px;
  }
  .validate-row .v-icon {
    width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
    background: var(--emerald);
    color: white;
    border-radius: 50%;
    flex-shrink: 0;
  }
  .validate-row .v-icon svg { width: 10px; height: 10px; }
  .validate-row .v-meta {
    margin-left: auto;
    font-size: 12px;
    color: var(--emerald);
    font-weight: 600;
  }

  /* Forms preview stack */
  .forms-stack-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .forms-stack-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 14px 16px;
    display: flex; align-items: center; gap: 12px;
    transition: border-color .15s;
  }
  .forms-stack-card:hover { border-color: var(--emerald); }
  .forms-stack-icon {
    width: 36px; height: 36px;
    background: var(--emerald-soft);
    color: var(--emerald);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .forms-stack-icon svg { width: 16px; height: 16px; }
  .forms-stack-body { flex: 1; min-width: 0; }
  .forms-stack-name { font-weight: 600; font-size: 13.5px; color: var(--ink); }
  .forms-stack-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
  .forms-stack-fee {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
  }

  /* Fee summary card */
  .fee-summary {
    background: var(--bg-soft);
    border: 1px solid var(--gold);
    border-radius: 12px;
    padding: 16px 18px;
    margin-top: 14px;
    display: flex; align-items: center; justify-content: space-between;
  }
  .fee-summary-label { font-size: 12.5px; color: var(--gold); font-weight: 600; }
  .fee-summary-amount {
    font-size: 24px;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
  }

  /* H-1B specific */
  .employer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .employer-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px;
    cursor: pointer;
    transition: all .15s;
  }
  .employer-card:hover { border-color: var(--emerald); transform: translateY(-1px); }
  .employer-card.selected { border-color: var(--emerald); background: var(--emerald-soft); }
  .employer-name { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
  .employer-sub { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
  .employer-stat { display: flex; gap: 16px; font-size: 11.5px; color: var(--muted); }
  .employer-stat strong { color: var(--ink); font-weight: 600; }

  /* Recommender list */
  .rec-list { display: flex; flex-direction: column; gap: 8px; }
  .rec-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    font-size: 13.5px;
  }
  .rec-toggle {
    margin-left: auto;
    display: flex; gap: 6px;
  }
  .rec-toggle-pill {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
    background: var(--surface);
    color: var(--muted);
  }
  .rec-toggle-pill.selected { background: var(--ink); color: var(--cream); border-color: var(--ink); }

  /* Post-Approval page */
  .celebration-banner {
    display: flex; align-items: center; gap: 18px;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--emerald-soft), #FAF6EE);
    border: 1px solid var(--emerald);
    border-radius: 14px;
    margin-bottom: 24px;
  }
  .celebration-icon {
    width: 48px; height: 48px;
    background: var(--emerald);
    color: white;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .celebration-icon svg { width: 22px; height: 22px; }
  .celebration-body { flex: 1; }
  .celebration-title { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
  .celebration-sub { font-size: 12.5px; color: var(--muted); }
  .pa-stage-pill {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 600;
    padding: 3px 9px;
    border-radius: 10px;
    border: 1px solid;
  }
  .pa-stage-pill.consular { background: #FFF8EA; border-color: var(--gold); color: var(--gold); }
  .pa-stage-pill.aos { background: var(--emerald-soft); border-color: var(--emerald); color: var(--emerald); }
  .pa-stage-pill.in-us { background: var(--bg-soft); border-color: var(--muted-2); color: var(--muted); }
  .pa-stage-pill.eligible { background: #F3EBFF; border-color: #6B4FAB; color: #6B4FAB; }
  .pa-stage-pill.alert { background: var(--burgundy-soft); border-color: var(--burgundy); color: var(--burgundy); }
  .pa-row { transition: background .1s; }
  .pa-row:hover { background: var(--surface-2); cursor: pointer; }
  .pa-next-action {
    font-size: 12px;
    color: var(--ink-2);
    display: flex; align-items: center; gap: 6px;
  }
  .pa-next-action svg { width: 12px; height: 12px; color: var(--muted); }
  .pa-opportunity {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 8px;
    background: var(--surface);
    cursor: pointer;
    transition: border-color .15s;
  }
  .pa-opportunity:hover { border-color: var(--emerald); }
  .pa-opp-head {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 6px;
  }
  .pa-opp-icon {
    width: 28px; height: 28px;
    border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .pa-opp-icon.family { background: var(--gold-soft); color: var(--gold); }
  .pa-opp-icon.cit { background: #F3EBFF; color: #6B4FAB; }
  .pa-opp-icon.i94 { background: var(--burgundy-soft); color: var(--burgundy); }
  .pa-opp-icon svg { width: 14px; height: 14px; }
  .pa-opp-title { font-weight: 600; font-size: 13.5px; color: var(--ink); }
  .pa-opp-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
  .pa-opp-body { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
  .pa-opp-body strong { color: var(--ink); font-weight: 600; }

  /* Timeline pills */
  .timeline-pill {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg-soft);
    color: var(--muted);
    font-variant-numeric: tabular-nums;
  }
  .timeline-pill.urgent { background: var(--burgundy-soft); color: var(--burgundy); font-weight: 600; }
  .timeline-pill.warn { background: var(--gold-soft); color: var(--gold); font-weight: 600; }

  
  /* Case detail page */
  .case-header {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 22px 26px;
    margin-bottom: 18px;
  }
  .case-head-top {
    display: flex; align-items: center; gap: 18px;
    margin-bottom: 16px;
  }
  .case-avatar {
    width: 64px; height: 64px;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
  }
  .case-title-block { flex: 1; }
  .case-name {
    font-size: 24px;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.01em;
    margin-bottom: 4px;
  }
  .case-meta-row {
    display: flex; align-items: center; gap: 14px;
    font-size: 13px;
    color: var(--muted);
  }
  .case-meta-row span { display: flex; align-items: center; gap: 4px; }
  .case-meta-dot { width: 3px; height: 3px; background: var(--muted-2); border-radius: 50%; }
  .case-actions { display: flex; gap: 8px; }
  .case-quickstats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line-soft);
  }
  .case-stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
  }
  .case-stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
  }
  .case-stat-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

  /* Timeline stepper */
  .case-timeline {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 24px 28px;
    margin-bottom: 16px;
  }
  .case-timeline-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 18px;
  }
  .timeline-stepper {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    position: relative;
  }
  .timeline-step {
    position: relative;
    display: flex; flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .timeline-step::before {
    content: "";
    position: absolute;
    top: 14px;
    left: -50%;
    right: 50%;
    height: 2px;
    background: var(--line);
    z-index: 0;
  }
  .timeline-step:first-child::before { display: none; }
  .timeline-step.done::before { background: var(--emerald); }
  .timeline-step.active::before { background: var(--emerald); }
  .timeline-dot {
    position: relative;
    z-index: 1;
    width: 30px; height: 30px;
    border-radius: 50%;
    border: 2px solid var(--line);
    background: var(--surface);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 8px;
  }
  .timeline-step.done .timeline-dot {
    background: var(--emerald);
    border-color: var(--emerald);
    color: white;
  }
  .timeline-step.done .timeline-dot svg { width: 14px; height: 14px; }
  .timeline-step.active .timeline-dot {
    background: var(--surface);
    border-color: var(--emerald);
    color: var(--emerald);
    box-shadow: 0 0 0 4px var(--emerald-soft);
  }
  .timeline-step.active .timeline-dot::after {
    content: "";
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--emerald);
    animation: pulse 1.6s ease-in-out infinite;
  }
  .timeline-label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 2px; }
  .timeline-step.done .timeline-label { color: var(--ink); }
  .timeline-step.active .timeline-label { color: var(--emerald); }
  .timeline-date { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

  /* Case detail content grid */
  .case-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 16px;
  }
  .case-section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px 22px;
    margin-bottom: 16px;
  }
  .case-section-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px;
  }
  .case-section-title { font-weight: 600; font-size: 14px; color: var(--ink); }
  .case-section-count {
    font-size: 11px;
    background: var(--bg-soft);
    color: var(--muted);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
  }
  .doc-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line-soft);
  }
  .doc-row:last-child { border-bottom: none; }
  .doc-icon {
    width: 32px; height: 32px;
    background: var(--bg-soft);
    color: var(--ink-2);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .doc-icon svg { width: 14px; height: 14px; }
  .doc-icon.client { background: var(--emerald-soft); color: var(--emerald); }
  .doc-icon.form { background: #E8EFEF; color: #2B579A; }
  .doc-icon.gen { background: var(--gold-soft); color: var(--gold); }
  .doc-name { font-weight: 600; font-size: 13px; color: var(--ink); }
  .doc-meta { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
  .doc-actions { margin-left: auto; display: flex; gap: 6px; }
  .doc-action-btn {
    font-size: 11.5px;
    padding: 4px 10px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink-2);
    cursor: pointer;
  }
  .doc-action-btn:hover { background: var(--surface-2); }

  .case-activity-feed { max-height: 380px; overflow-y: auto; }
  .case-activity-item {
    display: flex; gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line-soft);
  }
  .case-activity-item:last-child { border-bottom: none; }
  .case-act-dot {
    width: 8px; height: 8px;
    background: var(--emerald);
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
  }
  .case-act-dot.old { background: var(--muted-2); }
  .case-act-dot.gold { background: var(--gold); }
  .case-act-text { font-size: 13px; color: var(--ink-2); }
  .case-act-text strong { color: var(--ink); font-weight: 600; }
  .case-act-time { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

  .case-mini-msg {
    padding: 10px 0;
    border-bottom: 1px solid var(--line-soft);
  }
  .case-mini-msg:last-child { border-bottom: none; }
  .case-mini-msg-head {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 4px;
  }
  .case-mini-msg-sender { font-weight: 600; font-size: 12.5px; color: var(--ink); }
  .case-mini-msg-time { font-size: 11px; color: var(--muted); margin-left: auto; }
  .case-mini-msg-body { font-size: 13px; color: var(--ink-2); line-height: 1.5; }

  .case-pay-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--line-soft);
  }
  .case-pay-row:last-child { border-bottom: none; }
  .case-pay-row .pay-status-done { color: var(--emerald); font-weight: 600; }
  .case-pay-row strong { color: var(--ink); font-variant-numeric: tabular-nums; }

  .case-side-quickaction {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 9px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: border-color .15s;
    font-size: 13px;
    color: var(--ink-2);
  }
  .case-side-quickaction:hover { border-color: var(--emerald); }
  .case-side-quickaction svg { width: 14px; height: 14px; color: var(--muted); }

  .case-back-link {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 16px;
    cursor: pointer;
  }
  .case-back-link:hover { color: var(--ink); }
  .case-back-link svg { width: 14px; height: 14px; }

  .dependent-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line-soft);
    font-size: 13px;
  }
  .dependent-row:last-child { border-bottom: none; }
  .dependent-name { font-weight: 600; color: var(--ink); }
  .dependent-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

  
  /* New Case modal */
  .modal.modal-wide { width: 720px; max-width: calc(100vw - 32px); }
  .nc-stepper {
    display: flex; align-items: center;
    padding: 14px 28px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    gap: 0;
  }
  .nc-step {
    flex: 1;
    display: flex; align-items: center; gap: 8px;
    font-size: 12px;
    color: var(--muted);
    position: relative;
  }
  .nc-step-num {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--line);
    color: var(--muted-2);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
  }
  .nc-step.active .nc-step-num { background: var(--ink); color: var(--cream); }
  .nc-step.done .nc-step-num { background: var(--emerald); color: white; }
  .nc-step.done .nc-step-num svg { width: 11px; height: 11px; }
  .nc-step.active { color: var(--ink); font-weight: 600; }
  .nc-step.done { color: var(--emerald); }
  .nc-step:not(:last-child)::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
    margin: 0 8px;
  }
  .nc-step.done:not(:last-child)::after { background: var(--emerald); }
  .nc-pane { display: none; }
  .nc-pane.active { display: block; }
  .visa-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 4px;
  }
  .visa-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all .15s;
    background: var(--surface);
  }
  .visa-card:hover { border-color: var(--emerald); }
  .visa-card.selected { border-color: var(--emerald); background: var(--emerald-soft); }
  .visa-card-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 4px;
  }
  .visa-card-code { font-weight: 700; font-size: 14px; color: var(--ink); letter-spacing: -0.01em; }
  .visa-card-tag {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 8px;
    background: var(--bg-soft);
    color: var(--muted);
  }
  .visa-card-tag.hot { background: var(--emerald-soft); color: var(--emerald); }
  .visa-card-name { font-size: 12.5px; color: var(--ink-2); font-weight: 500; margin-bottom: 4px; }
  .visa-card-sub { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
  .nc-section-title { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }
  .nc-toggle-row {
    display: flex; gap: 6px;
    background: var(--surface-2);
    padding: 4px;
    border-radius: 8px;
    margin-bottom: 16px;
  }
  .nc-toggle-row .nc-toggle {
    flex: 1;
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    text-align: center;
    background: transparent;
    border: none;
  }
  .nc-toggle-row .nc-toggle.active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
  .nc-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .nc-form .full { grid-column: 1 / -1; }
  .nc-eligibility-stages { display: flex; flex-direction: column; gap: 8px; max-width: 480px; margin: 0 auto 18px; }
  .nc-stage {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 9px;
    font-size: 13px;
    color: var(--muted-2);
    opacity: 0.5;
    transition: all .3s;
  }
  .nc-stage.active { opacity: 1; border-color: var(--emerald); color: var(--ink); }
  .nc-stage.done { opacity: 1; color: var(--ink); }
  .nc-stage .nc-meta { margin-left: auto; font-size: 11.5px; color: var(--emerald); font-weight: 600; white-space: nowrap; }
  .nc-result-card {
    background: var(--emerald-soft);
    border: 1px solid var(--emerald);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 16px;
  }
  .nc-result-title { font-weight: 700; font-size: 16px; color: var(--ink); margin-bottom: 4px; }
  .nc-result-sub { font-size: 13px; color: var(--ink-2); }
  .nc-strategy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
  .nc-strategy-cell {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 14px;
  }
  .nc-strategy-label { font-size: 10.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
  .nc-strategy-value { font-size: 16px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
  .nc-strategy-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
  .nc-fee-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--line-soft);
    font-size: 13px;
  }
  .nc-fee-row:last-child { border-bottom: none; padding-top: 12px; font-weight: 700; font-size: 14px; }
  .nc-fee-row .nc-fee-amt { font-variant-numeric: tabular-nums; }
  .nc-done-icon {
    width: 64px; height: 64px;
    background: var(--emerald);
    color: white;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 18px;
  }
  .nc-done-icon svg { width: 30px; height: 30px; }
  .nc-done-list { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; margin-top: 14px; text-align: left; }
  .nc-done-list .checklist-item { padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
  .nc-done-list .checklist-item:last-child { border-bottom: none; }

  /* Sidebar / Account separator */
/* Sidebar / Account separator */
/* Sidebar / Account separator */

  /* Settings tabs / notif rows / switches */
  .settings-tab { display: none; }
  .settings-tab.active { display: block; }
  .notif-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--line-soft);
  }
  .notif-row:last-child { border-bottom: none; }
  .notif-title { font-size: 13.5px; font-weight: 600; color: var(--ink); }
  .notif-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
  .switch { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; }
  .switch input { opacity: 0; width: 0; height: 0; }
  .slider {
    position: absolute; cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--line);
    border-radius: 22px;
    transition: .2s;
  }
  .slider:before {
    content: ""; position: absolute;
    height: 16px; width: 16px;
    left: 3px; bottom: 3px;
    background: var(--surface);
    border-radius: 50%;
    transition: .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
  }
  .switch input:checked + .slider { background: var(--emerald); }
  .switch input:checked + .slider:before { transform: translateX(16px); }

  /* Inbox payment block */
  .pay-card {
    background: var(--bg-soft);
    border: 1px solid var(--gold);
    border-radius: 10px;
    padding: 12px 14px;
    margin: 12px 0;
  }
  .pay-card-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--gold); font-weight: 600; margin-bottom: 4px; }
  .pay-card-amount { font-family: 'Inter', system-ui, -apple-system, sans-serif; font-size: 24px; font-weight: 600; color: var(--ink); line-height: 1.1; }
  .pay-card-note { font-size: 11.5px; color: var(--gold); margin-top: 4px; font-weight: 500; }
  .pay-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; font-size: 13px; }
  .pay-row-left { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
  .pay-row-left svg { width: 14px; height: 14px; }
  .pay-row.done .pay-row-left { color: var(--emerald); }
  .pay-row.active .pay-row-left { color: var(--ink); font-weight: 600; }
  .pay-row.pending .pay-row-left { color: var(--muted); }
  .pay-row strong { font-weight: 600; color: var(--ink-2); }


  /* Sidebar toggle */
  .sidebar-toggle {
    width: 36px; height: 36px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--muted);
    background: transparent;
    transition: background .15s, color .15s;
    margin-right: 4px;
    cursor: pointer;
    border: none;
  }
  .sidebar-toggle:hover { background: var(--surface-2); color: var(--ink); }
  .app.sidebar-closed { grid-template-columns: 0 1fr; }
  .app.sidebar-closed .sidebar { display: none; }
  @media (max-width: 768px) {
    .app { grid-template-columns: 0 1fr; }
    .sidebar { display: none; }
    .app.sidebar-open { grid-template-columns: 240px 1fr; }
    .app.sidebar-open .sidebar { display: flex; position: fixed; top: 0; left: 0; height: 100vh; z-index: 100; box-shadow: var(--shadow-2); }
  }

  @media (max-width: 1100px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-2-1, .grid-1-1, .drafter-grid { grid-template-columns: 1fr; }
    .kanban { grid-template-columns: repeat(3, minmax(220px, 1fr)); overflow-x: auto; }
    .inbox-grid { grid-template-columns: 1fr; height: auto; }
    .case-panel { display: none; }
  }
