/* Final UI layer for all three backends. Keep the approved page layouts and the
   user's 90% portal scale. Typography uses literal CSS pixels; only geometry scales.
   Forms retain their names, values, validation, actions and editing semantics. */
.portal-refined:is(.agent-portal,.user-portal) {
  --ui-scale: 1;
  --ui-unit: calc(1px / var(--ui-scale));
  --ui-primary: #0e9cff;
  --ui-primary-hover: #0089e6;
  --ui-link: #087fc5;
  --ui-soft: #edf7ff;
  --ui-ink: #26364b;
  --ui-text: #45546a;
  --ui-muted: #65758b;
  --ui-line: #d5e0eb;
  --ui-field: #fbfdff;
  --ui-panel: #f4f7fa;
  --ui-page: 32px;
  --ui-section: 22px;
  --ui-card: 18px;
  --ui-dialog: 20px;
  --ui-metric: 36px;
  --ui-body: 16px;
  --ui-control: 15px;
  --ui-caption: 15px;
  --ui-gutter: calc(32 * var(--ui-unit));
  --ui-label: calc(148 * var(--ui-unit));
  --at-page: var(--ui-page); --ut-page: var(--ui-page);
  --at-section: var(--ui-section); --ut-section: var(--ui-section);
  --at-card: var(--ui-card); --ut-card: var(--ui-card);
  --at-body: var(--ui-body); --ut-body: var(--ui-body);
  --at-control: var(--ui-control); --ut-control: var(--ui-control);
  --at-caption: var(--ui-caption); --ut-caption: var(--ui-caption);
  --agent-blue: var(--ui-primary); --ud-blue: var(--ui-primary);
  --agent-ink: var(--ui-ink); --ud-ink: var(--ui-ink);
  --agent-muted: var(--ui-muted); --ud-muted: var(--ui-muted);
  --agent-line: var(--ui-line); --ud-line: var(--ui-line);
  --polish-primary: var(--ui-primary); --polish-primary-strong: var(--ui-primary-hover);
  --polish-primary-soft: var(--ui-soft); --polish-line: var(--ui-line);
  --polish-ink: var(--ui-ink); --polish-text: var(--ui-text); --polish-muted: var(--ui-muted);
  font-family: var(--geo-font-sans);
  font-size: var(--ui-body);
  color: var(--ui-text);
  line-height: 1.6;
}
.portal-refined.user-portal { --ui-scale: .9; }
/* Opening a section uses the same selected colors as visiting its child page. */
.portal-refined.user-portal .user-sidebar .user-nav-section.open > .user-nav-item {
  color: #fff; background: var(--ui-primary); box-shadow: none;
}
.portal-refined.user-portal .user-sidebar .user-nav-section.open > .user-nav-item :is(b,.ui-icon,.user-nav-arrow) {
  color: inherit;
}
/* Keep the platform icon beside the name, at 16px after the portal's 90% scale. */
.portal-refined.user-portal .user-content .four-accounts .authorized-account-name {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-width: 0; max-width: 100%; text-align: left;
}
.portal-refined.user-portal .user-content .four-accounts .authorized-account-name > b {
  flex: 1; min-width: 0;
  font-family: var(--geo-font-sans); font-size: 16px;
  font-weight: 400; line-height: 1.5; white-space: normal;
  overflow: visible; text-overflow: clip; overflow-wrap: anywhere;
}
.portal-refined.agent-portal .agent-logout .logout-btn > span,
.portal-refined.user-portal .user-sidebar-logout > button > span { font-size: 18px; font-weight: 800; }

/* Typography overrides are deliberate: older page styles contain very specific
   fixed sizes. Only UI chrome is normalized; authored rich-text sizes survive. */
.portal-refined:is(.agent-portal,.user-portal) :is(button,input,select,textarea) {
  font-family: var(--geo-font-sans) !important;
  font-size: var(--ui-control) !important;
  font-weight: 400;
}
.portal-refined:is(.agent-portal,.user-portal) :is(.agent-page-title,.user-page-heading) {
  font-size: var(--ui-page); font-weight: 700; color: var(--ui-ink); letter-spacing: -.025em;
}
.portal-refined:is(.agent-portal,.user-portal) :is(.agent-table-title,.design-table-title,.user-module-heading h1,.publish-heading h1,.profile-title h2) {
  font-size: var(--ui-section); color: var(--ui-ink); font-weight: 700; line-height: 1.45;
}
.portal-refined:is(.agent-portal,.user-portal) :is(.data-table,.user-records-table,.user-module-table,.publish-table) {
  font-size: var(--ui-control); color: var(--ui-text); line-height: 1.65;
}
.portal-refined:is(.agent-portal,.user-portal) :is(.data-table,.user-records-table,.user-module-table,.publish-table) th {
  color: var(--ui-ink); font-size: var(--ui-control); font-weight: 700;
}
.portal-refined:is(.agent-portal,.user-portal) :is(.field-help,.modal-tip,.form-field > small,.user-module-heading p,.publish-heading p,.profile-brand-heading > span) {
  font-size: var(--ui-caption); line-height: 1.7; color: var(--ui-muted);
}
.portal-refined:is(.agent-portal,.user-portal) :is(small,.profile-image-overlay):not(:where(.rich-editor *,.article-content *)) { font-size: var(--ui-caption) !important; line-height: 1.65; }
.portal-refined.user-portal .user-content .task-model-summary { text-align: center; }
.portal-refined.user-portal .user-content .task-model-summary > :is(span,small) { font-size: 15px !important; }
.portal-refined.user-portal .user-record-modal .instruction-parameters p { font-size: var(--ui-caption); line-height: 1.7; }
.portal-refined.user-portal .user-record-modal .article-editor-row > div > p { font-size: var(--ui-caption); color: var(--ui-muted); }
.portal-refined.user-portal .overseas-engine-notice > div > span { font-size: var(--ui-caption); line-height: 1.7; }
.portal-refined.user-portal [data-ai-result-count] { color: var(--ui-link); font-size: var(--ui-caption); }
.portal-refined.user-portal .user-nav-sub a { font-size: var(--ui-caption); min-height: 38px; }
/* Explicit navigation sizes requested by the user; do not rescale the page tokens. */
.portal-refined.user-portal .user-sidebar :is(.user-nav-main,.user-nav-item),
.portal-refined.user-portal .user-sidebar :is(.user-nav-main,.user-nav-item) > b { font-size: 17px !important; font-weight: 500; }
.portal-refined.user-portal .user-sidebar .user-nav-sub > a,
.portal-refined.user-portal .user-sidebar .user-nav-branch > summary { font-size: 15px; }
/* Shared hierarchy: distinguish actions, column labels and section headings
   without bolding ordinary values or changing authored article typography. */
.portal-refined.agent-portal .sidebar nav a { font-size: 17px; font-weight: 500; }
.portal-refined.agent-portal .sidebar nav a b { font-weight: 500; }
.portal-refined:is(.agent-portal,.user-portal) :is(button,.primary-btn,.tool-btn,.user-tool,.outline-action,.design-tabs > button) {
  font-weight: 600;
}
.portal-refined:is(.agent-portal,.user-portal) :is(.content,.user-content) table:not(:where(.rich-editor *,.article-content *)) th {
  font-size: var(--ui-control) !important; font-weight: 700 !important; color: var(--ui-ink);
}
.portal-refined:is(.agent-portal,.user-portal) :is(.metric-card,.stat-card,.pricing-metrics,.design-metric) > strong {
  font-size: var(--ui-metric); font-weight: 700;
}
.portal-refined.user-portal .user-content .design-metric > strong > small {
  font-size: 24px !important; font-weight: 500;
}
.portal-refined:is(.agent-portal,.user-portal) :is(.profile-brand-heading strong,.modal-form h3,.model-card h3,.design-quicklinks h3) {
  font-size: var(--ui-card); font-weight: 600;
}
.portal-refined.user-portal .user-content .footage-header h1 {
  font-size: var(--ui-section); font-weight: 700;
}
.portal-refined.agent-portal .content .page-head h1 {
  font-size: var(--ui-section); font-weight: 700; line-height: 1.45;
}
.portal-refined.user-portal .user-content :is(.account-auth-empty,.client-report-share-popover) h3 {
  font-size: var(--ui-card); font-weight: 600; line-height: 1.5;
}
.portal-refined.user-portal .account-platform-card > b { font-size: var(--ui-body); font-weight: 700; }
.portal-refined.user-portal .account-platform-card > small { font-weight: 400; }
.portal-refined.user-portal .account-auth-selection h3 { font-size: var(--ui-card); font-weight: 600; }
.portal-refined:is(.agent-portal,.user-portal) :is(.workspace-panel,.user-module-page,.profile-logo-card,.user-account-card) {
  border-color: var(--ui-line); box-shadow: 0 2px 10px #26364b04;
}

/* Inputs and editors: a readable text line, consistent outline, explicit states.
   Search pills, sliders, checkboxes, radios and media controls keep their sizing. */
.portal-refined:is(.agent-portal,.user-portal) :is(.modal-form,.cloud-fields,.profile-form,.user-module-form,.user-profile-form,.user-profile-card,.footage-upload,.overseas-query-form,.pricing-form,.grid-form,.manual-word-grid,.user-record-modal,.publish-modal-dialog,.user-tool-form,.keyword-tool-form,.account-auth-dialog) :is(input,select):not(:where([type=hidden],[type=checkbox],[type=radio],[type=range],[type=file],[type=color],[type=button],[type=submit],[type=reset],[type=image],[multiple],[size],.pricing-table .price-input > input)) {
  box-sizing: border-box; min-width: 0; width: 100%; max-width: 100%;
  height: calc(42 * var(--ui-unit)) !important;
  min-height: calc(42 * var(--ui-unit)) !important;
  padding: 0 calc(12 * var(--ui-unit)) !important;
  line-height: 1.5 !important;
  border: 1px solid var(--ui-line) !important; border-radius: calc(8 * var(--ui-unit)) !important;
  color: var(--ui-ink); background: var(--ui-field) !important; box-shadow: none;
}
.portal-refined:is(.agent-portal,.user-portal) :is(.modal-form,.cloud-fields,.profile-form,.user-module-form,.user-profile-form,.user-profile-card,.footage-upload,.overseas-query-form,.pricing-form,.grid-form,.manual-word-grid,.user-record-modal,.publish-modal-dialog,.user-tool-form,.keyword-tool-form) select:not([multiple]) {
  padding-right: calc(32 * var(--ui-unit)) !important; text-overflow: clip;
}
.portal-refined:is(.agent-portal,.user-portal) :is(.modal-form,.cloud-fields,.profile-form,.user-module-form,.user-profile-form,.user-profile-card,.footage-upload,.overseas-query-form,.pricing-form,.grid-form,.manual-word-grid,.user-record-modal,.publish-modal-dialog,.user-tool-form) textarea {
  box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%;
  min-height: calc(116 * var(--ui-unit)); padding: calc(12 * var(--ui-unit));
  border: 1px solid var(--ui-line); border-radius: calc(8 * var(--ui-unit));
  color: var(--ui-ink); background: var(--ui-field); line-height: 1.75; resize: vertical;
}
.portal-refined:is(.agent-portal,.user-portal) input::placeholder,
.portal-refined:is(.agent-portal,.user-portal) textarea::placeholder { color: #8795a8; opacity: 1; }
.portal-refined:is(.agent-portal,.user-portal) :is(input,select,textarea):focus {
  border-color: var(--ui-primary) !important;
  outline: 2px solid #0e9cff33; outline-offset: 2px; box-shadow: none;
}
.portal-refined:is(.agent-portal,.user-portal) :is(input,select,textarea):is([readonly],:disabled) {
  background: #f0f3f7 !important; color: #69798e !important;
}
.portal-refined:is(.agent-portal,.user-portal) :is(input,select,textarea):disabled { cursor: not-allowed; }
.portal-refined:is(.agent-portal,.user-portal) :is(input[type=checkbox],input[type=radio],input[type=range]) { accent-color: var(--ui-primary); }
.portal-refined:is(.agent-portal,.user-portal) input[type=file] {
  box-sizing: border-box; max-width: 100%; min-width: 0; min-height: calc(44 * var(--ui-unit));
  padding: calc(6 * var(--ui-unit)); border: 1px solid var(--ui-line);
  border-radius: calc(8 * var(--ui-unit)); color: var(--ui-text); background: var(--ui-field);
}
.portal-refined:is(.agent-portal,.user-portal) input[type=file]::file-selector-button {
  margin-right: 10px; padding: 7px 12px; border: 0; border-radius: 5px;
  color: var(--ui-link); background: var(--ui-soft); font: inherit; cursor: pointer;
}
.portal-refined:is(.agent-portal,.user-portal) :is(.primary-btn,.user-submit,.btn-primary,.tool-btn.add,.user-tool.add,.btn-soft,.btn-mini) {
  color: #fff !important; background: var(--ui-primary) !important; border-color: transparent;
  box-shadow: none; font-weight: 600; white-space: nowrap;
}
.portal-refined:is(.agent-portal,.user-portal) :is(.primary-btn,.user-submit,.btn-primary,.tool-btn.add,.user-tool.add,.btn-soft,.btn-mini):hover:not(:disabled) {
  background: var(--ui-primary-hover) !important;
}
.portal-refined:is(.agent-portal,.user-portal) :is(.reset-btn,.user-reset,.btn-line,.test-model-btn) {
  color: var(--ui-text); background: var(--ui-panel); border: 1px solid var(--ui-line); box-shadow: none; white-space: nowrap;
}
.portal-refined.user-portal .footage-header > a.btn-line { color: #fff; background: var(--ui-primary); border-color: var(--ui-primary); }
.portal-refined.user-portal .footage-header > a.btn-line:hover { background: var(--ui-primary-hover); border-color: var(--ui-primary-hover); }
/* Video upload details occupy the full right column; helper text belongs below
   the action rather than in a floating side column. */
.portal-refined.user-portal .footage-fields > label:is([for=footage-knowledge],[for=footage-description]) { padding-right: 0; min-width: 0; }
.portal-refined.user-portal .footage-fields #footage-description { height: 180px; min-height: 180px; }
.portal-refined.user-portal .footage-upload > #footage-help { position: static; width: auto; margin: 0; font-size: 15px; line-height: 1.7; color: #98a2b3; }
.portal-refined.user-portal .footage-upload > .user-submit { background: linear-gradient(135deg,#16a5ff,#0786da) !important; }
@media (min-width: 861px) {
  .portal-refined.user-portal .footage-fields .design-file-drop { grid-row: 2 / 7; }
  .portal-refined.user-portal .footage-fields > label[for=footage-knowledge] { grid-row: 2; }
  .portal-refined.user-portal .footage-fields > label[for=footage-description] { grid-row: 3; }
  .portal-refined.user-portal .footage-upload > .footage-rights { grid-row: 4; }
  .portal-refined.user-portal .footage-upload > .user-submit { grid-row: 5; }
  .portal-refined.user-portal .footage-upload > #footage-help { grid-row: 6; }
  .portal-refined.user-portal .footage-upload > [data-footage-status] { grid-row: 7; }
}
.portal-refined:is(.agent-portal,.user-portal) :is(.primary-btn,.reset-btn,.user-submit,.user-reset,.btn) { border-radius: 999px; }
.portal-refined:is(.agent-portal,.user-portal) :is(button,a,summary):focus-visible { outline: 2px solid var(--ui-primary); outline-offset: 3px; }
.portal-refined:is(.agent-portal,.user-portal) :is(button,.btn):disabled { opacity: .5; cursor: not-allowed; }
.portal-refined:is(.agent-portal,.user-portal) .rich-toolbar {
  flex-wrap: wrap; gap: 4px; padding: 8px; border-color: var(--ui-line);
  border-radius: 8px 8px 0 0; background: var(--ui-panel);
}
.portal-refined:is(.agent-portal,.user-portal) .rich-toolbar button { height: calc(32 * var(--ui-unit)); border-radius: 5px; color: var(--ui-text); }
.portal-refined:is(.agent-portal,.user-portal) .rich-toolbar button:hover { background: #e1f1ff; color: var(--ui-link); }
.portal-refined:is(.agent-portal,.user-portal) :is(.rich-editor,.rich-source-editor) {
  border-color: var(--ui-line); border-radius: 0 0 8px 8px; padding: calc(16 * var(--ui-unit));
  font-family: var(--geo-font-sans); font-size: var(--ui-body); line-height: 1.8; background: #fff; color: var(--ui-ink);
}
.portal-refined:is(.agent-portal,.user-portal) :is(.rich-editor,.rich-source-editor):focus { border-color: var(--ui-primary); outline: 2px solid #0e9cff33; }
.portal-refined:is(.agent-portal,.user-portal) .rich-editor-status { font-size: var(--ui-caption); color: var(--ui-muted); }
.portal-refined:is(.agent-portal,.user-portal) .rich-toolbar button[aria-pressed=true] { color: var(--ui-link); background: var(--ui-soft); border-color: #80c8f7; }
.portal-refined.user-portal .keyword-layer-flow { border-color: var(--ui-line); background: var(--ui-soft); }
.portal-refined.user-portal .keyword-layer-flow b { background: var(--ui-primary); }
.portal-refined.user-portal :is(.keyword-mode,.keyword-combinations button) {
  min-height: calc(34 * var(--ui-unit)); border: 1px solid var(--ui-line); border-radius: 7px;
  color: var(--ui-text); background: var(--ui-panel); white-space: nowrap;
}
.portal-refined.user-portal :is(.keyword-mode.ai,.article-cover-upload button) { color: #fff; background: var(--ui-primary); }
.portal-refined.user-portal .keyword-mode.manual { color: var(--ui-link); background: var(--ui-soft); border-color: #beddf3; }
.portal-refined.user-portal .keyword-combinations button.selected { color: var(--ui-link); background: var(--ui-soft); border-color: #80c8f7; }
.portal-refined.user-portal .keyword-combinations { display: flex; flex-wrap: wrap; gap: 8px; }
.portal-refined.user-portal .keyword-combinations > span { flex-basis: 100%; }
.portal-refined.user-portal .keyword-combinations button { min-width: 0; width: auto; padding: 6px 12px; }
.portal-refined.user-portal .keyword-result-head > b { color: var(--ui-link); background: var(--ui-soft); box-shadow: none; font-size: var(--ui-caption); }
.portal-refined.user-portal .keyword-result-actions button { min-height: calc(36 * var(--ui-unit)); padding: 6px 16px; border-radius: 999px; box-shadow: none; }
.portal-refined.user-portal .keyword-result-actions [data-generate-keywords] { color: #fff; background: var(--ui-primary); }
.portal-refined.user-portal .keyword-result-actions [data-copy-keywords] { color: var(--ui-text); background: var(--ui-panel); }
.portal-refined.user-portal .keyword-result-actions [data-clear-keywords] { color: #d9364b; background: #fff0f2; }

/* Manual keyword page follows the domestic reference at the same 90% scale.
   Keep these dimensions local: other tools and their modal variants use the
   shared tokens above. English word values and combination logic are unchanged. */
.portal-refined.user-portal .user-content .manual-keyword-page {
  --ui-control: 15px; --ui-caption: 15px; --ut-caption: 15px;
  font-size: 16px; line-height: 1.6; color: #1c2941;
  padding: 30px; border: 0; border-radius: 16px; background: #fff; box-shadow: none;
}
.portal-refined.user-portal .manual-keyword-page .tool-page-heading { gap: 18px; margin: 0 0 24px; }
.portal-refined.user-portal .manual-keyword-page .tool-page-heading h1 { margin: 0; font-size: var(--ui-section); font-weight: 700; line-height: 1.5; color: #333; }
.portal-refined.user-portal .user-content .manual-keyword-page .tool-page-heading p { margin-top: 8px; font-size: 15px; line-height: 1.6; color: #657184; }
.portal-refined.user-portal .manual-keyword-page .tool-page-heading small { padding: 7px 11px; border-radius: 15px; font-size: 15px !important; line-height: 1.6; color: #5d55d8; background: #f0efff; }
.portal-refined.user-portal .user-content .manual-keyword-page .manual-word-grid {
  display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 14px; margin-top: 23px;
}
.portal-refined.user-portal .user-content .manual-keyword-page .manual-word-grid > label {
  display: grid; gap: 8px; min-width: 0; padding: 12px; border: 1px solid #dce5ef;
  border-radius: 10px; background: #fff; box-shadow: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.portal-refined.user-portal .user-content .manual-keyword-page .manual-word-grid > label > b {
  display: flex; align-items: center; justify-content: center; box-sizing: border-box;
  min-height: 44px; padding: 0 12px; border: 1px solid #dce5ef; border-radius: 8px;
  color: #334155; background: #f1f5f9; box-shadow: inset 3px 0 0 #94a3b8;
  font-size: 15px; font-weight: 600; line-height: 1.4; letter-spacing: .01em;
}
.portal-refined.user-portal .user-content .manual-keyword-page .manual-word-grid > label:is(:hover,:focus-within) { border-color: #a9d8f8; box-shadow: 0 4px 14px #0e9cff14; }
.portal-refined.user-portal .user-content .manual-keyword-page .manual-word-grid > label:is(:hover,:focus-within) > b { border-color: #a9d8f8; color: #0c5e8f; background: #f0f9ff; box-shadow: inset 3px 0 0 #38bdf8; }
.portal-refined.user-portal .user-content .manual-keyword-page .manual-word-grid > label.required { border-color: #82c9f8; background: #f7fcff; }
.portal-refined.user-portal .user-content .manual-keyword-page .manual-word-grid > label.required > b { border-color: #82c9f8; color: #075985; background: #eaf6ff; box-shadow: inset 3px 0 0 #0e9cff; font-weight: 700; }
.portal-refined.user-portal .user-content .manual-keyword-page textarea {
  box-sizing: border-box; width: 100%; min-width: 0; padding: 8px 12px;
  border: 1px solid #d7dde8; border-radius: 9px; color: #344054 !important;
  background: #fbfcfe !important; font-size: 16px !important; font-weight: 400; line-height: 1.5; resize: vertical;
}
.portal-refined.user-portal .user-content .manual-keyword-page .manual-word-grid textarea { height: 220px; min-height: 220px; margin-top: 12px; }
.portal-refined.user-portal .user-content .manual-keyword-page :is(.manual-combinations,.manual-results-section,.manual-help) {
  margin-top: 24px; padding: 24px; border: 1px solid #e1e6eb; border-radius: 12px; background: #fafbfd; box-shadow: none;
}
.portal-refined.user-portal .user-content .manual-keyword-page :is(.manual-combinations,.manual-results-section) h2 { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.5; color: #333; }
.portal-refined.user-portal .user-content .manual-keyword-page .manual-help h2 { margin: 0; font-size: var(--ui-card); font-weight: 700; line-height: 1.6; color: #5f6ce5; }
.portal-refined.user-portal .user-content .manual-keyword-page .manual-combinations > div { display: grid; grid-template-columns: repeat(10,minmax(0,1fr)); gap: 10px; margin-top: 13px; }
.portal-refined.user-portal .user-content .manual-keyword-page .manual-combinations > div button { min-width: 0; height: 38px; min-height: 38px; padding: 1px 6px; border: 1px solid #d4e5f1; border-radius: 6px; color: #555; background: #fff; font-size: 15px !important; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.portal-refined.user-portal .user-content .manual-keyword-page .manual-combinations > header button { padding: 1px 6px; border: 0 none #d4e5f1; border-radius: 6px; color: #555; background: #fff; font-size: 16px !important; line-height: 1.6; }
.portal-refined.user-portal .user-content .manual-keyword-page .manual-results-section > header > b { padding: 7px 11px; border-radius: 16px; font-size: 15px; font-weight: 600; line-height: 1.5; }
.portal-refined.user-portal .user-content .manual-keyword-page .manual-result-actions { gap: 10px; margin-top: 12px; }
.portal-refined.user-portal .user-content .manual-keyword-page .manual-result-actions button {
  display: flex; align-items: center; gap: 8px; height: 42px; min-height: 36px; padding: 7px 18px;
  border: 1px solid transparent; border-radius: 20px; font-size: 15px !important; font-weight: 600; line-height: 1.4; white-space: nowrap;
}
.portal-refined.user-portal .user-content .manual-keyword-page .manual-result-actions button:nth-child(2) { color: #333; background: #f1f2f3; box-shadow: none; }
.portal-refined.user-portal .user-content .manual-keyword-page .manual-result-actions button:nth-child(3) { color: #f34c60; background: #ffeff0; box-shadow: none; }
.portal-refined.user-portal .user-content .manual-keyword-page :is(.manual-combinations > div button.selected,.manual-results-section > header > b,.manual-result-actions button:first-child) {
  border-color: #0e9cff; color: #fff; background: linear-gradient(135deg,#16a5ff,#0786da); box-shadow: 0 5px 13px #0e9cff29;
}
.portal-refined.user-portal .user-content .manual-keyword-page .manual-results-section > textarea { min-height: 240px; margin-top: 13px; }
@media (max-width: 1280px) {
  .portal-refined.user-portal .user-content .manual-keyword-page .manual-word-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .portal-refined.user-portal .user-content .manual-keyword-page .manual-combinations > div { grid-template-columns: repeat(5,minmax(0,1fr)); }
}
@media (max-width: 700px) {
  .portal-refined.user-portal .user-content .manual-keyword-page { padding: 18px; }
  .portal-refined.user-portal .user-content .manual-keyword-page .manual-word-grid { grid-template-columns: minmax(0,1fr); }
  .portal-refined.user-portal .user-content .manual-keyword-page .manual-combinations > div { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .portal-refined.user-portal .user-content .manual-keyword-page :is(.manual-combinations,.manual-results-section,.manual-help) { padding: 18px; }
  .portal-refined.user-portal .user-content .manual-keyword-page .manual-result-actions { flex-wrap: wrap; }
}

/* Dialog geometry: shared gutters, enough width, only the body scrolls.
   A symmetric scrollbar gutter prevents a visible one-sided indentation. */
.portal-refined:is(.agent-portal,.user-portal) :is(.app-modal,.publish-modal-dialog,.account-auth-dialog,.agreement-modal-host > section) {
  --modal-gutter: var(--ui-gutter);
  box-sizing: border-box; min-width: 0; border: 1px solid #dce5ee;
  border-radius: calc(14 * var(--ui-unit)); background: #fff;
  color: var(--ui-text); box-shadow: 0 24px 80px #182d4930;
}
.portal-refined:is(.agent-portal,.user-portal) .app-modal:not(.is-minimized):not(.is-maximized) {
  width: min(var(--ui-dialog-width, calc(960 * var(--ui-unit))), calc((100vw - 48px) / var(--ui-scale)));
  max-height: calc((100dvh - 48px) / var(--ui-scale));
}
.portal-refined.agent-portal .model-modal { --ui-dialog-width: 1000px; --ui-label: 80px; }
.portal-refined.agent-portal .enterprise-modal { --ui-dialog-width: 1000px; --ui-label: 72px; }
.portal-refined.agent-portal .realname-modal { --ui-dialog-width: 920px; --ui-label: 196px; }
.portal-refined.user-portal :is(.user-instruction-modal,.user-task-modal,.user-keyword-modal,.user-knowledge-modal,.user-article-modal,.user-media-modal) { --ui-dialog-width: calc(1120 * var(--ui-unit)); }
/* Creation dialogs share compact label tracks in both add and edit mode. */
.portal-refined.user-portal .user-task-modal { --ui-label: calc(112 * var(--ui-unit)); }
.portal-refined.user-portal .user-article-modal { --ui-label: calc(104 * var(--ui-unit)); }
.portal-refined.user-portal .user-instruction-modal { --ui-label: calc(72 * var(--ui-unit)); }
.portal-refined.user-portal .video-auto-modal { --ui-label: calc(96 * var(--ui-unit)); }
.portal-refined.user-portal .keyword-tool-modal { --ui-dialog-width: calc(1320 * var(--ui-unit)); }
.portal-refined.user-portal :is(.user-resource-article-categories,.user-resource-image-categories,.user-article-import-modal,.user-image-upload-modal) { --ui-dialog-width: calc(800 * var(--ui-unit)); }
.portal-refined.user-portal .user-record-modal:not(.is-minimized):not(.is-maximized) { height: min(calc(760 * var(--ui-unit)),calc((100dvh - 48px) / var(--ui-scale))); }
.portal-refined.user-portal :is(.user-resource-article-categories,.user-resource-image-categories):not(.is-minimized):not(.is-maximized) { height: auto; }
.portal-refined:is(.agent-portal,.user-portal) :is(.app-modal,.publish-modal-dialog,.account-auth-dialog) > header {
  box-sizing: border-box; flex: 0 0 auto; height: auto; min-height: calc(58 * var(--ui-unit));
  padding: calc(12 * var(--ui-unit)) var(--ui-gutter); border-bottom: 1px solid #e1e8f0;
  color: var(--ui-ink); background: #eff4f9;
}
.portal-refined:is(.agent-portal,.user-portal) :is(.app-modal,.publish-modal-dialog,.account-auth-dialog) > header :is(strong,b,h2) {
  margin: 0; font-size: var(--ui-dialog); font-weight: 700; line-height: 1.4;
}
.portal-refined:is(.agent-portal,.user-portal) :is(.app-modal,.publish-modal-dialog,.account-auth-dialog) > header small { color: var(--ui-muted); font-size: var(--ui-caption); }
.portal-refined:is(.agent-portal,.user-portal) :is(.app-modal,.publish-modal-dialog,.account-auth-dialog) > header button {
  flex: none; width: calc(30 * var(--ui-unit)); height: calc(30 * var(--ui-unit));
  color: #6d7e94; background: transparent; border: 0; border-radius: 6px;
}
.portal-refined:is(.agent-portal,.user-portal) :is(.app-modal,.publish-modal-dialog,.account-auth-dialog) > header button:hover { background: #dfeaf4; color: var(--ui-ink); }
.portal-refined.agent-portal .app-modal .modal-form { padding: 24px var(--ui-gutter); scrollbar-gutter: stable both-edges; }
.portal-refined.agent-portal .enterprise-modal .enterprise-form { padding: 0; scrollbar-gutter: auto; }
.portal-refined.agent-portal .enterprise-modal .enterprise-form .enterprise-form-body { padding: 24px var(--ui-gutter); scrollbar-gutter: stable both-edges; }
.portal-refined.agent-portal .enterprise-modal .enterprise-settings { max-width: none; }
.portal-refined.agent-portal .app-modal .modal-form > label,
.portal-refined.agent-portal .enterprise-modal .enterprise-form-body > label {
  display: grid; grid-template-columns: var(--ui-label) minmax(0,1fr); align-items: center;
  gap: 8px 16px; margin-bottom: 18px;
}
.portal-refined.agent-portal .app-modal .modal-form label > span:first-child {
  font-size: var(--ui-control); font-weight: 600; color: var(--ui-text); white-space: nowrap; text-align: left;
}
.portal-refined.agent-portal .model-modal .model-form .field-help { margin: -6px 0 20px calc(var(--ui-label) + 16px); }
.portal-refined.agent-portal .modal-form .radio-row { gap: 14px; }
.portal-refined.agent-portal .modal-form .radio-row > label { white-space: nowrap; }
.portal-refined.user-portal .user-content .user-record-modal:not(.is-minimized) > form {
  display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; max-height: none; padding: 0; overflow: hidden;
}
.portal-refined.user-portal .user-record-modal > form > :is(.reference-form-stack,.task-form-body,.article-form-body,.user-keyword-form,.user-form-grid,.knowledge-form-body,.media-content-form-grid,.article-import-form-body) { flex: 1 1 auto; }
.portal-refined.user-portal .user-record-modal :is(.user-form-grid,.user-keyword-form,.reference-form-stack,.task-form-body,.article-form-body,.knowledge-form-body,.media-content-form-grid,.article-import-form-body,.image-upload-form-row,.keyword-tool-body,.user-detail-content) {
  box-sizing: border-box; min-height: 0; padding: 24px var(--ui-gutter); gap: 20px 24px;
  overflow-y: auto; scrollbar-gutter: stable both-edges; overscroll-behavior: contain;
}
.portal-refined.user-portal .user-record-modal :is(.reference-form-stack,.user-keyword-form,.task-form-body,.article-form-body,.video-advanced) > label:not([hidden]),
.portal-refined.user-portal .user-record-modal .video-auto-body .video-field {
  display: grid; grid-template-columns: var(--ui-label) minmax(0,1fr); align-items: center; gap: 8px 16px; min-width: 0;
}
.portal-refined.user-portal .user-record-modal :is(.reference-form-stack,.user-keyword-form,.task-form-body,.article-form-body,.video-advanced) > label > span:first-child,
.portal-refined.user-portal .user-record-modal .video-field > span:first-child {
  text-align: left; padding: 0; font-size: var(--ui-control); font-weight: 600; white-space: nowrap;
}
.portal-refined.user-portal .user-record-modal :is(.reference-form-stack,.task-form-body,.article-form-body,.video-advanced) > label > small,
.portal-refined.user-portal .user-record-modal .video-field > small { grid-column: 2; font-size: var(--ui-caption); line-height: 1.7; color: var(--ui-muted); margin: 0; }
.portal-refined.user-portal .user-record-modal :is(.reference-form-stack,.article-form-body,.media-content-form-grid) > label:has(textarea,.rich-editor-shell),
.portal-refined.user-portal .user-record-modal .task-form-body > label:has(textarea) { grid-template-columns: minmax(0,1fr); }
.portal-refined.user-portal .user-record-modal label:has(textarea,.rich-editor-shell) > span:first-child { text-align: left; }
.portal-refined.user-portal .user-record-modal label:has(textarea,.rich-editor-shell) > small { grid-column: 1 / -1; }
/* Cover selection is a compact action, with its preview in the control column. */
.portal-refined.user-portal .user-article-modal .article-cover-upload > div { position: relative; justify-self: start; width: auto; }
.portal-refined.user-portal .user-article-modal .article-cover-upload > div::before { content: none; }
.portal-refined.user-portal .user-article-modal .article-cover-upload button {
  width: auto; min-width: calc(80 * var(--ui-unit)); min-height: calc(36 * var(--ui-unit));
  padding: 6px 18px; border-radius: 7px; white-space: nowrap;
}
.portal-refined.user-portal .user-article-modal .article-cover-upload > .article-cover-preview {
  grid-column: 2; justify-self: start; width: calc(240 * var(--ui-unit)); max-width: 100%;
  height: calc(144 * var(--ui-unit)); max-height: none; margin: 4px 0 0;
  border: 1px solid var(--ui-line); border-radius: 7px; background: var(--ui-field); object-fit: contain;
}
.portal-refined.user-portal .user-record-modal :is(.knowledge-form-body,.instruction-parameter-grid,.task-form-grid) { gap: 20px 24px; }
.portal-refined.user-portal .keyword-tool-modal .keyword-word-grid { grid-template-columns: repeat(6,minmax(0,1fr)); gap: 14px; }
.portal-refined.user-portal .keyword-tool-modal .keyword-word-grid label > b {
  height: auto; min-height: 34px; padding: 6px 8px; font-size: var(--ui-control); font-weight: 600;
  color: var(--ui-ink); background: var(--ui-panel); border: 1px solid var(--ui-line); border-radius: 7px;
  white-space: nowrap; overflow: visible; text-overflow: clip;
}
.portal-refined.user-portal .keyword-tool-modal .keyword-word-grid label:nth-child(3) > b { color: var(--ui-link); background: var(--ui-soft); border-color: #80c8f7; }
.portal-refined.user-portal .keyword-tool-modal .keyword-word-grid textarea { word-break: normal; overflow-wrap: normal; white-space: pre; overflow-x: auto; }
.portal-refined.user-portal .user-record-modal :is(.user-form-grid,.knowledge-form-body,.media-content-form-grid,.instruction-parameter-grid) label > span:first-child {
  font-size: var(--ui-control); font-weight: 600; color: var(--ui-text);
}
.portal-refined.user-portal .user-media-modal :is(.media-status-field,.media-status-options) { justify-content: flex-start; }
.portal-refined.user-portal .user-record-modal :is(.reference-radio-row,.task-status-row) {
  display: block; min-width: 0; margin-inline: 0; padding: 0; border: 0;
}
.portal-refined.user-portal .user-record-modal :is(.reference-radio-row,.task-status-row) > legend {
  float: left; width: var(--ui-label); min-width: 0; margin: 0 16px 0 0; padding: 7px 0;
  text-align: left; white-space: nowrap; font-size: var(--ui-control); font-weight: 600;
}
.portal-refined.user-portal .user-record-modal :is(.reference-radio-row,.task-status-row)::after { content: ''; display: block; clear: both; }
.portal-refined.user-portal .user-record-modal :is(.reference-radio-row,.task-status-row) > label { display: inline-flex; margin: 0 10px 6px 0; }
.portal-refined.user-portal .user-record-modal :is(.reference-radio-row,.task-status-row) > small { display: block; clear: both; margin-left: calc(var(--ui-label) + 16px); font-size: var(--ui-caption); }
.portal-refined.user-portal .task-status-row input:checked + span.paused { background: #69788e; }
.portal-refined.user-portal .task-status-row input:checked + span.paused i { background: #69788e; }
.portal-refined.user-portal .user-status.task-paused { color: #69788e; }
.portal-refined.user-portal .user-status.task-paused i { background: #69788e; }
.portal-refined.user-portal :is(.reference-radio-row,.radio-pills) label > span {
  min-height: calc(34 * var(--ui-unit)); padding: 7px 12px; border: 1px solid var(--ui-line);
  border-radius: 7px; color: var(--ui-text); background: var(--ui-panel); font-size: var(--ui-control); font-weight: 400;
}
.portal-refined.user-portal :is(.reference-radio-row,.radio-pills) input:checked + span {
  color: var(--ui-link); background: var(--ui-soft); border-color: #7ecbff;
}
.portal-refined.user-portal :is(.reference-radio-row,.radio-pills) input:checked + span::before { border-color: var(--ui-primary); background: var(--ui-primary); box-shadow: inset 0 0 0 2px #fff; }
.portal-refined.user-portal :is(.reference-radio-row,.radio-pills) input:focus-visible + span { outline: 2px solid var(--ui-primary); outline-offset: 3px; }
.portal-refined.user-portal .user-record-modal :is(.instruction-parameters,.task-video-picker,.video-flow-note,.reference-warning) { border-color: var(--ui-line); border-radius: 10px; background: var(--ui-panel); }
.portal-refined.user-portal .video-auto-body {
  --video-disclosure-ink: var(--ui-link); --video-disclosure-surface: var(--ui-soft);
  --video-disclosure-border: #beddf3; --video-disclosure-action: #dff0ff;
  --video-disclosure-action-border: #80c8f7; --video-disclosure-hover: #e4f3ff;
  --video-disclosure-focus: var(--ui-primary);
}
.portal-refined.user-portal .user-record-modal .task-range { grid-template-columns: var(--ui-label) minmax(0,1fr) auto !important; }
.portal-refined.user-portal .user-record-modal .task-range > span { grid-column: auto; }
.portal-refined.user-portal .publish-modal-dialog { width: min(calc(960 * var(--ui-unit)),calc((100vw - 48px) / var(--ui-scale))); }
.portal-refined.user-portal .publish-modal-dialog.compact { width: min(calc(640 * var(--ui-unit)),calc((100vw - 48px) / var(--ui-scale))); }
.portal-refined.user-portal .publish-modal-dialog.task-dialog { width: min(calc(1120 * var(--ui-unit)),calc((100vw - 48px) / var(--ui-scale))); height: min(calc(780 * var(--ui-unit)),calc((100dvh - 48px) / var(--ui-scale))); max-height: calc((100dvh - 48px) / var(--ui-scale)); }
.portal-refined.user-portal .publish-modal-dialog.task-dialog .task-form-grid { padding: 24px var(--ui-gutter); gap: 20px 24px; scrollbar-gutter: stable both-edges; }
.portal-refined.user-portal .user-content .account-auth-dialog > header { padding-inline: var(--ui-gutter); }
.portal-refined.user-portal .user-content .account-auth-dialog-body { padding: 24px var(--ui-gutter); scrollbar-gutter: stable both-edges; }
.portal-refined:is(.agent-portal,.user-portal) :is(.app-modal,.publish-modal-dialog,.account-auth-dialog) footer,
.portal-refined:is(.agent-portal,.user-portal) :is(.app-modal,.publish-modal-dialog) form > footer {
  box-sizing: border-box; justify-content: center; gap: 10px; flex: 0 0 auto;
  padding: 14px var(--ui-gutter); margin-inline: 0; min-height: calc(64 * var(--ui-unit));
  border-top: 1px solid #e4ebf3; background: #fff;
}
.portal-refined:is(.agent-portal,.user-portal) :is(.app-modal,.publish-modal-dialog,.account-auth-dialog) footer :is(button,.btn) {
  min-height: calc(36 * var(--ui-unit)); min-width: calc(88 * var(--ui-unit)); height: auto; padding: 6px 16px;
}
.portal-refined:is(.agent-portal,.user-portal) .app-modal.is-minimized > header { min-height: 0; height: 100%; padding-block: 0; }

/* Undesigned utility pages reuse the same form/card language. */
.portal-refined.user-portal .client-report-share > summary { margin-bottom: 0; }
.portal-refined.user-portal .user-module-form { padding: 24px; border: 1px solid var(--ui-line); border-radius: 12px; background: var(--ui-panel); gap: 20px 24px; }
.portal-refined.user-portal .user-module-form label > span { color: var(--ui-text); font-size: var(--ui-control); font-weight: 600; }
.portal-refined.user-portal .user-module-form label > small { font-size: var(--ui-caption); line-height: 1.7; color: var(--ui-muted); }
.portal-refined.user-portal .site-form { display: grid; grid-template-columns: minmax(140px,.55fr) minmax(240px,2fr) minmax(170px,.8fr) max-content; align-items: start; gap: 8px 24px; }
.portal-refined.user-portal .site-form > label { min-width: 0; grid-row: 1 / 4; display: grid; grid-template-rows: subgrid; }
.portal-refined.user-portal .site-form > button { grid-column: 4; grid-row: 2; align-self: center; justify-self: end; margin-top: 0; white-space: nowrap; }

@media (max-width: 1120px) {
  .portal-refined.user-portal .site-form { grid-template-columns: 1fr; }
  .portal-refined.user-portal .site-form > label { grid-row: auto; grid-template-rows: none; }
  .portal-refined.user-portal .site-form > button { grid-column: 1; grid-row: auto; }
}
/* Native progress values remain accurate when CSP disallows inline widths. */
.portal-refined.user-portal progress.overseas-batch-progress { display: block; width: 100%; appearance: none; border: 0; color: var(--ui-primary, #0e9cff); }
.portal-refined.user-portal progress.overseas-batch-progress::-webkit-progress-bar { background: #e8ecf3; border-radius: 5px; }
.portal-refined.user-portal progress.overseas-batch-progress::-webkit-progress-value { background: var(--ui-primary, #0e9cff); border-radius: 5px; }
.portal-refined.user-portal progress.overseas-batch-progress::-moz-progress-bar { background: var(--ui-primary, #0e9cff); border-radius: 5px; }

@media (max-width: 900px) {
  .portal-refined:is(.agent-portal,.user-portal) { --ui-gutter: calc(24 * var(--ui-unit)); --ui-page: calc(27 * var(--ui-unit)); }
  .portal-refined.user-portal .keyword-tool-modal .keyword-word-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .portal-refined.agent-portal .enterprise-modal .enterprise-settings :is(.quota-module-grid,.enterprise-edit-quota-grid) { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 640px) {
  .portal-refined:is(.agent-portal,.user-portal) { --ui-gutter: calc(16 * var(--ui-unit)); --ui-page: calc(24 * var(--ui-unit)); --ui-section: calc(19 * var(--ui-unit)); }
  .portal-refined:is(.agent-portal,.user-portal) .app-modal:not(.is-minimized):not(.is-maximized) { width: calc((100vw - 24px) / var(--ui-scale)); max-height: calc((100dvh - 24px) / var(--ui-scale)); }
  .portal-refined.agent-portal .app-modal .modal-form > label,
  .portal-refined.agent-portal .enterprise-modal .enterprise-form-body > label,
  .portal-refined.user-portal .user-record-modal :is(.reference-form-stack,.user-keyword-form,.task-form-body,.article-form-body,.video-advanced) > label:not([hidden]),
  .portal-refined.user-portal .user-record-modal .video-auto-body .video-field { grid-template-columns: minmax(0,1fr); gap: 7px; }
  .portal-refined:is(.agent-portal,.user-portal) .app-modal form label > span:first-child { text-align: left; white-space: normal; }
  .portal-refined.agent-portal .model-modal .model-form .field-help { margin-left: 0; }
  .portal-refined.agent-portal .enterprise-modal .enterprise-settings .modal-two-col { grid-template-columns: minmax(0,1fr); }
  .portal-refined.user-portal .user-record-modal :is(.reference-form-stack,.task-form-body,.article-form-body,.video-advanced) > label > small,
  .portal-refined.user-portal .user-record-modal .video-field > small { grid-column: 1 / -1; }
  .portal-refined.user-portal .user-record-modal :is(.reference-radio-row,.task-status-row) > legend { float: none; width: auto; text-align: left; margin: 0 0 6px; }
  .portal-refined.user-portal .user-record-modal :is(.reference-radio-row,.task-status-row) > small { margin-left: 0; }
  .portal-refined.user-portal .user-record-modal .task-range { grid-template-columns: minmax(0,1fr) auto !important; }
  .portal-refined.user-portal .user-record-modal .task-range > span { grid-column: 1 / -1; }
  .portal-refined.user-portal .user-article-modal .article-cover-upload > .article-cover-preview { grid-column: 1; }
  .portal-refined.user-portal .keyword-tool-modal .keyword-word-grid { grid-template-columns: minmax(0,1fr); }
}

/* Article import settings use the same modal, typography and enterprise gallery. */
.portal-refined.user-portal .user-article-import-modal:not(.is-minimized):not(.is-maximized) {
  height: min(calc(760 * var(--ui-unit)), calc((100dvh - 48px) / var(--ui-scale)));
}
.portal-refined.user-portal .user-record-modal .article-import-form-body { gap: calc(16 * var(--ui-unit)); }
.portal-refined.user-portal .article-import-picker { min-height: calc(100 * var(--ui-unit)); }
.portal-refined.user-portal .article-import-images {
  min-width: 0; margin: 0; padding: calc(18 * var(--ui-unit));
  display: grid; gap: calc(12 * var(--ui-unit)); border: 1px solid var(--ui-line);
  border-radius: calc(10 * var(--ui-unit)); background: var(--ui-panel);
}
.portal-refined.user-portal .article-import-images > legend {
  float: none; padding: 0 8px; color: var(--ui-ink); font-size: var(--ui-body); font-weight: 700;
}
.portal-refined.user-portal .article-import-images > legend > span {
  margin-left: 6px; color: var(--ui-muted); font-size: var(--ui-caption); font-weight: 400;
}
.portal-refined.user-portal .article-import-images-intro,
.portal-refined.user-portal .article-import-image-help,
.portal-refined.user-portal .article-import-preserve-note {
  margin: 0; color: var(--ui-muted); font-size: var(--ui-caption); text-align: left;
}
.portal-refined.user-portal .article-import-image-row {
  display: grid; grid-template-columns: calc(102 * var(--ui-unit)) minmax(0,1fr);
  align-items: center; gap: calc(12 * var(--ui-unit)); min-width: 0; margin: 0;
}
.portal-refined.user-portal .article-import-image-row > :is(span,label) { text-align: left; }
.portal-refined.user-portal .article-import-image-help { margin-left: calc(114 * var(--ui-unit)); }
.portal-refined.user-portal .article-import-cover-option {
  display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin: 0; cursor: pointer;
}
.portal-refined.user-portal .article-import-cover-option input[type=checkbox] {
  width: 18px !important; height: 18px !important; min-height: 0; margin: 0; accent-color: var(--ui-primary);
}
.portal-refined.user-portal .article-import-cover-option small { color: var(--ui-muted); font-size: var(--ui-caption); }
.portal-refined.user-portal .article-import-image-count {
  display: grid; grid-template-columns: minmax(60px,1fr) calc(64 * var(--ui-unit)) auto;
  align-items: center; gap: 10px; min-width: 0;
}
.portal-refined.user-portal .article-import-image-count input[type=range] {
  width: 100%; height: 20px; min-height: 0; padding: 0; border: 0; box-shadow: none; accent-color: var(--ui-primary);
}
.portal-refined.user-portal .article-import-image-count input[type=number] { width: 100%; text-align: center; padding: 0 4px; }
.portal-refined.user-portal .article-import-image-count > span { white-space: nowrap; color: var(--ui-muted); font-size: var(--ui-caption); }
.portal-refined.user-portal .article-import-images-summary {
  margin: 0; padding: 10px 12px; background: var(--ui-soft); border-radius: 7px;
  color: var(--ui-link); font-size: var(--ui-caption); line-height: 1.65;
}
@media (max-width: 600px) {
  .portal-refined.user-portal .article-import-image-row { grid-template-columns: minmax(0,1fr); gap: 6px; }
  .portal-refined.user-portal .article-import-image-help { margin-left: 0; }
}

/* Admin model defaults share the existing portal palette and typography. */
.portal-refined .model-default-summary { display:flex; flex-wrap:wrap; gap:16px; margin:0 0 20px; }
.portal-refined .model-default-summary > div { flex:1 1 280px; display:flex; flex-wrap:wrap; align-items:center; gap:10px; padding:14px 18px; border:1px solid #dce8f4; border-radius:10px; background:#f5f9fd; }
.portal-refined .model-default-summary strong { color:#1687d0; overflow-wrap:anywhere; }
.portal-refined .model-default-summary small { color:#7b8ba3; }

/* List errors stay on one line. The native title carries the complete message. */
body table td .list-error-text[title] {
  display: block;
  width: 240px;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  word-break: normal;
}

/* SEO task list: fit the remaining columns after hiding site and date range. */
.portal-refined.user-portal .user-content .seo-task-page .publish-table {
  width: 100%; min-width: 0; table-layout: fixed;
}
.portal-refined.user-portal .user-content .seo-task-page .publish-table :is(th,td) {
  padding-inline: 8px;
}
.portal-refined.user-portal .user-content .seo-task-page .publish-table th {
  white-space: normal;
}

@media (max-width: 1440px) {
  .portal-refined.user-portal .user-content .seo-task-page .publish-table :is(th,td) { padding-inline: 4px; }
}

/* Left-align the query-status group and keep equal space above and below. */
.portal-refined.user-portal .user-content .query-records-page .query-record-filters {
  justify-content: flex-start; align-items: center; padding: 8px 12px;
}
.portal-refined.user-portal .user-content .query-records-page .query-record-filters > a {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
}

/* Three-tier management: reuse existing typography, colors and controls. */
.portal-refined.agent-portal .agent-account-workspace { padding: 28px; }
.portal-refined.agent-portal .agent-account-form h3 { margin: 24px 0 16px; }
.portal-refined.agent-portal .agent-account-form footer { display: flex; gap: 12px; margin-top: 24px; }
.portal-refined.agent-portal .agent-allocation-detail { white-space: normal; min-width: 280px; max-width: 640px; text-align: left; }
.portal-refined.agent-portal .pricing-target-form { display:flex; align-items:end; flex-wrap:wrap; gap:12px; margin:20px 0; }
.portal-refined.agent-portal .pricing-target-form label { display:grid; gap:8px; min-width:240px; }
.portal-refined.agent-portal .pricing-target-form select { min-height:40px; padding:8px 12px; border:1px solid var(--ui-border,#d5e0eb); border-radius:8px; background:#fff; }
.portal-refined.agent-portal .pricing-toolbar { flex-wrap:wrap; }
.portal-refined.agent-portal .profile-workspace input[readonly] { color:#6f7d90; background:#f4f7fa; }
/* Agent OEM controls follow the existing light panel and blue action styles. */
.oem-domain-management { margin-top: 24px; padding-top: 20px; border-top: 1px solid #e4eaf2; }
.oem-domain-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 16px 0; padding: 14px 18px; background: #f5f8fc; border-radius: 10px; }
.oem-domain-summary small { flex-basis: 100%; color: #738298; }
.oem-domain-summary a, .oem-domain-row span { overflow-wrap: anywhere; }
.oem-domain-row { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 12px 0; }
.oem-domain-add { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.oem-domain-add label { display: grid; gap: 8px; flex: 1; min-width: 240px; }
.oem-domain-add input { width: 100%; height: 42px; background: #fbfdff; color: #263c53; border: 1px solid #d2deef; border-radius: 8px; padding: 0 12px; }
.geo-login-brand .geo-oem-wordmark { width: 360px; max-width: 100%; height: 90px; object-fit: contain; }

/* Agent list and pricing refinements reuse the enterprise toolbar and dialog. */
.portal-refined.agent-portal .agent-management-page .table-toolbar .tool-btn.add { order: 6; }
.portal-refined.agent-portal .agent-management-page summary[hidden] { display: none; }
/* Match the enterprise list's name emphasis, account colors and rendered rows.
   Keep the scope on the direct list cells so embedded modal tables are untouched. */
.portal-refined.agent-portal .agent-management-page > .table-wrap > .data-table > tbody > tr > td:not(.empty) { height: 63px; }
.portal-refined.agent-portal .agent-management-page .data-table .agent-account-cell { color: #2f3640; }
.portal-refined.agent-portal .agent-management-page .agent-name-note { font-size: inherit !important; font-weight: 400; line-height: inherit; }
.portal-refined.agent-portal .agent-management-page .agent-status-note { margin-left: 8px; }
.portal-refined.agent-portal .agent-management-page .round-actions > form > .outline-action { font-weight: 600; }
.portal-refined.agent-portal .agent-edit-modal { text-align: left; white-space: normal; }
.portal-refined.agent-portal .agent-edit-modal h3 { margin: 0 0 18px; }
.portal-refined.agent-portal .agent-edit-modal .profile-form { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: start; gap: 20px 24px; margin-bottom: 24px; }
.portal-refined.agent-portal .agent-edit-modal .profile-form label { display: grid; grid-template-columns: minmax(0,1fr); gap: 8px; min-width: 0; margin: 0; text-align: left; }
.portal-refined.agent-portal .agent-edit-modal .profile-form label > span:first-child { padding: 0; white-space: normal; }
.portal-refined.agent-portal .agent-edit-modal .profile-form :is(input,select) { width: 100%; min-width: 0; height: 42px; padding: 0 12px; border: 1px solid #d2deef; border-radius: 8px; color: #263c53; background: #fbfdff; }
.portal-refined.agent-portal .agent-edit-modal .profile-form small { margin: 0; color: #738298; }
.portal-refined.agent-portal .agent-edit-modal .enterprise-form-body :is(small,.modal-tip) { display: block; }
.portal-refined.agent-portal .agent-edit-modal .modal-tip { margin-left: 0; }
.portal-refined.agent-portal .agent-edit-modal .oem-domain-management { margin-top: 0; }
.portal-refined.agent-portal .agent-edit-modal .oem-domain-help { margin-top: 14px; }
.portal-refined.agent-portal .pricing-head-actions { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
/* The compact price-and-unit control follows the approved pricing design,
   with one shared border instead of the standard full-size form field. */
.portal-refined.agent-portal .pricing-table .price-input {
  display: inline-flex; align-items: stretch; box-sizing: border-box;
  width: calc(120 * var(--ui-unit)); height: calc(30 * var(--ui-unit));
  margin: auto; padding: 0; overflow: hidden;
  border: 1px solid #ccc; border-radius: calc(3 * var(--ui-unit)); background: #fff;
  box-shadow: none;
}
.portal-refined.agent-portal .pricing-table .price-input:focus-within { border-color: #00f; }
.portal-refined.agent-portal .pricing-table .price-input > input {
  flex: 1 1 0; box-sizing: border-box; width: 0; min-width: 0; height: 100%; min-height: 0;
  margin: 0; padding: 0 calc(8 * var(--ui-unit)); border: 0; border-radius: 0;
  color: #ff3f52; background: #fff; text-align: center; line-height: 1; font-weight: 400;
}
.portal-refined.agent-portal .pricing-table .price-input > input:focus { outline: none; box-shadow: none; }
.portal-refined.agent-portal .pricing-table .price-input > span {
  display: flex; align-items: center; justify-content: center; flex: 0 0 calc(34 * var(--ui-unit));
  box-sizing: border-box; height: 100%; padding: 0;
  color: #999; background: #f5f7fa; font-size: var(--ui-control); line-height: 1;
}
.portal-refined.agent-portal .pricing-target-dialog { --ui-dialog-width: calc(520 * var(--ui-unit)); top: 50%; transform: translate(-50%,-50%); }
.portal-refined.agent-portal .pricing-target-dialog .pricing-target-form { display: block; margin: 0; }
.portal-refined.agent-portal .pricing-target-dialog .pricing-target-form label { min-width: 0; }
.portal-refined.agent-portal .pricing-target-dialog .pricing-target-form select { width: 100%; }
.portal-refined.agent-portal .pricing-target-dialog footer { display: flex; justify-content: center; gap: 8px; padding: 12px 24px; border-top: 1px solid #e4eaf2; }
@media (max-width: 760px) {
  .portal-refined.agent-portal .agent-edit-modal .profile-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

/* Publication tabs show ten rows; the remaining records scroll within the table. */
.portal-refined.user-portal .legacy-simple-report .report-publication-scroll {
  overflow: auto; overscroll-behavior-y: contain;
  scrollbar-width: thin; scrollbar-color: #c1c8d0 transparent;
}
.portal-refined.user-portal .report-publication-scroll[data-publication-limit] {
  max-height: 594px; scroll-padding-top: 54px; scrollbar-gutter: stable;
}
.portal-refined.user-portal .report-publication-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.portal-refined.user-portal .report-publication-scroll::-webkit-scrollbar-thumb { background: #c1c8d0; border-radius: 999px; }
.portal-refined.user-portal .report-publication-scroll thead th { position: sticky; top: 0; z-index: 1; }
.portal-refined.user-portal .report-publication-scroll:focus-visible { outline: 2px solid var(--ui-primary); outline-offset: -2px; }
.portal-refined.user-portal .report-publication-scroll a { scroll-margin-block: 4px; }

/* Shared reports use the live overview components, without authenticated chrome. */
.portal-refined.user-portal.public-report-page { min-width: 320px; }
.portal-refined.user-portal .public-report-shell {
  max-width: 1760px; margin: 20px auto; padding: 30px;
  min-height: calc(100vh / var(--ui-scale) - 40px);
  border: 1px solid #fff; border-radius: 20px; background: var(--ud-canvas);
}
.portal-refined.user-portal .public-report-content { margin: 0; padding: 0; min-width: 0; }
@media (max-width: 860px) {
  .portal-refined.user-portal .public-report-shell { margin: 12px; padding: 12px; }
}
.portal-refined.agent-portal .opening-plan-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin:16px 0 24px; }
.portal-refined.agent-portal .opening-plan-card { display:grid; gap:8px; padding:18px; border:1px solid var(--ui-border,#d3e0f2); border-radius:12px; background:#f4f8fd; }
.portal-refined.agent-portal .opening-plan-card strong { font-size:18px; font-weight:700; }
.portal-refined.agent-portal .opening-plan-card > span { color:#0e9cff; font-size:22px; font-weight:700; }
.portal-refined.agent-portal .opening-preview { margin:16px 0; padding:14px 16px; border-radius:8px; background:#f0f7ff; line-height:1.7; font-size:15px; }
.portal-refined.agent-portal .opening-preview-error { color:#bb333d; background:#fff2f3; }
.portal-refined.agent-portal .opening-prices-modal .app-modal { width:min(620px,calc(100vw - 32px)); }
.portal-refined.agent-portal .opening-price-row { display:grid; grid-template-columns:minmax(0,1fr) 220px; align-items:center; gap:20px; margin-bottom:18px; }
.portal-refined.agent-portal .opening-price-control { display:flex; align-items:center; gap:10px; }
.portal-refined.agent-portal .opening-price-control input { min-width:0; width:100%; }
.portal-refined.agent-portal .enterprise-modal .package-correction-form .enterprise-form-body > label { grid-template-columns:170px minmax(0,1fr); }
.portal-refined.agent-portal .enterprise-modal .package-correction-form .enterprise-form-body > label > span { white-space:normal; overflow:visible; }
.portal-refined.agent-portal .enterprise-modal form[data-opening-mode] .enterprise-form-body > label { grid-template-columns:140px minmax(0,1fr); }
@media (max-width:640px) { .portal-refined.agent-portal .enterprise-modal :is(.package-correction-form,form[data-opening-mode]) .enterprise-form-body > label { grid-template-columns:1fr; } }
.portal-refined.agent-portal .opening-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; margin:12px 0 24px; }
.portal-refined.agent-portal .opening-metrics article { display:grid; gap:12px; padding:22px; background:#f1f6fc; border-radius:14px; }
.portal-refined.agent-portal .opening-metrics strong { font-size:30px; font-weight:700; color:#223a52; }
@media (max-width:760px) { .portal-refined.agent-portal :is(.opening-plan-list,.opening-metrics,.opening-price-row) { grid-template-columns:1fr; } }

/* Report platform filters retain the existing card grid and support keyboard navigation. */
.portal-refined.user-portal .simple-effect-achievement progress.simple-achievement-track {
  display:block; width:calc(100% - 40px); appearance:none; border:0; color:var(--ui-primary);
}
.portal-refined.user-portal progress.simple-achievement-track::-webkit-progress-bar {
  background:#e2eaf0; border-radius:999px;
}
.portal-refined.user-portal progress.simple-achievement-track::-webkit-progress-value {
  background:var(--ui-primary); border-radius:999px;
}
.portal-refined.user-portal progress.simple-achievement-track::-moz-progress-bar {
  background:var(--ui-primary); border-radius:999px;
}
.portal-refined.user-portal .design-ranking-platforms > .ranking-platform-filter {
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  min-width:0; min-height:60px; padding:10px 16px;
  border:1px solid #d8d8d8; border-radius:6px; background:#f7f7f7;
  color:#555; text-decoration:none; cursor:pointer;
}
.portal-refined.user-portal .ranking-platform-filter .ranking-platform-identity {
  display:flex; align-items:center; gap:10px; min-width:0;
  font-size:var(--ut-caption); font-weight:600;
}
.portal-refined.user-portal .ranking-platform-identity :is(img,.ui-icon) {
  flex:none; width:26px; height:26px;
}
.portal-refined.user-portal .ranking-platform-count {
  font-size:var(--ut-caption); font-variant-numeric:tabular-nums; white-space:nowrap;
}
.portal-refined.user-portal .design-ranking-platforms > .ranking-platform-filter:hover {
  border-color:var(--ui-primary); background:#eef8ff;
}
.portal-refined.user-portal .design-ranking-platforms > .ranking-platform-filter[aria-current="true"] {
  border-color:var(--ui-primary); background:#eef8ff; color:var(--ui-primary);
}
.portal-refined.user-portal .ranking-platform-filter:focus-visible {
  outline:2px solid var(--ui-primary); outline-offset:2px;
}
@media (max-width:760px) {
  .portal-refined.user-portal .design-ranking-platforms > .ranking-platform-filter { padding:10px; }
  .portal-refined.user-portal .ranking-platform-filter .ranking-platform-identity { gap:6px; }
}
