/* ContentAI Web - design tokens, reset and the components every screen shares. Dark theme only. */
:root {
  --bg: #0d1017; --bg-2: #121722; --panel: #171d2a; --panel-2: #1d2433; --panel-3: #252d40; --line: #2a3347; --line-2: #36415a;
  --text: #e8ecf5; --muted: #8d98b3; --faint: #5f6a85;
  --accent: #6c8cff; --accent-2: #8aa4ff; --accent-d: #4b69d9; --accent-bg: rgba(108, 140, 255, .14);
  --ok: #3ecf8e; --warn: #f5b942; --danger: #ff6b6b; --danger-bg: rgba(255, 107, 107, .12);
  --video: #7c5cff; --image: #2fb6a2; --audio: #f08a4b;
  --radius: 10px; --radius-s: 6px; --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --nav-h: 52px; --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', 'Noto Sans Tamil', sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
body.modal-open { overflow: hidden; }
body.dragging { user-select: none; -webkit-user-select: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 24px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
p { margin: 0; }
a { color: var(--accent-2); text-decoration: none; } a:hover { text-decoration: underline; }
a.link { color: var(--accent-2); }
kbd { font: 11px var(--mono); background: var(--panel-3); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--muted); }
.muted { color: var(--muted); } .faint { color: var(--faint); } .grow { flex: 1 1 auto; } .center { text-align: center; } .pad { padding: 14px; }
::selection { background: rgba(108, 140, 255, .4); }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #fff; padding: 6px 10px; border-radius: 6px; z-index: 999; } .skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 4px; }
button, input, select, textarea { font: inherit; color: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; } ::-webkit-scrollbar-thumb:hover { background: var(--faint); background-clip: content-box; border: 2px solid transparent; } ::-webkit-scrollbar-track { background: transparent; }

/* ---------- top navigation ---------- */
.topnav { height: var(--nav-h); display: flex; align-items: center; gap: 18px; padding: 0 16px; background: var(--bg-2); border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 650; white-space: nowrap; } .brand:hover { text-decoration: none; }
.brand b { color: var(--accent-2); font-weight: 650; }
.mark { width: 24px; height: 24px; border-radius: 7px; background: linear-gradient(135deg, var(--accent), #a06bff); position: relative; flex: none; }
.mark::after { content: ''; position: absolute; left: 8px; top: 6px; border-left: 9px solid #fff; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
#nav { display: flex; gap: 2px; }
#nav a, #nav button { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 8px; color: var(--muted); background: none; border: 0; cursor: pointer; font-weight: 550; white-space: nowrap; }
#nav a:hover, #nav button:hover { background: var(--panel); color: var(--text); text-decoration: none; }
#nav a[aria-current='page'] { background: var(--accent-bg); color: var(--accent-2); }
#nav .ic { width: 17px; height: 17px; }
#account { position: relative; }
.acct-btn { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px 4px 4px; cursor: pointer; }
.acct-btn:hover { border-color: var(--line-2); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, #6c8cff, #a06bff); display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #fff; }
.acct-btn .em { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }

main#app { height: calc(100vh - var(--nav-h)); overflow: auto; outline: none; position: relative; }
body.no-nav main#app { height: 100vh; }
main#app.editor-main { overflow: hidden; }

/* ---------- icons ---------- */
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.fill { fill: currentColor; stroke: none; }

/* ---------- buttons and inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font-weight: 550; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover:not(:disabled) { background: var(--panel-3); border-color: var(--faint); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent-d); border-color: var(--accent); color: #fff; } .btn.primary:hover:not(:disabled) { background: var(--accent); }
.btn.danger { background: var(--danger-bg); border-color: rgba(255, 107, 107, .5); color: #ff9a9a; } .btn.danger:hover:not(:disabled) { background: rgba(255, 107, 107, .22); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); } .btn.ghost:hover:not(:disabled) { background: var(--panel); color: var(--text); border-color: transparent; }
.btn.small { padding: 4px 10px; font-size: 12.5px; border-radius: 7px; } .btn.wide { width: 100%; }
.btn.magic { background: linear-gradient(135deg, #6c46ff, #c14bff); border-color: transparent; color: #fff; } .btn.magic:hover:not(:disabled) { filter: brightness(1.12); background: linear-gradient(135deg, #6c46ff, #c14bff); border-color: transparent; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; color: var(--muted); cursor: pointer; flex: none; text-decoration: none; }
.icon-btn:hover:not(:disabled) { background: var(--panel-3); color: var(--text); text-decoration: none; }
.icon-btn.on { color: var(--accent-2); background: var(--accent-bg); } .icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.icon-btn.danger-ic:hover { color: var(--danger); background: var(--danger-bg); }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--muted); cursor: pointer; font-size: 12.5px; font-weight: 550; white-space: nowrap; }
.chip-btn:hover { color: var(--text); border-color: var(--faint); } .chip-btn.on, .chip-btn[aria-pressed='true'] { background: var(--accent-bg); border-color: var(--accent); color: var(--accent-2); }
.chip-btn .ic { width: 15px; height: 15px; }
.input { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 10px; min-width: 0; color: var(--text); }
.input:hover { border-color: var(--faint); } .input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-bg); }
select.input { padding-right: 26px; cursor: pointer; } select.input option { background: var(--panel); }
textarea.input { width: 100%; resize: vertical; min-height: 64px; }
input[type='date'].input { color-scheme: dark; }
input[type='color'] { width: 34px; height: 28px; padding: 0; border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg-2); cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; } .field > span { color: var(--muted); font-size: 12.5px; font-weight: 550; }
.inline-field { display: inline-flex; align-items: center; gap: 6px; }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 9px; padding: 2px; gap: 2px; flex-wrap: nowrap; }
.seg button { border: 0; background: none; color: var(--muted); padding: 5px 11px; border-radius: 7px; cursor: pointer; font-weight: 550; font-size: 13px; white-space: nowrap; }
.seg button:hover { color: var(--text); } .seg button[aria-pressed='true'] { background: var(--accent-d); color: #fff; }
input[type='range'] { -webkit-appearance: none; appearance: none; height: 18px; background: transparent; cursor: pointer; width: 100%; margin: 0; }
input[type='range']::-webkit-slider-runnable-track { height: 4px; background: linear-gradient(to right, var(--accent) var(--fill, 0%), var(--line-2) var(--fill, 0%)); border-radius: 4px; }
input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--accent-2); margin-top: -5px; border: 2px solid var(--bg); box-shadow: 0 0 0 1px var(--accent); }
input[type='range']::-moz-range-track { height: 4px; background: var(--line-2); border-radius: 4px; }
input[type='range']::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--accent-2); border: 2px solid var(--bg); }
input[type='range']:disabled { opacity: .4; }
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; background: var(--line-2); border-radius: 20px; transition: background .15s; }
.switch i::after { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + i { background: var(--accent); } .switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* ---------- toasts, modal, menus ---------- */
.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 1000; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; background: var(--panel-3); border: 1px solid var(--line-2); border-left: 4px solid var(--accent); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); max-width: min(560px, 90vw); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; cursor: pointer; }
.toast.in { opacity: 1; transform: none; } .toast.ok { border-left-color: var(--ok); } .toast.error { border-left-color: var(--danger); } .toast.warn { border-left-color: var(--warn); }
.modal-back { position: fixed; inset: 0; background: rgba(5, 8, 14, .72); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 500; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal-card { background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); width: min(520px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; outline: none; }
.modal-card.wide { width: min(1100px, 100%); height: min(780px, calc(100vh - 32px)); }
.modal-card.full { width: 100%; height: 100%; max-height: none; border-radius: 0; border: 0; background: #07090e; }
.modal-back.full-back { display: block; padding: 0; background: #000; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px 20px; }
.modal-body { padding: 10px 20px 16px; overflow: auto; flex: 1 1 auto; min-height: 0; }
.modal-card.full .modal-body, .modal-card.wide .modal-body.flush { padding: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.popmenu { position: fixed; z-index: 700; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow); padding: 5px; min-width: 170px; max-height: 70vh; overflow: auto; }
.pm-item { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 16px; background: none; border: 0; padding: 7px 10px; border-radius: 6px; cursor: pointer; text-align: left; }
.pm-item:hover, .pm-item:focus { background: var(--panel-3); outline: none; } .pm-item.danger { color: var(--danger); }
.popmenu .sep { height: 1px; background: var(--line); margin: 4px 0; }

/* ---------- shared bits ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 44px 20px; color: var(--muted); }
.empty.big { padding: 80px 20px; } .empty.big b { font-size: 18px; color: var(--text); } .empty.small { padding: 18px; } .empty b { color: var(--text); }
.error-box { background: var(--danger-bg); border: 1px solid rgba(255, 107, 107, .4); color: #ffb0b0; border-radius: var(--radius); padding: 12px 14px; }
.note-box { background: var(--accent-bg); border: 1px solid rgba(108, 140, 255, .4); color: #c6d3ff; border-radius: var(--radius); padding: 10px 14px; font-size: 13px; }
.warn-box { background: rgba(245, 185, 66, .1); border: 1px solid rgba(245, 185, 66, .4); color: #f7d58b; border-radius: var(--radius); padding: 10px 14px; font-size: 13px; }
.skeleton, .skel-line { background: linear-gradient(100deg, var(--panel) 30%, var(--panel-2) 50%, var(--panel) 70%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner, .v-spin { width: 34px; height: 34px; border: 3px solid var(--line-2); border-top-color: var(--accent-2); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress { height: 6px; background: var(--line); border-radius: 6px; overflow: hidden; } .progress > div { height: 100%; background: linear-gradient(90deg, var(--accent), #a06bff); transition: width .3s; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; background: var(--panel-3); color: var(--muted); }
.reco { display: inline-flex; align-items: center; gap: 3px; background: linear-gradient(135deg, #6c46ff, #c14bff); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .03em; padding: 1px 6px; border-radius: 999px; text-transform: uppercase; }
table.tbl { width: 100%; border-collapse: collapse; } .tbl th { text-align: left; color: var(--muted); font-weight: 550; font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); } .tbl td { padding: 7px 8px; border-bottom: 1px solid var(--line); }

@media (max-width: 760px) {
  #nav a span, #nav button span { display: none; } .topnav { gap: 8px; padding: 0 10px; } .brand span:last-child { display: none; } .acct-btn .em { display: none; } .acct-btn { padding: 4px; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
