/* ARK_UI_SYNC_V57: scoped, theme-aware; no auth or application state changes. */
html[data-ark-ui-sync-v57] {
  --ark57-accent: var(--accent, #e11d2e);
  --ark57-font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ark57-control: 40px;
  --ark57-radius: 10px;
  --ark57-scroll: 5px;
  --ark57-toast-width: 390px;
}
/* Keep existing semantic colours and code/editor font stacks. */
html[data-ark-ui-sync-v57] body {font-family:var(--ark57-font)}
html[data-ark-ui-sync-v57] :is(button,select,input,textarea) {font-family:inherit}
html[data-ark-ui-sync-v57] :is(.CodeMirror,.monaco-editor,.cm-editor,.ace_editor,pre,code,kbd,samp) {font-family:var(--mono,Consolas,"Cascadia Code",monospace)}
html[data-ark-ui-sync-v57] :is(.CodeMirror,.monaco-editor,.cm-editor,.ace_editor) :is(textarea,input) {font-family:inherit}
html[data-ark-ui-sync-v57] :is(button,a,input,select,textarea,[role="button"],[role="tab"]):focus-visible {outline:2px solid var(--ark57-accent);outline-offset:2px}
html[data-ark-ui-sync-v57] [data-ark57-hide-top="1"] {display:none!important}
/* Only known common navigation and tools. No sizing of editor actions or file tree. */
html[data-ark-ui-sync-v57] body header.top :is(#theme,#arkFileToolsOpen) {
  box-sizing:border-box!important; min-height:var(--ark57-control)!important;
  height:var(--ark57-control)!important; max-height:var(--ark57-control)!important;
  border-radius:var(--ark57-radius)!important; align-items:center!important;
  justify-content:center!important; flex-shrink:0!important;
}
html[data-ark-ui-sync-v57] body header.top #theme {width:var(--ark57-control)!important;min-width:var(--ark57-control)!important;padding:0!important}
html[data-ark-ui-sync-v57] body header.top #arkFileToolsOpen svg {width:18px!important;height:18px!important;flex:none!important}
html[data-ark-ui-sync-v57] :is(#tabs,#modesBox,#arkUsTabs) > :is(button,a) {
  border-radius:var(--ark57-radius)!important; font-family:var(--ark57-font)!important;
  line-height:1.35; align-items:center; gap:6px;
}
html[data-ark-ui-sync-v57] :is(#tabs,#modesBox,#arkUsTabs) > :is(button,a) svg {width:15px;height:15px;flex:none}
html[data-ark-ui-sync-v57] #arkUsTabs button[aria-selected="true"] {background:var(--ark57-accent)!important;color:var(--on-accent,#fff)!important}
/* Thin red scrollbars. Native Firefox; pseudo elements in Chromium/WebView. */
html[data-ark-ui-sync-v57],html[data-ark-ui-sync-v57] body,html[data-ark-ui-sync-v57] body * {
  scrollbar-width:thin!important;scrollbar-color:var(--ark57-accent) transparent!important;
}
@supports selector(::-webkit-scrollbar) {
  html[data-ark-ui-sync-v57],html[data-ark-ui-sync-v57] body,html[data-ark-ui-sync-v57] body * {scrollbar-width:auto!important;scrollbar-color:auto!important}
  html[data-ark-ui-sync-v57]::-webkit-scrollbar,html[data-ark-ui-sync-v57] body::-webkit-scrollbar,html[data-ark-ui-sync-v57] body *::-webkit-scrollbar {width:var(--ark57-scroll)!important;height:var(--ark57-scroll)!important;background:transparent!important}
  html[data-ark-ui-sync-v57]::-webkit-scrollbar-thumb,html[data-ark-ui-sync-v57] body::-webkit-scrollbar-thumb,html[data-ark-ui-sync-v57] body *::-webkit-scrollbar-thumb {background:var(--ark57-accent)!important;border:0!important;border-radius:99px!important;box-shadow:none!important}
  html[data-ark-ui-sync-v57]::-webkit-scrollbar-track,html[data-ark-ui-sync-v57] body::-webkit-scrollbar-track,html[data-ark-ui-sync-v57] body *::-webkit-scrollbar-track,html[data-ark-ui-sync-v57] body *::-webkit-scrollbar-corner {background:transparent!important;border:0!important}
  html[data-ark-ui-sync-v57]::-webkit-scrollbar-button,html[data-ark-ui-sync-v57] body::-webkit-scrollbar-button,html[data-ark-ui-sync-v57] body *::-webkit-scrollbar-button {display:none!important;width:0!important;height:0!important}
}
/* Preserve existing toast callbacks, timers and success/error/running colours. */
html[data-ark-ui-sync-v57] :is(#toasts,#arkHostToasts) {right:max(12px,env(safe-area-inset-right))!important;bottom:max(12px,env(safe-area-inset-bottom))!important;width:min(var(--ark57-toast-width),calc(100vw - 24px))!important;max-width:calc(100vw - 24px)!important}
html[data-ark-ui-sync-v57] :is(#toasts .toast,#arkHostToasts .ark-host-toast) {box-sizing:border-box!important;max-width:100%!important;font-family:var(--ark57-font)!important;border-radius:12px!important}
html[data-ark-ui-sync-v57] :is(#toasts .toast .tm,#arkHostToasts .ark-host-toast p) {overflow-wrap:anywhere!important;min-width:0}
/* Admin iframe only: remove body bottom padding and fill exactly to viewport. */
html[data-ark-ui-sync-v57][data-ark57-suite="1"] body {padding-bottom:0!important;margin-bottom:0!important}
html[data-ark-ui-sync-v57][data-ark57-suite="1"] #app {margin-bottom:0!important;padding-bottom:0!important;min-height:0!important}
html[data-ark-ui-sync-v57][data-ark57-suite="1"] #v-user-suite:not([hidden]) {
  display:flex!important;flex-direction:column!important;align-items:stretch!important;
  box-sizing:border-box!important;width:100%!important;max-width:none!important;
  min-width:0!important;min-height:0!important;max-height:none!important;
  height:var(--ark57-suite-height,75vh)!important;margin:0!important;padding:0!important;
  gap:0!important;overflow:hidden!important;
}
html[data-ark-ui-sync-v57][data-ark57-suite="1"] #v-user-suite .ark-us-title {flex:0 0 auto!important;margin:0 0 8px!important}
html[data-ark-ui-sync-v57][data-ark57-suite="1"] #v-user-suite #arkUsTabs {flex:0 0 auto!important;display:flex!important;flex-wrap:wrap!important;gap:6px!important;margin:0 0 8px!important}
html[data-ark-ui-sync-v57][data-ark57-suite="1"] #v-user-suite .ark-us-box {flex:1 1 0!important;display:flex!important;flex-direction:column!important;min-height:0!important;max-height:none!important;height:auto!important;width:100%!important;max-width:none!important;margin:0!important;padding:0!important;box-sizing:border-box!important;overflow:hidden!important}
html[data-ark-ui-sync-v57][data-ark57-suite="1"] #v-user-suite #arkUsFrame:not([hidden]) {display:block!important;flex:1 1 0!important;box-sizing:border-box!important;height:100%!important;min-height:0!important;max-height:none!important;width:100%!important;max-width:none!important;border:0!important;margin:0!important;padding:0!important;background:var(--bg,#101010)!important}
html[data-ark-ui-sync-v57] #v-user-suite #arkUsFrame[hidden],html[data-ark-ui-sync-v57] #v-user-suite #arkUsRunner[hidden] {display:none!important}
/* Embedded index. Match root to iframe, not the outer page viewport. */
html[data-ark-ui-sync-v57][data-ark57-embedded="suite"],html[data-ark-ui-sync-v57][data-ark57-embedded="suite"] body {
  box-sizing:border-box!important; width:100%!important;max-width:100%!important;min-width:0!important;
  height:100%!important;min-height:0!important;max-height:none!important;margin:0!important;padding:0!important;overflow:hidden!important;
}
html[data-ark-ui-sync-v57][data-ark57-embedded="suite"] body > header.top {display:none!important}
html[data-ark-ui-sync-v57][data-ark57-embedded="suite"] body #shell:not([hidden]) {
  box-sizing:border-box!important;width:100%!important;max-width:100%!important;min-width:0!important;
  height:100%!important;min-height:0!important;max-height:none!important;margin:0!important;
  padding-bottom:0!important;overflow:hidden!important;
}
html[data-ark-ui-sync-v57][data-ark57-embedded="suite"] body #shell > :is(.side,#workspace) {box-sizing:border-box!important;min-width:0!important;min-height:0!important;max-height:100%!important;overflow:auto!important;overscroll-behavior:contain}
@media(min-width:901px){
  html[data-ark-ui-sync-v57][data-ark57-embedded="suite"] body #shell:not([hidden]){display:flex!important;align-items:stretch!important}
  html[data-ark-ui-sync-v57][data-ark57-embedded="suite"] body #shell>.side{flex:0 0 clamp(300px,24vw,440px)!important;width:clamp(300px,24vw,440px)!important;height:100%!important}
  html[data-ark-ui-sync-v57][data-ark57-embedded="suite"] body #shell>#workspace{flex:1 1 0!important;width:auto!important;height:100%!important}
}
@media(max-width:900px){
  html[data-ark-ui-sync-v57][data-ark57-embedded="suite"] body #shell:not([hidden]){display:flex!important;flex-direction:column!important;overflow-y:auto!important;overflow-x:hidden!important}
  html[data-ark-ui-sync-v57][data-ark57-embedded="suite"] body #shell > :is(.side,#workspace){flex:0 0 auto!important;width:100%!important;height:auto!important;max-height:none!important;overflow:visible!important}
  html[data-ark-ui-sync-v57][data-ark57-embedded="suite"] body #shell>#workspace{min-height:360px!important}
  html[data-ark-ui-sync-v57] #arkUsTabs {max-width:100%;flex-wrap:wrap}
}
@media(prefers-reduced-motion:reduce){html[data-ark-ui-sync-v57] :is(#tabs,#modesBox,#arkUsTabs) > :is(button,a){transition:none!important}}
