/* One stable header for the name-combination categories; business panels stay below. */
/* The footer must fit its content before viewport pagination measures the card. */
html:not([data-ui="mobile"]) body[data-theme] .names-ai-combo-results .smart-funnel-name-grid.ai-combo-actions .smart-funnel-name-card.final-name {
  grid-template-rows: 25px minmax(44px, 1fr) auto;
}
html:not([data-ui="mobile"]) body[data-theme] .names-ai-combo-results .smart-funnel-name-grid.ai-combo-actions .smart-funnel-name-actions > .ai-combo-readonly-label {
  grid-column: 2 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 24px;
  margin: 0;
  color: var(--ui-text-muted, #687b73);
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

html:not([data-ui="mobile"]) body[data-theme] .names-screen.names-shared-workspace {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: 42px auto minmax(0, 1fr) !important;
  grid-template-areas: "heading" "modes" "workspace" !important;
  gap: 4px;
  min-width: 0;
  min-height: 0;
  position: relative;
}
html:not([data-ui="mobile"]) body[data-theme] .names-screen.names-shared-workspace > .names-shared-header {
  grid-area: heading;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  height: 42px;
  margin: 0;
  padding: 0 2px;
}
html:not([data-ui="mobile"]) body[data-theme] .names-screen.names-shared-workspace > .names-shared-header > div { min-width: 0; }
html:not([data-ui="mobile"]) body[data-theme] .names-screen.names-shared-workspace > .names-shared-header h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  white-space: nowrap;
}
html:not([data-ui="mobile"]) body[data-theme] .names-screen.names-shared-workspace > .names-shared-header p {
  margin: 2px 0 0;
  font-size: 11px;
  line-height: 1.2;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
html:not([data-ui="mobile"]) body[data-theme] .names-screen.names-shared-workspace > .names-shared-header button { flex: none; min-height: 28px; font-size: 11px; }
html:not([data-ui="mobile"]) body[data-theme] .names-screen.names-shared-workspace > .names-shared-modebar {
  grid-area: modes;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 248px;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 3px 5px;
  border: 1px solid var(--ui-line, #dbe7df);
  border-radius: 6px;
  background: var(--ui-surface-1, #f7faf8);
  overflow: visible;
}
html:not([data-ui="mobile"]) body[data-theme] .names-shared-modebar > :is(.names-shared-filter-slot, .names-shared-optional-slot) {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 35px;
  grid-column: auto;
}
html:not([data-ui="mobile"]) body[data-theme] .names-shared-modebar .shared-name-filter-control { width: 100%; box-sizing: border-box; padding-right: 0; border-right: 0; }
html:not([data-ui="mobile"]) body[data-theme] .names-shared-modebar .shared-name-filter-trigger { max-width: 100%; min-height: 35px; overflow: hidden; text-overflow: ellipsis; }
html:not([data-ui="mobile"]) body[data-theme] .names-shared-modebar > .names-shared-tabs {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 5px;
  min-width: 0;
  min-height: 35px;
  margin: 0;
  padding: 0;
  border: 0;
  overflow-x: auto;
  overflow-y: hidden;
  background: transparent;
  scrollbar-width: thin;
}
html:not([data-ui="mobile"]) body[data-theme] .names-shared-modebar > .names-shared-tabs > button {
  flex: none;
  min-height: 32px;
  height: 32px;
  margin: 0;
  padding: 5px 10px;
  border-width: 1px;
  border-radius: 5px;
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
}
html:not([data-ui="mobile"]) body[data-theme] .names-shared-modebar .names-shared-history-scope {
  display: block;
  min-width: 0;
  max-width: 100%;
  color: var(--ui-text-muted, #687b73);
  font-size: 11px;
  line-height: 1.4;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: default;
}
html:not([data-ui="mobile"]) body[data-theme] .names-screen.names-shared-workspace > .names-shared-body {
  grid-area: workspace;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  min-height: 0;
  height: auto;
  overflow: hidden;
}
html:not([data-ui="mobile"]) body[data-theme] .names-shared-body > :is(.names-workbench, .strict-name-workbench-body, .history-name-results) { flex: 1; min-width: 0; min-height: 0; }
html:not([data-ui="mobile"]) body[data-theme] .names-shared-body > :is(.nameology-combination-banner, .notice, .shared-name-filter-ai-notice) { flex: none; }
html:not([data-ui="mobile"]) body[data-theme] .names-shared-body > .history-name-results { grid-template-rows: minmax(0, 1fr) auto; }
html:not([data-ui="mobile"]) body[data-theme] .names-shared-body.strict-names-top-layout {
  display: grid !important;
  grid-template-columns: 450px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: "tools results";
}
html:not([data-ui="mobile"]) body[data-theme] .names-screen.names-shared-workspace > [data-name-ranking-workspace] { grid-area: workspace; min-width: 0; min-height: 0; }
html:not([data-ui="mobile"]) body[data-theme] .names-shared-body[hidden] { display: none !important; }
html:not([data-ui="mobile"]) body[data-theme] .names-screen.names-shared-workspace:has(> .shared-name-filter-ai-notice) {
  grid-template-rows: 42px auto auto minmax(0, 1fr) !important;
  grid-template-areas: "heading" "modes" "notice" "workspace" !important;
}
html:not([data-ui="mobile"]) body[data-theme] .names-screen.names-shared-workspace > .shared-name-filter-ai-notice { grid-area: notice; margin: 0; }

@media (max-width: 1350px) {
  html:not([data-ui="mobile"]) body[data-theme] .names-screen.names-shared-workspace > .names-shared-modebar { grid-template-columns: 190px minmax(0, 1fr); }
  html:not([data-ui="mobile"]) body[data-theme] .names-shared-modebar > .names-shared-optional-slot { grid-column: 1 / -1; min-height: 35px; }
}
@media (max-width: 900px) {
  html:not([data-ui="mobile"]) body[data-theme] .names-screen.names-shared-workspace { grid-template-rows: 42px auto minmax(0, 1fr) !important; }
  html:not([data-ui="mobile"]) body[data-theme] .names-screen.names-shared-workspace > .names-shared-modebar { grid-template-columns: minmax(0, 1fr); }
  html:not([data-ui="mobile"]) body[data-theme] .names-shared-modebar > .names-shared-filter-slot { min-height: 30px; }
  html:not([data-ui="mobile"]) body[data-theme] .names-shared-body.strict-names-top-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "tools" "results"; }
}
