/* Shared workbench standard. Business state and mobile flow remain owned by each tool. */
body[data-v110-tool-page] {
  --ui-font:"Microsoft YaHei","PingFang SC",system-ui,sans-serif;
  --ui-ink:#25342e; --ui-muted:#64716b; --ui-line:#d8e0dc;
  --ui-accent:#237451; --ui-soft:#eef5f1; --ui-canvas:#f6f8f7;
  --primary:var(--ui-accent); --accent:var(--ui-accent); --green:var(--ui-accent);
  --text:var(--ui-ink); --muted:var(--ui-muted); --line:var(--ui-line);
  font-family:var(--ui-font); color:var(--ui-ink); background:var(--ui-canvas);
}

/* Final token authority: legacy preview rules above stay structurally intact,
   while every shared action uses the blue workbench accent. */
body[data-v110-tool-page] :is(.primary,.primary-button,.button-primary,.btn-primary,.primary-btn) { background:#1f5f9f!important; border-color:#1f5f9f!important; color:#fff!important; }
body[data-v110-tool-page] :is(.primary,.primary-button,.button-primary,.btn-primary,.primary-btn):hover { background:#164b7f!important; border-color:#164b7f!important; }
body[data-v110-tool-page] :is(input,select,textarea):focus { border-color:#6e9cca!important; box-shadow:0 0 0 3px rgba(31,95,159,.12)!important; }

/* Preview-wide blue design tokens. */
body[data-v110-tool-page] {
  --ui-ink:#1d2d3d; --ui-muted:#637487; --ui-line:#d7e1eb;
  --ui-accent:#1f5f9f; --ui-soft:#eaf2fb; --ui-canvas:#f5f8fc;
  --primary:var(--ui-accent); --accent:var(--ui-accent); --green:var(--ui-accent);
  --text:var(--ui-ink); --muted:var(--ui-muted); --line:var(--ui-line);
  color:var(--ui-ink); background:var(--ui-canvas);
}
body[data-v110-tool-page] :is(button,.button,.primary-button,.secondary-button) { border-radius:6px; }
body[data-v110-tool-page] :is(.primary,.primary-button,.button-primary,.btn-primary,.primary-btn) { background:var(--ui-accent)!important; border-color:var(--ui-accent)!important; }
body[data-v110-tool-page] :is(.primary,.primary-button,.button-primary,.btn-primary,.primary-btn):hover { background:#164b7f!important; }
body[data-v110-tool-page] :is(input,select,textarea):focus { border-color:#6e9cca!important; box-shadow:0 0 0 3px rgba(31,95,159,.12)!important; }

@media (max-width:767px) {
  body[data-preview="v110"] :is(.hero-tools-entry,.portal-tools-entry) {
    position:relative;
    top:auto;
    left:auto;
    width:calc(100% - 32px);
    margin:24px 16px 0;
    transform:none;
    opacity:1;
    animation:none;
  }
  body[data-preview="v110"] :is(.hero-tools-entry,.portal-tools-entry):hover,
  body[data-preview="v110"] :is(.hero-tools-entry,.portal-tools-entry):active {
    transform:none;
  }
}
body[data-v110-tool-page] :is(button,input,select,textarea) { font-family:var(--ui-font); }
body[data-v110-tool-page] * { letter-spacing:0 !important; }
body[data-v110-tool-page] [hidden],body[data-v110-tool-page] .hidden { display:none !important; }
body[data-v110-tool-page] :is(button,a,input,select,textarea,summary):focus-visible { outline:2px solid #1f5f9f; outline-offset:3px; }
body[data-v110-tool-page] .v110-tool-nav :focus-visible { outline-color:#a0e0bf; }
body[data-v110-tool-page] :is(button,.button)[disabled] { cursor:not-allowed; opacity:.5; }
body[data-v110-tool-page] :is(button,.button):not(:disabled) { transition:background-color .16s,color .16s,box-shadow .16s; }
body[data-v110-tool-page] :is(button,.button):not(:disabled):active { filter:brightness(.95); }
@media(min-width:1024px) {
  body[data-v110-tool-page] { font-size:14px; line-height:1.6; }
  body[data-v110-tool-page] :is(h1,h2,h3,p) { overflow-wrap:anywhere; }
  body[data-v110-tool-page] h1 { font-size:24px !important; line-height:1.35; font-weight:700; color:var(--ui-ink); }
  body[data-v110-tool-page] h2 { font-size:16px !important; line-height:1.5; color:var(--ui-ink); }
  body[data-v110-tool-page] h3 { font-size:14px !important; line-height:1.5; }
  body[data-v110-tool-page] :is(button,.button,.primary-button,.secondary-button) { font-size:14px; border-radius:6px; min-height:36px; padding:7px 14px; white-space:normal; }
  body[data-v110-tool-page] :is(input,select,textarea):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=hidden]) { font-size:14px; border:1px solid #aebeb5; border-radius:6px; padding:8px 10px; box-shadow:none; min-height:38px; background:#fff; color:var(--ui-ink); }
  body[data-v110-tool-page] input:is([type=checkbox],[type=radio]),body[data-v110-tool-page] input[type=range] { accent-color:var(--ui-accent); }
  body[data-v110-tool-page] :is(label,.field>span) { font-size:13px; }
  body[data-v110-tool-page] :is(.primary,.primary-button,.button-primary,.btn-primary,.primary-btn) { background:var(--ui-accent) !important; color:#fff !important; border-color:var(--ui-accent) !important; box-shadow:none; }
  body[data-v110-tool-page] :is(.primary,.primary-button,.button-primary,.btn-primary,.primary-btn):hover { background:#164b7f !important; }
  body[data-v110-tool-page] :is(.secondary,.secondary-button,.button-secondary,.ghost-button,.btn-secondary) { background:#fff; color:var(--ui-ink); border:1px solid var(--ui-line); box-shadow:none; }
  body[data-v110-tool-page] :is(.section-heading,.panel-heading,.page-heading,.tool-page-heading,.section-head) { max-width:none; gap:16px; }
  body[data-v110-tool-page] :is(.page-heading,.tool-page-heading) { margin:0 0 24px; display:flex; align-items:center; justify-content:space-between; }
  body[data-v110-tool-page] .tool-page-heading h1 { margin:0; }
  body[data-v110-tool-page] :is(.section-heading,.panel-heading,.section-head) { margin-bottom:16px; }
  body[data-v110-tool-page] :is(.actions,.button-row,.heading-actions,.form-actions,.result-actions) { gap:8px; flex-wrap:wrap; }
  body[data-v110-tool-page] :is(main.page-shell,main.attendance-page,main.equipment-shell,main.shell,body>main) { width:100%; max-width:none; margin:0; padding:28px 32px 48px; }
  body[data-v110-tool-page] :is(.panel,.tool-card,.tool-panel,.section-block,.simple-step,.generator-panel,.context-panel,.preview-panel,.workbench,.settings,.records,.form-section,.details-panel) { box-shadow:none; border-radius:0; background:transparent; }
  body[data-v110-tool-page] :is(.panel,.section-block,.simple-step,.generator-panel,.context-panel,.preview-panel,.workbench,.settings,.records,.form-section,.details-panel) { border:0; }
  body[data-v110-tool-page] :is(.workbench,.settings,.form-section,.generator-panel) { padding:0; }
  body[data-v110-tool-page] :is(.empty-state,.empty-panel,.empty) { color:var(--ui-muted); }
  body[data-v110-tool-page] .icon-button { width:36px; height:36px; padding:0; flex:none; }
body[data-v110-tool-page] :is(.field-grid,.form-grid,.input-grid,.tool-grid,.work-grid,.split,.overview-grid)>* { min-width:0; }

  /* Preview portal: keep the primary entry below the fixed topbar and make its
     entrance/hover state clickable without changing the production portal. */
  body[data-preview="v110"] :is(.hero-tools-entry,.portal-tools-entry) {
    position:absolute;
    z-index:4;
    top:calc(50% + 30px);
    left:50%;
    width:min(960px,calc(100% - 64px));
    margin:0;
    transform:translate(-50%,20px);
    opacity:0;
    display:flex !important;
    visibility:hidden !important;
    pointer-events:none;
    transition:opacity .9s ease, transform .9s cubic-bezier(.2,.8,.2,1), visibility 0s linear .9s;
    aria-hidden:true;
  }
  body[data-preview="v110"].scene-title-ready :is(.hero-tools-entry,.portal-tools-entry) {
    visibility:visible !important;
    opacity:1;
    transform:translate(-50%,0);
    pointer-events:auto;
    transition-delay:0s;
  }
  body[data-preview="v110"] :is(.hero-tools-entry,.portal-tools-entry):hover { transform:translate(-50%,-2px); }
  body[data-preview="v110"] :is(.hero-tools-entry,.portal-tools-entry):active { transform:translate(-50%,1px) scale(.99); }
  body[data-preview="v110"] :is(.hero-tools-entry,.portal-tools-entry) {
    width:max-content !important;
    min-width:0 !important;
    max-width:none !important;
    min-height:46px;
    padding:11px 12px;
    white-space:nowrap;
  }
  body[data-preview="v110"] [data-theme="night"] :is(.hero-tools-entry,.portal-tools-entry) {
    clip-path:polygon(16% 0,84% 0,100% 22%,100% 78%,84% 100%,16% 100%,0 78%,0 22%);
    border:1px solid rgba(88,145,194,.72);
    box-shadow:0 0 0 1px rgba(84,126,180,.18), 0 8px 20px rgba(3,12,35,.28), inset 0 0 16px rgba(85,216,255,.06);
  }
  body[data-preview="v110"] [data-theme="day"] :is(.hero-tools-entry,.portal-tools-entry) {
    border:1px solid #6a9be0;
    box-shadow:0 6px 16px rgba(36,95,200,.14);
  }
  @media (prefers-reduced-motion: reduce) {
    body[data-preview="v110"] :is(.hero-tools-entry,.portal-tools-entry) { transition:none; opacity:1; visibility:visible; transform:translate(-50%,0); pointer-events:auto; }
    body[data-preview="v110"] :is(.hero-tools-entry,.portal-tools-entry):hover { transform:translate(-50%,-2px); }
  }
  @media (max-width:760px) {
    body[data-preview="v110"] :is(.hero-tools-entry,.portal-tools-entry) { top:calc(50% + 30px); width:max-content !important; }
  }

  /* Portal controls are secondary chrome: keep them available but quieter than
     the title and primary entry action. */
  body[data-preview="v110"] .topbar { height:68px; padding-inline:32px; }
  body[data-preview="v110"] .portal-controls { gap:7px; opacity:.72; }
  body[data-preview="v110"] .control-button,
  body[data-preview="v110"] .account-button { height:34px; padding-inline:9px; gap:6px; font-size:12px; }
  body[data-preview="v110"] .account-user { gap:8px; font-size:12px; }

  /* Expense: input sequence on the left; live outcome and breakdown together. */
  body[data-tool=expense] .app-shell { display:grid; grid-template-columns:minmax(440px,1.4fr) minmax(300px,.9fr); gap:24px 40px; align-items:start; }
  body[data-tool=expense] .tool-page-heading { grid-column:1/-1; margin:0; }
  body[data-tool=expense] .mode-section { grid-column:1; margin:0; padding:0 0 20px; border-bottom:1px solid var(--ui-line); }
  body[data-tool=expense] .calculator-form { grid-column:1; display:grid; gap:24px; }
  body[data-tool=expense] .field-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 20px; }
  body[data-tool=expense] .field-grid-single { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
  body[data-tool=expense] .expense-output { grid-column:2; grid-row:2/4; position:sticky; top:24px; padding-left:28px; border-left:1px solid var(--ui-line); }
  body[data-tool=expense] .results { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:0 0 24px; }
  body[data-tool=expense] .result-card { border:0; border-radius:6px; background:#edf1ef; padding:18px; min-height:120px; }
  body[data-tool=expense] .result-card-primary { grid-column:1/-1; grid-row:1; background:#e3f1e9; color:#175638; }
  body[data-tool=expense] .result-card-accent { background:#f3efe3; color:#6a551f; }
  body[data-tool=expense] .result-value { font-size:27px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
  body[data-tool=expense] .result-card-primary .result-value { font-size:36px; }
  body[data-tool=expense] .details-panel { display:block; padding:0; }
  body[data-tool=expense] .breakdown-list>div { padding:10px 0; }
  body[data-tool=expense] .form-actions { justify-content:flex-start; margin-top:20px; }
  body[data-tool=expense] .segmented-control input:checked+span { background:var(--ui-accent); color:#fff; }

  /* Speech: write, tune, generate. History is secondary and stays below. */
  body[data-tool=text-to-speech] .speech-workflow { display:grid; grid-template-columns:minmax(0,1fr) 340px; gap:20px 32px; align-items:start; }
  body[data-tool=text-to-speech] .workbench { grid-column:1; display:block; max-width:none; }
  body[data-tool=text-to-speech] .settings { grid-column:2; grid-row:1/3; padding-left:24px; border-left:1px solid var(--ui-line); }
  body[data-tool=text-to-speech] .settings .section-heading { align-items:start; flex-wrap:wrap; gap:8px; }
  body[data-tool=text-to-speech] .settings-grid { display:grid; grid-template-columns:1fr; gap:16px; }
  body[data-tool=text-to-speech] .settings-grid .preview-button { justify-self:start; margin:0; }
  body[data-tool=text-to-speech] .pause-tools { gap:8px; margin-top:24px; padding-top:16px; border-top:1px solid var(--ui-line); }
  body[data-tool=text-to-speech] .pause-tools>span { width:100%; }
  body[data-tool=text-to-speech] #text-input { height:360px; min-height:240px; resize:vertical; }
  body[data-tool=text-to-speech] .generate-section { grid-column:1; margin:0; display:flex; align-items:center; flex-wrap:wrap; gap:16px; }
  body[data-tool=text-to-speech] .generate-button { width:auto; min-width:136px; }
  body[data-tool=text-to-speech] .records { border-top:1px solid var(--ui-line); margin-top:32px; padding:24px 0 0; }

  /* Existing application navigation becomes a subnavigation, not a second rail. */
  body[data-tool=pre-review] .app-shell { display:block; min-height:100vh; }
  body[data-tool=pre-review] .app-shell>.sidebar { position:static; width:auto; height:auto; padding:12px 32px; background:#fff; border:0; border-bottom:1px solid var(--ui-line); display:flex; align-items:center; gap:24px; }
  body[data-tool=pre-review] .sidebar>.brand { display:none; }
  body[data-tool=pre-review] .primary-nav { display:flex; flex-wrap:wrap; gap:8px; padding:0; }
  body[data-tool=pre-review] .account-panel { margin:0 0 0 auto; padding:0; border:0; max-width:300px; }
  body[data-tool=pre-review] .workspace { margin:0; width:100%; min-width:0; }
  body[data-tool=pre-review] .topbar { position:static; background:transparent; box-shadow:none; padding:24px 32px 0; border:0; min-height:0; }
  body[data-tool=pre-review] .topbar .back-link,body[data-tool=pre-review] #page-eyebrow { display:none; }
  body[data-tool=pre-review] #app-content { max-width:none; width:100%; margin:0; padding:24px 32px 48px; }
  body[data-tool=pre-review] :is(.card,.panel,.stat-card) { box-shadow:none; border-radius:6px; border-color:var(--ui-line); }
  body[data-tool=pre-review] :is(.nav-item.active,.nav-button.active) { background:var(--ui-soft); color:var(--ui-accent); }
  /* Bring the legacy pre-review shell onto the shared workbench surface. */
  body[data-tool=pre-review] .workspace { background:var(--ui-canvas); }
  body[data-tool=pre-review] .topbar { background:var(--ui-canvas)!important; color:var(--ui-ink); padding:24px 32px 0!important; }
  body[data-tool=pre-review] .topbar h1 { color:var(--ui-ink)!important; font-size:24px!important; line-height:1.35; font-weight:700; }
  body[data-tool=pre-review] .topbar .eyebrow { color:var(--ui-accent)!important; font-size:13px; font-weight:700; }
  body[data-tool=pre-review] :is(.primary-button,.secondary-button,.danger-button,.ghost-button,.notice-button) { min-height:38px; padding:8px 14px; border-radius:6px; font:600 14px/1.35 var(--ui-font); letter-spacing:0; text-align:center; }
  body[data-tool=pre-review] .primary-button { background:var(--ui-accent)!important; border-color:var(--ui-accent)!important; color:#fff!important; }
  body[data-tool=pre-review] .secondary-button,body[data-tool=pre-review] .ghost-button { background:#fff!important; border:1px solid var(--ui-line)!important; color:var(--ui-ink)!important; }
  body[data-tool=pre-review] .danger-button { background:#fff!important; border:1px solid #e1b8b3!important; color:#a33a32!important; }
  body[data-tool=pre-review] :is(.section-heading h2,.panel-header h2,.review-form h2) { color:var(--ui-ink)!important; }
  body[data-tool=pre-review] :is(.auth-layout,.auth-shell) { max-width:1000px; margin:24px auto; }
  body[data-tool=pre-review] :is(.auth-hero,.auth-visual,.auth-illustration) { background:#edf4f0; color:var(--ui-ink); box-shadow:none; }
  body[data-tool=collection] #app>.app-header { display:none; }
  body[data-tool=collection] .internal-layout { width:100%; max-width:none; margin:0; display:block; }
  body[data-tool=collection] .internal-layout>.sidebar { position:static; width:100%; padding:12px 32px; display:flex; flex-wrap:wrap; gap:8px; border:0; border-bottom:1px solid var(--ui-line); background:#fff; min-height:0; }
  body[data-tool=collection] .nav-button { width:auto; }
  body[data-tool=collection] .nav-button.active { background:var(--ui-soft); color:var(--ui-accent); }
  body[data-tool=collection] .internal-main { padding:28px 32px 48px; min-width:0; }
  body[data-tool=collection] .metrics { display:grid; grid-template-columns:repeat(4,1fr); gap:24px; padding:0 0 24px; border-bottom:1px solid var(--ui-line); }
  body[data-tool=collection] .metric { background:transparent; border:0; padding:0; }
  body[data-tool=collection] .work-grid { display:grid; grid-template-columns:minmax(0,1.6fr) minmax(280px,1fr); gap:32px; }
  body[data-tool=collection] .service-status-section { margin:16px 0 24px; padding:12px 0; }
  body[data-tool=collection] .section-block { padding:0; }

  /* Calculators and bank lookup keep the result beside the input. */
  body[data-tool=labor] .tool-card { padding:0; border:0; }
  body[data-tool=labor] .tool-grid { grid-template-columns:minmax(360px,.85fr) minmax(0,1.3fr); gap:40px; }
  body[data-tool=labor] :is(.input-panel,.result-panel) { padding:24px 0; border:0; background:transparent; }
  body[data-tool=labor] .result-panel { border-left:1px solid var(--ui-line); padding-left:32px; }
  body[data-tool=labor] #amount-input { max-width:400px; }
  body[data-tool=amount-uppercase] .tool-panel { display:grid; grid-template-columns:minmax(360px,1fr) minmax(0,1.25fr); gap:32px; padding:0; border:0; }
  body[data-tool=amount-uppercase] .result-block { margin:0; padding:24px; border-radius:6px; background:var(--ui-soft); }
  body[data-tool=amount-uppercase] .examples { grid-column:1/-1; }
  body[data-tool=bank] :is(.workspace,.batch-workspace) { grid-template-columns:minmax(350px,.8fr) minmax(0,1.4fr); gap:32px; }
  body[data-tool=bank] :is(.query-panel,.batch-input-panel) { border-right:1px solid var(--ui-line); padding:0 28px 0 0; }
  body[data-tool=bank] :is(.results-panel,.batch-results-panel) { padding:0; }
  body[data-tool=bank] .intro { margin-bottom:24px; }

  body[data-tool=meeting-usage] .input-grid { grid-template-columns:minmax(360px,.9fr) minmax(0,1.3fr); gap:32px; align-items:start; }
  body[data-tool=meeting-usage] .panel { padding:0; }
  body[data-tool=meeting-usage] .input-grid>.panel+ .panel { border-left:1px solid var(--ui-line); padding-left:28px; }
  body[data-tool=meeting-usage] .results-section { max-width:none; margin-top:32px; border-top:1px solid var(--ui-line); padding-top:24px; }
  body[data-tool=meeting-usage] .mapping-panel { background:#edf1ef; border-radius:6px; padding:16px; }

  /* Participant generation: batch setup then column/region choices, optional settings last. */
  body[data-tool=attendance-data] .attendance-layout { grid-template-columns:minmax(0,1fr) 280px; gap:32px; align-items:start; }
  body[data-tool=attendance-data] .generator-panel { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(250px,1fr); gap:20px 24px; }
  body[data-tool=attendance-data] .generator-panel>:is(.section-heading,.panel-heading,.basic-grid,.advanced-block,.generator-actions,.field-error,.validation-list) { grid-column:1/-1; }
  body[data-tool=attendance-data] .basic-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
  body[data-tool=attendance-data] .selector-block { margin:0; padding:16px 0; border:0; border-top:1px solid var(--ui-line); }
  body[data-tool=attendance-data] .selector-block:has(#column-grid) { grid-column:1/-1; }
  body[data-tool=attendance-data] .column-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
  body[data-tool=attendance-data] .province-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  body[data-tool=attendance-data] .option-columns { display:block; }
  body[data-tool=attendance-data] .context-panel { border-left:1px solid var(--ui-line); padding:0 0 0 24px; }
  body[data-tool=attendance-data] .advanced-block { margin:0; }
  body[data-tool=attendance-data] .preview-panel { border-top:1px solid var(--ui-line); margin-top:24px; padding:24px 0; }

  body[data-tool=meeting-summary] .app-layout { display:grid; grid-template-columns:200px minmax(0,1fr); padding:0; width:100%; max-width:none; margin:0; }
  body[data-tool=meeting-summary] .project-rail { border:0; border-right:1px solid var(--ui-line); background:#fff; padding:24px 16px; }
  body[data-tool=meeting-summary] .simple-workspace { padding:28px 32px; width:100%; max-width:none; }
  body[data-tool=meeting-summary] .simple-step { padding:20px 0; margin:0; border-top:1px solid var(--ui-line); }
  body[data-tool=meeting-summary] .simple-upload-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
  body[data-tool=meeting-summary] .upload-card { border-radius:6px; }
  body[data-tool=meeting-summary] .content-editor { min-height:380px; }
  body[data-tool=meeting-summary] .simple-workspace { display:grid; grid-template-columns:minmax(0,1fr) minmax(280px,34%); column-gap:40px; align-content:start; }
  body[data-tool=meeting-summary] .simple-workspace > .tool-page-heading,
  body[data-tool=meeting-summary] .simple-workspace > .workspace-title,
  body[data-tool=meeting-summary] .simple-workspace > #service-alert { grid-column:1/-1; }
  body[data-tool=meeting-summary] .simple-workspace > #upload-section { grid-column:1; }
  body[data-tool=meeting-summary] .simple-workspace > #preview-section { grid-column:2; grid-row:4; margin:0; }
  body[data-tool=meeting-summary] .simple-workspace > #content-section { grid-column:1; }
  body[data-tool=meeting-summary] .simple-workspace > #word-section { grid-column:2; grid-row:5; }
  body[data-tool=meeting-summary] .simple-upload-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  body[data-tool=meeting-summary] .screenshot-upload { grid-column:1/-1; }
  /* Summary is a working canvas: use both columns without shrinking the
     editor, and keep the title/actions aligned to the shared workbench grid. */
  body[data-tool=meeting-summary] .simple-workspace { grid-template-columns:minmax(0,1.25fr) minmax(360px,.75fr); column-gap:48px; }
  body[data-tool=meeting-summary] .simple-workspace > .tool-page-heading { padding:0 0 18px; border-bottom:1px solid var(--ui-line); }
  body[data-tool=meeting-summary] .simple-workspace > .tool-page-heading p { display:none; }
  body[data-tool=meeting-summary] .simple-workspace > .workspace-title { padding:18px 0 20px; border-bottom:1px solid var(--ui-line); align-items:center; }
  body[data-tool=meeting-summary] .simple-workspace > #upload-section { grid-column:1/-1; }
  body[data-tool=meeting-summary] .simple-workspace > #content-section { grid-column:1; }
  body[data-tool=meeting-summary] .simple-workspace > #word-section { grid-column:2; grid-row:auto; align-self:start; }
  body[data-tool=meeting-summary] #content-body { min-height:520px; width:100%; }
  body[data-tool=meeting-summary] .content-heading .secondary-button { margin-left:auto; }
  body[data-tool=meeting-summary] :is(.primary-button,.secondary-button,.danger-button) { text-align:center; }
  body[data-tool=meeting-summary] .project-name { max-width:100%; }
  body[data-tool=meeting-summary] .download-step { padding-top:24px; }
  body[data-tool=attendance-data] .attendance-page { width:100%; max-width:none; margin:0; padding:28px 32px 60px; }
  body[data-tool=attendance-data] .tool-page-heading { margin-bottom:24px; }
  body[data-tool=attendance-data] .generator-panel { background:#fff; padding:24px; border:1px solid var(--ui-line); border-radius:8px; }
  body[data-tool=attendance-data] .context-panel { background:#f7fbff; padding:20px; border:1px solid var(--ui-line); border-radius:8px; }
  body[data-tool=equipment] .overview-grid { grid-template-columns:minmax(0,1.5fr) minmax(280px,1fr); gap:32px; }
  body[data-tool=equipment] .tabs { margin-bottom:24px; background:transparent; border-bottom:1px solid var(--ui-line); }
  body[data-tool=equipment] .split { grid-template-columns:minmax(300px,.7fr) minmax(0,1.5fr); gap:32px; }
  body[data-tool=yimu-live] .shell { display:grid; grid-template-columns:minmax(360px,.85fr) minmax(0,1.2fr); gap:24px 40px; align-items:start; }
  body[data-tool=yimu-live] .install-intro { grid-column:1; border:0; background:transparent; padding:0; }
  body[data-tool=yimu-live] .guide { grid-column:2; grid-row:1/3; padding-left:32px; border-left:1px solid var(--ui-line); }
  body[data-tool=yimu-live] .notes-grid { grid-column:1; grid-template-columns:1fr; }
}

@media (min-width:1024px) {
  /* Keep every desktop tool flush with the viewport while maintaining a
     readable measure inside text-heavy editors. */
  body[data-v110-tool-page] :is(.tool-page-heading,.page-heading) { text-align:left; }
  body[data-v110-tool-page] :is(.tool-page-heading h1,.page-heading h1) { letter-spacing:0; }
}

/* Refined portal entry: the action belongs to the title block, not the page
   centre. Both themes share the title's reveal trigger and timing while
   keeping their own shape language. */
@media (min-width:761px) {
  body[data-preview="v110"] .hero-tools-entry {
    top:calc(45% + clamp(62px, 5.6vw, 88px));
    left:clamp(76px, 10.5vw, 178px);
    width:max-content !important;
    min-width:0 !important;
    max-width:calc(100% - 32px) !important;
    min-height:46px;
    margin:0;
    padding:12px 20px;
    gap:10px;
    justify-content:center;
    font-family:"Microsoft YaHei","PingFang SC",system-ui,sans-serif;
    font-size:16px;
    font-weight:700;
    line-height:1;
    letter-spacing:.02em;
    white-space:nowrap;
    transform:translateY(20px);
    transition:opacity .9s ease, transform .9s cubic-bezier(.2,.8,.2,1), visibility 0s linear .9s, box-shadow .2s ease, border-color .2s ease, background-color .2s ease;
  }
  body[data-preview="v110"].scene-title-ready .hero-tools-entry {
    transform:translateY(0);
  }
  body[data-preview="v110"] .hero-tools-entry > span {
    display:inline-block;
    font-size:16px;
    line-height:1;
    transition:transform .2s ease;
  }
  body[data-preview="v110"] .hero-tools-entry::before {
    content:none;
    display:none;
  }
  body[data-preview="v110"] .hero-tools-entry:hover > span,
  body[data-preview="v110"] .hero-tools-entry:focus-visible > span { transform:translateX(3px); }
  body[data-preview="v110"] .hero-tools-entry:focus-visible {
    outline:2px solid #8fd9ff;
    outline-offset:4px;
  }
  body[data-preview="v110"][data-theme="night"] .hero-tools-entry {
    clip-path:polygon(13% 0,87% 0,100% 28%,100% 72%,87% 100%,13% 100%,0 72%,0 28%);
    color:#eaf6ff;
    background:#102b52;
    border:1px solid rgba(112,181,232,.68);
    box-shadow:0 8px 22px rgba(3,12,35,.28), inset 0 0 0 1px rgba(123,216,255,.08);
  }
  body[data-preview="v110"][data-theme="night"] .hero-tools-entry:hover {
    background:#173c6c;
    border-color:rgba(143,217,255,.9);
    box-shadow:0 10px 26px rgba(3,12,35,.38), inset 0 0 0 1px rgba(143,217,255,.14);
  }
  body[data-preview="v110"][data-theme="day"] .hero-tools-entry {
    top:calc(49% + clamp(72px, 7.4vw, 116px));
    left:50%;
    color:#153d73;
    background:#f7fbff;
    border:1px solid #6d9ee4;
    border-radius:999px;
    box-shadow:0 7px 18px rgba(36,95,200,.16);
  }
  body[data-preview="v110"][data-theme="day"] .hero-tools-entry:hover {
    color:#0f3564;
    background:#fff;
    border-color:#3f7ed4;
    box-shadow:0 10px 24px rgba(36,95,200,.22);
  }
  body[data-preview="v110"][data-theme="day"].scene-title-ready .hero-tools-entry { transform:translate(-50%,0); }
  body[data-preview="v110"][data-theme="day"] .hero-tools-entry { transform:translate(-50%,20px); }
}

@media (max-width:760px) {
  body[data-preview="v110"] .hero-tools-entry {
    top:calc(73% + 58px);
    left:50%;
    width:max-content !important;
    max-width:calc(100% - 32px) !important;
    min-height:44px;
    padding:11px 18px;
    font-size:15px;
    transform:translate(-50%,20px);
  }
  body[data-preview="v110"].scene-title-ready .hero-tools-entry { transform:translate(-50%,0); }
  body[data-preview="v110"][data-theme="day"] .hero-tools-entry { top:calc(49% + 126px); }
  body[data-preview="v110"][data-theme="day"].scene-title-ready .hero-tools-entry { transform:translate(-50%,0); }
}

@media (min-width:1024px) {
  /* Attendance: explicit rows prevent headings/counts/actions from colliding. */
  body[data-tool=attendance-data] .attendance-page { width:min(1600px,calc(100% - 64px)); }
  body[data-tool=attendance-data] .attendance-layout { grid-template-columns:minmax(0,1fr) 300px; gap:28px; }
  body[data-tool=attendance-data] .generator-panel { padding:28px; }
  body[data-tool=attendance-data] .selector-block { padding-top:0; }
  body[data-tool=attendance-data] .selector-block legend { position:static; display:flex; align-items:center; min-height:48px; padding:0 16px; border-bottom:1px solid var(--ui-line); font-size:15px; }
  body[data-tool=attendance-data] .selector-heading { position:static; display:block; padding:10px 16px 0; color:var(--ui-muted); font-size:13px; }
  body[data-tool=attendance-data] .column-toolbar,
  body[data-tool=attendance-data] .selector-toolbar { display:flex; align-items:center; justify-content:space-between; gap:18px; min-height:52px; padding:10px 16px 12px; }
  body[data-tool=attendance-data] .column-toolbar p { flex:1; min-width:0; line-height:1.45; }
  body[data-tool=attendance-data] .toolbar-actions { display:flex; flex:0 0 auto; gap:8px; }
  body[data-tool=attendance-data] .toolbar-actions button { min-width:64px; white-space:nowrap; }
  body[data-tool=attendance-data] .column-grid { grid-template-columns:repeat(7,minmax(100px,1fr)); }
  body[data-tool=attendance-data] .province-grid { grid-template-columns:repeat(4,minmax(150px,1fr)); }
  body[data-tool=attendance-data] .option-columns { grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
  body[data-tool=attendance-data] .generator-actions { justify-content:flex-start; align-items:center; gap:10px; }
  body[data-tool=attendance-data] .generator-actions button { min-width:112px; }

  /* Bank: use the desktop canvas without the legacy fixed empty height. */
  body[data-tool=bank] main { width:min(1600px,calc(100% - 64px)); padding:32px 0 56px; }
  body[data-tool=bank] .page-toolbar { align-items:center; margin-bottom:22px; }
  body[data-tool=bank] .intro h1 { font-size:24px; line-height:1.35; }
  body[data-tool=bank] .mode-tabs { min-width:300px; }
  body[data-tool=bank] .workspace { grid-template-columns:minmax(420px,.95fr) minmax(0,1.45fr); min-height:0; gap:0; border:1px solid var(--ui-line); box-shadow:none; }
  body[data-tool=bank] .query-panel, body[data-tool=bank] .results-panel { padding:28px 32px; }
  body[data-tool=bank] .query-panel { border-right:1px solid var(--ui-line); }
  body[data-tool=bank] .section-heading { margin-bottom:20px; }
  body[data-tool=bank] .section-heading h2 { font-size:16px; }
  body[data-tool=bank] form { gap:16px 18px; }
  body[data-tool=bank] .form-actions { margin-top:8px; }
  body[data-tool=bank] .primary-button, body[data-tool=bank] .secondary-button { min-height:38px; padding:8px 16px; border-radius:6px; font:600 14px/1.35 var(--ui-font); }
  body[data-tool=bank] .primary-button { background:var(--ui-accent); border-color:var(--ui-accent); }
  body[data-tool=bank] .secondary-button { background:#fff; border-color:var(--ui-line); }
  body[data-tool=bank] .empty-state, body[data-tool=bank] .loading-state { min-height:260px; }
  body[data-tool=bank] .batch-workspace { grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:24px; }
  body[data-tool=bank] .batch-input-panel, body[data-tool=bank] .batch-results-panel { padding:28px 32px; border-radius:6px; box-shadow:none; }
}
