/* CrimiToons Studio — dark creator UI on Bootstrap 5.3 */
:root, [data-bs-theme="dark"] {
  --ct-bg: #0d1017;
  --ct-panel: #151a24;
  --ct-panel-2: #1c2230;
  --ct-line: #262e3f;
  --ct-accent: #ffd84d;
  --ct-accent-ink: #1a1400;
  --ct-pink: #ff5c8a;
  --bs-body-bg: var(--ct-bg);
  --bs-body-color: #e8ebf2;
  --bs-border-color: var(--ct-line);
  --sidebar-w: 248px;
}
html, body { background: var(--ct-bg); overflow-x: hidden; }
body { -webkit-tap-highlight-color: transparent; }
.brand { font-weight: 800; letter-spacing: .06em; font-size: 1rem; color: #fff; }
.text-accent { color: var(--ct-accent) !important; }
.btn-accent { --bs-btn-bg: var(--ct-accent); --bs-btn-color: var(--ct-accent-ink); --bs-btn-border-color: var(--ct-accent);
  --bs-btn-hover-bg: #ffe27a; --bs-btn-hover-color: var(--ct-accent-ink); --bs-btn-hover-border-color: #ffe27a;
  --bs-btn-active-bg: #f2c623; --bs-btn-active-color: var(--ct-accent-ink); --bs-btn-disabled-bg: #8a7a3a;
  --bs-btn-disabled-border-color: #8a7a3a; font-weight: 700; }
.btn-icon { border: 0; color: #e8ebf2; padding: .25rem .5rem; min-width: 44px; min-height: 44px; }
.btn { min-height: 40px; }
.btn-sm { min-height: 34px; }

/* layout */
.app-shell { min-height: 100vh; }
.main-col { min-width: 0; }
.sidebar { background: var(--ct-panel); border-right: 1px solid var(--ct-line); }
@media (min-width: 992px) {
  .sidebar { width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
}
@media (max-width: 991.98px) { .sidebar { --bs-offcanvas-width: 290px; background: var(--ct-panel); } }
.sidebar-brand { padding: 1.1rem 1rem 1rem; }
.sidebar-nav .nav-link { color: #aeb6c7; border-radius: .6rem; padding: .62rem .8rem; display: flex; gap: .7rem;
  align-items: center; font-weight: 500; }
.sidebar-nav .nav-link i { font-size: 1.1rem; width: 1.3rem; text-align: center; }
.sidebar-nav .nav-link:hover { background: var(--ct-panel-2); color: #fff; }
.sidebar-nav .nav-link.active { background: rgba(255, 216, 77, .12); color: var(--ct-accent); }
.sidebar-status { border-top: 1px solid var(--ct-line); }
.dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin-right: .4rem; }
.dot.ok { background: #35d07f; } .dot.ko { background: #ff5c5c; } .dot.warn { background: #ffb547; }
.topbar { position: sticky; top: 0; z-index: 1020; height: 60px; background: rgba(13, 16, 23, .92);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--ct-line); padding-top: env(safe-area-inset-top); }
.fab { position: fixed; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom)); width: 58px; height: 58px;
  border-radius: 50%; font-size: 1.6rem; z-index: 1030; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
#view { max-width: 1680px; margin: 0 auto; padding-bottom: 6rem !important; }

/* cards */
.ct-card { background: var(--ct-panel); border: 1px solid var(--ct-line); border-radius: 1rem; }
.ct-card .card-header { background: transparent; border-bottom-color: var(--ct-line); }
.stat { padding: 1rem 1.1rem; }
.stat .num { font-size: 2rem; font-weight: 800; line-height: 1; }
.stat .lbl { color: #9aa3b6; font-size: .85rem; }
.project-card { transition: transform .12s ease, border-color .12s ease; height: 100%; }
.project-card:hover { transform: translateY(-2px); border-color: #3a4560; }
.project-thumb { aspect-ratio: 9/16; width: 100%; object-fit: cover; border-radius: .75rem .75rem 0 0;
  background: linear-gradient(160deg, #1c2230, #12161f); display: block; }
.thumb-empty { aspect-ratio: 9/16; display: flex; align-items: center; justify-content: center; color: #4a5571;
  font-size: 2.5rem; background: linear-gradient(160deg, #1c2230, #12161f); border-radius: .75rem .75rem 0 0; }
.vs-title { font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
.vs-title .vs { color: var(--ct-accent); font-size: .8em; display: block; margin: .1rem 0; }
.vs-label { color: var(--ct-accent); font-weight: 800; letter-spacing: .1em; }
.confirm-name { font-size: 1.6rem; font-weight: 800; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip { font-size: .75rem; padding: .2rem .5rem; border-radius: 999px; background: var(--ct-panel-2); color: #c4cad8;
  border: 1px solid var(--ct-line); white-space: nowrap; }
.chip.ok { color: #35d07f; border-color: rgba(53, 208, 127, .35); }
.chip.work { color: #6cb4ff; border-color: rgba(108, 180, 255, .35); }
.chip.draft { color: var(--ct-accent); border-color: rgba(255, 216, 77, .35); }
.chip.err { color: #ff6b6b; border-color: rgba(255, 107, 107, .4); }
.chip.lock { color: #7c879e; }

/* pipeline */
.pipe-card { padding: .9rem 1rem; border-radius: .9rem; background: var(--ct-panel-2); border: 1px solid var(--ct-line); }
.pipe-card .state { font-weight: 800; font-size: 1.05rem; }
.pipe-arrow { color: #4a5571; text-align: center; font-size: 1.2rem; line-height: 1; padding: .2rem 0; }
.pipe-stop { border: 1px dashed #4a5571; color: #9aa3b6; text-align: center; padding: .6rem; border-radius: .8rem; }

/* tabs */
.tabs-scroll { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs-scroll::-webkit-scrollbar { display: none; }
.tabs-scroll .nav { flex-wrap: nowrap; }
.tabs-scroll .nav-link { white-space: nowrap; color: #aeb6c7; }
.tabs-scroll .nav-link.active { color: var(--ct-accent); background: transparent; border-color: var(--ct-line) var(--ct-line) var(--ct-bg); }

/* text */
.verse { border-left: 3px solid var(--ct-accent); padding-left: .9rem; margin-bottom: 1.2rem; }
.verse.b { border-left-color: var(--ct-pink); }
.verse-title { font-size: .78rem; letter-spacing: .08em; color: #9aa3b6; font-weight: 700; margin-bottom: .35rem; }
.bar { display: flex; gap: .7rem; padding: .3rem 0; font-size: 1.02rem; }
.bar .n { color: #6b7590; font-variant-numeric: tabular-nums; min-width: 1.6rem; font-weight: 600; }
.bar .t { overflow-wrap: anywhere; }

/* media */
.ratio-916 { aspect-ratio: 9/16; width: 100%; object-fit: contain; background: #0a0c11; border-radius: .9rem; display: block; }
.preview-col { max-width: 420px; }
.version-strip { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .3rem; }
.version-strip .vthumb { width: 64px; flex: 0 0 64px; cursor: pointer; border: 2px solid transparent; border-radius: .5rem; position: relative; }
.version-strip .vthumb.active { border-color: var(--ct-accent); }
.version-strip .vthumb img { width: 100%; aspect-ratio: 9/16; object-fit: cover; border-radius: .4rem; display: block; }
.version-strip .vthumb span { position: absolute; left: 3px; top: 3px; font-size: .65rem; background: rgba(0,0,0,.7); padding: 0 .25rem; border-radius: .25rem; }
.gallery-img { aspect-ratio: 9/16; width: 100%; object-fit: cover; border-radius: .7rem; background: #0a0c11; cursor: zoom-in; }
audio { width: 100%; }
.cue { display: grid; grid-template-columns: 2.4rem 1fr; gap: .2rem .7rem; padding: .55rem 0; border-bottom: 1px solid var(--ct-line); }
.cue .num { color: #6b7590; font-weight: 700; }
.cue .tm { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; color: #8fb7ff; }
pre.code { white-space: pre-wrap; word-break: break-word; background: #0a0c11; border: 1px solid var(--ct-line);
  border-radius: .7rem; padding: .9rem; font-size: .85rem; max-height: 60vh; overflow: auto; text-align: left; }
.file-row { display: flex; justify-content: space-between; gap: .6rem; padding: .45rem 0; border-bottom: 1px dashed var(--ct-line); }
.file-row .p { overflow-wrap: anywhere; min-width: 0; }
.empty { text-align: center; color: #7c879e; padding: 2.5rem 1rem; }
.empty i { font-size: 2.4rem; display: block; margin-bottom: .5rem; }
.skeleton { background: linear-gradient(90deg, #171c27 0%, #1f2534 50%, #171c27 100%); background-size: 200% 100%;
  animation: sk 1.2s infinite; border-radius: .7rem; min-height: 120px; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.spin { animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.notif-item.unread { background: rgba(255, 216, 77, .06); }
.login-card { max-width: 420px; }
.login-logo { width: 84px; height: 84px; border-radius: 1.2rem; object-fit: cover; }
.min-w-0 { min-width: 0; }
.filter-pills .btn { border-radius: 999px; }
.legacy-tile { aspect-ratio: 9/16; display: flex; align-items: center; justify-content: center; border-radius: .7rem;
  background: repeating-linear-gradient(45deg, #151a24, #151a24 10px, #181e2a 10px, #181e2a 20px); color: #4a5571; }
@media (max-width: 575.98px) {
  .confirm-name { font-size: 1.35rem; }
  .stat .num { font-size: 1.6rem; }
  h1.h3 { font-size: 1.35rem; }
}

/* ---- user-friendly additions ---- */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: flex; justify-content: space-around;
  align-items: center; background: rgba(21, 26, 36, .97); border-top: 1px solid var(--ct-line);
  padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom)); backdrop-filter: blur(8px); }
.bottom-nav a, .bottom-nav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .1rem;
  color: #9aa3b6; text-decoration: none; background: none; border: 0; font-size: .7rem; min-height: 48px;
  justify-content: center; position: relative; }
.bottom-nav i { font-size: 1.35rem; }
.bottom-nav a.active { color: var(--ct-accent); }
.bottom-nav .plus { flex: 0 0 58px; height: 58px; border-radius: 50%; background: var(--ct-accent); color: var(--ct-accent-ink);
  margin-top: -22px; box-shadow: 0 8px 22px rgba(0, 0, 0, .5); }
.bottom-nav .plus i { font-size: 1.7rem; }
.todo-dot { position: absolute; top: 6px; right: calc(50% - 16px); width: 9px; height: 9px; border-radius: 50%; background: var(--ct-pink); }
@media (max-width: 991.98px) { #view { padding-bottom: 7.5rem !important; } .toast-container { bottom: 80px !important; } }
.next-step { border: 1px solid rgba(255, 216, 77, .45); background: linear-gradient(90deg, rgba(255, 216, 77, .12), rgba(255, 216, 77, .03));
  border-radius: 1rem; padding: .9rem 1rem; }
.next-step.error { border-color: rgba(255, 92, 92, .5); background: linear-gradient(90deg, rgba(255, 92, 92, .14), rgba(255, 92, 92, .03)); }
.next-step .ttl { font-size: .72rem; letter-spacing: .08em; color: #9aa3b6; font-weight: 700; }
.todo-row { display: flex; gap: .8rem; align-items: center; padding: .75rem .9rem; border-bottom: 1px solid var(--ct-line);
  color: inherit; text-decoration: none; }
.todo-row:hover { background: var(--ct-panel-2); }
.todo-row img, .todo-row .ph { width: 38px; height: 68px; object-fit: cover; border-radius: .4rem; background: var(--ct-panel-2); flex: 0 0 38px; }
.tab-dot { display: inline-block; width: .45rem; height: .45rem; border-radius: 50%; background: var(--ct-pink); margin-left: .3rem; vertical-align: middle; }
.bar.editable { cursor: pointer; border-radius: .5rem; margin: 0 -.4rem; padding: .3rem .4rem; }
.bar.editable:hover { background: var(--ct-panel-2); }
.bar.editable:hover .t::after { content: " ✏️"; font-size: .8em; opacity: .7; }
.upload-tile { border: 1.5px dashed #3a4560; border-radius: .9rem; padding: .9rem; text-align: center; cursor: pointer; display: block; }
.upload-tile:hover { border-color: var(--ct-accent); }
.preset-chips .btn { border-radius: 999px; }
.hint { font-size: .85rem; color: #9aa3b6; }
.btn .spinner-border { width: 1rem; height: 1rem; border-width: .15em; }

/* ---- projects + checklist ---- */
.nav-section { font-size: .68rem; letter-spacing: .12em; color: #6b7590; font-weight: 700; padding: .9rem .8rem .25rem; }
.checklist { border-radius: 1rem; overflow: hidden; border: 1px solid var(--ct-line); background: var(--ct-panel); }
.check-row { display: flex; align-items: center; gap: .9rem; padding: .95rem 1rem; border-bottom: 1px solid var(--ct-line);
  color: inherit; text-decoration: none; min-height: 64px; }
.check-row:last-child { border-bottom: 0; }
.check-row:hover { background: var(--ct-panel-2); }
.check-ic { width: 2.2rem; height: 2.2rem; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; flex: 0 0 2.2rem; background: var(--ct-panel-2); border: 1.5px solid var(--ct-line); }
.check-ic.ok { background: #1f9d55; border-color: #1f9d55; color: #fff; }
.check-ic.todo { border-color: var(--ct-accent); color: var(--ct-accent); }
.check-ic.work { border-color: #6cb4ff; color: #6cb4ff; }
.check-ic.err { border-color: #ff5c5c; color: #ff5c5c; }
.check-ic.lock { color: #4a5571; }
.check-row .nm { font-weight: 700; font-size: 1.02rem; }
.mini-checks { display: flex; gap: .25rem; flex-wrap: wrap; }
.mini-checks span { width: 1.55rem; height: 1.55rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: .8rem; background: var(--ct-panel-2); border: 1px solid var(--ct-line); }
.mini-checks span.ok { background: #1f9d55; border-color: #1f9d55; }
.mini-checks span.todo { border-color: var(--ct-accent); }
.mini-checks span.err { border-color: #ff5c5c; }
.mini-checks span.work { border-color: #6cb4ff; }
.back-link { color: #9aa3b6; text-decoration: none; font-size: .9rem; }
.back-link:hover { color: #fff; }
.clip-card pre { white-space: pre-wrap; word-break: break-word; font-size: .82rem; background: #0a0c11; border: 1px solid var(--ct-line);
  border-radius: .6rem; padding: .7rem; max-height: 260px; overflow: auto; margin: 0; }
.cue-edit input { max-width: 7.5rem; }
.progress-line { height: 6px; border-radius: 3px; background: var(--ct-panel-2); overflow: hidden; }
.progress-line > div { height: 100%; background: linear-gradient(90deg, #1f9d55, #35d07f); }
