/* Clickable app preview (demo.js). Matches the ZeroCap desktop app's look. */
.demo-wrap { position: relative; z-index: 1; max-width: 1080px; margin: 56px auto 0; padding: 0 0 8px; }
.demo-hint { margin: 14px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.demo { text-align: left; }

.dm-win {
  --dm-side: #1b1c1f; --dm-line: rgb(255 255 255 / 9%); --dm-panel: rgb(24 27 34 / 88%); --dm-text: #eceff4; --dm-dim: #9aa3b2;
  position: relative; height: 580px; display: flex; flex-direction: column; overflow: hidden;
  border-radius: 16px; border: 1px solid rgb(255 255 255 / 14%); background: #111317; color: var(--dm-text);
  box-shadow: 0 -10px 80px color-mix(in srgb, var(--accent) 16%, transparent), 0 30px 80px rgb(0 0 0 / 60%);
  font-size: 14px; line-height: 1.45;
}
.dm-win button { font: inherit; color: inherit; cursor: pointer; }
.dm-i { flex: none; }
.dm-sp { flex: 1; }
.dm-title { display: flex; align-items: center; gap: 14px; height: 40px; padding: 0 12px; background: var(--dm-side); border-bottom: 1px solid var(--dm-line); font-size: 13px; color: #d7dce4; }
.dm-title i { width: 11px; height: 11px; border-radius: 50%; background: rgb(255 255 255 / 14%); }
.dm-ib { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--dm-dim); }
.dm-ib:hover { background: rgb(255 255 255 / 8%); color: var(--dm-text); }
.dm-body { flex: 1; display: flex; min-height: 0; position: relative; }

/* sidebar */
.dm-side { width: 230px; flex: none; display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; background: var(--dm-side); border-right: 1px solid var(--dm-line); overflow: hidden; transition: margin .25s ease; }
.noside .dm-side { margin-left: -230px; }
.dm-brand { display: flex; align-items: center; gap: 8px; padding: 2px 6px 12px; font-weight: 600; }
.dm-brand img { width: 26px; height: 26px; image-rendering: pixelated; }
.dm-new { display: flex; align-items: center; justify-content: center; gap: 8px; height: 38px; margin-bottom: 10px; border-radius: 10px; border: 1px solid rgb(255 255 255 / 14%); background: rgb(255 255 255 / 9%); font-weight: 600; }
.dm-new:hover { background: rgb(255 255 255 / 14%); }
.dm-nav, .dm-sess, .dm-more { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border: 0; border-radius: 9px; background: none; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-nav:hover, .dm-sess:hover, .dm-more:hover { background: rgb(255 255 255 / 6%); }
.dm-nav.on, .dm-sess.on { background: rgb(255 255 255 / 10%); }
.dm-wsh { display: flex; align-items: center; gap: 10px; padding: 14px 10px 6px; color: var(--dm-dim); font-size: 13px; }
.dm-wsh span { flex: 1; }
.dm-ws { display: flex; align-items: center; gap: 8px; padding: 6px 10px; }
.dm-ws .dm-i { color: color-mix(in srgb, var(--accent) 70%, #8ab4ff); }
.dm-sess { padding-left: 32px; color: #d7dce4; }
.dm-more { margin-top: auto; color: var(--dm-dim); }

/* main */
.dm-main { flex: 1; min-width: 0; position: relative; display: flex; flex-direction: column; background: #0c0f16 var(--dm-bg) center / cover no-repeat; image-rendering: pixelated; }
.dm-main::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, rgb(5 8 16 / 30%), rgb(5 8 16 / 62%)); pointer-events: none; }
.dm-main > * { position: relative; image-rendering: auto; }
.dm-home { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px; }
.dm-hero { display: flex; align-items: center; gap: 12px; font-size: 28px; font-weight: 700; text-shadow: 0 2px 20px rgb(0 0 0 / 60%); }
.dm-hero img { width: 34px; height: 34px; image-rendering: pixelated; }
.dm-hero em { font: 12px var(--px); padding: 3px 8px; border-radius: 8px; background: rgb(60 70 120 / 75%); }
.dm-ctx { display: flex; gap: 18px; font-size: 13px; font-weight: 600; text-shadow: 0 1px 8px rgb(0 0 0 / 70%); }
.dm-ctx span { display: inline-flex; align-items: center; gap: 6px; }

/* composer */
.dm-comp { width: min(640px, 100%); border-radius: 18px; background: var(--dm-panel); border: 1px solid var(--dm-line); backdrop-filter: blur(12px); padding: 12px 12px 10px; box-shadow: 0 16px 40px rgb(0 0 0 / 35%); }
.dm-comp textarea { width: 100%; resize: none; border: 0; outline: 0; background: none; color: var(--dm-text); font: inherit; padding: 2px 4px 8px; }
.dm-comp textarea::placeholder { color: #8b93a3; }
.dm-row { display: flex; align-items: center; gap: 6px; }
.dm-row .dm-ib { border: 1px solid var(--dm-line); border-radius: 50%; color: var(--dm-text); }
.dm-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 9px; border: 0; background: rgb(255 255 255 / 7%); font-size: 13px; font-weight: 600; white-space: nowrap; }
.dm-chip:hover { background: rgb(255 255 255 / 12%); }
.dm-chip.ghost { background: none; font-weight: 500; }
.dm-dim { color: var(--dm-dim); }
.dm-send { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); }
.dm-chat .dm-comp { margin: 0 auto 14px; width: min(680px, calc(100% - 28px)); }

/* chat */
.dm-chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.dm-chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; font-size: 13px; color: var(--dm-dim); border-bottom: 1px solid var(--dm-line); background: rgb(12 15 22 / 45%); backdrop-filter: blur(8px); }
.dm-chat-head b { color: var(--dm-text); font-size: 14px; }
.dm-chat-head span { display: inline-flex; align-items: center; gap: 5px; }
.dm-msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 18px max(18px, calc((100% - 680px) / 2)); }
.dm-user { align-self: flex-end; max-width: 78%; padding: 10px 14px; border-radius: 16px; background: rgb(30 34 44 / 92%); border: 1px solid var(--dm-line); }
.dm-proc { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; color: #c8cfda; font-size: 13px; text-shadow: 0 1px 8px rgb(0 0 0 / 80%); }
.dm-proc.static { cursor: default; }
.dm-steps { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-radius: 12px; background: rgb(12 15 22 / 78%); border: 1px solid var(--dm-line); }
.dm-steps[hidden] { display: none; }
.dm-step { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.dm-step .dm-i { color: var(--accent); }
.dm-step em { margin-left: auto; font-style: normal; color: var(--dm-dim); font-size: 12px; }
.dm-reply { padding: 12px 14px; border-radius: 14px; background: rgb(12 15 22 / 74%); border: 1px solid var(--dm-line); }
.dm-reply code { font: 12.5px ui-monospace, Consolas, monospace; padding: 1px 5px; border-radius: 5px; background: rgb(255 255 255 / 9%); }
.dm-acts { display: flex; align-items: center; gap: 12px; color: #b6bfcc; font-size: 12px; text-shadow: 0 1px 6px rgb(0 0 0 / 80%); }
.dm-acts span { display: inline-flex; align-items: center; gap: 5px; }
.dm-ad { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgb(20 24 34 / 86%); border: 1px solid rgb(127 127 127 / 22%); cursor: pointer; }
.dm-ad:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.dm-ad-m { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: linear-gradient(135deg, #14b8a6, #2563eb); font-weight: 700; }
.dm-ad div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dm-ad b { font-size: 13px; }
.dm-ad i { font: 700 10px var(--px); font-style: normal; color: var(--accent); margin-right: 4px; text-transform: uppercase; }
.dm-ad span { font-size: 12px; color: var(--dm-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-ad > button { flex: none; border: 0; border-radius: 9px; padding: 6px 12px; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 12px; }

/* plugins and tasks pages */
.dm-page { flex: 1; overflow-y: auto; margin: 16px; padding: 20px; border-radius: 16px; background: rgb(14 17 24 / 86%); border: 1px solid var(--dm-line); backdrop-filter: blur(10px); }
.dm-page h3 { margin: 0; font-size: 18px; }
.dm-sub { display: block; margin: 4px 0 16px; color: var(--dm-dim); font-size: 13px; }
.dm-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.dm-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px 64px 14px 14px; border-radius: 12px; background: rgb(255 255 255 / 4%); border: 1px solid var(--dm-line); }
.dm-card b, .dm-task b { display: inline-flex; align-items: center; gap: 7px; }
.dm-card span, .dm-task span { color: var(--dm-dim); font-size: 12.5px; }
.dm-card .dm-tog { position: absolute; right: 14px; top: 14px; }
.dm-task { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 8px; border-radius: 12px; background: rgb(255 255 255 / 4%); border: 1px solid var(--dm-line); }
.dm-task div { flex: 1; display: flex; flex-direction: column; }
.dm-tog { width: 38px; height: 22px; border-radius: 999px; border: 0; background: rgb(255 255 255 / 16%); position: relative; flex: none; transition: background .2s ease; }
.dm-tog::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s ease; }
.dm-tog.on { background: var(--accent); }
.dm-tog.on::after { transform: translateX(16px); }
.dm-btn { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--dm-line); background: rgb(255 255 255 / 7%); font-weight: 600; }

/* menus */
.dm-menu { position: absolute; z-index: 30; min-width: 230px; padding: 6px; border-radius: 14px; background: #1d2028; border: 1px solid rgb(255 255 255 / 12%); box-shadow: 0 18px 50px rgb(0 0 0 / 55%); }
.dm-menu > button, .dm-lv button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 9px; background: none; text-align: left; }
.dm-menu > button:hover, .dm-menu > button.on { background: rgb(255 255 255 / 7%); }
.dm-menu > button .dm-i:last-child { margin-left: auto; color: var(--accent); }
.dm-menu span { display: flex; flex-direction: column; }
.dm-menu small { color: var(--dm-dim); font-size: 12px; }
.dm-k { margin-left: auto; }
.dm-mh { padding: 8px 10px 4px; font-size: 11px; font-weight: 700; color: var(--dm-dim); letter-spacing: .04em; text-transform: uppercase; }
.dm-lv { display: flex; gap: 4px; padding: 2px 4px; }
.dm-lv button { width: auto; flex: 1; justify-content: center; padding: 6px 4px; font-size: 12px; }
.dm-lv button:hover { background: rgb(255 255 255 / 7%); }
.dm-lv button.on { background: color-mix(in srgb, var(--accent) 22%, transparent); box-shadow: inset 0 0 0 1px var(--accent); }
.dm-lv img { width: 26px; height: 26px; object-fit: contain; image-rendering: pixelated; }
.dm-lvname { padding: 6px 10px 4px; font-size: 12px; color: var(--accent); font-weight: 600; }
.at-plus { left: 250px; bottom: 74px; }
.at-perm { left: 290px; bottom: 74px; }
.at-model { right: 60px; bottom: 74px; min-width: 300px; }
.at-more { left: 12px; bottom: 52px; }
.noside .at-plus { left: 20px; } .noside .at-perm { left: 60px; }

/* settings */
.dm-modal { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: rgb(0 0 0 / 45%); backdrop-filter: blur(3px); }
.dm-set { width: min(760px, calc(100% - 24px)); height: min(470px, calc(100% - 24px)); display: flex; border-radius: 16px; overflow: hidden; background: #191c23; border: 1px solid rgb(255 255 255 / 12%); box-shadow: 0 24px 70px rgb(0 0 0 / 60%); }
.dm-set aside { width: 200px; flex: none; display: flex; flex-direction: column; gap: 3px; padding: 14px 10px; border-right: 1px solid var(--dm-line); }
.dm-set-h { padding: 4px 10px 12px; font-size: 16px; }
.dm-set aside button { display: flex; align-items: center; gap: 9px; height: 36px; padding: 0 10px; border: 0; border-radius: 9px; background: none; text-align: left; }
.dm-set aside button:hover { background: rgb(255 255 255 / 6%); }
.dm-set aside button.on { background: rgb(255 255 255 / 11%); }
.dm-credit { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px; color: var(--dm-dim); font-size: 12px; text-decoration: none; }
.dm-credit svg { color: #4d6bfe; }
.dm-credit:hover { color: var(--dm-text); background: rgb(255 255 255 / 5%); }
.dm-set section { flex: 1; position: relative; overflow-y: auto; padding: 22px 22px 18px; }
.dm-x { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--dm-dim); }
.dm-x:hover { background: rgb(255 255 255 / 8%); color: var(--dm-text); }
.dm-set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--dm-line); }
.dm-set-row div { display: flex; flex-direction: column; }
.dm-set-row span, .dm-set-col span { color: var(--dm-dim); font-size: 12.5px; }
.dm-set-col { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--dm-line); }
.dm-themes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.dm-themes button { display: flex; flex-direction: column; gap: 4px; padding: 0 0 6px; border-radius: 10px; border: 1px solid var(--dm-line); background: rgb(255 255 255 / 4%); overflow: hidden; font-size: 12px; }
.dm-themes img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; image-rendering: pixelated; }
.dm-themes button.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.dm-on { color: var(--accent) !important; font-weight: 600; }
.dm-st-t { display: block; font-size: 16px; }
.dm-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dm-tiles div { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 12px; border: 1px solid var(--dm-line); background: rgb(255 255 255 / 4%); }
.dm-tiles span, .dm-tiles small { color: var(--dm-dim); font-size: 12px; }
.dm-tiles b { font-size: 26px; color: var(--accent); }

/* toast */
.dm-toast { position: absolute; left: 50%; bottom: 84px; z-index: 40; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 12px; background: #262a34; border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); box-shadow: 0 14px 40px rgb(0 0 0 / 50%); font-size: 13px; font-weight: 600; text-align: center; }
.dm-toast[hidden] { display: none; }

/* small screens: sidebar slides over the content */
@media (max-width: 720px) {
  .dm-win { height: 540px; }
  .dm-side { position: absolute; z-index: 10; top: 0; bottom: 0; left: 0; box-shadow: 10px 0 30px rgb(0 0 0 / 45%); }
  .dm-title span { display: none; }
  .dm-hero { font-size: 21px; }
  .dm-ctx { gap: 10px; font-size: 12px; }
  .dm-row .dm-chip.ghost .dm-dim { display: none; }
  .at-plus, .at-perm, .noside .at-plus, .noside .at-perm { left: 12px; }
  .at-model { right: 12px; left: 12px; min-width: 0; }
  .dm-set aside { width: 150px; }
  .dm-set aside button { white-space: nowrap; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
  .dm-credit { font-size: 11px; }
  .dm-themes { grid-template-columns: repeat(3, 1fr); }
  .dm-tiles { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .dm-set { flex-direction: column; }
  .dm-set aside { width: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--dm-line); padding: 8px; }
  .dm-set-h, .dm-credit { display: none; }
  .dm-set aside button { height: 30px; font-size: 12px; }
}
