:root{
  --bg:#f6f5f2;--surface:#fff;--surface-2:#fbfaf7;--ink:#1e1f1d;--muted:#72736f;--muted-2:#9a9b96;
  --line:#e6e4df;--line-strong:#d9d6cf;--accent:#765d3d;--accent-soft:#eee8df;--accent-ink:#56442f;
  --green:#3f6a50;--green-soft:#e9f1eb;--amber:#956728;--amber-soft:#f7eedf;--blue:#4e607c;--blue-soft:#e9edf4;
  --danger:#934b43;--danger-soft:#f5e9e7;--shadow:0 1px 2px rgba(24,24,20,.04),0 12px 34px rgba(35,31,25,.06);
  --radius:16px;--rail:236px;--max:1180px;
}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--bg);color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Roboto,Arial,sans-serif;-webkit-font-smoothing:antialiased}button,input,textarea,select{font:inherit;color:inherit}button{cursor:pointer}a{color:inherit}.boot{display:flex;gap:14px;align-items:center;max-width:440px;margin:18vh auto;padding:22px}.boot-mark{width:42px;height:42px;border-radius:13px;display:grid;place-items:center;background:var(--ink);color:#fff;font-weight:800}.boot strong,.boot span{display:block}.boot span{color:var(--muted);font-size:13px;margin-top:3px}
.app-shell{min-height:100vh;display:grid;grid-template-columns:var(--rail) minmax(0,1fr)}
.sidebar{position:sticky;top:0;height:100vh;background:#efede8;border-right:1px solid var(--line);display:flex;flex-direction:column;padding:16px 12px;overflow:auto}.logo-row{display:flex;align-items:center;gap:10px;padding:4px 6px 14px}.logo-mark{width:31px;height:31px;border-radius:9px;background:var(--ink);color:#fff;display:grid;place-items:center;font-size:12px;font-weight:800}.logo-text{font-size:13px;font-weight:800;letter-spacing:.08em}.logo-sub{font-size:10px;color:var(--muted);margin-top:1px}.project-switch{border:1px solid var(--line-strong);background:rgba(255,255,255,.7);border-radius:12px;padding:9px 10px;display:grid;grid-template-columns:1fr auto;gap:8px;align-items:center;text-align:left;width:100%;margin-bottom:12px}.project-switch small{display:block;color:var(--muted);font-size:10px;margin-bottom:2px}.project-switch strong{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chev{color:var(--muted)}
.nav-block{margin-top:3px}.nav-label{font-size:10px;font-weight:700;color:var(--muted-2);padding:9px 9px 5px;text-transform:uppercase;letter-spacing:.08em}.nav-btn{width:100%;border:0;background:transparent;display:flex;align-items:center;gap:9px;padding:8px 9px;border-radius:10px;text-align:left;font-size:13px;margin:1px 0}.nav-btn:hover,.nav-btn.active{background:rgba(255,255,255,.78)}.nav-icon{width:20px;height:20px;display:grid;place-items:center;color:var(--muted);font-size:12px}.nav-btn.active .nav-icon{color:var(--accent)}.nav-btn .count{margin-left:auto;color:var(--muted);font-size:10px}.stage-nav .nav-btn{padding-top:7px;padding-bottom:7px}.stage-dot{width:20px;height:20px;border-radius:7px;border:1px solid var(--line-strong);display:grid;place-items:center;font-size:10px;font-weight:700;background:rgba(255,255,255,.48)}.nav-btn.active .stage-dot{background:var(--accent);border-color:var(--accent);color:white}.stage-mini-progress{width:30px;height:3px;border-radius:9px;background:#ddd9d0;margin-left:auto;overflow:hidden}.stage-mini-progress i{display:block;height:100%;background:var(--accent);border-radius:9px}.sidebar-foot{margin-top:auto;padding:12px 7px 2px;color:var(--muted);font-size:10px;display:flex;justify-content:space-between;gap:8px}
.main{min-width:0}.mobile-top{display:none}.main-inner{width:min(var(--max),calc(100% - 48px));margin:0 auto;padding:24px 0 84px}.page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin:3px 0 18px}.page-head-left{min-width:0}.eyebrow{font-size:11px;color:var(--muted);font-weight:700;text-transform:uppercase;letter-spacing:.075em;margin-bottom:5px}.page-head h1{font-size:26px;line-height:1.1;margin:0;letter-spacing:-.03em}.page-head p{font-size:13px;line-height:1.45;color:var(--muted);margin:7px 0 0;max-width:720px}.head-actions{display:flex;gap:7px;align-items:center;flex-wrap:wrap;justify-content:flex-end}.save-indicator{display:flex;align-items:center;gap:5px;color:var(--muted);font-size:11px}.save-dot{width:6px;height:6px;border-radius:50%;background:var(--green)}
.btn{border:1px solid var(--line-strong);background:var(--surface);border-radius:10px;padding:8px 11px;font-size:12px;font-weight:650;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:34px}.btn:hover{border-color:#c9c5bd}.btn.primary{background:var(--ink);border-color:var(--ink);color:#fff}.btn.ghost{background:transparent;border-color:transparent}.btn.danger{color:var(--danger)}.icon-btn{width:34px;height:34px;padding:0;border-radius:10px}.btn.sm{padding:6px 9px;min-height:30px;font-size:11px}
.surface{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}.surface-flat{background:var(--surface);border:1px solid var(--line);border-radius:14px}.section-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:23px 0 9px}.section-title h2{font-size:14px;margin:0}.section-title span{font-size:11px;color:var(--muted)}
.project-hero{padding:17px 18px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:18px;align-items:center}.project-hero h2{font-size:18px;margin:0 0 4px}.project-meta{display:flex;flex-wrap:wrap;gap:5px 12px;color:var(--muted);font-size:11px}.hero-progress{width:156px}.hero-progress-top{display:flex;justify-content:space-between;font-size:10px;color:var(--muted);margin-bottom:6px}.bar{height:6px;background:#ece9e3;border-radius:99px;overflow:hidden}.bar i{display:block;height:100%;background:var(--accent);border-radius:99px}
.focus-card{display:grid;grid-template-columns:46px minmax(0,1fr) auto;gap:14px;align-items:center;padding:16px 17px}.focus-num{width:42px;height:42px;border-radius:13px;background:var(--accent-soft);color:var(--accent-ink);display:grid;place-items:center;font-weight:800;font-size:16px}.focus-card h3{font-size:14px;margin:0 0 3px}.focus-card p{font-size:12px;color:var(--muted);margin:0;line-height:1.4}.focus-card .btn{white-space:nowrap}.attention-row{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.mini-stat{padding:12px 13px}.mini-stat strong{display:block;font-size:18px;letter-spacing:-.02em}.mini-stat span{display:block;color:var(--muted);font-size:10px;margin-top:2px}
.route{overflow:hidden}.route-row{display:grid;grid-template-columns:30px minmax(0,1fr) 120px 18px;gap:10px;align-items:center;padding:11px 14px;border-bottom:1px solid var(--line);cursor:pointer;transition:.12s}.route-row:last-child{border-bottom:0}.route-row:hover{background:var(--surface-2)}.route-n{width:25px;height:25px;border-radius:8px;background:#f0ede7;color:var(--accent-ink);display:grid;place-items:center;font-size:10px;font-weight:800}.route-name{font-size:12px;font-weight:680;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.route-sub{font-size:10px;color:var(--muted);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.route-progress{display:flex;align-items:center;gap:8px}.route-progress .bar{flex:1;height:4px}.route-progress b{font-size:10px;color:var(--muted);font-weight:600;width:28px;text-align:right}.arrow{color:var(--muted-2);font-size:15px}
.stage-strip{display:flex;gap:6px;overflow:auto;padding:1px 0 11px;scrollbar-width:none}.stage-strip::-webkit-scrollbar{display:none}.stage-pill{border:1px solid var(--line);background:var(--surface);border-radius:10px;padding:7px 10px;font-size:11px;font-weight:650;white-space:nowrap;display:flex;align-items:center;gap:6px}.stage-pill b{width:18px;height:18px;border-radius:6px;display:grid;place-items:center;background:#f0ede7;font-size:9px}.stage-pill.active{border-color:#bcae9c;background:#f5f0e9}.stage-pill.active b{background:var(--accent);color:white}
.stage-head{padding:16px 17px;margin-bottom:10px}.stage-head-top{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.stage-title-wrap{display:flex;gap:12px;align-items:flex-start}.stage-badge{width:38px;height:38px;border-radius:12px;background:var(--accent-soft);color:var(--accent-ink);display:grid;place-items:center;font-weight:800;flex:none}.stage-head h1{font-size:20px;margin:0 0 4px;letter-spacing:-.02em}.stage-head p{font-size:12px;color:var(--muted);margin:0;line-height:1.45}.method-link{border:0;background:transparent;color:var(--accent);font-size:11px;font-weight:700;padding:4px 0;white-space:nowrap}.method-box{display:none;border-top:1px solid var(--line);margin-top:12px;padding-top:11px;font-size:11px;color:var(--muted);line-height:1.5}.method-box.open{display:block}.subtabs{display:flex;gap:5px;overflow:auto;scrollbar-width:none;margin:10px 0}.subtabs::-webkit-scrollbar{display:none}.subtab{border:1px solid var(--line);background:var(--surface);padding:7px 10px;border-radius:9px;font-size:11px;font-weight:650;white-space:nowrap}.subtab.active{background:var(--ink);border-color:var(--ink);color:#fff}
.workspace-grid{display:grid;grid-template-columns:minmax(0,1fr) 250px;gap:12px;align-items:start}.workspace-main{min-width:0}.context-panel{position:sticky;top:15px}.context-card{padding:13px}.context-card h3{font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);margin:0 0 9px}.context-line{font-size:11px;line-height:1.45;padding:8px 0;border-top:1px solid var(--line)}.context-line:first-of-type{border-top:0;padding-top:0}.context-line strong{display:block;font-size:12px;color:var(--ink);margin-bottom:2px}.status-chip{display:inline-flex;align-items:center;gap:5px;border-radius:999px;padding:4px 7px;font-size:9px;font-weight:750}.status-chip.fact{background:var(--green-soft);color:var(--green)}.status-chip.hyp{background:var(--amber-soft);color:var(--amber)}.status-chip.decision{background:var(--blue-soft);color:var(--blue)}.status-chip.method{background:var(--accent-soft);color:var(--accent-ink)}
.task-panel{padding:14px}.task-panel-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}.task-panel-head h2{font-size:13px;margin:0}.task-panel-head .meta{font-size:10px;color:var(--muted)}.empty-state{padding:32px 20px;text-align:center}.empty-icon{width:42px;height:42px;margin:0 auto 10px;border-radius:14px;background:#f1eee8;display:grid;place-items:center;color:var(--accent);font-weight:800}.empty-state h3{font-size:13px;margin:0 0 5px}.empty-state p{font-size:11px;line-height:1.45;color:var(--muted);max-width:420px;margin:0 auto 13px}
.record-list{display:grid;gap:7px}.record-card{border:1px solid var(--line);border-radius:12px;background:var(--surface);padding:11px 12px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;cursor:pointer}.record-card:hover{border-color:#ccc6bc}.record-card-title{font-size:12px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.record-card-sub{font-size:10px;color:var(--muted);margin-top:3px;display:flex;gap:8px;flex-wrap:wrap}.record-card-actions{display:flex;align-items:center;gap:7px}.records-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:9px}.view-switch{display:flex;border:1px solid var(--line);border-radius:9px;padding:2px;background:#f5f3ef}.view-switch button{border:0;background:transparent;border-radius:7px;padding:5px 7px;font-size:9px}.view-switch button.active{background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.08)}
.field-groups{display:grid;gap:10px}.field-group{border:1px solid var(--line);border-radius:13px;overflow:hidden;background:var(--surface)}.field-group-head{padding:11px 13px;border-bottom:1px solid var(--line);background:var(--surface-2)}.field-group-head h3{font-size:12px;margin:0}.field-group-head p{font-size:10px;color:var(--muted);margin:3px 0 0}.fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0}.field{padding:10px 12px;border-bottom:1px solid var(--line);min-width:0}.field:nth-child(odd){border-right:1px solid var(--line)}.field.wide{grid-column:1/-1;border-right:0}.field label{display:block;font-size:10px;font-weight:700;color:var(--muted);margin-bottom:5px}.field input,.field textarea,.field select{width:100%;border:0;background:transparent;padding:0;outline:none;font-size:12px;line-height:1.4;resize:vertical}.field textarea{min-height:42px}.field input::placeholder,.field textarea::placeholder{color:#b6b5b1}.field:focus-within{background:#fffdf7;box-shadow:inset 2px 0 var(--accent)}
.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:12px;background:#fff}.data-table{border-collapse:collapse;width:max-content;min-width:100%;font-size:10px}.data-table th,.data-table td{padding:7px 8px;border-bottom:1px solid var(--line);border-right:1px solid var(--line);vertical-align:top;min-width:130px}.data-table th{position:sticky;top:0;background:#f7f5f1;text-align:left;font-size:9px;color:var(--muted);z-index:2}.data-table textarea,.data-table input,.data-table select{border:0;background:transparent;width:100%;font:inherit;resize:vertical;min-height:32px}.data-table th:first-child,.data-table td:first-child{position:sticky;left:0;background:#faf9f6;z-index:1;min-width:85px}.data-table th:first-child{z-index:3}
.strategy-summary{padding:15px 16px;display:grid;grid-template-columns:auto minmax(0,1fr);gap:14px;align-items:center}.progress-ring{width:58px;height:58px;border-radius:50%;display:grid;place-items:center;background:conic-gradient(var(--accent) var(--p),#ece9e3 0);position:relative}.progress-ring:after{content:"";position:absolute;inset:6px;background:var(--surface);border-radius:50%}.progress-ring strong{position:relative;z-index:1;font-size:13px}.strategy-summary h2{font-size:14px;margin:0 0 3px}.strategy-summary p{font-size:11px;color:var(--muted);margin:0}.assembly-list{overflow:hidden}.assembly-row{display:grid;grid-template-columns:28px minmax(0,1fr) 130px 16px;gap:10px;align-items:center;padding:10px 13px;border-bottom:1px solid var(--line)}.assembly-row:last-child{border-bottom:0}.assembly-num{width:24px;height:24px;border-radius:8px;background:#f0ede7;display:grid;place-items:center;font-size:9px;font-weight:800}.assembly-name{font-size:11px;font-weight:680}.assembly-map{font-size:9px;color:var(--muted);margin-top:2px}.assembly-row select{border:1px solid var(--line);background:#fff;border-radius:8px;padding:6px 7px;font-size:10px}
.source-card,.history-card{padding:11px 12px}.source-card h3,.history-card h3{font-size:12px;margin:0 0 3px}.source-card p,.history-card p{font-size:10px;color:var(--muted);margin:0;line-height:1.4}.history-time{font-size:9px;color:var(--muted-2);margin-top:5px}.simple-list{display:grid;gap:7px}
.mobile-project-actions{display:none}.project-list{display:grid;gap:8px}.project-row{padding:13px 14px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;cursor:pointer}.project-row h3{font-size:13px;margin:0 0 4px}.project-row p{font-size:10px;color:var(--muted);margin:0}.project-row-meta{display:flex;gap:9px;align-items:center}.project-row-meta .pct{font-size:11px;font-weight:700}
.modal-backdrop{position:fixed;inset:0;background:rgba(25,25,22,.34);z-index:100;display:flex;align-items:stretch;justify-content:flex-end}.drawer{width:min(520px,100%);background:var(--surface);height:100%;box-shadow:-18px 0 55px rgba(0,0,0,.14);display:flex;flex-direction:column;animation:slide .18s ease-out}@keyframes slide{from{transform:translateX(24px);opacity:.5}to{transform:translateX(0);opacity:1}}.drawer-head{padding:14px 16px;border-bottom:1px solid var(--line);display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.drawer-head h2{font-size:15px;margin:0}.drawer-head p{font-size:10px;color:var(--muted);margin:3px 0 0}.drawer-body{padding:13px 15px 26px;overflow:auto;flex:1}.drawer-foot{border-top:1px solid var(--line);padding:10px 15px;display:flex;justify-content:space-between;gap:8px;background:#faf9f6}.drawer .field-group{box-shadow:none}.drawer .fields{grid-template-columns:1fr}.drawer .field{border-right:0!important}.role-choice{display:flex;gap:5px;flex-wrap:wrap;margin:0 0 10px}.role-choice button{border:1px solid var(--line);background:#fff;border-radius:999px;padding:6px 9px;font-size:10px;font-weight:700}.role-choice button.active.fact{background:var(--green-soft);color:var(--green);border-color:#cbdccc}.role-choice button.active.hyp{background:var(--amber-soft);color:var(--amber);border-color:#ead5b7}.role-choice button.active.decision{background:var(--blue-soft);color:var(--blue);border-color:#ccd5e2}
.mobile-bottom{display:none}.toast{position:fixed;right:18px;bottom:18px;background:#222;color:#fff;border-radius:10px;padding:9px 11px;font-size:11px;z-index:200;box-shadow:var(--shadow)}
@media(max-width:980px){:root{--rail:210px}.workspace-grid{grid-template-columns:1fr}.context-panel{display:none}.main-inner{width:min(100% - 34px,var(--max))}.route-row{grid-template-columns:30px minmax(0,1fr) 92px 18px}}
@media(max-width:760px){body{padding-bottom:calc(64px + env(safe-area-inset-bottom))}.app-shell{display:block}.sidebar{display:none}.mobile-top{display:flex;position:sticky;top:0;z-index:30;height:55px;align-items:center;justify-content:space-between;gap:10px;padding:8px 12px;background:rgba(246,245,242,.92);backdrop-filter:blur(16px);border-bottom:1px solid rgba(220,217,211,.8)}.mobile-brand{display:flex;align-items:center;gap:8px;min-width:0}.mobile-brand .logo-mark{width:28px;height:28px;border-radius:8px}.mobile-project{font-size:11px;font-weight:750;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-project small{display:block;font-size:9px;color:var(--muted);font-weight:500}.main-inner{width:100%;padding:12px 11px 28px}.page-head{margin:2px 2px 12px}.page-head h1{font-size:21px}.page-head p{font-size:11px;margin-top:5px}.page-head .head-actions{display:none}.project-hero{padding:13px 14px;grid-template-columns:1fr}.hero-progress{width:100%}.focus-card{grid-template-columns:38px minmax(0,1fr);padding:13px}.focus-num{width:36px;height:36px;border-radius:11px}.focus-card .btn{grid-column:1/-1;width:100%;margin-top:2px}.attention-row{grid-template-columns:repeat(3,1fr);gap:6px}.mini-stat{padding:10px}.mini-stat strong{font-size:16px}.route-row{grid-template-columns:27px minmax(0,1fr) 16px;padding:10px 11px}.route-progress{display:none}.route-n{width:23px;height:23px}.route-name{font-size:11px}.route-sub{font-size:9px}.section-title{margin:18px 2px 8px}.stage-strip{padding-left:1px;padding-bottom:8px}.stage-pill{padding:6px 8px}.stage-head{padding:13px 14px}.stage-title-wrap{gap:10px}.stage-badge{width:34px;height:34px;border-radius:10px}.stage-head h1{font-size:17px}.stage-head p{font-size:10px}.method-link{font-size:10px}.task-panel{padding:11px}.records-toolbar{position:sticky;top:58px;z-index:10;background:var(--bg);padding:3px 0 7px}.record-card{padding:10px}.fields{grid-template-columns:1fr}.field{border-right:0!important}.field.wide{grid-column:auto}.mobile-project-actions{display:grid;grid-template-columns:1fr auto;gap:6px;margin:0 0 10px}.project-list{gap:6px}.project-row{padding:11px 12px}.assembly-row{grid-template-columns:26px minmax(0,1fr) 16px}.assembly-row select{grid-column:2;max-width:160px;margin-top:3px}.strategy-summary{padding:13px}.mobile-bottom{position:fixed;left:0;right:0;bottom:0;z-index:40;display:grid;grid-template-columns:repeat(5,1fr);padding:5px 6px calc(5px + env(safe-area-inset-bottom));background:rgba(249,248,245,.96);backdrop-filter:blur(18px);border-top:1px solid var(--line)}.mobile-bottom button{border:0;background:transparent;display:grid;justify-items:center;gap:2px;padding:5px 2px;color:var(--muted);font-size:8px}.mobile-bottom button b{font-size:13px;font-weight:500;line-height:1}.mobile-bottom button.active{color:var(--ink)}.drawer{width:100%}.drawer-head{padding-top:max(14px,env(safe-area-inset-top))}.toast{left:12px;right:12px;bottom:calc(72px + env(safe-area-inset-bottom));text-align:center}}

/* V4 — mobile typography pass: larger readable text without changing information architecture */
@media(max-width:760px){
  body{font-size:15px;padding-bottom:calc(76px + env(safe-area-inset-bottom))}
  .mobile-top{height:64px;padding:9px 13px}
  .mobile-brand .logo-mark{width:32px;height:32px;border-radius:9px;font-size:13px}
  .mobile-project{font-size:14px;line-height:1.15}
  .mobile-project small{font-size:11px;line-height:1.25;margin-top:2px}
  .main-inner{padding:15px 13px 34px}

  .eyebrow{font-size:12px;line-height:1.25;margin-bottom:6px}
  .page-head{margin:3px 2px 15px}
  .page-head h1{font-size:26px;line-height:1.08}
  .page-head p{font-size:14px;line-height:1.45;margin-top:7px}

  .btn{font-size:14px;min-height:42px;padding:10px 13px;border-radius:11px}
  .btn.sm{font-size:12px;min-height:36px;padding:8px 10px}
  .icon-btn{width:40px;height:40px}

  .section-title{margin:22px 2px 10px}
  .section-title h2{font-size:17px;line-height:1.2}
  .section-title span{font-size:13px;line-height:1.3}

  .project-hero{padding:15px 15px}
  .project-hero h2{font-size:20px}
  .project-meta{font-size:13px;line-height:1.4;gap:6px 12px}
  .hero-progress-top{font-size:12px}

  .focus-card{grid-template-columns:42px minmax(0,1fr);gap:13px;padding:15px}
  .focus-num{width:40px;height:40px;font-size:18px}
  .focus-card h3{font-size:17px;line-height:1.25;margin-bottom:4px}
  .focus-card p{font-size:14px;line-height:1.45}

  .mini-stat{padding:12px 11px}
  .mini-stat strong{font-size:21px;line-height:1.1}
  .mini-stat span{font-size:12px;line-height:1.25;margin-top:4px}

  .route-row{grid-template-columns:30px minmax(0,1fr) 18px;gap:11px;padding:13px 12px}
  .route-n{width:27px;height:27px;font-size:12px;border-radius:9px}
  .route-name{font-size:14px;line-height:1.25;white-space:normal}
  .route-sub{font-size:12px;line-height:1.25;margin-top:3px;white-space:normal}
  .arrow{font-size:18px}

  .stage-strip{gap:7px;padding-bottom:10px}
  .stage-pill{font-size:12px;padding:8px 10px;border-radius:10px}
  .stage-pill b{width:20px;height:20px;font-size:10px}
  .stage-head{padding:15px}
  .stage-badge{width:38px;height:38px;font-size:15px}
  .stage-head h1{font-size:21px;line-height:1.15}
  .stage-head p{font-size:13px;line-height:1.45;margin-top:4px}
  .method-link{font-size:12px}
  .method-box{font-size:13px;line-height:1.5}
  .subtab{font-size:12px;padding:8px 11px}

  .task-panel{padding:13px}
  .task-panel-head h2{font-size:16px}
  .task-panel-head .meta{font-size:12px}
  .records-toolbar{top:67px;padding:4px 0 8px}
  .view-switch button{font-size:11px;padding:6px 8px}
  .record-card{padding:12px}
  .record-card-title{font-size:14px;line-height:1.3}
  .record-card-sub{font-size:12px;line-height:1.3;margin-top:4px}
  .status-chip{font-size:11px;padding:5px 8px}

  .empty-state{padding:30px 18px}
  .empty-state h3{font-size:16px}
  .empty-state p{font-size:13px;line-height:1.5}

  .field-group-head{padding:12px 13px}
  .field-group-head h3{font-size:14px}
  .field-group-head p{font-size:12px;line-height:1.35}
  .field{padding:12px 13px}
  .field label{font-size:12px;margin-bottom:6px}
  .field input,.field textarea,.field select{font-size:14px;line-height:1.45}
  .field textarea{min-height:54px}

  .strategy-summary{padding:15px}
  .progress-ring strong{font-size:15px}
  .strategy-summary h2{font-size:16px}
  .strategy-summary p{font-size:13px;line-height:1.4}
  .assembly-row{grid-template-columns:28px minmax(0,1fr) 18px;padding:12px 13px}
  .assembly-num{width:26px;height:26px;font-size:11px}
  .assembly-name{font-size:14px;line-height:1.25}
  .assembly-map{font-size:11px;line-height:1.3;margin-top:3px}
  .assembly-row select{font-size:12px;padding:7px 8px;max-width:190px}

  .source-card,.history-card{padding:13px}
  .source-card h3,.history-card h3{font-size:14px}
  .source-card p,.history-card p{font-size:12px;line-height:1.45}
  .history-time{font-size:11px}

  .mobile-project-actions{gap:7px;margin-bottom:12px}
  .project-list{gap:8px}
  .project-row{padding:14px 13px}
  .project-row h3{font-size:17px;line-height:1.2;margin-bottom:5px}
  .project-row p{font-size:13px;line-height:1.35}
  .project-row-meta{gap:10px}
  .project-row-meta .pct{font-size:14px}

  .drawer-head h2{font-size:18px}
  .drawer-head p{font-size:12px;line-height:1.35}
  .role-choice button{font-size:12px;padding:7px 10px}
  .drawer-foot{padding:11px 15px}

  .mobile-bottom{padding:6px 6px calc(7px + env(safe-area-inset-bottom))}
  .mobile-bottom button{gap:3px;padding:6px 2px;font-size:11px;line-height:1.15}
  .mobile-bottom button b{font-size:17px;line-height:1}
  .toast{font-size:13px;bottom:calc(84px + env(safe-area-inset-bottom));padding:11px 13px}
}


/* V5 — EL3ONORA-inspired visual system: light workspace + burgundy + dusty rose */
:root{
  --bg:#f7f2f3;
  --surface:#fffdfd;
  --surface-2:#fbf5f6;
  --ink:#251b1f;
  --muted:#776b70;
  --muted-2:#9b8e93;
  --line:#eadfe2;
  --line-strong:#dccdd2;
  --accent:#591126;
  --accent-strong:#430918;
  --accent-soft:#f1e3e8;
  --accent-ink:#591126;
  --rose:#db3d78;
  --rose-soft:#fae8ef;
  --green:#456b57;--green-soft:#e8f1eb;
  --amber:#8b642d;--amber-soft:#f7efdf;
  --blue:#5d5878;--blue-soft:#eceaf3;
  --danger:#9a404e;--danger-soft:#f6e7ea;
  --shadow:0 1px 2px rgba(55,12,29,.035),0 12px 32px rgba(66,20,36,.065);
}
::selection{background:#efd0dc;color:var(--accent-strong)}
body{background:linear-gradient(180deg,#faf7f7 0,#f7f2f3 280px,#f7f2f3 100%)}
.sidebar{background:#f2e9ec;border-right-color:#e3d5d9}
.logo-mark,.boot-mark{background:var(--accent);box-shadow:inset 0 0 0 1px rgba(255,255,255,.08)}
.logo-text{color:var(--accent-strong)}
.project-switch{background:rgba(255,253,253,.78);border-color:#ddcfd4}
.nav-btn:hover{background:rgba(255,255,255,.72)}
.nav-btn.active{background:#fff8fa;color:var(--accent-strong);box-shadow:inset 3px 0 0 var(--rose)}
.nav-btn.active .nav-icon{color:var(--rose)}
.nav-btn.active .stage-dot{background:var(--accent);border-color:var(--accent);color:#fff}
.stage-mini-progress{background:#e6d9dd}.stage-mini-progress i{background:var(--rose)}
.mobile-top{background:rgba(249,244,245,.94)!important;border-bottom-color:#e6dadd!important}
.mobile-brand .logo-mark{background:var(--accent)}
.mobile-project{color:var(--accent-strong)}
.btn{border-color:#dccfd3;background:#fffdfd}
.btn:hover{border-color:#cdb9c0;background:#fff9fb}
.btn.primary{background:var(--accent);border-color:var(--accent);color:#fff;box-shadow:0 6px 16px rgba(89,17,38,.13)}
.btn.primary:hover{background:var(--accent-strong);border-color:var(--accent-strong)}
.btn.ghost:hover{background:var(--rose-soft)}
.surface,.surface-flat{border-color:#e8dde0;background:rgba(255,253,253,.96)}
.surface{box-shadow:var(--shadow)}
.project-hero{position:relative;overflow:hidden}
.project-hero:before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:linear-gradient(180deg,var(--rose),var(--accent))}
.project-hero h2{color:var(--accent-strong)}
.bar{background:#eadde1}.bar i{background:linear-gradient(90deg,var(--accent),var(--rose))}
.focus-card{background:linear-gradient(135deg,var(--accent-strong) 0%,var(--accent) 62%,#701a38 100%);border-color:transparent;color:#fff;box-shadow:0 14px 34px rgba(70,9,27,.16)}
.focus-card .focus-num{background:rgba(255,255,255,.12);color:#fff;border:1px solid rgba(255,255,255,.15)}
.focus-card h3{color:#fff}.focus-card p{color:#eadce1}
.focus-card .btn.primary{background:#fff;color:var(--accent-strong);border-color:#fff;box-shadow:none}
.focus-card .btn.primary:hover{background:#fceef3;border-color:#fceef3}
.mini-stat{background:linear-gradient(180deg,#fffdfd,#fcf7f8)}
.mini-stat strong{color:var(--accent-strong)}
.route-row:hover{background:#fcf6f8}
.route-n{background:#f3e7eb;color:var(--accent);border:1px solid #ead8df}
.route-row:hover .route-n{background:var(--rose-soft);color:#a62759}
.stage-pill.active{border-color:#cda9b7;background:#faedf2;color:var(--accent-strong)}
.stage-pill.active b{background:var(--accent);color:#fff}
.stage-badge,.focus-num{background:var(--accent-soft);color:var(--accent)}
.method-link{color:#a52856}
.subtab.active{background:var(--accent);border-color:var(--accent);color:#fff}
.status-chip.method{background:var(--accent-soft);color:var(--accent)}
.status-chip.hyp{background:#f8eee4;color:#8a5a24}
.status-chip.decision{background:#eee9f4;color:#5b5275}
.records-toolbar{background:var(--bg)}
.record-card:hover{border-color:#d7bcc6;background:#fffafb}
.view-switch button.active{background:var(--accent);border-color:var(--accent);color:#fff}
.field:focus-within{background:#fff9fb}
.field input:focus,.field textarea:focus,.field select:focus{border-color:#bf7893;box-shadow:0 0 0 3px rgba(219,61,120,.09);outline:none}
.source-card:hover,.history-card:hover{border-color:#d9c3cb}
.assembly-row:hover{background:#fcf6f8}
.progress-ring{background:conic-gradient(var(--rose) var(--progress,0%),#eadde1 0)}
.project-row{transition:.14s ease}
.project-row:hover{border-color:#d8bfc8;background:#fff9fb;transform:translateY(-1px)}
.project-row h3{color:var(--accent-strong)}
.project-row .status-chip.method{background:#f3e6ea}
.drawer{border-left:1px solid #e2d3d8}
.drawer-head{background:#fffafb}
.drawer-foot{background:#fbf4f6}
.role-choice button.active.hyp{background:#f8eee4;color:#8a5a24;border-color:#e3c8a8}
.role-choice button.active.decision{background:#eee9f4;color:#5b5275;border-color:#d4cce0}
.mobile-bottom{background:rgba(253,249,250,.96)!important;border-top-color:#e4d7db!important;box-shadow:0 -10px 28px rgba(72,22,38,.05)}
.mobile-bottom button.active{color:var(--accent)}
.mobile-bottom button.active b{color:var(--rose)}
.toast{background:var(--accent-strong)}

/* Brand accent: a restrained pink line, echoing the source material without making the workspace loud */
.page-head h1,.stage-head h1{color:var(--accent-strong)}
.page-head-left:after{content:"";display:block;width:42px;height:3px;border-radius:999px;background:var(--rose);margin-top:10px;opacity:.9}
.stage-head{position:relative;overflow:hidden}
.stage-head:after{content:"";position:absolute;left:0;right:0;bottom:0;height:2px;background:linear-gradient(90deg,var(--rose),rgba(219,61,120,0) 58%)}

@media(max-width:760px){
  body{background:linear-gradient(180deg,#faf7f8 0,#f7f2f3 240px,#f7f2f3 100%)}
  .page-head-left:after{width:34px;height:3px;margin-top:9px}
  .focus-card{box-shadow:0 12px 28px rgba(70,9,27,.14)}
  .project-row:hover{transform:none}
  .route-row:active{background:#fbf1f4}
  .mobile-bottom button.active{font-weight:650}
}

/* V6 — stronger visual hierarchy + installable app identity */
:root{
  --wine-950:#320510;
  --wine-900:#430918;
  --wine-800:#591126;
  --wine-700:#711b36;
  --rose-500:#df3f7b;
  --rose-300:#f08aaf;
  --cream:#fff9f6;
}

/* Stronger branded header areas */
.mobile-top{
  background:linear-gradient(135deg,var(--wine-950) 0%,var(--wine-800) 68%,#7a2441 100%)!important;
  border-bottom-color:rgba(255,255,255,.08)!important;
  box-shadow:0 7px 22px rgba(62,6,24,.18);
}
.mobile-top .logo-mark{
  background:rgba(255,255,255,.12)!important;
  color:#fff;
  border:1px solid rgba(255,255,255,.18);
  box-shadow:none;
}
.mobile-project{color:#fff!important}
.mobile-project small{color:#ead1da!important}
.mobile-top .icon-btn{
  background:rgba(255,255,255,.10)!important;
  border-color:rgba(255,255,255,.22)!important;
  color:#fff!important;
}

.page-head{
  position:relative;
  background:linear-gradient(135deg,#fffdfd 0%,#fbf1f4 62%,#f7e8ed 100%);
  border:1px solid #ead8de;
  border-radius:18px;
  padding:17px 18px 18px;
  box-shadow:0 8px 24px rgba(68,9,28,.045);
  overflow:hidden;
}
.page-head:before{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:5px;
  background:linear-gradient(180deg,var(--rose-500),var(--wine-800));
}
.page-head .eyebrow{color:#9c365a}
.page-head-left:after{height:4px;background:linear-gradient(90deg,var(--rose-500),var(--rose-300));opacity:1}

/* Strong project identity block */
.project-hero{
  background:linear-gradient(135deg,var(--wine-950) 0%,var(--wine-800) 58%,#7b2443 100%);
  border-color:transparent;
  color:#fff;
  box-shadow:0 14px 32px rgba(65,7,25,.16);
}
.project-hero:before{width:6px;background:var(--rose-500)}
.project-hero h2{color:#fff}
.project-hero .project-meta{color:#eddce2}
.project-hero .hero-progress-top{color:#f0dfe5}
.project-hero .bar{background:rgba(255,255,255,.16)}
.project-hero .bar i{background:linear-gradient(90deg,#ff9cbd,#ff4f8b)}

/* Section headers behave as visual anchors */
.section-title h2{color:var(--wine-900);font-weight:800}
.section-title span{
  color:#8b6170;
  background:#f3e5ea;
  border:1px solid #ead6dd;
  border-radius:999px;
  padding:4px 8px;
}

/* Semantic data states use color intentionally */
.mini-stat{position:relative;overflow:hidden;border-width:1px}
.mini-stat:before{content:"";position:absolute;left:0;top:0;right:0;height:4px}
.mini-stat.fact-stat{background:linear-gradient(180deg,#fbfffc,#f1f8f3);border-color:#d8e8dd}
.mini-stat.fact-stat:before{background:#5d8b6e}
.mini-stat.fact-stat strong{color:#315b42}
.mini-stat.hyp-stat{background:linear-gradient(180deg,#fffdf8,#fbf3e5);border-color:#ead9bd}
.mini-stat.hyp-stat:before{background:#bb7c2d}
.mini-stat.hyp-stat strong{color:#80531f}
.mini-stat.decision-stat{background:linear-gradient(180deg,#fcfaff,#f2edf8);border-color:#dfd5ea}
.mini-stat.decision-stat:before{background:#766493}
.mini-stat.decision-stat strong{color:#57466f}

/* Route = main working structure */
.route{border-color:#dfcbd2;box-shadow:0 10px 28px rgba(62,8,26,.07)}
.route-row{position:relative;background:#fffdfd}
.route-row:nth-child(even){background:#fdf8fa}
.route-row.current{
  background:linear-gradient(90deg,#fbe9f0 0%,#fffafb 72%);
  box-shadow:inset 5px 0 0 var(--rose-500);
}
.route-row.current .route-n{
  background:linear-gradient(135deg,var(--wine-800),#8b2850);
  border-color:transparent;
  color:#fff;
  box-shadow:0 5px 12px rgba(89,17,38,.18);
}
.route-row.current .route-name{color:var(--wine-900)}
.route-row.done{background:linear-gradient(90deg,#f0f7f2,#fff 75%)}
.route-row.done .route-n{background:#dfeee4;color:#315b42;border-color:#c9dfd0}
.route-row .arrow{color:#b18d9a}

/* Stage workspace */
.stage-head{
  background:linear-gradient(135deg,#fffdfd 0%,#fbf0f4 100%);
  border-color:#e4ced6;
}
.stage-badge{
  background:linear-gradient(135deg,var(--wine-800),#8b2850)!important;
  color:#fff!important;
  box-shadow:0 6px 14px rgba(89,17,38,.16);
}
.stage-pill.active{
  background:linear-gradient(135deg,var(--wine-800),#7c2343);
  border-color:transparent;
  color:#fff;
  box-shadow:0 5px 12px rgba(89,17,38,.13);
}
.stage-pill.active b{background:rgba(255,255,255,.16);color:#fff}
.subtab.active{background:linear-gradient(135deg,var(--wine-800),#7f2345);box-shadow:0 5px 12px rgba(89,17,38,.12)}

/* Strategy page gets a clear visual core */
.strategy-summary{
  background:linear-gradient(135deg,var(--wine-950) 0%,var(--wine-800) 62%,#792140 100%);
  border-color:transparent;
  color:#fff;
  box-shadow:0 14px 32px rgba(65,7,25,.16);
}
.strategy-summary h2{color:#fff}
.strategy-summary p{color:#ead7df}
.progress-ring{background:conic-gradient(#ff6698 var(--p),rgba(255,255,255,.17) 0)!important}
.progress-ring:after{background:var(--wine-900)}
.progress-ring strong{color:#fff}
.assembly-list{border-color:#dfcbd2}
.assembly-row{position:relative;background:#fffdfd}
.assembly-row:nth-child(even){background:#fdf8fa}
.assembly-row:before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:#eadde2}
.assembly-row.state-ready:before{background:#5d8b6e}
.assembly-row.state-check:before{background:#d3973c}
.assembly-row.state-empty:before{background:#d8bdc7}
.assembly-num{background:#f1e2e8;color:var(--wine-800);border:1px solid #e3ccd5}
.assembly-row.state-ready .assembly-num{background:#e2f0e7;color:#315b42;border-color:#cfe2d5}
.assembly-row.state-check .assembly-num{background:#f9eddc;color:#80531f;border-color:#ead5b4}
.assembly-row select{background:#fffafc;border-color:#dbc7cf}

/* Project cards */
.project-row{
  border-color:#dfcbd2;
  background:linear-gradient(135deg,#fffdfd,#fbf3f6);
  box-shadow:0 8px 22px rgba(64,10,27,.055);
  position:relative;
  overflow:hidden;
}
.project-row:before{content:"";position:absolute;left:0;top:0;bottom:0;width:5px;background:linear-gradient(180deg,var(--rose-500),var(--wine-800))}
.project-row-meta .pct{color:var(--wine-800)}

/* Bottom navigation: stronger active state */
.mobile-bottom{background:rgba(255,250,252,.97)!important;box-shadow:0 -10px 30px rgba(68,9,28,.09)}
.mobile-bottom button{position:relative}
.mobile-bottom button.active{color:var(--wine-800)!important;font-weight:750}
.mobile-bottom button.active:before{
  content:"";
  position:absolute;
  top:-6px;
  width:28px;
  height:3px;
  border-radius:99px;
  background:linear-gradient(90deg,var(--rose-500),var(--wine-800));
}
.mobile-bottom button.active b{color:var(--rose-500)!important}

/* Source / history cards */
.source-card,.history-card{border-color:#e2d1d7}
.source-card:focus-within,.history-card:focus-within{border-color:#c98da3}

@media(max-width:760px){
  body{background:linear-gradient(180deg,#f7eff2 0,#faf6f7 195px,#f6f0f2 100%)}
  .main-inner{padding-top:16px}
  .page-head{padding:15px 14px 16px;margin-left:0;margin-right:0;border-radius:17px}
  .page-head:before{width:4px}
  .page-head h1{color:var(--wine-900)}
  .page-head p{color:#6f6066}
  .project-hero{border-radius:17px}
  .focus-card{border-radius:17px}
  .section-title{align-items:center}
  .section-title span{font-size:11px;padding:4px 7px;max-width:46%;text-align:right}
  .route-row.current{box-shadow:inset 4px 0 0 var(--rose-500)}
  .strategy-summary{border-radius:17px}
  .mobile-bottom button.active:before{top:-7px}
}

/* Reuse the accepted app icon as the in-product brand mark */
.logo-mark{
  background-image:url('/apple-touch-icon.png')!important;
  background-size:cover!important;
  background-position:center!important;
  color:transparent!important;
  border:0!important;
  box-shadow:0 4px 10px rgba(57,6,21,.16)!important;
}
.mobile-top .logo-mark{background-color:transparent!important}

/* V7 — clearer color architecture, compact safe header, readable content cards */
:root{
  --wine:#4a091b;
  --wine-deep:#31040f;
  --wine-mid:#6a1734;
  --pink:#ef5d98;
  --pink-bright:#ff79ad;
  --pink-soft:#ffe3ee;
  --milk:#fffaf6;
  --milk-2:#fffdfb;
  --paper:#ffffff;
  --warm-line:#ead8dd;
}

/* iPhone/PWA header: compact and never under the status bar */
@media(max-width:760px){
  .mobile-top{
    position:sticky;
    top:0;
    min-height:52px;
    height:auto;
    padding:8px 12px;
    padding-top:max(8px, env(safe-area-inset-top));
    background:linear-gradient(120deg,var(--wine-deep) 0%,var(--wine) 70%,#7c2446 100%)!important;
    align-items:center;
  }
  .mobile-brand{gap:9px}
  .mobile-top .logo-mark{width:31px;height:31px;border-radius:9px}
  .mobile-project{font-size:15px!important;line-height:1.05;font-weight:800;letter-spacing:.01em;color:#fff!important}
  .mobile-project small{display:none!important}
  .mobile-top .icon-btn{width:34px;height:34px;border-radius:11px}
  .main-inner{padding-top:12px}
  .records-toolbar{top:calc(52px + env(safe-area-inset-top));}
}

/* Long-reading surfaces are light. Strong color is reserved for structure and collapsed navigation. */
.task-panel,.field-group,.record-card,.context-card,.source-card,.history-card,.strategy-summary + .surface,
.stage-head,.project-row,.route,.surface:not(.focus-card):not(.project-hero):not(.strategy-summary){
  background:var(--milk-2);
}

/* Page intro: mostly light, with explicit wine + pink anchors */
.page-head{
  background:linear-gradient(135deg,var(--milk-2) 0%,#fff6f8 100%);
  border-color:#e8cfd8;
}
.page-head:before{background:linear-gradient(180deg,var(--pink),var(--wine-mid))}
.page-head .eyebrow{color:#aa315e}
.page-head-left:after{background:linear-gradient(90deg,var(--pink-bright),var(--pink));height:5px}

/* Project list cards: title card / collapsed state gets a wine ribbon */
.project-row{padding:0!important;display:block!important;background:var(--milk-2)!important;border-color:#e5cfd7!important;overflow:hidden}
.project-row:before{display:none!important}
.project-row > div:first-child{
  padding:14px 16px 12px;
  border-left:6px solid var(--wine-mid);
}
.project-row h3{font-size:18px!important;color:var(--wine-deep)!important;margin-bottom:6px!important}
.project-row p{font-size:14px!important;line-height:1.4!important;color:#6d5b61!important}
.project-row-meta{
  padding:10px 14px 11px;
  background:linear-gradient(90deg,var(--wine-deep),var(--wine-mid));
  color:#fff;
  justify-content:flex-end;
}
.project-row-meta .pct,.project-row-meta .arrow{color:#fff!important}
.project-row-meta .status-chip.method{background:var(--pink-soft)!important;color:#861940!important}

/* Overview: stronger section hierarchy */
.section-title h2{font-size:17px!important;color:var(--wine-deep)!important}
.section-title span{background:var(--pink-soft);border-color:#f3bfd1;color:#9b2853}

/* Route rows read like collapsed cards: dark title band + light detail */
.route{background:transparent!important;border:0!important;box-shadow:none!important;display:grid;gap:8px;overflow:visible}
.route-row{
  display:grid;
  grid-template-columns:34px minmax(0,1fr) 18px;
  gap:11px;
  padding:12px 13px;
  border:0!important;
  border-radius:14px;
  background:linear-gradient(100deg,var(--wine-deep),var(--wine-mid))!important;
  color:#fff;
  box-shadow:0 8px 18px rgba(67,9,24,.10);
}
.route-row:nth-child(even){background:linear-gradient(100deg,#4d0c20,#741c3e)!important}
.route-row .route-n{background:rgba(255,255,255,.13)!important;color:#fff!important;border:1px solid rgba(255,255,255,.13)!important}
.route-row .route-name{color:#fff!important;font-size:14px!important;font-weight:760}
.route-row .route-sub{color:#f3dce4!important;font-size:12px!important}
.route-row .arrow{color:var(--pink-bright)!important;font-size:22px}
.route-row.current{
  background:linear-gradient(105deg,#7f1944 0%,#a3295c 70%,var(--pink) 130%)!important;
  box-shadow:0 10px 24px rgba(126,25,68,.20),inset 0 0 0 1px rgba(255,255,255,.10)!important;
}
.route-row.current .route-n{background:#fff!important;color:var(--wine-mid)!important}
.route-row.done{background:linear-gradient(100deg,#315a45,#4f8066)!important}
.route-row.done .route-sub{color:#e4f3ea!important}
.route-progress{display:none!important}

/* Horizontal stage switcher: wine cards, bright pink active */
.stage-strip{gap:8px}
.stage-pill{
  background:var(--wine)!important;
  border-color:var(--wine)!important;
  color:#fff!important;
  border-radius:12px;
  padding:9px 12px;
  box-shadow:0 5px 12px rgba(67,9,24,.09);
}
.stage-pill b{background:rgba(255,255,255,.12)!important;color:#fff!important}
.stage-pill.active{
  background:linear-gradient(105deg,#c52f6a,var(--pink))!important;
  border-color:transparent!important;
  box-shadow:0 7px 16px rgba(223,63,123,.22)!important;
}
.stage-pill.active b{background:#fff!important;color:#ad2a5b!important}

/* Stage summary: full-width copy; method link no longer steals the right column */
.stage-head{
  background:var(--milk)!important;
  border:1px solid #e8cfd7!important;
  padding:16px!important;
  border-radius:18px!important;
}
.stage-head:after{height:4px;background:linear-gradient(90deg,var(--pink-bright),var(--pink),rgba(239,93,152,0) 70%)}
.stage-head-main{display:grid;grid-template-columns:48px minmax(0,1fr);gap:13px;align-items:start}
.stage-badge{
  width:48px!important;height:48px!important;border-radius:14px!important;
  background:linear-gradient(145deg,var(--wine-deep),var(--wine-mid))!important;
  color:#fff!important;font-size:20px;
}
.stage-copy{min-width:0}
.stage-copy h1{font-size:24px!important;line-height:1.08!important;margin:2px 0 8px!important;color:var(--wine-deep)!important}
.stage-copy p{font-size:15px!important;line-height:1.48!important;color:#6d5c62!important;margin:0!important;max-width:720px}
.stage-head-foot{display:flex;align-items:center;gap:12px;margin-top:15px;padding-top:13px;border-top:1px solid #efdee4}
.stage-progress-wrap{display:flex;align-items:center;gap:9px;flex:1;min-width:0}
.stage-progress-wrap .bar{flex:1;height:7px;background:#f0dce4}
.stage-progress-wrap .bar i{background:linear-gradient(90deg,var(--pink),var(--pink-bright))}
.stage-progress-wrap span{font-size:12px;color:#9a4967;font-weight:750;min-width:30px;text-align:right}
.method-link{
  flex:none;
  padding:7px 10px!important;
  border-radius:999px!important;
  background:var(--pink-soft)!important;
  color:#9f2653!important;
  font-size:12px!important;
}
.method-box{background:#fff;border:1px solid #edd7df;border-radius:12px;padding:12px!important;margin-top:12px!important;color:#6b5960!important}

/* Sub-sections: collapsed names are wine; current one pink */
.subtabs{gap:8px;margin:12px 0 11px}
.subtab{
  background:var(--wine)!important;
  color:#fff!important;
  border:0!important;
  border-radius:12px!important;
  padding:10px 13px!important;
  font-size:13px!important;
  box-shadow:0 4px 10px rgba(67,9,24,.08);
}
.subtab.active{
  background:linear-gradient(105deg,#c72e6c,var(--pink))!important;
  box-shadow:0 6px 14px rgba(223,63,123,.20)!important;
}

/* Reading/data blocks: white or milk, no heavy tint */
.task-panel,.record-card,.field-group,.context-card,.source-card,.history-card{
  background:#fff!important;
  border-color:#e9dfe2!important;
}
.task-panel-head{
  margin:-14px -14px 12px;
  padding:11px 14px;
  background:linear-gradient(100deg,var(--wine-deep),var(--wine-mid));
  color:#fff;
  border-radius:14px 14px 0 0;
}
.task-panel-head h2{color:#fff!important}
.task-panel-head .meta{color:#f5dce5!important}
.record-card{box-shadow:0 6px 16px rgba(57,7,21,.045)}
.field label{color:#745f67!important}
.field input,.field textarea,.field select{background:#fffdfb}

/* Buttons and controls: use the pink/rose accent more visibly */
.btn.primary{
  background:linear-gradient(105deg,var(--wine-mid),#8d2350)!important;
  border-color:transparent!important;
}
.btn.primary:hover{background:linear-gradient(105deg,#821f49,var(--pink))!important}
.view-switch button.active{background:var(--pink)!important;border-color:var(--pink)!important}
.status-chip.method{background:var(--pink-soft)!important;color:#a12958!important}

/* Strategy screen */
.strategy-summary{background:linear-gradient(110deg,var(--wine-deep),var(--wine-mid) 65%,#8f2a52 100%)!important}
.progress-ring{background:conic-gradient(var(--pink-bright) var(--p),rgba(255,255,255,.16) 0)!important}
.assembly-row{background:#fff!important}
.assembly-row:nth-child(even){background:var(--milk)!important}

/* Bottom navigation: stronger but calm */
.mobile-bottom button.active b{color:var(--pink)!important}
.mobile-bottom button.active:before{background:linear-gradient(90deg,var(--pink-bright),var(--pink))!important}

@media(max-width:760px){
  .page-head{margin-top:0}
  .page-head h1{font-size:28px!important}
  .page-head p{font-size:15px!important}
  .stage-head-main{grid-template-columns:44px minmax(0,1fr);gap:12px}
  .stage-badge{width:44px!important;height:44px!important;font-size:18px}
  .stage-copy h1{font-size:22px!important}
  .stage-copy p{font-size:15px!important}
  .stage-head-foot{align-items:center}
  .method-link{font-size:11px!important;padding:6px 8px!important}
  .route-row{padding:13px 14px!important}
  .route-name{font-size:15px!important;white-space:normal!important;line-height:1.25}
  .route-sub{font-size:12px!important}
  .subtab{font-size:13px!important}
  .task-panel-head{margin:-13px -13px 12px;padding:11px 13px}
}

/* V7 final polish — dark structural headers, light reading bodies */
.field-group{
  background:#fff!important;
  border-color:#ead9df!important;
  box-shadow:0 5px 14px rgba(57,7,21,.035);
}
.field-group-head{
  background:linear-gradient(100deg,var(--wine-deep),var(--wine-mid))!important;
  border-bottom:0!important;
  padding:11px 13px!important;
}
.field-group-head h3{color:#fff!important;font-size:14px!important;font-weight:780}
.field-group-head p{color:#f0dce4!important}
.fields{background:#fff}
.focus-card .btn.primary{
  background:linear-gradient(100deg,var(--pink),var(--pink-bright))!important;
  color:var(--wine-deep)!important;
  border:0!important;
  font-weight:800;
  box-shadow:0 6px 16px rgba(239,93,152,.20)!important;
}
.focus-card .btn.primary:hover{background:linear-gradient(100deg,var(--pink-bright),#ff9fc4)!important;color:var(--wine-deep)!important}

@media(max-width:760px){
  .field-group-head{padding:11px 12px!important}
  .field-group-head h3{font-size:14px!important}
}

/* V8 — wine canvas + light overview cards, compact stage workspace, real tabs */
:root{
  --v8-wine:#4a091b;
  --v8-wine-deep:#31040f;
  --v8-wine-mid:#6a1734;
  --v8-rose:#ef5d98;
  --v8-rose-bright:#ff79ad;
  --v8-rose-pale:#ffe3ee;
  --v8-milk:#fffaf6;
  --v8-paper:#fffdfb;
}

/* Overview: the page itself is the wine canvas; content cards become readable light islands. */
.main.screen-overview{
  background:
    radial-gradient(circle at 88% 9%,rgba(239,93,152,.20),transparent 28%),
    linear-gradient(155deg,var(--v8-wine-deep) 0%,var(--v8-wine) 46%,#67162f 100%);
  min-height:100vh;
}
.screen-overview .main-inner{position:relative}
.screen-overview .page-head,
.screen-overview .project-hero,
.screen-overview .focus-card,
.screen-overview .mini-stat,
.screen-overview .route-row{
  background:var(--v8-milk)!important;
  border:1px solid rgba(255,255,255,.28)!important;
  color:var(--v8-wine-deep)!important;
  box-shadow:0 10px 26px rgba(25,0,8,.16)!important;
}
.screen-overview .page-head:before{background:linear-gradient(180deg,var(--v8-rose-bright),var(--v8-rose))!important}
.screen-overview .page-head .eyebrow{color:#b12d61!important}
.screen-overview .page-head h1{color:var(--v8-wine-deep)!important}
.screen-overview .page-head p{color:#705e65!important}
.screen-overview .project-hero:before{background:linear-gradient(180deg,var(--v8-rose-bright),var(--v8-wine-mid))!important}
.screen-overview .project-hero h2{color:var(--v8-wine-deep)!important}
.screen-overview .project-hero .project-meta,
.screen-overview .project-hero .hero-progress-top{color:#79666d!important}
.screen-overview .project-hero .bar{background:#f1dfe6!important}
.screen-overview .project-hero .bar i{background:linear-gradient(90deg,var(--v8-rose),var(--v8-rose-bright))!important}
.screen-overview .focus-card{grid-template-columns:46px minmax(0,1fr) auto!important}
.screen-overview .focus-num{
  background:transparent!important;
  color:var(--v8-wine-mid)!important;
  border:2px solid var(--v8-wine-mid)!important;
  box-shadow:none!important;
}
.screen-overview .focus-card h3{color:var(--v8-rose)!important;font-weight:820}
.screen-overview .focus-card p{color:#6e5b62!important}
.screen-overview .focus-card .btn.primary{
  background:linear-gradient(100deg,var(--v8-rose),var(--v8-rose-bright))!important;
  color:var(--v8-wine-deep)!important;
  box-shadow:none!important;
}
.screen-overview .section-title h2{color:#fff7f9!important}
.screen-overview .section-title span{
  color:#ffd5e4!important;
  background:rgba(255,255,255,.09)!important;
  border-color:rgba(255,255,255,.14)!important;
}
.screen-overview .mini-stat{background:var(--v8-paper)!important}
.screen-overview .route{display:grid;gap:8px;background:transparent!important;border:0!important;box-shadow:none!important}
.screen-overview .route-row,
.screen-overview .route-row:nth-child(even),
.screen-overview .route-row.done,
.screen-overview .route-row.current{
  grid-template-columns:36px minmax(0,1fr) 18px!important;
  padding:11px 13px!important;
  border-radius:14px!important;
  background:var(--v8-paper)!important;
  box-shadow:0 8px 20px rgba(28,0,9,.12)!important;
}
.screen-overview .route-row.current{
  border-color:#ffbdd5!important;
  box-shadow:0 9px 22px rgba(28,0,9,.15),inset 4px 0 0 var(--v8-rose)!important;
}
.screen-overview .route-row .route-n,
.screen-overview .route-row.current .route-n,
.screen-overview .route-row.done .route-n{
  background:transparent!important;
  color:var(--v8-wine-mid)!important;
  border:1.5px solid var(--v8-wine-mid)!important;
  box-shadow:none!important;
}
.screen-overview .route-row.current .route-n{border-color:var(--v8-rose)!important;color:var(--v8-rose)!important}
.screen-overview .route-row .route-name,
.screen-overview .route-row.current .route-name,
.screen-overview .route-row.done .route-name{color:var(--v8-rose)!important}
.screen-overview .route-row .route-sub,
.screen-overview .route-row.current .route-sub,
.screen-overview .route-row.done .route-sub{color:#77656c!important}
.screen-overview .route-row .arrow{color:var(--v8-wine-mid)!important}

/* Stage selector = true tabs instead of filled buttons. */
.stage-strip{
  gap:2px!important;
  padding:0 0 1px!important;
  margin:0 0 10px!important;
  border-bottom:1px solid #e6cfd8;
  scroll-behavior:auto;
}
.stage-pill,
.stage-pill.active{
  position:relative;
  flex:0 0 auto;
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  color:#8b6e78!important;
  padding:8px 10px 10px!important;
  gap:6px!important;
  font-size:12px!important;
  font-weight:680!important;
}
.stage-pill b,
.stage-pill.active b{
  width:23px!important;height:23px!important;
  border-radius:50%!important;
  background:transparent!important;
  border:1px solid #caaab6!important;
  color:var(--v8-wine-mid)!important;
  font-size:10px!important;
}
.stage-pill.active{color:var(--v8-wine-deep)!important;font-weight:820!important}
.stage-pill.active b{border-color:var(--v8-rose)!important;color:var(--v8-rose)!important;background:#fff6f9!important}
.stage-pill.active:after{
  content:"";
  position:absolute;
  left:10px;right:10px;bottom:-1px;
  height:3px;border-radius:99px 99px 0 0;
  background:linear-gradient(90deg,var(--v8-rose),var(--v8-rose-bright));
}

/* Secondary collections are tabs too, not large pink/dark pills. */
.subtabs{
  gap:3px!important;
  margin:4px 0 12px!important;
  padding:0 2px!important;
  border-bottom:1px solid #ead5dd;
}
.subtab,
.subtab.active{
  position:relative;
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  color:#887079!important;
  padding:9px 10px 10px!important;
  font-size:13px!important;
  font-weight:700!important;
}
.subtab.active{color:var(--v8-wine-deep)!important;font-weight:820!important}
.subtab.active:after{
  content:"";
  position:absolute;left:8px;right:8px;bottom:-1px;height:3px;border-radius:99px 99px 0 0;
  background:var(--v8-rose);
}

/* Compact stage summary — keep the good layout, remove unnecessary mass. */
.stage-head{padding:12px 13px!important;border-radius:16px!important;margin-bottom:8px!important}
.stage-head-main{grid-template-columns:38px minmax(0,1fr)!important;gap:11px!important}
.stage-badge{
  width:38px!important;height:38px!important;border-radius:11px!important;
  font-size:16px!important;
  background:var(--v8-paper)!important;
  color:var(--v8-wine-mid)!important;
  border:2px solid var(--v8-wine-mid)!important;
  box-shadow:none!important;
}
.stage-copy h1{font-size:20px!important;line-height:1.12!important;margin:0 0 5px!important;color:var(--v8-wine-deep)!important}
.stage-copy p{font-size:13px!important;line-height:1.42!important;color:#6f5f65!important}
.stage-head-foot{margin-top:10px!important;padding-top:9px!important;gap:9px!important}
.stage-progress-wrap .bar{height:5px!important}
.method-link{font-size:11px!important;padding:5px 8px!important}

/* Cleaner records area. No rough rectangular header and no meaningless mobile view icons. */
.task-panel{padding:13px!important;border-radius:17px!important;overflow:hidden}
.records-toolbar{
  position:static!important;
  top:auto!important;
  background:transparent!important;
  margin:0 0 10px!important;
  padding:0 0 10px!important;
  border-bottom:1px solid #eee0e5;
}
.records-title{display:flex;align-items:baseline;gap:8px;min-width:0}
.records-title strong{font-size:14px;color:var(--v8-wine-deep)}
.records-title span{font-size:11px;color:#8a757c}
.records-actions{display:flex;gap:7px;align-items:center;flex:none}
.view-switch{background:#faf2f5!important;border-color:#e8d5dc!important;padding:3px!important}
.view-switch button{display:inline-flex;align-items:center;gap:5px;font-size:10px!important;padding:6px 8px!important;color:#7d6870}
.view-switch button.active{background:#fff!important;color:var(--v8-wine-mid)!important;box-shadow:0 1px 5px rgba(62,5,23,.08)!important}
.empty-icon{background:#fff2f7!important;color:var(--v8-rose)!important;border:1px solid #f4d3df}

@media(max-width:760px){
  .main.screen-overview{background:linear-gradient(155deg,var(--v8-wine-deep) 0%,var(--v8-wine) 52%,#65142f 100%)!important}
  .screen-overview .main-inner{padding-top:12px!important}
  .screen-overview .page-head{margin-bottom:12px!important}
  .screen-overview .focus-card{grid-template-columns:38px minmax(0,1fr)!important;padding:12px 13px!important}
  .screen-overview .focus-num{width:34px!important;height:34px!important;border-radius:10px!important}
  .screen-overview .focus-card h3{font-size:16px!important}
  .screen-overview .focus-card p{font-size:13px!important}
  .screen-overview .focus-card .btn{grid-column:1/-1;width:100%;margin-top:1px}
  .screen-overview .route-row,
  .screen-overview .route-row:nth-child(even),
  .screen-overview .route-row.done,
  .screen-overview .route-row.current{padding:10px 12px!important}
  .screen-overview .route-name{font-size:14px!important;line-height:1.23!important}
  .screen-overview .route-sub{font-size:11px!important}

  .stage-strip{margin-left:-1px!important;margin-right:-1px!important}
  .stage-pill,.stage-pill.active{padding:7px 9px 9px!important;font-size:11px!important}
  .stage-pill b,.stage-pill.active b{width:21px!important;height:21px!important;font-size:9px!important}
  .stage-pill span{max-width:190px;overflow:hidden;text-overflow:ellipsis}
  .stage-head{padding:11px 12px!important}
  .stage-head-main{grid-template-columns:36px minmax(0,1fr)!important;gap:10px!important}
  .stage-badge{width:36px!important;height:36px!important;font-size:15px!important}
  .stage-copy h1{font-size:19px!important}
  .stage-copy p{font-size:13px!important;line-height:1.4!important}
  .stage-head-foot{margin-top:9px!important;padding-top:8px!important}
  .subtabs{margin-top:2px!important}
  .subtab,.subtab.active{font-size:12px!important;padding:8px 9px 9px!important}
  .records-toolbar{gap:10px!important;align-items:center!important}
  .records-title{display:grid;gap:1px}
  .records-title strong{font-size:14px}
  .records-title span{font-size:11px}
  .records-actions .btn{min-height:36px;padding:7px 11px!important}
}
/* V8 contrast correction: bright pink stays an accent; text uses a deeper rose for readability. */
:root{--v8-rose-text:#c52f6a}
.screen-overview .focus-card h3,
.screen-overview .route-row .route-name,
.screen-overview .route-row.current .route-name,
.screen-overview .route-row.done .route-name{color:var(--v8-rose-text)!important}

/* =========================================================
   V9 — approved MARKETING LAB visual system
   Burgundy workspace + milk cards + pink focus + gold detail.
   Applied consistently to Overview, Stages, Strategy, Sources,
   Projects and More without changing the stored data model.
   ========================================================= */
:root{
  --lab-wine-1000:#30020f;
  --lab-wine-950:#3b0415;
  --lab-wine-900:#4a061b;
  --lab-wine-850:#560922;
  --lab-wine-800:#650d2c;
  --lab-wine-700:#801740;
  --lab-pink:#ec226b;
  --lab-pink-2:#ff5d99;
  --lab-pink-soft:#ffe0eb;
  --lab-pink-pale:#fff0f5;
  --lab-gold:#c99832;
  --lab-gold-2:#e5bd5d;
  --lab-gold-soft:#fff2cf;
  --lab-milk:#fff9f5;
  --lab-milk-2:#fff4ef;
  --lab-paper:#fffdfb;
  --lab-ink:#4c0a20;
  --lab-text:#4f4145;
  --lab-muted:#7b6970;
  --lab-line:#ead8d8;
  --lab-shadow:0 10px 26px rgba(37,0,12,.16);
}
.ui-icon{width:1.25em;height:1.25em;display:block;overflow:visible}

/* Base workspace */
body{background:var(--lab-wine-950)}
.main{
  min-height:100vh;
  background:
    radial-gradient(900px 420px at 84% 3%,rgba(239,34,107,.18),transparent 48%),
    linear-gradient(150deg,var(--lab-wine-1000) 0%,var(--lab-wine-900) 48%,#6b0c31 100%);
  color:var(--lab-milk);
}
.main-inner{position:relative}
.surface,.surface-flat{
  background:linear-gradient(145deg,var(--lab-paper),var(--lab-milk))!important;
  border-color:rgba(116,32,57,.16)!important;
  box-shadow:var(--lab-shadow);
  color:var(--lab-ink);
}
.section-title h2{color:#fff!important}
.section-title span{color:#efdce2!important;background:transparent!important;border:0!important;padding:0!important}
.section-title-on-wine span.gold-outline,.gold-outline{
  color:var(--lab-gold-2)!important;
  border:1px solid rgba(229,189,93,.85)!important;
  background:rgba(91,9,36,.38)!important;
  padding:5px 10px!important;
  border-radius:999px!important;
}
.arrow{color:var(--lab-gold)!important;font-size:20px}

/* Buttons */
.btn{border-color:#e4d2d3;background:var(--lab-paper);color:var(--lab-ink)}
.btn.primary{
  background:linear-gradient(100deg,var(--lab-pink),var(--lab-pink-2))!important;
  border-color:transparent!important;
  color:#fff!important;
  box-shadow:0 7px 18px rgba(236,34,107,.24)!important;
}
.btn.primary .ui-icon{color:#fff}
.btn.gold-btn,.gold-btn{
  background:rgba(255,250,245,.08)!important;
  border:1px solid var(--lab-gold-2)!important;
  color:var(--lab-gold-2)!important;
}
.icon-btn{display:grid;place-items:center}

/* Desktop rail adopts the same visual language */
.sidebar{
  background:linear-gradient(180deg,var(--lab-wine-1000),var(--lab-wine-850));
  border-right-color:rgba(255,255,255,.08);
  color:#fff;
}
.sidebar .logo-mark{background-image:none!important;background:transparent!important;border:1.5px solid var(--lab-gold-2)!important;color:var(--lab-gold-2)!important;box-shadow:none!important}
.sidebar .logo-text{color:#fff}.sidebar .logo-sub,.sidebar .nav-label,.sidebar-foot{color:#dcbfc8}
.sidebar .project-switch{background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.14);color:#fff}
.sidebar .project-switch small,.sidebar .chev{color:#dcbfc8}
.sidebar .nav-btn{color:#eadde1}.sidebar .nav-btn:hover,.sidebar .nav-btn.active{background:rgba(255,255,255,.10)}
.sidebar .nav-btn.active .nav-icon{color:var(--lab-gold-2)}
.sidebar .stage-dot{background:transparent;border-color:rgba(255,255,255,.28);color:#fff}
.sidebar .nav-btn.active .stage-dot{background:var(--lab-pink);border-color:var(--lab-pink)}
.sidebar .stage-mini-progress{background:rgba(255,255,255,.14)}.sidebar .stage-mini-progress i{background:var(--lab-gold-2)}

/* Mobile brand header */
.mobile-top{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
}
.mobile-brand{
  border:0;background:transparent;padding:0;margin:0;display:flex;align-items:center;gap:12px;text-align:left;min-width:0;color:#fff;
}
.mobile-top .logo-mark{
  background-image:none!important;
  background:rgba(74,6,27,.55)!important;
  border:1.5px solid var(--lab-gold-2)!important;
  color:var(--lab-gold-2)!important;
  box-shadow:0 4px 14px rgba(0,0,0,.12)!important;
  font-size:13px!important;font-weight:800;
}
.mobile-brand-copy{min-width:0}.mobile-project{color:#fff!important}.mobile-sub{color:var(--lab-gold-2);font-size:9px;font-weight:700;letter-spacing:.28em;margin-top:3px;white-space:nowrap}
.project-grid-btn{background:rgba(255,255,255,.07)!important;border-color:rgba(255,255,255,.25)!important;color:#fff!important}
.project-grid-btn .ui-icon{width:19px;height:19px}

/* Generic page introduction */
.page-head{
  background:linear-gradient(145deg,var(--lab-paper),var(--lab-milk-2))!important;
  border-color:rgba(116,32,57,.14)!important;
  box-shadow:var(--lab-shadow)!important;
  color:var(--lab-ink);
}
.page-head:before{background:linear-gradient(180deg,var(--lab-pink-2),var(--lab-pink))!important}
.page-head .eyebrow{color:#bb3162!important}.page-head h1{color:var(--lab-ink)!important}.page-head p{color:var(--lab-muted)!important}.page-head-left:after{background:var(--lab-pink-2)!important}

/* Projects list */
.project-row{
  background:linear-gradient(145deg,var(--lab-paper),var(--lab-milk))!important;
  border-color:rgba(116,32,57,.15)!important;
  color:var(--lab-ink)!important;
  box-shadow:var(--lab-shadow)!important;
}
.project-row h3{color:var(--lab-ink)!important}.project-row p{color:var(--lab-muted)!important}
.project-row-meta{background:linear-gradient(100deg,var(--lab-wine-900),var(--lab-wine-700))!important}
.project-row-meta .pct,.project-row-meta .arrow{color:#fff!important}.project-row .status-chip.method{background:var(--lab-pink-soft)!important;color:#8f1c45!important}
.mobile-project-actions .btn:not(.primary){background:transparent;color:var(--lab-gold-2);border-color:var(--lab-gold-2)}

/* Overview */
.overview-project-card{
  display:grid!important;
  grid-template-columns:58px minmax(0,1fr)!important;
  gap:15px!important;
  padding:18px!important;
  color:var(--lab-ink)!important;
}
.overview-project-icon{
  width:54px;height:54px;border-radius:15px;display:grid;place-items:center;color:var(--lab-pink);
  background:linear-gradient(145deg,#fff5f8,#ffe5ed);border:1px solid #f4d4df;box-shadow:0 7px 18px rgba(90,8,35,.08)
}
.overview-project-icon .ui-icon{width:27px;height:27px}
.overview-project-copy{min-width:0}.overview-project-top{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.overview-project-top h2{font-size:21px!important;margin:0;color:var(--lab-ink)!important}.overview-project-state{display:flex;align-items:center;gap:10px;flex:none}.overview-project-state b{font-size:18px;color:var(--lab-wine-800)}
.overview-project-card p{font-size:13px;line-height:1.4;color:var(--lab-muted);margin:4px 0 12px}.overview-project-card .bar{height:6px;background:#f0d9e1}.overview-project-card .bar i{background:linear-gradient(90deg,var(--lab-pink),var(--lab-pink-2))}
.status-chip.method{background:var(--lab-pink-soft)!important;color:#9d1e4c!important;border:0!important}
.focus-card{
  background:linear-gradient(135deg,var(--lab-paper) 0%,#fff8f6 68%,#ffeaf1 100%)!important;
  border-color:rgba(116,32,57,.14)!important;
  color:var(--lab-ink)!important;position:relative;overflow:hidden;
}
.focus-card:after{content:"";position:absolute;right:-38px;bottom:-55px;width:150px;height:150px;border-radius:50%;border:24px solid rgba(255,93,153,.08);pointer-events:none}
.focus-num{background:transparent!important;border:1.5px solid var(--lab-pink)!important;color:var(--lab-pink)!important;box-shadow:none!important}
.focus-card h3{color:#be265e!important}.focus-card p{color:var(--lab-text)!important}
.attention-row .mini-stat{box-shadow:0 8px 18px rgba(28,0,9,.13)!important;background:var(--lab-paper)!important}

/* Strategy route is a single calm cream stack */
.route{display:block!important;background:linear-gradient(145deg,var(--lab-paper),var(--lab-milk))!important;border:1px solid rgba(116,32,57,.14)!important;box-shadow:var(--lab-shadow)!important;overflow:hidden!important}
.route-row,.route-row:nth-child(even),.route-row.done,.route-row.current{
  background:transparent!important;box-shadow:none!important;border:0!important;border-bottom:1px solid #eadbdc!important;border-radius:0!important;color:var(--lab-ink)!important;
}
.route-row:last-child{border-bottom:0!important}.route-row.current{background:linear-gradient(90deg,#fff0f5,#fff9f7)!important;box-shadow:inset 5px 0 0 var(--lab-pink)!important}
.route-row .route-n,.route-row.done .route-n,.route-row.current .route-n{background:transparent!important;border:1.5px solid var(--lab-wine-700)!important;color:var(--lab-wine-700)!important;box-shadow:none!important}
.route-row.current .route-n{background:var(--lab-pink-soft)!important;border-color:var(--lab-pink)!important;color:var(--lab-pink)!important}
.route-row .route-name,.route-row.done .route-name,.route-row.current .route-name{color:var(--lab-ink)!important}.route-row.current .route-name{color:#be265e!important}.route-row .route-sub{color:var(--lab-muted)!important}.route-row .route-progress .bar{background:#efdde3}.route-row .route-progress .bar i{background:var(--lab-pink)}

/* Stage navigation: slim tabs with readable active state */
.stage-strip{border-bottom:1px solid rgba(255,255,255,.16)!important;margin-top:2px!important}
.stage-pill,.stage-pill.active{color:#ddc7ce!important;background:transparent!important;border:0!important;box-shadow:none!important}
.stage-pill b,.stage-pill.active b{background:transparent!important;border:0!important;color:inherit!important;width:auto!important;height:auto!important;border-radius:0!important;font-size:12px!important}
.stage-pill span{font-size:11px}.stage-pill.active{color:#fff!important;font-weight:800!important}.stage-pill.active b{color:var(--lab-gold-2)!important}.stage-pill.active:after{background:linear-gradient(90deg,var(--lab-gold-2),var(--lab-pink-2))!important;height:4px!important}
.stage-head{background:linear-gradient(145deg,var(--lab-paper),var(--lab-milk))!important;border-color:rgba(116,32,57,.14)!important;color:var(--lab-ink)!important;box-shadow:var(--lab-shadow)!important}
.stage-badge{background:linear-gradient(145deg,#ffd0df,#ffb6cf)!important;border:1px solid #f398ba!important;color:#b31e56!important;box-shadow:0 6px 14px rgba(176,30,85,.12)!important}
.stage-copy h1{color:var(--lab-ink)!important}.stage-copy p{color:var(--lab-text)!important}.stage-progress-wrap .bar{background:#f0dae2}.stage-progress-wrap .bar i{background:linear-gradient(90deg,var(--lab-pink),var(--lab-pink-2))}.stage-progress-wrap span{color:var(--lab-ink)!important}.method-link{color:var(--lab-gold)!important;border:1px solid rgba(201,152,50,.55)!important;border-radius:999px;padding:5px 9px!important}
.method-box{color:var(--lab-muted)!important;border-top-color:#ead9dc!important}
.subtabs{border-bottom:1px solid rgba(255,255,255,.16)!important}.subtab,.subtab.active{color:#d9c3ca!important}.subtab.active{color:#fff!important}.subtab.active:after{background:linear-gradient(90deg,var(--lab-gold-2),var(--lab-pink))!important}
.task-panel{background:linear-gradient(145deg,var(--lab-paper),var(--lab-milk))!important;border-color:rgba(116,32,57,.14)!important;box-shadow:var(--lab-shadow)!important}
.records-toolbar{border-bottom-color:#eddde0!important}.records-title strong{color:var(--lab-ink)!important}.records-title span{color:var(--lab-muted)!important}.record-card{background:var(--lab-paper)!important;border-color:#eadadd!important}.record-card-title{color:var(--lab-ink)!important}.record-card-sub{color:var(--lab-muted)!important}.record-card:hover{background:#fff5f8!important;border-color:#e9b9c9!important}
.field-group{background:var(--lab-paper)!important;border-color:#eadadd!important}.field-group-head{background:transparent!important;padding:13px 14px 7px!important;border-bottom:0!important}.field-group-head h3{display:inline-flex;background:linear-gradient(105deg,var(--lab-wine-900),var(--lab-wine-700));color:#fff!important;border-radius:10px;padding:7px 11px;font-size:14px!important;box-shadow:0 5px 12px rgba(58,3,20,.11)}.field-group-head h3:before{content:"◆";color:var(--lab-gold-2);font-size:8px;margin-right:8px;align-self:center}.field{border-color:#eee1e2!important}.field label{color:#826c73!important}.field textarea,.field input,.field select{color:var(--lab-ink)!important}.field:focus-within{background:#fff6f9!important;box-shadow:inset 3px 0 var(--lab-pink)!important}
.context-card{background:var(--lab-paper)!important}

/* Strategy */
.strategy-summary{background:linear-gradient(145deg,var(--lab-paper),var(--lab-milk))!important;border-color:rgba(116,32,57,.14)!important;color:var(--lab-ink)!important;box-shadow:var(--lab-shadow)!important}.strategy-summary h2{color:var(--lab-ink)!important;font-size:19px!important}.strategy-summary p{color:var(--lab-muted)!important}.progress-ring{background:conic-gradient(var(--lab-pink) var(--p),#f0dce3 0)!important}.progress-ring:after{background:var(--lab-paper)!important}.progress-ring strong{color:var(--lab-ink)!important}.assembly-list{background:linear-gradient(145deg,var(--lab-paper),var(--lab-milk))!important;border-color:rgba(116,32,57,.14)!important}.assembly-row,.assembly-row:nth-child(even){background:transparent!important;border-bottom-color:#eadbdc!important}.assembly-row:before{background:var(--lab-pink-soft)!important}.assembly-num{background:transparent!important;border:1.5px solid var(--lab-wine-700)!important;color:var(--lab-wine-700)!important}.assembly-name{color:var(--lab-ink)!important}.assembly-map{color:var(--lab-muted)!important}.assembly-row select{background:var(--lab-pink-soft)!important;border-color:transparent!important;color:#9a214d!important}.strategy-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}

/* Sources */
.source-tools{display:grid;gap:10px;margin-bottom:12px}.source-search{height:46px;display:flex;align-items:center;gap:10px;background:linear-gradient(145deg,var(--lab-paper),var(--lab-milk));border:1px solid rgba(116,32,57,.14);border-radius:14px;padding:0 14px;color:var(--lab-wine-700);box-shadow:var(--lab-shadow)}.source-search .ui-icon{width:20px;height:20px}.source-search input{border:0;outline:0;background:transparent;width:100%;font-size:14px;color:var(--lab-ink)}.source-search input::placeholder{color:#a18d93}.source-filters{display:flex;gap:7px;overflow:auto;scrollbar-width:none}.source-filters::-webkit-scrollbar{display:none}.source-filters button{border:1px solid var(--lab-gold-2);background:rgba(78,6,28,.22);color:var(--lab-gold-2);border-radius:999px;padding:8px 14px;white-space:nowrap;font-weight:700}.source-filters button.active{background:linear-gradient(100deg,var(--lab-pink),var(--lab-pink-2));border-color:transparent;color:#fff}.source-card{display:grid!important;grid-template-columns:46px minmax(0,1fr) 18px!important;gap:12px;align-items:center;background:linear-gradient(145deg,var(--lab-paper),var(--lab-milk))!important;box-shadow:var(--lab-shadow)!important}.source-icon{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;background:#fff0f5;color:var(--lab-pink);border:1px solid #f3d5df}.source-icon .ui-icon{width:21px;height:21px}.source-main{min-width:0}.source-card-top{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:2px}.source-kind{font-size:10px;font-weight:800;color:#bd2a5e;background:var(--lab-pink-soft);padding:4px 7px;border-radius:999px}.source-card h3{color:var(--lab-ink)!important;font-size:14px!important}.source-card p{color:var(--lab-text)!important;font-size:12px!important}

/* More / history */
.more-actions{overflow:hidden;padding:0!important}.more-actions button{width:100%;border:0;background:transparent;display:grid;grid-template-columns:38px minmax(0,1fr) 16px;gap:11px;align-items:center;text-align:left;padding:12px 14px;border-bottom:1px solid #eadbdc;color:var(--lab-ink)}.more-actions button:last-child{border-bottom:0}.more-actions button>.ui-icon{width:24px;height:24px;color:var(--lab-pink)}.more-actions button span b{display:block;font-size:14px}.more-actions button span small{display:block;color:var(--lab-muted);font-size:11px;margin-top:2px}.more-actions button i{font-style:normal;color:var(--lab-gold);font-size:20px}.history-card{background:linear-gradient(145deg,var(--lab-paper),var(--lab-milk))!important;box-shadow:0 7px 16px rgba(33,0,10,.11)!important}.history-card h3{color:var(--lab-ink)!important}.history-card p,.history-time{color:var(--lab-muted)!important}

/* Drawer / editing surfaces */
.modal-backdrop{background:rgba(28,0,10,.62)}.drawer{background:var(--lab-milk);color:var(--lab-ink)}.drawer-head{background:linear-gradient(105deg,var(--lab-wine-950),var(--lab-wine-700));border:0;color:#fff}.drawer-head h2{color:#fff}.drawer-head p{color:#ead0d9}.drawer-head .ghost{color:#fff}.drawer-body{background:var(--lab-milk)}.drawer-foot{background:var(--lab-paper);border-top-color:#eadadd}.role-choice button{background:var(--lab-paper)}

/* Bottom navigation */
.mobile-bottom{
  background:linear-gradient(105deg,rgba(55,3,19,.98),rgba(98,10,43,.98))!important;
  border-top:1px solid rgba(255,255,255,.12)!important;
  box-shadow:0 -10px 28px rgba(22,0,7,.26)!important;
  backdrop-filter:blur(18px)!important;
}
.mobile-bottom button{color:#fff!important}.mobile-bottom button b{color:#fff!important}.mobile-bottom button .ui-icon{width:22px;height:22px}.mobile-bottom button.active{color:var(--lab-gold-2)!important}.mobile-bottom button.active b{color:var(--lab-gold-2)!important}.mobile-bottom button.active:before{background:var(--lab-gold-2)!important;height:3px!important;width:38px!important}

/* Desktop main cards remain readable */
@media(min-width:761px){
  .main-inner{padding-top:30px}.page-head{max-width:100%}.mobile-bottom{display:none!important}
  .screen-overview .main-inner,.screen-strategy .main-inner,.screen-sources .main-inner,.screen-history .main-inner,.screen-stage .main-inner{padding-bottom:48px}
}

@media(max-width:760px){
  html,body{background:var(--lab-wine-950)!important}
  body{padding-bottom:calc(80px + env(safe-area-inset-bottom))!important}
  .main{background:radial-gradient(640px 260px at 92% 0%,rgba(244,40,116,.18),transparent 52%),linear-gradient(155deg,var(--lab-wine-1000),var(--lab-wine-900) 56%,#6b0c31)!important}
  .mobile-top{
    min-height:72px!important;height:auto!important;
    padding:10px 18px 10px!important;
    padding-top:max(10px,env(safe-area-inset-top))!important;
  }
  .mobile-top .logo-mark{width:42px!important;height:42px!important;border-radius:11px!important}
  .mobile-project{font-size:19px!important;font-weight:820!important;letter-spacing:.01em}.mobile-sub{font-size:9px!important}
  .mobile-top .project-grid-btn{width:40px!important;height:40px!important;border-radius:12px!important}
  .main-inner{padding:10px 12px 26px!important}
  .page-head{margin:0 0 12px!important;border-radius:18px!important;padding:15px 15px 16px!important}.page-head h1{font-size:22px!important}.page-head p{font-size:13px!important;line-height:1.42!important}
  .overview-project-card{grid-template-columns:48px minmax(0,1fr)!important;padding:14px!important;gap:12px!important;border-radius:18px!important}.overview-project-icon{width:46px;height:46px;border-radius:13px}.overview-project-icon .ui-icon{width:23px;height:23px}.overview-project-top h2{font-size:19px!important}.overview-project-card p{font-size:12px!important;margin-bottom:10px}.overview-project-state{gap:7px}.overview-project-state b{font-size:16px}
  .section-title{margin:17px 3px 8px!important}.section-title h2{font-size:18px!important}.section-title span{font-size:11px!important;max-width:56%!important}
  .focus-card{grid-template-columns:38px minmax(0,1fr)!important;padding:12px 13px!important;border-radius:17px!important}.focus-num{width:36px!important;height:36px!important}.focus-card h3{font-size:15px!important}.focus-card p{font-size:12px!important;line-height:1.38!important}.focus-card .btn{grid-column:1/-1;width:100%;min-height:42px;font-size:14px!important;margin-top:2px}
  .attention-row{gap:7px!important}.mini-stat{padding:11px 10px!important;border-radius:14px!important}.mini-stat strong{font-size:18px!important}.mini-stat span{font-size:11px!important}
  .route{border-radius:18px!important}.route-row,.route-row:nth-child(even),.route-row.done,.route-row.current{grid-template-columns:35px minmax(0,1fr) 18px!important;padding:10px 12px!important}.route-n{width:31px!important;height:31px!important;border-radius:9px!important;font-size:12px!important}.route-name{font-size:14px!important;line-height:1.2!important}.route-sub{font-size:11px!important}.route-progress{display:none!important}
  .stage-strip{margin:0 -2px 10px!important;padding-bottom:2px!important}.stage-pill,.stage-pill.active{padding:8px 10px 11px!important;display:grid!important;gap:2px!important;text-align:center!important}.stage-pill span{max-width:none!important;font-size:11px!important}.stage-pill b,.stage-pill.active b{font-size:13px!important;font-weight:800!important}
  .stage-head{padding:13px!important;border-radius:18px!important}.stage-head-main{grid-template-columns:43px minmax(0,1fr)!important;gap:12px!important}.stage-badge{width:43px!important;height:43px!important;border-radius:12px!important;font-size:19px!important}.stage-copy h1{font-size:20px!important}.stage-copy p{font-size:13px!important}.stage-head-foot{margin-top:10px!important}.method-link{font-size:11px!important}
  .subtabs{margin:1px 0 10px!important}.subtab,.subtab.active{padding:8px 10px 10px!important;font-size:12px!important}
  .task-panel{padding:11px!important;border-radius:18px!important}.records-toolbar{margin-bottom:8px!important}.records-actions .btn{min-height:36px!important}.record-card{padding:11px!important}.record-card-title{font-size:14px!important}.record-card-sub{font-size:11px!important}
  .field-group{border-radius:16px!important}.field-group-head{padding:11px 11px 6px!important}.field-group-head h3{font-size:13px!important;padding:7px 10px!important}.field{padding:11px 12px!important}.field label{font-size:11px!important}.field textarea,.field input,.field select{font-size:14px!important}
  .strategy-summary{padding:14px!important;border-radius:18px!important}.progress-ring{width:62px!important;height:62px!important}.strategy-summary h2{font-size:17px!important}.strategy-summary p{font-size:12px!important}
  .assembly-list{border-radius:18px!important}.assembly-row{grid-template-columns:34px minmax(0,1fr) 18px!important;padding:11px 12px!important}.assembly-num{width:31px!important;height:31px!important;border-radius:9px!important;font-size:12px!important}.assembly-name{font-size:14px!important}.assembly-map{font-size:11px!important}.assembly-row select{grid-column:2;max-width:175px!important;font-size:11px!important;margin-top:4px}.strategy-actions{display:grid;grid-template-columns:1fr 1fr}.strategy-actions .btn{min-height:40px}
  .source-tools{margin-top:2px}.source-search{height:44px;border-radius:14px}.source-filters button{padding:7px 12px;font-size:12px}.source-card{grid-template-columns:42px minmax(0,1fr) 18px!important;padding:11px!important;border-radius:17px!important}.source-icon{width:39px;height:39px}.source-card h3{font-size:14px!important}.source-card p{font-size:11px!important}
  .more-actions{border-radius:18px!important}.more-actions button{grid-template-columns:34px minmax(0,1fr) 16px;padding:11px 13px}.more-actions button>.ui-icon{width:22px;height:22px}.more-actions button span b{font-size:14px}.more-actions button span small{font-size:11px}
  .project-row{border-radius:18px!important}.mobile-project-actions{gap:8px!important}.mobile-project-actions .btn{min-height:42px!important}
  .mobile-bottom{padding:7px 7px calc(8px + env(safe-area-inset-bottom))!important}.mobile-bottom button{gap:4px!important;padding:6px 2px!important;font-size:11px!important}.mobile-bottom button b{font-size:20px!important}
  .drawer-head{padding-top:max(14px,env(safe-area-inset-top))!important}
}

/* =========================================================
   V10 — UX cleanup + mobile editing fix
   ========================================================= */

/* General rhythm: cards are separate objects, never a glued sheet */
.project-list,.field-groups,.record-list,.simple-list{gap:12px!important}
.route,.assembly-list{display:grid!important;gap:10px!important;background:transparent!important;border:0!important;box-shadow:none!important;overflow:visible!important}
.route-row,.assembly-row{border-radius:16px!important;border:1px solid rgba(116,32,57,.12)!important;background:linear-gradient(145deg,var(--lab-paper),var(--lab-milk))!important;box-shadow:0 7px 18px rgba(35,0,11,.10)!important;overflow:hidden}
.route-row+ .route-row,.assembly-row+ .assembly-row{border-top:1px solid rgba(116,32,57,.12)!important}
.task-panel,.field-group,.source-card,.history-card,.strategy-summary,.more-actions,.context-card{margin-bottom:12px!important}

/* Gold is the structural accent; pink marks activity/current focus */
.route-n,.assembly-num,.stage-badge{border-color:var(--lab-gold-2)!important;color:#9c6815!important;background:#fffaf0!important}
.route-row .arrow,.assembly-row .arrow,.record-card .arrow,.source-card .arrow{color:var(--lab-gold)!important}
.route-row.current .route-n,.route-row.done .route-n{border-color:var(--lab-pink)!important;color:var(--lab-pink)!important;background:#fff0f6!important}
.route-row.current{border-color:rgba(245,74,137,.38)!important;box-shadow:inset 5px 0 0 var(--lab-pink),0 7px 18px rgba(35,0,11,.10)!important}
.field-group-head h3:before{color:var(--lab-gold-2)!important}
.lab-marker{display:inline-flex;align-items:center;margin-left:7px;padding:2px 6px;border:1px solid var(--lab-gold-2);border-radius:999px;color:var(--lab-gold)!important;font-size:9px;letter-spacing:.08em;vertical-align:1px;background:#fff8e8}

/* Projects screen: intro is part of the wine canvas, not another card */
.screen-projects .main-inner{padding-top:16px!important}
.projects-intro{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:18px;align-items:start;margin:0 6px 22px;color:#fff}
.projects-kicker{font-size:12px;font-weight:800;letter-spacing:.15em;color:var(--lab-gold-2);margin-bottom:8px}
.projects-intro h1{margin:0;font-size:34px;line-height:1.02;letter-spacing:-.035em;color:#fff}
.projects-intro p{margin:10px 0 0;max-width:650px;font-size:14px;line-height:1.5;color:#ecdce2}
.projects-actions{display:flex;gap:8px;align-items:center}
.projects-icon-btn{width:42px;height:42px;border-radius:13px;border:1px solid rgba(248,213,124,.68);background:rgba(255,255,255,.06);color:var(--lab-gold-2);display:grid;place-items:center;box-shadow:0 7px 16px rgba(26,0,8,.12)}
.projects-icon-btn .ui-icon{width:20px;height:20px}.projects-icon-btn.new{background:var(--lab-gold-2);color:var(--lab-wine-950);border-color:var(--lab-gold-2)}
.project-list{display:grid}
.project-card{position:relative;border:1px solid rgba(116,32,57,.13);background:linear-gradient(145deg,#fffdfa,#fff7f6);border-radius:18px;box-shadow:var(--lab-shadow);overflow:hidden;cursor:pointer;color:var(--lab-ink)}
.project-card:before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:var(--lab-gold-2)}
.project-card-main{padding:16px 18px 12px 20px}.project-card-title{display:flex;align-items:center;justify-content:space-between;gap:12px}.project-card h3{margin:0;color:var(--lab-ink);font-size:20px;line-height:1.15}.project-card p{margin:7px 0 0;color:var(--lab-muted);font-size:13px;line-height:1.42;max-width:720px}.project-card-arrow{font-size:26px;color:var(--lab-gold)}
.project-card-foot{display:grid;grid-template-columns:auto minmax(80px,1fr) auto;align-items:center;gap:11px;padding:10px 18px 12px 20px;border-top:1px solid #f0e4e5}.project-card-progress{height:5px;border-radius:99px;background:#f0dfe5;overflow:hidden}.project-card-progress i{display:block;height:100%;background:linear-gradient(90deg,var(--lab-pink),var(--lab-gold-2));border-radius:inherit}.project-card-foot strong{color:var(--lab-wine-800);font-size:14px}
.screen-projects .mobile-project-actions{display:none!important}

/* Internal page headers remain light, but avoid needless methodology branding */
.method-box .status-chip.method{color:var(--lab-gold)!important;border:1px solid rgba(202,151,55,.30)}

/* Passport mobile uses a real editor screen instead of editing in narrow rows */
.field-mobile-value{display:none}
.single-field-editor{height:100%;display:flex}.single-field-editor textarea{width:100%;min-height:100%;border:0;outline:0;resize:none;background:transparent;color:var(--lab-ink);font:inherit;font-size:17px;line-height:1.55;padding:4px 1px 40px}
.editor-kicker{display:block;color:var(--lab-gold-2);font-size:10px;font-weight:800;letter-spacing:.13em;text-transform:uppercase;margin-bottom:4px}
.drawer-foot .full{width:100%}

@media(max-width:760px){
  /* Projects: compact utility actions in the corner, clean cards below */
  .screen-projects .mobile-top{min-height:68px!important}
  .screen-projects .main-inner{padding:14px 16px 28px!important}
  .projects-intro{margin:2px 2px 18px;gap:10px}.projects-kicker{font-size:11px;margin-bottom:6px}.projects-intro h1{font-size:30px}.projects-intro p{font-size:13px;line-height:1.42;margin-top:8px}.projects-actions{gap:7px}.projects-icon-btn{width:40px;height:40px;border-radius:12px}
  .project-list{gap:12px!important}.project-card{border-radius:17px}.project-card-main{padding:14px 15px 10px 18px}.project-card h3{font-size:18px}.project-card p{font-size:13px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.project-card-foot{padding:9px 15px 11px 18px;grid-template-columns:auto 1fr auto;gap:9px}

  /* Better breathing room through every working screen */
  .route,.assembly-list,.field-groups,.record-list,.simple-list{gap:10px!important}
  .route-row,.assembly-row{border-radius:15px!important}
  .field-group{overflow:visible!important;background:transparent!important;border:0!important;box-shadow:none!important;margin-bottom:14px!important}
  .field-group-head{padding:0 0 7px!important}.field-group-head h3{border-radius:10px!important;margin-left:1px}
  .fields{display:grid!important;gap:8px!important}
  .field{background:linear-gradient(145deg,var(--lab-paper),var(--lab-milk))!important;border:1px solid #eadadd!important;border-radius:14px!important;padding:11px 12px!important;box-shadow:0 5px 14px rgba(35,0,11,.07)!important}
  .field label{margin-bottom:7px!important}
  .desktop-inline-editor{display:none!important}
  .field-mobile-value{display:grid;grid-template-columns:minmax(0,1fr) 14px;align-items:center;gap:8px;width:100%;border:0;background:transparent;text-align:left;padding:0;color:var(--lab-ink);font-size:14px;line-height:1.43;white-space:pre-wrap}
  .field-mobile-value span{color:#b7a6ac}.field-mobile-value i{font-style:normal;color:var(--lab-gold);font-size:20px;justify-self:end}

  /* Full-screen editing that tracks the visual viewport when keyboard opens */
  body.editor-open{overflow:hidden!important;padding-bottom:0!important;overscroll-behavior:none}
  body.editor-open .mobile-bottom{display:none!important}
  .modal-backdrop{position:fixed!important;left:0!important;right:0!important;top:var(--editor-top,0px)!important;bottom:auto!important;height:var(--editor-vh,100dvh)!important;z-index:200!important;align-items:stretch!important;background:var(--lab-wine-950)!important}
  .drawer,.field-editor{width:100%!important;max-width:none!important;height:100%!important;max-height:none!important;border:0!important;border-radius:0!important;box-shadow:none!important;animation:none!important;display:flex!important;flex-direction:column!important}
  .drawer-head{flex:0 0 auto;padding:12px 15px 11px!important;padding-top:max(12px,env(safe-area-inset-top))!important;min-height:72px!important}
  .drawer-head h2{font-size:19px!important;line-height:1.15!important}.drawer-head p{font-size:11px!important}
  .drawer-body{flex:1 1 auto;min-height:0!important;overflow:auto!important;-webkit-overflow-scrolling:touch;padding:14px 14px 22px!important;background:var(--lab-milk)!important}
  .drawer-body .field-groups{gap:14px!important}.drawer-body .field-group{background:transparent!important}
  .drawer-body .field{background:#fffdfb!important}.drawer-body textarea,.drawer-body input,.drawer-body select{font-size:16px!important;line-height:1.5!important}
  .drawer-foot{flex:0 0 auto;padding:10px 14px calc(10px + env(safe-area-inset-bottom))!important;background:var(--lab-paper)!important;box-shadow:0 -8px 22px rgba(46,0,14,.08)!important}
  .single-field-editor{min-height:100%;height:auto}.single-field-editor textarea{font-size:17px!important;min-height:calc(var(--editor-vh,100dvh) - 170px)!important}

  /* Card lists are visually separate everywhere */
  .record-card,.source-card,.history-card{border-radius:15px!important;margin:0!important}
  .strategy-summary{margin-bottom:16px!important}
}

/* =========================================================
   V11 — glass refinement + modal editor + stable mobile header
   ========================================================= */

/* Shared solids instead of gradients on progress / active rails */
.bar i,
.project-card-progress i,
.overview-hero-progress .bar i,
.route-row .route-progress .bar i,
.overview-project-card .bar i,
.stage-progress-wrap .bar i,
.mobile-bottom button.active:before,
.stage-pill.active:after{
  background:var(--lab-gold-2)!important;
}

/* Glass language */
.glass-card,
.project-card,
.route-row,
.assembly-row,
.source-card,
.history-card,
.strategy-summary,
.more-actions,
.context-card,
.task-panel,
.stage-head,
.focus-card,
.mini-stat,
.field{
  background:rgba(255,252,250,.72)!important;
  backdrop-filter:blur(18px) saturate(118%);
  -webkit-backdrop-filter:blur(18px) saturate(118%);
  border:1px solid rgba(255,255,255,.22)!important;
  box-shadow:0 10px 24px rgba(25,0,8,.12)!important;
}

/* Field blocks: no sharp corners, clearer labels */
.field,
.record-card,
.source-card,
.history-card,
.project-card,
.route-row,
.assembly-row,
.focus-card,
.task-panel,
.stage-head{overflow:hidden!important}
.field label{color:#9b2d58!important;font-weight:800!important;letter-spacing:.01em}
.field textarea,.field input,.field select{color:var(--lab-ink)!important}
.fields{gap:10px!important}
.field-group{background:transparent!important;border:0!important;box-shadow:none!important;overflow:visible!important}
.field-group-head{background:transparent!important;border:0!important}

/* Project list card more compact and translucent */
.project-list{max-width:720px}
.project-card{
  max-width:640px;
  width:100%;
  background:rgba(255,251,249,.64)!important;
  border-color:rgba(255,255,255,.25)!important;
}
.project-card:before{width:3px!important;background:rgba(229,189,93,.92)!important}
.project-card-main{padding:14px 16px 10px 18px!important}
.project-card h3{font-size:18px!important}
.project-card p{font-size:12px!important;line-height:1.38!important}
.project-card-foot{padding:8px 16px 10px 18px!important;border-top:1px solid rgba(116,32,57,.10)!important}
.project-card-progress{background:rgba(229,189,93,.18)!important}
.project-card-foot strong{font-size:13px!important}

/* Clean project header inside project, no framed title card */
.overview-hero-clean{margin:4px 2px 18px;color:#fff}
.overview-hero-clean .eyebrow{color:var(--lab-gold-2)!important;margin-bottom:8px!important}
.overview-hero-clean h1{margin:0;font-size:38px;line-height:1.02;letter-spacing:-.04em;color:#fff}
.overview-hero-clean p{margin:10px 0 0;color:#ecdce2;font-size:14px;line-height:1.45;max-width:760px}
.overview-hero-clean-top{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}
.overview-hero-main{min-width:0}
.overview-hero-stats{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.overview-hero-stats strong{font-size:22px;line-height:1;color:#fff}
.overview-hero-progress{display:flex;align-items:center;gap:10px;margin-top:14px;max-width:520px}
.overview-hero-progress .bar{flex:1;height:6px;background:rgba(255,255,255,.14)!important}
.overview-hero-progress span{font-size:11px;color:#ead6dc;letter-spacing:.02em}
.overview-hero-clean .status-chip.method{background:rgba(255,248,230,.14)!important;color:var(--lab-gold-2)!important;border:1px solid rgba(229,189,93,.42)!important}

/* Stage top cards: stable height to avoid jump between screens */
.stage-head{min-height:184px!important}
.stage-head .subtabs{margin-top:12px!important}
.stage-head .subtab,
.subtab{background:rgba(255,255,255,.08)!important;color:#f0dde3!important;border:1px solid rgba(255,255,255,.10)!important}
.stage-head .subtab.active,
.subtab.active{background:rgba(255,248,230,.12)!important;color:#fff!important;border-color:rgba(229,189,93,.42)!important;box-shadow:inset 0 -2px 0 var(--lab-gold-2)!important}

/* Stage strip and bottom menu active accents in gold, not gradient */
.stage-pill.active b{color:var(--lab-gold-2)!important}
.mobile-bottom button.active{color:var(--lab-gold-2)!important}
.mobile-bottom button.active b{color:var(--lab-gold-2)!important}

/* Mobile header is fixed, not sticky, to avoid iOS ghosting / duplicate artifacts */
@media(max-width:760px){
  .mobile-top{
    position:fixed!important;
    top:0!important;left:0!important;right:0!important;
    z-index:70!important;
    padding-top:max(10px,env(safe-area-inset-top))!important;
    min-height:74px!important;
    background:linear-gradient(180deg,rgba(48,2,15,.96) 0%,rgba(74,6,27,.88) 100%)!important;
    backdrop-filter:none!important;
    -webkit-backdrop-filter:none!important;
    border-bottom:1px solid rgba(255,255,255,.08)!important;
    box-shadow:0 8px 20px rgba(23,0,7,.16)!important;
  }
  .main-inner{padding-top:92px!important;padding-left:16px!important;padding-right:16px!important;padding-bottom:32px!important}
  body{padding-bottom:calc(78px + env(safe-area-inset-bottom))!important}

  /* Project list mobile compactness */
  .project-list{max-width:100%!important}
  .project-card{max-width:100%!important;border-radius:18px!important}
  .project-card-main{padding:12px 14px 9px 16px!important}
  .project-card h3{font-size:17px!important}
  .project-card p{-webkit-line-clamp:2}
  .projects-intro{margin-top:2px!important}

  /* Stable, lighter project header */
  .overview-hero-clean{margin:2px 2px 16px!important}
  .overview-hero-clean h1{font-size:28px!important}
  .overview-hero-clean p{font-size:13px!important;line-height:1.4!important}
  .overview-hero-clean-top{flex-direction:column!important;align-items:flex-start!important;gap:9px!important}
  .overview-hero-stats{justify-content:flex-start!important}
  .overview-hero-progress{max-width:none!important;margin-top:8px!important}

  /* Modal windows instead of full-screen pages */
  body.editor-open{overflow:hidden!important}
  body.editor-open .mobile-bottom{display:none!important}
  .modal-window-backdrop,
  .modal-backdrop{
    position:fixed!important;
    inset:0!important;
    z-index:200!important;
    display:flex!important;
    align-items:flex-end!important;
    justify-content:center!important;
    padding:10px 12px calc(10px + env(safe-area-inset-bottom))!important;
    background:rgba(27,0,10,.54)!important;
  }
  .drawer,
  .field-editor,
  .project-create-modal{
    width:min(100%,760px)!important;
    max-width:760px!important;
    height:min(calc(var(--editor-vh,100dvh) - 22px),82vh)!important;
    max-height:min(calc(var(--editor-vh,100dvh) - 22px),82vh)!important;
    border-radius:24px!important;
    border:1px solid rgba(255,255,255,.12)!important;
    overflow:hidden!important;
    box-shadow:0 18px 48px rgba(0,0,0,.28)!important;
    animation:none!important;
  }
  .drawer-head{min-height:unset!important;padding:14px 16px 12px!important;padding-top:max(14px,env(safe-area-inset-top))!important}
  .drawer-head h2{font-size:20px!important}
  .drawer-body{padding:14px 14px 20px!important;background:var(--lab-milk)!important}
  .drawer-body .field-groups{gap:12px!important}
  .drawer-foot{padding:11px 14px calc(11px + env(safe-area-inset-bottom))!important}
  .single-field-editor textarea{min-height:calc(min(var(--editor-vh,100dvh) - 22px,82vh) - 170px)!important}

  /* Individual field cards */
  .fields{gap:10px!important}
  .field{border-radius:16px!important;padding:12px 13px!important;background:rgba(255,252,250,.82)!important}
  .field-mobile-value{font-size:14px!important;line-height:1.45!important}
  .field-mobile-value i{color:var(--lab-gold)!important}

  /* Stage cards / list cards glass style */
  .focus-card,
  .route-row,
  .assembly-row,
  .record-card,
  .task-panel,
  .source-card,
  .history-card,
  .mini-stat,
  .stage-head{
    border-radius:18px!important;
  }
  .stage-head{min-height:176px!important}
}

/* =========================================================
   V11.1 — fix header overlap + unify glass cards + clickable route
   ========================================================= */
@media (max-width:760px){
  :root{--mobile-top-h:76px}

  /* Stronger, more stable top bar */
  .mobile-top,
  .screen-projects .mobile-top,
  .screen-overview .mobile-top,
  .screen-stage .mobile-top,
  .screen-strategy .mobile-top,
  .screen-sources .mobile-top,
  .screen-history .mobile-top{
    position:fixed!important;
    top:0;left:0;right:0;
    z-index:80!important;
    min-height:72px!important;
    height:auto!important;
    padding:12px 16px 12px!important;
    padding-top:max(12px,env(safe-area-inset-top))!important;
    background:rgba(82,7,30,.94)!important;
    border-bottom:1px solid rgba(255,255,255,.08)!important;
    box-shadow:0 8px 24px rgba(16,0,7,.22)!important;
    -webkit-backdrop-filter:blur(20px) saturate(140%);
    backdrop-filter:blur(20px) saturate(140%);
  }
  .mobile-top .mobile-project{font-size:12px!important;line-height:1.06!important;color:#fff!important}
  .mobile-top .mobile-sub{font-size:10px!important;letter-spacing:.18em!important;color:var(--lab-gold-2)!important;text-transform:uppercase}
  .mobile-top .project-grid-btn{background:rgba(255,255,255,.10)!important;border:1px solid rgba(255,255,255,.14)!important}

  /* Real top offset for every screen */
  .screen-projects .main-inner,
  .screen-overview .main-inner,
  .screen-stage .main-inner,
  .screen-strategy .main-inner,
  .screen-sources .main-inner,
  .screen-history .main-inner{
    padding-top:calc(var(--mobile-top-h) + 18px)!important;
    padding-left:16px!important;
    padding-right:16px!important;
    padding-bottom:28px!important;
  }

  /* Unified glass cards — clearer, not washed out */
  .project-card,
  .page-head,
  .focus-card,
  .mini-stat,
  .route-row,
  .assembly-row,
  .strategy-summary,
  .source-card,
  .history-card,
  .record-card,
  .task-panel,
  .field-group,
  .field,
  .surface.empty-state,
  .surface.card,
  .stage-head,
  .search-card,
  .search-box{
    background:rgba(255,248,251,.84)!important;
    -webkit-backdrop-filter:blur(22px) saturate(150%)!important;
    backdrop-filter:blur(22px) saturate(150%)!important;
    border:1px solid rgba(255,255,255,.24)!important;
    box-shadow:0 10px 28px rgba(20,0,9,.16)!important;
  }
  .page-head h1,.stage-head h1,.project-card h3,.route-name,.assembly-name,.strategy-summary h2,.focus-card h3,.history-card h3,.source-card h3{color:var(--lab-wine-900)!important}
  .page-head p,.stage-head p,.project-card p,.route-sub,.assembly-map,.strategy-summary p,.field-mobile-value,.source-card p,.history-card p{color:#6a5760!important}

  /* Reduce yellow overload: keep gold only as line/icon accent */
  .gold-outline,
  .section-title-on-wine .gold-outline,
  .status-chip.method{
    color:#dcb25b!important;
    border-color:rgba(220,178,91,.66)!important;
    background:rgba(220,178,91,.08)!important;
  }
  .projects-icon-btn.new{
    background:rgba(220,178,91,.95)!important;
    color:#4d1122!important;
    border:0!important;
  }
  .projects-icon-btn:not(.new){color:#dfbb69!important;border-color:rgba(220,178,91,.55)!important;background:rgba(255,255,255,.06)!important}

  /* Make project list intro readable and not hidden */
  .projects-intro{margin:0 2px 16px!important;color:#fff!important}
  .projects-intro p{color:#efe1e6!important}

  /* Route cards definitely clickable and uniform */
  .route{display:grid!important;gap:12px!important;background:transparent!important;border:0!important;box-shadow:none!important}
  .route-row,
  .route-row:nth-child(even),
  .route-row.done,
  .route-row.current{
    appearance:none!important;
    -webkit-appearance:none!important;
    width:100%!important;
    text-align:left!important;
    cursor:pointer!important;
    grid-template-columns:40px minmax(0,1fr) 18px!important;
    align-items:center!important;
    gap:12px!important;
    margin:0!important;
    padding:14px 14px!important;
    border-radius:20px!important;
    border:1px solid rgba(255,255,255,.24)!important;
    background:rgba(255,248,251,.84)!important;
    box-shadow:0 10px 28px rgba(20,0,9,.16)!important;
  }
  .route-row + .route-row{border-top:1px solid rgba(255,255,255,.24)!important}
  .route-row:before{display:none!important}
  .route-row.current{box-shadow:inset 4px 0 0 var(--lab-pink),0 10px 28px rgba(20,0,9,.16)!important}
  .route-row .route-n,
  .route-row.current .route-n,
  .route-row.done .route-n{
    width:34px!important;height:34px!important;border-radius:12px!important;
    background:rgba(255,255,255,.42)!important;
    color:var(--lab-wine-700)!important;
    border:1.5px solid rgba(118,27,59,.58)!important;
  }
  .route-row.current .route-n{border-color:rgba(239,88,149,.78)!important;color:#d93677!important;background:rgba(255,239,246,.92)!important}
  .route-row .arrow{color:var(--lab-wine-700)!important}

  /* Strategy screen rows: remove zebra / dark alternation */
  .screen-strategy .assembly-list{background:transparent!important;border:0!important;box-shadow:none!important;display:grid!important;gap:12px!important}
  .screen-strategy .assembly-row,
  .screen-strategy .assembly-row:nth-child(even),
  .screen-strategy .assembly-row.state-ready,
  .screen-strategy .assembly-row.state-check,
  .screen-strategy .assembly-row.state-empty{
    grid-template-columns:40px minmax(0,1fr) 18px!important;
    gap:12px!important;
    padding:14px!important;
    border-radius:20px!important;
    border:1px solid rgba(255,255,255,.24)!important;
    border-bottom:1px solid rgba(255,255,255,.24)!important;
    margin:0!important;
    background:rgba(255,248,251,.84)!important;
    box-shadow:0 10px 28px rgba(20,0,9,.16)!important;
  }
  .screen-strategy .assembly-row:before{display:none!important}
  .screen-strategy .assembly-num{width:34px!important;height:34px!important;border-radius:12px!important;background:rgba(255,255,255,.42)!important;color:var(--lab-wine-700)!important;border:1.5px solid rgba(118,27,59,.58)!important}
  .screen-strategy .assembly-row select{background:rgba(255,238,246,.92)!important;color:#a42858!important;border:1px solid rgba(239,88,149,.18)!important;border-radius:12px!important}
  .screen-strategy .strategy-summary{background:rgba(255,248,251,.84)!important}

  /* Strategy 9-step rows: no alternating backgrounds */
  .screen-strategy .record-card,
  .screen-strategy .record-card:nth-child(even),
  .screen-strategy .task-panel,
  .screen-strategy .task-panel:nth-child(even){background:rgba(255,248,251,.84)!important}

  /* Better glass stage cards */
  .focus-card,.stage-head,.task-panel,.source-card,.history-card,.record-card{border-radius:22px!important}

  /* Search and pills */
  .screen-sources .filter-chip,
  .screen-sources .seg-chip,
  .screen-history .seg-chip,
  .screen-stage .subtab,
  .screen-stage .stage-pill{
    background:rgba(255,255,255,.08)!important;
    color:#f5e4e9!important;
    border:1px solid rgba(255,255,255,.12)!important;
  }
  .screen-sources .filter-chip.active,
  .screen-history .seg-chip.active,
  .screen-stage .subtab.active,
  .screen-stage .stage-pill.active{
    background:rgba(255,248,230,.08)!important;
    color:#fff!important;
    border-color:rgba(220,178,91,.44)!important;
    box-shadow:inset 0 -2px 0 var(--lab-gold-2)!important;
  }

  /* Strategy screen check rows on Strategy tab */
  .screen-strategy .assembly-row .arrow,
  .screen-strategy .record-card .arrow{color:var(--lab-wine-700)!important}
}

/* =========================================================
   V13 — robust mobile chrome + unified readable glass
   ========================================================= */
@media(max-width:760px){
  :root{--mobile-top-safe:calc(98px + env(safe-area-inset-top))}

  .mobile-top,
  .screen-projects .mobile-top,
  .screen-overview .mobile-top,
  .screen-stage .mobile-top,
  .screen-strategy .mobile-top,
  .screen-sources .mobile-top,
  .screen-history .mobile-top{
    position:fixed!important;
    top:0!important;left:0!important;right:0!important;
    z-index:90!important;
    min-height:calc(70px + env(safe-area-inset-top))!important;
    padding:12px 16px 12px!important;
    padding-top:calc(10px + env(safe-area-inset-top))!important;
    background:rgba(74,6,27,.96)!important;
    -webkit-backdrop-filter:blur(22px) saturate(155%)!important;
    backdrop-filter:blur(22px) saturate(155%)!important;
    border-bottom:1px solid rgba(255,255,255,.08)!important;
    box-shadow:0 8px 24px rgba(20,0,8,.22)!important;
  }

  .screen-projects .main-inner,
  .screen-overview .main-inner,
  .screen-stage .main-inner,
  .screen-strategy .main-inner,
  .screen-sources .main-inner,
  .screen-history .main-inner{
    padding-top:var(--mobile-top-safe)!important;
    padding-left:16px!important;
    padding-right:16px!important;
    padding-bottom:30px!important;
  }

  /* Readable iPhone-like glass: translucent, but never pale */
  .project-card,
  .page-head,
  .focus-card,
  .mini-stat,
  .route-row,
  .assembly-row,
  .strategy-summary,
  .source-card,
  .history-card,
  .record-card,
  .task-panel,
  .stage-head,
  .field,
  .surface.empty-state,
  .more-actions,
  .context-card{
    background:rgba(255,249,252,.91)!important;
    -webkit-backdrop-filter:blur(24px) saturate(145%)!important;
    backdrop-filter:blur(24px) saturate(145%)!important;
    border:1px solid rgba(255,255,255,.42)!important;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.68),
      0 12px 30px rgba(24,0,9,.16)!important;
  }

  .project-card p,.page-head p,.focus-card p,.route-sub,.assembly-map,.strategy-summary p,.source-card p,.history-card p,.field-mobile-value{color:#65545b!important}
  .project-card h3,.page-head h1,.focus-card h3,.route-name,.assembly-name,.strategy-summary h2,.source-card h3,.history-card h3,.field label{color:#5f102d!important}

  /* Gold only as restrained accent, never large fills */
  .route-row .arrow,.assembly-row .arrow,.source-card .arrow,.record-card .arrow,.field-mobile-value i{color:#b8842e!important}
  .route-n,.assembly-num,.stage-badge{
    color:#7b1b3e!important;
    border-color:rgba(123,27,62,.62)!important;
    background:rgba(255,255,255,.48)!important;
  }
  .route-row.current .route-n{color:#d83a78!important;border-color:rgba(216,58,120,.72)!important;background:rgba(255,240,247,.96)!important}
  .gold-outline,.section-title-on-wine .gold-outline{color:#dbb15c!important;border-color:rgba(219,177,92,.62)!important;background:rgba(255,255,255,.04)!important}

  /* Completely uniform route cards */
  .route{
    display:grid!important;
    gap:12px!important;
    background:transparent!important;
    border:0!important;
    box-shadow:none!important;
    overflow:visible!important;
  }
  .route-row,
  .route-row:nth-child(even),
  .route-row.done,
  .route-row.current{
    display:grid!important;
    grid-template-columns:40px minmax(0,1fr) 18px!important;
    gap:12px!important;
    align-items:center!important;
    width:100%!important;
    margin:0!important;
    padding:14px!important;
    border-radius:20px!important;
    border:1px solid rgba(255,255,255,.42)!important;
    background:rgba(255,249,252,.91)!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.68),0 12px 30px rgba(24,0,9,.16)!important;
    color:inherit!important;
    text-align:left!important;
    cursor:pointer!important;
    pointer-events:auto!important;
    touch-action:manipulation!important;
    -webkit-tap-highlight-color:rgba(236,34,107,.12);
  }
  .route-row + .route-row{border-top:1px solid rgba(255,255,255,.42)!important}
  .route-row:before,.route-row:after{display:none!important}
  .route-row.current{box-shadow:inset 4px 0 0 #ec4a8a,inset 0 1px 0 rgba(255,255,255,.68),0 12px 30px rgba(24,0,9,.16)!important}

  /* Bottom nav — explicit tap targets */
  .mobile-bottom{z-index:95!important}
  .mobile-bottom button{
    pointer-events:auto!important;
    touch-action:manipulation!important;
    min-height:58px!important;
    position:relative!important;
    z-index:1!important;
  }
  .mobile-bottom [data-mobile-work]{cursor:pointer!important}

  /* Strategy: one glass language, no zebra / dark rows */
  .screen-strategy .assembly-list{
    display:grid!important;
    gap:12px!important;
    background:transparent!important;
    border:0!important;
    box-shadow:none!important;
    overflow:visible!important;
  }
  .screen-strategy .assembly-row,
  .screen-strategy .assembly-row:nth-child(even),
  .screen-strategy .assembly-row.state-ready,
  .screen-strategy .assembly-row.state-check,
  .screen-strategy .assembly-row.state-empty{
    grid-template-columns:40px minmax(0,1fr) 18px!important;
    gap:12px!important;
    align-items:center!important;
    margin:0!important;
    padding:14px!important;
    border-radius:20px!important;
    background:rgba(255,249,252,.91)!important;
    border:1px solid rgba(255,255,255,.42)!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.68),0 12px 30px rgba(24,0,9,.16)!important;
  }
  .screen-strategy .assembly-row:before,.screen-strategy .assembly-row:after{display:none!important}
  .screen-strategy .assembly-row select{
    background:rgba(255,238,246,.94)!important;
    border:1px solid rgba(216,58,120,.16)!important;
    color:#a22b59!important;
    border-radius:12px!important;
  }

  /* Source / History top cards should also start below chrome */
  .screen-sources .page-head,
  .screen-history .page-head,
  .screen-strategy .page-head,
  .screen-stage .page-head{margin-top:0!important}

  /* Remove any remaining alternating / dark accidental card backgrounds */
  .assembly-row:nth-child(even),
  .record-card:nth-child(even),
  .history-card:nth-child(even),
  .source-card:nth-child(even),
  .field:nth-child(even){background:rgba(255,249,252,.91)!important}
}

/* =========================================================
   V14 — restore stage navigation + pink accents on glass
   ========================================================= */
@media(max-width:760px){
  /* Bright pink is the accent inside glass cards. Gold stays outside glass. */
  .project-card:before,
  .route-row.current,
  .focus-card,
  .assembly-row,
  .stage-head,
  .field,
  .source-card,
  .history-card,
  .record-card,
  .task-panel,
  .strategy-summary{
    --glass-accent:var(--lab-pink);
  }

  .project-card:before{background:var(--lab-pink)!important}
  .project-card-arrow,
  .project-card .arrow,
  .project-card-foot strong,
  .route-row .arrow,
  .assembly-row .arrow,
  .record-card .arrow,
  .source-card .arrow,
  .field-mobile-value i{color:var(--lab-pink)!important}

  .project-card-progress{background:rgba(236,34,107,.13)!important}
  .project-card-progress i,
  .route-row .route-progress .bar i,
  .stage-progress-wrap .bar i,
  .strategy-summary .bar i{background:var(--lab-pink)!important}

  .project-card .status-chip.method,
  .overview-hero-clean .status-chip.method{
    color:#a51f52!important;
    border:1px solid rgba(236,34,107,.22)!important;
    background:rgba(255,225,237,.88)!important;
  }

  .route-row .route-n,
  .route-row.done .route-n,
  .route-row.current .route-n,
  .assembly-num,
  .stage-badge{
    border-color:rgba(236,34,107,.56)!important;
    color:#b52459!important;
    background:rgba(255,244,248,.78)!important;
  }
  .route-row.current .route-n{
    border-color:var(--lab-pink)!important;
    color:var(--lab-pink)!important;
    background:#fff0f6!important;
  }

  .screen-strategy .assembly-row .arrow{color:var(--lab-pink)!important}
  .screen-strategy .assembly-num{border-color:rgba(236,34,107,.56)!important;color:#b52459!important;background:rgba(255,244,248,.78)!important}

  /* Pink underline/indicator on glass navigation, no yellow on glass */
  .screen-stage .subtab.active,
  .screen-stage .stage-pill.active{
    border-color:rgba(236,34,107,.45)!important;
    box-shadow:inset 0 -2px 0 var(--lab-pink)!important;
  }
  .screen-stage .stage-pill.active b{color:var(--lab-pink)!important}

  /* Make all navigation targets explicit */
  [data-stage],
  [data-mobile-work],
  [data-assembly-open]{
    pointer-events:auto!important;
    touch-action:manipulation!important;
    -webkit-tap-highlight-color:rgba(236,34,107,.14);
  }
  .route-row{cursor:pointer!important}
  .screen-strategy .assembly-row{cursor:pointer!important}
}

/* =========================================================
   V15 — tabs cleanup, stable stage switching, strategy modal,
         cleaner field groups and modal header
   ========================================================= */

/* Stage navigation should read as tabs, not boxed buttons */
.stage-strip,
.subtabs{
  display:flex!important;
  gap:18px!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  scrollbar-width:none!important;
  border:0!important;
  background:transparent!important;
}
.stage-strip::-webkit-scrollbar,.subtabs::-webkit-scrollbar{display:none!important}
.stage-pill,.stage-pill.active,
.subtab,.subtab.active{
  position:relative!important;
  flex:0 0 auto!important;
  appearance:none!important;
  -webkit-appearance:none!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  background:transparent!important;
  color:#ead7de!important;
  padding:10px 4px 13px!important;
  min-height:0!important;
  font-weight:700!important;
}
.stage-pill{display:grid!important;gap:3px!important;text-align:center!important}
.stage-pill b,.stage-pill.active b{
  width:auto!important;height:auto!important;
  border:0!important;border-radius:0!important;
  background:transparent!important;
  color:#ead7de!important;
  font-size:13px!important;
  line-height:1!important;
}
.stage-pill span{font-size:12px!important;line-height:1.1!important}
.stage-pill.active,.subtab.active{color:#fff!important}
.stage-pill.active b{color:var(--lab-pink)!important}
.stage-pill:after,.subtab:after{
  content:""!important;
  position:absolute!important;
  left:0!important;right:0!important;bottom:0!important;
  height:3px!important;
  border-radius:999px!important;
  background:transparent!important;
}
.stage-pill.active:after,.subtab.active:after{
  background:var(--lab-gold-2)!important;
}

/* Keep stage tab rail stable beneath the app header */
@media(max-width:760px){
  .screen-stage .page-head{
    min-height:236px!important;
    height:236px!important;
    max-height:236px!important;
    display:flex!important;
    align-items:flex-start!important;
    overflow:hidden!important;
    padding-bottom:18px!important;
  }
  .screen-stage .page-head-left{min-width:0!important}
  .screen-stage .page-head h1{
    min-height:52px!important;
    max-height:58px!important;
    overflow:hidden!important;
    display:-webkit-box!important;
    -webkit-line-clamp:2!important;
    -webkit-box-orient:vertical!important;
  }
  .screen-stage .page-head p{
    min-height:56px!important;
    max-height:64px!important;
    overflow:hidden!important;
    display:-webkit-box!important;
    -webkit-line-clamp:3!important;
    -webkit-box-orient:vertical!important;
  }
  .screen-stage .stage-strip{
    position:sticky!important;
    top:var(--mobile-top-h,84px)!important;
    z-index:55!important;
    margin:0 -16px 14px!important;
    padding:5px 18px 0!important;
    min-height:66px!important;
    background:rgba(77,5,28,.96)!important;
    border-bottom:1px solid rgba(255,255,255,.08)!important;
    -webkit-backdrop-filter:blur(18px)!important;
    backdrop-filter:blur(18px)!important;
  }
  .screen-stage .subtabs{
    margin:4px 0 14px!important;
    min-height:46px!important;
    padding:0 2px!important;
  }
}

/* The active stage content card itself should keep a stable footprint */
.stage-head{
  min-height:196px!important;
  height:196px!important;
  max-height:196px!important;
}
.stage-copy p{
  display:-webkit-box!important;
  -webkit-line-clamp:3!important;
  -webkit-box-orient:vertical!important;
  overflow:hidden!important;
}

/* Field-group headers are section titles, not badges */
.field-group-head{
  padding:2px 2px 10px!important;
  margin:0!important;
  background:transparent!important;
  border:0!important;
}
.field-group-head h3{
  display:flex!important;
  align-items:center!important;
  gap:9px!important;
  width:auto!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  color:#fff!important;
  font-size:16px!important;
  line-height:1.25!important;
}
.field-group-head h3:before{
  content:""!important;
  width:7px!important;height:7px!important;
  flex:0 0 7px!important;
  border-radius:50%!important;
  background:var(--lab-pink)!important;
  margin:0!important;
}
.field-group .fields{background:transparent!important}

/* Editing modal header: no unused safe-area gap inside the sheet */
@media(max-width:760px){
  .modal-window-backdrop{
    padding-top:12px!important;
  }
  .drawer,.field-editor,.assembly-modal,.project-create-modal{
    height:min(calc(var(--editor-vh,100dvh) - 24px),84vh)!important;
    max-height:min(calc(var(--editor-vh,100dvh) - 24px),84vh)!important;
    border-radius:26px!important;
  }
  .drawer-head,.compact-modal-head{
    position:relative!important;
    padding:20px 64px 16px 18px!important;
    min-height:0!important;
  }
  .drawer-head h2,.compact-modal-head h2{font-size:22px!important;line-height:1.15!important}
  .drawer-head p,.compact-modal-head p{font-size:12px!important;margin-top:6px!important}
  .drawer-head .icon-btn.ghost,
  .modal-close-btn{
    position:absolute!important;
    top:14px!important;
    right:14px!important;
    width:44px!important;
    height:44px!important;
    min-width:44px!important;
    border:1px solid rgba(255,255,255,.16)!important;
    border-radius:14px!important;
    display:grid!important;
    place-items:center!important;
    padding:0!important;
    background:rgba(255,255,255,.08)!important;
    color:#fff!important;
    font-size:30px!important;
    line-height:1!important;
    font-weight:300!important;
  }
}

/* Strategy checks stay inside Strategy and open a modal */
.assembly-row{
  appearance:none!important;
  -webkit-appearance:none!important;
  width:100%!important;
  text-align:left!important;
  cursor:pointer!important;
}
.assembly-map{font-size:12px!important;color:#806c73!important}
.assembly-modal-block{margin-bottom:20px}
.assembly-modal-block>label{
  display:block;
  margin-bottom:9px;
  color:#9c315a;
  font-size:12px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.07em;
}
.assembly-modal-block select{
  width:100%;
  min-height:50px;
  border:1px solid #edd8e0;
  border-radius:14px;
  padding:0 14px;
  background:#fff8fb;
  color:var(--lab-wine-800);
  font-size:15px;
}
.assembly-stage-links{display:grid;gap:9px}
.assembly-stage-link{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  width:100%;
  min-height:50px;
  padding:11px 14px;
  border:1px solid rgba(236,34,107,.18);
  border-radius:14px;
  background:#fff8fb;
  color:var(--lab-wine-800);
  text-align:left;
  font-weight:700;
}
.assembly-stage-link span{color:var(--lab-pink);font-size:22px}

/* Glass cards use pink accents; gold remains only the tab runner / global chrome */
.route-row .arrow,
.assembly-row .arrow,
.field-mobile-value i,
.source-card .arrow,
.record-card .arrow{
  color:var(--lab-pink)!important;
}
.route-n,.assembly-num,.stage-badge{
  border-color:rgba(236,34,107,.52)!important;
  color:#b32659!important;
  background:rgba(255,243,248,.76)!important;
}
.stage-progress-wrap .bar i,
.route-progress .bar i,
.project-card-progress i{
  background-color:var(--lab-pink)!important;
  background-image:none!important;
}

/* =========================================================
   V16 — compact stages, clean tabs, neutral glass, stable editor
   ========================================================= */

/* Neutral glass instead of dirty pink cards */
:root{
  --glass-clean:rgba(255,255,255,.88);
  --glass-clean-strong:rgba(255,255,255,.94);
  --glass-border:rgba(255,255,255,.34);
  --glass-shadow:0 10px 28px rgba(25,0,8,.16);
}

.project-card,
.focus-card,
.mini-stat,
.route-row,
.assembly-row,
.strategy-summary,
.source-card,
.history-card,
.version-card,
.record-card,
.task-panel,
.field,
.surface.empty-state,
.more-actions,
.context-card{
  background:var(--glass-clean)!important;
  border:1px solid var(--glass-border)!important;
  box-shadow:var(--glass-shadow)!important;
  -webkit-backdrop-filter:blur(22px) saturate(135%)!important;
  backdrop-filter:blur(22px) saturate(135%)!important;
}

/* Stage intro lives directly on the main wine background */
.stage-intro-plain{
  color:#fff;
  margin:0 2px 10px;
  height:168px;
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
  overflow:hidden;
}
.stage-intro-eyebrow{
  color:var(--lab-pink-2);
  font-size:12px;
  font-weight:850;
  letter-spacing:.10em;
  margin-bottom:7px;
}
.stage-intro-plain h1{
  margin:0;
  color:#fff;
  font-size:27px;
  line-height:1.08;
  letter-spacing:-.025em;
  max-height:58px;
  overflow:hidden;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
}
.stage-intro-plain>p{
  margin:9px 0 0;
  color:#ead8df;
  font-size:13px;
  line-height:1.42;
  max-height:56px;
  overflow:hidden;
  display:-webkit-box;
  -webkit-line-clamp:3;
  -webkit-box-orient:vertical;
}
.stage-intro-meta{
  margin-top:auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  min-height:28px;
}
.stage-intro-progress{display:flex;align-items:center;gap:10px;min-width:0;flex:1;max-width:430px}
.stage-intro-progress .bar{height:5px;flex:1;background:rgba(255,255,255,.14)!important;border-radius:999px;overflow:hidden}
.stage-intro-progress .bar i{display:block;height:100%;background:var(--lab-pink)!important;border-radius:inherit}
.stage-intro-progress strong{color:#fff;font-size:12px;min-width:32px;text-align:right}
.stage-intro-plain .method-link{
  color:#f7dbe5!important;
  background:transparent!important;
  border:0!important;
  padding:3px 0!important;
  font-size:11px!important;
}
.stage-intro-plain .method-box{
  margin-top:7px!important;
  padding-top:7px!important;
  border-top:1px solid rgba(255,255,255,.10)!important;
  color:#e9d6dd!important;
  font-size:11px!important;
  max-height:58px;
  overflow:auto;
}

/* Stage tabs: pure text navigation, no boxes */
.screen-stage .stage-strip,
.screen-stage .subtabs{
  display:flex!important;
  gap:22px!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  scrollbar-width:none!important;
  border:0!important;
  box-shadow:none!important;
}
.screen-stage .stage-strip::-webkit-scrollbar,
.screen-stage .subtabs::-webkit-scrollbar{display:none!important}

.screen-stage .stage-strip{
  position:sticky!important;
  top:var(--mobile-top-h,84px)!important;
  z-index:56!important;
  margin:0 -16px 12px!important;
  padding:0 18px!important;
  min-height:54px!important;
  height:54px!important;
  align-items:flex-end!important;
  background:rgba(72,5,26,.96)!important;
  border-bottom:1px solid rgba(255,255,255,.08)!important;
  -webkit-backdrop-filter:blur(18px)!important;
  backdrop-filter:blur(18px)!important;
}
.screen-stage .stage-pill,
.screen-stage .stage-pill.active{
  flex:0 0 auto!important;
  min-width:auto!important;
  height:54px!important;
  display:flex!important;
  align-items:center!important;
  gap:6px!important;
  padding:0 2px 11px!important;
  margin:0!important;
  border:0!important;
  outline:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  color:#dbc6ce!important;
  font-size:12px!important;
  font-weight:750!important;
}
.screen-stage .stage-pill b,
.screen-stage .stage-pill.active b{
  width:auto!important;height:auto!important;
  background:transparent!important;
  border:0!important;border-radius:0!important;
  color:inherit!important;
  font-size:12px!important;
  line-height:1!important;
}
.screen-stage .stage-pill span{font-size:12px!important;line-height:1!important;white-space:nowrap}
.screen-stage .stage-pill.active{color:#fff!important}
.screen-stage .stage-pill.active b{color:var(--lab-pink-2)!important}
.screen-stage .stage-pill:after,
.screen-stage .stage-pill.active:after{
  content:""!important;
  position:absolute!important;
  left:0!important;right:0!important;bottom:0!important;
  height:3px!important;
  border-radius:999px!important;
  background:transparent!important;
}
.screen-stage .stage-pill.active:after{background:var(--lab-gold-2)!important}

.screen-stage .subtabs{
  margin:0 0 12px!important;
  padding:0 2px!important;
  min-height:40px!important;
  height:40px!important;
  align-items:flex-end!important;
  background:transparent!important;
}
.screen-stage .subtab,
.screen-stage .subtab.active{
  position:relative!important;
  flex:0 0 auto!important;
  height:40px!important;
  min-height:40px!important;
  padding:0 1px 10px!important;
  border:0!important;
  outline:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  color:#dbc6ce!important;
  font-size:12px!important;
  font-weight:760!important;
  white-space:nowrap!important;
}
.screen-stage .subtab.active{color:#fff!important}
.screen-stage .subtab:after,
.screen-stage .subtab.active:after{
  content:""!important;
  position:absolute!important;
  left:0!important;right:0!important;bottom:0!important;
  height:3px!important;
  border-radius:999px!important;
  background:transparent!important;
}
.screen-stage .subtab.active:after{background:var(--lab-gold-2)!important}

/* No duplicate giant stage card */
.screen-stage .page-head,
.screen-stage .stage-head{display:none!important}

/* Field groups: simple heading on the background, not a badge/card */
.screen-stage .field-group{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  margin:0 0 18px!important;
  overflow:visible!important;
}
.screen-stage .field-group-head{
  margin:0 0 9px!important;
  padding:0 3px!important;
  background:transparent!important;
  border:0!important;
}
.screen-stage .field-group-head h3{
  margin:0!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  border-radius:0!important;
  color:#fff!important;
  font-size:16px!important;
  font-weight:800!important;
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
}
.screen-stage .field-group-head h3:before{
  content:""!important;
  width:6px!important;height:6px!important;
  flex:0 0 6px!important;
  border-radius:50%!important;
  background:var(--lab-pink)!important;
  margin:0!important;
}
.screen-stage .fields{display:grid!important;gap:10px!important;background:transparent!important}
.screen-stage .field{
  border-radius:18px!important;
  padding:13px 14px!important;
  background:var(--glass-clean-strong)!important;
  border:1px solid var(--glass-border)!important;
  box-shadow:0 8px 20px rgba(20,0,8,.12)!important;
}
.screen-stage .field label{color:var(--lab-wine-800)!important;font-size:12px!important;font-weight:820!important}
.screen-stage .field-mobile-value{color:#65545b!important}
.screen-stage .field-mobile-value i{color:var(--lab-pink)!important}

/* Records/task cards stay compact */
.screen-stage .task-panel{padding:13px!important;border-radius:20px!important;background:var(--glass-clean)!important}
.screen-stage .records-toolbar{position:static!important;background:transparent!important;padding:0 0 10px!important}
.screen-stage .empty-state{padding:24px 16px!important}
.screen-stage .record-card{padding:12px 13px!important;border-radius:16px!important;background:var(--glass-clean-strong)!important}

/* Modal/editor: fixed in place, shrink above keyboard, never jump with viewport offset */
@media(max-width:760px){
  .modal-window-backdrop,
  .modal-backdrop{
    position:fixed!important;
    top:0!important;left:0!important;right:0!important;bottom:auto!important;
    height:var(--editor-vh,100dvh)!important;
    padding:12px!important;
    padding-bottom:max(12px,env(safe-area-inset-bottom))!important;
    display:flex!important;
    align-items:flex-end!important;
    justify-content:center!important;
    background:rgba(28,0,10,.62)!important;
    overflow:hidden!important;
  }
  .drawer,.field-editor,.assembly-modal,.project-create-modal{
    width:100%!important;
    max-width:760px!important;
    height:min(calc(var(--editor-vh,100dvh) - 24px),78vh)!important;
    max-height:min(calc(var(--editor-vh,100dvh) - 24px),78vh)!important;
    border-radius:24px!important;
    overflow:hidden!important;
    transform:none!important;
  }
  .drawer-head,.compact-modal-head{
    padding:16px 60px 13px 17px!important;
    min-height:0!important;
  }
  .drawer-head .icon-btn.ghost,
  .modal-close-btn{
    top:10px!important;right:10px!important;
    width:44px!important;height:44px!important;min-width:44px!important;
    font-size:28px!important;
  }
  .drawer-body{min-height:0!important;overflow:auto!important;-webkit-overflow-scrolling:touch!important}
  .single-field-editor textarea{
    min-height:100%!important;
    font-size:17px!important;
    line-height:1.48!important;
    padding:2px 0 28px!important;
  }
}

/* More screen: versions, not an endless operation log */
.version-list{display:grid;gap:10px}
.version-card{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 15px;border-radius:18px;color:var(--lab-wine-900)}
.version-card h3{margin:0;font-size:14px}.version-card p{margin:4px 0 0;font-size:11px;color:#746169}
.version-badge{font-size:10px;color:var(--lab-pink);font-weight:800;text-transform:uppercase;letter-spacing:.06em}
.compact-empty{padding:20px!important}

/* Remove remaining gradient runners */
.stage-pill.active:after,
.subtab.active:after,
.mobile-bottom button.active:before,
.bar i,
.project-card-progress i,
.stage-intro-progress .bar i{
  background-image:none!important;
}

@media(max-width:760px){
  /* Keep the editor below the iPhone status area even when the keyboard shrinks the visual viewport */
  .modal-window-backdrop,.modal-backdrop{
    padding-top:max(54px,calc(env(safe-area-inset-top) + 8px))!important;
  }
  .drawer,.field-editor,.assembly-modal,.project-create-modal{
    height:min(calc(var(--editor-vh,100dvh) - 74px),78vh)!important;
    max-height:min(calc(var(--editor-vh,100dvh) - 74px),78vh)!important;
  }
}

/* =========================================================
   V17 — clear stage architecture + clean tabs + robust editor
   ========================================================= */

/* Overview is a dashboard, not a duplicate of the Stage workspace */
.overview-next-card{
  appearance:none;-webkit-appearance:none;width:100%;text-align:left;border:1px solid var(--glass-border)!important;
  display:grid;grid-template-columns:42px minmax(0,1fr) 18px;gap:13px;align-items:center;
  padding:14px 15px!important;border-radius:20px!important;background:var(--glass-clean)!important;color:var(--lab-wine-900)!important;
  box-shadow:var(--glass-shadow)!important;cursor:pointer;
}
.overview-next-card .focus-num{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;border:1.5px solid var(--lab-pink)!important;color:var(--lab-pink)!important;background:rgba(255,255,255,.42)!important;font-weight:850}
.overview-next-copy h3{margin:0;color:#c82f68!important;font-size:17px;line-height:1.18}.overview-next-copy p{margin:4px 0 0;color:#65545b!important;font-size:13px;line-height:1.4}.overview-next-arrow{color:var(--lab-pink);font-size:26px}
.overview-stage-summary{appearance:none;-webkit-appearance:none;width:100%;display:grid;grid-template-columns:minmax(0,1fr) auto 16px;gap:12px;align-items:center;text-align:left;margin-top:14px;padding:14px 15px;border-radius:18px;border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.07);color:#fff;cursor:pointer}
.overview-stage-summary strong{display:block;font-size:15px}.overview-stage-summary span{display:block;margin-top:4px;color:#dbc9d0;font-size:11px;line-height:1.35}.overview-stage-summary b{color:var(--lab-pink-2);font-size:14px}.overview-stage-summary i{font-style:normal;color:#fff;font-size:22px}

/* Stage screen: navigation sits on the SAME wine canvas — no dirty band */
.screen-stage .stage-strip{
  background:var(--lab-wine-950)!important;
  border:0!important;
  box-shadow:none!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
  gap:26px!important;
  min-height:62px!important;height:62px!important;
  align-items:stretch!important;
}
.screen-stage .stage-pill,
.screen-stage .stage-pill.active{
  position:relative!important;
  min-width:88px!important;
  height:62px!important;
  display:grid!important;
  grid-template-rows:auto auto!important;
  align-content:center!important;
  justify-items:center!important;
  gap:5px!important;
  padding:5px 1px 10px!important;
  border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;
  color:#dcc9d0!important;
}
.screen-stage .stage-pill b,
.screen-stage .stage-pill.active b{display:block!important;font-size:15px!important;line-height:1!important;font-weight:850!important;color:inherit!important}
.screen-stage .stage-pill span{display:block!important;font-size:12px!important;line-height:1.08!important;font-weight:760!important;text-align:center!important}
.screen-stage .stage-pill.active{color:#fff!important}
.screen-stage .stage-pill.active b{color:var(--lab-pink-2)!important}
.screen-stage .stage-pill:after,.screen-stage .stage-pill.active:after{height:3px!important;left:8px!important;right:8px!important;background:transparent!important}
.screen-stage .stage-pill.active:after{background:var(--lab-gold-2)!important}

/* Inner tabs: text only, no panel/fill behind them */
.screen-stage .subtabs{
  background:transparent!important;
  border:0!important;box-shadow:none!important;
  gap:26px!important;margin:2px 0 14px!important;padding:0 3px!important;height:42px!important;min-height:42px!important;
}
.screen-stage .subtab,.screen-stage .subtab.active{
  height:42px!important;min-height:42px!important;padding:0 0 10px!important;
  border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;
  color:#dbc8cf!important;font-size:13px!important;font-weight:760!important;
}
.screen-stage .subtab.active{color:#fff!important}.screen-stage .subtab.active:after{background:var(--lab-gold-2)!important}

/* Group titles live on the base canvas, no filled header strip */
.screen-stage .field-group-head{background:transparent!important;box-shadow:none!important;border:0!important;padding:0 4px 8px!important;margin:0!important}
.screen-stage .field-group-head h3{background:transparent!important;box-shadow:none!important;border:0!important;padding:0!important;color:#fff!important;font-size:16px!important;border-radius:0!important}
.screen-stage .field-group-head h3:before{background:var(--lab-pink)!important;width:6px!important;height:6px!important}

/* Neutral clean glass for editable fields, not muddy pink */
.screen-stage .field,
.drawer-body .field,
.drawer-body .drawer-entry-field{
  background:rgba(255,252,251,.96)!important;
  border:1px solid rgba(255,255,255,.72)!important;
  box-shadow:0 8px 22px rgba(22,0,8,.14)!important;
}
.screen-stage .field label,.drawer-body .field label{color:var(--lab-wine-800)!important}

/* Empty state plus is a real button */
.empty-add-btn{border:1px solid rgba(236,34,107,.18)!important;cursor:pointer!important;color:var(--lab-pink)!important}
.empty-add-btn:active{transform:scale(.97)}

/* Record editor: roomy writing fields */
.drawer-entry-field{padding:13px 14px!important;border-radius:16px!important;margin-bottom:2px!important}
.drawer-entry-field textarea{
  display:block!important;
  width:100%!important;
  min-height:118px!important;
  max-height:none!important;
  padding:10px 11px!important;
  border:1px solid #eadde2!important;
  border-radius:13px!important;
  background:#fff!important;
  color:var(--lab-wine-900)!important;
  font-size:16px!important;line-height:1.48!important;
  resize:vertical!important;
}
.drawer-entry-field textarea:focus{border-color:rgba(236,34,107,.52)!important;box-shadow:0 0 0 3px rgba(236,34,107,.08)!important}

/* Stable modal over iOS keyboard */
html.editor-open,body.editor-open{overflow:hidden!important;overscroll-behavior:none!important}
@media(max-width:760px){
  .modal-backdrop,.modal-window-backdrop{
    top:var(--editor-vtop,0px)!important;
    height:var(--editor-vh,100dvh)!important;
    padding:10px 12px max(10px,env(safe-area-inset-bottom))!important;
    align-items:flex-end!important;
  }
  .drawer,.field-editor,.assembly-modal,.project-create-modal{
    height:min(calc(var(--editor-vh,100dvh) - 18px),80vh)!important;
    max-height:min(calc(var(--editor-vh,100dvh) - 18px),80vh)!important;
  }
  .drawer-body{scroll-padding-top:18px!important;scroll-padding-bottom:28px!important}
  .drawer-entry-field textarea{min-height:132px!important}
}

/* =========================================================
   V18 — compact tabs, dashboard route, note-style record editor
   ========================================================= */

/* Stage navigation: compact two-line tabs, no filled band */
.screen-stage .stage-strip{
  gap:14px!important;
  min-height:52px!important;
  height:52px!important;
  padding:0 2px!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}
.screen-stage .stage-pill,
.screen-stage .stage-pill.active{
  min-width:68px!important;
  height:52px!important;
  display:grid!important;
  grid-template-rows:14px 18px!important;
  align-content:center!important;
  justify-items:center!important;
  gap:3px!important;
  padding:5px 0 8px!important;
  margin:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  color:#d9c5cc!important;
}
.screen-stage .stage-pill b,
.screen-stage .stage-pill.active b{
  font-size:12px!important;
  line-height:14px!important;
  font-weight:850!important;
}
.screen-stage .stage-pill span{
  font-size:10.5px!important;
  line-height:17px!important;
  font-weight:720!important;
}
.screen-stage .stage-pill.active{color:#fff!important}
.screen-stage .stage-pill.active b{color:var(--lab-pink-2)!important}
.screen-stage .stage-pill:after,
.screen-stage .stage-pill.active:after{
  left:8px!important;right:8px!important;bottom:0!important;height:3px!important;
}
.screen-stage .stage-pill.active:after{background:var(--lab-gold-2)!important}

/* Inner tabs: compact text navigation */
.screen-stage .subtabs{
  gap:20px!important;
  height:36px!important;
  min-height:36px!important;
  margin:0 0 14px!important;
  padding:0 2px!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}
.screen-stage .subtab,
.screen-stage .subtab.active{
  height:36px!important;
  min-height:36px!important;
  padding:0 0 8px!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  font-size:11.5px!important;
  font-weight:750!important;
  color:#d8c4cb!important;
}
.screen-stage .subtab.active{color:#fff!important}
.screen-stage .subtab.active:after{background:var(--lab-gold-2)!important}

/* Remove all legacy group-fill artifacts under section titles */
.screen-stage .field-groups,
.screen-stage .field-group,
.screen-stage .field-group .fields,
.screen-stage .field-group-head{
  background:transparent!important;
  background-image:none!important;
  border:0!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}
.screen-stage .field-group:before,
.screen-stage .field-group:after,
.screen-stage .field-group-head:before,
.screen-stage .field-group-head:after,
.screen-stage .fields:before,
.screen-stage .fields:after{display:none!important;content:none!important}
.screen-stage .field-group{padding:0!important;margin:0 0 18px!important;overflow:visible!important}
.screen-stage .field-group-head{padding:0 3px 8px!important;margin:0!important}
.screen-stage .field-group-head h3{
  padding:0!important;margin:0!important;background:none!important;border:0!important;border-radius:0!important;box-shadow:none!important;
  color:#fff!important;font-size:15px!important;line-height:1.2!important;font-weight:800!important;
}
.screen-stage .field-group-head h3:before{width:6px!important;height:6px!important;background:var(--lab-pink)!important}

/* Dashboard: compact Continue card and collapsible seven-stage route */
.overview-continue-card{
  width:100%;appearance:none;-webkit-appearance:none;border:1px solid rgba(255,255,255,.12);border-radius:18px;
  background:rgba(255,255,255,.075);color:#fff;text-align:left;padding:12px 14px;margin:14px 0 18px;cursor:pointer;
  box-shadow:0 8px 18px rgba(20,0,8,.10)
}
.overview-continue-kicker{display:block;color:var(--lab-pink-2);font-size:10px;font-weight:850;letter-spacing:.12em;text-transform:uppercase;margin-bottom:5px}
.overview-continue-main{display:grid;grid-template-columns:minmax(0,1fr) 18px;gap:10px;align-items:center}
.overview-continue-main strong{display:block;font-size:15px;line-height:1.25;color:#fff}
.overview-continue-main small{display:block;margin-top:3px;color:#d9c4cb;font-size:11px;line-height:1.35;font-weight:500}
.overview-continue-main i{font-style:normal;font-size:24px;color:var(--lab-pink-2)}
.overview-state-title{margin-top:0!important}

.overview-route-panel{
  margin-top:16px;border:1px solid rgba(255,255,255,.13);border-radius:18px;background:rgba(255,255,255,.065);overflow:hidden;color:#fff;
}
.overview-route-panel summary{
  list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 14px;
}
.overview-route-panel summary::-webkit-details-marker{display:none}
.overview-route-panel summary strong{display:block;font-size:14px;color:#fff}
.overview-route-panel summary small{display:block;margin-top:2px;font-size:10px;color:#d5c1c8}
.overview-route-summary-right{display:flex;align-items:center;gap:9px;flex:none}
.overview-route-summary-right b{color:var(--lab-pink-2);font-size:13px}
.overview-route-summary-right i{font-style:normal;color:#fff;transition:transform .16s}
.overview-route-panel[open] .overview-route-summary-right i{transform:rotate(180deg)}
.overview-route-list{padding:0 9px 9px;display:grid;gap:6px}
.overview-route-row{
  appearance:none;-webkit-appearance:none;width:100%;display:grid;grid-template-columns:28px minmax(0,1fr) 16px;gap:9px;align-items:center;text-align:left;
  padding:9px 8px;border:0;border-top:1px solid rgba(255,255,255,.075);background:transparent;color:#fff;cursor:pointer;
}
.overview-route-row.current{background:rgba(236,34,107,.08);border-radius:12px;border-top-color:transparent}
.overview-route-num{width:26px;height:26px;border-radius:9px;border:1px solid rgba(255,255,255,.22);display:grid;place-items:center;font-size:10px;font-weight:850;color:#fff}
.overview-route-row.current .overview-route-num{border-color:rgba(255,93,153,.7);color:var(--lab-pink-2)}
.overview-route-copy{min-width:0}.overview-route-copy>strong{display:block;font-size:11.5px;line-height:1.18;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.overview-route-copy>span{display:grid;grid-template-columns:minmax(0,1fr) 28px;align-items:center;gap:7px;margin-top:4px}
.overview-route-copy i{height:3px;border-radius:99px;background:rgba(255,255,255,.13);overflow:hidden}
.overview-route-copy i b{display:block;height:100%;background:var(--lab-pink-2);border-radius:inherit}
.overview-route-copy em{font-style:normal;font-size:9px;color:#d7c3ca;text-align:right}
.overview-route-arrow{font-size:18px;color:var(--lab-pink-2)}

/* Record editor: one continuous note sheet, not nested cards */
.record-note-drawer .drawer-body{background:#fbf8f6!important}
.record-note-body{padding:12px 14px 18px!important}
.record-note-sheet{
  background:#fffdfb;border:1px solid #efe5e5;border-radius:20px;overflow:hidden;box-shadow:0 8px 22px rgba(38,0,13,.08)
}
.note-group{padding:0!important;margin:0!important;background:transparent!important}
.note-group+ .note-group{border-top:8px solid #f7f1ef}
.note-group h3{
  margin:0;padding:12px 16px 8px;color:#c42f67;font-size:11px;font-weight:850;letter-spacing:.08em;text-transform:uppercase;background:#fffdfb
}
.note-field{padding:0 16px;background:#fffdfb}
.note-field+ .note-field{border-top:1px solid #f0e6e7}
.note-field label{display:block;padding-top:11px;color:var(--lab-wine-800);font-size:12px;font-weight:850}
.note-field textarea{
  width:100%;height:auto;min-height:72px;max-height:none;overflow:hidden!important;resize:none;border:0!important;outline:0!important;
  padding:7px 0 12px;background:transparent!important;color:var(--lab-wine-900);font-size:16px;line-height:1.48;box-shadow:none!important;
}
.note-field textarea::placeholder{color:#b9adaf}
.note-field:focus-within{box-shadow:inset 3px 0 var(--lab-pink)!important;background:#fffafb}

/* Role switch: one clear active state, actually visible */
.record-note-drawer .role-choice{gap:7px;margin:0 0 10px;padding:0 1px}
.record-note-drawer .role-choice button,
.record-note-drawer .role-choice button.fact,
.record-note-drawer .role-choice button.hyp,
.record-note-drawer .role-choice button.decision{
  border:1px solid #e8dcdf;background:#fff;color:var(--lab-wine-800);border-radius:999px;padding:7px 12px;font-size:11px;font-weight:800;box-shadow:none
}
.record-note-drawer .role-choice button.active{
  border-color:rgba(236,34,107,.5)!important;background:var(--lab-pink-soft)!important;color:#a91f52!important;box-shadow:inset 0 0 0 1px rgba(236,34,107,.10)!important
}

/* Modal must not jump when iOS keyboard changes viewport */
html.editor-open,body.editor-open{overflow:hidden!important}
@media(max-width:760px){
  .modal-backdrop,.modal-window-backdrop{
    top:0!important;bottom:auto!important;height:var(--editor-vh,100dvh)!important;
    padding:10px 12px max(10px,env(safe-area-inset-bottom))!important;
    align-items:flex-end!important;overflow:hidden!important;
  }
  .record-note-drawer{
    height:min(calc(var(--editor-vh,100dvh) - 18px),82vh)!important;
    max-height:min(calc(var(--editor-vh,100dvh) - 18px),82vh)!important;
    border-radius:24px!important;
  }
  .record-note-drawer .drawer-body{scroll-padding:14px 0 26px!important;overscroll-behavior:contain!important}
  .note-field textarea{font-size:16px!important}
  .note-field textarea:focus{min-height:150px!important}
}

/* =========================================================
   V19 — clean route, methodology popover, non-jumping editors
   ========================================================= */

/* Dashboard route: no single enclosing card; each stage is independently readable */
.overview-route-panel{
  margin-top:16px!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  overflow:visible!important;
}
.overview-route-panel>summary{
  padding:4px 2px 10px!important;
  border:0!important;
  background:transparent!important;
}
.overview-route-panel>summary strong{font-size:17px!important;line-height:1.2!important}
.overview-route-panel>summary small{font-size:11.5px!important;color:#d8c5cc!important;margin-top:3px!important}
.overview-route-list{padding:0!important;display:grid!important;gap:8px!important}
.overview-route-row,
.overview-route-row.current{
  padding:11px 12px!important;
  grid-template-columns:32px minmax(0,1fr) 18px!important;
  gap:10px!important;
  border:1px solid rgba(255,255,255,.11)!important;
  border-radius:14px!important;
  background:rgba(255,255,255,.055)!important;
  box-shadow:none!important;
}
.overview-route-row.current{background:rgba(236,34,107,.095)!important;border-color:rgba(255,93,153,.22)!important}
.overview-route-num{width:29px!important;height:29px!important;border-radius:9px!important;font-size:11px!important}
.overview-route-copy>strong{font-size:14px!important;line-height:1.22!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important}
.overview-route-copy>span{grid-template-columns:minmax(0,1fr) 34px!important;margin-top:6px!important}
.overview-route-copy em{font-size:10.5px!important}
.overview-route-copy i{height:4px!important}

/* Methodology becomes a small popover, not an inline white field */
.method-popover{
  position:fixed;z-index:400;
  padding:12px 13px 13px;
  border-radius:14px;
  background:rgba(255,251,249,.97);
  border:1px solid rgba(255,255,255,.7);
  box-shadow:0 16px 40px rgba(20,0,8,.28);
  color:var(--lab-wine-900);
  -webkit-backdrop-filter:blur(18px) saturate(130%);
  backdrop-filter:blur(18px) saturate(130%);
}
.method-popover-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.method-popover-head strong{font-size:13px;color:var(--lab-wine-900)}
.method-popover-head button{border:0;background:transparent;color:var(--lab-wine-800);font-size:21px;line-height:1;width:28px;height:28px;border-radius:50%}
.method-popover p{margin:7px 0 0;font-size:12px;line-height:1.42;color:#65555c;word-break:break-word}
.stage-intro-plain .method-box{display:none!important}

/* Sticky stage navigation is opaque so content never visually passes underneath */
@media(max-width:760px){
  .screen-stage .stage-strip{
    background:#56071f!important;
    -webkit-backdrop-filter:none!important;
    backdrop-filter:none!important;
    box-shadow:0 8px 16px rgba(36,0,12,.14)!important;
    border-bottom:1px solid rgba(255,255,255,.08)!important;
    isolation:isolate!important;
  }
  .screen-stage .stage-strip:before{
    content:"";position:absolute;inset:-1px -16px 0;z-index:-1;background:#56071f;
  }
  .screen-stage{scroll-padding-top:calc(var(--mobile-top-h,84px) + 58px)!important}
}

/* Editors: fixed full-height sheet; keyboard overlays it, content scrolls inside */
.editor-head-actions{display:flex;align-items:center;gap:8px;flex:none}
.editor-icon-btn{
  width:42px;height:42px;display:grid;place-items:center;
  border-radius:13px;border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.09);color:#fff;
}
.editor-icon-btn .ui-icon{width:22px;height:22px}
.editor-icon-btn.done{background:var(--lab-pink)!important;border-color:transparent!important;box-shadow:0 8px 18px rgba(236,34,107,.22)}
.editor-icon-btn.delete{background:rgba(255,255,255,.08)!important;color:#ffdce8!important}
.editor-topbar{padding-right:14px!important}
.compact-editor-shell{display:flex!important;flex-direction:column!important}
.compact-editor-body{flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;overscroll-behavior:contain!important}
.compact-editor-shell .drawer-foot{display:none!important}

@media(max-width:760px){
  html.editor-open,body.editor-open{overflow:hidden!important;overscroll-behavior:none!important}
  .modal-backdrop,.modal-window-backdrop{
    position:fixed!important;inset:0!important;
    height:100svh!important;
    padding:max(14px,calc(env(safe-area-inset-top) + 8px)) 12px 12px!important;
    align-items:flex-start!important;justify-content:center!important;
    background:rgba(24,0,9,.66)!important;
    overflow:hidden!important;
  }
  .compact-editor-shell,
  .record-note-drawer.compact-editor-shell,
  .field-editor.compact-editor-shell{
    width:100%!important;
    height:calc(100svh - max(32px,calc(env(safe-area-inset-top) + 20px)))!important;
    max-height:none!important;
    border-radius:24px!important;
    overflow:hidden!important;
    transform:none!important;
  }
  .editor-topbar{
    flex:0 0 auto!important;
    min-height:78px!important;
    padding:13px 12px 12px 16px!important;
    padding-top:13px!important;
  }
  .editor-topbar h2{font-size:21px!important;line-height:1.12!important;margin:0!important}
  .editor-topbar p{font-size:11px!important;margin-top:5px!important}
  .compact-editor-body{padding-bottom:34vh!important;scroll-padding-bottom:38vh!important}
  .record-note-body{padding:12px 13px 34vh!important}
  .single-field-editor{min-height:100%!important;display:flex!important}
  .single-field-editor textarea{
    flex:1 1 auto!important;width:100%!important;min-height:100%!important;
    resize:none!important;overflow-y:auto!important;
    font-size:17px!important;line-height:1.5!important;
    padding:4px 0 40vh!important;
  }
  .note-field textarea{min-height:74px!important;max-height:none!important;overflow:hidden!important}
}

/* =========================================================
   V20 — uniform route, seamless sticky stage nav, stable editors
   ========================================================= */

/* Dashboard: all seven stages are visually equal; gold carries structure */
.overview-route-row,
.overview-route-row.current{
  background:rgba(255,255,255,.055)!important;
  border-color:rgba(255,255,255,.11)!important;
  box-shadow:none!important;
}
.overview-route-num,
.overview-route-row.current .overview-route-num{
  border-color:rgba(229,189,93,.72)!important;
  color:var(--lab-gold-2)!important;
  background:rgba(229,189,93,.055)!important;
}
.overview-route-copy i b{background:var(--lab-pink-2)!important}
.overview-route-arrow{color:var(--lab-pink-2)!important}

/* Type selector is metadata, not content tabs */
.record-type-control{padding:0 1px 10px}
.record-type-label{display:block;margin:0 0 7px 2px;color:#8f7780;font-size:10px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
.record-note-drawer .role-choice{margin:0!important;gap:7px!important}
.record-note-drawer .role-choice button{
  display:inline-flex!important;align-items:center!important;gap:6px!important;
  padding:7px 11px!important;background:#fff!important;color:var(--lab-wine-800)!important;
  border:1px solid #eadfe2!important;border-radius:999px!important;
}
.record-note-drawer .role-choice button i{
  width:8px;height:8px;border-radius:50%;background:#d9cbd0;display:block;flex:none;
}
.record-note-drawer .role-choice button.active{
  background:var(--lab-pink-soft)!important;color:#a91f52!important;border-color:rgba(236,34,107,.55)!important;
  box-shadow:inset 0 0 0 1px rgba(236,34,107,.08)!important;
}
.record-note-drawer .role-choice button.active i{background:var(--lab-pink)!important}

@media(max-width:760px){
  /* Sticky stage navigation should visually merge with the page background. */
  .screen-stage .stage-strip{
    position:sticky!important;
    top:var(--mobile-top-h,84px)!important;
    z-index:56!important;
    margin:0 -16px 12px!important;
    padding:0 18px!important;
    min-height:54px!important;height:54px!important;
    background:var(--lab-wine-950)!important;
    border:0!important;
    box-shadow:none!important;
    -webkit-backdrop-filter:none!important;
    backdrop-filter:none!important;
    isolation:isolate!important;
  }
  .screen-stage .stage-strip:before{display:none!important;content:none!important}

  /* The content starts below the sticky navigation; nothing visually bleeds underneath it. */
  .screen-stage .workspace-grid,
  .screen-stage .subtabs{position:relative;z-index:1}
  .screen-stage{scroll-padding-top:calc(var(--mobile-top-h,84px) + 58px)!important}

  /* Editor shell stays anchored to the layout viewport; only its body scrolls. */
  html.editor-open,body.editor-open{overflow:hidden!important;height:100%!important}
  .modal-backdrop.modal-window-backdrop,
  .field-editor-backdrop{
    position:fixed!important;inset:0!important;height:100%!important;
    padding:0!important;align-items:stretch!important;justify-content:center!important;
    overflow:hidden!important;background:rgba(24,0,9,.68)!important;
  }
  .compact-editor-shell,
  .record-note-drawer.compact-editor-shell,
  .field-editor.compact-editor-shell{
    position:fixed!important;
    top:max(12px,calc(env(safe-area-inset-top) + 6px))!important;
    left:12px!important;right:12px!important;bottom:12px!important;
    width:auto!important;height:auto!important;max-height:none!important;
    margin:0!important;border-radius:24px!important;overflow:hidden!important;
    transform:none!important;
  }
  .editor-topbar{
    position:relative!important;top:auto!important;z-index:20!important;
    flex:0 0 auto!important;padding:14px 12px 12px 16px!important;
  }
  .compact-editor-body{
    flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;
    -webkit-overflow-scrolling:touch!important;overscroll-behavior:contain!important;
    scroll-padding-top:12px!important;scroll-padding-bottom:52vh!important;
  }
  .record-note-body{padding:12px 13px 52vh!important}
  .note-field{scroll-margin-top:10px!important;scroll-margin-bottom:48vh!important}
  .note-field textarea:focus{min-height:150px!important}
}

/* Native radio-backed record type selector for reliable iOS interaction */
.record-note-drawer .role-choice .role-option{display:inline-flex;cursor:pointer;position:relative}
.record-note-drawer .role-choice .role-option input{position:absolute;opacity:0;pointer-events:none}
.record-note-drawer .role-choice .role-option span{
  display:inline-flex;align-items:center;gap:6px;padding:7px 11px;border:1px solid #eadfe2;border-radius:999px;
  background:#fff;color:var(--lab-wine-800);font-size:11px;font-weight:800;line-height:1;
}
.record-note-drawer .role-choice .role-option span i{width:8px;height:8px;border-radius:50%;background:#d9cbd0;display:block;flex:none}
.record-note-drawer .role-choice .role-option input:checked + span{
  background:var(--lab-pink-soft);color:#a91f52;border-color:rgba(236,34,107,.55);
  box-shadow:inset 0 0 0 1px rgba(236,34,107,.08)
}
.record-note-drawer .role-choice .role-option input:checked + span i{background:var(--lab-pink)}

/* =========================================================
   V21 — visual viewport editor fix + seamless stage navigation
   ========================================================= */
@media(max-width:760px){
  /* One continuous wine field: sticky stage navigation is technically opaque,
     but visually indistinguishable from the page background. */
  .screen-stage.main,
  .screen-stage .main-inner{
    background:var(--lab-wine-950)!important;
  }
  .screen-stage .stage-strip{
    background:var(--lab-wine-950)!important;
    border:0!important;
    box-shadow:none!important;
    outline:0!important;
    -webkit-backdrop-filter:none!important;
    backdrop-filter:none!important;
  }
  .screen-stage .stage-strip:before,
  .screen-stage .stage-strip:after{display:none!important;content:none!important}

  /* Do not freeze the page with position:fixed. iOS will pan that layout viewport
     under the keyboard and push the modal header above the visible area. */
  html.editor-open,body.editor-open{
    overflow:hidden!important;
    height:auto!important;
    position:static!important;
  }
  body.editor-open{padding-bottom:0!important}
  body.editor-open .mobile-bottom{display:none!important}

  /* Root follows the actual visible iOS viewport. JS updates --vv-top/--vv-height
     on every visualViewport resize/scroll. */
  .modal-backdrop.modal-window-backdrop,
  .field-editor-backdrop{
    position:fixed!important;
    left:0!important;right:0!important;
    top:var(--vv-top,0px)!important;
    bottom:auto!important;
    width:100%!important;
    height:var(--vv-height,100dvh)!important;
    min-height:0!important;
    padding:max(8px,env(safe-area-inset-top)) 12px 8px!important;
    display:flex!important;
    align-items:stretch!important;
    justify-content:center!important;
    overflow:hidden!important;
    background:rgba(24,0,9,.68)!important;
    z-index:400!important;
  }

  .compact-editor-shell,
  .record-note-drawer.compact-editor-shell,
  .field-editor.compact-editor-shell{
    position:relative!important;
    top:auto!important;left:auto!important;right:auto!important;bottom:auto!important;
    width:100%!important;
    height:100%!important;
    max-height:100%!important;
    min-height:0!important;
    margin:0!important;
    border-radius:24px!important;
    overflow:hidden!important;
    transform:none!important;
    display:flex!important;
    flex-direction:column!important;
  }

  /* Header never participates in the scrolling content. */
  .compact-editor-shell .editor-topbar{
    position:relative!important;
    top:auto!important;
    z-index:30!important;
    flex:0 0 auto!important;
    min-height:76px!important;
    padding:13px 12px 12px 16px!important;
  }
  .compact-editor-shell .editor-topbar h2{margin:0!important}

  /* Only the white editor content scrolls. No keyboard-sized fake paddings. */
  .compact-editor-shell .compact-editor-body,
  .record-note-drawer .record-note-body{
    flex:1 1 auto!important;
    min-height:0!important;
    height:auto!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior:contain!important;
    scroll-padding-top:10px!important;
    scroll-padding-bottom:18px!important;
    padding-bottom:22px!important;
  }
  .record-note-drawer .record-note-body{padding:12px 13px 22px!important}
  .compact-editor-shell .note-field{scroll-margin-top:8px!important;scroll-margin-bottom:12px!important}

  /* Single project fields start directly under the fixed header and scroll as one note. */
  .single-field-editor{display:flex!important;min-height:100%!important;height:auto!important}
  .single-field-editor textarea{
    flex:1 1 auto!important;
    width:100%!important;
    min-height:100%!important;
    height:auto!important;
    padding:6px 2px 24px!important;
    overflow-y:auto!important;
    resize:none!important;
  }

  /* Record fields grow with content; the drawer body is the only scroll surface. */
  .note-field textarea,
  .note-field textarea:focus{
    min-height:76px!important;
    max-height:none!important;
    overflow:hidden!important;
  }
}

/* V23 — Tyurina workbook relations. Existing layout unchanged; only editor relation controls. */
.relation-field select{
  width:100%;
  min-height:46px;
  border:0;
  border-radius:0;
  background:transparent;
  color:var(--lab-wine-900);
  font:inherit;
  font-size:15px;
  line-height:1.35;
  padding:8px 28px 8px 0;
  outline:none;
}
.relation-field select:focus{box-shadow:inset 0 -2px 0 var(--lab-pink)}
.relation-field small{display:block;margin-top:3px;color:var(--muted);font-size:10px;line-height:1.35}
.record-links-back{margin:14px 0 4px;padding-top:12px;border-top:1px solid rgba(91,14,42,.12)}
.record-links-back>h3{margin:0 0 8px;color:var(--lab-wine-700);font-size:11px;text-transform:uppercase;letter-spacing:.08em}
.record-backlink{display:grid;grid-template-columns:auto 1fr;gap:2px 8px;padding:8px 0;border-bottom:1px solid rgba(91,14,42,.08)}
.record-backlink:last-child{border-bottom:0}
.record-backlink span{color:var(--lab-pink);font-size:10px;font-weight:800}
.record-backlink strong{color:var(--lab-wine-900);font-size:12px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.record-backlink small{grid-column:2;color:var(--muted);font-size:9px}

/* V23.2 — compact relation picker UI */
.relation-field{position:relative}
.relation-picker-trigger{
  width:100%;
  min-height:46px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border:0;
  background:transparent;
  padding:8px 0;
  color:var(--lab-wine-900);
  font:inherit;
  font-size:15px;
  line-height:1.35;
  text-align:left;
  cursor:pointer;
}
.relation-picker-trigger.has-value .relation-picker-value{font-weight:760}
.relation-picker-value{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.relation-picker-chevron{flex:none;color:var(--lab-pink);font-size:18px;line-height:1}
.relation-field small{display:block;margin-top:0;color:var(--muted);font-size:10px;line-height:1.35}

.relation-picker-layer{
  position:fixed;
  inset:0;
  z-index:460;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  padding:14px 14px calc(14px + env(safe-area-inset-bottom));
  background:rgba(34,0,12,.30);
  -webkit-backdrop-filter:blur(4px);
  backdrop-filter:blur(4px);
}
.relation-picker-card{
  width:min(100%,560px);
  max-height:min(62vh,520px);
  background:rgba(255,252,250,.98);
  border:1px solid rgba(117,20,53,.12);
  border-radius:22px;
  box-shadow:0 22px 54px rgba(26,0,9,.28);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
.relation-picker-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:15px 16px 12px;
  border-bottom:1px solid rgba(117,20,53,.08);
}
.relation-picker-head strong{display:block;color:var(--lab-wine-900);font-size:15px}
.relation-picker-head small{display:block;color:var(--muted);font-size:10px;margin-top:2px}
.relation-picker-close{
  width:34px;height:34px;border-radius:11px;border:0;
  background:rgba(117,20,53,.07);color:var(--lab-wine-900);
  font-size:22px;line-height:1;cursor:pointer
}
.relation-picker-list{overflow:auto;-webkit-overflow-scrolling:touch;padding:6px}
.relation-picker-option{
  width:100%;
  min-height:54px;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  padding:10px 12px;
  border:0;
  border-radius:15px;
  background:transparent;
  color:var(--lab-wine-900);
  text-align:left;
  font:inherit;
  cursor:pointer;
}
.relation-picker-option+ .relation-picker-option{margin-top:2px}
.relation-picker-option:hover,.relation-picker-option:focus-visible{background:rgba(239,88,149,.07)}
.relation-picker-option.selected{background:rgba(239,88,149,.11);box-shadow:inset 3px 0 0 var(--lab-pink)}
.relation-picker-option span{font-size:14px;font-weight:720;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.relation-picker-option small{font-size:9px;color:var(--muted);margin:0}
.relation-picker-option.empty{grid-template-columns:1fr}

@media(max-width:760px){
  .relation-picker-trigger{font-size:16px!important}
  .relation-picker-layer{padding:12px 12px calc(12px + env(safe-area-inset-bottom))!important}
  .relation-picker-card{max-height:58vh!important;border-radius:20px!important}
  .relation-picker-option{min-height:52px!important}
}

/* V23.3 — relation picker anchored to the field; relation row unified with note fields */
.relation-field{
  position:relative;
  background:#fffdfb!important;
  padding:0 16px!important;
}
.relation-field label{
  display:block;
  padding-top:11px!important;
  color:var(--lab-wine-800)!important;
  font-size:12px!important;
  font-weight:850!important;
}
.relation-picker-trigger{
  min-height:64px!important;
  padding:7px 0 11px!important;
  align-items:center!important;
  border-radius:0!important;
  background:transparent!important;
}
.relation-picker-trigger.has-value .relation-picker-value{font-weight:720!important}
.relation-picker-value{
  font-size:16px!important;
  line-height:1.4!important;
  color:var(--lab-wine-900)!important;
}
.relation-picker-chevron{
  width:30px!important;
  height:30px!important;
  display:grid!important;
  place-items:center!important;
  font-size:20px!important;
  color:var(--lab-pink)!important;
  transform:translateY(-1px);
}
.relation-field small{
  margin:-7px 0 9px!important;
  color:#9d8d92!important;
  font-size:10px!important;
}
.relation-field:focus-within{
  box-shadow:inset 3px 0 var(--lab-pink)!important;
  background:#fffafb!important;
}

.relation-picker-layer,
.relation-picker-layer.anchored{
  position:fixed!important;
  inset:0!important;
  z-index:470!important;
  display:block!important;
  padding:0!important;
  background:transparent!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
  pointer-events:auto!important;
}
.relation-picker-card{
  position:fixed!important;
  left:auto;
  top:auto;
  width:auto;
  max-width:calc(100vw - 24px)!important;
  max-height:min(46vh,360px)!important;
  border-radius:16px!important;
  border:1px solid rgba(117,20,53,.11)!important;
  background:rgba(255,252,250,.99)!important;
  box-shadow:0 14px 34px rgba(26,0,9,.22)!important;
  overflow:hidden!important;
}
.relation-picker-head{
  padding:10px 12px 8px!important;
  gap:8px!important;
}
.relation-picker-head strong{font-size:13px!important}
.relation-picker-head small{font-size:9px!important}
.relation-picker-close{
  width:28px!important;
  height:28px!important;
  border-radius:9px!important;
  font-size:18px!important;
}
.relation-picker-list{padding:4px!important;max-height:280px!important}
.relation-picker-option{
  min-height:46px!important;
  padding:8px 10px!important;
  border-radius:12px!important;
}
.relation-picker-option span{font-size:13px!important}
.relation-picker-option small{font-size:8px!important}

@media(max-width:760px){
  .relation-picker-card{max-height:min(42vh,330px)!important;border-radius:15px!important}
  .relation-picker-option{min-height:46px!important}
}


/* V24 — stage flow / source-of-truth refinements */
.relation-picker-card{
  border:1px solid rgba(114,20,52,.32)!important;
}
.derived-data-group{
  background:rgba(248,243,241,.86)!important;
  border-top:1px solid rgba(98,42,61,.09)!important;
}
.derived-data-group>h3{
  color:var(--lab-pink)!important;
}
.derived-data-row{
  padding:12px 16px 13px;
  border-top:1px solid rgba(93,48,63,.08);
}
.derived-data-row:first-of-type{border-top:0}
.derived-data-row label{
  display:block;
  margin:0 0 5px;
  color:var(--lab-wine-800);
  font-size:12px;
  font-weight:820;
}
.derived-data-row div{
  color:#5f5056;
  font-size:14px;
  line-height:1.45;
  white-space:pre-wrap;
}
.derived-data-row div span{color:#b9abad}
@media(max-width:760px){
  .derived-data-row{padding:11px 16px 12px}
  .derived-data-row div{font-size:15px}
}
