:root { color-scheme: dark; --bg: #05040a; --panel: #0a0711; --line: #332047; --text: #f7f1ff; --muted: #b8abc8; --purple: #9b4dff; --purple2: #6e35d7; --cyan: #58d5ff; }
    * { box-sizing: border-box; }
    body { margin: 0; min-height: 100vh; font-family: Inter, ui-sans-serif, system-ui, Segoe UI, Arial, sans-serif; background: radial-gradient(circle at 78% 10%, rgba(155,77,255,.32), transparent 34rem), radial-gradient(circle at 2% 8%, rgba(88,213,255,.14), transparent 26rem), var(--bg); color: var(--text); }
    header { position: fixed; inset: 0 0 auto 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 34px clamp(28px, 4vw, 76px); pointer-events: none; }
    .brand { display: inline-flex; align-items: center; text-decoration: none; pointer-events: auto; }
    .brand img { width: 174px; height: auto; display: block; }
    nav { display: flex; gap: 10px; align-items: center; pointer-events: auto; }
    .nav-form { display: inline-flex; margin: 0; gap: 0; }
    nav a, .secondary, .primary, button { border-radius: 999px; border: 1px solid rgba(255,255,255,.16); color: var(--text); padding: 10px 16px; text-decoration: none; font-weight: 750; background: rgba(255,255,255,.04); }
    .primary { display: inline-flex; justify-content: center; border: 0; background: linear-gradient(135deg, var(--purple), var(--purple2)); box-shadow: 0 18px 55px rgba(155,77,255,.25); cursor: pointer; }
    .secondary { display: inline-flex; justify-content: center; cursor: pointer; }
    main { width: min(1680px, calc(100% - 44px)); margin: 0 auto 80px; display: grid; gap: 18px; padding-top: 116px; }
    .hero { padding: clamp(28px, 6vw, 72px) 0; }
    .eyebrow { margin: 0 0 10px; color: var(--purple); font-size: 12px; font-weight: 850; letter-spacing: .18em; text-transform: uppercase; }
    h1 { margin: 0; font-size: clamp(42px, 8vw, 84px); line-height: .95; letter-spacing: 0; }
    h2 { margin: 0 0 14px; font-size: 24px; }
    .lede { max-width: 660px; color: var(--muted); font-size: 18px; line-height: 1.55; }
    .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
    .surface { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(12,9,22,.9), rgba(7,5,13,.86)); border-radius: 8px; padding: 28px; box-shadow: 0 22px 80px rgba(0,0,0,.38); }
    .sub-card { border: 1px solid rgba(255,255,255,.11); background: linear-gradient(145deg, rgba(255,255,255,.045), rgba(255,255,255,.018)); border-radius: 8px; padding: 22px; box-shadow: inset 0 1px 0 rgba(255,255,255,.03); }
    .settings-shell { width: min(1540px, 100%); margin: 0 auto; display: grid; grid-template-columns: 286px minmax(0, 1fr); gap: 52px; align-items: start; }
    .settings-sidebar { position: sticky; top: 118px; display: grid; align-content: start; gap: 8px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(12,9,22,.94), rgba(7,5,13,.88)); border-radius: 8px; padding: 18px; min-height: calc(100vh - 150px); box-shadow: 0 22px 80px rgba(0,0,0,.28); }
    .sidebar-brand { display: none; }
    .sidebar-nav { display: grid; gap: 8px; }
    .sidebar-help { display: none; }
    .settings-category { margin: 14px 8px 6px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.12); color: #c084fc; font-size: 12px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
    .settings-tab { width: 100%; min-height: 46px; display: flex; align-items: center; gap: 12px; border-radius: 6px; border: 1px solid transparent; border-left: 3px solid transparent; padding: 11px 13px; color: var(--muted); text-align: left; text-decoration: none; font-weight: 850; background: transparent; cursor: pointer; }
    .settings-tab:hover, .settings-tab.active { color: var(--text); border-color: rgba(255,255,255,.1); border-left-color: var(--purple); background: rgba(155,77,255,.14); }
    .tab-icon { width: 18px; height: 18px; opacity: .82; flex: 0 0 auto; }
    .tab-icon path { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
    .settings-content { min-width: 0; display: block; }
    .settings-panel { display: none; }
    .settings-panel.active { display: block; }
    .hub-page { display: grid; gap: 18px; max-width: 1320px; }
    .page-heading { margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
    .page-heading-clean { margin-bottom: 0; padding: 0 0 18px; }
    .page-heading h1 { font-size: clamp(42px, 5vw, 64px); line-height: 1; }
    .page-heading p { margin: 10px 0 0; }
    .dashboard-grid, .account-layout, .security-grid { display: grid; gap: 16px; }
    .dashboard-grid { grid-template-columns: minmax(0, 1fr) minmax(330px, .9fr) minmax(310px, .82fr); grid-template-areas: "account services health" "activity activity quick" "receipts receipts quick"; }
    .account-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
    .security-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
    .wide-card { grid-column: 1 / -1; }
    .account-card { grid-area: account; }
    .service-card { grid-area: services; }
    .health-card { grid-area: health; }
    .activity-card { grid-area: activity; }
    .receipts-card { grid-area: receipts; }
    .quick-card { grid-area: quick; }
    .account-card, .health-card, .profile-card, .preferences-card, .security-card { min-height: 100%; }
    .profile-line { display: flex; align-items: center; gap: 20px; min-width: 0; }
    .compact-profile { margin-top: 6px; }
    .profile-line > div:last-child { min-width: 0; }
    .profile-line h2, .profile-line h3 { margin: 0 0 6px; font-size: clamp(26px, 3vw, 38px); line-height: 1; }
    .profile-line h2, .profile-line h3, .profile-line p { overflow-wrap: anywhere; }
    .avatar { width: 86px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; color: white; font-size: 30px; font-weight: 900; background: radial-gradient(circle at 28% 20%, #a855f7, #3b0b86 72%); box-shadow: 0 20px 50px rgba(122,56,255,.28); }
    .avatar.large { width: 112px; font-size: 42px; }
    .status-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
    .chip { display: inline-flex; align-items: center; min-height: 30px; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 6px 10px; color: var(--muted); background: rgba(255,255,255,.035); font-weight: 850; font-size: 13px; }
    .chip.good { color: #b8ffcc; border-color: rgba(34,197,94,.34); background: rgba(34,197,94,.16); }
    .chip.warn { color: #ffd38a; border-color: rgba(245,158,11,.36); background: rgba(245,158,11,.14); }
    .mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 28px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.1); }
    .mini-stats div { border: 1px solid rgba(255,255,255,.1); border-radius: 8px; padding: 12px; background: rgba(255,255,255,.02); }
    .mini-stats span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; }
    .mini-stats strong { display: block; margin-top: 6px; overflow-wrap: anywhere; }
    .health-card { display: grid; align-content: start; gap: 18px; }
    .setup-row { display: flex; align-items: center; gap: 22px; }
    .health-ring { width: 128px; aspect-ratio: 1; border-radius: 50%; margin: 0; display: grid; place-items: center; background: conic-gradient(var(--purple) calc(var(--score) * 1%), rgba(255,255,255,.08) 0); position: relative; flex: 0 0 auto; }
    .health-ring::after { content: ""; position: absolute; inset: 13px; border-radius: 50%; background: #08050d; }
    .health-ring strong, .health-ring span { position: relative; z-index: 1; display: block; text-align: center; }
    .health-ring strong { font-size: 32px; }
    .health-ring span { color: var(--muted); font-weight: 800; margin-top: 42px; position: absolute; }
    .check-list { display: grid; gap: 8px; }
    .check-list span { color: var(--muted); }
    .check-list span.done { color: #86efac; }
    .service-list { display: grid; gap: 10px; }
    .service-row { border: 1px solid rgba(255,255,255,.1); border-radius: 8px; padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; background: rgba(255,255,255,.02); }
    .service-row strong, .service-row span { display: block; }
    .service-row span { color: var(--muted); margin-top: 4px; }
    .quick-card { display: grid; gap: 10px; align-content: start; }
    .quick-link { display: block; border: 1px solid rgba(255,255,255,.1); border-radius: 8px; padding: 14px; color: var(--text); text-decoration: none; background: rgba(255,255,255,.025); font-weight: 850; }
    .quick-link span { display: block; margin-top: 4px; color: var(--muted); font-weight: 650; }
    .quick-link:hover { border-color: rgba(155,77,255,.5); background: rgba(155,77,255,.12); }
    .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .grid div { border: 1px solid rgba(255,255,255,.1); border-radius: 8px; padding: 18px; }
    .grid span, .muted, .switch { color: var(--muted); }
    .grid strong { display: block; margin-top: 8px; }
    .stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 22px 0; }
    .stats div, .admin-block { border: 1px solid rgba(255,255,255,.1); border-radius: 8px; padding: 16px; }
    .stats span { display: block; color: var(--muted); font-size: 13px; }
    .stats strong { display: block; margin-top: 6px; font-size: 28px; }
    .section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
    .button-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
    .admin-table { display: grid; gap: 8px; }
    .admin-row { display: grid; grid-template-columns: minmax(240px, 2fr) minmax(110px, .7fr) minmax(100px, .7fr) minmax(120px, .8fr) minmax(220px, 1.4fr); gap: 12px; align-items: center; border: 1px solid rgba(255,255,255,.1); border-radius: 8px; padding: 12px; background: rgba(255,255,255,.018); }
    .admin-row small { display: block; margin-top: 4px; color: var(--muted); }
    .media-manager-console { width: 100%; }
    body.media-drawer-open .app-shell .settings-content { padding-left: 34px; padding-right: 34px; }
    body.media-drawer-open .media-manager-console { width: calc(100vw - 260px - 620px - 92px); max-width: none; }
    .media-stats div { position: relative; overflow: hidden; padding-left: 72px; }
    .media-stats small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
    .media-controls { display: grid; grid-template-columns: minmax(260px, 1.8fr) repeat(3, minmax(150px, .8fr)); gap: 12px; margin: 0 0 16px; }
    .media-controls label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 800; }
    .media-controls input, .media-controls select { width: 100%; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; padding: 10px 12px; color: var(--text); background: rgba(255,255,255,.035); }
    .media-controls select option { color: #12091f; background: #f7f2ff; }
    .scan-progress { width: min(420px, 100%); height: 8px; margin-top: 10px; overflow: hidden; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; background: rgba(255,255,255,.04); }
    .scan-progress span { display: block; width: 0%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--purple), #58d5ff); transition: width .25s ease; }
    .media-stat::before { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 38px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 999px; font-size: 18px; font-weight: 900; border: 1px solid currentColor; opacity: .95; }
    .media-stat.blue::before { content: "▣"; color: #38bdf8; background: rgba(56,189,248,.12); }
    .media-stat.amber::before { content: "↻"; color: #f59e0b; background: rgba(245,158,11,.13); }
    .media-stat.green::before { content: "✓"; color: #22c55e; background: rgba(34,197,94,.14); }
    .media-stat.purple::before { content: "◉"; color: #a855f7; background: rgba(168,85,247,.14); }
    .media-table { display: grid; border: 1px solid rgba(255,255,255,.1); border-radius: 8px; overflow: hidden; background: rgba(255,255,255,.018); }
    .media-table-head, .media-table-row { display: grid; grid-template-columns: 42px minmax(320px, 2.25fr) 92px 180px 150px; align-items: center; }
    .request-admin-table { display: grid; border: 1px solid rgba(255,255,255,.1); border-radius: 8px; overflow: hidden; background: rgba(255,255,255,.018); }
    .request-admin-head, .request-admin-row { grid-template-columns: minmax(360px, 2fr) minmax(220px, 1fr) 130px 100px minmax(360px, 1.4fr); }
    .media-table-head { color: #d9ccff; background: rgba(255,255,255,.035); font-size: 12px; font-weight: 850; }
    .media-table-head span, .media-table-row > span { min-width: 0; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
    .compact-actions { justify-content: flex-start; gap: 6px; }
    .compact-actions button { padding: 7px 10px; font-size: 12px; }
    .media-table-section { padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.08); color: #fff; background: rgba(255,255,255,.045); text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }
    .media-table-group { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid rgba(155,77,255,.16); color: #eadfff; background: linear-gradient(90deg, rgba(155,77,255,.16), rgba(155,77,255,.035)); }
    .media-table-group small { color: var(--muted); font-size: 12px; }
    .media-table-row { cursor: pointer; }
    .media-table-row:hover, .media-table-row.selected { background: rgba(155,77,255,.1); }
    .media-table-row.selected { box-shadow: inset 3px 0 0 var(--purple); }
    .media-selected-count { margin: -6px 0 14px; text-align: right; }
    .media-title-cell { display: flex; gap: 10px; align-items: center; }
    .media-title-cell > span:last-child { min-width: 0; }
    .media-title-cell strong, .media-title-cell small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .poster-thumb { width: 34px; aspect-ratio: 2 / 3; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.12); border-radius: 4px; color: #e9d5ff; font-size: 13px; font-weight: 900; background: linear-gradient(145deg, rgba(155,77,255,.32), rgba(255,255,255,.04)); }
    .poster-thumb-image { overflow: hidden; background: rgba(255,255,255,.04); }
    .poster-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .status-pill { display: inline-flex; align-items: center; max-width: 100%; min-width: max-content; border-radius: 6px; padding: 5px 10px; font-size: 12px; font-weight: 850; white-space: nowrap; }
    .status-pill.good { color: #86efac; background: rgba(34,197,94,.16); border: 1px solid rgba(34,197,94,.22); }
    .status-pill.warn { color: #fbbf24; background: rgba(245,158,11,.13); border: 1px solid rgba(245,158,11,.2); }
    .status-pill.bad { color: #fda4af; background: rgba(244,63,94,.13); border: 1px solid rgba(244,63,94,.24); }
    .status-pill.neutral { color: #c4b5fd; background: rgba(155,77,255,.12); border: 1px solid rgba(155,77,255,.2); }
    .media-table-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; color: var(--muted); }
    .media-drawer { position: fixed; z-index: 40; inset: 0 0 0 auto; width: min(620px, 100vw); display: none; padding: 28px; border-left: 1px solid rgba(255,255,255,.14); background: linear-gradient(180deg, rgba(12,9,22,.98), rgba(6,4,11,.98)); box-shadow: -30px 0 90px rgba(0,0,0,.46); overflow: auto; }
    .media-drawer.open { display: block; }
    .drawer-close { position: absolute; top: 22px; right: 22px; border: 0; background: transparent; font-size: 28px; padding: 2px 8px; }
    .drawer-grid { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 16px; align-items: start; }
    .drawer-grid label, .drawer-section { display: grid; gap: 8px; margin: 0; }
    .drawer-grid input, .drawer-grid textarea, .drawer-grid select { width: 100%; border: 1px solid rgba(255,255,255,.12); border-radius: 6px; padding: 10px; color: var(--text); background: rgba(255,255,255,.035); }
    .drawer-grid select option { color: #12091f; background: #f7f2ff; }
    .drawer-grid textarea { min-height: 96px; resize: vertical; }
    .drawer-poster { grid-row: span 2; min-height: 270px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; background: linear-gradient(145deg, rgba(255,255,255,.06), rgba(155,77,255,.1)); color: var(--muted); }
    .drawer-poster img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
    .drawer-poster > span { display: grid; justify-items: center; gap: 8px; padding: 18px; text-align: center; }
    .drawer-poster strong, .drawer-poster small { display: block; }
    .drawer-section { grid-column: 1 / -1; border: 1px solid rgba(255,255,255,.1); border-radius: 8px; padding: 14px; }
    .drawer-section h3 { margin: 0; }
    .asset-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid rgba(255,255,255,.08); }
    .asset-row:first-of-type { border-top: 0; }
    .asset-row strong, .asset-row small { display: block; }
    .asset-row small { color: var(--muted); margin-top: 3px; }
    .drawer-grid .wide { grid-column: 1 / -1; }
    .chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
    .chip-row span { display: inline-flex; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; padding: 6px 9px; color: #ddd0ff; background: rgba(155,77,255,.11); font-size: 12px; font-weight: 850; }
    .technical-section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
    .technical-section h3, .technical-section label:nth-last-child(-n+2) { grid-column: 1 / -1; }
    .show-section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
    .show-section h3, .show-section .wide { grid-column: 1 / -1; }
    .drawer-actions { position: sticky; bottom: -28px; display: flex; justify-content: flex-end; gap: 10px; margin: 22px -28px -28px; padding: 16px 28px; border-top: 1px solid rgba(255,255,255,.1); background: rgba(6,4,11,.96); }
    .page-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
    .page-title-row h1, .page-title-row h2 { font-size: clamp(34px, 5vw, 56px); margin: 0 0 8px; line-height: 1; }
    .action-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
    .danger { border-color: rgba(255,80,96,.45); color: #ff7b86; background: rgba(120,20,40,.14); }
    .pill { border: 1px solid rgba(255,255,255,.16); border-radius: 999px; padding: 7px 11px; color: var(--muted); font-weight: 800; font-size: 12px; }
    .status-banner { border: 1px solid rgba(255,255,255,.1); border-radius: 8px; background: linear-gradient(135deg, rgba(255,255,255,.055), rgba(255,255,255,.024)); padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
    .status-banner strong, .status-banner span { display: block; }
    .status-banner span, .banner-side span { color: var(--muted); margin-top: 4px; }
    .status-banner.ok { border-color: rgba(34,197,94,.2); }
    .status-banner.warning { border-color: rgba(239,68,68,.32); background: rgba(120,20,40,.14); }
    .banner-side { text-align: right; }
    .activity-list, .receipt-list { display: grid; gap: 0; }
    .activity-item, .receipt-item { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 0; border-top: 1px solid rgba(255,255,255,.08); }
    .activity-item:first-child, .receipt-item:first-child { border-top: 0; }
    .activity-item strong, .activity-item span, .receipt-item strong, .receipt-item span { display: block; }
    .activity-item span, .receipt-item span, .activity-item time { color: var(--muted); margin-top: 4px; }
    .activity-icon { width: 34px; aspect-ratio: 1; border-radius: 999px; display: grid !important; place-items: center; flex: 0 0 auto; margin: 0 !important; color: #f7f1ff !important; background: rgba(155,77,255,.2); border: 1px solid rgba(155,77,255,.34); font-weight: 900; }
    .activity-item > div { flex: 1 1 auto; min-width: 0; }
    .receipt-item > div:last-child { display: flex; align-items: center; gap: 14px; text-align: right; }
    .summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
    .summary-tile, .billing-block, .notice-row, .alert-row { border: 1px solid rgba(255,255,255,.1); border-radius: 8px; background: rgba(255,255,255,.025); }
    .summary-tile { padding: 18px; min-height: 128px; }
    .summary-tile span, .billing-block h3 { display: block; color: #c084fc; font-size: 12px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
    .summary-tile strong { display: block; margin-top: 14px; font-size: 17px; }
    .summary-tile p { margin: 8px 0 0; color: var(--muted); overflow-wrap: anywhere; }
    .text-link { color: #c084fc; text-decoration: none; font-weight: 850; }
    .text-link:hover { color: var(--text); }
    .billing-grid, .subscription-grid { display: grid; gap: 14px; margin: 0; }
    .billing-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .subscription-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .billing-block { padding: 18px; min-width: 0; }
    .billing-block h3 { margin: 0 0 14px; }
    .detail-rows { display: grid; }
    .detail-rows div { display: grid; grid-template-columns: minmax(130px, .7fr) minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.09); }
    .detail-rows div:first-child { border-top: 0; }
    .detail-rows span { color: var(--muted); }
    .detail-rows strong { overflow-wrap: anywhere; }
    .payment-method-row { display: grid; gap: 6px; padding-top: 10px; }
    .payment-method-row span { color: var(--muted); }
    .data-table { display: grid; width: 100%; overflow: hidden; min-width: 0; }
    .table-head, .table-row { display: grid; grid-template-columns: minmax(86px,.7fr) minmax(78px,.65fr) minmax(0,2fr) minmax(78px,.7fr) minmax(68px,.55fr) minmax(72px,.55fr); align-items: center; min-width: 0; }
    .activity-table .table-head, .activity-table .table-row { grid-template-columns: minmax(110px,.7fr) minmax(160px,1fr) minmax(220px,1.45fr) minmax(90px,.65fr) minmax(86px,.6fr) minmax(72px,.55fr); }
    .table-head { background: rgba(155,77,255,.12); color: #d9ccff; font-weight: 850; }
    .table-head span, .table-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 11px 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
    .receipt-actions { display: inline-flex; gap: 10px; align-items: center; padding: 0 !important; border: 0 !important; }
    .link-button { border: 0; border-radius: 0; padding: 0; color: #c084fc; background: transparent; font: inherit; font-weight: 850; cursor: pointer; }
    .receipt-modal[hidden] { display: none; }
    .receipt-modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; }
    .receipt-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.72); }
    .receipt-modal-window { position: relative; width: min(980px, calc(100vw - 32px)); height: min(820px, calc(100vh - 48px)); display: grid; grid-template-rows: auto minmax(0, 1fr); border: 1px solid rgba(255,255,255,.16); border-radius: 8px; background: #08050d; box-shadow: 0 30px 90px rgba(0,0,0,.55); overflow: hidden; }
    .receipt-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.1); }
    .receipt-modal-actions { display: flex; gap: 8px; align-items: center; }
    .receipt-modal iframe { width: 100%; height: 100%; border: 0; background: #111; }
    body.modal-open { overflow: hidden; }
    mark { border-radius: 999px; padding: 4px 8px; color: var(--text); background: rgba(255,255,255,.1); }
    .inline-status { display: inline-flex; vertical-align: middle; margin-left: 12px; font-size: 15px; transform: translateY(-8px); }
    mark.ok { background: rgba(34,197,94,.28); color: #b8ffcc; }
    mark.bad { background: rgba(239,68,68,.22); color: #ffb3b3; }
    mark.neutral { color: #ddd0ff; }
    .benefit-list { display: grid; gap: 18px; }
    .benefit-list strong, .benefit-list span { display: block; }
    .benefit-list span { color: var(--muted); margin-top: 4px; }
    .notice-row, .alert-row { display: flex; align-items: center; gap: 16px; justify-content: space-between; padding: 18px; margin-top: 0; }
    .notice-row span, .alert-row span { color: var(--muted); }
    .alert-row { border-color: rgba(255,80,96,.34); background: rgba(120,20,40,.18); }
    .compact-form { margin: 0 0 14px; }
    .collapsed { display: none; }
    .auth { width: min(520px, 100%); margin: 0 auto; }
    form { display: grid; gap: 14px; margin-top: 22px; }
    .stack-form { grid-template-columns: 1fr; margin: 0; }
    .stack-form button, .full-width { width: 100%; }
    .button-details { position: relative; }
    .button-details > summary { list-style: none; cursor: pointer; }
    .button-details > summary::-webkit-details-marker { display: none; }
    .button-details[open] { display: grid; gap: 12px; }
    .button-details[open] > form { margin-top: 12px; }
    label { display: grid; gap: 7px; color: var(--muted); font-weight: 750; }
    input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 13px 14px; background: #06040b; color: var(--text); font: inherit; }
    textarea { min-height: 88px; resize: vertical; }
    .message { min-height: 22px; color: #ff9fab; }
    .row { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid rgba(255,255,255,.1); padding: 14px 0; }
    .inline-list { display: grid; gap: 10px; margin-top: 16px; }
    .inline-item, .action-tile { border: 1px solid rgba(255,255,255,.1); border-radius: 8px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
    .inline-item strong, .inline-item span, .action-tile strong, .action-tile span { display: block; }
    .inline-item span, .action-tile span { color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
    .inline-edit { border: 1px solid rgba(255,255,255,.1); border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
    .inline-edit summary { list-style: none; cursor: pointer; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
    .inline-edit summary::-webkit-details-marker { display: none; }
    .inline-edit summary strong, .inline-edit summary span { display: block; }
    .inline-edit summary span { color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
    .inline-edit form { padding: 0 14px 14px; }
    .audit-list { display: grid; gap: 0; }
    .audit-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid rgba(255,255,255,.08); }
    .audit-row:first-child { border-top: 0; }
    .audit-row span { color: var(--muted); }
    .settings-detail { margin-top: 18px; border: 1px solid rgba(255,255,255,.1); border-radius: 8px; padding: 0; overflow: hidden; }
    .settings-detail summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; font-weight: 850; }
    .settings-detail summary::-webkit-details-marker { display: none; }
    .settings-detail[open] { padding-bottom: 14px; }
    .settings-detail .inline-list { margin: 0; padding: 0 14px; }
    details.admin-user { margin-top: 10px; padding: 0; overflow: hidden; }
    details.admin-user summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 14px; padding: 14px 16px; }
    details.admin-user summary::-webkit-details-marker { display: none; }
    details.admin-user summary small { display: block; color: var(--muted); margin-top: 4px; font-weight: 650; }
    details.admin-user[open] { padding-bottom: 14px; }
    details.admin-user .muted { margin: 0 16px; }
    .admin-user-extra { display: grid; gap: 12px; padding: 14px 16px 0; }
    .admin-user-extra section { border: 1px solid rgba(255,255,255,.08); border-radius: 8px; padding: 12px; }
    .admin-user-extra h3 { margin: 0 0 8px; font-size: 16px; }
    .admin-user-extra .row { padding: 10px 0; }
    .admin-user-extra .row:first-of-type { border-top: 0; }
    .file-group { border-top: 1px solid rgba(255,255,255,.08); padding: 10px 0; }
    .file-group:first-child { border-top: 0; padding-top: 0; }
    .file-group > strong { display: block; margin-bottom: 6px; }
    .compact-admin-form { margin: 0; padding: 0 16px 12px; }
    .admin-form { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 0 18px; }
    .admin-form .wide { grid-column: 1 / -1; }
    .admin-form button, .admin-form .message { align-self: end; }
    .app-shell header { justify-content: flex-end; padding: 34px clamp(24px, 3.6vw, 58px) 0 0; }
    .app-shell main { width: auto; max-width: none; margin: 0; padding: 0; display: block; }
    .app-shell .settings-shell { width: auto; margin: 0; display: block; }
    .app-shell .settings-sidebar { position: fixed; z-index: 18; inset: 0 auto 0 0; width: 260px; min-height: 100vh; border-width: 0 1px 0 0; border-radius: 0; padding: 42px 22px 36px; display: flex; flex-direction: column; gap: 0; background: linear-gradient(180deg, rgba(11,9,20,.98), rgba(5,4,10,.96)); box-shadow: none; }
    .app-shell .sidebar-brand { display: inline-flex; width: fit-content; margin: 0 0 44px; }
    .app-shell .sidebar-brand img { width: 166px; height: auto; display: block; }
    .app-shell .sidebar-nav { display: grid; gap: 8px; }
    .app-shell .settings-tab { min-height: 48px; border-radius: 8px; padding: 12px 14px; }
    .app-shell .settings-category { margin: 16px 8px 8px; padding-top: 14px; }
    .app-shell .sidebar-help { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; margin-top: auto; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; padding: 14px; color: var(--text); text-decoration: none; background: rgba(255,255,255,.025); }
    .app-shell .sidebar-help strong, .app-shell .sidebar-help small { display: block; }
    .app-shell .sidebar-help small { margin-top: 3px; color: #c084fc; }
    .app-shell .help-icon { width: 30px; aspect-ratio: 1; border-radius: 999px; display: grid; place-items: center; color: #d9ccff; border: 1px solid rgba(155,77,255,.5); background: rgba(155,77,255,.14); font-weight: 900; }
    .app-shell .help-arrow { color: #c084fc; }
    .app-shell .settings-content { margin-left: 260px; padding: 110px clamp(52px, 5.4vw, 104px) 72px; min-height: 100vh; }
    .app-shell .hub-page { max-width: 1360px; }
    .app-shell .page-heading h1 { font-size: clamp(42px, 4.2vw, 58px); }
    .payment-note { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
    .security-status-strip .status-chips { margin: 0; justify-content: flex-end; }
    .disabled-cell { opacity: .58; }
    @media (max-width: 1280px) { .dashboard-grid { grid-template-columns: minmax(0, 1fr) minmax(300px, .85fr); grid-template-areas: "account health" "services quick" "activity quick" "receipts receipts"; } }
    @media (max-width: 1120px) { .dashboard-grid, .account-layout, .security-grid, .summary-grid, .billing-grid, .subscription-grid { grid-template-columns: 1fr; } .dashboard-grid { grid-template-areas: none; } .account-card, .service-card, .health-card, .activity-card, .receipts-card, .quick-card { grid-area: auto; } .settings-shell { grid-template-columns: 220px minmax(0, 1fr); gap: 24px; } .page-title-row, .notice-row, .alert-row, .status-banner { flex-direction: column; align-items: stretch; } .action-row { justify-content: stretch; } .banner-side { text-align: left; } }
    @media (max-width: 700px) and (pointer: coarse) { .table-head { display: none; } .table-row, .activity-table .table-row { grid-template-columns: 1fr; padding: 10px 0; } .table-row span { padding: 5px 10px; border-bottom: 0; } }
    @media (max-width: 700px) and (pointer: coarse) { header { align-items: flex-start; flex-direction: column; gap: 14px; } main { width: min(100% - 24px, 1500px); margin-top: 22px; } .settings-shell, .grid, .stats, .admin-form, .mini-stats { grid-template-columns: 1fr; } .settings-sidebar { position: static; min-height: 0; } .app-shell header { padding: 18px 18px 0; align-items: flex-end; } .app-shell main { width: auto; margin: 0; } .app-shell .settings-sidebar { position: static; width: auto; min-height: 0; border: 1px solid var(--line); border-radius: 8px; margin: 88px 14px 0; padding: 18px; } .app-shell .sidebar-brand { margin-bottom: 18px; } .app-shell .sidebar-help { display: none; } .app-shell .settings-content { margin-left: 0; padding: 22px 14px 54px; } h1 { font-size: 44px; } .profile-line { align-items: flex-start; flex-direction: column; } }

    @media (max-width: 760px) and (pointer: coarse) {
      html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
      body { min-width: 0; }
      header, .app-shell header {
        position: sticky;
        top: 0;
        z-index: 60;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
        gap: 10px;
        width: 100%;
        padding: max(12px, env(safe-area-inset-top)) 12px 10px;
        border-bottom: 1px solid rgba(255,255,255,.1);
        background: rgba(8,5,13,.86);
        backdrop-filter: blur(18px);
      }
      .public-shell header { justify-content: space-between; }
      header .brand img { width: 140px; height: auto; }
      nav { margin-left: auto; gap: 8px; flex-wrap: nowrap; }
      nav a, .nav-form button, header button {
        min-height: 40px;
        padding: 9px 12px;
        white-space: nowrap;
      }
      main, .app-shell main {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
      }
      .app-shell .settings-shell {
        width: 100%;
        max-width: 100%;
        margin: 0;
        display: block;
      }
      .app-shell .settings-sidebar {
        position: relative;
        inset: auto;
        width: auto;
        min-height: 0;
        margin: 14px 12px;
        padding: 18px;
        border: 1px solid var(--line);
        border-radius: 8px;
        box-shadow: 0 18px 50px rgba(0,0,0,.24);
      }
      .app-shell .sidebar-brand {
        margin: 0 0 18px;
      }
      .app-shell .sidebar-brand img { width: 150px; }
      .app-shell .sidebar-nav { gap: 8px; }
      .app-shell .settings-tab {
        min-height: 44px;
        padding: 10px 12px;
      }
      .app-shell .settings-category {
        margin: 14px 4px 8px;
        padding-top: 12px;
      }
      .app-shell .sidebar-help { display: none; }
      .app-shell .settings-content {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        padding: 0 12px 42px;
        min-height: auto;
      }
      body.media-drawer-open .app-shell .settings-content {
        padding-left: 12px;
        padding-right: 12px;
      }
      body.media-drawer-open .media-manager-console {
        width: 100%;
      }
      .hub-page, .surface, .media-manager-console {
        width: 100%;
        max-width: 100%;
        min-width: 0;
      }
      .surface {
        padding: 18px;
        border-radius: 8px;
      }
      h1, .page-title-row h1, .page-title-row h2 {
        font-size: clamp(32px, 10vw, 44px);
        line-height: 1.06;
      }
      .section-head, .page-title-row, .status-banner, .notice-row, .alert-row, .payment-note {
        flex-direction: column;
        align-items: stretch;
      }
      .button-row, .action-row {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 8px;
        max-width: 100%;
        overflow-x: auto;
        padding: 2px 0 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
      }
      .button-row button, .action-row button, .button-row a, .action-row a {
        flex: 0 0 auto;
        min-height: 42px;
        white-space: nowrap;
      }
      .media-selected-count {
        margin: 4px 0 12px;
        text-align: left;
      }
      .stats, .media-stats, .grid, .mini-stats, .summary-grid, .billing-grid, .subscription-grid, .account-layout, .security-grid {
        grid-template-columns: 1fr;
      }
      .media-stats div {
        min-height: 94px;
        padding: 18px 18px 18px 78px;
      }
      .media-stat::before {
        left: 20px;
        width: 42px;
        font-size: 19px;
      }
      .media-controls, .request-controls {
        grid-template-columns: 1fr;
        gap: 10px;
      }
      .media-controls input, .media-controls select {
        min-height: 46px;
        font-size: 16px;
      }
      .scan-progress {
        width: 100%;
        height: 9px;
      }
      .media-table, .request-admin-table {
        overflow: visible;
      }
      .media-table-head, .request-admin-head {
        display: none;
      }
      .media-table-section, .media-table-group {
        padding: 13px 12px;
        font-size: 13px;
      }
      .media-table-row {
        display: grid;
        grid-template-columns: 34px minmax(0, 1fr);
        grid-template-areas:
          "check title"
          ". type"
          ". conversion"
          ". packaging";
        gap: 8px 10px;
        padding: 12px;
      }
      .media-table-row > span {
        min-width: 0;
        padding: 0;
        border-bottom: 0;
      }
      .media-table-row > span:nth-child(1) { grid-area: check; align-self: start; padding-top: 12px; }
      .media-table-row > span:nth-child(2) { grid-area: title; }
      .media-table-row > span:nth-child(3) { grid-area: type; }
      .media-table-row > span:nth-child(4) { grid-area: conversion; }
      .media-table-row > span:nth-child(5) { grid-area: packaging; }
      .media-title-cell {
        align-items: flex-start;
        gap: 10px;
      }
      .media-title-cell strong, .media-title-cell small {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        overflow-wrap: anywhere;
      }
      .poster-thumb {
        width: 46px;
        border-radius: 6px;
      }
      .status-pill {
        width: fit-content;
        max-width: 100%;
        min-width: 0;
        white-space: normal;
        line-height: 1.2;
      }
      .media-table-footer {
        flex-direction: column;
        align-items: flex-start;
      }
      .request-admin-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 12px;
      }
      .request-admin-row > span {
        min-width: 0;
        overflow-wrap: anywhere;
      }
      .admin-row {
        grid-template-columns: 1fr;
      }
      .profile-line, .setup-row, .service-row, .activity-item, .receipt-item, .inline-item, .action-tile, .row {
        align-items: flex-start;
        flex-direction: column;
      }
      .detail-rows div {
        grid-template-columns: 1fr;
        gap: 4px;
      }
      .table-row, .activity-table .table-row {
        grid-template-columns: 1fr;
      }
      .table-row span, .table-head span {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        overflow-wrap: anywhere;
      }
      .media-drawer {
        inset: 0;
        width: 100vw;
        max-width: none;
        padding: max(18px, env(safe-area-inset-top)) 14px calc(92px + env(safe-area-inset-bottom));
        border-left: 0;
      }
      .drawer-close {
        top: max(12px, env(safe-area-inset-top));
        right: 12px;
      }
      .drawer-grid, .technical-section, .show-section {
        grid-template-columns: 1fr;
      }
      .drawer-poster {
        grid-row: auto;
        min-height: 220px;
        width: min(180px, 56vw);
        justify-self: start;
      }
      .asset-row {
        grid-template-columns: 1fr;
      }
      .drawer-actions {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        margin: 0;
        padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
        justify-content: stretch;
      }
      .drawer-actions button {
        flex: 1 1 0;
        min-width: 0;
        padding: 10px 8px;
      }
    }
