/* Scientific plotting catalog: Hiplot-style workflow, Hemu visual system. */
body[data-studio="plotting"] {
  --pc-bg: #f5f6f2;
  --pc-surface: #fff;
  --pc-surface-2: #f8faf7;
  --pc-ink: #172b22;
  --pc-muted: #607068;
  --pc-faint: #87938d;
  --pc-line: #d8dfd7;
  --pc-line-strong: #c5d0c4;
  --pc-brand: #4f7b48;
  --pc-brand-2: #244f32;
  --pc-soft: #eaf1e6;
  --pc-accent: #b3cf87;
  --pc-width: 1320px;
  color: var(--pc-ink);
  background: var(--pc-bg);
}

html[data-theme="dark"] body[data-studio="plotting"] {
  --pc-bg: #0f1712;
  --pc-surface: #17231b;
  --pc-surface-2: #1d2a21;
  --pc-ink: #f1f5ef;
  --pc-muted: #b2beb7;
  --pc-faint: #89978f;
  --pc-line: #314139;
  --pc-line-strong: #43564c;
  --pc-brand: #9ac476;
  --pc-brand-2: #b6d48e;
  --pc-soft: #263a2c;
  --pc-accent: #a8c878;
}

.plotcat-page { overflow: clip; min-height: 100vh; padding-bottom: 30px; background: var(--pc-bg); }
.plotcat-banner { width: 100%; height: clamp(190px, 19vw, 270px); margin: 0; overflow: hidden; background: #0d1813; }
.plotcat-banner img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 47%; }

.plotcat-heading,
.plotcat-shell,
.plotcat-status { width: min(calc(100% - clamp(48px, 7vw, 104px)), var(--pc-width)); margin-inline: auto; }

.plotcat-heading { display: grid; grid-template-columns: minmax(420px, .9fr) minmax(480px, 1.1fr); align-items: center; gap: 52px; padding: 30px 0 24px; }
.plotcat-title-block { display: flex; min-width: 0; align-items: center; gap: 22px; }
.plotcat-title-icon { display: grid; width: 76px; height: 76px; flex: 0 0 auto; border: 1px solid var(--pc-line); border-radius: 20px; background: var(--pc-soft); place-items: center; }
.plotcat-title-icon img { width: 39px; height: 39px; opacity: .85; }
.plotcat-title-block h1 { margin: 0; color: var(--pc-ink); font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif; font-size: clamp(38px, 3.2vw, 50px); font-weight: 780; line-height: 1.1; letter-spacing: -.035em; }
.plotcat-title-block p { max-width: 620px; margin: 9px 0 0; color: var(--pc-muted); font-size: 16px; line-height: 1.7; }

.plotcat-search { display: grid; grid-template-columns: 28px minmax(0, 1fr) 96px; min-height: 62px; border: 1px solid var(--pc-line-strong); border-radius: 13px; align-items: center; overflow: hidden; background: var(--pc-surface); box-shadow: 0 12px 34px rgba(27, 53, 37, .07); }
.plotcat-search:focus-within { border-color: var(--pc-brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--pc-brand) 15%, transparent), 0 14px 38px rgba(27, 53, 37, .09); }
.plotcat-search > .ui-icon { margin-left: 18px; color: var(--pc-muted); }
.plotcat-search input { width: 100%; min-width: 0; height: 60px; border: 0; outline: 0; padding: 0 18px 0 14px; color: var(--pc-ink); background: transparent; font: inherit; font-size: 16px; }
.plotcat-search input::placeholder { color: var(--pc-faint); }
.plotcat-search button { align-self: stretch; border: 8px solid var(--pc-surface); border-radius: 14px; color: #fff; background: var(--pc-brand-2); font-size: 15px; font-weight: 780; cursor: pointer; }

.plotcat-shell { display: grid; grid-template-columns: 246px minmax(0, 1fr); height: min(860px, calc(100vh - 116px)); min-height: 720px; border: 1px solid var(--pc-line); border-radius: 16px; overflow: hidden; background: var(--pc-surface); box-shadow: 0 20px 58px rgba(25, 49, 35, .08); }
.plotcat-map { min-height: 0; overflow: hidden; border-right: 1px solid var(--pc-line); padding: 18px 0 14px; background: var(--pc-surface-2); }
.plotcat-map-head { display: grid; grid-template-columns: 48px minmax(0,1fr); padding: 0 18px 17px; align-items: center; gap: 12px; }
.plotcat-map-head > span { display: grid; width: 48px; height: 48px; border-radius: 13px; color: var(--pc-brand-2); background: var(--pc-soft); font-size: 16px; font-weight: 820; place-items: center; }
.plotcat-map h2 { margin: 0; color: var(--pc-ink); font-size: 18px; font-weight: 800; }
.plotcat-map-head p { margin: 3px 0 0; color: var(--pc-faint); font-size: 12px; }
.plotcat-map h3 { margin: 17px 18px 8px; color: var(--pc-faint); font-size: 12px; font-weight: 760; letter-spacing: .08em; }
.plotcat-view-stack { display: grid; gap: 4px; border-top: 1px solid var(--pc-line); border-bottom: 1px solid var(--pc-line); padding: 10px 9px; }
.plotcat-view-stack button { display: grid; grid-template-columns: minmax(0,1fr) auto; min-height: 45px; border: 0; border-radius: 9px; padding: 7px 11px; align-items: center; gap: 7px; color: var(--pc-muted); background: transparent; text-align: left; cursor: pointer; }
.plotcat-view-stack button strong { font-size: 14px; font-weight: 700; }
.plotcat-view-stack button span { color: var(--pc-faint); font-size: 11px; }
.plotcat-view-stack button[aria-pressed="true"] { color: var(--pc-ink); background: var(--pc-soft); }
.plotcat-view-stack button[aria-pressed="true"] strong { font-weight: 820; }
.plotcat-map nav { height: calc(100% - 280px); overflow-y: auto; padding: 0 9px 10px; scrollbar-width: thin; scrollbar-color: var(--pc-line-strong) transparent; }
.plotcat-map nav button { position: relative; display: grid; grid-template-columns: 28px minmax(0,1fr) auto; width: 100%; min-height: 48px; border: 0; border-radius: 9px; padding: 7px 10px; align-items: center; gap: 8px; color: var(--pc-muted); background: transparent; text-align: left; cursor: pointer; }
.plotcat-map nav button:hover { color: var(--pc-ink); background: color-mix(in srgb, var(--pc-soft) 62%, transparent); }
.plotcat-map nav button[aria-pressed="true"] { color: var(--pc-ink); background: var(--pc-soft); font-weight: 780; }
.plotcat-map nav img { width: 21px; height: 21px; object-fit: contain; opacity: .8; }
.plotcat-map nav span { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.plotcat-category-count { color: var(--pc-faint); font-size: 11px !important; font-variant-numeric: tabular-nums; }

.plotcat-results { display: flex; min-width: 0; min-height: 0; overflow: hidden; flex-direction: column; background: var(--pc-surface); }
.plotcat-toolbar { display: flex; min-height: 64px; border-bottom: 1px solid var(--pc-line); padding: 0 20px; align-items: center; justify-content: space-between; gap: 18px; }
.plotcat-toolbar > div:first-child { display: flex; align-items: baseline; gap: 12px; }
.plotcat-toolbar > div:first-child strong { color: var(--pc-ink); font-size: 18px; font-weight: 820; }
.plotcat-toolbar > div:first-child span { color: var(--pc-faint); font-size: 13px; }
.plotcat-toolbar-meta { display: flex; align-items: center; gap: 9px; color: var(--pc-faint); font-size: 12px; white-space: nowrap; }
.plotcat-self-check { display: inline-flex; min-height: 30px; border-radius: 999px; padding: 0 11px; align-items: center; color: #2f6b3f; background: #edf6eb; font-weight: 760; white-space: nowrap; }
.plotcat-self-check[data-state="passed"]::before { width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; background: #58a268; content: ""; box-shadow: 0 0 0 4px rgba(88,162,104,.12); }
.plotcat-self-check[data-state="failed"] { color: #9b3f35; background: #fbe9e6; }
html[data-theme="dark"] .plotcat-self-check { color: #c8e2bc; background: #24392a; }
.plotcat-toolbar-meta strong { color: var(--pc-muted); }
.plotcat-toolbar-meta select { height: 38px; border: 1px solid var(--pc-line); border-radius: 8px; padding: 0 30px 0 11px; color: var(--pc-muted); background: var(--pc-surface-2); font: inherit; font-size: 12px; }
.plotcat-toolbar-meta button { min-width: 48px; height: 38px; border: 1px solid var(--pc-line); border-radius: 8px; padding: 0 10px; color: var(--pc-muted); background: var(--pc-surface); font-size: 12px; cursor: pointer; }
.plotcat-toolbar-meta button.is-active { border-color: var(--pc-brand); color: var(--pc-brand-2); background: var(--pc-soft); font-weight: 750; }

.plotcat-detail { display: grid; grid-template-columns: 210px minmax(0,1fr) 170px; min-height: 188px; border-bottom: 1px solid var(--pc-line); padding: 18px 20px; align-items: stretch; gap: 22px; background: var(--pc-surface-2); }
#plotDetailCanvas { display: block; width: 210px; height: 142px; align-self: center; border: 1px solid var(--pc-line); border-radius: 10px; background: #fff; }
.plotcat-detail-copy { min-width: 0; }
.plotcat-detail-copy > span { color: var(--pc-brand); font-size: 12px; font-weight: 780; letter-spacing: .08em; }
.plotcat-detail-copy header { display: flex; margin-top: 4px; align-items: center; gap: 10px; }
.plotcat-detail h2 { margin: 0; color: var(--pc-ink); font-size: 27px; font-weight: 820; }
.plotcat-detail-copy header button { border: 0; border-radius: 6px; padding: 5px 8px; color: #9a6b0c; background: #fff4d6; font-size: 11px; font-weight: 760; cursor: pointer; }
.plotcat-detail-copy > p { margin: 7px 0 12px; color: var(--pc-muted); font-size: 13px; line-height: 1.65; }
.plotcat-detail dl { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin: 0; }
.plotcat-detail dl div { min-width: 0; border-left: 2px solid var(--pc-line); padding-left: 10px; }
.plotcat-detail dt { display: flex; align-items: center; gap: 6px; color: var(--pc-faint); font-size: 11px; }
.plotcat-detail dt img { width: 15px; height: 15px; opacity: .72; }
.plotcat-detail dd { overflow: hidden; margin: 4px 0 0; color: var(--pc-ink); font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.plotcat-detail-actions { display: flex; min-width: 0; flex-direction: column; justify-content: center; gap: 8px; }
.plotcat-detail-actions > p { margin: 0 0 2px; color: var(--pc-faint); font-size: 12px; text-align: center; }
.plotcat-detail-actions button { min-height: 42px; border-radius: 9px; font-size: 13px; font-weight: 780; cursor: pointer; }
.plotcat-use { border: 0; color: #fff; background: var(--pc-brand-2); }
.plotcat-save { border: 1px solid var(--pc-line-strong); color: var(--pc-brand-2); background: var(--pc-surface); }
.plotcat-detail-actions small { display: flex; align-items: center; justify-content: center; gap: 5px; color: var(--pc-faint); font-size: 10px; }
.plotcat-detail-actions small img { width: 13px; height: 13px; }

.plotcat-list-head { display: flex; min-height: 44px; border-bottom: 1px solid var(--pc-line); padding: 0 20px; align-items: center; justify-content: space-between; }
.plotcat-list-head strong { color: var(--pc-ink); font-size: 14px; }
.plotcat-list-head button { border: 0; color: var(--pc-brand); background: transparent; font-size: 12px; cursor: pointer; }
.plotcat-tool-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 14px 16px 18px; scrollbar-width: thin; scrollbar-color: var(--pc-line-strong) transparent; }
.plotcat-tool-list.is-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-content: start; gap: 14px; }
.plotcat-tool-row { position: relative; display: grid; grid-template-columns: 154px minmax(0,1fr) auto 36px; min-height: 116px; border: 1px solid var(--pc-line); border-radius: 12px; padding: 10px; align-items: center; gap: 14px; color: var(--pc-ink); background: var(--pc-surface); cursor: pointer; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.plotcat-tool-row:hover { border-color: var(--pc-line-strong); box-shadow: 0 10px 25px rgba(25,51,35,.09); transform: translateY(-1px); }
.plotcat-tool-row[aria-selected="true"] { border-color: var(--pc-brand); background: var(--pc-soft); }
.plotcat-thumb { display: block; width: 154px; height: 92px; border: 1px solid var(--pc-line); border-radius: 8px; background: #fff; }
.plotcat-tool-copy { min-width: 0; }
.plotcat-tool-copy strong { display: block; overflow: hidden; color: var(--pc-ink); font-size: 18px; font-weight: 800; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.plotcat-tool-copy p { display: -webkit-box; overflow: hidden; min-height: 40px; margin: 7px 0 0; color: var(--pc-muted); font-size: 13px; line-height: 1.55; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.plotcat-badge { border: 1px solid color-mix(in srgb, var(--badge) 45%, var(--pc-line)); border-radius: 7px; padding: 6px 9px; color: var(--badge); background: color-mix(in srgb, var(--badge) 7%, var(--pc-surface)); font-size: 11px; white-space: nowrap; }
.plotcat-favorite { width: 36px; height: 36px; border: 0; border-radius: 50%; color: var(--pc-faint); background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; }
.plotcat-favorite:hover,
.plotcat-favorite[aria-pressed="true"] { color: #9b6b09; background: #fff2ca; }
.plotcat-card-meta,
.plotcat-card-action { display: none; }

.plotcat-tool-list.is-grid .plotcat-tool-row { display: flex; min-width: 0; min-height: 388px; padding: 12px; flex-direction: column; align-items: stretch; gap: 10px; }
.plotcat-tool-list.is-grid .plotcat-thumb { width: 100%; height: 154px; flex: 0 0 auto; }
.plotcat-tool-list.is-grid .plotcat-tool-copy strong { font-size: 18px; }
.plotcat-tool-list.is-grid .plotcat-tool-copy p { min-height: 40px; }
.plotcat-tool-list.is-grid .plotcat-badge { align-self: flex-start; }
.plotcat-tool-list.is-grid .plotcat-favorite { position: absolute; top: 15px; right: 15px; border: 1px solid var(--pc-line); background: color-mix(in srgb,var(--pc-surface) 92%,transparent); }
.plotcat-tool-list.is-grid .plotcat-card-meta { display: flex; margin-top: auto; align-items: center; justify-content: space-between; color: var(--pc-faint); font-size: 11px; }
.plotcat-tool-list.is-grid .plotcat-card-action { display: block; min-height: 38px; border: 1px solid var(--pc-line-strong); border-radius: 8px; color: var(--pc-brand-2); background: var(--pc-surface); font-size: 12px; font-weight: 780; cursor: pointer; }
.plotcat-tool-list.is-grid .plotcat-card-action:hover { border-color: var(--pc-brand); color: #fff; background: var(--pc-brand-2); }
.plotcat-empty { grid-column: 1/-1; margin: 50px auto; color: var(--pc-muted); font-size: 15px; }
.plotcat-status { margin-top: 12px; color: var(--pc-faint); font-size: 12px; }

/* Full plotting workbench. The backdrop deliberately has no close action. */
.plotrun-layer[hidden],
.plotrun-body[hidden],
.plotrun-info[hidden],
.plotrun-loading[hidden] { display: none !important; }
.plotrun-layer { position: fixed; z-index: 2100; inset: 0; display: grid; padding: 16px; isolation: isolate; pointer-events: auto; place-items: center; }
.plotrun-backdrop { position: absolute; z-index: 0; inset: 0; background: rgba(10,19,14,.68); backdrop-filter: blur(12px); pointer-events: auto; }
.plotrun-dialog { position: relative; z-index: 1; display: flex; width: min(1680px, calc(100vw - 32px)); height: min(940px, calc(100vh - 32px)); border: 1px solid var(--pc-line-strong); border-radius: 18px; flex-direction: column; overflow: hidden; color: var(--pc-ink); background: var(--pc-surface); box-shadow: 0 34px 96px rgba(0,0,0,.32); animation: plotrun-in .24s ease both; }
@keyframes plotrun-in { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.plotrun-head { display: grid; min-height: 88px; border-bottom: 1px solid var(--pc-line); padding: 11px 18px 10px 22px; flex: 0 0 88px; grid-template-columns: minmax(280px,1fr) auto 46px; align-items: center; gap: 20px; background: var(--pc-surface); }
.plotrun-head > div:first-child { min-width: 0; }
.plotrun-head > div:first-child > span { color: var(--pc-brand); font-size: 11px; font-weight: 820; letter-spacing: .12em; }
.plotrun-head h2 { overflow: hidden; margin: 3px 0 0; color: var(--pc-ink); font-size: 24px; font-weight: 820; line-height: 1.18; text-overflow: ellipsis; white-space: nowrap; }
.plotrun-head p { overflow: hidden; margin: 3px 0 0; color: var(--pc-faint); font-size: 12px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.plotrun-mode-tabs { display: flex; align-items: center; gap: 5px; }
.plotrun-mode-tabs button { min-height: 38px; border: 1px solid transparent; border-radius: 8px; padding: 0 14px; color: var(--pc-muted); background: transparent; font-size: 13px; font-weight: 700; cursor: pointer; }
.plotrun-mode-tabs button[aria-pressed="true"] { border-color: var(--pc-line); color: var(--pc-brand-2); background: var(--pc-soft); }
.plotrun-close { display: grid; width: 42px; height: 42px; border: 1px solid var(--pc-line); border-radius: 50%; color: var(--pc-ink); background: var(--pc-surface); cursor: pointer; place-items: center; }
.plotrun-close:hover { border-color: var(--pc-brand); background: var(--pc-soft); }
.plotrun-body { display: grid; min-height: 0; flex: 1 1 0; grid-template-columns: minmax(0,1fr) clamp(420px,28vw,480px); grid-template-areas: "stage controls"; }
.plotrun-data { grid-area: controls; display: flex; min-width: 0; min-height: 0; border-left: 1px solid var(--pc-line); flex-direction: column; background: var(--pc-surface); }
.plotrun-stage { grid-area: stage; display: flex; min-width: 0; min-height: 0; flex-direction: column; background: var(--pc-surface-2); }
.plotrun-section-head { display: flex; min-height: 56px; border-bottom: 1px solid var(--pc-line); padding: 0 16px; flex: 0 0 56px; align-items: center; gap: 11px; }
.plotrun-section-head > span { display: grid; width: 34px; height: 34px; border-radius: 10px; color: var(--pc-brand-2); background: var(--pc-soft); font-size: 13px; font-weight: 850; place-items: center; }
.plotrun-section-head > div { display: grid; gap: 2px; min-width: 0; }
.plotrun-section-head h3 { margin: 0; color: var(--pc-ink); font-size: 17px; font-weight: 800; }
.plotrun-section-head small { color: var(--pc-faint); font-size: 10px; }
.plotrun-section-head button { margin-left: auto; border: 0; color: var(--pc-brand); background: transparent; font-size: 12px; cursor: pointer; }
.plotwb-control-tabs { position: relative; z-index: 2; display: grid; min-height: 44px; border-bottom: 1px solid var(--pc-line); padding: 0 10px; flex: 0 0 44px; grid-template-columns: repeat(5,1fr); background: var(--pc-surface); }
.plotwb-control-tabs button { position: relative; border: 0; color: var(--pc-faint); background: transparent; font-size: 12px; font-weight: 740; cursor: pointer; transition: color .16s ease, background-color .16s ease; }
.plotwb-control-tabs button::after { position: absolute; right: 10px; bottom: -1px; left: 10px; height: 2px; border-radius: 2px 2px 0 0; background: var(--pc-brand); content: ""; opacity: 0; transform: scaleX(.45); transition: opacity .16s ease, transform .2s ease; }
.plotwb-control-tabs button:hover { color: var(--pc-ink); }
.plotwb-control-tabs button[aria-selected="true"] { color: var(--pc-brand-2); background: color-mix(in srgb,var(--pc-soft) 55%,transparent); }
.plotwb-control-tabs button[aria-selected="true"]::after { opacity: 1; transform: scaleX(1); }
.plotrun-scroll { min-height: 0; overflow-y: scroll; padding: 0 16px 16px; flex: 1 1 0; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: var(--pc-line-strong) transparent; }
.plotwb-control-panel { animation: plotwb-panel-in .12s ease-out both; }
.plotwb-control-panel[hidden] { display: none !important; }
@keyframes plotwb-panel-in { from { opacity: .45; } }
.plotwb-setting-section { border-bottom: 1px solid var(--pc-line); padding: 16px 0; }
.plotwb-section-title { display: flex; margin-bottom: 11px; align-items: center; justify-content: space-between; gap: 12px; }
.plotwb-section-title h4 { margin: 0; color: var(--pc-ink); font-size: 14px; font-weight: 780; }
.plotwb-section-title span { color: var(--pc-faint); font-size: 11px; }
.plotwb-section-title span.is-ready { color: #35845a; }
.plotwb-tabs { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin-bottom: 12px; }
.plotwb-tabs button { min-height: 36px; border: 1px solid var(--pc-line); border-radius: 8px; color: var(--pc-muted); background: var(--pc-surface-2); font-size: 12px; cursor: pointer; }
.plotwb-tabs button[aria-selected="true"] { border-color: var(--pc-brand); color: var(--pc-brand-2); background: var(--pc-soft); font-weight: 780; }
.plotwb-dropzone { display: grid; min-height: 76px; border: 1px dashed var(--pc-line-strong); border-radius: 10px; padding: 11px 13px; grid-template-columns: 32px minmax(0,1fr); grid-template-rows: auto auto; align-content: center; align-items: center; column-gap: 11px; text-align: left; cursor: pointer; }
.plotwb-dropzone:hover,
.plotwb-dropzone.is-dragging { border-color: var(--pc-brand); background: var(--pc-soft); }
.plotwb-dropzone img { grid-row: 1 / 3; width: 28px; height: 28px; opacity: .78; }
.plotwb-dropzone strong { color: var(--pc-ink); font-size: 13px; }
.plotwb-dropzone small { margin-top: 2px; color: var(--pc-faint); font-size: 10px; }
.plotwb-file-chip { display: grid; grid-template-columns: minmax(0,1fr) auto 18px; margin-top: 9px; border: 1px solid var(--pc-line); border-radius: 8px; padding: 9px 10px; align-items: center; gap: 8px; }
.plotwb-file-chip span { overflow: hidden; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.plotwb-file-chip small { color: var(--pc-faint); font-size: 10px; white-space: nowrap; }
.plotwb-file-chip img { width: 17px; height: 17px; }
#plotData { display: block; width: 100%; min-height: 142px; resize: vertical; border: 1px solid var(--pc-line-strong); border-radius: 8px; padding: 10px; color: var(--pc-ink); background: var(--pc-surface-2); font: 12px/1.55 ui-monospace, monospace; }
.plotrun-secondary { min-height: 36px; border: 1px solid var(--pc-line-strong); border-radius: 7px; margin-top: 8px; padding: 0 13px; color: var(--pc-ink); background: var(--pc-surface); font-size: 12px; font-weight: 720; cursor: pointer; }
.plotwb-data-table-wrap { max-height: 132px; overflow: auto; border: 1px solid var(--pc-line); border-radius: 8px; scrollbar-width: thin; }
.plotwb-data-table-wrap table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 11px; font-variant-numeric: tabular-nums; }
.plotwb-data-table-wrap th,
.plotwb-data-table-wrap td { border-right: 1px solid var(--pc-line); border-bottom: 1px solid var(--pc-line); padding: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plotwb-data-table-wrap th { position: sticky; top: 0; color: var(--pc-muted); background: var(--pc-surface-2); }
.plotwb-palette-row { display: flex; gap: 8px; margin-bottom: 13px; }
.plotwb-palette-row button { width: 60px; height: 24px; border: 2px solid transparent; border-radius: 6px; padding: 2px; background-clip: content-box; cursor: pointer; }
.plotwb-palette-row button:nth-child(1) { background-image: linear-gradient(90deg,#29488d,#eef0f2,#cf2e3c); }
.plotwb-palette-row button:nth-child(2) { background-image: linear-gradient(90deg,#3b4cc0,#3fbc73,#f9dc46); }
.plotwb-palette-row button:nth-child(3) { background-image: linear-gradient(90deg,#eef6e8,#83b67c,#1e5735); }
.plotwb-palette-row button:nth-child(4) { background-image: linear-gradient(90deg,#5d3c99,#e86658,#f7c65a); }
.plotwb-palette-row button.is-active { border-color: var(--pc-brand); }
.plotwb-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 10px; }
.plotwb-form-grid label { display: grid; gap: 6px; min-width: 0; }
.plotwb-form-grid label > span { color: var(--pc-muted); font-size: 12px; font-weight: 760; }
.plotwb-form-grid select,
.plotwb-form-grid input[type="number"],
.plotwb-form-grid input[type="text"] { min-width: 0; width: 100%; height: 38px; border: 1px solid var(--pc-line-strong); border-radius: 7px; padding: 0 10px; color: var(--pc-ink); background: var(--pc-surface-2); font: inherit; font-size: 12px; }
.plotwb-form-grid select { padding-right: 26px; }
.plotwb-form-grid input[type="color"] { width: 100%; height: 38px; border: 1px solid var(--pc-line-strong); border-radius: 7px; padding: 4px; background: var(--pc-surface-2); cursor: pointer; }
.plotwb-range-field { grid-column: 1 / -1; }
.plotwb-range-control { display: grid; grid-template-columns: minmax(0,1fr) 82px; align-items: center; gap: 10px; }
.plotwb-range-control input[type="range"] { width: 100%; accent-color: var(--pc-brand); }
.plotwb-toggle-field { display: flex !important; min-height: 42px; border: 1px solid var(--pc-line); border-radius: 8px; padding: 0 10px; align-items: center; justify-content: space-between; background: var(--pc-surface-2); }
.plotwb-toggle-field input { width: 34px; height: 18px; accent-color: var(--pc-brand); }
.plotwb-radio-field { grid-column: 1 / -1; }
.plotwb-radio-options { display: flex; flex-wrap: wrap; gap: 7px; }
.plotwb-radio-options label { display: flex; min-height: 34px; border: 1px solid var(--pc-line); border-radius: 7px; padding: 0 9px; flex-direction: row; align-items: center; gap: 5px; background: var(--pc-surface-2); }
.plotwb-radio-options input { accent-color: var(--pc-brand); }
.plotwb-param-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.plotwb-param-actions button { min-height: 34px; border: 1px solid var(--pc-line); border-radius: 7px; padding: 0 11px; color: var(--pc-muted); background: var(--pc-surface); font-size: 11px; font-weight: 720; cursor: pointer; }
.plotwb-param-actions button:hover { border-color: var(--pc-brand); color: var(--pc-brand-2); background: var(--pc-soft); }
.plotwb-task-name { display: grid; gap: 7px; }
.plotwb-task-name > span { color: var(--pc-muted); font-size: 12px; font-weight: 760; }
.plotwb-task-name input { width: 100%; height: 40px; border: 1px solid var(--pc-line-strong); border-radius: 8px; padding: 0 11px; color: var(--pc-ink); background: var(--pc-surface-2); font: inherit; font-size: 12px; }
.plotwb-task-actions { display: grid; grid-template-columns: repeat(3,1fr); }
.plotwb-task-actions button { padding: 0 6px; }
.plotwb-checks { display: flex; flex-wrap: wrap; gap: 9px 15px; margin-top: 12px; }
.plotwb-checks label { display: flex; align-items: center; gap: 6px; color: var(--pc-muted); font-size: 11px; }
.plotwb-checks input { accent-color: var(--pc-brand); }
.plotrun-submit { min-height: 82px; border-top: 1px solid var(--pc-line); padding: 8px 16px 9px; flex: 0 0 82px; background: var(--pc-surface); box-shadow: 0 -10px 24px color-mix(in srgb,var(--pc-surface) 78%,transparent); }
.plotrun-auto { display: flex; min-height: 25px; align-items: center; justify-content: space-between; gap: 12px; }
.plotrun-auto label { display: inline-flex; align-items: center; gap: 6px; color: var(--pc-muted); font-size: 11px; cursor: pointer; }
.plotrun-auto input { accent-color: var(--pc-brand); }
.plotrun-auto > span { display: inline-flex; align-items: center; gap: 6px; color: var(--pc-faint); font-size: 10px; }
.plotrun-auto > span i { width: 7px; height: 7px; border-radius: 50%; background: #52a06a; box-shadow: 0 0 0 4px color-mix(in srgb,#52a06a 14%,transparent); }
.plotrun-auto > span[data-state="dirty"] i { background: #d38b43; box-shadow: 0 0 0 4px color-mix(in srgb,#d38b43 14%,transparent); }
.plotrun-auto > span[data-state="rendering"] i { background: var(--pc-brand); animation: plotrun-pulse .8s ease infinite alternate; }
.plotrun-auto > span[data-state="error"] i { background: #c9453d; box-shadow: 0 0 0 4px color-mix(in srgb,#c9453d 14%,transparent); }
@keyframes plotrun-pulse { to { opacity: .35; transform: scale(.7); } }
.plotrun-submit button { width: 100%; min-height: 44px; border: 0; border-radius: 8px; color: #fff; background: var(--pc-brand-2); font-size: 14px; font-weight: 780; cursor: pointer; }
.plotrun-submit p { min-height: 16px; margin: 6px 0 0; color: var(--pc-muted); font-size: 11px; text-align: center; }
.plotrun-submit p[data-status="success"] { color: #2f8758; }
.plotrun-submit p[data-status="error"] { color: #c9453d; }

.plotrun-stagebar { display: flex; min-height: 54px; border-bottom: 1px solid var(--pc-line); padding: 7px 16px; flex: 0 0 54px; align-items: center; justify-content: space-between; gap: 16px; background: var(--pc-surface); }
.plotrun-stagebar > div:first-child { display: grid; gap: 3px; min-width: 0; }
.plotrun-stagebar strong { font-size: 15px; }
.plotrun-stagebar span { overflow: hidden; color: var(--pc-faint); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.plotrun-stagebar > div:last-child { display: flex; align-items: center; gap: 6px; }
.plotrun-stagebar button { min-width: 46px; height: 34px; border: 1px solid var(--pc-line); border-radius: 7px; padding: 0 9px; color: var(--pc-muted); background: var(--pc-surface); font-size: 11px; white-space: nowrap; cursor: pointer; }
.plotrun-stagebar button:hover { border-color: var(--pc-brand); color: var(--pc-brand-2); background: var(--pc-soft); }
.plotrun-stagebar i { width: 1px; height: 24px; margin: 0 4px; background: var(--pc-line); }
.plot-font-control {
  display: inline-flex;
  height: 34px;
  border: 1px solid var(--pc-line);
  border-radius: 7px;
  align-items: center;
  overflow: hidden;
  background: var(--pc-surface-2);
}
.plot-font-control > span { padding: 0 8px; color: var(--pc-faint); font-size: 10px; font-weight: 740; }
.plotrun-stagebar .plot-font-control button {
  min-width: 29px;
  height: 32px;
  border: 0;
  border-left: 1px solid var(--pc-line);
  border-radius: 0;
  padding: 0 5px;
}
.plotrun-stagebar .plot-font-control button[aria-pressed="true"] { color: #fff; background: var(--pc-brand-2); }
.plotrun-stagebar .plot-font-control button:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--pc-brand); outline-offset: -3px; }
.plotwb-canvas-viewport { position: relative; display: grid; min-height: 0; flex: 1 1 0; overflow: auto; padding: 12px; background: #eef2ee; place-items: center; scrollbar-width: thin; }
html[data-theme="dark"] .plotwb-canvas-viewport { background: #111a14; }
#plotCanvas { position: absolute; display: block; width: calc(100% - 24px); height: calc(100% - 24px); inset: 12px; transform: scale(var(--plot-zoom,1)); transform-origin: center; border: 0; background: transparent; object-fit: contain; transition: transform .18s ease; }
.plotrun-loading { position: absolute; z-index: 2; inset: 12px; display: grid; align-content: center; justify-items: center; border: 1px solid var(--pc-line); border-radius: 10px; color: var(--pc-ink); background: color-mix(in srgb,var(--pc-surface) 94%,transparent); text-align: center; }
.plotrun-loading img { width: 34px; height: 34px; margin-bottom: 10px; animation: plotrun-spin .8s linear infinite; }
.plotrun-loading strong { font-size: 15px; }
.plotrun-loading small { margin-top: 5px; color: var(--pc-faint); font-size: 11px; }
@keyframes plotrun-spin { to { transform: rotate(360deg); } }
.plotwb-stage-summary { min-height: 78px; border-top: 1px solid var(--pc-line); padding: 10px 16px; flex: 0 0 78px; background: var(--pc-surface); }
.plotwb-stage-summary dl { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 0; }
.plotwb-stage-summary dl > div { display: grid; grid-template-columns: 76px repeat(3,minmax(0,1fr)); align-items: center; gap: 6px 12px; }
.plotwb-stage-summary dt { font-size: 12px; font-weight: 800; }
.plotwb-stage-summary dd { display: flex; margin: 0; flex-direction: column; gap: 3px; }
.plotwb-stage-summary dd span { color: var(--pc-faint); font-size: 9px; }
.plotwb-stage-summary dd strong { overflow: hidden; color: var(--pc-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.plotrun-info { flex: 1 1 auto; overflow-y: auto; padding: 42px clamp(34px,6vw,90px); }
.plotrun-info > header { max-width: 760px; }
.plotrun-info > header span { color: var(--pc-brand); font-size: 12px; font-weight: 820; letter-spacing: .12em; }
.plotrun-info h3 { margin: 8px 0 10px; font-size: clamp(30px,4vw,48px); font-weight: 820; }
.plotrun-info header p { color: var(--pc-muted); font-size: 15px; }
.plotrun-info ol { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin: 34px 0 0; padding: 0; list-style: none; counter-reset: guide; }
.plotrun-info ol li { min-height: 190px; border: 1px solid var(--pc-line); border-radius: 12px; padding: 22px; counter-increment: guide; }
.plotrun-info ol li::before { display: block; margin-bottom: 30px; color: var(--pc-brand); content: "0" counter(guide); font-size: 13px; font-weight: 820; }
.plotrun-info ol strong { display: block; font-size: 18px; }
.plotrun-info ol span { display: block; margin-top: 9px; color: var(--pc-muted); font-size: 13px; line-height: 1.7; }
.plotrun-log ul { max-width: 900px; margin: 32px 0 0; padding: 0; list-style: none; }
.plotrun-log li { display: grid; grid-template-columns: 90px minmax(0,1fr); border-bottom: 1px solid var(--pc-line); padding: 16px 0; gap: 18px; }
.plotrun-log time { color: var(--pc-faint); font-size: 12px; }
.plotrun-log li span { color: var(--pc-ink); font-size: 14px; }
body.plotrun-open { overflow: hidden; }

@media (max-width: 1180px) {
  .plotcat-heading { grid-template-columns: 1fr; gap: 18px; }
  .plotcat-shell { grid-template-columns: 220px minmax(0,1fr); }
  .plotcat-detail { grid-template-columns: 180px minmax(0,1fr); }
  #plotDetailCanvas { width: 180px; height: 132px; }
  .plotcat-detail-actions { grid-column: 1/-1; display: grid; grid-template-columns: 1fr 1fr; }
  .plotcat-detail-actions > p,
  .plotcat-detail-actions > small { display: none; }
  .plotcat-tool-list.is-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .plotcat-self-check { display: none; }
  .plotrun-body { grid-template-columns: minmax(0,1fr) minmax(390px,430px); }
}

@media (max-width: 860px) {
  .plotcat-heading,
  .plotcat-shell,
  .plotcat-status { width: min(calc(100% - 36px), var(--pc-width)); }
  .plotcat-shell { display: flex; height: auto; min-height: 0; overflow: visible; flex-direction: column; }
  .plotcat-map { border-right: 0; border-bottom: 1px solid var(--pc-line); }
  .plotcat-map-head { padding-bottom: 12px; }
  .plotcat-view-stack { grid-template-columns: repeat(4,minmax(150px,1fr)); overflow-x: auto; }
  .plotcat-map h3 { display: none; }
  .plotcat-map nav { display: flex; height: auto; overflow-x: auto; padding: 10px; }
  .plotcat-map nav button { min-width: 190px; }
  .plotcat-results { height: 900px; }
  .plotcat-detail { grid-template-columns: 170px minmax(0,1fr); }
  .plotcat-toolbar-meta > span { display: none; }
  .plotrun-layer { padding: 10px; }
  .plotrun-dialog { width: calc(100vw - 20px); height: calc(100vh - 20px); }
  .plotrun-head { grid-template-columns: minmax(0,1fr) 42px; }
  .plotrun-mode-tabs { grid-column: 1/-1; grid-row: 2; }
  .plotrun-head { padding-bottom: 10px; }
  .plotrun-body { grid-template-columns: 1fr; grid-template-areas: "stage" "controls"; overflow-y: auto; }
  .plotrun-stage { min-height: 650px; }
  .plotrun-data { min-height: 720px; border-top: 1px solid var(--pc-line); border-left: 0; }
  .plotrun-info ol { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 620px) {
  .plotcat-heading,
  .plotcat-shell,
  .plotcat-status { width: min(calc(100% - 24px), var(--pc-width)); }
  .plotcat-banner { height: 176px; }
  .plotcat-title-icon { width: 62px; height: 62px; border-radius: 16px; }
  .plotcat-title-block h1 { font-size: 34px; }
  .plotcat-title-block p { font-size: 14px; }
  .plotcat-search { grid-template-columns: 26px minmax(0,1fr) 82px; }
  .plotcat-toolbar { align-items: flex-start; flex-direction: column; padding: 12px 14px; }
  .plotcat-toolbar-meta { width: 100%; overflow-x: auto; }
  .plotcat-detail { grid-template-columns: 1fr; }
  #plotDetailCanvas { width: 100%; height: auto; }
  .plotcat-detail dl { grid-template-columns: 1fr; }
  .plotcat-detail-actions { grid-template-columns: 1fr; }
  .plotcat-results { height: 1060px; }
  .plotcat-tool-list.is-grid { grid-template-columns: 1fr; }
  .plotcat-tool-row { grid-template-columns: 104px minmax(0,1fr) 34px; }
  .plotcat-thumb { width: 104px; height: 72px; }
  .plotcat-badge { display: none; }
  .plotrun-head { min-height: 120px; }
  .plotrun-mode-tabs { width: 100%; overflow-x: auto; }
  .plotrun-mode-tabs button { flex: 1 0 auto; }
  .plotrun-stagebar { min-height: 100px; padding: 8px 12px 9px; flex: 0 0 100px; align-items: flex-start; flex-direction: column; gap: 7px; }
  .plotrun-stagebar > div:last-child { width: 100%; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .plotrun-stagebar > div:last-child::-webkit-scrollbar { display: none; }
  .plotwb-stage-summary dl { grid-template-columns: 1fr; }
  .plotrun-info ol { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .plotcat-tool-row,
  #plotCanvas,
  .plotrun-dialog,
  .plotrun-loading img { transition: none; animation: none; }
}

/* Catalog layout 14 — category / list / persistent preview */
@media (min-width: 1181px) {
  .plotcat-shell {
    display: grid;
    grid-template-columns: 224px minmax(520px, 1fr) 308px;
    grid-template-rows: 58px 42px minmax(0, 1fr);
    height: clamp(700px, calc(100vh - 118px), 820px);
    min-height: 700px;
  }

  .plotcat-map {
    grid-column: 1;
    grid-row: 1 / 4;
    padding: 16px 0 12px;
  }

  .plotcat-map-head {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 0 14px 13px;
    gap: 10px;
  }

  .plotcat-map-head > span {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 15px;
  }

  .plotcat-map h2 { font-size: 16px; }
  .plotcat-map-head p { font-size: 11px; }

  .plotcat-view-stack {
    grid-template-columns: 1fr;
    margin: 0 10px;
    padding: 7px;
    gap: 2px;
  }

  .plotcat-view-stack button {
    display: flex;
    min-height: 34px;
    border-radius: 8px;
    padding: 6px 8px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .plotcat-view-stack strong { font-size: 12px; }
  .plotcat-view-stack span { font-size: 10px; }
  .plotcat-map h3 { margin: 14px 16px 6px; }

  .plotcat-map nav {
    height: auto;
    overflow: visible;
    padding: 0 8px 6px;
  }

  .plotcat-map nav button {
    min-height: 40px;
    grid-template-columns: 25px minmax(0, 1fr) auto;
    border-radius: 8px;
    padding: 5px 9px;
  }

  .plotcat-map nav img { width: 19px; height: 19px; }
  .plotcat-map nav span { font-size: 12px; }

  .plotcat-results { display: contents; }

  .plotcat-toolbar {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    min-height: 58px;
    padding: 0 14px 0 16px;
    gap: 10px;
  }

  .plotcat-toolbar > div:first-child { gap: 8px; }
  .plotcat-toolbar > div:first-child strong { font-size: 16px; }
  .plotcat-toolbar > div:first-child span { font-size: 11px; }
  .plotcat-toolbar-meta { gap: 6px; }
  .plotcat-toolbar-meta > span:not(.plotcat-self-check) { display: none; }
  .plotcat-self-check { max-width: 162px; overflow: hidden; text-overflow: ellipsis; }
  .plotcat-toolbar-meta select { width: 102px; height: 34px; }
  .plotcat-toolbar-meta button { min-width: 42px; height: 34px; padding: 0 8px; }

  .plotcat-list-head {
    grid-column: 2;
    grid-row: 2;
    min-height: 42px;
    padding: 0 16px;
    background: color-mix(in srgb, var(--pc-surface-2) 72%, var(--pc-surface));
  }

  .plotcat-tool-list {
    grid-column: 2;
    grid-row: 3;
    min-height: 0;
    overflow-y: auto;
    padding: 6px 10px 12px;
  }

  .plotcat-tool-row {
    grid-template-columns: 112px minmax(0, 1fr) auto 32px;
    min-height: 92px;
    border: 0;
    border-bottom: 1px solid var(--pc-line);
    border-radius: 0;
    padding: 9px 7px;
    gap: 12px;
    background: transparent;
    box-shadow: none;
  }

  .plotcat-tool-row:hover {
    border-bottom-color: var(--pc-line-strong);
    background: color-mix(in srgb, var(--pc-soft) 45%, transparent);
    transform: translateX(2px);
  }

  .plotcat-tool-row[aria-current="true"] {
    border-bottom-color: color-mix(in srgb, var(--pc-brand) 42%, var(--pc-line));
    border-left: 3px solid var(--pc-brand);
    padding-left: 10px;
    background: var(--pc-soft);
  }

  .plotcat-thumb {
    width: 112px;
    height: 68px;
    border-radius: 7px;
  }

  .plotcat-tool-copy strong { font-size: 16px; }
  .plotcat-tool-copy p { margin-top: 5px; font-size: 11px; line-height: 1.5; }
  .plotcat-badge { padding: 5px 7px; font-size: 10px; }
  .plotcat-favorite { width: 32px; height: 32px; font-size: 10px; }

  .plotcat-detail {
    grid-column: 3;
    grid-row: 1 / 4;
    display: flex;
    min-width: 0;
    min-height: 0;
    border-bottom: 0;
    border-left: 1px solid var(--pc-line);
    padding: 18px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: linear-gradient(180deg, var(--pc-surface-2), var(--pc-surface));
  }

  #plotDetailCanvas {
    order: 1;
    width: 100%;
    height: auto;
    aspect-ratio: 420 / 250;
    border-radius: 10px;
    margin: 14px 0 17px;
    background: var(--pc-surface);
    box-shadow: 0 10px 26px rgba(25, 49, 35, .06);
  }

  .plotcat-detail-copy { display: contents; }
  .plotcat-detail-copy > span { order: 0; font-size: 11px; }
  .plotcat-detail-copy header { order: 2; margin: 0; align-items: flex-start; justify-content: space-between; }
  .plotcat-detail h2 { max-width: 220px; font-size: 23px; line-height: 1.25; }
  .plotcat-detail-copy > p { order: 3; margin: 8px 0 16px; font-size: 12px; line-height: 1.7; }

  .plotcat-detail dl {
    order: 4;
    display: block;
    margin: 0;
    border-top: 1px solid var(--pc-line);
  }

  .plotcat-detail dl div {
    display: grid;
    grid-template-columns: 95px minmax(0, 1fr);
    border: 0;
    border-bottom: 1px solid var(--pc-line);
    padding: 11px 0;
    align-items: center;
    gap: 8px;
  }

  .plotcat-detail dt { font-size: 10px; }
  .plotcat-detail dd { margin: 0; font-size: 11px; white-space: normal; }

  .plotcat-detail-actions {
    order: 5;
    display: flex;
    margin-top: auto;
    padding-top: 17px;
    gap: 8px;
  }

  .plotcat-detail-actions > p { margin-bottom: 5px; font-size: 11px; line-height: 1.5; }
  .plotcat-detail-actions button { min-height: 44px; }
  .plotcat-detail-actions small { margin-top: 2px; }

  .plotcat-tool-list.is-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px;
    gap: 12px;
  }

  .plotcat-tool-list.is-grid .plotcat-tool-row { min-height: 326px; border: 1px solid var(--pc-line); border-radius: 11px; padding: 11px; }
  .plotcat-tool-list.is-grid .plotcat-thumb { height: 132px; }
}

@media (min-width: 861px) and (max-width: 1180px) {
  .plotcat-shell { height: 820px; min-height: 0; }
  .plotcat-detail { min-height: 180px; }
  .plotcat-tool-row { grid-template-columns: 122px minmax(0, 1fr) auto 34px; }
  .plotcat-thumb { width: 122px; height: 76px; }
}

@media (max-width: 860px) {
  .plotcat-results { height: auto; min-height: 0; overflow: visible; }
  .plotcat-toolbar { order: 1; }
  .plotcat-detail { order: 2; }
  .plotcat-list-head { order: 3; }
  .plotcat-tool-list { order: 4; max-height: 760px; }
}

.plot-template-library { width: min(calc(100% - clamp(48px, 7vw, 104px)), var(--pc-width)); margin: 4px auto 30px; padding: 30px; border: 1px solid var(--pc-line); border-radius: 18px; background: linear-gradient(135deg, var(--pc-surface), color-mix(in srgb, var(--pc-soft) 58%, var(--pc-surface))); box-shadow: 0 18px 48px rgba(25, 49, 35, .07); scroll-margin-top: 92px; }
.plot-template-library > header { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, .72fr); gap: 46px; align-items: end; margin-bottom: 24px; }
.plot-template-library > header span { color: var(--pc-brand); font: 800 10px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .15em; }
.plot-template-library h2 { margin: 7px 0 0; color: var(--pc-ink); font-size: clamp(28px, 3.5vw, 42px); font-weight: 790; letter-spacing: -.045em; }
.plot-template-library > header p { margin: 0; color: var(--pc-muted); font-size: 14px; line-height: 1.75; }
.plot-template-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--pc-line); border-left: 1px solid var(--pc-line); }
.plot-template-grid button { display: grid; min-height: 218px; grid-template-rows: auto auto 1fr 1fr auto; gap: 11px; padding: 22px; border: 0; border-right: 1px solid var(--pc-line); border-bottom: 1px solid var(--pc-line); color: var(--pc-ink); background: color-mix(in srgb, var(--pc-surface) 94%, transparent); cursor: pointer; text-align: left; transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease; }
.plot-template-grid button:hover, .plot-template-grid button:focus-visible { position: relative; z-index: 1; background: var(--pc-soft); box-shadow: inset 0 0 0 2px var(--pc-brand); transform: translateY(-2px); }
.plot-template-grid button > span { color: var(--pc-brand); font: 800 10px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; }
.plot-template-grid button strong { font-size: 20px; line-height: 1.35; }
.plot-template-grid button p { margin: 0; color: var(--pc-muted); font-size: 12px; line-height: 1.55; }
.plot-template-grid button p b { color: var(--pc-ink); font-weight: 720; }
.plot-template-grid button i { color: var(--pc-brand); font-size: 11px; font-style: normal; font-weight: 780; }
.plotcat-maturity { display: block; width: fit-content; margin-top: 7px; padding: 3px 7px; border-radius: 999px; color: #6a704f; background: #f0f2df; font-size: 10px; font-weight: 740; }
.plotcat-maturity[data-level="verified"] { color: #2e6942; background: #e6f3e7; }
html[data-theme="dark"] .plotcat-maturity { color: #d8d0a2; background: #35351f; }
html[data-theme="dark"] .plotcat-maturity[data-level="verified"] { color: #c9e3bf; background: #253b2a; }
.plot-feedback-link { display: inline-flex; min-height: 34px; align-items: center; padding: 0 10px; border: 1px solid var(--pc-line); border-radius: 7px; color: var(--pc-brand-2); background: var(--pc-surface); font-size: 11px; font-weight: 760; }

@media (max-width: 900px) {
  .plot-template-library > header { grid-template-columns: 1fr; gap: 16px; }
  .plot-template-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 580px) {
  .plot-template-library { width: min(calc(100% - 24px), var(--pc-width)); padding: 20px; }
  .plot-template-grid { grid-template-columns: 1fr; }
  .plot-template-grid button { min-height: 200px; }
}

/* Workbench legibility: keep operational text readable without sacrificing
   the fixed canvas/inspector layout. */
.plotrun-dialog { font-size: 14px; }
.plotrun-section-head small,
.plotwb-dropzone small,
.plotwb-file-chip small,
.plotrun-auto > span,
.plotrun-submit p,
.plotrun-stagebar span,
.plotrun-loading small { font-size: 12px; }
.plotwb-control-tabs button,
.plotwb-tabs button,
.plotwb-form-grid label > span,
.plotwb-form-grid select,
.plotwb-form-grid input[type="number"],
.plotwb-form-grid input[type="text"] { font-size: 13px; }
.plotwb-data-table-wrap table,
.plotwb-param-actions button,
.plotwb-checks label,
.plotrun-auto label,
.plotrun-stagebar button,
.plot-feedback-link { font-size: 12px; }
.plotwb-stage-summary dd span { font-size: 11px; }
.plotwb-stage-summary dd strong { font-size: 12px; }
.plotcat-maturity { font-size: 11px; }

@media (min-width: 1181px) {
  .plotcat-map-head p,
  .plotcat-toolbar > div:first-child span,
  .plotcat-detail-copy > span,
  .plotcat-detail-copy > p,
  .plotcat-detail dt,
  .plotcat-detail dd,
  .plotcat-detail-actions > p,
  .plotcat-tool-copy p { font-size: 12px; }
}

/* Workbench text can be scaled without changing the exported chart's own
   publication typography controls in the Style tab. */
.plotrun-dialog { --plot-ui-scale: 1; }
.plotrun-dialog[data-research-font="compact"] { --plot-ui-scale: .92; }
.plotrun-dialog[data-research-font="large"] { --plot-ui-scale: 1.14; }
.plotrun-dialog .plotrun-section-head small,
.plotrun-dialog .plotwb-dropzone small,
.plotrun-dialog .plotwb-file-chip small,
.plotrun-dialog .plotrun-auto > span,
.plotrun-dialog .plotrun-submit p,
.plotrun-dialog .plotrun-stagebar span,
.plotrun-dialog .plotrun-loading small { font-size: calc(12px * var(--plot-ui-scale)) !important; }
.plotrun-dialog .plotwb-control-tabs button,
.plotrun-dialog .plotwb-tabs button,
.plotrun-dialog .plotwb-form-grid label > span,
.plotrun-dialog .plotwb-form-grid select,
.plotrun-dialog .plotwb-form-grid input[type="number"],
.plotrun-dialog .plotwb-form-grid input[type="text"] { font-size: calc(13px * var(--plot-ui-scale)) !important; }
.plotrun-dialog .plotwb-data-table-wrap table,
.plotrun-dialog .plotwb-param-actions button,
.plotrun-dialog .plotwb-checks label,
.plotrun-dialog .plotrun-auto label,
.plotrun-dialog .plotrun-stagebar button,
.plotrun-dialog .plot-feedback-link { font-size: calc(12px * var(--plot-ui-scale)) !important; }
.plotrun-dialog .plotwb-stage-summary dd span { font-size: calc(11px * var(--plot-ui-scale)) !important; }
.plotrun-dialog .plotwb-stage-summary dd strong { font-size: calc(12px * var(--plot-ui-scale)) !important; }

@media (max-width: 860px) {
  .plot-font-control { flex: 0 0 auto; }
}
