/* RO Flashcards theme: one shared panel rhythm, desktop and mobile. */
:root{--ro-panel-gap:16px;--ro-panel-inset-x:16px;--ro-panel-inset-y:28px}
/* A single leading margin is the fallback for nested block panels. */
html body :is(.panel,.deck,.flash,.arena-panel,.weekly-card,.achievement-panel,.lounge-topic-group,.profile-public-name,.ro-learning-card,.push-profile,.layout-card){margin-top:var(--ro-panel-gap)!important;margin-bottom:0!important;box-sizing:border-box}
html body :is(.panel,.arena-panel,.weekly-card,.achievement-panel,.profile-public-name,.ro-learning-card,.push-profile){padding-left:var(--ro-panel-inset-x)!important;padding-right:var(--ro-panel-inset-x)!important;padding-top:var(--ro-panel-inset-y)!important;padding-bottom:var(--ro-panel-inset-y)!important}
/* Explicit stacks eliminate collapsing and doubled margins. */
html body :is(.screen.active,.arena-wrap,.weekly-wrap,main.lounge-profile>.auth,#arenaLobby,#courseDeckList,#savedFullList,#savedCardsFullList,#deckList,.ro-panel-stack){display:flex;flex-direction:column;gap:var(--ro-panel-gap)!important}
html body :is(.screen.active,.arena-wrap,.weekly-wrap,main.lounge-profile>.auth,#arenaLobby,#courseDeckList,#savedFullList,#savedCardsFullList,#deckList,.ro-panel-stack)>*{margin-top:0!important;margin-bottom:0!important;min-width:0}
html body :is(.screen.active,.arena-wrap,.weekly-wrap,main.lounge-profile>.auth,#arenaLobby,#courseDeckList,#savedFullList,#savedCardsFullList,#deckList,.ro-panel-stack)>:is(script,style,link,[hidden]){display:none!important}
html body :is(.arena-wrap,.weekly-wrap)>p:empty{display:none!important}
/* The page header uses the same 16px border-to-border gap. */
html body>header.top{margin-bottom:0!important}
html body>main{margin-top:var(--ro-panel-gap)!important}
html body main.lounge-profile{margin-top:var(--ro-panel-gap)!important}
html body>main:not(.auth){padding-top:0!important}
html body>.app>.screen.active{margin-top:var(--ro-panel-gap)!important}
html body main.lounge-profile>.auth{padding-top:0!important;padding-bottom:0!important;border:0!important;margin:0!important}
html body>.app>.lounge-header{margin-bottom:0!important}
/* Preserve horizontal grid layouts with the same space between panel cards. */
html body :is(.layout-grid,.arena-players,.row):has(>:is(.panel,.deck,.layout-card,.arena-panel)){gap:var(--ro-panel-gap)!important}
html body :is(.layout-grid,.arena-players,.row)>:is(.panel,.deck,.layout-card,.arena-panel){margin-top:0!important;margin-bottom:0!important}
/* Topics uses an unframed wrapper; the banner and topic groups own spacing. */
html body #spanishCourseScreen>.lounge-topics-panel{padding:0!important;margin:0!important;display:flex;flex-direction:column;gap:var(--ro-panel-gap)!important}
html body #spanishCourseScreen .lounge-topics-panel>.lounge-spanish-banner{margin:0!important}
html body #courseDeckList{padding-top:0!important;padding-bottom:0!important;margin:0!important}
/* Compact progress bars and centered flashcards keep their functional inset. */
html body :is(#studyScreen,#autoStudyScreen)>.panel:first-child{margin:0!important;padding:18px var(--ro-panel-inset-x)!important}
html body [hidden]{display:none!important}
html body main.arena-wrap{padding:var(--ro-panel-gap)!important}
html body #home [data-ro-install-panel]{margin-top:0!important;margin-bottom:0!important;padding-top:var(--ro-panel-inset-y)!important;padding-bottom:var(--ro-panel-inset-y)!important}

/* Consistent page and panel widths across RO Flashcards. */
:root{--ro-page-width:512px;--ro-shell-width:540px}
html body .app,html body main.lounge-profile{box-sizing:border-box!important;width:100%!important;max-width:var(--ro-shell-width)!important;margin-left:auto!important;margin-right:auto!important;padding-left:14px!important;padding-right:14px!important}
html body header.ro-centered-header,html body header.top,html body header.lounge-header,html body.ro-welcome-page header.ro-welcome-header{box-sizing:border-box!important;width:calc(100% - 28px)!important;max-width:var(--ro-page-width)!important;margin-left:auto!important;margin-right:auto!important}
html body .app>header{width:100%!important}
html body main.arena-wrap,html body main.weekly-wrap{box-sizing:border-box!important;width:calc(100% - 28px)!important;max-width:var(--ro-page-width)!important;margin-left:auto!important;margin-right:auto!important;padding:0!important;border:0!important;background:none!important;box-shadow:none!important}
html body main.arena-wrap :is(.arena-panel,.arena-promo),html body main.weekly-wrap>.weekly-card{box-sizing:border-box!important;width:100%!important;max-width:100%!important}
html body.ro-welcome-page .welcome{box-sizing:border-box!important;width:100%!important;max-width:var(--ro-shell-width)!important;margin-left:auto!important;margin-right:auto!important;padding-left:14px!important;padding-right:14px!important;display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:24px!important}
html body.ro-welcome-page .welcome>:is(.hero,.auth){box-sizing:border-box!important;width:100%!important;min-width:0!important;max-width:var(--ro-page-width)!important}
html body.ro-welcome-page .welcome-games{box-sizing:border-box!important;width:calc(100% - 28px)!important;max-width:var(--ro-page-width)!important;margin-left:auto!important;margin-right:auto!important}
html body :is(.arena-board-table-wrap,.arena-personal-ranking){min-width:0;max-width:100%;overflow-x:auto}
html body>main:not(.arena-wrap):not(.weekly-wrap){box-sizing:border-box!important;width:100%!important;max-width:var(--ro-shell-width)!important;padding-left:14px!important;padding-right:14px!important;margin-left:auto!important;margin-right:auto!important}
html body main.lounge-profile>.auth{box-sizing:border-box!important;width:100%!important;max-width:100%!important;padding-left:0!important;padding-right:0!important}
