/* NOVA component styles. Rules follow nova-main.css (NOVA UI System v2.0) declaration for declaration,
   bound to the design-system tokens so the Dark theme renders exactly as the source and the added Light theme works.
   Where a rule used a literal colour it now uses a token (`on-accent`, `accent-text`, `accent-ink`, `danger-ink`, `wash`, `wash-2`,
   `border-hover`, `chrome`, `scrim`); in Dark every token equals the literal it replaced.
   Additions not in the source: `:focus-visible` rings on buttons, links and tabs, the `.bl-icon` sizes (the source sets none), and the iOS WebKit fix just below (nova-main.css colors `body` but never `html`). The global reset is nova-main.css's own. */

/* ===== Reset (nova-main.css: `*, *::before, *::after`) ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== iOS WebKit fix: color `html`, not just `body` =====
   Safari on iOS paints two things white if only `body` has a background: the elastic
   overscroll/rubber-band area above and below the page, and the instant before any
   stylesheet has loaded. `color-scheme` tells WebKit which of those to use even before
   this file has arrived; pair it with the `<meta name="color-scheme">` tag in the
   loading snippet in README.md, which is the only part that reaches the true pre-load
   flash (a CSS rule can't act before its own stylesheet is fetched). */
html { background: var(--bg); color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

/* ===== Type helpers ===== */
.hero-title, .section-title, .subsection-title, .card-title, .body-primary, .body-secondary { color: var(--text); }
.section-title, .card-title { margin-bottom: 6px; }
.caption, .micro, .tiny { color: var(--muted); }
.tiny { opacity: 0.6; text-transform: uppercase; }
.micro { text-transform: uppercase; }
.text-accent { color: var(--accent-text); }
.text-muted { color: var(--muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
/* Code: Google Sans Code, for code only. `.text-mono` is kept as an alias of `.text-code`. */
code, kbd, samp, pre, .text-code, .text-mono { font-family: var(--font-code); }
:not(pre) > code, kbd, samp { font-size: 0.92em; background: var(--sur3); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-xs); padding: 1px 6px; }
pre { background: var(--sur3); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-control); padding: 12px 14px; font-size: 13px; line-height: 1.6; overflow-x: auto; tab-size: 2; }
pre code { font-size: inherit; background: none; border: 0; padding: 0; }
.section-kicker { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--accent-text); font-family: var(--font-sans); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.section-kicker::before { content: ''; width: 18px; height: 1px; background: color-mix(in srgb, var(--accent-text) 65%, transparent); box-shadow: 0 0 12px color-mix(in srgb, var(--accent-text) 20%, transparent); }

/* ===== Buttons ===== */
.btn { border: 1px solid var(--border); background: var(--wash); color: var(--text); border-radius: var(--radius-md); padding: 11px 14px; font-family: var(--font-sans); font-size: 12px; text-decoration: none; cursor: pointer; transition: border-color 160ms ease, transform 160ms ease, background 160ms ease, color 160ms ease; display: inline-flex; align-items: center; justify-content: center; gap: 8px; line-height: 1; }
.btn:hover { border-color: var(--border-hover); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary, .btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.btn.primary:hover, .btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.subtle, .btn-subtle { background: var(--sur2); border-color: var(--border); color: var(--muted); font-size: 11px; padding: 10px 12px; }
.btn.subtle:hover, .btn-subtle:hover { color: var(--text); border-color: var(--border); }
.btn.danger, .btn-danger { border-color: var(--border-danger); background: var(--danger-soft); color: var(--danger-ink); }
.btn.danger:hover, .btn-danger:hover { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 20%, transparent); }
.btn.disabled, .btn[aria-disabled="true"], .btn:disabled { background: var(--sur2); border-color: var(--border); color: var(--muted); cursor: not-allowed; pointer-events: none; filter: grayscale(1); }
.btn-launch { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 10px; background: var(--sur3); border: 1px solid var(--border2); border-radius: var(--radius-sm); font-family: var(--font-display); font-size: 13px; font-weight: 700; color: var(--text); text-decoration: none; cursor: pointer; transition: background .2s, border-color .2s, color .2s, transform .15s; }
.btn-launch:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); transform: translateY(-1px); }
.btn-passkey { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; padding: 11px; background: var(--accent-glow); border: 1px solid color-mix(in srgb, var(--accent-text) 20%, transparent); border-radius: var(--radius-sm); font-family: var(--font-sans); font-size: 13px; color: var(--text); cursor: pointer; transition: background 0.2s, border-color 0.2s, opacity 0.2s; }
.btn-passkey:hover { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent-text) 34%, transparent); }
.btn-passkey:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-logout { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; background: transparent; border: 1px solid var(--border); border-radius: var(--radius-control); font-family: var(--font-sans); font-size: 12px; color: var(--muted); cursor: pointer; transition: border-color .2s, color .2s; white-space: nowrap; }
.btn-logout:hover { border-color: var(--danger); color: var(--danger); }
.icon-btn { width: 34px; height: 34px; flex: 0 0 auto; border-radius: var(--radius-control); border: 1px solid var(--border2); background: var(--sur3); color: var(--muted); cursor: pointer; transition: color .2s, border-color .2s, background .2s; display: flex; align-items: center; justify-content: center; }
.icon-btn:hover, .icon-btn.is-active { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent-text) 34%, transparent); background: color-mix(in srgb, var(--accent-text) 8%, transparent); }
.btn-group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn .fa-solid, .btn .fa-brands, .btn-primary .fa-solid { margin-right: 8px; }
.btn:focus-visible, .btn-launch:focus-visible, .btn-passkey:focus-visible, .btn-logout:focus-visible, .icon-btn:focus-visible, .tab-nav-item:focus-visible, .top-nav-link:focus-visible, .sidebar-link:focus-visible, .inline-link:focus-visible, .modal-btn:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }

/* ===== Cards ===== */
.card { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--wash), transparent 100%), var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 22px; box-shadow: var(--shadow); }
.card::before { content: ''; position: absolute; inset: 0 auto auto 0; width: 100%; height: 1px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 60%, transparent), color-mix(in srgb, var(--blue) 28%, transparent), transparent); }
.app-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 18px 16px; display: flex; flex-direction: column; gap: 0; transition: border-color .2s, background .2s, transform .18s, box-shadow .2s; cursor: default; }
.app-card:hover { border-color: var(--border-strong); background: var(--sur2); transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.app-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.app-icon { width: 40px; height: 40px; border-radius: var(--radius-control); background: var(--sur3); border: 1px solid var(--border2); display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 14px; flex-shrink: 0; }
.app-icon i { color: var(--accent-text); font-size: 17px; }
.app-meta { font-size: 9px; font-family: var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.app-card h2 { font-size: 16px; font-weight: 800; letter-spacing: -.3px; margin-bottom: 6px; color: var(--text); }
.app-description { font-size: 12px; font-family: var(--font-sans); color: var(--muted); line-height: 1.6; flex: 1; margin-bottom: 14px; }
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }

/* ===== Badges & chips ===== */
.badge-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--radius-pill); font-family: var(--font-sans); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.badge-pill.accent { background: var(--accent-glow); border: 1px solid color-mix(in srgb, var(--accent-text) 20%, transparent); color: var(--accent-ink); }
.badge-pill.default { background: var(--wash-2); border: 1px solid var(--border); color: var(--muted); }
.badge-pill.success { background: color-mix(in srgb, var(--success) 15%, transparent); border: 1px solid var(--success-border); color: var(--success); }
.badge-pill.danger { background: var(--danger-soft); border: 1px solid var(--border-danger); color: var(--danger-ink); }
.badge-pill.info { background: color-mix(in srgb, var(--blue) 12%, transparent); border: 1px solid color-mix(in srgb, var(--blue) 24%, transparent); color: var(--blue); }
.chip { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: var(--radius-pill); border: 1px solid var(--border); font-family: var(--font-sans); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); background: var(--wash-2); white-space: nowrap; }
.chip.current, .chip.success { color: var(--success); }
.chip.danger { color: var(--danger); }
.chip-group { display: flex; gap: 6px; flex-wrap: wrap; }
.provider-pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--wash); color: var(--muted-strong); font-family: var(--font-sans); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }

/* ===== Forms ===== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-family: var(--font-sans); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--sur2); color: var(--text); font-family: var(--font-sans); font-size: 13px; padding: 12px 13px; outline: none; }
.field textarea { resize: vertical; min-height: 90px; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent-text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-text) 14%, transparent); }
.field input::placeholder { color: var(--muted); }
.field input[type="file"] { padding: 10px; border-style: dashed; background: linear-gradient(180deg, color-mix(in srgb, var(--accent-text) 5%, transparent), var(--wash)), var(--sur2); color: var(--muted-strong); cursor: pointer; }
.field input[type="file"]:hover { border-color: color-mix(in srgb, var(--accent-text) 28%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--accent-text) 8%, transparent), var(--wash)), var(--sur3); }
.field input[type="file"]::file-selector-button { margin-right: 12px; border: 1px solid color-mix(in srgb, var(--accent-text) 24%, transparent); border-radius: var(--radius-control); background: var(--accent-soft); color: var(--text); padding: 10px 12px; font-family: var(--font-sans); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; transition: border-color 160ms ease, background 160ms ease, transform 160ms ease; }
.field input[type="file"]::file-selector-button:hover { border-color: color-mix(in srgb, var(--accent-text) 42%, transparent); background: color-mix(in srgb, var(--accent-text) 18%, transparent); transform: translateY(-1px); }
.field .hint { font-family: var(--font-sans); font-size: 11px; color: var(--muted); line-height: 1.5; }
.field-group-title { font-family: var(--font-sans); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.toggle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.toggle-item { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--sur2); padding: 12px 13px; font-family: var(--font-sans); font-size: 12px; color: var(--text); }
.toggle-item input[type="checkbox"] { width: 14px; height: 14px; padding: 0; margin: 0; accent-color: var(--accent); }
@media (max-width: 780px) { .form-grid, .toggle-grid { grid-template-columns: 1fr; } }

/* ===== Navigation ===== */
.top-nav-shell { position: sticky; top: 14px; z-index: 3; margin-bottom: 18px; }
.top-nav { display: flex; gap: 10px; overflow-x: auto; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--chrome); backdrop-filter: blur(14px); box-shadow: var(--shadow); scrollbar-width: none; }
.top-nav::-webkit-scrollbar { display: none; }
.top-nav-link { display: inline-flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--wash); color: var(--text); text-decoration: none; white-space: nowrap; transition: transform 160ms ease, border-color 160ms ease, background 160ms ease; }
.top-nav-link .fa-solid { color: var(--accent-text); font-size: 12px; width: 14px; text-align: center; flex-shrink: 0; }
.top-nav-link:hover { transform: translateY(-1px); border-color: var(--border-strong); background: var(--sur3); }
.top-nav-step { color: var(--accent-text); font-family: var(--font-sans); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.top-nav-label { font-size: 13px; font-weight: 700; letter-spacing: -0.02em; }
.sidebar-links { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sidebar-link { flex: 1 1 180px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control); font-size: 12px; font-family: var(--font-sans); color: var(--muted); text-decoration: none; transition: border-color .2s, color .2s; }
.sidebar-link:hover { border-color: var(--border2); color: var(--text); }
.inline-link { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; transition: opacity 0.2s; }
.inline-link:hover { opacity: 0.85; }
.section-anchor { scroll-margin-top: 120px; }
.tab-nav { display: grid; grid-template-columns: 1fr 1fr; background: var(--sur2); border: 1px solid var(--border); border-radius: var(--radius-control); padding: 3px; gap: 3px; margin-bottom: 22px; }
.tab-nav-item { padding: 8px; border: none; border-radius: 8px; background: transparent; font-size: 12px; font-family: var(--font-sans); font-weight: 500; color: var(--muted); cursor: pointer; transition: background 0.15s, color 0.15s; }
.tab-nav-item.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); }
.tab-nav-item:not(.active):hover { color: var(--text); }

/* ===== Notifications ===== */
.info-box { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--sur2); padding: 14px; }
.info-box.success { border-color: var(--success-border); background: color-mix(in srgb, var(--success) 4%, transparent); }
.product-alert { width: 100%; margin-bottom: 18px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--accent-text) 35%, transparent); border-radius: var(--radius-md); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 12%, transparent), color-mix(in srgb, var(--accent) 5%, transparent)), var(--surface); box-shadow: var(--shadow-alert); }
.notif-item { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--wash); padding: 12px; }
.notif-item.unread { border-color: var(--border-strong); background: linear-gradient(180deg, var(--accent-soft), transparent 120%), var(--wash); }
.notif-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.modal-backdrop { position: fixed; inset: 0; background: var(--scrim); backdrop-filter: blur(8px); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 30; }
.modal-backdrop.is-open { display: flex; }
.modal { width: min(460px, 100%); background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius-xl); padding: 22px 20px 18px; box-shadow: var(--shadow-modal); animation: fadeUp .24s ease both; }
.modal-badge { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: var(--radius-pill); background: var(--accent-glow); border: 1px solid color-mix(in srgb, var(--accent-text) 20%, transparent); color: var(--accent-ink); font-size: 10px; font-family: var(--font-sans); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 14px; }
.modal-status { min-height: 18px; font-size: 11px; font-family: var(--font-sans); color: var(--muted); margin-bottom: 14px; }
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.modal-btn { flex: 1 1 160px; padding: 11px 14px; border-radius: var(--radius-control); border: 1px solid var(--border2); background: var(--sur3); color: var(--text); font-size: 12px; font-family: var(--font-sans); cursor: pointer; transition: border-color .2s, background .2s, color .2s; }
.modal-btn:hover { border-color: var(--border-strong); background: var(--sur2); }
.modal-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.modal-btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.modal-btn:disabled { opacity: .55; cursor: not-allowed; }
.copy-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 10px 18px; background: var(--accent); color: var(--on-accent); border-radius: var(--radius-control); font-family: var(--font-sans); font-size: 12px; font-weight: 700; box-shadow: var(--shadow-toast); opacity: 0; transition: opacity .2s; z-index: 100; pointer-events: none; }
.copy-toast.show { opacity: 1; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Blacklink icons (<img class="bl-icon">); sizes are a starting point, not from the source ===== */
.bl-icon { width: 16px; height: 16px; flex: 0 0 auto; display: inline-block; vertical-align: middle; }
.btn .bl-icon, .top-nav-link .bl-icon { width: 14px; height: 14px; }
.app-icon .bl-icon { width: 20px; height: 20px; }
