:root {
  color-scheme: light dark;
  --ink: #202238;
  --ink-soft: #42465e;
  --muted: #75798e;
  --muted-strong: #60647a;
  --line: #e5e6ef;
  --line-strong: #d7d9e6;
  --canvas: #f5f6fa;
  --surface: #ffffff;
  --surface-soft: #fafaff;
  --accent: #554bd3;
  --accent-hover: #453bb9;
  --accent-soft: #f0efff;
  --mint: #dff5eb;
  --success: #167a59;
  --danger: #b74455;
  --shadow-soft: 0 16px 44px rgba(31, 34, 68, .07);
  --shadow-pop: 0 24px 70px rgba(27, 29, 55, .18);
  --radius-lg: 18px;
  --radius-xl: 26px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
html { width: 100%; min-width: 0; background: var(--canvas); }
body { min-height: 100vh; margin: 0; color: var(--ink); background: radial-gradient(ellipse at 12% 0%, #ecebff 0, transparent 34rem), var(--canvas); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #8c82ff; outline-offset: 3px; }

.topbar { position: sticky; z-index: 20; top: 0; display: flex; align-items: center; justify-content: space-between; height: 70px; padding: 0 clamp(20px, 5vw, 72px); border-bottom: 1px solid rgba(222, 224, 236, .82); background: rgba(255,255,255,.88); backdrop-filter: blur(18px); }
.wordmark { display: inline-flex; align-items: center; gap: 12px; min-width: 0; min-height: 44px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; flex: 0 0 auto; place-items: center; width: 38px; height: 38px; border-radius: 13px; color: #fff; background: linear-gradient(145deg, #7569e8, #4f45c5); box-shadow: 0 5px 14px rgba(85,75,211,.22); }
.brand-mark svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.7; stroke-linecap: round; stroke-linejoin: round; }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: 15px; font-weight: 760; letter-spacing: -.035em; }
.brand-copy small { color: var(--muted); font-size: 8px; font-weight: 780; letter-spacing: .17em; }
.top-actions { display: flex; align-items: center; gap: 9px; margin-left: auto; padding: 0 14px; }
.icon-button, .profile-button { display: inline-grid; flex: 0 0 auto; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid transparent; border-radius: 13px; color: var(--ink-soft); background: transparent; cursor: pointer; transition: background .16s, border-color .16s, transform .16s; }
.icon-button:hover, .profile-button:hover { border-color: var(--line); background: var(--surface-soft); }
.icon-button:active, .profile-button:active { transform: scale(.97); }
.icon-button svg { width: 19px; height: 19px; fill: currentColor; }
.profile-button { width: 44px; height: 44px; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; background: linear-gradient(145deg, #7469e1, #5147c7); font-size: 13px; font-weight: 720; }
.avatar-large { width: 54px; height: 54px; font-size: 19px; }
.sign-in-top { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; border: 1px solid #d8d4ff; border-radius: 12px; color: var(--accent); background: var(--surface); text-decoration: none; font-size: 12px; font-weight: 700; white-space: nowrap; }
.sign-in-top:hover { border-color: var(--accent); background: var(--accent-soft); }
.sign-in-top[hidden] { display: none; }

.popover { position: absolute; z-index: 30; top: 60px; right: clamp(14px, 4vw, 58px); width: min(360px, calc(100vw - 28px)); max-height: min(72vh, 620px); max-height: min(72dvh, 620px); overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-pop); }
.popover[hidden] { display: none; }
.launcher { padding: 19px; }
.popover-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 2px 13px; }
.popover-heading > div { display: grid; gap: 4px; }
.popover-heading strong { font-size: 16px; letter-spacing: -.025em; }
.popover-heading > span { color: var(--muted); font-size: 11px; }
.launcher-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.profile-menu { display: flex; flex-direction: column; align-items: center; gap: 9px; width: min(300px, calc(100vw - 28px)); padding: 22px; text-align: center; }
.profile-menu > strong { margin-top: 2px; font-size: 15px; }
.profile-menu .muted { margin-top: -5px; }
.muted { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.account-status { max-width: 100%; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted-strong); background: var(--surface-soft); font-size: 10px; }
.text-link, .menu-link { color: var(--accent); text-decoration: none; font-size: 12px; font-weight: 680; }
.text-link:hover, .menu-link:hover { text-decoration: underline; }
.profile-menu .text-link, .profile-menu .menu-link { display: block; width: 100%; min-height: 44px; padding: 11px 8px; }
.menu-button { border: 0; background: transparent; cursor: pointer; }
.profile-menu .menu-button { color: var(--accent); }

.home { width: min(1120px, calc(100% - 44px)); margin: 0 auto; padding: 47px 0 70px; }
.welcome { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 250px; align-items: center; min-height: 190px; padding: 32px clamp(24px, 4vw, 48px); overflow: hidden; border: 1px solid #e1defa; border-radius: var(--radius-xl); background: linear-gradient(110deg, #fff 0%, #fff 57%, #f1f0ff 100%); box-shadow: 0 10px 28px rgba(47, 42, 118, .035); }
.welcome::after { position: absolute; content: ""; width: 340px; height: 340px; right: -74px; top: -125px; border: 1px solid rgba(85,75,211,.11); border-radius: 50%; box-shadow: 0 0 0 34px rgba(85,75,211,.025), 0 0 0 70px rgba(85,75,211,.02); pointer-events: none; }
.welcome-copy { position: relative; z-index: 1; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 9px; font-weight: 780; letter-spacing: .15em; }
.eyebrow-mark { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--accent); }
.welcome h1 { max-width: 700px; margin: 12px 0 8px; font-size: clamp(30px, 4vw, 42px); font-weight: 690; line-height: 1.1; letter-spacing: -.055em; }
.intro { margin: 0; color: var(--muted-strong); font-size: 14px; line-height: 1.55; }
.welcome-mark { position: relative; display: grid; place-items: center; min-height: 125px; }
.welcome-mark-halo { position: absolute; width: 128px; height: 128px; border: 1px solid rgba(85,75,211,.17); border-radius: 50%; box-shadow: 0 0 0 18px rgba(85,75,211,.045), 0 0 0 38px rgba(85,75,211,.025); }
.welcome-mark-icon { position: relative; width: 58px; height: 58px; border-radius: 20px; }
.welcome-mark-icon svg { width: 37px; height: 37px; }
.welcome-mark-caption { position: absolute; bottom: 0; color: #706ab3; font-size: 8px; font-weight: 800; letter-spacing: .15em; }

.search-section { max-width: 780px; margin: 26px auto 0; }
.search { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 0 10px 0 18px; border: 1px solid var(--line-strong); border-radius: 17px; background: var(--surface); box-shadow: 0 7px 24px rgba(34,36,75,.045); transition: border-color .16s, box-shadow .16s; }
.search:focus-within { border-color: #a39cf1; box-shadow: 0 0 0 4px rgba(85,75,211,.10), 0 10px 28px rgba(34,36,75,.06); }
.search-icon { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.search input { width: 100%; min-width: 0; height: 52px; padding: 0 4px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 15px; }
.search input::placeholder { color: #989bad; }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search-provider { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted-strong); background: var(--surface-soft); font-size: 10px; font-weight: 650; }
.search-google-mark { font-size: 13px; font-weight: 800; color: #4285f4; }
.search-submit { display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 12px; color: #fff; background: var(--accent); cursor: pointer; transition: background .15s, transform .15s; }
.search-submit:hover { background: var(--accent-hover); }
.search-submit:active { transform: scale(.96); }
.search-submit svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.search-note { margin: 7px 0 0 18px; color: var(--muted); font-size: 10px; }

.apps-section, .tools-section { margin-top: 47px; }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.section-title h2 { margin: 6px 0 0; font-size: 22px; font-weight: 690; letter-spacing: -.045em; }
.text-button { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 10px; border: 0; border-radius: 9px; color: var(--accent); background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; }
.text-button:hover { background: var(--accent-soft); }
.app-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.app-card { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 178px; padding: 17px 18px 15px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); color: var(--ink); background: var(--surface); box-shadow: 0 5px 18px rgba(31,34,68,.035); text-decoration: none; transition: transform .18s, border-color .18s, box-shadow .18s; }
.app-card[href]:hover { transform: translateY(-3px); border-color: #c8c3f5; box-shadow: var(--shadow-soft); }
.app-card:focus-visible { outline: 3px solid #8c82ff; outline-offset: 2px; }
.app-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.app-icon { display: grid; width: 43px; height: 43px; flex: 0 0 auto; place-items: center; border-radius: 14px; color: var(--accent); background: var(--accent-soft); }
.app-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app-icon-drive { color: #277750; background: #e9f6ef; }
.app-icon-photos { color: #4269bd; background: #edf2ff; }
.app-icon-play { color: #6c53bc; background: #f2edff; }
.app-icon-office { color: #a85f35; background: #fff1e7; }
.app-icon-desktop { color: #386f96; background: #eaf4fa; }
.app-icon-mail { color: #3c6eaa; background: #eaf2ff; }
.app-card-copy { display: block; margin-top: 15px; }
.app-card-copy strong { display: block; font-size: 15px; font-weight: 690; letter-spacing: -.025em; }
.app-description { display: block; margin-top: 5px; color: var(--muted-strong); font-size: 11px; line-height: 1.5; }
.app-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 14px; }
.app-status { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 650; }
.app-status-dot { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: #55a982; }
.app-card-arrow { color: var(--accent); font-size: 17px; transition: transform .15s; }
.app-card[href]:hover .app-card-arrow { transform: translate(2px,-2px); }
.app-card-disabled { border-style: dashed; color: var(--muted); background: var(--surface-soft); }
.tools-section { padding-top: 3px; }
.tools-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.app-card-compact { display: grid; grid-template-columns: 40px minmax(0,1fr) auto; align-items: center; min-height: 84px; padding: 13px; border-radius: 14px; box-shadow: none; }
.app-card-compact .app-icon { width: 37px; height: 37px; border-radius: 12px; }
.app-card-compact .app-card-copy { min-width: 0; margin: 0; }
.app-card-compact .app-card-copy strong { font-size: 12px; }
.app-card-compact .app-description { margin-top: 3px; font-size: 10px; }
.app-card-compact .app-card-footer { margin: 0; padding: 0; }
.app-card-compact .app-status { width: 0; height: 0; overflow: hidden; }
.app-card-compact .app-card-arrow { font-size: 15px; }
.privacy-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 28px auto 0; color: var(--muted); font-size: 10px; }
.privacy-mark { display: grid; width: 18px; height: 18px; place-items: center; border-radius: 50%; color: var(--success); background: #e5f5ee; font-size: 11px; font-weight: 800; }

.device-link-panel { margin: 25px 0 0; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-soft); }
.device-link-panel h2 { margin: 9px 0 5px; font-size: 22px; letter-spacing: -.04em; }
.device-link-panel > p:not(.eyebrow) { color: var(--muted-strong); font-size: 13px; line-height: 1.6; }
.panel-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 15px; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 15px; border: 1px solid transparent; border-radius: 11px; font-size: 12px; font-weight: 700; cursor: pointer; transition: background .15s, border-color .15s, transform .15s; }
.primary-button { color: #fff; background: var(--accent); }
.primary-button:hover { background: var(--accent-hover); }
.secondary-button { color: var(--ink-soft); border-color: var(--line); background: var(--surface); }
.secondary-button:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.primary-button:active, .secondary-button:active { transform: scale(.98); }

.account-panel { width: min(860px, calc(100vw - 28px)); max-width: none; max-height: min(88vh, 900px); max-height: min(88dvh, 900px); margin: auto; padding: 0 0 env(safe-area-inset-bottom); overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 22px; color: var(--ink); background: var(--canvas); box-shadow: var(--shadow-pop); }
.account-panel:not([open]) { display: none; }
.account-panel::backdrop { background: rgba(20, 23, 42, .42); backdrop-filter: blur(4px); }
.account-panel[open] { animation: panel-enter .18s ease-out; }
.account-panel-heading { position: sticky; z-index: 2; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 83px; padding: 17px 24px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(16px); }
.account-panel-heading h2 { margin: 6px 0 0; font-size: 22px; letter-spacing: -.045em; }
.close-button { font-size: 23px; }
.account-subpanel { margin: 16px 20px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.subpanel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.subpanel-heading h3 { margin: 5px 0 0; font-size: 16px; letter-spacing: -.025em; }
.muted-copy, .empty-state { color: var(--muted); font-size: 11px; line-height: 1.55; }
.device-list { list-style: none; margin: 12px 0; padding: 0; }
.device-row, .member-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); }
.device-row:first-child, .member-row:first-child { border-top: 0; }
.device-info, .member-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.device-info strong, .member-info strong { font-size: 12px; }
.device-info span, .member-info span { color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.device-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; }
.member-controls { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.small-button { min-height: 44px; flex: 0 0 auto; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-soft); background: var(--surface); font-size: 10px; font-weight: 650; cursor: pointer; }
.small-button:hover { border-color: #c9c4f2; color: var(--accent); background: var(--accent-soft); }
.member-delete-button { color: var(--danger); }
.member-delete-button:hover { border-color: var(--danger); color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, var(--surface)); }
.danger-button { min-height: 44px; padding: 0 14px; border: 1px solid transparent; border-radius: 9px; color: #fff; background: #b8324b; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.danger-button:hover:not(:disabled) { background: #98253b; }
.danger-button:disabled { opacity: .45; cursor: not-allowed; }
.delete-member-dialog { width: min(440px, calc(100vw - 32px)); max-width: none; margin: auto; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow-pop); }
.delete-member-dialog::backdrop { background: rgba(20, 23, 42, .56); backdrop-filter: blur(3px); }
.delete-member-content { padding: 24px; }
.delete-member-content h2 { margin: 5px 0 10px; font-size: 20px; letter-spacing: -.035em; }
.delete-member-content > p:not(.eyebrow) { color: var(--muted-strong); font-size: 12px; line-height: 1.55; }
.delete-member-label { display: block; margin: 15px 0 6px; color: var(--muted-strong); font-size: 11px; font-weight: 680; }
.delete-member-content input { width: 100%; min-height: 46px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--ink); background: var(--surface-soft); font: inherit; font-size: 16px; }
.delete-member-error { margin: 8px 0 0; color: var(--danger) !important; }
.delete-member-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.delete-member-actions .secondary-button { min-height: 44px; }
.drive-device-details { margin: 14px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.drive-device-details[hidden] { display: none; }
.drive-device-details summary { display: flex; align-items: center; gap: 11px; min-height: 48px; padding: 0 13px; color: var(--ink); font-size: 12px; font-weight: 680; cursor: pointer; list-style: none; }
.drive-device-details summary::-webkit-details-marker { display: none; }
.drive-device-details summary::before { content: "+"; display: grid; width: 21px; height: 21px; place-items: center; border-radius: 7px; color: var(--accent); background: var(--accent-soft); font-size: 15px; }
.drive-device-details[open] summary::before { content: "−"; }
.drive-device-count { display: grid; min-width: 27px; height: 24px; margin-left: auto; padding: 0 7px; place-items: center; border-radius: 999px; color: var(--accent); background: var(--accent-soft); font-size: 10px; }
.drive-device-details > .muted-copy { margin: 0; padding: 0 13px 7px; }
.drive-device-details > .device-list { margin: 0; padding: 0 13px 9px; }
.drive-device-details > .empty-state { margin: 0; padding: 3px 13px 13px; }
.tv-remote-panel { margin: 14px 0; padding: 16px; border: 1px solid #dcd9f5; border-radius: 14px; background: linear-gradient(145deg, #f5f3ff, #fff); }
.tv-remote-panel[hidden] { display: none; }
.tv-remote-panel .subpanel-heading { margin-bottom: 7px; }
.tv-remote-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 13px; }
.tv-remote-controls button { min-height: 46px; padding: 8px 9px; font-size: 11px; }
.member-form { display: grid; grid-template-columns: 1fr 1fr 1.3fr auto; align-items: end; gap: 10px; margin: 16px 0; }
.member-form label { display: flex; flex-direction: column; gap: 6px; color: var(--muted-strong); font-size: 10px; font-weight: 650; }
.member-form input { width: 100%; min-width: 0; min-height: 40px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--ink); background: var(--surface); font-size: 12px; }
.member-row select { min-height: 35px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-soft); background: var(--surface); font-size: 10px; }
.admin-panel[hidden] { display: none; }

footer { display: flex; align-items: center; gap: 14px; width: min(1120px, calc(100% - 44px)); min-height: 58px; margin: 0 auto; padding: 12px 0 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
footer span:first-child { color: var(--ink-soft); font-weight: 780; letter-spacing: .1em; }
footer a { display: inline-flex; align-items: center; min-height: 44px; margin-left: auto; color: var(--muted-strong); text-decoration: none; }
footer a:hover { color: var(--accent); }

@keyframes panel-enter { from { opacity: 0; transform: translateY(9px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (prefers-color-scheme: dark) {
  :root { --ink: #f0effa; --ink-soft: #d6d5e6; --muted: #a0a0b2; --muted-strong: #c0bfd0; --line: #36364a; --line-strong: #49495f; --canvas: #141521; --surface: #1c1d2b; --surface-soft: #222334; --accent: #a59cff; --accent-hover: #b7b0ff; --accent-soft: #302d50; --success: #73d2aa; --danger: #ff8d9c; --shadow-soft: 0 16px 44px rgba(0,0,0,.18); --shadow-pop: 0 24px 70px rgba(0,0,0,.5); }
  body { background: radial-gradient(ellipse at 12% 0%, #282448 0, transparent 34rem), var(--canvas); }
  .topbar, .account-panel-heading { border-color: var(--line); background: rgba(28,29,43,.9); }
  .welcome { border-color: #373352; background: linear-gradient(110deg, #1c1d2b 0%, #1c1d2b 55%, #24223b 100%); }
  .welcome::after, .welcome-mark-halo { border-color: rgba(165,156,255,.17); box-shadow: 0 0 0 34px rgba(165,156,255,.025), 0 0 0 70px rgba(165,156,255,.018); }
  .welcome-mark-caption { color: #b2acd9; }
  .brand-mark { background: linear-gradient(145deg, #8e83f5, #5c51ce); }
  .search, .app-card, .device-link-panel, .account-subpanel, .secondary-button, .small-button { border-color: var(--line); background: var(--surface); }
  .app-icon-drive { color: #77d4a4; background: #1c382d; }
  .app-icon-photos { color: #9fb7ff; background: #252f4c; }
  .app-icon-play { color: #c0adff; background: #302844; }
  .app-icon-office { color: #ffc08c; background: #3b2b26; }
  .app-icon-desktop { color: #8ac8eb; background: #203440; }
  .app-icon-mail { color: #9fc7ff; background: #20324a; }
  .privacy-mark { color: #8de0b8; background: #1d3b30; }
  .primary-button { color: #17172a; background: #aaa2ff; }
  .primary-button:hover { background: #beb8ff; }
  .sign-in-top { border-color: #494466; color: #c2bbff; background: var(--surface); }
  .profile-menu, .launcher { background: var(--surface); }
}
@media (max-width: 760px) {
  .topbar { height: 64px; padding: 0 18px; }
  .top-actions { gap: 3px; padding: 0 7px; }
  .home { width: min(100% - 30px, 620px); padding-top: 24px; }
  .welcome { grid-template-columns: minmax(0,1fr) 110px; min-height: 155px; padding: 25px 21px; border-radius: 21px; }
  .welcome-mark { min-height: 100px; }
  .welcome-mark-halo { width: 88px; height: 88px; box-shadow: 0 0 0 13px rgba(85,75,211,.045), 0 0 0 28px rgba(85,75,211,.025); }
  .welcome-mark-icon { width: 45px; height: 45px; border-radius: 15px; }
  .welcome-mark-icon svg { width: 30px; height: 30px; }
  .welcome-mark-caption { font-size: 6px; }
  .welcome h1 { font-size: clamp(27px, 6vw, 36px); }
  .intro { font-size: 12px; }
  .search-section { margin-top: 20px; }
  .search { min-height: 54px; gap: 8px; padding-left: 14px; border-radius: 15px; }
  .search input { height: 48px; font-size: 14px; }
  .search-provider { padding: 6px 7px; font-size: 9px; }
  .search-submit { width: 35px; height: 35px; }
  .apps-section, .tools-section { margin-top: 34px; }
  .app-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .app-card { min-height: 162px; padding: 14px; }
  .app-card-copy { margin-top: 12px; }
  .app-card-copy strong { font-size: 13px; }
  .app-description { font-size: 10px; }
  .tools-grid { grid-template-columns: 1fr; gap: 8px; }
  .app-card-compact { min-height: 70px; }
  .account-panel { width: calc(100vw - 16px); max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); border-radius: 17px; }
  .account-panel-heading { min-height: 72px; padding: 13px 16px; }
  .account-panel-heading h2 { font-size: 19px; }
  .account-subpanel { margin: 11px; padding: 14px; }
  .device-row, .member-row { align-items: flex-start; }
  .device-actions { flex-wrap: wrap; justify-content: flex-end; }
  .member-form { grid-template-columns: 1fr 1fr; }
  .member-form button { grid-column: 1 / -1; }
  footer { width: min(100% - 30px, 620px); }
}
@media (max-width: 440px) {
  .wordmark { gap: 8px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 11px; }
  .brand-copy strong { font-size: 14px; }
  .brand-copy small { font-size: 7px; }
  .sign-in-top { min-height: 44px; padding: 0 10px; font-size: 10px; }
  .welcome { grid-template-columns: minmax(0,1fr) 64px; min-height: 143px; padding: 21px 16px; }
  .welcome-mark { min-height: 82px; }
  .welcome-mark-halo { width: 61px; height: 61px; box-shadow: 0 0 0 9px rgba(85,75,211,.04), 0 0 0 19px rgba(85,75,211,.02); }
  .welcome-mark-icon { width: 39px; height: 39px; border-radius: 13px; }
  .welcome-mark-icon svg { width: 26px; }
  .welcome-mark-caption { display: none; }
  .welcome h1 { margin-top: 9px; font-size: 26px; }
  .welcome .eyebrow { font-size: 7px; letter-spacing: .12em; }
  .search-provider { display: none; }
  .section-title h2 { font-size: 20px; }
  .section-title { align-items: center; }
  .app-card { min-height: 157px; padding: 12px; }
  .app-card-top .app-icon { width: 38px; height: 38px; }
  .app-card-footer { padding-top: 10px; }
  .app-status { font-size: 9px; }
  .account-panel-heading .eyebrow { font-size: 8px; }
  .member-form { grid-template-columns: 1fr; }
  .member-form button { grid-column: auto; }
  footer { gap: 9px; font-size: 9px; }
}
@media (max-width: 600px) {
  .topbar { padding-right: max(12px, env(safe-area-inset-right)); padding-left: max(12px, env(safe-area-inset-left)); background: var(--surface); backdrop-filter: none; }
  .top-actions { gap: 0; padding-inline: 3px; }
  .search input { font-size: 16px; }
  .search-submit { width: 44px; height: 44px; }
  .launcher-grid .app-card-compact { min-height: 80px; padding: 10px; }
  .account-panel { width: calc(100vw - 16px); max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
  .member-form { grid-template-columns: minmax(0, 1fr); }
  .member-form button { grid-column: auto; }
  .member-form input { min-height: 44px; font-size: 16px; }
  .member-row select { min-height: 44px; font-size: 16px; }
  .device-row, .member-row { align-items: stretch; }
  .member-controls { justify-content: flex-start; }
  .device-row .small-button, .member-row button, .member-row select { min-height: 44px; }
  .tv-remote-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .delete-member-content { padding: 20px; }
  .popover { top: calc(100% + 4px); right: max(8px, env(safe-area-inset-right)); }
}
@media (max-width: 390px) {
  .sign-in-top { width: 68px; padding: 0 6px; font-size: 0; }
  .sign-in-top::after { content: "Sign in"; font-size: 11px; }
}
@media (max-width: 360px) {
  .brand-copy small { display: none; }
  .wordmark { gap: 7px; }
  .sign-in-top { width: 68px; padding: 0 6px; font-size: 0; }
  .sign-in-top::after { content: "Sign in"; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
