/* FORGE OS adapter for @forge/workspace-ui 1.2.0. Shared rules opt into Unified. */
.workspace-appearance { position: relative; font: 13px/1.4 Inter, system-ui, sans-serif; }
.shell > main > header:has(.workspace-appearance) { height:auto; gap:12px; flex-wrap:wrap; }
.shell > main > header .header-actions:has(.workspace-appearance) { flex-wrap:wrap; justify-content:flex-end; gap:8px; }
.workspace-appearance > summary { list-style: none; cursor: pointer; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--card, #fff); color: var(--ink); }
.workspace-appearance > summary::-webkit-details-marker { display:none; }
.workspace-appearance-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 80; display: grid; gap: 14px; width: 288px; max-width: calc(100vw - 28px); padding: 18px; border: 1px solid #dce3e8; border-radius: 8px; background: #fff; color: #223444; box-shadow: 0 12px 36px #092b401f; }
.workspace-appearance-menu h2 { margin: 0; font: 600 16px/1.3 Inter, system-ui, sans-serif; }
.shell > main > header .workspace-appearance label { display: grid !important; gap: 6px; color:#61707c; font-size:12px; }
.shell > main > header .workspace-appearance select { width:100%; min-width:0; min-height:38px; padding:8px; border:1px solid #dce3e8; border-radius:5px; background:#fff; color:#223444; font:13px var(--fg-font,system-ui); }
.workspace-appearance-menu p { margin:0; font-size:12px; line-height:1.5; color:#61707c; }
.workspace-appearance-menu button { min-height:38px; padding:8px 12px; border:1px solid #dce3e8; border-radius:5px; background:#fff; color:#223444; cursor:pointer; }
.workspace-appearance-menu [role="status"]:empty { display:none; }
.workspace-appearance :is(summary,button,select):focus-visible { outline:2px solid var(--forge-button,#0b4d73); outline-offset:3px; }
.forge-admin-navigation { display:none; }
.forge-admin-wrap { display:contents; }

html[data-workspace-layout="unified"] body:has(.shell) { background:var(--fg-canvas); color:var(--fg-ink); font:14px/1.5 var(--fg-font); }
html[data-workspace-layout="unified"] .shell { --ink:var(--fg-ink); --muted:var(--fg-muted); --line:var(--fg-line); --paper:var(--fg-canvas); --card:var(--fg-surface); }
html[data-workspace-layout="unified"] .rail { padding:24px 14px 16px; background:var(--fg-nav-background,var(--fg-nav)); color:var(--fg-nav-text); }
html[data-workspace-layout="unified"] .rail .official-wordmark { padding:0 5px 18px; margin-bottom:10px; border-bottom:1px solid color-mix(in srgb,var(--fg-nav-text) 16%,transparent); }
html[data-workspace-layout="unified"] .rail nav { gap:2px; }
html[data-workspace-layout="unified"] .rail nav a { gap:10px; min-height:40px; padding:8px 10px; color:var(--fg-nav-text); border-radius:var(--fg-radius); font-size:13px; font-weight:400; }
html[data-workspace-layout="unified"] .rail nav a:is(.active,:hover) { background:var(--fg-nav-active); color:var(--fg-nav-text); }
html[data-workspace-layout="unified"] .rail nav a.active { box-shadow:inset 3px 0 var(--fg-nav-highlight); font-weight:600; }
html[data-workspace-layout="unified"] .rail nav .nav-section-label { margin:14px 10px 5px; padding:0; color:var(--fg-nav-muted); font-size:10px; font-weight:500; letter-spacing:.12em; border:0; }
html[data-workspace-layout="unified"] .rail :is(.rail-profile,.rail-identity-link,.rail-profile-action) { color:var(--fg-nav-text); }
html[data-workspace-layout="unified"] .rail :is(.local-note,.local-note small,.rail-profile-identity small,.forge-platform-attribution) { color:var(--fg-nav-muted); }
html[data-workspace-layout="unified"] .rail .rail-profile:is(:hover,:focus-visible) { background:var(--fg-nav-active); }
html[data-workspace-layout="unified"] .rail :is(.rail-nav-row,.rail-footer) :is(a,button):focus-visible { outline:2px solid var(--fg-nav-text); outline-offset:-2px; }
html[data-workspace-layout="unified"] .rail :is(.local-note,.rail-footer) { border-color:color-mix(in srgb,var(--fg-nav-text) 16%,transparent); }
html[data-workspace-layout="unified"] .rail .local-note { font-size:11px; }
html[data-workspace-layout="unified"] .shell > main > header { min-height:68px; height:auto; padding:12px 24px; background:var(--fg-surface); border-color:var(--fg-line); }
html[data-workspace-layout="unified"] .header-title small { color:var(--fg-muted); font-size:10px; font-weight:500; }
html[data-workspace-layout="unified"] .header-title strong { color:var(--fg-ink); font:600 16px/1.4 var(--fg-font); }
html[data-workspace-layout="unified"] .shell > main > header .header-actions > label { color:var(--fg-muted); font-size:11px; font-weight:500; }
html[data-workspace-layout="unified"] .shell > main > header .header-actions > label select { min-height:var(--fg-control-height); border:1px solid var(--fg-line); border-radius:var(--fg-radius); background:var(--fg-surface); color:var(--fg-ink); font:13px var(--fg-font); }
html[data-workspace-layout="unified"] .workspace { max-width:1600px; padding:24px; color:var(--fg-ink); }
html[data-workspace-layout="unified"] .workspace :is(h1,h2,h3,h4,.metric>strong,.tenant-count b) { color:var(--fg-ink); font-family:var(--fg-font); letter-spacing:-.025em; }
html[data-workspace-layout="unified"] .workspace h1 { font-size:clamp(23px,2.3vw,30px); font-weight:600; line-height:1.2; }
html[data-workspace-layout="unified"] .workspace h2 { font-size:20px; font-weight:600; line-height:1.3; }
html[data-workspace-layout="unified"] .workspace h3 { font-size:16px; font-weight:600; line-height:1.4; }
html[data-workspace-layout="unified"] .workspace > :is(.intro,.admin-toolbar,.application-directory-head,.admin-hero,.help-hero,.scenario-hero,.module-hero,.rewards-hero,.storypilot-hero),
html[data-workspace-layout="unified"] .workspace > section > .intro,
html[data-workspace-layout="unified"] .workspace > .forge-invoice-workspace > .intro,
html[data-workspace-layout="unified"] .workspace > .subscription-page > .subscription-hero {
  min-height:0; margin:0 0 24px; padding:0; border:0; border-radius:0; background:transparent; color:var(--fg-ink); box-shadow:none;
}
html[data-workspace-layout="unified"] .workspace :is(.intro,.admin-toolbar,.application-directory-head,.module-hero,.admin-hero,.scenario-hero,.rewards-hero,.storypilot-hero,.subscription-hero) :is(h1,h2) { color:var(--fg-ink); margin:3px 0 7px; font-family:var(--fg-font); font-weight:600; }
html[data-workspace-layout="unified"] .workspace :is(.intro,.admin-toolbar,.application-directory-head,.module-hero,.admin-hero,.scenario-hero,.rewards-hero,.storypilot-hero,.subscription-hero) :is(p,small,span) { color:var(--fg-muted); }
html[data-workspace-layout="unified"] .workspace :is(.panel,.metric,.connector-card,.module-card,.organization-admin-card,.tenant-card,.platform-admin-card,.scenario-card,.project-card) { border:1px solid var(--fg-line); border-radius:var(--fg-radius); box-shadow:none; background:var(--fg-surface); color:var(--fg-ink); }
html[data-workspace-layout="unified"] .workspace :is(.panel,.metric,.connector-card,.module-card,.platform-admin-card) { padding:calc(18px * var(--fg-density)) calc(20px * var(--fg-density)); }
html[data-workspace-layout="unified"] .workspace :is(.columns,.import-grid,.connector-cards,.module-grid,.admin-actions,.platform-admin-grid) { gap:var(--fg-gap); }
html[data-workspace-layout="unified"] .workspace :is(button,.button,.button-link,.primary,.secondary-button,input,select,textarea,dialog) { border-radius:var(--fg-radius); font-family:var(--fg-font); }
html[data-workspace-layout="unified"] .workspace :is(button,.button,.button-link,.primary,.secondary-button) { min-height:var(--fg-button-height); border-radius:var(--fg-button-radius); font-size:var(--fg-button-font-size); font-weight:600; }
html[data-workspace-layout="unified"] :where(.workspace) button { padding:var(--fg-button-padding-block) var(--fg-button-padding-inline); border:1px solid var(--fg-button-border); background:var(--fg-surface); color:var(--fg-ink); cursor:pointer; }
html[data-workspace-layout="unified"] .workspace button:disabled { opacity:.45; cursor:not-allowed; }
html[data-workspace-layout="unified"] .workspace :is(.button,.primary,.primary-button) { background:var(--fg-action); color:var(--fg-action-text); }
html[data-workspace-layout="unified"] .workspace [data-new-invoice] { background:var(--fg-action); border-color:var(--fg-action); color:var(--fg-action-text); }
html[data-workspace-layout="unified"] .workspace :is(.secondary-button,.button.secondary-button) { background:var(--fg-surface); color:var(--fg-action); border:1px solid var(--fg-line); }
html[data-workspace-layout="unified"] .workspace :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),select,textarea) { border:1px solid var(--fg-line); background:var(--fg-surface); color:var(--fg-ink); }
html[data-workspace-layout="unified"] .workspace :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),select) { min-height:var(--fg-control-height); }
html[data-workspace-layout="unified"] .workspace :is(.section-heading, .chart-head) { margin-bottom:14px; align-items:center; }
html[data-workspace-layout="unified"] .workspace :is(.section-heading p,.panel>p,.admin-section>p) { color:var(--fg-muted); font-size:13px; line-height:1.5; }
html[data-workspace-layout="unified"] .workspace table { border-collapse:collapse; font:13px/1.5 var(--fg-font); }
html[data-workspace-layout="unified"] .workspace :is(th,td) { padding:calc(13px * var(--fg-density)) 14px; border-bottom:1px solid var(--fg-line); vertical-align:middle; }
html[data-workspace-layout="unified"] .workspace th { font-size:11px; font-weight:600; color:var(--fg-muted); background:var(--fg-canvas); text-align:left; }
html[data-workspace-layout="unified"] .workspace td small { display:block; margin-top:3px; color:var(--fg-muted); }
html[data-workspace-layout="unified"] .workspace :is(button,input,select,textarea,a,summary):focus-visible { outline:2px solid var(--fg-action); outline-offset:3px; }
html[data-workspace-layout="unified"] .workspace .delete { color:var(--red,#b44e49); background:transparent; border:0; }

/* Admin filtering preserves the same live form elements and handlers. */
html[data-workspace-layout="unified"] .workspace[data-workspace-route="admin"] { display:flex; flex-direction:column; }
html[data-workspace-layout="unified"] .workspace[data-workspace-route="admin"] > .admin-toolbar { order:0; }
html[data-workspace-layout="unified"] .workspace[data-workspace-route="admin"] > .admin-actions { order:1; margin:0 0 20px; flex-wrap:wrap; }
html[data-workspace-layout="unified"] .forge-admin-navigation { display:block; order:2; }
html[data-workspace-layout="unified"] .forge-admin-navigation .fg-section-nav button { border-radius:0; font-size:13px; }
html[data-workspace-layout="unified"] [data-forge-admin-panel] { display:none; order:4; margin:0; }
html[data-workspace-layout="unified"][data-forge-admin-section="organizations"] [data-forge-admin-panel="organizations"],
html[data-workspace-layout="unified"][data-forge-admin-section="people"] [data-forge-admin-panel="people"],
html[data-workspace-layout="unified"][data-forge-admin-section="modules"] [data-forge-admin-panel="modules"],
html[data-workspace-layout="unified"][data-forge-admin-section="providers"] [data-forge-admin-panel="providers"],
html[data-workspace-layout="unified"][data-forge-admin-section="appearance"] [data-forge-admin-panel="appearance"],
html[data-workspace-layout="unified"][data-forge-admin-section="tools"] [data-forge-admin-panel="tools"] { display:block; }
html[data-workspace-layout="unified"] [data-forge-admin-panel].forge-admin-directory { order:3; }
html[data-workspace-layout="unified"] .forge-admin-wrap > section { margin:0 0 20px; }
html[data-workspace-layout="unified"] .forge-admin-mobile-section { display:none; }
html[data-workspace-layout="unified"] .workspace .organization-admin-card { display:grid; grid-template-columns:minmax(220px,1.2fr) minmax(140px,.7fr) minmax(200px,1fr) auto; align-items:center; gap:12px; padding:14px 18px; }
html[data-workspace-layout="unified"] .workspace .organization-admin-card > header { height:auto; padding:0; gap:16px; background:transparent; border:0; }
html[data-workspace-layout="unified"] .workspace header { min-height:0; height:auto; }
html[data-workspace-layout="unified"] .workspace .organization-admin-card > header { grid-column:1; grid-row:1; min-width:0; }
html[data-workspace-layout="unified"] .workspace .organization-admin-card > header .tenant-count b { font-size:16px; margin:0; }
html[data-workspace-layout="unified"] .workspace .organization-admin-card > header .tenant-count small { font-size:10px; }
html[data-workspace-layout="unified"] .workspace .organization-admin-card > header h3 { font-size:15px; }
html[data-workspace-layout="unified"] .workspace .organization-admin-card > header small { color:var(--fg-muted); letter-spacing:0; }
html[data-workspace-layout="unified"] .workspace .organization-admin-card > details { margin:0; padding:0; border:0; min-width:0; }
html[data-workspace-layout="unified"] .workspace .organization-admin-card > details:nth-child(2) { grid-column:2; grid-row:1; }
html[data-workspace-layout="unified"] .workspace .organization-admin-card > details:nth-child(3) { grid-column:3; grid-row:1; }
html[data-workspace-layout="unified"] .workspace .organization-admin-card > details > summary { min-height:38px; padding:9px 0; color:var(--fg-action); font:500 12px/1.5 var(--fg-font); }
html[data-workspace-layout="unified"] .workspace .organization-admin-card > footer { grid-column:4; grid-row:1; margin:0; padding:0; border:0; }
html[data-workspace-layout="unified"] .workspace .organization-admin-card > footer > small { display:none; }
html[data-workspace-layout="unified"] .workspace .organization-admin-card > details[open] { grid-column:1/-1; grid-row:2; padding-top:12px; border-top:1px solid var(--fg-line); }
html[data-workspace-layout="unified"] .workspace .organization-admin-card:has(>details:nth-child(2)[open]) > details:nth-child(3)[open] { grid-row:3; }
html[data-workspace-layout="unified"] .workspace .tenant-card { padding:14px 18px; }
html[data-workspace-layout="unified"] .workspace .tenant-card h3 { font-size:15px; }
html[data-workspace-layout="unified"] .workspace .tenant-card footer { gap:8px; }
html[data-workspace-layout="unified"] .workspace .organization-member { gap:10px; align-items:center; }
html[data-workspace-layout="unified"] .workspace .organization-member > span { min-width:0; overflow-wrap:anywhere; }
html[data-workspace-layout="unified"] .workspace .organization-hierarchy-panel { padding:20px; border:1px solid var(--fg-line); border-radius:var(--fg-radius); background:var(--fg-surface); }
html[data-workspace-layout="unified"] .workspace .organization-hierarchy-tree li { margin:12px 0; }
html[data-workspace-layout="unified"] .workspace .organization-hierarchy-tree strong { color:var(--fg-ink); }

@media(max-width:1100px) {
  html[data-workspace-layout="unified"] .shell > main > header { gap:12px; flex-wrap:wrap; }
  html[data-workspace-layout="unified"] .workspace .organization-admin-card { grid-template-columns:minmax(200px,1.2fr) minmax(130px,.8fr) minmax(160px,1fr); }
  html[data-workspace-layout="unified"] .workspace .organization-admin-card > footer { grid-column:1/-1; grid-row:auto; justify-content:flex-end; }
}
@media(max-width:900px) {
  .shell > main > header .header-actions > .workspace-appearance { grid-column:1/-1; justify-self:end; }
  .shell > main > header .workspace-appearance label { grid-column:auto; }
  html[data-workspace-layout="unified"] .shell > main > header { display:grid; padding:10px 14px; }
  html[data-workspace-layout="unified"] .workspace { padding:22px 16px; }
  html[data-workspace-layout="unified"] .rail { width:min(88vw,320px); }
  html[data-workspace-layout="unified"] .rail nav a { min-height:44px; }
  html[data-workspace-layout="unified"] { --fg-control-height:44px; }
}
@media(max-width:700px) {
  html[data-workspace-layout="unified"] .forge-admin-navigation .fg-section-nav { display:none; }
  html[data-workspace-layout="unified"] .forge-admin-mobile-section { display:grid; gap:6px; margin-bottom:20px; color:var(--fg-muted); font-size:12px; }
  html[data-workspace-layout="unified"] .forge-admin-mobile-section select { width:100%; padding:10px; }
  html[data-workspace-layout="unified"] .workspace .admin-actions { gap:8px; }
  html[data-workspace-layout="unified"] .workspace .admin-actions .button { flex:1 1 140px; padding:9px; white-space:normal; }
  html[data-workspace-layout="unified"] .workspace .section-heading { align-items:flex-start; flex-wrap:wrap; }
  html[data-workspace-layout="unified"] .workspace .organization-member { grid-template-columns:1fr 1fr; }
  html[data-workspace-layout="unified"] .workspace .organization-member > span { grid-column:1/-1; }
  html[data-workspace-layout="unified"] .workspace .organization-admin-card { grid-template-columns:1fr 1fr; }
  html[data-workspace-layout="unified"] .workspace .organization-admin-card > header { grid-column:1/-1; }
  html[data-workspace-layout="unified"] .workspace .organization-admin-card > details:nth-child(2) { grid-column:1; grid-row:2; }
  html[data-workspace-layout="unified"] .workspace .organization-admin-card > details:nth-child(3) { grid-column:2; grid-row:2; }
  html[data-workspace-layout="unified"] .workspace .organization-admin-card > footer { grid-row:3; }
  html[data-workspace-layout="unified"] .workspace .organization-admin-card > details[open] { grid-column:1/-1; grid-row:4; }
  html[data-workspace-layout="unified"] .workspace .organization-admin-card:has(>details:nth-child(2)[open]) > details:nth-child(3)[open] { grid-row:5; }
}
@media(prefers-reduced-motion:reduce) {
  html[data-workspace-layout="unified"] .workspace * { scroll-behavior:auto; }
}
