/* AI Office Studio — application styles (Bootstrap 5.3 base). No inline styles anywhere: CSP style-src 'self'. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin-ext.woff2") format("woff2"); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --aos-ink: #16213d;
  --aos-ink-2: #3b4664;
  --aos-muted: #6b7591;
  --aos-line: #e3e7f0;
  --aos-surface: #f5f7fb;
  --aos-card: #ffffff;
  --aos-primary: #2f5bea;
  --aos-primary-dark: #2448c7;
  --aos-primary-soft: #eaf0ff;
  --aos-accent: #ff6b4a;
  --aos-accent-soft: #fff1ec;
  --aos-admin: #121a2f;
  --aos-radius: 14px;
  --aos-sidebar: 248px;

  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Bengali", "Noto Sans Devanagari", sans-serif;
  --bs-body-color: var(--aos-ink);
  --bs-body-bg: var(--aos-surface);
  --bs-border-color: var(--aos-line);
  --bs-primary: #2f5bea;
  --bs-primary-rgb: 47, 91, 234;
  --bs-link-color: #2448c7;
  --bs-link-color-rgb: 36, 72, 199;
  --bs-link-hover-color: #1b379c;
  --bs-border-radius: 10px;
  --bs-border-radius-lg: 14px;
}

body { font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
h1, h2, h3, .h1, .h2, .h3, .h4, .h5, .h6 { letter-spacing: -0.015em; color: var(--aos-ink); }
code { color: #a3315a; }

.btn-primary { --bs-btn-bg: var(--aos-primary); --bs-btn-border-color: var(--aos-primary); --bs-btn-hover-bg: var(--aos-primary-dark); --bs-btn-hover-border-color: var(--aos-primary-dark); --bs-btn-active-bg: #1d3cae; --bs-btn-disabled-bg: var(--aos-primary); font-weight: 600; }
.btn-outline-primary { --bs-btn-color: var(--aos-primary-dark); --bs-btn-border-color: #b9c8f7; --bs-btn-hover-bg: var(--aos-primary); --bs-btn-hover-border-color: var(--aos-primary); }
.form-control, .form-select { border-color: #d7dce8; }
.form-control:focus, .form-select:focus { border-color: #8aa4f5; box-shadow: 0 0 0 .2rem rgba(47, 91, 234, .15); }
.card { border-color: var(--aos-line); border-radius: var(--aos-radius); box-shadow: 0 1px 2px rgba(22, 33, 61, .04); }
.table { --bs-table-bg: transparent; }
.table > thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--aos-muted); font-weight: 600; border-bottom-width: 1px; }
.card > .table-responsive > .table > :not(caption) > * > * { padding-left: 1rem; padding-right: 1rem; }

.ic { width: 18px; height: 18px; flex: 0 0 auto; }
.ic-lg { width: 28px; height: 28px; }
.skip-link { position: absolute; left: 1rem; top: 1rem; z-index: 2000; background: #fff; padding: .5rem 1rem; border-radius: 8px; }

/* ---- Auth / minimal layout ---- */
.auth-body { min-height: 100vh; background: radial-gradient(1200px 600px at 10% -10%, #e4ebff 0%, transparent 60%), radial-gradient(900px 500px at 110% 10%, #ffe9e2 0%, transparent 55%), var(--aos-surface); }
.auth-wrap { max-width: 440px; margin: 0 auto; padding: 48px 16px 32px; }
.auth-wrap-wide { max-width: 760px; }
.auth-wrap-xl { max-width: 1040px; }
.auth-brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 24px; color: var(--aos-ink); text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
.auth-card { border: 0; box-shadow: 0 10px 40px rgba(22, 33, 61, .08), 0 1px 2px rgba(22, 33, 61, .06); }
.auth-card > .card-body { padding: 32px; }
.auth-foot { text-align: center; color: var(--aos-muted); font-size: .8rem; margin-top: 20px; }
.icon-circle { width: 64px; height: 64px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--aos-primary-soft); color: var(--aos-primary); }
.icon-circle-warn { background: var(--aos-accent-soft); color: var(--aos-accent); }
.error-code { font-size: 3rem; font-weight: 800; color: var(--aos-primary); letter-spacing: -.04em; }
@media (max-width: 480px) { .auth-card > .card-body { padding: 22px; } .auth-wrap { padding-top: 28px; } }

/* ---- App shell ---- */
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar { width: var(--aos-sidebar); background: #fff; border-right: 1px solid var(--aos-line); display: flex; flex-direction: column; }
@media (min-width: 992px) { .app-sidebar { position: sticky; top: 0; height: 100vh; flex: 0 0 var(--aos-sidebar); } }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; font-weight: 700; letter-spacing: -.01em; }
.sidebar-nav { padding: 6px 10px; flex: 1 1 auto; overflow-y: auto; }
.sidebar-link { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--aos-ink-2); text-decoration: none; font-weight: 500; font-size: .93rem; margin-bottom: 2px; }
.sidebar-link:hover { background: var(--aos-surface); color: var(--aos-ink); }
.sidebar-link.active { background: var(--aos-primary-soft); color: var(--aos-primary-dark); font-weight: 600; }
.sidebar-link.disabled { color: #a6aec3; cursor: default; }
.sidebar-link.disabled:hover { background: transparent; }
.sidebar-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #9aa3ba; padding: 16px 12px 6px; font-weight: 600; }
.sidebar-admin { display: flex; align-items: center; gap: 10px; margin: 10px; padding: 10px 12px; border-radius: 10px; background: var(--aos-admin); color: #fff; text-decoration: none; font-size: .9rem; font-weight: 500; }
.sidebar-admin:hover { color: #fff; background: #1d2846; }

.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.app-topbar { display: flex; align-items: center; gap: 10px; padding: 10px 24px; background: rgba(255, 255, 255, .85); border-bottom: 1px solid var(--aos-line); position: sticky; top: 0; z-index: 1020; backdrop-filter: saturate(180%) blur(8px); }
.app-content { padding: 28px 24px 48px; max-width: 1200px; width: 100%; }
.app-content-wide { max-width: 1440px; }
@media (max-width: 575px) { .app-content { padding: 20px 16px 40px; } .app-topbar { padding: 8px 12px; } }

.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border-radius: 10px; }
.ws-switch { display: flex; align-items: center; gap: 10px; border: 1px solid var(--aos-line); background: #fff; border-radius: 12px; padding: 5px 12px 5px 6px; max-width: 320px; }
.ws-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ws-avatar, .user-avatar { width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; background: var(--aos-primary-soft); color: var(--aos-primary-dark); flex: 0 0 auto; }
.user-avatar { border-radius: 50%; background: var(--aos-ink); color: #fff; }
.ws-menu { min-width: 280px; }
.credit-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--aos-accent-soft); color: #b23a1f; font-size: .85rem; font-weight: 600; }
@media (max-width: 575px) { .credit-pill span { display: none; } .ws-switch { max-width: 190px; } }

.support-banner { display: flex; align-items: center; gap: 10px; padding: 10px 24px; background: #fff4d6; border-bottom: 1px solid #f2d999; color: #6a4b00; font-size: .9rem; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }

/* ---- Dashboard ---- */
.trial-strip { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--aos-radius); background: linear-gradient(90deg, var(--aos-primary-soft), #fff); border: 1px solid #d6e0ff; color: var(--aos-primary-dark); font-weight: 500; flex-wrap: wrap; }
.tile { position: relative; height: 100%; padding: 18px; border-radius: var(--aos-radius); background: #fff; border: 1px solid var(--aos-line); }
.tile-icon { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--aos-primary-soft); color: var(--aos-primary); margin-bottom: 12px; }
.tile-title { font-weight: 650; }
.tile-sub { color: var(--aos-muted); font-size: .88rem; margin-bottom: 10px; }
.tile-soon { opacity: .9; }
.stat { padding: 18px; border-radius: var(--aos-radius); background: #fff; border: 1px solid var(--aos-line); height: 100%; }
.stat-label { color: var(--aos-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.stat-value { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; margin: 4px 0; }
meter { height: 10px; }

/* ---- Files ---- */
.file-card { border: 1px solid var(--aos-line); border-radius: var(--aos-radius); background: #fff; overflow: hidden; height: 100%; display: flex; flex-direction: column; }
.file-thumb { aspect-ratio: 4 / 3; background: var(--aos-surface); display: flex; align-items: center; justify-content: center; color: var(--aos-muted); }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-meta { padding: 10px 12px 4px; }
.file-name { font-weight: 600; font-size: .9rem; }
.file-actions { display: flex; gap: 6px; padding: 8px 12px 12px; margin-top: auto; }
.empty { text-align: center; padding: 48px 16px; color: var(--aos-muted); border: 1px dashed #cfd6e6; border-radius: var(--aos-radius); background: #fff; }

/* ---- Account ---- */
.codes { font-size: .95rem; background: #fff; padding: 10px; border-radius: 8px; columns: 2; }
.secret-key { font-size: 1rem; letter-spacing: .05em; word-break: break-all; }
.qr-box img { border: 1px solid var(--aos-line); border-radius: 10px; background: #fff; max-width: 100%; height: auto; }
/* 2FA enrolment (first sign-in of platform staff / required roles) */
.enroll-steps { list-style: none; counter-reset: enroll; padding: 0; margin: 0 0 20px; }
.enroll-steps > li { counter-increment: enroll; position: relative; padding: 0 0 22px 48px; }
.enroll-steps > li::before { content: counter(enroll); position: absolute; left: 0; top: -2px; width: 32px; height: 32px; border-radius: 50%; background: var(--bs-primary); color: #fff; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.enroll-steps > li:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 34px; bottom: 6px; width: 2px; background: var(--aos-line); }
.enroll-scan { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.enroll-scan .qr-box { flex: 0 0 auto; }
.enroll-scan .qr-box img { width: 200px; padding: 8px; }
.enroll-key { flex: 1 1 220px; min-width: 0; padding: 12px 14px; border: 1px solid var(--aos-line); border-radius: 10px; background: #fff; }
.enroll-form { display: flex; gap: 10px; max-width: 420px; }
.enroll-form .form-control { letter-spacing: .2em; }
.enroll-form .btn { flex: 0 0 auto; }
.enroll-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--aos-line); padding-top: 14px; }
@media (max-width: 480px) { .enroll-steps > li { padding-left: 42px; } .enroll-scan .qr-box img { width: 180px; } .enroll-form { flex-direction: column; } }
.role-help { padding-left: 1rem; }

/* ---- Admin ---- */
.admin-sidebar { background: var(--aos-admin); border-right: 0; color: #c9d1e6; }
/* Bootstrap makes .offcanvas-lg transparent (!important) from lg up; keep the admin sidebar dark. */
@media (min-width: 992px) { .admin-sidebar.offcanvas-lg { background-color: var(--aos-admin) !important; } }
.admin-sidebar .sidebar-brand { color: #fff; }
.admin-sidebar .sidebar-link { color: #b6bfd8; }
.admin-sidebar .sidebar-link:hover { background: #1c2742; color: #fff; }
.admin-sidebar .sidebar-link.active { background: #253458; color: #fff; }
.admin-sidebar .sidebar-admin { background: #253458; }
.admin-body .app-content { font-size: .94rem; }
.audit-json { max-width: 380px; font-family: var(--bs-font-monospace); font-size: .75rem; color: var(--aos-muted); word-break: break-all; }

/* ---- Billing ---- */
a.credit-pill { text-decoration: none; }
.standing-banner { display: flex; align-items: center; gap: 10px; padding: 10px 24px; font-size: .9rem; flex-wrap: wrap; }
.standing-warning { background: #fff4d6; border-bottom: 1px solid #f2d999; color: #6a4b00; }
.standing-locked { background: #fde8e6; border-bottom: 1px solid #f4c3bd; color: #8a1f12; }
.plan-card { height: 100%; padding: 20px; border-radius: var(--aos-radius); background: #fff; border: 1px solid var(--aos-line); display: flex; flex-direction: column; }
.plan-card-current { border-color: var(--aos-primary); box-shadow: 0 0 0 2px rgba(47, 91, 234, .15); }
.plan-name { font-weight: 700; font-size: 1.05rem; }
.plan-price { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; margin-top: 6px; }
.plan-price span { font-size: .9rem; font-weight: 500; color: var(--aos-muted); }
.plan-features { list-style: none; padding: 0; margin: 0 0 16px; flex: 1 1 auto; font-size: .92rem; }
.plan-features li { padding: 5px 0 5px 22px; position: relative; border-bottom: 1px dashed var(--aos-line); }
.plan-features li::before { content: "✓"; position: absolute; left: 2px; color: var(--aos-primary); font-weight: 700; }
.topup { border: 1px solid var(--aos-line); border-radius: 12px; padding: 12px 16px; min-width: 220px; }

/* ---- AI writer (P2) ---- */
.writer-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.writer-tab { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--aos-line); border-radius: 12px; background: var(--aos-card); color: var(--aos-ink); text-decoration: none; }
.writer-tab svg { width: 18px; height: 18px; color: var(--aos-primary); }
.writer-tab span { font-weight: 600; font-size: .92rem; }
.writer-tab small { color: var(--aos-muted); font-size: .78rem; }
.writer-tab:hover { border-color: var(--aos-primary); }
.writer-tab.active { border-color: var(--aos-primary); background: var(--aos-primary-soft); box-shadow: inset 0 0 0 1px var(--aos-primary); }
@media (max-width: 575px) { .writer-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ai-output { border: 1px solid var(--aos-line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: var(--aos-surface); }
.ai-output-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--aos-muted); margin-bottom: 4px; }
.ai-text { white-space: pre-wrap; word-break: break-word; margin-bottom: 8px; color: var(--aos-ink); }
form[data-busy] button[disabled] { opacity: .75; }

/* ---- P3: brand kits & documents ---------------------------------------------------------------------- */
.min-w-0 { min-width: 0; }
.empty-icon { width: 56px; height: 56px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; background: var(--aos-primary-soft); color: var(--aos-primary); }
.empty-icon svg { width: 26px; height: 26px; }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; margin: 0 -4px 12px; background: rgba(255, 255, 255, .94); border: 1px solid var(--aos-line); border-radius: var(--aos-radius); box-shadow: 0 -6px 18px rgba(22, 33, 61, .06); backdrop-filter: blur(6px); }
.setup-strip { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--aos-radius); background: #fff; border: 1px dashed #c9d5ff; color: var(--aos-ink-2); flex-wrap: wrap; }
.setup-strip svg { color: var(--aos-primary); }
a.tile-live { display: block; color: var(--aos-ink); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
a.tile-live:hover { border-color: var(--aos-primary); box-shadow: 0 6px 18px rgba(47, 91, 234, .12); }

.kit-logo { height: 64px; display: flex; align-items: center; }
.kit-logo img { max-height: 64px; max-width: 100%; object-fit: contain; }
.kit-logo-sm { height: 44px; }
.kit-logo-sm img { max-height: 44px; max-width: 160px; }
.kit-logo-none { width: 56px; height: 56px; border-radius: 14px; background: var(--aos-primary-soft); color: var(--aos-primary); font-weight: 700; font-size: 1.5rem; display: inline-flex; align-items: center; justify-content: center; }
.kit-swatches { display: flex; align-items: center; gap: 10px; }

.type-card { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 14px; border: 1px solid var(--aos-line); border-radius: 12px; background: #fff; cursor: pointer; }
.type-card:hover { border-color: var(--aos-primary); }
.btn-check:checked + .type-card { border-color: var(--aos-primary); background: var(--aos-primary-soft); box-shadow: inset 0 0 0 1px var(--aos-primary); }
.btn-check:focus-visible + .type-card { outline: 3px solid rgba(47, 91, 234, .35); outline-offset: 2px; }
.type-icon { color: var(--aos-primary); margin-bottom: 4px; }
.type-name { font-weight: 650; }
.type-help { color: var(--aos-muted); font-size: .85rem; }

.row-card { padding: 12px; border: 1px solid var(--aos-line); border-radius: 12px; background: #fbfcfe; margin-bottom: 10px; }
.row-tools .btn { min-width: 34px; }
textarea[data-autogrow] { resize: vertical; overflow: hidden; }

.items-grid .item-head, .items-grid .item-row { display: grid; gap: 6px; align-items: start; grid-template-columns: minmax(150px, 1fr) 68px 64px 92px 60px 76px 100px 28px; }
.items-grid.with-hsn .item-head, .items-grid.with-hsn .item-row { grid-template-columns: minmax(140px, 1fr) 72px 68px 64px 92px 60px 76px 100px 28px; }
.items-scroll { overflow-x: auto; }
@media (min-width: 768px) { .items-grid { min-width: 660px; } }
.items-grid:not(.with-hsn) .c-hsn { display: none; }
.items-grid.no-tax .c-gst { visibility: hidden; }
.item-head { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--aos-muted); font-weight: 600; padding: 0 2px 4px; }
.item-row { padding: 6px 0; border-top: 1px solid var(--aos-line); }
.item-row .c-amount { padding-top: 5px; text-align: right; font-variant-numeric: tabular-nums; font-size: .9rem; white-space: nowrap; }
.item-row .c-remove { padding: 2px 6px; font-size: 1.1rem; line-height: 1; }
.live-totals { margin-left: auto; max-width: 340px; padding: 12px 14px; border-radius: 12px; background: var(--aos-surface); font-variant-numeric: tabular-nums; }
.live-totals > div { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.live-totals .t-total { border-top: 1px solid var(--aos-line); margin-top: 4px; padding-top: 6px; font-size: 1.1rem; }
.live-totals.no-tax .t-tax, .live-totals.no-round .t-round { display: none; }
@media (max-width: 767px) {
  .items-grid .item-head { display: none; }
  .items-grid .item-row, .items-grid.with-hsn .item-row { grid-template-columns: repeat(6, 1fr); padding: 10px 0; }
  .item-row .c-desc { grid-column: 1 / -1; }
  .item-row > input, .item-row > select { grid-column: span 2; }
  .item-row .c-amount { grid-column: 1 / 6; text-align: left; font-weight: 600; }
  .item-row .c-remove { grid-column: 6; justify-self: end; }
  .live-totals { max-width: none; }
}
@media (min-width: 1400px) { .ai-side { position: sticky; top: 76px; } }

.doc-stage { background: #e9edf5; border-radius: var(--aos-radius); padding: 20px; overflow-x: auto; }
.version-list .is-shown { background: var(--aos-primary-soft); margin: 0 -8px; padding-left: 8px !important; padding-right: 8px !important; border-radius: 8px; }
@media (max-width: 575px) { .doc-stage { padding: 8px; margin: 0 -8px; } }

/* Public share page */
.share-body { background: #e9edf5; min-height: 100vh; }
.share-bar { position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--aos-line); backdrop-filter: blur(6px); }
.share-bar-inner { max-width: 230mm; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.share-bar-title { display: flex; flex-direction: column; min-width: 0; }
.share-bar-title strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.share-main { padding: 24px 16px 8px; }
.share-foot { text-align: center; color: var(--aos-muted); font-size: .8rem; padding: 8px 16px 24px; margin: 0; }
@media (max-width: 575px) { .share-main { padding: 12px 8px 4px; } }

/* ---- P4: image studio & library ---------------------------------------------------------------------- */
.size-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.size-card { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; height: 100%; padding: 10px 12px; border: 1px solid var(--aos-line); border-radius: 12px; background: #fff; cursor: pointer; }
.size-card:hover { border-color: var(--aos-primary); }
.btn-check:checked + .size-card { border-color: var(--aos-primary); background: var(--aos-primary-soft); box-shadow: inset 0 0 0 1px var(--aos-primary); }
.btn-check:focus-visible + .size-card { outline: 3px solid rgba(47, 91, 234, .35); outline-offset: 2px; }
.size-name { font-weight: 600; font-size: .86rem; line-height: 1.25; }
.size-px { color: var(--aos-muted); font-size: .76rem; }
.size-shape { display: block; border: 2px solid var(--aos-primary); border-radius: 3px; margin-bottom: 6px; background: rgba(47, 91, 234, .08); }
.size-square, .size-product { width: 26px; height: 26px; }
.size-portrait { width: 22px; height: 27px; }
.size-story { width: 17px; height: 30px; }
.size-landscape { width: 36px; height: 19px; }
.size-youtube, .size-wide { width: 36px; height: 20px; }
.size-poster { width: 20px; height: 28px; }
.brand-box { border: 1px solid var(--aos-line); border-radius: 12px; padding: 10px 14px; background: #fbfcfe; }
.brand-box summary { cursor: pointer; }
.thumb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.thumb { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--aos-surface); border: 1px solid var(--aos-line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.image-stage { background: #e9edf5; border-radius: var(--aos-radius); padding: 16px; display: flex; justify-content: center; }
.image-stage img { max-width: 100%; height: auto; max-height: 78vh; object-fit: contain; border-radius: 6px; box-shadow: 0 2px 16px rgba(22, 33, 61, .12); }
.gen-spinner { width: 56px; height: 56px; margin: 0 auto; border-radius: 50%; border: 5px solid var(--aos-primary-soft); border-top-color: var(--aos-primary); animation: aos-spin 1s linear infinite; }
@keyframes aos-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .gen-spinner { animation-duration: 3s; } }

.lib-folders { display: flex; flex-direction: column; gap: 2px; }
.lib-folder { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; color: var(--aos-ink-2); text-decoration: none; font-size: .92rem; }
.lib-folder svg { width: 17px; height: 17px; color: var(--aos-muted); flex: none; }
.lib-folder span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-folder small { color: var(--aos-muted); }
.lib-folder:hover { background: var(--aos-surface); }
.lib-folder.active { background: var(--aos-primary-soft); color: var(--aos-primary-dark); font-weight: 600; }
.tag-chip { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--aos-surface); border: 1px solid var(--aos-line); color: var(--aos-ink-2); font-size: .8rem; text-decoration: none; }
.tag-chip.active { background: var(--aos-primary); border-color: var(--aos-primary); color: #fff; }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--aos-line); border-radius: 12px; background: #fff; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.lib-card { position: relative; border: 1px solid var(--aos-line); border-radius: 12px; background: #fff; overflow: hidden; }
.lib-card.is-selected { border-color: var(--aos-primary); box-shadow: 0 0 0 2px rgba(47, 91, 234, .25); }
.lib-check { position: absolute; top: 8px; left: 8px; z-index: 2; width: 20px; height: 20px; box-shadow: 0 0 0 2px #fff; }
.lib-thumb { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; background: var(--aos-surface); }
.lib-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lib-file { display: flex; flex-direction: column; align-items: center; color: var(--aos-muted); }
.lib-file svg { width: 36px; height: 36px; }
.lib-meta { padding: 8px 10px; display: flex; flex-direction: column; min-width: 0; }
.lib-title { font-weight: 600; font-size: .88rem; color: var(--aos-ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-sub { color: var(--aos-muted); font-size: .76rem; }
.upload-form { display: inline-flex; }
@media (max-width: 575px) { .lib-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; } .size-picker { grid-template-columns: repeat(2, 1fr); } }

/* ---- P6 video studio ---- */
.tier-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.btn-check:disabled + .size-card { opacity: .55; cursor: not-allowed; }
.video-list { display: flex; flex-direction: column; gap: 6px; }
.video-row { display: flex; gap: 10px; align-items: center; padding: 6px; border-radius: 12px; color: inherit; text-decoration: none; border: 1px solid transparent; }
.video-row:hover { border-color: var(--aos-line); background: var(--aos-surface); }
.video-thumb { flex: 0 0 auto; width: 96px; aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; border-radius: 8px; overflow: hidden; background: #111827; color: #fff; }
.video-thumb.is-portrait { width: 54px; aspect-ratio: 9 / 16; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.video-prompt { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-meta { font-size: .78rem; color: var(--aos-muted); }
.video-stage { position: relative; background: #0b1020; border-radius: 14px; overflow: hidden; display: flex; justify-content: center; }
.video-stage video { display: block; width: 100%; max-height: 78vh; background: #000; }
.video-stage.is-portrait video { width: auto; max-width: 100%; height: 78vh; }
.video-badge { position: absolute; top: 10px; left: 10px; padding: 3px 8px; border-radius: 6px; background: rgba(0, 0, 0, .6); color: #fff; font-size: .75rem; }
.lib-thumb { position: relative; }
.lib-play { position: absolute; right: 8px; bottom: 8px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; }
.lib-play .ic { width: 15px; height: 15px; }

/* ---- P7 super admin ---- */
.stat-strong { border-color: var(--aos-primary); box-shadow: inset 0 0 0 1px var(--aos-primary); }
a.stat-link { display: block; color: inherit; text-decoration: none; }
a.stat-link:hover { border-color: var(--aos-primary); }
.chart-scroll { overflow-x: auto; }
.bar-chart { display: block; max-width: 100%; height: auto; }
.bar-chart .axis { stroke: var(--aos-line); stroke-width: 1; }
.bar-chart .b-rev { fill: var(--aos-primary); }
.bar-chart .b-api { fill: #f59e0b; }
.bar-chart .b-plat { fill: #94a3b8; }
.bar-chart .b-label { font-size: 10px; fill: var(--aos-muted); text-anchor: middle; }
.chart-legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; color: var(--aos-muted); }
.chart-legend .lg { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-left: 8px; }
.lg-rev { background: var(--aos-primary); } .lg-api { background: #f59e0b; } .lg-plat { background: #94a3b8; }
.abuse-close { min-width: 220px; }
.feature-select { width: auto; flex: 0 0 auto; }
.announce-preview { max-width: 360px; }
.announce { display: flex; align-items: flex-start; gap: 10px; padding: 10px 24px; border-bottom: 1px solid var(--aos-line); font-size: .9rem; }
.announce .ic { flex: 0 0 auto; margin-top: 2px; }
.announce-text { flex: 1; }
.announce-info { background: #eef4ff; color: #1e3a8a; }
.announce-success { background: #ecfdf3; color: #14532d; }
.announce-warning { background: #fff8e6; color: #7a4b00; }
.announce-maintenance { background: #fdecec; color: #7f1d1d; }
.announce-badge-info { background: #dbe7ff; color: #1e3a8a; } .announce-badge-success { background: #d1fadf; color: #14532d; }
.announce-badge-warning { background: #ffefc2; color: #7a4b00; } .announce-badge-maintenance { background: #fbd5d5; color: #7f1d1d; }

/* Pill filters (shared: library kinds, design kinds, admin filters) */
.kind-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.kind-tab { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--aos-line, #e3e7f0); background: #fff; font-size: .8rem; color: var(--aos-ink-2, #3b4664); text-decoration: none; }
.kind-tab.active, .kind-tab:hover { background: var(--aos-primary, #2f5bea); border-color: var(--aos-primary, #2f5bea); color: #fff; }

/* P8: cookie notice (public pages and sign-in pages) */
.cookie-notice { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 1050; max-width: 620px; margin-left: auto; margin-right: auto; display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-radius: 12px; background: #16213d; color: #fff; font-size: .9rem; box-shadow: 0 10px 30px rgba(10, 18, 40, .3); }
.cookie-notice a { color: #ffd98a; }
.cookie-notice form { margin-left: auto; flex: 0 0 auto; }
/* keep the bottom of every page (buttons, footer) clear of the notice */
body:has(.cookie-notice) { padding-bottom: 110px; }
.auth-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; font-size: .82rem; margin-top: 6px; }
.auth-legal a { color: var(--aos-muted); }
.legal-editor { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; line-height: 1.55; }
.legal-ph dt, .legal-ph dd { margin-bottom: 4px; }
.msg-body { white-space: normal; overflow-wrap: anywhere; }
.launch-badge { min-width: 46px; align-self: flex-start; margin-top: 2px; }

/* P8: getting-started checklist */
.onboard-bar { height: 6px; }
.onboard-w-0 { width: 0%; }
.onboard-w-10 { width: 10%; }
.onboard-w-20 { width: 20%; }
.onboard-w-30 { width: 30%; }
.onboard-w-40 { width: 40%; }
.onboard-w-50 { width: 50%; }
.onboard-w-60 { width: 60%; }
.onboard-w-70 { width: 70%; }
.onboard-w-80 { width: 80%; }
.onboard-w-90 { width: 90%; }
.onboard-w-100 { width: 100%; }
.onboard-steps { list-style: none; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 20px; }
.onboard-steps li { display: grid; grid-template-columns: 22px 1fr; gap: 0 8px; align-items: start; }
.onboard-steps li > :not(.onboard-mark) { grid-column: 2; }
.onboard-mark { grid-row: span 2; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--aos-line); display: grid; place-items: center; margin-top: 1px; }
.onboard-steps .is-done .onboard-mark { border: 0; color: #1f8a5b; }
.onboard-steps .is-done .onboard-mark .ic { width: 20px; height: 20px; }
.onboard-steps .is-done > span:not(.onboard-mark) { color: var(--aos-muted); text-decoration: line-through; }
.onboard-steps a { font-weight: 600; }

/* P8 accessibility pass: text colours with at least 4.5:1 contrast on cards and the page background (WCAG AA). */
.text-danger { color: #b02a37 !important; }
.btn-outline-danger { --bs-btn-color: #b02a37; --bs-btn-border-color: #b02a37; --bs-btn-hover-bg: #b02a37; --bs-btn-hover-border-color: #b02a37; }
.btn-outline-secondary { --bs-btn-color: #4b5563; --bs-btn-border-color: #9aa3b2; }
