/* Halawi Credits: app-specific layout and builder */
/* Boot must stay below modals. Hide it as soon as store.init succeeds. */
.boot { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: var(--bg); transition: opacity .2s; }
.boot[aria-hidden="true"], .boot.gone { display: none; }
.boot-in { display: flex; flex-direction: column; align-items: center; gap: 14px; color: var(--muted); font: 400 13px var(--f-ui); }
.boot-bar { width: 160px; height: 3px; border-radius: 3px; background: var(--glass-3); overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 40%; background: var(--grad); animation: boot 1s ease infinite; }
@keyframes boot { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }
.boot-err { max-width: 360px; text-align: center; }
.boot-err .btn { margin-top: 12px; }
.nojs { padding: 24px; text-align: center; }

.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--glass); flex-wrap: wrap; }
.banner.warn { background: rgba(232,163,61,.08); border-bottom-color: rgba(232,163,61,.35); }
.banner > div:first-child { display: flex; gap: 10px; align-items: flex-start; }

.start-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.start-card { text-align: left; padding: 20px 18px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--glass); color: inherit; cursor: pointer; transition: border-color .15s, background .15s, transform .08s; }
.start-card:hover { border-color: var(--line-2); background: var(--glass-2); }
.start-card.primary { border-color: var(--accent-line); background: var(--accent-bg); }
.start-card.secondary { opacity: .92; }
.start-card h3 { font-size: 16px; margin: 8px 0 6px; }
.start-card p { margin: 0; color: var(--muted); font-size: 13.5px; }
.sc-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--glass-3); color: var(--accent); }
.sc-ic .ic { width: 18px; height: 18px; }

.builder-page .page-hd { margin-bottom: 12px; }
.builder-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.builder-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.builder-side { position: sticky; top: 12px; max-height: calc(100dvh - 90px); overflow: auto; }
.toolbar { gap: 10px; }
.role-block { margin-bottom: 2px; }
.order-warn { display: flex; gap: 10px; padding: 10px 16px; background: rgba(232,163,61,.08); border-bottom: 1px solid rgba(232,163,61,.3); font-size: 13px; color: var(--text-2); }
.credit-row { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.credit-row:hover, .credit-row.on { background: var(--glass-2); }
.credit-row.dragging { opacity: .5; }
.credit-row.drag-over { outline: 1px dashed var(--accent-line); }
.credit-row .grip { color: var(--dim); cursor: grab; }
.credit-row .meta { min-width: 0; flex: 1; }
.credit-row .meta b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.credit-row .meta small { color: var(--muted); font-size: 12px; }
.ent { font: 600 10px/1 var(--f-ui); letter-spacing: .06em; text-transform: uppercase; padding: 4px 6px; border-radius: 6px; background: var(--glass-3); color: var(--muted); flex: none; }
.ent.company { color: var(--info); background: rgba(123,147,255,.12); }
.ent.person { color: var(--ok); background: rgba(63,182,139,.12); }

.logic-bd { display: flex; flex-direction: column; gap: 8px; }
.logic-block { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--glass); }
.logic-block summary { cursor: pointer; font: 500 13px var(--f-ui); list-style: none; }
.logic-block summary::-webkit-details-marker { display: none; }
.logic-block p { margin: 8px 0 2px; color: var(--text-2); font-size: 13.5px; }
.logic-chip-row, .duty-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.chip { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 20px; background: var(--glass-3); border: 1px solid var(--line); font-size: 12px; }
.chip.dim { color: var(--muted); }
.warn-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.warn-row:last-child { border-bottom: 0; }
.warn-row.warn b { color: var(--warn); }
.warn-row.info b { color: var(--info); }
.logic-warns { margin-top: 8px; }

.pick-list, .role-guide-list { display: flex; flex-direction: column; gap: 6px; max-height: min(60vh, 520px); overflow: auto; }
.pick-i, .role-guide-i { text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--glass); color: inherit; cursor: pointer; }
.pick-i:hover, .role-guide-i:hover, .role-guide-i.on { border-color: var(--accent-line); background: var(--accent-bg); }
.pick-i b, .role-guide-i b { display: block; font: 500 13.5px var(--f-ui); }
.pick-i small, .role-guide-i small { color: var(--muted); font-size: 12px; }

.crawl-pre { margin: 0; white-space: pre-wrap; text-align: center; font: 15px/1.7 Georgia, 'Times New Roman', serif; color: var(--text); max-height: 70vh; overflow: auto; }
.structured-prev { max-height: 70vh; overflow: auto; }
.sp-block { margin-bottom: 14px; }
.sp-label { font: 500 11px var(--f-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.sp-block ul { margin: 0; padding-left: 0; list-style: none; }
.sp-block li { padding: 4px 0; display: flex; gap: 8px; align-items: center; }

.proj-list { display: flex; flex-direction: column; gap: 10px; }
.proj-row.on { border-color: var(--accent-line); }

.empty-state { text-align: center; padding: 12px; }
.tip-panel { border-color: var(--accent-line); }

.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--bg-3); border: 1px solid var(--line-2); box-shadow: var(--shadow); min-width: 260px; max-width: 420px; animation: fadeUp .2s ease; }
.toast.out { opacity: 0; transform: translateY(6px); transition: .2s; }
.toast-msg { flex: 1; font-size: 13.5px; }
.toast-x { border: 0; background: transparent; color: var(--muted); cursor: pointer; }
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 400; display: flex; flex-direction: column; gap: 8px; }

.modal-wrap { position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 20px; backdrop-filter: blur(4px); }
.modal-wrap.out { opacity: 0; transition: .18s; }
.modal { width: min(560px, 100%); max-height: min(86vh, 820px); overflow: auto; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow); }
.modal--md { width: min(640px, 100%); }
.modal--lg { width: min(780px, 100%); }
.modal--sm { width: min(420px, 100%); }
.modal-hd { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal-hd h2 { font-size: 16px; flex: 1; }
.modal-bd { padding: 16px; }
.modal-ft { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }

.ctx { position: fixed; z-index: 90; min-width: 180px; padding: 6px; border-radius: 12px; background: var(--bg-3); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.ctx-i { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; background: transparent; color: inherit; border-radius: 8px; cursor: pointer; text-align: left; }
.ctx-i:hover { background: var(--glass-2); }
.ctx-sep { height: 1px; background: var(--line); margin: 4px 0; }

.mob-only { display: none; }
.scrim { display: none; }

@media (max-width: 1100px) {
  .builder-layout, .g-main, .start-grid, .g2, .g4 { grid-template-columns: 1fr; }
  .builder-side { position: static; max-height: none; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 88vw); z-index: 40; transform: translateX(-105%); transition: transform .2s; }
  .app.sb-open .sidebar { transform: none; }
  .app.sb-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 35; }
  .mob-only { display: inline-grid; }
  .cmdk-btn span, .cmdk-btn kbd { display: none; }
  .cmdk-btn { min-width: 36px; padding: 0; justify-content: center; }
}

@media print {
  .sidebar, .topbar, .sb-foot, #banners, #toasts, #modals, .acts, .toolbar { display: none !important; }
  .app { display: block; }
  .content { overflow: visible; }
  body { overflow: visible; background: #fff; color: #000; }
}

.chip.custom { background: var(--accent-bg); border-color: var(--accent-line); color: var(--accent); }
.logic-block summary { font-weight: 600; font-size: 12.5px; letter-spacing: .01em; cursor: pointer; list-style: none; }
.logic-block summary::-webkit-details-marker { display: none; }
.logic-block p { margin: 6px 0 0; color: var(--text-2); font-size: 13.5px; line-height: 1.45; }
.logic-block ul { margin: 6px 0 0; padding-left: 18px; color: var(--text-2); font-size: 13.5px; line-height: 1.45; }
.logic-block li { margin: 2px 0; }
.role-guide-i .tag-custom { font-size: 11px; margin-left: 6px; }
.pick-i .tag-custom { font-size: 11px; color: var(--accent); }

.imdb-line { margin: 6px 0 10px; padding: 8px 10px; border-left: 3px solid var(--accent, #9b3df5); background: rgba(155,61,245,.06); border-radius: 0 8px 8px 0; font-size: 13px; line-height: 1.45; }
.imdb-line b { color: var(--text); font-weight: 600; }

