/* DIE2HARD Studio — Platform 1.9 core experience (navigation, onboarding, help, project creation). */
:root{--d19-orange:#f26522;--d19-ink:#121212;--d19-paper:#f2ede6;--d19-line:rgba(255,255,255,.12);--d19-muted:#9b958c}

/* ---------- shared bits inside the (dark) modal */
.d19-lead{font-size:16px;line-height:1.5;margin:0 0 14px;color:#e9e3da}
.d19-foot{font-size:12px;color:var(--d19-muted);margin:10px 0 0}
.d19-help{display:block;font-size:12px;color:var(--d19-muted);line-height:1.45;margin-top:4px}
.d19-link{background:none!important;border:0!important;color:var(--d19-orange)!important;text-decoration:underline;padding:0!important;font:inherit;cursor:pointer;min-height:0!important}
.d19-help-btn{width:34px;height:34px;border-radius:50%;border:1px solid rgba(255,255,255,.25);background:transparent;color:#eee;font:700 15px var(--sans);cursor:pointer}
.d19-help-btn:hover{background:rgba(255,255,255,.08)}

/* ---------- project creation */
.d19-create{display:grid;gap:16px}
.d19-field{display:grid;grid-template-columns:minmax(0,1fr);gap:7px;border:0;margin:0;padding:0;min-width:0}
.d19-field>span,.d19-field>legend{font:600 14px/1.3 var(--sans);color:#f2ede6;padding:0}
.d19-field>span i{color:var(--d19-orange);font-style:normal}
.d19-field input:not([type=radio]):not([type=checkbox]),.d19-field textarea,.d19-field select{width:100%;box-sizing:border-box;min-height:46px;font-size:15px}
.d19-field textarea{min-height:110px;line-height:1.45}
.d19-chips{display:flex;flex-wrap:wrap;gap:8px}
.d19-chip input,.d19-radio input,.d19-person input{position:absolute;opacity:0;pointer-events:none}
.d19-chip span{display:inline-flex;align-items:center;gap:7px;min-height:40px;padding:0 14px;border-radius:999px;border:1px solid var(--d19-line);background:rgba(255,255,255,.04);color:#ddd;font:500 14px var(--sans);cursor:pointer}
.d19-chip span i{font-style:normal;font-size:13px;opacity:.75}
.d19-chip input:checked+span{background:var(--d19-orange);border-color:var(--d19-orange);color:#111}
.d19-chip input:focus-visible+span,.d19-radio input:focus-visible+span,.d19-person input:focus-visible+span{outline:2px solid var(--d19-orange);outline-offset:2px}
.d19-advanced{border:1px solid var(--d19-line);border-radius:14px;padding:0 14px}
.d19-advanced summary{cursor:pointer;list-style:none;padding:14px 0;font:600 14px var(--sans);display:flex;flex-direction:column;gap:3px}
.d19-advanced summary::-webkit-details-marker{display:none}
.d19-advanced summary{position:relative;padding-right:28px!important}
.d19-advanced summary::before{content:'+';position:absolute;right:2px;top:50%;transform:translateY(-50%);font-size:20px;line-height:1;color:var(--d19-orange)}
.d19-advanced[open] summary::before{content:'–'}
.d19-advanced summary small{font:400 12.5px var(--sans);color:var(--d19-muted)}
.d19-adv-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;padding:0 0 16px}
.d19-adv-grid .full{grid-column:1/-1}
.d19-radios,.d19-people{display:grid;gap:8px}
.d19-radio span,.d19-person span{display:grid;gap:2px;padding:11px 13px;border:1px solid var(--d19-line);border-radius:12px;cursor:pointer;background:rgba(255,255,255,.03)}
.d19-radio span b,.d19-person span b{font:600 14px var(--sans);color:#eee}
.d19-radio span small,.d19-person span small{font:13px/1.4 var(--sans);color:var(--d19-muted)}
.d19-radio input:checked+span,.d19-person input:checked+span{border-color:var(--d19-orange);background:rgba(242,101,34,.1)}
.d19-sticky{position:sticky;bottom:-1px;background:linear-gradient(180deg,rgba(15,16,19,0),rgba(15,16,19,.97) 30%);padding:14px 0 4px;margin:0;z-index:2}
#d19ProjectError:empty{display:none}

/* ---------- next steps */
.d19-next-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px;margin:10px 0}
.d19-next-card{display:grid;gap:4px;text-align:left;padding:14px 15px;border-radius:14px;border:1px solid var(--d19-line);background:rgba(255,255,255,.04);color:#f2ede6;cursor:pointer;min-height:76px}
.d19-next-card b{font:600 15px var(--sans)}
.d19-next-card small{font:13px/1.4 var(--sans);color:var(--d19-muted)}
.d19-next-card:hover{border-color:var(--d19-orange)}
.d19-starter{margin:18px 0 22px;padding:16px;border-radius:18px;border:1px dashed rgba(0,0,0,.25);background:rgba(255,255,255,.35)}
.d19-starter .d19-next-card{background:#151514;border-color:#2c2b28}

/* ---------- checklist */
.d19-checklist{margin:18px 0 26px;padding:18px 18px 14px;border-radius:20px;background:#151514;color:#f2ede6;border:1px solid #2c2b28}
.d19-checklist header{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.d19-checklist h2{font:700 26px/1.05 var(--display);margin:6px 0 0;text-transform:none}
.d19-checklist .eyebrow{color:#a49a8c}
.d19-bar{height:6px;border-radius:999px;background:rgba(255,255,255,.1);margin:14px 0 8px;overflow:hidden}
.d19-bar i{display:block;height:100%;background:var(--d19-orange);border-radius:999px}
.d19-checklist ol{list-style:none;margin:0;padding:0;display:grid;gap:2px}
.d19-checklist li{display:grid;grid-template-columns:28px 1fr auto;gap:10px;align-items:center;padding:10px 0;border-bottom:1px solid rgba(255,255,255,.07)}
.d19-checklist li:last-child{border-bottom:0}
.d19-checklist li b{font:600 14.5px var(--sans);display:block}
.d19-checklist li small{font:13px/1.4 var(--sans);color:#a49a8c}
.d19-checklist li.done b{color:#8f8a82;text-decoration:line-through}
.d19-checklist li em{font:12px var(--mono);color:#c4d992;font-style:normal}
.d19-check{width:24px;height:24px;border-radius:50%;border:1.5px solid #57534c;display:grid;place-items:center;font:700 13px var(--sans);color:#111}
.d19-checklist li.done .d19-check{background:#c4d992;border-color:#c4d992}
.d19-step-btn{min-height:36px;padding:0 13px;border-radius:999px;border:1px solid var(--d19-orange);background:transparent;color:#f6a37a;font:600 13px var(--sans);cursor:pointer;white-space:nowrap}
.d19-checklist.compact{margin:0 0 14px}

/* ---------- welcome */
.d19-points{margin:0 0 14px;padding-left:18px;display:grid;gap:8px;line-height:1.5;color:#ddd}
.d19-role{padding:12px 14px;border-radius:12px;background:rgba(242,101,34,.1);border:1px solid rgba(242,101,34,.3);color:#f3d2c1;margin:0 0 14px}
.d19-lang{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:6px}
.d19-lang span{font:12px var(--mono);color:var(--d19-muted);margin-right:4px}
.d19-lang button{min-height:36px;padding:0 14px;border-radius:999px;border:1px solid var(--d19-line);background:transparent;color:#ddd;cursor:pointer}
.d19-lang button.on{background:#f2ede6;color:#111}

/* ---------- help */
.d19-help-tabs{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:16px}
.d19-help-tabs button{min-height:36px;padding:0 12px;border-radius:999px;border:1px solid var(--d19-line);background:transparent;color:#ccc;font:500 13px var(--sans);cursor:pointer}
.d19-help-tabs button.on{background:#f2ede6;color:#111;border-color:#f2ede6}
.d19-help-body p{line-height:1.6;color:#ddd;margin:0 0 12px;font-size:14.5px}
.d19-help-body .secondary{margin-top:4px}
.d19-status{list-style:none;padding:0;margin:0 0 12px;display:grid;gap:6px}
.d19-status li{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:center;padding:11px 13px;border-radius:12px;background:rgba(255,255,255,.04);border:1px solid var(--d19-line)}
.d19-status li b{font:600 14px var(--sans);display:block}
.d19-status li small{font:12.5px/1.4 var(--sans);color:var(--d19-muted)}
.d19-status li em{font:12px var(--mono);font-style:normal;white-space:nowrap}
.d19-status .st-working em,.d19-status .st-configured em{color:#c4d992}
.d19-status .st-partial em,.d19-status .st-optional em{color:#f0c27a}
.d19-status .st-needs_config em,.d19-status .st-failing em,.d19-status .st-quota em{color:#ff9d95}
.d19-status .st-not_built em,.d19-status .st-off em{color:#9b958c}

/* ---------- "More" sheet */
.d19-sheet{display:grid;gap:6px}
.d19-sheet-row{display:grid;gap:2px;text-align:left;padding:12px 14px;border-radius:12px;border:1px solid var(--d19-line);background:rgba(255,255,255,.03);color:#f2ede6;cursor:pointer;min-height:56px}
.d19-sheet-row b{font:600 15px var(--sans)}
.d19-sheet-row span{font:13px var(--sans);color:var(--d19-muted)}
.d19-muted b{color:#ff9d95}

/* ---------- mobile tab bar */
.d19-tabbar{display:none}
@media (max-width:650px),(pointer:coarse) and (max-height:500px) and (max-width:1000px){
  body.d19 .sidebar{display:none!important}
  body.d19 #aiDock,body.d19 #aiMobile{display:none!important}
  /* the AI avatar floats above the tab bar (placed by d19PlaceAvatar) and steps aside while the assistant is open */
  body.d19 #d2GuideBall{width:52px!important;height:52px!important;z-index:95!important;transition:transform .25s ease!important;background:#121110!important;box-shadow:0 0 0 1px rgba(242,101,34,.35),0 10px 28px rgba(0,0,0,.35)!important}
  body.d19 #d2GuideBall .guide-dot{width:6px;height:6px;animation:v100Guide 2.4s ease-in-out infinite!important}
  body.d19 #d2GuideBall .g1{transform:translate(-10px,4px)}body.d19 #d2GuideBall .g3{transform:translate(10px,4px)}body.d19 #d2GuideBall .g2{transform:translate(0,-7px)}
  body.d19.d19-ai-open #d2GuideBall{opacity:0;pointer-events:none}
  body.d19 #logoutButton{display:none!important}
  body.d19 #workspace{padding-bottom:calc(96px + env(safe-area-inset-bottom))!important}
  .d19-tabbar{display:grid;grid-template-columns:repeat(auto-fit,minmax(0,1fr));position:fixed;left:0;right:0;bottom:0;z-index:90;background:rgba(12,12,13,.97);border-top:1px solid #2a2927;padding:6px 4px calc(6px + env(safe-area-inset-bottom));backdrop-filter:blur(16px)}
  .d19-tabbar button{display:grid;justify-items:center;gap:3px;min-height:52px;border:0;background:transparent;color:#9b958c;font:500 11.5px var(--sans);cursor:pointer;padding:4px 2px}
  .d19-tabbar button.active{color:#f2ede6}
  .d19-tabbar button.active svg{color:var(--d19-orange)}
  /* Assistant becomes a full-height sheet above the tab bar */
  body.d19 #assistant.assistant.open{top:60px!important;bottom:calc(64px + env(safe-area-inset-bottom))!important;left:0!important;right:0!important;width:100%!important;max-width:none!important;border-radius:18px 18px 0 0!important;height:auto!important;background:#0f1013!important;transform:none!important}
  body.d19 #assistant .ai-orbit{height:56px!important;min-height:56px!important;width:56px!important}
  /* Dialogs become full-screen sheets that scroll naturally with the keyboard */
  body.d19 dialog#modal{width:100vw!important;max-width:100vw!important;height:100dvh;max-height:100dvh!important;margin:0!important;border-radius:0!important;border:0!important;inset:0}
  body.d19 dialog#modal[open]{display:flex;flex-direction:column}
  body.d19 #modal .modal-head{flex:none;position:sticky;top:0;z-index:3;background:rgba(15,16,19,.98)}
  body.d19 #modal #modalClose{min-width:44px;min-height:44px}
  body.d19 #modalBody{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:18px 16px 24px!important}
  .d19-adv-grid{grid-template-columns:minmax(0,1fr)}
  .d19-checklist{padding:16px 14px 10px;margin:12px 0 20px}
  .d19-checklist li{grid-template-columns:26px 1fr;}
  .d19-checklist li>button,.d19-checklist li>em{grid-column:2;justify-self:start}
  .d19-next-grid{grid-template-columns:1fr}
  #toast{bottom:calc(80px + env(safe-area-inset-bottom))!important}
}
@media (prefers-reduced-motion:reduce){.d19-tabbar,.d19-next-card,.d19-chip span{transition:none!important}}

/* ---------- BUG FIX (all screen sizes): replies are <div class="chat-message assistant">, so the old
   panel rule `.assistant{position:fixed;opacity:0;…}` also hit every AI reply and made it invisible.
   Reset replies back to normal text blocks. */
#chatLog .chat-message.assistant{position:static!important;inset:auto!important;top:auto!important;right:auto!important;bottom:auto!important;left:auto!important;
  width:auto!important;height:auto!important;max-height:none!important;min-height:0!important;opacity:1!important;pointer-events:auto!important;transform:none!important;
  display:block!important;padding:12px 2px!important;margin:0!important;border:0!important;border-radius:12px!important;background:transparent!important;
  box-shadow:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;z-index:auto!important;transition:none!important;
  color:#e2ddd5!important;white-space:pre-wrap;overflow-wrap:anywhere;font-size:14.5px;line-height:1.6}
#chatLog .chat-message.user{font-size:14.5px;line-height:1.55}

/* ---------- taps: one tap is always enough.
   touch-action:manipulation stops the phone waiting to see whether a tap is a double-tap zoom, and on
   touch screens nothing changes on hover (a hover state that moves or reveals things eats the first tap). */
button,a,summary,label,select,input,textarea,[role=button],[data-action],[data-view]{touch-action:manipulation}
html{-webkit-tap-highlight-color:rgba(242,101,34,.15)}
@media (hover:none){
  body.d19 *:hover{transition:none}
  body.d19 .project-card:hover,body.d19 button:hover,body.d19 a:hover{transform:none!important}
}
@media (prefers-reduced-motion:reduce){body.d19 #d2GuideBall .guide-dot{animation:none!important}}
.d19-create .form-actions{display:flex;align-items:center;gap:10px;justify-content:flex-end;flex-wrap:wrap}
.d19-create .p2-delete{color:#ff9d95!important;margin-right:auto}
.d19-create .error:empty{display:none}
.d19-create fieldset.d19-field legend{margin-bottom:8px}
body.d19-collab #d2GuideBall{display:none!important}

/* v1.12.4 BUG FIX: the closed AI panel is invisible (opacity:0) but its chat replies were still tappable
   (pointer-events:auto). On phones in portrait the panel covers the screen, so taps on project cards
   landed on invisible replies. Nothing inside a closed panel may take taps. */
#assistant:not(.open),#assistant:not(.open) *,#assistant:not(.open) #chatLog .chat-message.assistant{pointer-events:none!important}
