/* Embedded admin app: only the inner app chrome disappears. Window title,
   minimize/maximize/close, and content/dialog headers are never targeted. */
.pc-embedded-admin-app > :is(div,main,section) > header:first-child:not(:is(.aml-header,.memo-pad-bar,.an-header,.rts-bar,.rssapp-header,.design-docs-header,.livekit-meet-toolbar)),
.pc-embedded-admin-app :is(.mobile-app-header,.work-log-header,.nad-top,.tmp-ktx-seat-header,.ai-crew-title) {
  display:none!important;
}

/* Keep essential app actions reachable as small controls IN the content,
   not as a second full-width header bar. */
.pc-embedded-admin-app .aml-app,
.pc-embedded-admin-app .memo-pad-app,
.pc-embedded-admin-app .an-app,
.pc-embedded-admin-app .rts-app,
.pc-embedded-admin-app .rssapp,
.pc-embedded-admin-app .design-docs-shell,
.pc-embedded-admin-app .work-log-app,
.pc-embedded-admin-app .nad-page,
.pc-embedded-admin-app .livekit-meet-app { position:relative; }

/* Library detail back: no app header strip, just a compact back action. */
.pc-embedded-admin-app .aml-header {
  display:block!important;position:relative;z-index:9;height:0!important;min-height:0!important;
  flex:0 0 0!important;padding:0!important;border:0!important;background:transparent!important;
  overflow:visible!important;
}
.pc-embedded-admin-app .aml-header-inner {display:block!important;height:0!important;padding:0!important;overflow:visible!important;}
.pc-embedded-admin-app .aml-header-inner>* {display:none!important;}
.pc-embedded-admin-app .aml-header-inner>button[aria-label="이전 화면"] {
  display:inline-grid!important;position:absolute!important;top:6px;left:6px;
  width:31px;height:31px;min-height:31px;z-index:10;
  background:#fff;border:1px solid #e8ebf1;border-radius:9px;
}
.pc-embedded-admin-app .aml-scroll-detail .aml-detail-hero {padding-left:42px;}

/* Memo: no top bar. Keep new-note and detail/back actions as corner icons. */
.pc-embedded-admin-app .memo-pad-bar {
  display:block!important;position:relative;z-index:9;height:0!important;min-height:0!important;
  flex:0 0 0!important;padding:0!important;border:0!important;background:transparent!important;overflow:visible!important;
}
.pc-embedded-admin-app .memo-bar-heading {display:none!important;}
.pc-embedded-admin-app .memo-pad-bar .memo-back-link {
  position:absolute!important;left:7px;top:6px;min-height:30px;padding:0 6px;
  background:#fff;border-radius:8px;
}
.pc-embedded-admin-app .memo-pad-bar .memo-bar-actions {
  position:absolute!important;right:7px;top:5px;margin:0;z-index:10;
}
.pc-embedded-admin-app .memo-pad-app:has(.memo-list-scroll) .memo-back-link {display:none!important;}
.pc-embedded-admin-app .memo-pad-app:has(.memo-list-scroll) .memo-page-heading {padding-right:42px;}
.pc-embedded-admin-app .memo-detail-scroll .memo-editor {padding-top:44px;}

/* Notifications: navigation and compose actions live in a bottom floating dock. */
.pc-embedded-admin-app .an-header {
  display:flex!important;position:absolute!important;bottom:9px;right:9px;top:auto;left:auto;
  width:max-content;max-width:calc(100% - 18px);height:auto!important;min-height:0!important;
  flex:0 0 auto!important;padding:4px 6px!important;gap:4px!important;
  background:rgba(255,255,255,.96)!important;border:1px solid #e5e9f0!important;border-radius:12px;
  box-shadow:0 3px 14px #1726371b;z-index:12;
}
.pc-embedded-admin-app .an-header-title {display:none!important;}
.pc-embedded-admin-app .an-header .an-navigation {min-width:0;flex-wrap:wrap;}
.pc-embedded-admin-app .an-header .an-navigation button {font-size:11px;min-height:30px;}
.pc-embedded-admin-app .an-list,
.pc-embedded-admin-app .an-detail,
.pc-embedded-admin-app .an-compose {padding-bottom:62px!important;}

/* Report templates: save/validate buttons remain as a bottom content action. */
.pc-embedded-admin-app .rts-bar {
  display:flex!important;position:absolute!important;bottom:9px;right:9px;top:auto;left:auto;
  width:max-content;min-width:0;min-height:0!important;height:auto!important;flex:0 0 auto!important;
  padding:0!important;background:transparent!important;border:0!important;z-index:12;
}
.pc-embedded-admin-app .rts-bar>:not(.rts-actions) {display:none!important;}
.pc-embedded-admin-app .rts-bar .rts-actions {margin:0!important;}
.pc-embedded-admin-app .rts-bar .rts-actions>button {
  background:#fff;box-shadow:0 2px 10px #1726371c;border:1px solid #e7eaf1;
}

/* RSS, agent directory and work log: no title band; retain refresh/back. */
.pc-embedded-admin-app .rssapp-header {
  display:flex!important;position:absolute!important;bottom:9px;right:9px;top:auto;left:auto;
  z-index:12;width:auto;height:auto!important;min-height:0!important;padding:0!important;
  background:transparent!important;border:0!important;
}
.pc-embedded-admin-app .rssapp-header>.rssapp-icon,
.pc-embedded-admin-app .rssapp-header>.rssapp-brand {display:none!important;}
.pc-embedded-admin-app .rssapp-header .rssapp-icon {width:34px;min-width:34px;height:34px;min-height:34px;background:#fff;}
.pc-embedded-admin-app .rssapp-header-actions{padding:0;}
.pc-embedded-admin-app .nad-top {
  display:flex!important;position:absolute!important;bottom:9px;right:9px;top:auto;left:auto;
  z-index:12;width:auto;min-height:0!important;padding:0!important;background:transparent!important;border:0!important;
}
.pc-embedded-admin-app .nad-top>div{display:none!important;}
.pc-embedded-admin-app .nad-top>button {background:#fff;border:1px solid #e5e9f0;border-radius:9px;box-shadow:0 2px 10px #1726371c;}
.pc-embedded-admin-app .work-log-header {
  display:block!important;position:absolute!important;bottom:9px;left:9px;right:9px;top:auto;
  z-index:12;width:auto;min-height:0!important;height:auto!important;padding:0!important;
  border:0!important;background:transparent!important;pointer-events:none;
}
.pc-embedded-admin-app .work-log-header .mantine-Title-root{display:none!important;}
.pc-embedded-admin-app .work-log-header button{pointer-events:auto;background:#fff;border:1px solid #e5e9f0;border-radius:9px;box-shadow:0 2px 10px #1726371c;}

/* Design Docs back and LiveKit copy remain reachable without their bars. */
.pc-embedded-admin-app .design-docs-header {
  display:flex!important;position:absolute!important;bottom:9px;left:9px;top:auto;right:auto;
  width:auto;height:auto!important;min-height:0!important;padding:0!important;
  background:transparent!important;border:0!important;z-index:12;
}
.pc-embedded-admin-app .design-docs-header__location,
.pc-embedded-admin-app .design-docs-header__meta {display:none!important;}
.pc-embedded-admin-app .design-docs-header__main {display:flex!important;width:auto;}
.pc-embedded-admin-app .design-docs-header__nav {width:35px;height:35px;background:#fff;border:1px solid #e5e9f0;border-radius:9px;box-shadow:0 2px 10px #1726371c;}
.pc-embedded-admin-app .livekit-meet-toolbar {
  display:flex!important;position:absolute!important;bottom:9px;right:9px;top:auto;left:auto;
  z-index:12;width:auto;height:auto!important;min-height:0!important;padding:0!important;
  border:0!important;background:transparent!important;
}
.pc-embedded-admin-app .livekit-meet-toolbar>:first-child,
.pc-embedded-admin-app .livekit-meet-toolbar>strong {display:none!important;}
.pc-embedded-admin-app .livekit-meet-toolbar>button:last-child {background:#fff;border:1px solid #e5e9f0;border-radius:9px;padding:6px 9px;}

/* No extra header for test or home-style embedded apps. */
.pc-embedded-admin-app .test-app-header,
.pc-embedded-admin-app .tmp-ktx-seat-header,
.pc-embedded-admin-app .mobile-app-header {display:none!important;}

/* Library list only: compact typography and row rhythm.
   Detail/document typography intentionally unchanged. */
.aml-app .aml-item {min-height:68px;padding:8px 6px;gap:10px;}
.aml-app .aml-item-icon {height:34px;width:34px;border-radius:9px;}
.aml-app .aml-item-icon svg {width:19px;height:19px;}
.aml-app .aml-item-body {gap:2px;}
.aml-app .aml-item-line {gap:5px;}
.aml-app .aml-item-line strong {font-size:14px;line-height:1.32;}
.aml-app .aml-item-meta {font-size:11px;line-height:1.4;gap:5px;}
.aml-app .aml-status {font-size:9px;padding:1px 5px;}
.aml-app .aml-item-chevron {width:17px;height:17px;}
.aml-app .aml-list-child .aml-item-icon {width:30px;height:30px;}
@media(max-width:700px) {
  .aml-app .aml-item {min-height:64px;padding:8px 4px;gap:8px;}
  .aml-app .aml-item-icon {height:32px;width:32px;}
  .aml-app .aml-item-line strong {font-size:13px;line-height:1.35;}
  .aml-app .aml-item-meta {font-size:10px;gap:4px;}
  .aml-app .aml-status {font-size:9px;}
}

/* Additional app-level title rows: retain actions, remove duplicated chrome. */
.pc-embedded-admin-app .ai-crew-title {
  display:flex!important;justify-content:flex-end!important;align-items:center!important;
  margin:0!important;padding:4px 6px!important;gap:4px!important;
  background:transparent!important;border:0!important;
}
.pc-embedded-admin-app .ai-crew-title>.mantine-Box-root:first-child {display:none!important;}
.pc-embedded-admin-app.app-rule-registry > .mantine-Box-root > .mantine-Stack-root > .mantine-Paper-root:first-child {display:none!important;}
.pc-embedded-admin-app.app-pushward-manager > .mantine-Box-root > .mantine-Group-root:first-child {display:none!important;}
.pc-embedded-admin-app.app-server-incident > div > .mantine-Stack-root > .mantine-Group-root:first-child .mantine-Title-root {display:none!important;}

/* Library scroll ownership: list uses .aml-scroll, detail uses .aml-detail-panel,
   maximized reader uses .aml-max-content. Only that one active region scrolls.
   Each scroll track remains flush against the rightmost app/window edge. */
.aml-app .aml-scroll:not(.aml-scroll-detail),
.aml-app .aml-detail-panel,
.aml-app.aml-max-overlay .aml-max-content {
  width:100%;
  max-width:100%;
  margin-right:0;
  overflow-x:hidden;
  overflow-y:auto;
  scrollbar-gutter:auto;
  scrollbar-width:thin;
  scrollbar-color:rgba(116,131,158,.44) transparent;
}
.aml-app .aml-scroll:not(.aml-scroll-detail)::-webkit-scrollbar,
.aml-app .aml-detail-panel::-webkit-scrollbar,
.aml-app.aml-max-overlay .aml-max-content::-webkit-scrollbar {width:3px;}
.aml-app .aml-scroll:not(.aml-scroll-detail)::-webkit-scrollbar-thumb,
.aml-app .aml-detail-panel::-webkit-scrollbar-thumb,
.aml-app.aml-max-overlay .aml-max-content::-webkit-scrollbar-thumb {
  background:rgba(116,131,158,.44);border-radius:99px;
}
.aml-app .aml-scroll:not(.aml-scroll-detail)::-webkit-scrollbar-track,
.aml-app .aml-detail-panel::-webkit-scrollbar-track,
.aml-app.aml-max-overlay .aml-max-content::-webkit-scrollbar-track {background:transparent;}
/* The detail wrapper itself never owns a second scroll. */
.aml-app .aml-scroll.aml-scroll-detail {overflow:hidden!important;}

/* Library HTML only: let the sandboxed document expand to its measured height.
   The library reader owns vertical scrolling, with its thumb at the viewport edge.
   Other previews (PDF, video, external cross-origin HTML) keep their own contracts. */
.aml-app .aml-html-preview[data-aml-html-auto-height="true"],
.aml-app .aml-html-preview[data-aml-html-auto-height="true"] > section,
.aml-app .aml-html-preview[data-aml-html-auto-height="true"] > section > div {
  display:block!important;
  height:auto!important;
  min-height:0!important;
  flex:0 0 auto!important;
  overflow:visible!important;
}
.aml-app .aml-html-preview[data-aml-html-auto-height="true"] iframe {
  display:block!important;
  flex:none!important;
  min-height:0!important;
  width:100%!important;
  overflow:hidden!important;
}
/* The scroll container spans the full application width, not an inset column. */
.aml-app .aml-detail-panel,
.aml-app.aml-max-overlay .aml-max-content {padding-right:0!important}
.aml-app .aml-detail-panel > .aml-detail-content,
.aml-app.aml-max-overlay .aml-max-content > .aml-detail-content {padding-right:11px}

/* Inline HTML in library: expand its sandboxed preview to document height.
   The outer .aml-detail-panel/.aml-max-content owns the only vertical scrollbar. */
.aml-app .aml-html-preview:has(iframe[srcdoc]),
.aml-app .aml-html-preview:has(iframe[srcdoc])>section,
.aml-app .aml-html-preview:has(iframe[srcdoc])>section>div {
  display:block!important;
  flex:none!important;
  height:auto!important;
  min-height:0!important;
  overflow:visible!important;
}
.aml-app .aml-html-preview iframe[srcdoc] {
  display:block!important;
  flex:none!important;
  min-height:0!important;
  max-height:none!important;
  height:var(--aml-html-frame-height, 640px)!important;
  overflow:hidden!important;
}
