/* ============================================================
   Hubicx — Desktop (PC) layout. Loaded only in desktop.html.
   Fullscreen, no window frame. Sidebar + topbar + content.
   ============================================================ */

html, body { height: 100%; }
body { background: var(--bg); overflow: hidden; }

#root {
  width: 100%;
  height: 100vh;
  max-width: none;
  display: block;
}

/* ── outer grid: sidebar + main ── */
.dk {
  width: 100%;
  height: 100vh;
  display: flex;
  background: var(--bg);
}

/* ════════════ SIDEBAR ════════════ */
.dk-side {
  width: 240px;
  flex: 0 0 auto;
  background: var(--card);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 20px 14px 14px;
}

.dk-brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 18px; }
.dk-logo {
  width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2b2b27, #15150f);
  color: var(--accent); font-size: 18px; font-weight: 900;
  overflow: hidden;
}
.dk-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dk-word { font-size: 20px; font-weight: 800; letter-spacing: -.03em; color: var(--ink); }

.dk-menu-lbl {
  font-size: 11px; font-weight: 700; color: var(--faint);
  text-transform: uppercase; letter-spacing: .08em; padding: 4px 10px 8px;
}

.dk-navs { display: flex; flex-direction: column; gap: 2px; }
.dk-nav {
  display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px;
  border-radius: 12px; color: var(--muted); font-weight: 700; font-size: 14px;
  cursor: pointer; transition: background .14s, color .14s; position: relative;
}
.dk-nav:hover { background: #f6f5f0; color: var(--ink); }
.dk-nav.on { background: #f0efe8; color: var(--ink); }
html.theme-dark .dk-nav:hover { background: #20242c; }
html.theme-dark .dk-nav.on { background: #252a34; }
.dk-nav.on .dk-ni { color: var(--ink); }
.dk-ni { color: var(--faint); display: flex; flex: 0 0 auto; }
.dk-nl { flex: 1; }
.dk-badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: #e0664a; color: #fff; font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

/* ── balance block ── */
.dk-bal { margin-top: auto; padding: 16px 12px 14px; }
.dk-bal-lbl { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.dk-bal-row { margin: 8px 0 12px; }
.dk-bal-num { display: flex; align-items: center; gap: 7px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.dk-bal-un { font-size: 13px; font-weight: 600; color: var(--muted); }
.dk-topup {
  width: 100%; height: 42px; border-radius: 12px; border: none;
  background: var(--accent); color: var(--accent-ink); font-size: 14px; font-weight: 800;
  font-family: inherit; cursor: pointer; box-shadow: 0 6px 16px rgba(210,210,80,.35);
  transition: transform .12s;
}
.dk-topup:hover { transform: translateY(-1px); }
.dk-topup:active { transform: none; }

/* ── user footer ── */
.dk-user {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  border-top: 1px solid var(--line); margin-top: 4px; cursor: pointer; border-radius: 12px;
}
.dk-user:hover { background: #f6f5f0; }
.dk-user.on { background: #f0efe8; }
html.theme-dark .dk-user:hover { background: #20242c; }
html.theme-dark .dk-user.on { background: #252a34; }
.dk-ava {
  width: 36px; height: 36px; border-radius: 11px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: #cdd9d2; color: #3c5a50; font-weight: 800; font-size: 16px;
}
.dk-uinfo { flex: 1; min-width: 0; }
.dk-uname { font-size: 13.5px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.dk-uhandle { font-size: 11.5px; color: var(--muted); }
.dk-pro {
  font-size: 9.5px; font-weight: 800; padding: 1px 6px; border-radius: 6px;
  background: var(--accent); color: var(--accent-ink); letter-spacing: .02em;
}
.dk-theme { color: var(--faint); display: flex; padding: 4px; border-radius: 8px; }
.dk-theme:hover { background: var(--line); }
.dk-theme-btn {
  width: 42px; height: 42px; border-radius: 13px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--line); cursor: pointer;
  color: var(--muted); font-family: inherit;
}
.dk-theme-btn:hover { background: #f6f5f0; }
html.theme-dark .dk-theme-btn:hover { background: #20242c; }

/* ════════════ MAIN ════════════ */
.dk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }

/* ── topbar ── */
.dk-top {
  flex: 0 0 auto; height: 72px; display: flex; align-items: center; gap: 18px;
  padding: 0 28px; border-bottom: 1px solid var(--line); background: var(--bg);
}
.dk-th { min-width: 0; }
.dk-title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.dk-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.dk-search {
  margin-left: auto; width: 320px; max-width: 34vw; height: 42px;
  display: flex; align-items: center; gap: 9px; padding: 0 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 13px;
}
.dk-search-ic { display: flex; flex: 0 0 auto; }
.dk-search input {
  flex: 1; border: none; background: none; outline: none; font-family: inherit;
  font-size: 14px; color: var(--ink); cursor: text;
}
.dk-search input::placeholder { color: var(--faint); }

.dk-tok {
  display: flex; align-items: center; gap: 7px; height: 42px; padding: 0 6px 0 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 13px;
  font-weight: 800; font-size: 14px; cursor: pointer;
}
.dk-tok-plus {
  width: 28px; height: 28px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-ink);
}
.dk-bell-wrap { position: relative; flex: 0 0 auto; }
.dk-bell {
  width: 42px; height: 42px; border-radius: 13px; position: relative;
  display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--line); cursor: pointer;
}
.dk-bell:hover { background: #f6f5f0; }
html.theme-dark .dk-bell:hover { background: #20242c; }
.dk-bell-dot { position: absolute; top: 11px; right: 12px; width: 7px; height: 7px; border-radius: 50%; background: #e0664a; border: 1.5px solid var(--card); }

/* ── notifications dropdown ── */
.dk-notif {
  position: absolute; top: 50px; right: 0; width: 340px; z-index: 90;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0,0,0,.18); overflow: hidden;
}
.dk-notif-top { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 800; }
.dk-notif-list { max-height: 380px; overflow-y: auto; }
.dk-notif-empty { padding: 34px 18px; text-align: center; font-size: 13.5px; color: var(--muted); }
.dk-notif-item { display: flex; align-items: flex-start; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.dk-notif-item:last-child { border-bottom: none; }
.dk-notif-ic { width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.dk-notif-tx { flex: 1; min-width: 0; }
.dk-notif-t { font-weight: 700; font-size: 13.5px; }
.dk-notif-s { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk-notif-time { font-size: 11px; color: var(--faint); flex: 0 0 auto; }

/* ── content scroll area ── */
.dk-content { flex: 1; overflow-y: auto; min-height: 0; }
.dk-content::-webkit-scrollbar { width: 10px; }
.dk-content::-webkit-scrollbar-thumb { background: #dedcd4; border-radius: 6px; border: 3px solid var(--bg); }
html.theme-dark .dk-content::-webkit-scrollbar-thumb { background: #343946; }
.dk-page { max-width: 1180px; margin: 0 auto; padding: 26px 28px 40px; }

/* ── shared bits ── */
.dk-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); }
.dk-pad { padding: 18px; }
.dk-lbl { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 18px 0 8px; }
.dk-sec { display: flex; align-items: center; justify-content: space-between; margin: 26px 2px 14px; }
.dk-sec h2 { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.dk-all { color: var(--link); font-size: 13.5px; font-weight: 700; cursor: pointer; }
.dk-back { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; cursor: pointer; color: var(--muted); margin-bottom: 18px; }
.dk-back:hover { color: var(--ink); }

/* primary CTA + secondary button */
.dk-cta {
  width: 100%; height: 52px; border: none; border-radius: 15px; font-family: inherit;
  font-size: 15.5px; font-weight: 800; color: var(--accent-ink); background: var(--accent);
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 8px 20px rgba(210,210,80,.38); transition: transform .12s;
}
.dk-cta:hover { transform: translateY(-1px); }
.dk-cta:active { transform: none; }
.dk-cta:disabled { background: #eceae3; color: #b3b2a9; box-shadow: none; cursor: default; transform: none; }
.dk-cta-sm { height: 44px; font-size: 14.5px; }
.dk-btn-sec {
  height: 44px; padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--ink); font-size: 14px; font-weight: 700; font-family: inherit;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none;
}
.dk-btn-sec:hover { background: #f6f5f0; }
.dk-btn-sec:disabled { opacity: .55; cursor: default; }

/* ════════════ HOME ════════════ */
.dk-hero {
  background: var(--card); border: 1px solid var(--line); border-radius: 24px;
  padding: 34px 34px 28px; box-shadow: var(--shadow-sm);
}
.dk-home-top {
  display: grid;
  grid-template-columns: minmax(560px, 1.45fr) minmax(440px, .95fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}
.dk-home-top .dk-hero {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.dk-hero-h { font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.dk-grad { background: linear-gradient(90deg, #7faa9d, #b6b5e6); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.dk-hero-sub { color: var(--muted); font-size: 15px; margin-top: 10px; }

.dk-modes { display: flex; gap: 4px; background: var(--nav-bg); border-radius: 14px; padding: 5px; width: fit-content; margin-top: 22px; }
.dk-mode {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 22px; border: none;
  border-radius: 11px; background: none; color: var(--muted); font-weight: 700; font-size: 14px;
  font-family: inherit; cursor: pointer;
}
.dk-mode.on { background: var(--card); color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.08); }

.dk-askbar {
  display: flex; align-items: center; gap: 10px; margin-top: 16px;
  background: #f8f7f2; border: 1px solid var(--line); border-radius: 18px; padding: 10px 10px 10px 20px;
}
.dk-askbar input { flex: 1; border: none; background: none; outline: none; font-family: inherit; font-size: 15px; color: var(--ink); min-width: 0; }
.dk-askbar input::placeholder { color: var(--faint); }
.dk-ask-pill-wrap { position: relative; flex: 0 0 auto; }
.dk-ask-pill {
  display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 13px; border-radius: 11px;
  background: var(--card); border: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--ink);
  white-space: nowrap; cursor: pointer; font-family: inherit;
}
.dk-ask-pill:hover { background: #f6f5f0; }
.dk-ask-pill.on { border-color: var(--ink); }
.dk-ask-menu {
  position: absolute; top: 44px; right: 0; min-width: 220px; z-index: 40;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px;
  box-shadow: 0 16px 44px rgba(0,0,0,.16);
  animation: dk-pop .16s ease both; transform-origin: top right;
}
@keyframes dk-pop { from { opacity:0; transform: translateY(-6px) scale(.98); } to { opacity:1; transform: translateY(0) scale(1); } }
.dk-ask-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer; font-size: 13.5px; font-weight: 600;
}
.dk-ask-opt:hover { background: #f6f5f0; }
.dk-ask-opt.on { background: #f0efe8; font-weight: 700; }
.dk-ask-opt.muted { color: var(--muted); cursor: default; font-weight: 600; }
.dk-ask-opt-p { font-size: 12px; color: var(--muted); white-space: nowrap; }
.dk-ask-cta {
  display: flex; align-items: center; gap: 7px; height: 44px; padding: 0 22px; border: none; border-radius: 13px;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 14.5px; font-family: inherit; cursor: pointer;
  box-shadow: 0 6px 16px rgba(210,210,80,.35); white-space: nowrap;
}
.dk-chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.dk-chip {
  display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 11px;
  background: var(--card); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer;
}
.dk-chip:hover { background: #f6f5f0; }

.dk-acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
.dk-home-acts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  margin-top: 0;
  height: 100%;
}
.dk-home-acts .dk-act:last-child { grid-column: 1 / -1; }
.dk-act {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: transform .14s;
}
.dk-home-acts .dk-act { min-height: 128px; display: flex; flex-direction: column; justify-content: center; }

@media (max-width: 1380px) {
  .dk-home-top { grid-template-columns: 1fr; }
  .dk-home-acts { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .dk-home-acts .dk-act:last-child { grid-column: auto; }
}
.dk-act:hover { transform: translateY(-2px); }
.dk-act-ic { width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.dk-act-t { font-weight: 800; font-size: 15.5px; }
.dk-act-s { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

/* ── template grid ── */
.dk-tpl-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.dk-tpl-grid.wide { grid-template-columns: repeat(4, 1fr); gap: 16px; }
.dk-tpl { cursor: pointer; }
.dk-tpl-img {
  position: relative; aspect-ratio: 0.82; border-radius: 16px; overflow: hidden;
  background: linear-gradient(135deg, #e7e4f3, #dde9e2); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.dk-tpl-img img, .dk-tpl-img video { width: 100%; height: 100%; object-fit: cover; display:block; }
.dk-tpl-img video { position:relative; z-index:0; }
.dk-tpl:hover .dk-tpl-img { box-shadow: 0 8px 22px rgba(40,40,30,.14); }
.dk-tpl-badge { display: none; }
.dk-tpl-lbl { font-size: 13.5px; font-weight: 700; margin-top: 8px; }

.dk-tpl-tabs { display: flex; gap: 4px; background: var(--nav-bg); border-radius: 13px; padding: 5px; width: fit-content; margin-bottom: 22px; }
.dk-tpl-tab { height: 38px; padding: 0 26px; border: none; border-radius: 10px; background: none; color: var(--muted); font-weight: 700; font-size: 14px; font-family: inherit; cursor: pointer; }
.dk-tpl-tab.on { background: var(--card); color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.dk-templates-page { max-width: none; margin: 0; padding-left: 28px; padding-right: 28px; }
.dk-templates-page .dk-tpl-tabs { margin-left: 0; margin-right: auto; }
.dk-templates-page .dk-tpl-grid.wide { grid-template-columns: repeat(auto-fill, 260px); justify-content: start; align-content: start; gap: 16px; }

/* ════════════ GENERATION (two-panel) ════════════ */
.dk-gen { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 22px; height: 100%; padding: 14px 20px 20px; max-width: none; margin: 0; }
.dk-gen-form { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 22px; overflow: visible; box-shadow: var(--shadow-sm); }
.dk-gen-form::-webkit-scrollbar { width: 8px; }
.dk-gen-form::-webkit-scrollbar-thumb { background: #e4e2da; border-radius: 5px; }

.dk-seg { display: flex; background: var(--nav-bg); border-radius: 13px; padding: 4px; gap: 3px; }
.dk-seg button {
  flex: 1; height: 40px; border: none; background: none; color: var(--muted); font-weight: 700; font-size: 13.5px;
  border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; font-family: inherit;
}
.dk-seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.08); }

.dk-drop {
  border-radius: 16px; border: 1.5px dashed var(--faint); background: #f8f7f2;
  padding: 26px 18px; text-align: center; cursor: pointer; margin-top: 14px;
  display: flex; flex-direction: column; align-items: center;
}
.dk-drop.has { padding: 0; position: relative; overflow: hidden; border-style: solid; border-color: var(--line); min-height: 130px; justify-content: center; }
.dk-drop-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .5; }
.dk-drop-in { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.dk-drop-ic { width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center; background: var(--card); border: 1px solid var(--line); margin-bottom: 8px; }
.dk-drop-t { font-weight: 800; font-size: 14.5px; }
.dk-drop-s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dk-drop-x { position: absolute; top: 8px; right: 10px; z-index: 2; background: rgba(0,0,0,.45); border: none; border-radius: 20px; color: #fff; font-size: 11px; font-weight: 700; padding: 3px 9px; cursor: pointer; }
.dk-ref-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dk-ref-slots .dk-drop { min-height: 136px; }
.dk-ref-slots .dk-drop-t { text-align: center; }

.dk-gen-tpls { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 14px; max-height: 454px; overflow-y: auto; padding-right: 4px; }
.dk-gen-tpls::-webkit-scrollbar { width: 6px; }
.dk-gen-tpls::-webkit-scrollbar-thumb { background: #d9d7cf; border-radius: 6px; }
.dk-gen-tpl { position: relative; aspect-ratio: 0.8; border-radius: 12px; overflow: hidden; cursor: pointer; border: 2px solid transparent; background: #e7e4f3; }
.dk-gen-tpl.on { border-color: var(--ink); }
.dk-gen-tpl img, .dk-gen-tpl video { width: 100%; height: 100%; object-fit: cover; display:block; }
.dk-gen-tpl video { position:relative; z-index:0; }
.dk-gen-tpl .tpl-media { position:absolute; inset:0; }
.dk-gen-tpl-l { position: absolute; left: 7px; right: 7px; bottom: 6px; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 5px rgba(0,0,0,.6); z-index: 1; }
.dk-tpl-fav { position: absolute; top: 9px; right: 9px; z-index: 3; width: 34px; height: 34px; border: none; border-radius: 11px; background: rgba(0,0,0,.18); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; filter: drop-shadow(0 1px 4px rgba(0,0,0,.55)); transition: color .14s, transform .14s, background .14s; }
.dk-gen-tpl-fav { position: absolute; top: 6px; right: 6px; z-index: 3; width: 26px; height: 26px; border: none; border-radius: 9px; background: rgba(0,0,0,.18); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); transition: color .14s, transform .14s, background .14s; }
.dk-gen-tpl-fav:hover,
.dk-tpl-fav:hover { color: #ff315f; transform: scale(1.06); }
.dk-gen-tpl-fav:hover svg path,
.dk-tpl-fav:hover svg path,
.dk-gen-tpl-fav.on svg path,
.dk-tpl-fav.on svg path { fill: currentColor; }
.dk-gen-tpl-fav.on,
.dk-tpl-fav.on { background: rgba(0,0,0,.18); border: none; color: #ff315f; }
.dk-gen-tpl-empty { grid-column: 1 / -1; padding: 18px 14px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); text-align: center; font-size: 13px; line-height: 1.45; background: #faf9f5; }

.dk-template-selected { margin-top:14px; display:flex; align-items:center; gap:12px; padding:10px; border:1px solid var(--line); border-radius:16px; background:#faf9f5; }
.dk-template-selected img, .dk-template-selected video { width:58px; height:70px; border-radius:12px; object-fit:cover; flex:0 0 auto; }
.dk-template-selected video { width:58px; height:70px; border-radius:12px; object-fit:cover; flex:0 0 auto; position:relative; z-index:0; }
.dk-template-selected > .tpl-media { position:relative; inset:auto; width:58px; height:70px; border-radius:12px; overflow:hidden; flex:0 0 auto; }
.dk-template-selected > .tpl-media img,
.dk-template-selected > .tpl-media video { width:100%; height:100%; border-radius:0; }
.dk-template-selected-tx { flex:1; min-width:0; }
.dk-template-selected-k { font-size:11px; color:var(--muted); font-weight:800; text-transform:uppercase; letter-spacing:.04em; }
.dk-template-selected-v { font-size:15px; font-weight:800; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:1px; }
.dk-template-selected-s { font-size:12px; color:var(--muted); line-height:1.35; margin-top:2px; }
.dk-template-clear { width:34px; height:34px; border-radius:11px; border:1px solid var(--line); background:var(--card); color:var(--muted); cursor:pointer; display:flex; align-items:center; justify-content:center; }
.dk-template-clear:hover { color:var(--ink); background:#f1f0ea; }

.dk-ta {
  width: 100%; margin-top: 14px; height: 120px; resize: none; background: #f8f7f2;
  border: 1px solid var(--line); border-radius: 14px; padding: 14px; color: var(--ink);
  font-size: 14.5px; font-family: inherit; outline: none; box-sizing: border-box;
}
.dk-ta:focus { border-color: #c7c6bd; background: var(--card); }

.dk-row { display: flex; align-items: center; gap: 13px; padding: 13px 14px; cursor: pointer; }
.dk-row:hover { background: #f8f7f2; }
.dk-row.locked { cursor: default; }
.dk-row.locked:hover { background: transparent; }
.dk-row-ic { width: 40px; height: 40px; border-radius: 12px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; background: #f1f0ea; }
.dk-row-tx { flex: 1; min-width: 0; }
.dk-row-k { font-size: 11.5px; color: var(--muted); }
.dk-row-v { font-weight: 700; font-size: 14.5px; margin-top: 1px; }
.dk-row-s { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.dk-row-div { height: 1px; background: var(--line); }
.dk-gen-form .dk-card { position: relative; overflow: visible; }
.dk-drop-list { border-top: 1px solid var(--line); background: #faf9f5; padding: 6px; }
.dk-drop-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; border-radius: 10px; cursor: pointer; }
.dk-drop-opt:hover { background: var(--card); }
.dk-drop-opt.on { background: var(--card); }
.dk-opt-t { font-weight: 700; font-size: 14px; }
.dk-opt-s { font-size: 12px; color: var(--muted); margin-top: 1px; }
.dk-lock-btn { width:36px; height:36px; border-radius:12px; border:1px solid var(--line); background:var(--accent); color:var(--accent-ink); cursor:pointer; display:flex; align-items:center; justify-content:center; flex:0 0 auto; }
.dk-lock-btn.off { background:var(--card); color:var(--muted); }
.dk-lock-btn:hover { transform:translateY(-1px); }
.dk-duration-inline { padding:13px 14px 14px; }
.dk-duration-inline.locked { cursor:default; }
.dk-duration-head { display:flex; align-items:center; gap:13px; }
.dk-duration-control {
  margin:12px 0 0 53px;
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  gap:10px;
  align-items:center;
}
.dk-duration-control.no-auto {
  grid-template-columns:minmax(0,1fr);
}
.dk-duration-auto {
  height:36px;
  min-width:58px;
  padding:0 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#f1f0ea;
  color:var(--muted);
  font:inherit;
  font-size:12.5px;
  font-weight:850;
  cursor:pointer;
}
.dk-duration-auto.on {
  background:var(--ink);
  color:var(--card);
  border-color:var(--ink);
}
.dk-duration-range {
  -webkit-appearance:none;
  appearance:none;
  width:100%;
  height:36px;
  margin:0;
  accent-color:var(--accent);
  background:transparent;
}
.dk-duration-control.no-auto .dk-duration-range {
  grid-column:1 / -1;
}
.dk-duration-range::-webkit-slider-runnable-track {
  height:8px;
  border-radius:999px;
  background:linear-gradient(90deg,var(--accent) 0 var(--duration-progress, 0%),#dfe6db var(--duration-progress, 0%) 100%);
  border:1px solid var(--line);
}
.dk-duration-range::-webkit-slider-thumb {
  -webkit-appearance:none;
  appearance:none;
  width:24px;
  height:24px;
  margin-top:-9px;
  border-radius:50%;
  background:var(--ink);
  border:4px solid var(--card);
  box-shadow:0 6px 16px rgba(0,0,0,.18);
}
.dk-duration-scale {
  grid-column:1 / -1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  color:var(--muted);
  font-size:11.5px;
  font-weight:800;
}
.dk-duration-scale b { color:var(--ink); font-size:13px; font-weight:950; }
.dk-duration-scale span.active { color:var(--ink); font-weight:950; }
.dk-duration-chips { grid-column:1 / -1; display:flex; flex-wrap:wrap; gap:6px; }
.dk-duration-chip {
  height:32px;
  padding:0 10px;
  border-radius:10px;
  border:1px solid var(--line);
  background:#f1f0ea;
  color:var(--ink);
  font:inherit;
  font-size:12px;
  font-weight:850;
  cursor:pointer;
  white-space:nowrap;
  flex:0 0 auto;
}
.dk-duration-chip.on {
  background:var(--ink);
  color:var(--card);
  border-color:var(--ink);
}
.dk-seedance-tier {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:7px;
  padding:0 14px 13px 67px;
}
.dk-seedance-tier button {
  border:1px solid var(--line);
  background:#f1f0ea;
  color:var(--muted);
  border-radius:13px;
  padding:8px 9px;
  font:inherit;
  text-align:left;
  cursor:pointer;
}
.dk-seedance-tier button b { display:block; color:var(--ink); font-size:13px; line-height:1.05; }
.dk-seedance-tier button span { display:block; font-size:10.5px; margin-top:2px; }
.dk-seedance-tier button.on {
  border-color:var(--accent);
  background:color-mix(in srgb,var(--accent) 18%,var(--card));
  box-shadow:0 8px 18px color-mix(in srgb,var(--accent) 18%,transparent);
}
.dk-floating-menu {
  position:absolute; left:calc(100% + 14px); width:260px; z-index:35;
  background:rgba(255,255,255,.96); border:1px solid rgba(222,220,211,.9); border-radius:18px;
  box-shadow:0 24px 65px rgba(25,24,20,.18), 0 0 0 6px rgba(255,255,255,.55);
  padding:8px; max-height:390px; overflow-y:auto; backdrop-filter:blur(12px);
  animation:dk-float-open .18s cubic-bezier(.2,.8,.2,1) both; transform-origin:left top;
}
.dk-floating-model { top:0; max-height:none; overflow:visible; }
.dk-floating-quality { top:62px; }
.dk-floating-batch { top:124px; }
.dk-floating-aspect { top:186px; }
@keyframes dk-float-open { from { opacity:0; transform:translateX(-8px) translateY(8px) scale(.96); } to { opacity:1; transform:translateX(0) translateY(0) scale(1); } }
.dk-floating-opt { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:13px 14px; border-radius:12px; cursor:pointer; transition:background .14s ease, transform .14s ease; }
.dk-floating-opt:hover { background:#f7f6f1; transform:translateX(2px); }
.dk-floating-opt.on { background:#f0efe8; }

.dk-gen-form .dk-cta { margin-top: 20px; }

/* ── canvas (right) ── */
.dk-canvas { background: var(--card); border: 1px solid var(--line); border-radius: 22px; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-sm); }
.dk-canvas-h { padding: 18px 24px; border-bottom: 1px solid var(--line); font-size: 16px; font-weight: 800; }
.dk-canvas-body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 28px; min-height: 0; overflow-y: auto; }
.dk-session-panel .dk-canvas-body { align-items: center; justify-content: center; padding: 18px; }
.dk-session-panel .dk-canvas-body .dk-session { align-self: stretch; }
.dk-canvas-empty { display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 360px; }
.dk-canvas-ph { width: 84px; height: 84px; border-radius: 22px; background: #f1f0ea; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.dk-canvas-et { font-size: 17px; font-weight: 800; }
.dk-canvas-es { font-size: 13.5px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.dk-refund { margin-top: 14px; font-size: 13.5px; font-weight: 700; color: #5f9184; background: #eef5f1; border-radius: 12px; padding: 9px 16px; }

.dk-result { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; max-width: min(760px, 100%); }
.dk-result-media { display: block; width: auto; height: auto; max-width: 100%; max-height: 70vh; border-radius: 18px; object-fit: contain; background: #000; }
.dk-result-cap { font-size: 13.5px; color: var(--muted); text-align: center; }
.dk-result-acts { display: flex; gap: 10px; width: 100%; }
.dk-result-acts > * { flex: 1; }

.dk-session { width: 100%; min-height: 100%; display: flex; flex-direction: column; gap: 16px; }
.dk-session-grid { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); grid-auto-rows: 204px; gap: 16px; align-content: start; }
.dk-session-card { position: relative; overflow: hidden; border-radius: 16px; background: #f5f4ef; border: 1px solid var(--line); min-height: 180px; }
.dk-session-media { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.dk-session-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end; flex-direction: column; padding: 14px; color: var(--muted); font-size: 12px; font-weight: 700; text-align: center; }
.dk-session-loading .gen-skel { position:absolute; inset:0; border-radius:0; }
.dk-session-loading span { position: relative; z-index: 2; background: rgba(255,255,255,.74); border:1px solid rgba(255,255,255,.5); border-radius: 999px; padding: 6px 10px; }
.dk-session-download { position: absolute; right: 8px; bottom: 8px; width: 32px; height: 32px; border-radius: 11px; background: rgba(255,255,255,.86); color: var(--ink); display: flex; align-items: center; justify-content: center; text-decoration:none; box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.dk-session-failed { height:100%; display:flex; flex-direction:column; align-items:flex-start; justify-content:flex-start; padding:14px; gap:5px; font-size:12px; color:#fff; background: linear-gradient(180deg,#282828,#181818); }
.dk-session-failed b { font-size:13px; }
.dk-session-failed span { opacity:.78; line-height:1.35; }
.dk-session-actions { display:flex; justify-content:center; padding-bottom:2px; }
.dk-session-actions .dk-cta { width:auto; min-width:190px; padding:0 24px; }

.dk-view { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.dk-view-media { max-width: 640px; max-height: 70vh; border-radius: 18px; background: #000; }

/* ════════════ CHAT (list + conversation + agents) ════════════ */
.dk-chat { display: grid; grid-template-columns: 285px minmax(0, 1fr) 392px; gap: 18px; height: 100%; padding: 22px 24px; max-width: none; margin: 0; }
.dk-chat-list { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 14px; overflow-y: auto; box-shadow: var(--shadow-sm); }
.dk-newchat {
  width: 100%; height: 44px; border: none; border-radius: 13px; background: var(--ink); color: #fff;
  font-weight: 800; font-size: 14px; font-family: inherit; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 12px;
}
html.theme-dark .dk-newchat { background:#2b303b; color:#f5f2ea; border:1px solid #3a404d; }
html.theme-dark .dk-newchat:hover { background:#343a46; }
.dk-chat-starters { display: flex; flex-direction: column; gap: 7px; }
.dk-starter { display: flex; align-items: center; gap: 10px; padding: 12px 13px; border-radius: 13px; background: #f8f7f2; border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.dk-starter:hover { background: var(--card); }
.dk-starter-ic { flex: 0 0 auto; display: flex; }
.dk-chat-item { display: flex; align-items: center; gap: 10px; padding: 11px; border-radius: 13px; cursor: pointer; }
.dk-chat-item:hover { background: #f6f5f0; }
.dk-chat-item.on { background: #f0efe8; }
.dk-chat-av { width: 38px; height: 38px; border-radius: 11px; overflow: hidden; flex: 0 0 auto; }
.dk-chat-av img { width: 100%; height: 100%; object-fit: cover; }
.dk-chat-meta { flex: 1; min-width: 0; }
.dk-chat-title { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk-chat-prev { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk-chat-x { color: var(--faint); width: 26px; height: 26px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; border-radius: 7px; }
.dk-chat-x:hover { background: var(--line); color: var(--ink); }

.dk-conv { background: var(--card); border: 1px solid var(--line); border-radius: 22px; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-sm); }
.dk-conv-h { display: flex; align-items: center; gap: 11px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.dk-conv-av { width: 40px; height: 40px; border-radius: 12px; overflow: hidden; flex: 0 0 auto; }
.dk-conv-av img { width: 100%; height: 100%; object-fit: cover; }
.dk-conv-headtext { flex: 1; min-width: 0; }
.dk-conv-name { font-weight: 800; font-size: 15.5px; }
.dk-conv-status { font-size: 12px; font-weight: 600; }
.dk-agent-pill { height: 34px; border: 1px solid var(--line); border-radius: 999px; background: #f8f7f2; color: var(--ink); padding: 0 10px; display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 800; font-family: inherit; cursor: pointer; }
.dk-agent-pill:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.dk-conv-body { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 11px; min-height: 0; }
.dk-conv-body .bubble { max-width: 72%; }
.dk-conv-input { flex: 0 0 auto; padding: 14px 22px 18px; border-top: 1px solid var(--line); }
.dk-conv-ask { display: flex; align-items: center; gap: 10px; background: #f8f7f2; border: 1px solid var(--line); border-radius: 16px; padding: 7px 7px 7px 18px; }
.dk-conv-ask input { flex: 1; border: none; background: none; outline: none; font-family: inherit; font-size: 14.5px; color: var(--ink); }
.dk-conv-send { width: 40px; height: 40px; border-radius: 12px; border: none; flex: 0 0 auto; background: var(--nav-bg); color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.dk-conv-send.on { background: var(--accent); color: var(--accent-ink); }
.dk-conv-nochat { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.dk-conv-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 28px; }
.dk-conv-empty-ic { width: 84px; height: 84px; border-radius: 22px; background: #f1f0ea; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.dk-agents-panel { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 16px; overflow-y: auto; box-shadow: var(--shadow-sm); }
.dk-agents-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.dk-agents-title { font-size: 18px; font-weight: 900; letter-spacing: -.02em; }
.dk-agents-sub { color: var(--muted); font-size: 12.5px; font-weight: 600; margin-top: 3px; }
.dk-chat-settings-btn {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--nav-bg); color: var(--ink); display:flex; align-items:center; justify-content:center;
  cursor:pointer; flex:0 0 auto;
}
.dk-chat-settings-btn:hover { background: var(--card); border-color:#c7c6bd; }
.chat-settings-ov { background: rgba(8, 10, 12, .56); backdrop-filter: blur(10px); }
html.desktop .chat-settings-ov {
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 92;
}
html.desktop .chat-settings-ov .chat-settings-sheet {
  width: min(1120px, calc(100vw - 72px));
  max-width: none;
  padding: 0;
}
html.desktop .chat-settings-ov .chat-settings-card {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 32px 90px rgba(0,0,0,.34);
}
html.desktop .chat-settings-card .sheet-grab { display: none; }
html.desktop .chat-settings-head {
  align-items: center;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 18% 0%, rgba(252,253,118,.16), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.04), transparent);
}
html.desktop .chat-settings-mark {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 12px 30px rgba(210,210,80,.22);
}
html.desktop .chat-settings-head .sheet-title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -.02em;
}
html.desktop .chat-settings-sub {
  max-width: 520px;
  font-size: 13.5px;
  font-weight: 700;
}
html.desktop .chat-settings-close {
  display: flex;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  background: var(--nav-bg);
  color: var(--muted);
  font-family: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}
html.desktop .chat-settings-close:hover { background: var(--line); color: var(--ink); }
html.desktop .chat-settings-body {
  grid-template-columns: minmax(0, 1fr) minmax(260px, .78fr) minmax(300px, .92fr);
  grid-template-areas:
    "models models models"
    "style emoji text"
    "lang emoji text";
  gap: 14px;
  max-height: none;
  overflow: visible;
  padding: 18px 26px 12px;
  margin: 0;
}
html.desktop .chat-settings-group {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--nav-bg);
  padding: 14px;
}
html.desktop .chat-settings-group:first-child { grid-area: models; }
html.desktop .chat-settings-body .chat-settings-group:nth-child(2) { grid-area: style; }
html.desktop .chat-settings-body .chat-settings-group:nth-child(3) { grid-area: lang; }
html.desktop .chat-settings-group-emoji { grid-area: emoji; }
html.desktop .chat-settings-group-text {
  grid-area: text;
  display: flex;
  flex-direction: column;
}
html.desktop .chat-settings-section {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
html.desktop .chat-settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 11px;
}
html.desktop .chat-settings-grid-models { grid-template-columns: repeat(6, minmax(0, 1fr)); }
html.desktop .chat-settings-grid-lang { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html.desktop .chat-setting-choice {
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--card);
  transition: border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease;
}
html.desktop .chat-setting-choice:hover {
  transform: translateY(-1px);
  border-color: #c7c6bd;
  box-shadow: var(--shadow-sm);
}
html.desktop .chat-setting-choice.on {
  background: #fffdf1;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(210,210,80,.18) inset, 0 12px 28px rgba(210,210,80,.12);
}
html.desktop .chat-setting-choice span { font-size: 13px; }
html.desktop .chat-settings-emoji-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin-top: 11px;
}
html.desktop .chat-settings-emoji-grid .emoji-cell {
  min-height: 44px;
  border-radius: 14px;
  background: var(--card);
}
html.desktop .chat-settings-text {
  flex: 1;
  min-height: 218px;
  margin-top: 11px;
  resize: vertical;
  background: var(--card);
}
html.desktop .chat-settings-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--line);
  background: var(--card);
}
html.desktop .chat-settings-saved {
  min-height: auto;
  font-size: 12.5px;
  font-weight: 800;
}
html.desktop .chat-settings-done {
  width: auto;
  min-width: 160px;
  height: 46px;
  margin: 0;
  padding: 0 22px;
}
@media (max-width: 1180px) {
  html.desktop .chat-settings-ov .chat-settings-sheet {
    width: min(940px, calc(100vw - 48px));
  }
  html.desktop .chat-settings-body {
    grid-template-columns: minmax(0, 1fr) minmax(270px, .85fr);
    grid-template-areas:
      "models models"
      "style emoji"
      "lang emoji"
      "text text";
  }
  html.desktop .chat-settings-grid-models { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  html.desktop .chat-settings-text { min-height: 108px; }
}
html.theme-dark .chat-settings-ov { background: rgba(4, 5, 7, .62); }
html.theme-dark .chat-settings-group,
html.theme-dark .chat-setting-choice,
html.theme-dark .chat-settings-text,
html.theme-dark .chat-settings-emoji-grid .emoji-cell,
html.theme-dark .chat-settings-close { background: #12151b; }
html.theme-dark .chat-setting-choice:hover { border-color: #454b58; }
html.theme-dark .chat-setting-choice.on {
  background: rgba(252,253,118,.08);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(252,253,118,.16) inset;
}
.dk-agents-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.dk-agent-card { min-height: 124px; border: 1px solid var(--line); border-radius: 16px; background: #fbfaf6; padding: 12px 9px 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 7px; text-align: left; font-family: inherit; color: var(--ink); cursor: pointer; transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease; }
.dk-agent-card:hover { transform: translateY(-2px); background: #fff; border-color: #d7d4c8; box-shadow: 0 12px 30px rgba(0,0,0,.08); }
.dk-agent-card.on { background: #fffdf1; border-color: #d8d12a; box-shadow: 0 14px 36px rgba(210,203,30,.16); }
.dk-agent-emoji { width: 36px; height: 36px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.dk-agent-name { font-size: 13.5px; font-weight: 900; line-height: 1.1; }
.dk-agent-desc { font-size: 11.5px; color: var(--muted); font-weight: 600; line-height: 1.25; }
.dk-agents-hint { margin-top: 12px; border: 1px dashed var(--line); border-radius: 14px; padding: 10px 11px; color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.35; background: #fbfaf6; }

/* ════════════ HISTORY ════════════ */
.dk-history-page { max-width: none; margin: 0; padding-left: 28px; padding-right: 28px; }
.dk-hist-grid { display: grid; grid-template-columns: repeat(auto-fill, 260px); justify-content: start; align-content: start; gap: 14px; }
.dk-hist { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform .14s; }
.dk-hist:hover { transform: translateY(-2px); }
.dk-hist-img { aspect-ratio: 1; background: #f1f0ea; display: flex; align-items: center; justify-content: center; }
.dk-hist-img img { width: 100%; height: 100%; object-fit: cover; }
.dk-hist-meta { padding: 11px 13px; }
.dk-hist-t { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk-hist-s { font-size: 12px; color: var(--muted); margin-top: 2px; }

.dk-empty-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-sm);
  padding: 44px 24px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; max-width: 460px; margin: 8px auto;
}
.dk-empty-fill { width:100%; max-width:none; min-height:520px; justify-content:center; margin:8px 0 0; }
.dk-history-empty { min-height:calc(100vh - 128px); }
.dk-profile-empty { min-height:330px; }

/* ════════════ PROFILE ════════════ */
.dk-prof { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; max-width: 1180px; margin: 0 auto; padding: 24px 28px 40px; align-items:start; }
.dk-prof-main { min-width:0; }
.dk-prof-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 22px; display: grid; gap: 18px; box-shadow: var(--shadow-sm); }
.dk-prof-top { display:flex; align-items:center; gap:16px; min-width:0; }
.dk-prof-ava { width: 76px; height: 76px; border-radius: 22px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; background: #dbe7df; color: #3c5a50; font-weight: 900; font-size: 34px; }
.dk-prof-id { flex: 1; min-width: 0; }
.dk-prof-name { font-size: 22px; font-weight: 900; display: flex; align-items: center; gap: 10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dk-prof-handle { font-size: 13.5px; color: var(--muted); margin-top: 5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dk-prof-plan { flex:0 0 auto; padding:7px 11px; border-radius:999px; background:var(--nav-bg); color:var(--muted); border:1px solid var(--line); font-size:12px; font-weight:900; }
.dk-prof-plan.on { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }
.dk-prof-summary { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:10px; }
.dk-prof-summary div { min-height:66px; border:1px solid var(--line); border-radius:16px; padding:12px; background:var(--nav-bg); display:flex; flex-direction:column; justify-content:center; gap:7px; }
.dk-prof-summary span { font-size:12px; color:var(--muted); font-weight:800; }
.dk-prof-summary b { display:flex; align-items:center; gap:6px; min-width:0; font-size:14px; font-weight:900; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.dk-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.dk-stat { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; text-align: center; box-shadow: var(--shadow-sm); min-height:106px; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.dk-stat-n { font-size: 24px; font-weight: 900; margin-top: 6px; }
.dk-stat-l { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.dk-prof-side { display: flex; flex-direction: column; gap: 14px; }
.dk-prof-side .dk-card { border-radius:20px; }
.dk-prof-side .dk-pad { padding:18px; }
.dk-side-lbl { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; text-align: center; }
.dk-side-bal { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 30px; font-weight: 900; margin: 10px 0 16px; }
.dk-side-note { font-size: 12px; color: var(--muted); text-align: center; margin-top: 12px; line-height:1.4; }
.dk-side-h { font-size: 15px; font-weight: 900; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.dk-kv { display: flex; justify-content: space-between; align-items: center; gap:12px; font-size: 13.5px; padding: 7px 0; }
.dk-kv span { color: var(--muted); }
.dk-kv b { font-weight: 800; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dk-ref { display: flex; align-items: center; gap: 8px; background: #f8f7f2; border: 1px solid var(--line); border-radius: 12px; padding: 4px 4px 4px 13px; }
.dk-ref-link { flex: 1; font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk-ref-copy { width: 36px; height: 34px; border-radius: 9px; border: none; background: var(--ink); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }

/* ── picker modal (model / format) ── */
.dk-picker {
  width: calc(100vw - 56px); max-width: 560px; max-height: min(86vh, 760px); background: var(--card); border-radius: 22px;
  box-shadow: 0 24px 70px rgba(0,0,0,.22), 0 0 0 1px rgba(255,255,255,.02); display: flex; flex-direction: column; overflow: hidden;
}
.dk-picker-top { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); font-size: 17px; font-weight: 800; }
.dk-picker-top .dk-modal-x { position: static; }
.dk-picker-list { padding: 8px; overflow-y: auto; }
.dk-picker-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px; border-radius: 12px; cursor: pointer; }
.dk-picker-opt:hover { background: #f6f5f0; }
.dk-picker-opt.on { background: #f0efe8; }
.dk-picker-opt > div { min-width: 0; flex: 1; }
.dk-aspect-mini {
  width: 34px;
  max-height: 46px;
  min-height: 14px;
  flex: 0 0 34px;
  border-radius: 6px;
  border: 2px solid currentColor;
  background: color-mix(in srgb, var(--card) 58%, transparent);
  color: var(--muted);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.dk-picker-opt.on .dk-aspect-mini {
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 22%, var(--card));
}
.dk-picker-model { max-width: 760px; }
.dk-picker-model .dk-picker-list,
.dk-picker-quality .dk-picker-list,
.dk-picker-batch .dk-picker-list,
.dk-picker-aspect .dk-picker-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}
.dk-picker-model .dk-picker-opt,
.dk-picker-quality .dk-picker-opt,
.dk-picker-batch .dk-picker-opt,
.dk-picker-aspect .dk-picker-opt {
  min-height: 72px;
  align-items: flex-start;
}

/* ════════════ AUTH (desktop login/register) ════════════ */
.dk-auth { width: 100%; height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 24px; }
.dk-auth-card {
  width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--line);
  border-radius: 24px; padding: 34px 32px 28px; box-shadow: 0 20px 60px rgba(0,0,0,.10);
}
.dk-auth-brand { display: flex; align-items: center; gap: 11px; justify-content: center; margin-bottom: 20px; }
.dk-auth-h { font-size: 24px; font-weight: 800; letter-spacing: -.02em; text-align: center; }
.dk-auth-sub { font-size: 13.5px; color: var(--muted); text-align: center; margin-top: 6px; }
.dk-auth-fields { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.dk-auth-in {
  height: 50px; border-radius: 14px; border: 1px solid var(--line); background: #f8f7f2;
  padding: 0 16px; font-size: 15px; font-family: inherit; color: var(--ink); outline: none; box-sizing: border-box; width: 100%;
}
.dk-auth-in:focus { border-color: #c7c6bd; background: var(--card); }
.dk-auth-in::placeholder { color: var(--faint); }
.dk-auth-foot { text-align: center; font-size: 13.5px; color: var(--muted); margin-top: 16px; }
.dk-auth-foot b { color: var(--link); font-weight: 700; cursor: pointer; }
.dk-auth-note { text-align: center; font-size: 12px; color: var(--faint); margin-top: 14px; line-height: 1.5; }

/* ════════════ MODALS ════════════ */
.dk-modal-ov { position: fixed; inset: 0; z-index: 80; background: rgba(28,28,22,.42); display: flex; align-items: center; justify-content: center; padding: 24px; }
.dk-modal { width: 100%; max-width: 720px; background: var(--card); border-radius: 26px; padding: 28px 30px 30px; position: relative; box-shadow: 0 30px 80px rgba(0,0,0,.28); }
.dk-topup-modal { max-width:760px; max-height:88vh; overflow:auto; padding:28px; }
.dk-modal-x { position: absolute; top: 18px; right: 18px; width: 34px; height: 34px; border-radius: 10px; border: none; background: var(--nav-bg); color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.dk-modal-x:hover { background: var(--line); color: var(--ink); }
.dk-modal-title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.dk-modal-sub { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.dk-link-modal { max-width: 480px; padding: 28px; }
.dk-link-hero { display:flex; align-items:flex-start; gap:14px; padding-right:34px; }
.dk-link-hero > span {
  width:48px; height:48px; border-radius:16px; flex:0 0 auto;
  display:flex; align-items:center; justify-content:center;
  background:#e9f1ec; border:1px solid var(--line);
}
.dk-link-hero > span.dk-telegram-mark {
  background:linear-gradient(135deg,#37aee2,#1e8bd2);
  color:#fff;
  border:none;
  box-shadow:0 12px 28px rgba(30,139,210,.24);
}
.dk-link-fields { margin-top:18px; }
.dk-link-fields .dk-auth-in { background:var(--bg); }
.dk-link-done {
  margin-top:18px; padding:16px; border-radius:16px; border:1px solid var(--line);
  background:#eef7f2; color:var(--ink); font-size:14px; font-weight:900;
  display:flex; align-items:center; justify-content:center; gap:8px;
}
.dk-link-steps { display:grid; gap:8px; margin:18px 0 16px; }
.dk-link-steps div {
  display:flex; align-items:center; gap:10px; padding:11px 12px;
  border:1px solid var(--line); border-radius:14px; background:var(--nav-bg);
}
.dk-link-steps b {
  width:24px; height:24px; border-radius:8px; display:flex; align-items:center; justify-content:center;
  background:var(--card); color:var(--ink); font-size:12px; font-weight:900; border:1px solid var(--line); flex:0 0 auto;
}
.dk-link-steps span { color:var(--muted); font-size:13px; font-weight:700; line-height:1.3; }
.dk-telegram-cta {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}

.dk-bonus-card,
.dk-bonus-card-v2 { background: linear-gradient(135deg, rgba(127,170,157,.12), rgba(182,181,230,.10)); border:1px solid var(--line); border-radius:18px; padding:16px; }
.dk-topup-bonus { margin:18px 0 16px; }
.dk-bonus-title { font-size: 17px; font-weight: 900; }
.dk-bonus-note { margin-top: 10px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.dk-bonus-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.dk-bonus-bal { min-width:58px; padding:8px 10px; border-radius:14px; background:var(--nav-bg); border:1px solid var(--line); text-align:center; }
.dk-bonus-bal b { display:block; font-size:18px; line-height:1; color:var(--ink); }
.dk-bonus-bal span { display:block; margin-top:2px; font-size:12px; color:var(--muted); font-weight:900; }
.dk-bonus-tasks { display:grid; grid-template-columns: 1fr; gap: 9px; margin-top: 14px; }
.dk-bonus-task { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px; border-radius:16px; border:1px solid var(--line); background:var(--card); box-shadow:var(--shadow-sm); }
.dk-bonus-task.done { opacity:.82; }
.dk-bonus-copy { min-width:0; flex:1; }
.dk-bonus-copy span { display:block; font-size:13px; font-weight:900; line-height:1.2; }
.dk-bonus-copy small { display:block; margin-top:4px; color:var(--muted); font-size:11.5px; line-height:1.35; }
.dk-bonus-act { flex:0 0 auto; display:flex; flex-direction:column; align-items:flex-end; gap:7px; }
.dk-bonus-act b { color:#7a9c92; font-size:12px; white-space:nowrap; }
.dk-bonus-act em { font-style:normal; color:var(--muted); font-size:11.5px; font-weight:900; white-space:nowrap; }
.dk-bonus-act button,
.dk-bonus-act a { border:0; border-radius:11px; background:var(--ink); color:var(--card); text-decoration:none; font-weight:900; font-size:11.5px; padding:8px 10px; cursor:pointer; white-space:nowrap; }
.dk-bonus-act a:hover,
.dk-bonus-act button:hover { transform: translateY(-1px); }
.dk-topup-label { margin:18px 0 10px; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; font-size:12px; font-weight:900; }
.dk-sub-grid { display:grid; grid-template-columns: repeat(5,1fr); gap:10px; margin:0 0 8px; }
.dk-sub-grid-templates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dk-sub-grid-plans { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dk-sub-card { position:relative; border:1.5px solid var(--line); border-radius:18px; padding:20px 12px 16px; text-align:center; cursor:pointer; background:var(--card); transition:border-color .12s,transform .12s,background .12s; }
.dk-sub-card:hover { border-color:#c7c6bd; transform:translateY(-1px); }
.dk-sub-card.on { border-color:var(--accent); background:rgba(252,253,118,.08); box-shadow:0 0 0 1px rgba(252,253,118,.18) inset; }
.dk-sub-card .dk-sub-badge { position:absolute; top:-10px; left:50%; transform:translateX(-50%); background:var(--accent); color:var(--accent-ink); font-size:11px; font-weight:800; padding:2px 10px; border-radius:8px; white-space:nowrap; }
.dk-sub-card .dk-sub-title { font-size:13px; font-weight:700; margin-bottom:4px; }
.dk-sub-card .dk-sub-n { font-size:24px; font-weight:800; letter-spacing:-.02em; margin-top:8px; }
.dk-sub-card .dk-sub-meta { font-size:11.5px; color:var(--muted); margin-top:4px; }
.dk-sub-card .dk-sub-price { font-size:15px; font-weight:800; margin-top:10px; }
html.theme-dark .dk-sub-card:hover { border-color:#454b58; }
html.theme-dark .dk-sub-card.on { background:rgba(252,253,118,.08); border-color:var(--accent); box-shadow:0 0 0 1px rgba(252,253,118,.16) inset; }

.dk-packs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 0 0 18px; }
.dk-pack { position: relative; border: 1.5px solid var(--line); border-radius: 18px; padding: 20px 12px 16px; text-align: center; cursor: pointer; background: var(--card); transition: border-color .12s, transform .12s, background .12s; }
.dk-pack:hover { border-color: #c7c6bd; }
.dk-pack:hover { transform:translateY(-1px); }
.dk-pack.on { border-color: var(--accent); background: rgba(252,253,118,.08); box-shadow:0 0 0 1px rgba(252,253,118,.18) inset; }

/* ── dark theme refinements ── */
html.theme-dark .dk-modal-ov { background: rgba(4,6,10,.58); backdrop-filter: blur(10px); }
html.theme-dark .dk-picker { border: 1px solid rgba(255,255,255,.07); box-shadow: 0 26px 86px rgba(0,0,0,.36), 0 18px 48px rgba(0,0,0,.18), 0 0 0 1px rgba(255,255,255,.02); }
html.theme-dark .dk-cta:disabled { background: #252a34; color: #69707d; }
html.theme-dark .dk-btn-sec:hover,
html.theme-dark .dk-ask-pill:hover,
html.theme-dark .dk-ask-opt:hover,
html.theme-dark .dk-floating-opt:hover,
html.theme-dark .dk-chip:hover,
html.theme-dark .dk-row:hover,
html.theme-dark .dk-chat-item:hover,
html.theme-dark .dk-picker-opt:hover { background: #20242c; }
html.theme-dark .dk-ask,
html.theme-dark .dk-drop,
html.theme-dark .dk-ta,
html.theme-dark .dk-drop-list,
html.theme-dark .dk-floating-menu,
html.theme-dark .dk-starter,
html.theme-dark .dk-agent-pill,
html.theme-dark .dk-agent-card,
html.theme-dark .dk-agents-hint,
html.theme-dark .dk-conv-ask,
html.theme-dark .dk-ref,
html.theme-dark .dk-auth-in,
html.theme-dark .dk-pack.on { background: #12151b; }
html.theme-dark .dk-seedance-tier button { background:#20242c; }
html.theme-dark .dk-seedance-tier button.on { background:#2b3024; }
html.theme-dark .dk-ask-opt.on,
html.theme-dark .dk-floating-opt.on,
html.theme-dark .dk-agent-card.on,
html.theme-dark .dk-chat-item.on,
html.theme-dark .dk-picker-opt.on { background: #252a34; }
html.theme-dark .dk-drop-zone,
html.theme-dark .dk-ta:focus,
html.theme-dark .dk-auth-in:focus { background: var(--card); border-color: #454b58; }
html.theme-dark .dk-row-ic,
html.theme-dark .dk-canvas-ph,
html.theme-dark .dk-conv-empty-ic,
html.theme-dark .dk-hist-img { background: #20242c; }
html.theme-dark .dk-duration-auto,
html.theme-dark .dk-duration-chip { background:#20242c; }
html.theme-dark .dk-duration-auto.on,
html.theme-dark .dk-duration-chip.on { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }
html.theme-dark .dk-duration-range::-webkit-slider-runnable-track { background:linear-gradient(90deg,var(--accent) 0 var(--duration-progress, 0%),#2d332f var(--duration-progress, 0%) 100%); }
html.theme-dark .dk-refund { color: #90c7b8; background: rgba(144,199,184,.12); }
html.theme-dark .dk-pack:hover { border-color: #454b58; }
html.theme-dark .dk-pack.on { background: rgba(252,253,118,.08); border-color: var(--accent); box-shadow:0 0 0 1px rgba(252,253,118,.16) inset; }
html.theme-dark .dk-prof-summary div,
html.theme-dark .dk-chat-settings-btn,
html.theme-dark .dk-link-fields .dk-auth-in,
html.theme-dark .dk-link-steps div { background:#12151b; }
html.theme-dark .dk-link-hero > span,
html.theme-dark .dk-link-steps b { background:#20242c; }
html.theme-dark .dk-link-hero > span.dk-telegram-mark {
  background:linear-gradient(135deg,#37aee2,#1e8bd2);
  color:#fff;
}
html.theme-dark .dk-link-done { background:rgba(144,199,184,.12); }
.dk-pack-best { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; padding: 2px 10px; border-radius: 8px; white-space: nowrap; }
.dk-pack-n { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin-top: 8px; }
.dk-pack-bonus { font-size: 11.5px; font-weight: 800; color: #7a9c92; margin-top: 2px; }
.dk-pack-price { font-size: 15px; font-weight: 800; margin-top: 10px; }

.dk-topup-more {
  width: 100%; min-height: 44px; border: 1px dashed var(--line); border-radius: 15px;
  background: var(--nav-bg); color: var(--link); font-family: inherit; font-size: 13px;
  font-weight: 900; cursor: pointer; margin: -4px 0 12px;
}
.dk-topup-more:hover { border-color:#c7c6bd; transform: translateY(-1px); }
.dk-tpl-category { margin-top: 24px; }
.dk-tpl-category:first-of-type { margin-top: 18px; }
.dk-tpl-category h2 { margin: 0 0 12px; font-size: 18px; color: var(--ink); }
.dk-custom-box { display:grid; gap:8px; margin: 0 0 14px; }
.dk-custom-preview {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:10px 12px; border-radius:14px; background:var(--nav-bg); color:var(--muted);
  font-size:13px;
}
.dk-custom-preview b { color:var(--ink); }

.dk-feats { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; padding: 4px 0 4px; }
.dk-feats span { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.dk-pay-err { font-size: 13px; color: #c0473e; font-weight: 600; text-align: center; margin-top: 12px; }

/* ── responsive: collapse panels on smaller desktops ── */
@media (max-width: 1080px) {
  .dk-acts { grid-template-columns: repeat(2, 1fr); }
  .dk-tpl-grid { grid-template-columns: repeat(3, 1fr); }
  .dk-packs { grid-template-columns: repeat(2, 1fr); }
  .dk-sub-grid, .dk-sub-grid-templates, .dk-sub-grid-plans { grid-template-columns: repeat(2, 1fr); }
  .dk-bonus-tasks { grid-template-columns: 1fr; }
  .dk-gen { grid-template-columns: 380px 1fr; }
}
@media (max-width: 880px) {
  .dk-search { width: 200px; }
  .dk-prof { grid-template-columns: 1fr; }
  .dk-gen, .dk-chat { grid-template-columns: 1fr; }
  .dk-hist-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   Hubicx — staged-canvas "момент генерации" (H1 «Холст»)
   ============================================================ */
.gen-canvas, .dk-stage{
  position:relative; width:100%; border-radius:18px; overflow:hidden; margin-top:8px;
  background:rgba(10,16,26,.5); border:1px solid var(--line);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05);
}
.gen-skel{position:absolute; inset:0; overflow:hidden;
  background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01));}
.gen-skel::after{content:""; position:absolute; top:0; bottom:0; width:55%;
  background:linear-gradient(100deg, transparent, rgba(127,184,255,.22) 45%, rgba(92,200,255,.32) 50%, transparent);
  transform:translateX(-120%); animation:genSweep 1.5s ease-in-out infinite;}
@keyframes genSweep{0%{transform:translateX(-120%)}100%{transform:translateX(220%)}}
.gen-media{position:absolute; inset:0; width:100%; height:100%; object-fit:contain;
  opacity:0; filter:blur(16px) saturate(.6); transform:scale(1.06);
  transition:opacity .9s ease, filter 1.1s ease, transform 1.1s ease; background:rgba(0,0,0,.04);}
.gen-media.in{opacity:1; filter:blur(0) saturate(1); transform:scale(1);}
.gen-grain{position:absolute; inset:0; opacity:.5; mix-blend-mode:overlay; pointer-events:none;
  background-image:radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px); background-size:3px 3px;}
.gen-stages{display:flex; gap:5px; margin-top:12px;}
.gen-chip{flex:1; height:5px; border-radius:3px; background:rgba(255,255,255,.10); overflow:hidden;}
.gen-chip i{display:block; height:100%; width:0; border-radius:3px;
  background:linear-gradient(90deg,#5cc8ff,#2f80ed); transition:width .4s ease;}
.gen-chip.done i{width:100%;}
.gen-chip.act i{width:60%; animation:genChipPulse 1.1s ease-in-out infinite;}
@keyframes genChipPulse{0%,100%{opacity:.7}50%{opacity:1}}
.gen-stagerow{display:flex; align-items:center; justify-content:space-between; margin-top:10px; gap:12px;}
.gen-stage-l{display:flex; align-items:center; gap:8px; font-size:14px; font-weight:700;}
.gen-dot{width:7px; height:7px; border-radius:50%; background:#5cc8ff;
  box-shadow:0 0 0 0 rgba(92,200,255,.5); animation:genPing 1.4s ease-out infinite;}
@keyframes genPing{0%{box-shadow:0 0 0 0 rgba(92,200,255,.5)}100%{box-shadow:0 0 0 9px rgba(92,200,255,0)}}
.gen-eta{font-size:13px; color:var(--muted,#90A0B6); font-variant-numeric:tabular-nums; white-space:nowrap;}
.dk-stage-wrap{display:flex; flex-direction:column; align-items:stretch; width:300px; max-width:100%;}
.dk-stage{margin-top:0;}
.dk-result-stage{width:min(760px,100%); aspect-ratio:1/1; max-height:70vh; margin:0 auto;}
@media (prefers-reduced-motion:reduce){
  .gen-skel::after, .gen-chip.act i, .gen-dot{animation:none}
  .gen-media{transition:none; opacity:1; filter:none; transform:none}
}
