/* PaulTech tokens — generated from tokens/tokens.json. Do not edit. */
:root, [data-theme="light"] {
  color-scheme: light;
  --surface-0: #ffffff;
  --surface-100: #f5f6f7;
  --surface-200: #eceef0;
  --line: #d9dde1;
  --line-strong: #8a939b;
  --ink: #15171a;
  --ink-muted: #5a636b;
  --ink-inverse: #ffffff;
  --brand: #ff5b1f;
  --on-brand: #15171a;
  --brand-text: #c23a08;
  --brand-soft: #fff0e9;
  --info: #2457d6;
  --info-soft: #eaf0ff;
  --success: #1d7a46;
  --success-soft: #e6f4ec;
  --warning: #8f5200;
  --warning-soft: #fdf1dc;
  --danger: #c4213a;
  --danger-soft: #fdeaed;
  --focus: #2457d6;
  --primary: #ff5b1f;
  --on-primary: #15171a;
  --primary-hover: #e74900;
  --primary-text: var(--brand-text);
  --primary-soft: var(--brand-soft);
  --secondary: #353b41;
  --on-secondary: #ffffff;
  --secondary-hover: #454b51;
  --secondary-text: #353b41;
  --secondary-soft: #eceef0;
  --accent: #2457d6;
  --on-accent: #ffffff;
  --accent-hover: #1443c1;
  --accent-text: #2457d6;
  --accent-soft: #ecf3ff;
  --chart-1: #ff5b1f;
  --chart-2: #2457d6;
  --chart-3: #0f8b8d;
  --chart-4: #7b4ec4;
  --chart-5: #59800b;
  --chart-6: #c2186b;
  --shadow-raised: 0 1px 2px rgba(21,23,26,0.06), 0 2px 8px rgba(21,23,26,0.05);
  --shadow-floating: 0 4px 12px rgba(21,23,26,0.10), 0 1px 2px rgba(21,23,26,0.08);
  --shadow-overlay: 0 8px 24px rgba(21,23,26,0.12), 0 1px 2px rgba(21,23,26,0.08);
}
[data-theme="dark"] {
  color-scheme: dark;
  --surface-0: #0f1113;
  --surface-100: #16191c;
  --surface-200: #1e2226;
  --line: #2e3439;
  --line-strong: #5d666e;
  --ink: #eef0f2;
  --ink-muted: #a3acb4;
  --ink-inverse: #15171a;
  --brand: #ff6a33;
  --on-brand: #15171a;
  --brand-text: #ff8a5c;
  --brand-soft: #3a1d10;
  --info: #8fb0ff;
  --info-soft: #16233f;
  --success: #5ccf8e;
  --success-soft: #10291c;
  --warning: #f0b44c;
  --warning-soft: #2e2210;
  --danger: #ff8796;
  --danger-soft: #3a1219;
  --focus: #8fb0ff;
  --primary: #ff6a33;
  --on-primary: #15171a;
  --primary-hover: #ff7d55;
  --primary-text: var(--brand-text);
  --primary-soft: var(--brand-soft);
  --secondary: #9ea5ad;
  --on-secondary: #15171a;
  --secondary-hover: #adb5bc;
  --secondary-text: #c3c9cf;
  --secondary-soft: #24282c;
  --accent: #75a2ff;
  --on-accent: #10171d;
  --accent-hover: #8eb3ff;
  --accent-text: #8fb0ff;
  --accent-soft: #172544;
  --chart-1: #ff6a33;
  --chart-2: #6b9bff;
  --chart-3: #3cc4c6;
  --chart-4: #b08cf0;
  --chart-5: #85ae47;
  --chart-6: #f07ab3;
  --shadow-raised: 0 1px 2px rgba(0,0,0,0.4), 0 0 0 1px #2e3439;
  --shadow-floating: 0 4px 12px rgba(0,0,0,0.45), 0 0 0 1px #2e3439;
  --shadow-overlay: 0 8px 24px rgba(0,0,0,0.5), 0 0 0 1px #2e3439;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --surface-0: #0f1113;
    --surface-100: #16191c;
    --surface-200: #1e2226;
    --line: #2e3439;
    --line-strong: #5d666e;
    --ink: #eef0f2;
    --ink-muted: #a3acb4;
    --ink-inverse: #15171a;
    --brand: #ff6a33;
    --on-brand: #15171a;
    --brand-text: #ff8a5c;
    --brand-soft: #3a1d10;
    --info: #8fb0ff;
    --info-soft: #16233f;
    --success: #5ccf8e;
    --success-soft: #10291c;
    --warning: #f0b44c;
    --warning-soft: #2e2210;
    --danger: #ff8796;
    --danger-soft: #3a1219;
    --focus: #8fb0ff;
    --primary: #ff6a33;
    --on-primary: #15171a;
    --primary-hover: #ff7d55;
    --primary-text: var(--brand-text);
    --primary-soft: var(--brand-soft);
    --secondary: #9ea5ad;
    --on-secondary: #15171a;
    --secondary-hover: #adb5bc;
    --secondary-text: #c3c9cf;
    --secondary-soft: #24282c;
    --accent: #75a2ff;
    --on-accent: #10171d;
    --accent-hover: #8eb3ff;
    --accent-text: #8fb0ff;
    --accent-soft: #172544;
    --chart-1: #ff6a33;
    --chart-2: #6b9bff;
    --chart-3: #3cc4c6;
    --chart-4: #b08cf0;
    --chart-5: #85ae47;
    --chart-6: #f07ab3;
    --shadow-raised: 0 1px 2px rgba(0,0,0,0.4), 0 0 0 1px #2e3439;
    --shadow-floating: 0 4px 12px rgba(0,0,0,0.45), 0 0 0 1px #2e3439;
    --shadow-overlay: 0 8px 24px rgba(0,0,0,0.5), 0 0 0 1px #2e3439;
  }
}
:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-10: 40px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-pill: 999px;
  --control-sm: 28px;
  --control-md: 32px;
  --control-lg: 40px;
  --border-width-thin: 1px;
  --border-width-thick: 2px;
  --focus-ring-width: 2px;
  --focus-ring-offset: 2px;
  --border-subtle: var(--border-width-thin) solid var(--line);
  --border-strong: var(--border-width-thin) solid var(--line-strong);
  --focus-ring: var(--focus-ring-width) solid var(--focus);
  --z-raised: 1;
  --z-sticky: 100;
  --z-overlay: 1000;
  --z-popover: 1100;
  --z-toast: 1200;
  --z-tooltip: 1300;
  --bp-sm: 640px;
  --bp-md: 1024px;
  --bp-lg: 1280px;
  --bp-xl: 1536px;
  --duration-fast: 120ms;
  --duration-moderate: 200ms;
  --duration-slow: 300ms;
  --duration-slower: 500ms;
  --easing-standard: cubic-bezier(0.2, 0, 0, 1);
  --easing-enter: cubic-bezier(0, 0, 0, 1);
  --easing-exit: cubic-bezier(0.3, 0, 1, 1);
  --easing-linear: linear;
  --animation-fade-in: pt-fade-in var(--duration-moderate) var(--easing-enter) both;
  --animation-scale-in: pt-scale-in var(--duration-fast) var(--easing-enter) both;
  --animation-slide-in-up: pt-slide-in-up var(--duration-moderate) var(--easing-enter) both;
  --animation-slide-in-left: pt-slide-in-left var(--duration-slow) var(--easing-enter) both;
  --animation-slide-in-right: pt-slide-in-right var(--duration-slow) var(--easing-enter) both;
  --animation-sheet-in: pt-sheet-in var(--duration-slow) var(--easing-enter) both;
  --animation-spin: pt-spin 0.8s var(--easing-linear) infinite;
  --animation-shimmer: pt-shimmer 1.6s var(--easing-linear) infinite;
  --animation-indeterminate: pt-indeterminate 1.4s ease-in-out infinite;
  --font-sans: "Schibsted Grotesk", "Noto Sans TC", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --font-heading: "Schibsted Grotesk", "Noto Sans TC", system-ui, sans-serif;
  --font-body: "Schibsted Grotesk", "Noto Sans TC", system-ui, sans-serif;
  --heading-weight: 700;
  --text-display-size: 48px;
  --text-display-lh: 52px;
  --text-heading-1-size: 32px;
  --text-heading-1-lh: 40px;
  --text-heading-2-size: 24px;
  --text-heading-2-lh: 32px;
  --text-heading-3-size: 18px;
  --text-heading-3-lh: 26px;
  --text-body-size: 16px;
  --text-body-lh: 24px;
  --text-body-sm-size: 14px;
  --text-body-sm-lh: 20px;
  --text-label-size: 13px;
  --text-label-lh: 16px;
  --text-code-size: 13px;
  --text-code-lh: 20px;
}
.pt-text-display { font-family: var(--font-sans); font-size: 48px; line-height: 52px; font-weight: 700; letter-spacing: -0.02em; }
.pt-text-heading-1 { font-family: var(--font-sans); font-size: 32px; line-height: 40px; font-weight: 700; letter-spacing: -0.015em; }
.pt-text-heading-2 { font-family: var(--font-sans); font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.01em; }
.pt-text-heading-3 { font-family: var(--font-sans); font-size: 18px; line-height: 26px; font-weight: 600; }
.pt-text-body { font-family: var(--font-sans); font-size: 16px; line-height: 24px; font-weight: 400; }
.pt-text-body-sm { font-family: var(--font-sans); font-size: 14px; line-height: 20px; font-weight: 400; }
.pt-text-label { font-family: var(--font-sans); font-size: 13px; line-height: 16px; font-weight: 500; }
.pt-text-code { font-family: var(--font-mono); font-size: 13px; line-height: 20px; font-weight: 400; }
@keyframes pt-fade-in { from { opacity: 0; } }
@keyframes pt-fade-out { to { opacity: 0; } }
@keyframes pt-scale-in { from { opacity: 0; transform: scale(.97); } }
@keyframes pt-slide-in-up { from { opacity: 0; transform: translateY(8px); } }
@keyframes pt-slide-in-down { from { opacity: 0; transform: translateY(-8px); } }
@keyframes pt-slide-in-left { from { opacity: 0; transform: translateX(-24px); } }
@keyframes pt-slide-in-right { from { opacity: 0; transform: translateX(24px); } }
@keyframes pt-sheet-in { from { opacity: 0; transform: translateY(32px); } }
@keyframes pt-spin { to { transform: rotate(360deg); } }
@keyframes pt-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes pt-indeterminate { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@keyframes pt-countdown { to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0ms;
    --duration-moderate: 0ms;
    --duration-slow: 0ms;
    --duration-slower: 0ms;
    --animation-spin: pt-spin 2.4s linear infinite;
    --animation-shimmer: none;
    --animation-indeterminate: pt-indeterminate 4s ease-in-out infinite;
  }
}

/* PaulTech components. Requires tokens.css (styles.css includes both). Every rule reads design tokens only. */
.pt-root { font-family: var(--font-body, var(--font-sans)); font-size: var(--text-body-size, 16px); line-height: var(--text-body-lh, 24px); background: var(--surface-0); color: var(--ink); -webkit-font-smoothing: antialiased; }
.pt-root *, .pt-root *::before, .pt-root *::after { box-sizing: border-box; }
.pt-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:where(.pt-root) :focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-ring-offset); }
.pt-fg-muted { color: var(--ink-muted); } .pt-fg-inverse { color: var(--ink-inverse); } .pt-fg-primary { color: var(--primary-text); }
.pt-fg-info { color: var(--info); } .pt-fg-success { color: var(--success); } .pt-fg-warning { color: var(--warning); } .pt-fg-danger { color: var(--danger); } .pt-fg-neutral { color: var(--ink-muted); }
.pt-fg-secondary { color: var(--secondary-text); } .pt-fg-accent { color: var(--accent-text); }
.pt-bg-primary { background: var(--primary); } .pt-bg-info { background: var(--info); } .pt-bg-success { background: var(--success); } .pt-bg-warning { background: var(--warning); } .pt-bg-danger { background: var(--danger); }
.pt-stroke-primary { stroke: var(--primary); } .pt-stroke-info { stroke: var(--info); } .pt-stroke-success { stroke: var(--success); } .pt-stroke-warning { stroke: var(--warning); } .pt-stroke-danger { stroke: var(--danger); }
.pt-soft-neutral { background: var(--surface-200); color: var(--ink); }
.pt-soft-primary { background: var(--primary-soft); color: var(--primary-text); } .pt-soft-secondary { background: var(--secondary-soft); color: var(--secondary-text); } .pt-soft-accent { background: var(--accent-soft); color: var(--accent-text); }
.pt-soft-info { background: var(--info-soft); color: var(--info); } .pt-soft-success { background: var(--success-soft); color: var(--success); } .pt-soft-warning { background: var(--warning-soft); color: var(--warning); } .pt-soft-danger { background: var(--danger-soft); color: var(--danger); }
.pt-icon-btn { flex: none; display: inline-grid; place-items: center; width: var(--control-sm, 28px); height: var(--control-sm, 28px); padding: 0; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--ink-muted); cursor: pointer; }
.pt-icon-btn:hover:not(:disabled) { background: var(--surface-200); color: var(--ink); }
.pt-icon-btn:disabled { opacity: .45; cursor: not-allowed; }

/* typography */
.pt-heading { margin: 0; color: var(--ink); font-family: var(--font-heading, var(--font-sans)); }
.pt-p { margin: 0 0 var(--space-3); }
.pt-strong { font-weight: 600; }
.pt-code { font-family: var(--font-mono); font-size: .875em; padding: 1px 5px; border-radius: var(--radius-sm); background: var(--surface-200); }
.pt-blockquote { margin: 0 0 var(--space-3); padding: var(--space-1) var(--space-4); border-left: 3px solid var(--line-strong); color: var(--ink-muted); }
.pt-list { margin: 0 0 var(--space-3); padding-left: 1.4em; display: grid; gap: var(--space-1); }
.pt-link { color: var(--primary-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; cursor: pointer; }
.pt-link:hover { text-decoration-thickness: 2px; }
.pt-link-neutral { color: inherit; }
.pt-link-ext { display: inline-block; width: 12px; height: 12px; margin-left: 3px; vertical-align: -1px; }
.pt-mark { background: var(--warning-soft); color: inherit; border-radius: 2px; box-shadow: 0 0 0 1px var(--warning-soft); }
.pt-ellipsis { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pt-clamp { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.pt-ellipsis-mid { display: flex; min-width: 0; white-space: nowrap; }
.pt-ellipsis-a { overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
.pt-ellipsis-b { flex: none; max-width: 50%; overflow: hidden; direction: rtl; text-overflow: ellipsis; }

/* layouts */
.pt-container { border-radius: var(--radius-lg); padding: var(--space-4); }
.pt-container-default { border: var(--border-width-thin) solid var(--line); background: var(--surface-0); }
.pt-container-minimal { padding: 0; }
.pt-container-emphasized { color: var(--ink); }
.pt-surface { background: var(--surface-0); border: var(--border-width-thin) solid var(--line); border-radius: var(--radius-lg); }
.pt-surface-raised { box-shadow: var(--shadow-raised); }
.pt-surface-floating { box-shadow: var(--shadow-floating); }
.pt-divider { border: 0; border-top: var(--border-width-thin) solid var(--line); margin: var(--space-4) 0; width: 100%; }
.pt-divider-v { border-top: 0; border-left: var(--border-width-thin) solid var(--line); width: 0; height: auto; align-self: stretch; margin: 0 var(--space-2); }
.pt-action-group { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.pt-action-group-end { justify-content: flex-end; } .pt-action-group-between { justify-content: space-between; }
.pt-input-group { display: flex; align-items: stretch; min-width: 0; }
.pt-input-group > * { border-radius: 0 !important; margin-left: -1px; }
.pt-input-group > *:first-child { border-top-left-radius: var(--radius-md) !important; border-bottom-left-radius: var(--radius-md) !important; margin-left: 0; }
.pt-input-group > *:last-child { border-top-right-radius: var(--radius-md) !important; border-bottom-right-radius: var(--radius-md) !important; }
.pt-input-group > *:focus-within, .pt-input-group > *:focus-visible { position: relative; z-index: var(--z-raised); }
.pt-input-group > .pt-field, .pt-input-group > .pt-textinput { flex: 1; }
.pt-titlebar { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-4) 0; flex-wrap: wrap; }
.pt-titlebar-text { flex: 1 1 240px; min-width: 0; }
.pt-titlebar-title { margin: 0; font-family: var(--font-heading, var(--font-sans)); overflow-wrap: anywhere; }
.pt-titlebar-sub { margin: var(--space-1) 0 0; color: var(--ink-muted); font-size: var(--text-body-sm-size, 14px); }
.pt-titlebar-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.pt-appheader { display: flex; align-items: center; gap: var(--space-6); min-height: 52px; padding: 0 var(--space-4); border-bottom: var(--border-width-thin) solid var(--line); background: var(--surface-0); min-width: 0; }
.pt-appheader-logo { display: flex; align-items: center; gap: var(--space-2); font-weight: 700; font-family: var(--font-heading, var(--font-sans)); flex: none; }
.pt-appheader-nav { display: flex; gap: var(--space-1); align-self: stretch; overflow-x: auto; flex: 1 1 auto; min-width: 0; contain: inline-size; scrollbar-width: none; }
.pt-appheader-actions { display: flex; gap: var(--space-2); align-items: center; margin-left: auto; flex: none; }
.pt-appnav-link { display: flex; align-items: center; padding: 0 var(--space-3); color: var(--ink-muted); text-decoration: none; font-size: var(--text-body-sm-size, 14px); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
.pt-appnav-link:hover { color: var(--ink); }
.pt-appnav-link[aria-current="page"] { color: var(--ink); border-bottom-color: var(--primary); font-weight: 600; }
.pt-page { display: flex; flex-direction: column; min-height: 100%; height: 100%; }
.pt-page-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); min-height: 0; }
.pt-page-body.has-side { grid-template-columns: var(--pt-page-side) minmax(0, 1fr); }
.pt-page-body.has-detail { grid-template-columns: minmax(0, 1fr) var(--pt-page-detail); }
.pt-page-body.has-side.has-detail { grid-template-columns: var(--pt-page-side) minmax(0, 1fr) var(--pt-page-detail); }
.pt-page-sidebar { border-right: var(--border-width-thin) solid var(--line); background: var(--surface-100); overflow: auto; padding: var(--space-4); }
.pt-page-main { overflow: auto; padding: var(--space-6); min-width: 0; }
.pt-page-detail { border-left: var(--border-width-thin) solid var(--line); overflow: auto; padding: var(--space-4); }
@media (max-width: 1023.98px) {
  .pt-page-body.has-side, .pt-page-body.has-detail, .pt-page-body.has-side.has-detail { grid-template-columns: minmax(0, 1fr); }
  .pt-page-sidebar { border-right: 0; border-bottom: var(--border-width-thin) solid var(--line); }
  .pt-page-detail { border-left: 0; border-top: var(--border-width-thin) solid var(--line); }
  .pt-page-main { padding: var(--space-4); }
}
.pt-split { display: flex; min-height: 0; min-width: 0; height: 100%; }
.pt-split-v { flex-direction: column; }
.pt-split-pane { min-width: 0; min-height: 0; overflow: auto; }
.pt-split-handle { flex: none; background: var(--line); position: relative; touch-action: none; }
.pt-split-h > .pt-split-handle { width: 1px; cursor: col-resize; }
.pt-split-v > .pt-split-handle { height: 1px; cursor: row-resize; }
.pt-split-handle::after { content: ""; position: absolute; inset: -4px; }
.pt-split-handle:hover, .pt-split-handle:focus-visible { background: var(--primary); }
@media (max-width: 639.98px) { .pt-appheader { gap: var(--space-3); padding: 0 var(--space-3); } }

/* Original components: field, input, switch, badge, card, tabs, alert, select, checkbox, dialog, table. */
.pt-field { display: flex; flex-direction: column; gap: var(--space-1); }
.pt-label { font-size: 13px; line-height: 16px; font-weight: 500; color: var(--ink); }
.pt-hint { font-size: 13px; line-height: 16px; color: var(--ink-muted); }
.pt-error { font-size: 13px; line-height: 16px; color: var(--danger); }
.pt-input { box-sizing: border-box; width: 100%; font: inherit; font-size: 14px; height: var(--control-md); padding: 0 var(--space-3); border-radius: var(--radius-md); border: var(--border-width-thin) solid var(--line-strong); background: var(--surface-0); color: var(--ink); }
.pt-input::placeholder { color: var(--ink-muted); }
.pt-input:disabled { background: var(--surface-100); color: var(--ink-muted); }
.pt-input[aria-invalid="true"] { border-color: var(--danger); }
.pt-switch-wrap { display: inline-flex; align-items: center; gap: var(--space-3); font-size: 14px; cursor: pointer; }
.pt-switch { position: relative; width: 36px; height: 20px; flex: none; border-radius: var(--radius-pill); border: var(--border-width-thin) solid var(--line-strong); background: var(--surface-200); padding: 0; cursor: pointer; transition: background-color var(--duration-fast); }
.pt-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: var(--radius-pill); background: var(--ink-muted); transition: transform var(--duration-moderate) var(--easing-standard), background-color var(--duration-fast); }
.pt-switch[aria-checked="true"] { background: var(--primary); border-color: var(--primary); }
.pt-switch[aria-checked="true"]::after { transform: translateX(16px); background: var(--on-primary); }
.pt-switch:disabled { opacity: .45; cursor: not-allowed; }
.pt-badge { display: inline-flex; align-items: center; gap: var(--space-1); height: 20px; padding: 0 var(--space-2); font-size: 12px; font-weight: 500; line-height: 20px; border-radius: var(--radius-sm); background: var(--surface-200); color: var(--ink); white-space: nowrap; }
.pt-badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pt-badge-brand, .pt-badge-primary { background: var(--primary-soft); color: var(--primary-text); }
.pt-badge-info { background: var(--info-soft); color: var(--info); }
.pt-badge-success { background: var(--success-soft); color: var(--success); }
.pt-badge-secondary { background: var(--secondary-soft); color: var(--secondary-text); }
.pt-badge-accent { background: var(--accent-soft); color: var(--accent-text); }
.pt-badge-warning { background: var(--warning-soft); color: var(--warning); }
.pt-badge-danger { background: var(--danger-soft); color: var(--danger); }
.pt-card { background: var(--surface-0); border: var(--border-width-thin) solid var(--line); border-radius: var(--radius-lg); padding: var(--space-6); }
.pt-card-subtle { background: var(--surface-100); }
.pt-card-title { margin: 0 0 var(--space-1); font-size: 18px; line-height: 26px; font-weight: 600; }
.pt-card-desc { margin: 0 0 var(--space-4); font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.pt-card-footer { display: flex; gap: var(--space-2); justify-content: flex-end; margin-top: var(--space-6); padding-top: var(--space-4); border-top: var(--border-width-thin) solid var(--line); }
.pt-tabs-list { display: flex; gap: var(--space-6); border-bottom: var(--border-width-thin) solid var(--line); }
.pt-tab { font: inherit; font-size: 14px; font-weight: 500; background: none; border: 0; padding: var(--space-2) 0 var(--space-3); margin-bottom: -1px; color: var(--ink-muted); border-bottom: 2px solid transparent; cursor: pointer; }
.pt-tab:hover { color: var(--ink); }
.pt-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--primary); font-weight: 600; }
.pt-tab-panel { padding-top: var(--space-4); font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.pt-alert { display: grid; grid-template-columns: 20px 1fr; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); font-size: 14px; line-height: 20px; color: var(--ink); }
.pt-alert-icon { width: 20px; height: 20px; }
.pt-alert-title { font-weight: 600; margin: 0; }
.pt-alert-body { margin: 0; color: var(--ink); }
.pt-alert-info { background: var(--info-soft); }
.pt-alert-info .pt-alert-icon { color: var(--info); }
.pt-alert-success { background: var(--success-soft); }
.pt-alert-success .pt-alert-icon { color: var(--success); }
.pt-alert-warning { background: var(--warning-soft); }
.pt-alert-warning .pt-alert-icon { color: var(--warning); }
.pt-alert-danger { background: var(--danger-soft); }
.pt-alert-danger .pt-alert-icon { color: var(--danger); }
.pt-select-wrap { position: relative; display: flex; }
.pt-select { appearance: none; -webkit-appearance: none; width: 100%; padding-right: var(--space-8); cursor: pointer; }
.pt-select-chev { position: absolute; right: var(--space-3); top: 50%; width: 16px; height: 16px; margin-top: -8px; color: var(--ink-muted); pointer-events: none; }
.pt-check { display: inline-flex; align-items: flex-start; gap: var(--space-2); font-size: 14px; line-height: 20px; cursor: pointer; position: relative; }
.pt-check-input { position: absolute; opacity: 0; width: 16px; height: 16px; margin: 2px 0 0; }
.pt-check-box { flex: none; width: 16px; height: 16px; margin-top: 2px; border: var(--border-width-thin) solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-0); color: var(--on-primary); display: grid; place-items: center; transition: background-color var(--duration-fast), border-color var(--duration-fast); }
.pt-check-box svg { width: 12px; height: 12px; }
.pt-check-tick, .pt-check-dash { opacity: 0; }
.pt-check-input:checked + .pt-check-box, .pt-check-input:indeterminate + .pt-check-box { background: var(--primary); border-color: var(--primary); }
.pt-check-input:checked:not(:indeterminate) + .pt-check-box .pt-check-tick { opacity: 1; }
.pt-check-input:indeterminate + .pt-check-box .pt-check-dash { opacity: 1; }
.pt-check:hover .pt-check-input:not(:checked):not(:disabled) + .pt-check-box { background: var(--surface-200); }
.pt-check-text { display: flex; flex-direction: column; gap: 2px; }
.pt-check-disabled { cursor: not-allowed; opacity: .45; }
.pt-dialog-backdrop { position: fixed; inset: 0; z-index: var(--z-overlay); display: grid; place-items: center; padding: var(--space-4); background: rgba(15,17,19,0.48); animation: var(--animation-fade-in); }
.pt-dialog { width: 100%; max-height: calc(100% - 32px); overflow: auto; background: var(--surface-0); color: var(--ink); border: var(--border-width-thin) solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-overlay); padding: var(--space-6); animation: var(--animation-slide-in-up); }
.pt-dialog:focus { outline: none; }
.pt-dialog-sm { max-width: 400px; }
.pt-dialog-md { max-width: 520px; }
.pt-dialog-lg { max-width: 720px; }
.pt-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); }
.pt-dialog-title { margin: 0; font-size: 18px; line-height: 26px; font-weight: 600; }
.pt-dialog-close { flex: none; width: 32px; height: 32px; margin: -4px -8px 0 0; display: grid; place-items: center; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--ink-muted); cursor: pointer; }
.pt-dialog-close:hover { background: var(--surface-200); color: var(--ink); }
.pt-dialog-close svg { width: 16px; height: 16px; }
.pt-dialog-desc { margin: var(--space-2) 0 0; font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.pt-dialog-body { margin-top: var(--space-4); font-size: 14px; line-height: 20px; }
.pt-dialog-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-6); }
.pt-table-wrap { overflow-x: auto; border: var(--border-width-thin) solid var(--line); border-radius: var(--radius-lg); }
.pt-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.pt-table-caption { caption-side: top; text-align: left; padding: var(--space-3) var(--space-4); font-weight: 600; border-bottom: var(--border-width-thin) solid var(--line); }
.pt-table th { text-align: left; font-size: 13px; line-height: 16px; font-weight: 500; color: var(--ink-muted); background: var(--surface-100); padding: var(--space-2) var(--space-4); border-bottom: var(--border-width-thin) solid var(--line); white-space: nowrap; }
.pt-table td { padding: var(--space-3) var(--space-4); border-bottom: var(--border-width-thin) solid var(--line); color: var(--ink); vertical-align: middle; }
.pt-table tbody tr:last-child td { border-bottom: 0; }
.pt-table tbody tr:hover td { background: var(--surface-100); }
.pt-table-compact td { padding: var(--space-1) var(--space-3); }
.pt-table-compact th { padding: var(--space-1) var(--space-3); }
.pt-table .pt-right { text-align: right; }
.pt-table .pt-mono { font-family: var(--font-mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.pt-table-empty { text-align: center; color: var(--ink-muted); padding: var(--space-8) var(--space-4); }
.pt-th-sort { font: inherit; color: inherit; background: none; border: 0; padding: 0; display: inline-flex; align-items: center; gap: var(--space-1); cursor: pointer; border-radius: var(--radius-sm); }
.pt-th-sort:hover { color: var(--ink); }
.pt-right .pt-th-sort { flex-direction: row-reverse; }
.pt-sort-icon { width: 14px; height: 14px; }
.pt-sort-icon path { opacity: .35; }
.pt-sort-asc .pt-sort-up, .pt-sort-desc .pt-sort-down { opacity: 1; color: var(--primary-text); }
@media (prefers-reduced-motion: reduce) { .pt-switch::after, .pt-check-box { transition: none; } .pt-dialog, .pt-dialog-backdrop { animation: none; } }

/* Plain-HTML markup (no React): <svg> directly in .pt-alert, a bare <input> in .pt-check, <select class="pt-select"> without a wrapper. */
.pt-alert > svg:not(.pt-alert-icon) { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.pt-alert-info > svg { color: var(--info); } .pt-alert-success > svg { color: var(--success); } .pt-alert-warning > svg { color: var(--warning); } .pt-alert-danger > svg { color: var(--danger); }
.pt-check > input { position: absolute; opacity: 0; width: 16px; height: 16px; margin: 2px 0 0; }
.pt-check > input:checked + .pt-check-box { background: var(--primary); border-color: var(--primary); }
.pt-check > input:focus-visible + .pt-check-box { outline: var(--focus-ring); outline-offset: var(--focus-ring-offset); }
.pt-check-box:empty::after { content: ""; width: 8px; height: 4px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.pt-check > input:checked + .pt-check-box:empty::after { opacity: 1; }
select.pt-select { background-image: linear-gradient(45deg, transparent 50%, var(--ink-muted) 50%), linear-gradient(135deg, var(--ink-muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.pt-select-wrap > select.pt-select { background-image: none; }

.pt-btn { box-sizing: border-box; font: inherit; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: var(--control-md, 32px); padding: 0 var(--space-4); font-size: var(--text-body-sm-size, 14px); line-height: 1; border-radius: var(--radius-md); border: 1px solid transparent; cursor: pointer; transition: background-color var(--duration-fast) var(--easing-standard), border-color var(--duration-fast), color var(--duration-fast); white-space: nowrap; text-decoration: none; user-select: none; }
.pt-btn:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-ring-offset); }
.pt-btn:disabled, .pt-btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.pt-btn svg { width: 16px; height: 16px; flex: none; }
.pt-btn-sm { height: var(--control-sm, 28px); padding: 0 var(--space-3); font-size: var(--text-label-size, 13px); gap: var(--space-1); }
.pt-btn-lg { height: var(--control-lg, 40px); padding: 0 var(--space-6); font-size: var(--text-body-size, 16px); }
.pt-btn-block { display: flex; width: 100%; }
.pt-btn-icon { padding: 0; width: var(--control-md, 32px); }
.pt-btn-icon.pt-btn-sm { width: var(--control-sm, 28px); } .pt-btn-icon.pt-btn-lg { width: var(--control-lg, 40px); }
.pt-btn.is-loading { cursor: progress; }
.pt-btn-primary { background: var(--primary); color: var(--on-primary); }
.pt-btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.pt-btn-accent { background: var(--accent); color: var(--on-accent); }
.pt-btn-accent:hover:not(:disabled) { background: var(--accent-hover); }
.pt-btn-secondary, .pt-btn-outline { background: var(--surface-0); color: var(--ink); border-color: var(--line-strong); }
.pt-btn-secondary:hover:not(:disabled), .pt-btn-outline:hover:not(:disabled) { background: var(--surface-200); }
.pt-btn-ghost { background: transparent; color: var(--ink); }
.pt-btn-ghost:hover:not(:disabled) { background: var(--surface-200); }
.pt-btn-danger { background: var(--surface-0); color: var(--danger); border-color: var(--danger); }
.pt-btn-danger:hover:not(:disabled) { background: var(--danger-soft); }
.pt-btn-danger-filled { background: var(--danger); color: var(--surface-0); }
.pt-btn-danger-filled:hover:not(:disabled) { filter: brightness(.92); }
.pt-btn[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary-text); border-color: var(--primary); }
.pt-inline-btn { font: inherit; color: var(--primary-text); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.pt-inline-btn:hover { text-decoration-thickness: 2px; }
.pt-inline-btn:disabled { color: var(--ink-muted); cursor: not-allowed; text-decoration: none; }
.pt-spinner { display: inline-block; flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; opacity: .8; animation: var(--animation-spin); vertical-align: middle; }
.pt-spinner-sm { width: 14px; height: 14px; border-width: 2px; }
.pt-spinner-lg { width: 32px; height: 32px; border-width: 3px; }
@media (prefers-reduced-motion: reduce) { .pt-btn { transition: none; } .pt-spinner { animation-duration: 2s; } }
/* Pressed: a small darkening that works on every variant and in both themes. */
.pt-btn:active:not(:disabled):not(.is-loading), .pt-icon-btn:active:not(:disabled) { filter: brightness(.94); }
[data-theme="dark"] .pt-btn:active:not(:disabled):not(.is-loading), [data-theme="dark"] .pt-icon-btn:active:not(:disabled) { filter: brightness(1.12); }

.pt-accordion { border-top: var(--border-width-thin) solid var(--line); }
.pt-accordion-item { border-bottom: var(--border-width-thin) solid var(--line); }
.pt-accordion-h { margin: 0; font-size: inherit; font-weight: inherit; }
.pt-accordion-trigger { font: inherit; font-weight: 600; width: 100%; display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-1); background: none; border: 0; color: var(--ink); cursor: pointer; text-align: left; }
.pt-accordion-trigger:hover:not(:disabled) { background: var(--surface-100); }
.pt-accordion-trigger:disabled { color: var(--ink-muted); cursor: not-allowed; }
.pt-accordion-chev { flex: none; transition: transform var(--duration-fast); color: var(--ink-muted); }
.pt-accordion-trigger[aria-expanded="true"] .pt-accordion-chev { transform: rotate(180deg); }
.pt-accordion-panel { padding: 0 var(--space-1) var(--space-4); color: var(--ink); font-size: var(--text-body-sm-size, 14px); }
.pt-avatar { display: inline-grid; place-items: center; flex: none; overflow: hidden; border-radius: 50%; font-weight: 600; width: 32px; height: 32px; font-size: 13px; line-height: 1; user-select: none; }
.pt-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pt-avatar-sm { width: 24px; height: 24px; font-size: 10px; } .pt-avatar-lg { width: 40px; height: 40px; font-size: 15px; } .pt-avatar-xl { width: 64px; height: 64px; font-size: 22px; }
.pt-avatar-square { border-radius: var(--radius-md); }
.pt-avatar-group { display: inline-flex; flex-direction: row; }
.pt-avatar-group > .pt-avatar { box-shadow: 0 0 0 2px var(--surface-0); }
.pt-avatar-group > .pt-avatar + .pt-avatar { margin-left: -8px; }
.pt-avatar-more { background: var(--surface-200); color: var(--ink); }
.pt-chip { display: inline-flex; align-items: center; gap: var(--space-1); max-width: 100%; height: 24px; padding: 0 var(--space-2); border-radius: var(--radius-pill); font-size: var(--text-label-size, 13px); font-weight: 500; line-height: 1; white-space: nowrap; border: 1px solid transparent; font-family: inherit; }
.pt-chip-sm { height: 20px; font-size: 12px; padding: 0 6px; }
.pt-chip-label { overflow: hidden; text-overflow: ellipsis; }
.pt-chip-filled.pt-chipc-neutral { background: var(--surface-200); color: var(--ink); }
.pt-chip-filled.pt-chipc-primary { background: var(--primary-soft); color: var(--primary-text); }
.pt-chip-filled.pt-chipc-secondary { background: var(--secondary-soft); color: var(--secondary-text); }
.pt-chip-filled.pt-chipc-accent { background: var(--accent-soft); color: var(--accent-text); }
.pt-chip-filled.pt-chipc-info { background: var(--info-soft); color: var(--info); }
.pt-chip-filled.pt-chipc-success { background: var(--success-soft); color: var(--success); }
.pt-chip-filled.pt-chipc-warning { background: var(--warning-soft); color: var(--warning); }
.pt-chip-filled.pt-chipc-danger { background: var(--danger-soft); color: var(--danger); }
.pt-chip-outline { background: var(--surface-0); color: var(--ink); border-color: var(--line-strong); }
.pt-chip-outline.pt-chipc-primary { color: var(--primary-text); border-color: var(--primary); }
.pt-chip-outline.pt-chipc-info { color: var(--info); border-color: var(--info); } .pt-chip-outline.pt-chipc-success { color: var(--success); border-color: var(--success); }
.pt-chip-outline.pt-chipc-warning { color: var(--warning); border-color: var(--warning); } .pt-chip-outline.pt-chipc-danger { color: var(--danger); border-color: var(--danger); }
.pt-chip-outline.pt-chipc-accent { color: var(--accent-text); border-color: var(--accent); } .pt-chip-outline.pt-chipc-secondary { color: var(--secondary-text); border-color: var(--secondary); }
.pt-chip-emphasized.pt-chipc-neutral { background: var(--ink); color: var(--ink-inverse); }
.pt-chip-emphasized.pt-chipc-primary { background: var(--primary); color: var(--on-primary); } .pt-chip-emphasized.pt-chipc-secondary { background: var(--secondary); color: var(--on-secondary); }
.pt-chip-emphasized.pt-chipc-accent { background: var(--accent); color: var(--on-accent); }
.pt-chip-emphasized.pt-chipc-info { background: var(--info); color: var(--surface-0); } .pt-chip-emphasized.pt-chipc-success { background: var(--success); color: var(--surface-0); }
.pt-chip-emphasized.pt-chipc-warning { background: var(--warning); color: var(--surface-0); } .pt-chip-emphasized.pt-chipc-danger { background: var(--danger); color: var(--surface-0); }
.pt-chip-x { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-right: -4px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; opacity: .75; }
.pt-chip-x:hover { opacity: 1; background: color-mix(in srgb, currentColor 16%, transparent); }
.pt-chip-group { display: flex; flex-wrap: wrap; gap: var(--space-1); align-items: center; }
.pt-chip-more { cursor: pointer; }
.pt-health { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-body-sm-size, 14px); }
.pt-health-label { color: var(--ink); }
.pt-health-dot { width: 10px; height: 10px; flex: none; background: currentColor; border-radius: 50%; }
.pt-health-warning { border-radius: 1px; transform: rotate(45deg) scale(.85); }
.pt-health-critical { border-radius: 2px; }
.pt-health-unknown { background: transparent; border: 2px solid currentColor; }
.pt-health-inactive { background: var(--line-strong); }
.pt-message { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); font-size: var(--text-body-sm-size, 14px); line-height: var(--text-body-sm-lh, 20px); color: var(--ink); border: 1px solid transparent; }
.pt-message-icon { display: flex; padding-top: 0; }
.pt-message-icon svg { width: 20px; height: 20px; }
.pt-message-title { margin: 0; font-weight: 600; }
.pt-message-body > :last-child { margin-bottom: 0; }
.pt-message-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-3); }
.pt-message-x { margin: -4px -8px -4px 0; }
.pt-message-neutral { background: var(--surface-100); border-color: var(--line); } .pt-message-neutral .pt-message-icon { color: var(--ink-muted); }
.pt-message-info { background: var(--info-soft); } .pt-message-info .pt-message-icon { color: var(--info); }
.pt-message-success { background: var(--success-soft); } .pt-message-success .pt-message-icon { color: var(--success); }
.pt-message-warning { background: var(--warning-soft); } .pt-message-warning .pt-message-icon { color: var(--warning); }
.pt-message-danger { background: var(--danger-soft); } .pt-message-danger .pt-message-icon { color: var(--danger); }
.pt-progress { display: grid; gap: var(--space-1); min-width: 0; }
.pt-progress-head { display: flex; justify-content: space-between; gap: var(--space-2); font-size: var(--text-label-size, 13px); color: var(--ink); }
.pt-progress-val { color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.pt-progress-track { height: 8px; border-radius: var(--radius-pill); background: var(--surface-200); overflow: hidden; position: relative; }
.pt-progress-sm .pt-progress-track { height: 4px; }
.pt-progress-bar { height: 100%; border-radius: inherit; transition: width var(--duration-moderate) var(--easing-standard); }
.pt-progress-track.is-indeterminate .pt-progress-bar { width: 40%; animation: var(--animation-indeterminate); }
.pt-progress-circle { position: relative; display: inline-grid; place-items: center; flex: none; }
.pt-progress-circle svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.pt-progress-circle circle { fill: none; stroke-width: 4; }
.pt-progress-circle-track { stroke: var(--surface-200); }
.pt-progress-circle-bar { stroke-linecap: round; transition: stroke-dasharray var(--duration-moderate); }
.pt-progress-circle.is-indeterminate svg { animation: var(--animation-spin); }
.pt-progress-circle-val { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pt-skeleton { display: block; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--surface-200) 25%, var(--surface-100) 50%, var(--surface-200) 75%); background-size: 200% 100%; animation: var(--animation-shimmer); }
.pt-skeleton-text { display: grid; gap: var(--space-2); }
.pt-snippet { border: var(--border-width-thin) solid var(--line); border-radius: var(--radius-lg); background: var(--surface-100); overflow: hidden; min-width: 0; margin-bottom: var(--space-3); }
.pt-snippet-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: 2px 4px 2px var(--space-3); border-bottom: var(--border-width-thin) solid var(--line); min-height: 32px; }
.pt-snippet-lang { font-size: 12px; color: var(--ink-muted); font-family: var(--font-mono); }
.pt-snippet-pre { margin: 0; padding: var(--space-3); overflow: auto; font: var(--text-code-size, 13px)/var(--text-code-lh, 20px) var(--font-mono); color: var(--ink); tab-size: 2; }
.pt-snippet-ln { display: inline-block; width: 2.5em; margin-right: var(--space-3); text-align: right; color: var(--ink-muted); user-select: none; opacity: .7; }
.pt-snippet-more { width: 100%; padding: var(--space-2); border: 0; border-top: var(--border-width-thin) solid var(--line); background: var(--surface-0); color: var(--primary-text); font: inherit; font-size: 13px; cursor: pointer; }
.pt-kbd-group { display: inline-flex; align-items: center; gap: 3px; font: inherit; }
.pt-kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; font: 500 11px/1 var(--font-mono); color: var(--ink); background: var(--surface-0); border: var(--border-width-thin) solid var(--line-strong); border-bottom-width: 2px; border-radius: var(--radius-sm); }
.pt-kbd-plus { font-size: 11px; color: var(--ink-muted); }
.pt-expandable .pt-inline-btn { margin-top: var(--space-1); font-size: var(--text-body-sm-size, 14px); }
.pt-markdown { font-size: var(--text-body-size, 16px); line-height: var(--text-body-lh, 24px); overflow-wrap: anywhere; }
.pt-md-h { margin: var(--space-4) 0 var(--space-2); font-family: var(--font-heading, var(--font-sans)); line-height: 1.3; }
.pt-markdown > :first-child { margin-top: 0; }
@media (prefers-reduced-motion: reduce) { .pt-skeleton { animation: none; } .pt-accordion-chev, .pt-progress-bar { transition: none; } }

/* ---------- Forms ---------- */
.pt-field { min-width: 0; }
.pt-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); }
.pt-req { color: var(--danger); margin-left: 2px; }
.pt-error { display: inline-flex; align-items: flex-start; gap: var(--space-1); }
.pt-error-icon { flex: none; width: 14px; height: 14px; margin-top: 1px; }
.pt-field-disabled .pt-label { color: var(--ink-muted); }
.pt-form { display: flex; flex-direction: column; gap: var(--space-5); }
.pt-form-h .pt-field { display: grid; grid-template-columns: minmax(120px, 30%) 1fr; column-gap: var(--space-4); align-items: center; }
.pt-form-h .pt-field > :not(.pt-label-row) { grid-column: 2; }
@media (max-width: 639.98px) { .pt-form-h .pt-field { display: flex; } }
.pt-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.pt-legend { padding: 0; margin-bottom: var(--space-1); font-family: var(--font-heading, inherit); font-weight: var(--heading-weight, 600); font-size: 16px; line-height: 24px; color: var(--ink); }
.pt-fieldset-desc { margin: 0 0 var(--space-3); }
.pt-fieldset-body { display: flex; flex-direction: column; gap: var(--space-4); }

/* Control shell: one border around text + affixes + buttons */
.pt-ctl { position: relative; display: flex; align-items: center; gap: var(--space-1); width: 100%; min-width: 0; height: var(--control-md); padding: 0 var(--space-1) 0 var(--space-3); border: var(--border-width-thin) solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface-0); color: var(--ink); font-size: 14px; transition: border-color var(--duration-fast), box-shadow var(--duration-fast); }
.pt-ctl-sm { height: var(--control-sm); font-size: 13px; padding-left: var(--space-2); }
.pt-ctl-lg { height: var(--control-lg); font-size: 16px; }
.pt-ctl:hover:not(.pt-ctl-disabled) { border-color: var(--ink-muted); }
.pt-ctl:focus-within { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.pt-ctl :focus-visible { outline: none; }
.pt-ctl .pt-ctl-btn:focus-visible { outline: var(--focus-ring); outline-offset: -2px; }
.pt-ctl-invalid, .pt-ctl-invalid:hover:not(.pt-ctl-disabled) { border-color: var(--danger); }
.pt-ctl-invalid:focus-within { box-shadow: 0 0 0 1px var(--danger); border-color: var(--danger); }
.pt-ctl-disabled { background: var(--surface-100); color: var(--ink-muted); cursor: not-allowed; }
.pt-ctl-input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; }
.pt-ctl-input::placeholder { color: var(--ink-muted); }
.pt-ctl-input:disabled { cursor: not-allowed; }
.pt-ctl-input::-webkit-search-cancel-button { display: none; }
.pt-ctl-input:read-only:not(:disabled) { cursor: default; }
.pt-ctl-affix { flex: none; display: inline-flex; align-items: center; gap: 2px; color: var(--ink-muted); }
.pt-ctl-affix:first-child { margin-right: var(--space-1); }
.pt-ctl-btn { width: calc(var(--control-md) - 8px); height: calc(var(--control-md) - 8px); }
.pt-ctl-sm .pt-ctl-btn { width: calc(var(--control-sm) - 6px); height: calc(var(--control-sm) - 6px); }
.pt-ctl:not(:has(.pt-ctl-btn, .pt-sel-chev)) { padding-right: var(--space-3); }
.pt-number .pt-ctl-input { font-variant-numeric: tabular-nums; }
.pt-number-unit { padding: 0 var(--space-1); font-size: 13px; }
.pt-number-steps { display: inline-flex; border-left: var(--border-width-thin) solid var(--line); padding-left: 2px; }
.pt-secret .pt-ctl-input { font-family: var(--font-mono); }
.pt-textarea { height: auto; min-height: calc(var(--control-md) * 2); padding: var(--space-2) var(--space-3); line-height: 20px; resize: vertical; }
.pt-textarea-auto { resize: none; overflow-y: auto; }
.pt-input:focus-visible, .pt-textarea:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.pt-textarea-wrap { display: flex; flex-direction: column; gap: var(--space-1); }
.pt-count { align-self: flex-end; font-variant-numeric: tabular-nums; }

/* Radio */
.pt-radio-dot { border-radius: 50%; position: relative; }
.pt-radio-dot::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--on-primary); transform: scale(0); transition: transform var(--duration-fast); }
.pt-check-input:checked + .pt-radio-dot { background: var(--primary); border-color: var(--primary); }
.pt-check-input:checked + .pt-radio-dot::after { transform: scale(1); }
.pt-check-input:focus-visible + .pt-check-box { outline: var(--focus-ring); outline-offset: var(--focus-ring-offset); }
.pt-check-input[aria-invalid="true"] + .pt-check-box { border-color: var(--danger); }
.pt-choice-group { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.pt-choice-group > legend { margin-bottom: var(--space-2); padding: 0; }
.pt-choice-list { display: flex; flex-direction: column; gap: var(--space-2); }
.pt-choice-row { flex-direction: row; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }

/* Toggle button group */
.pt-toggle-group { display: inline-flex; max-width: 100%; overflow-x: auto; padding: 2px; gap: 2px; border-radius: var(--radius-md); background: var(--surface-200); }
.pt-toggle { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1); height: calc(var(--control-md) - 4px); padding: 0 var(--space-3); border: 0; border-radius: calc(var(--radius-md) - 2px); background: transparent; color: var(--ink-muted); font: inherit; font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer; transition: background-color var(--duration-fast), color var(--duration-fast); }
.pt-toggle svg { width: 16px; height: 16px; }
.pt-toggle:hover:not(:disabled) { color: var(--ink); }
.pt-toggle[aria-pressed="true"] { background: var(--surface-0); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 0 0 1px var(--line); }
.pt-toggle:disabled { opacity: .45; cursor: not-allowed; }
.pt-toggle-icon { width: calc(var(--control-md) - 4px); padding: 0; }
.pt-toggle-sm .pt-toggle { height: calc(var(--control-sm) - 4px); font-size: 13px; padding: 0 var(--space-2); }
.pt-toggle-sm .pt-toggle-icon { width: calc(var(--control-sm) - 4px); padding: 0; }
.pt-toggle-lg .pt-toggle { height: calc(var(--control-lg) - 4px); padding: 0 var(--space-4); }

/* Select */
.pt-sel { cursor: pointer; padding-right: var(--space-2); }
.pt-sel-trigger { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; gap: var(--space-2); padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: inherit; }
.pt-sel-trigger svg { flex: none; width: 16px; height: 16px; }
.pt-sel-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-sel-placeholder { color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-sel-count { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--primary-soft); color: var(--primary-text); font-size: 12px; font-weight: 600; line-height: 20px; text-align: center; }
.pt-sel-chev { flex: none; color: var(--ink-muted); pointer-events: none; transition: transform var(--duration-fast); }
.pt-ctl-open .pt-sel-chev { transform: rotate(180deg); }

/* Floating layers */
.pt-float { background: transparent; z-index: var(--z-popover); font-size: 14px; line-height: 20px; }
.pt-pop { min-width: 160px; max-width: min(420px, calc(100vw - 16px)); background: var(--surface-0); color: var(--ink); border: var(--border-width-thin) solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-floating); animation: var(--animation-scale-in); transform-origin: top; overflow: hidden; }
.pt-listbox-pop { display: flex; flex-direction: column; max-height: min(360px, 60vh); }
.pt-listbox-filter { display: flex; align-items: center; gap: var(--space-2); padding: 0 var(--space-3); border-bottom: var(--border-width-thin) solid var(--line); color: var(--ink-muted); }
.pt-listbox-search { flex: 1; min-width: 0; height: var(--control-md); border: 0; background: none; color: var(--ink); font: inherit; }
.pt-listbox-search:focus { outline: none; }
.pt-listbox { list-style: none; margin: 0; padding: var(--space-1); overflow-y: auto; flex: 1; }
.pt-listbox:focus { outline: none; }
.pt-option { display: flex; align-items: center; gap: var(--space-2); min-height: var(--control-md); padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); cursor: pointer; user-select: none; }
.pt-option-active { background: var(--surface-200); }
.pt-option[aria-selected="true"]:not(.pt-option-multi) { color: var(--primary-text); font-weight: 500; }
.pt-option[aria-disabled] { opacity: .45; cursor: not-allowed; }
.pt-option-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pt-option-text > :first-child { overflow: hidden; text-overflow: ellipsis; }
.pt-option-icon { display: inline-flex; color: var(--ink-muted); }
.pt-option-check { flex: none; color: var(--primary-text); }
.pt-option .pt-check-box { margin-top: 0; }
.pt-option-tick { width: 12px; height: 12px; opacity: 0; stroke-width: 2; }
.pt-check-box-on { background: var(--primary); border-color: var(--primary); }
.pt-check-box-on .pt-option-tick { opacity: 1; }
.pt-option-group { padding: var(--space-2) var(--space-2) var(--space-1); font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--ink-muted); }
.pt-option-group:not(:first-child) { margin-top: var(--space-1); border-top: var(--border-width-thin) solid var(--line); }
.pt-option-empty { padding: var(--space-3) var(--space-2); color: var(--ink-muted); }
.pt-listbox-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-top: var(--border-width-thin) solid var(--line); font-size: 13px; }

/* Calendar */
.pt-cal { width: max-content; padding: var(--space-2); }
.pt-cal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-1); }
.pt-cal-title { font-weight: 600; font-size: 14px; }
.pt-cal-grid { border-collapse: collapse; }
.pt-cal-grid th { width: 36px; height: 28px; font-size: 12px; font-weight: 500; color: var(--ink-muted); text-align: center; }
.pt-cal-grid td { padding: 1px 0; text-align: center; }
.pt-cal-day { width: 34px; height: 32px; margin: 0 1px; padding: 0; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--ink); font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer; position: relative; }
.pt-cal-day:hover:not(:disabled) { background: var(--surface-200); }
.pt-cal-out { color: var(--ink-muted); }
.pt-cal-today::after { content: ""; position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--primary); }
.pt-cal-sel, .pt-cal-sel:hover:not(:disabled) { background: var(--primary); color: var(--on-primary); font-weight: 600; }
.pt-cal-sel.pt-cal-today::after { background: var(--on-primary); }
.pt-cal-day:disabled { opacity: .35; cursor: not-allowed; text-decoration: line-through; }
.pt-cal-in { background: var(--primary-soft); }
.pt-cal-in .pt-cal-day { border-radius: 0; color: var(--primary-text); }
.pt-cal-start { background: linear-gradient(90deg, transparent 50%, var(--primary-soft) 50%); }
.pt-cal-end { background: linear-gradient(90deg, var(--primary-soft) 50%, transparent 50%); }
.pt-date-pop { max-width: calc(100vw - 16px); overflow: auto; }
.pt-date-foot { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-top: var(--border-width-thin) solid var(--line); }
.pt-date-foot .pt-time { width: auto; margin-right: auto; height: var(--control-sm); }
.pt-range-summary { margin-right: auto; font-variant-numeric: tabular-nums; }
.pt-range-body { display: flex; }
.pt-range-presets { list-style: none; margin: 0; padding: var(--space-2); border-right: var(--border-width-thin) solid var(--line); display: flex; flex-direction: column; gap: 2px; min-width: 132px; }
.pt-range-preset { width: 100%; padding: var(--space-1) var(--space-2); border: 0; border-radius: var(--radius-sm); background: none; color: var(--ink); font: inherit; font-size: 13px; text-align: left; cursor: pointer; white-space: nowrap; }
.pt-range-preset:hover { background: var(--surface-200); }
.pt-range-times { display: flex; gap: var(--space-2); padding: 0 var(--space-2) var(--space-2); }
.pt-range-times label { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.pt-range-times .pt-time { height: var(--control-sm); }
.pt-date .pt-ctl-input { font-variant-numeric: tabular-nums; }
.pt-date-range .pt-ctl-input { cursor: pointer; text-overflow: ellipsis; }
@media (max-width: 639.98px) {
  .pt-range-body { flex-direction: column; }
  .pt-range-presets { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: var(--border-width-thin) solid var(--line); }
  .pt-range-preset { width: auto; }
}
@media (prefers-reduced-motion: reduce) { .pt-pop { animation: none; } .pt-radio-dot::after, .pt-sel-chev { transition: none; } }

/* ---------- Modal, Drawer, Sheet ---------- */
.pt-layer { position: fixed; inset: 0; z-index: var(--z-overlay); display: flex; background: rgba(15,17,19,0.48); animation: var(--animation-fade-in); }
.pt-layer-nonmodal { background: transparent; pointer-events: none; }
.pt-layer-nonmodal .pt-overlay { pointer-events: auto; }
.pt-layer-modal { align-items: center; justify-content: center; padding: var(--space-4); }
.pt-layer-drawer.pt-layer-right { justify-content: flex-end; }
.pt-layer-sheet { align-items: flex-end; justify-content: center; }
.pt-overlay { display: flex; flex-direction: column; min-height: 0; background: var(--surface-0); color: var(--ink); box-shadow: var(--shadow-overlay); font-size: 14px; line-height: 20px; }
.pt-overlay:focus { outline: none; }
.pt-modal { width: 100%; max-height: calc(100% - 16px); border: var(--border-width-thin) solid var(--line); border-radius: var(--radius-lg); animation: var(--animation-slide-in-up); }
.pt-modal-sm { max-width: 400px; } .pt-modal-md { max-width: 560px; } .pt-modal-lg { max-width: 760px; } .pt-modal-xl { max-width: 1040px; }
.pt-modal-full { max-width: none; height: 100%; }
.pt-drawer { height: 100%; max-width: 100%; border-left: var(--border-width-thin) solid var(--line); animation: var(--animation-slide-in-right); }
.pt-layer-left .pt-drawer { border-left: 0; border-right: var(--border-width-thin) solid var(--line); animation: var(--animation-slide-in-left); }
.pt-sheet { width: min(1200px, 100%); max-height: calc(100% - 24px); border: var(--border-width-thin) solid var(--line); border-bottom: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; animation: var(--animation-sheet-in); }
.pt-overlay-head { display: flex; align-items: flex-start; gap: var(--space-2); padding: var(--space-5) var(--space-5) 0 var(--space-6); }
.pt-overlay-titles { flex: 1; min-width: 0; }
.pt-overlay-title { margin: 0; font-family: var(--font-heading, inherit); font-weight: var(--heading-weight, 600); font-size: 18px; line-height: 26px; }
.pt-overlay-desc { margin: var(--space-1) 0 0; color: var(--ink-muted); }
.pt-overlay-body { flex: 1; min-height: 0; overflow: auto; padding: var(--space-4) var(--space-6); }
.pt-overlay-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); padding: var(--space-4) var(--space-6); border-top: var(--border-width-thin) solid var(--line); }
.pt-modal .pt-overlay-foot { border-top: 0; padding-top: var(--space-2); }
@media (max-width: 639.98px) {
  .pt-layer-modal { padding: var(--space-2); align-items: flex-end; }
  .pt-overlay-head { padding: var(--space-4) var(--space-3) 0 var(--space-4); }
  .pt-overlay-body, .pt-overlay-foot { padding-left: var(--space-4); padding-right: var(--space-4); }
}

/* ---------- Tooltip, Popover, overlays ---------- */
.pt-tooltip-anchor, .pt-popover-anchor, .pt-highlight-target { display: inline-flex; max-width: 100%; vertical-align: middle; }
.pt-float.pt-tooltip { z-index: var(--z-tooltip); }
.pt-tooltip { max-width: 260px; padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); background: var(--ink); color: var(--surface-0); font-size: 12px; line-height: 16px; pointer-events: none; animation: pt-fade-in var(--duration-fast) var(--easing-enter) both; }
.pt-popover { padding: var(--space-3) var(--space-4); max-width: min(360px, calc(100vw - 16px)); }
.pt-info-btn { width: 20px; height: 20px; vertical-align: middle; }
.pt-info-btn svg { width: 14px; height: 14px; }
.pt-info-pop { max-width: 300px; }
.pt-info-title { font-weight: 600; margin-bottom: var(--space-1); }
.pt-info-body { color: var(--ink-muted); }
.pt-term { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: help; text-decoration: underline dotted; text-underline-offset: 3px; text-decoration-color: var(--ink-muted); }
.pt-term:hover { text-decoration-color: currentColor; }
.pt-highlight-on > :first-child { border-radius: var(--radius-md); box-shadow: 0 0 0 2px var(--surface-0), 0 0 0 4px var(--accent); }
.pt-feature { width: 300px; padding: var(--space-3) var(--space-4); border-color: var(--accent); overflow: visible; }
.pt-feature-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-2); margin: 0 -8px var(--space-1) 0; }
.pt-feature-head b { padding-top: 4px; }
.pt-feature-body { color: var(--ink-muted); }
.pt-feature-foot { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-3); }
.pt-feature-foot .pt-hint { margin-right: auto; }

/* ---------- Menu ---------- */
.pt-menu { min-width: 180px; padding: var(--space-1); overflow-y: auto; max-height: min(420px, 70vh); }
.pt-menu-item { display: flex; align-items: center; gap: var(--space-2); min-height: var(--control-md); padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; cursor: pointer; user-select: none; }
.pt-menu-item:hover, .pt-menu-item:focus { background: var(--surface-200); outline: none; }
.pt-menu-item:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.pt-menu-item[aria-disabled] { opacity: .45; cursor: not-allowed; }
.pt-menu-item[aria-expanded="true"] { background: var(--surface-200); }
.pt-menu-danger { color: var(--danger); }
.pt-menu-icon { display: inline-flex; color: var(--ink-muted); }
.pt-menu-danger .pt-menu-icon { color: inherit; }
.pt-menu-label { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pt-menu-kbd { font: 12px var(--font-mono); color: var(--ink-muted); }
.pt-menu-sub { color: var(--ink-muted); }
.pt-menu-sep { height: 1px; margin: var(--space-1) calc(var(--space-1) * -1); background: var(--line); }
.pt-menu .pt-check-box { margin-top: 0; }

/* ---------- Tabs ---------- */
.pt-tabs-list { overflow-x: auto; scrollbar-width: none; }
.pt-tab { display: inline-flex; align-items: center; gap: var(--space-2); white-space: nowrap; }
.pt-tab svg { width: 16px; height: 16px; }
.pt-tab:disabled { opacity: .45; cursor: not-allowed; }
.pt-tab:focus-visible { outline: var(--focus-ring); outline-offset: -2px; border-radius: var(--radius-sm); }
.pt-tab-count { min-width: 20px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--surface-200); color: var(--ink-muted); font-size: 12px; line-height: 18px; text-align: center; }
.pt-tab[aria-selected="true"] .pt-tab-count { background: var(--primary-soft); color: var(--primary-text); }
.pt-tab-panel:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-ring-offset); }
.pt-tabs-contained .pt-tabs-list { display: inline-flex; max-width: 100%; gap: 2px; padding: 2px; border: 0; border-radius: var(--radius-md); background: var(--surface-200); }
.pt-tabs-contained .pt-tab { padding: var(--space-1) var(--space-3); margin: 0; border: 0; border-radius: calc(var(--radius-md) - 2px); }
.pt-tabs-contained .pt-tab[aria-selected="true"] { background: var(--surface-0); box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 0 0 1px var(--line); }

/* ---------- Breadcrumbs, Stepper, Pagination ---------- */
.pt-crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); margin: 0; padding: 0; list-style: none; font-size: 14px; }
.pt-crumbs li { display: inline-flex; align-items: center; gap: var(--space-1); min-width: 0; }
.pt-crumb-link { color: var(--ink-muted); text-decoration: none; }
.pt-crumb-link:hover { color: var(--ink); text-decoration: underline; }
.pt-crumb-current { color: var(--ink); font-weight: 500; }
.pt-crumb-sep { width: 14px; height: 14px; color: var(--ink-muted); }
.pt-crumb-more { font: inherit; padding: 0 var(--space-1); border: 0; border-radius: var(--radius-sm); background: none; color: var(--ink-muted); cursor: pointer; }
.pt-crumb-more:hover { background: var(--surface-200); color: var(--ink); }
.pt-stepper { display: flex; gap: var(--space-2); margin: 0; padding: 0; list-style: none; counter-reset: s; }
.pt-step { flex: 1; min-width: 0; display: flex; align-items: flex-start; }
.pt-step:not(:last-child)::after { content: ""; flex: 1; min-width: var(--space-4); height: 2px; margin: 13px var(--space-2) 0; border-radius: 1px; background: var(--line); }
.pt-step-done:not(:last-child)::after { background: var(--primary); }
.pt-step-btn { display: flex; align-items: flex-start; gap: var(--space-2); padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; }
button.pt-step-btn { cursor: pointer; border-radius: var(--radius-sm); }
button.pt-step-btn:hover .pt-step-label { text-decoration: underline; }
.pt-step-mark { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface-0); color: var(--ink-muted); font-size: 13px; font-weight: 600; }
.pt-step-mark svg { width: 14px; height: 14px; stroke-width: 2.2; }
.pt-step-done .pt-step-mark { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.pt-step-current .pt-step-mark { border-color: var(--primary); color: var(--primary-text); }
.pt-step-error .pt-step-mark { border-color: var(--danger); background: var(--danger); color: #fff; }
.pt-step-text { display: flex; flex-direction: column; padding-top: 3px; font-size: 14px; line-height: 20px; min-width: 0; }
.pt-step-label { font-weight: 500; white-space: nowrap; }
.pt-step-todo .pt-step-label { color: var(--ink-muted); }
.pt-step-current .pt-step-label { font-weight: 600; }
.pt-stepper-v { flex-direction: column; gap: 0; }
.pt-stepper-v .pt-step { flex-direction: column; }
.pt-stepper-v .pt-step:not(:last-child)::after { width: 2px; height: auto; min-height: var(--space-5); margin: var(--space-1) 0 var(--space-1) 13px; }
@media (max-width: 639.98px) { .pt-stepper:not(.pt-stepper-v) .pt-step-text .pt-hint, .pt-stepper:not(.pt-stepper-v) .pt-step:not(.pt-step-current) .pt-step-text { display: none; } }
.pt-pagination { display: inline-flex; align-items: center; gap: 2px; }
.pt-page { min-width: var(--control-sm); height: var(--control-sm); padding: 0 var(--space-1); border: 0; border-radius: var(--radius-md); background: none; color: var(--ink); font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer; }
.pt-page:hover { background: var(--surface-200); }
.pt-page[aria-current="page"] { background: var(--primary-soft); color: var(--primary-text); font-weight: 600; }
.pt-page-gap { min-width: 20px; text-align: center; color: var(--ink-muted); }

/* ---------- Toasts ---------- */
.pt-toasts { position: fixed; z-index: var(--z-toast); display: flex; flex-direction: column; gap: var(--space-2); width: min(380px, calc(100vw - 32px)); background: transparent; pointer-events: none; }
.pt-toasts-bottom-right { right: 16px; bottom: 16px; }
.pt-toasts-bottom-left { left: 16px; bottom: 16px; }
.pt-toasts-top-right { right: 16px; top: 16px; flex-direction: column-reverse; }
.pt-toasts-top-center { left: 50%; top: 16px; transform: translateX(-50%); flex-direction: column-reverse; }
.pt-toasts-bottom-center { left: 50%; bottom: 16px; transform: translateX(-50%); }
.pt-toast { position: relative; overflow: hidden; display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--space-2) var(--space-3) var(--space-4); border: var(--border-width-thin) solid var(--line); border-radius: var(--radius-lg); background: var(--surface-0); color: var(--ink); box-shadow: var(--shadow-overlay); font-size: 14px; line-height: 20px; pointer-events: auto; animation: var(--animation-slide-in-up); }
.pt-toast-icon { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--ink-muted); }
.pt-toast-info .pt-toast-icon { color: var(--info); } .pt-toast-success .pt-toast-icon { color: var(--success); }
.pt-toast-warning .pt-toast-icon { color: var(--warning); } .pt-toast-critical .pt-toast-icon { color: var(--danger); }
.pt-toast-critical { border-color: var(--danger); }
.pt-toast-text { flex: 1; min-width: 0; padding-top: 1px; }
.pt-toast-title { font-weight: 600; }
.pt-toast-msg { color: var(--ink-muted); }
.pt-toast-action { margin-top: var(--space-2); }
.pt-toast-timer { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--line-strong); transform-origin: left; animation: pt-countdown linear forwards; }

/* ---------- DataTable ---------- */
.pt-dt { display: flex; flex-direction: column; gap: var(--space-3); width: 100%; min-width: 0; }
.pt-dt-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.pt-dt-toolbar > .pt-ctl, .pt-dt-toolbar > .pt-field { width: auto; flex: 1 1 200px; max-width: 320px; }
.pt-dt-title { font-family: var(--font-heading, inherit); font-weight: 600; font-size: 16px; margin-right: var(--space-2); }
.pt-dt-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-left: auto; }
.pt-dt-tools .pt-btn svg { width: 16px; height: 16px; }
.pt-dt-selcount { font-size: 13px; font-weight: 500; color: var(--primary-text); }
.pt-dt-scroll { overflow: auto; }
.pt-dt-scroll thead th { position: sticky; top: 0; z-index: var(--z-raised); }
.pt-dt-table td { font-variant-numeric: tabular-nums; }
.pt-dt-table .pt-center { text-align: center; }
.pt-dt-narrow { width: 1%; white-space: nowrap; padding-right: 0 !important; }
.pt-dt-table .pt-dt-narrow:last-child { padding-right: var(--space-3) !important; }
.pt-dt-table .pt-check { vertical-align: middle; }
.pt-dt-table tbody tr.pt-dt-selected td { background: var(--primary-soft); }
.pt-dt-clickable tbody tr:not(.pt-dt-detail) { cursor: pointer; }
.pt-dt-expand svg { transition: transform var(--duration-fast); }
.pt-dt-open svg { transform: rotate(90deg); }
.pt-dt-detail td { background: var(--surface-100); padding: var(--space-4) var(--space-6); }
.pt-dt-detail:hover td { background: var(--surface-100) !important; }
.pt-dt-actions { text-align: right; }
.pt-dt-sk { height: 12px; width: 70%; }
.pt-dt-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-2) var(--space-4); font-size: 13px; }
.pt-dt-size { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--ink-muted); }
.pt-dt-size .pt-ctl { width: 76px; }
.pt-dt-range { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .pt-layer, .pt-overlay, .pt-toast, .pt-tooltip { animation: none; } .pt-toast-timer { display: none; } }
.pt-table-wrap { position: relative; }
.pt-modal .pt-overlay-head + .pt-overlay-foot { padding-top: var(--space-5); }
.pt-layer[data-theme="dark"]:not(.pt-layer-nonmodal) { background: rgba(0,0,0,0.64); }
@media (prefers-color-scheme: dark) { .pt-layer:not([data-theme="light"]):not(.pt-layer-nonmodal) { background: rgba(0,0,0,0.64); } }

/* DataTable: column actions, pinned columns, cell actions, line wrap */
.pt-th-inner { display: inline-flex; align-items: center; gap: var(--space-1); max-width: 100%; }
.pt-right .pt-th-inner { flex-direction: row-reverse; }
.pt-dt-colbtn, .pt-dt-cellbtn { width: 22px; height: 22px; flex: none; opacity: 0; }
.pt-dt-colbtn svg, .pt-dt-cellbtn svg { width: 14px; height: 14px; }
th:hover .pt-dt-colbtn, th:focus-within .pt-dt-colbtn, .pt-dt-colbtn[aria-expanded="true"],
td:hover .pt-dt-cellbtn, td:focus-within .pt-dt-cellbtn, .pt-dt-cellbtn[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .pt-dt-colbtn, .pt-dt-cellbtn { opacity: 1; } }
.pt-dt-cell { display: flex; align-items: center; gap: var(--space-1); min-width: 0; }
.pt-dt-cell-v { flex: 1 1 auto; min-width: 0; }
.pt-right .pt-dt-cell { flex-direction: row-reverse; }
.pt-dt-table .pt-dt-pin { position: sticky; z-index: var(--z-raised); background: var(--surface-0); }
.pt-dt-table thead .pt-dt-pin { z-index: calc(var(--z-raised) + 1); background: var(--surface-100); }
.pt-dt-table .pt-dt-pin-last { box-shadow: inset calc(-1 * var(--border-width-thin)) 0 0 var(--line); }
.pt-dt-table tbody tr:hover td.pt-dt-pin { background: var(--surface-100); }
.pt-dt-table tbody tr.pt-dt-selected td.pt-dt-pin { background: var(--primary-soft); }
.pt-dt-nowrap td, .pt-dt-nowrap th { white-space: nowrap; }
.pt-dt-nowrap td { max-width: 24rem; overflow: hidden; text-overflow: ellipsis; }
.pt-dt-nowrap .pt-dt-cell-v { overflow: hidden; text-overflow: ellipsis; }

/* ---------- Charts ---------- */
.pt-chart { margin: 0; min-width: 0; display: flex; flex-direction: column; gap: var(--space-3); transition: opacity var(--duration-fast); }
.pt-chart-loading { opacity: .5; }
.pt-chart-head { display: flex; align-items: flex-start; gap: var(--space-2); }
.pt-chart-titles { flex: 1; min-width: 0; }
.pt-chart-title { font-weight: 600; font-size: 14px; line-height: 20px; color: var(--ink); }
.pt-chart-sub { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.pt-chart-toggle[aria-pressed="true"] { background: var(--surface-200); color: var(--ink); }
.pt-chart-table { max-height: 320px; overflow: auto; }
.pt-plot { position: relative; width: 100%; min-width: 0; }
.pt-plot-svg { display: block; overflow: visible; touch-action: pan-y; }
.pt-plot-svg:focus { outline: none; }
.pt-plot-svg:focus-visible { outline: var(--focus-ring); outline-offset: 4px; border-radius: 4px; }
.pt-grid { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.pt-axis { stroke: var(--line-strong); stroke-width: 1; shape-rendering: crispEdges; }
.pt-tick { fill: var(--ink-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.pt-axis-label { fill: var(--ink-muted); font-size: 11px; font-weight: 500; }
.pt-cat { fill: var(--ink); font-size: 12px; }
.pt-value { fill: var(--ink); font-size: 12px; font-weight: 500; }
.pt-direct { fill: var(--ink); font-size: 12px; font-weight: 500; }
.pt-crosshair { stroke: var(--ink-muted); stroke-width: 1; shape-rendering: crispEdges; }
.pt-ring { stroke: var(--surface-0); stroke-width: 2; paint-order: stroke; }
.pt-hover-band { fill: var(--surface-200); opacity: .5; }
.pt-threshold-label { fill: var(--ink-muted); font-weight: 500; paint-order: stroke; stroke: var(--surface-0); stroke-width: 3px; }

.pt-legend { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); margin: 0; padding: 0; list-style: none; font-size: 12px; line-height: 18px; color: var(--ink); }
.pt-legend li { display: inline-flex; align-items: center; min-width: 0; }
.pt-legend li > button { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px; margin: -2px -4px; border: 0; border-radius: var(--radius-sm); background: none; color: inherit; font: inherit; cursor: pointer; }
.pt-legend li > button:hover { background: var(--surface-200); }
.pt-legend li:not(:has(button)) { gap: 6px; }
.pt-legend-off { opacity: .45; }
.pt-legend-off .pt-legend-name { text-decoration: line-through; }
.pt-legend-key { flex: none; display: inline-block; }
.pt-legend-rect { width: 10px; height: 10px; border-radius: 2px; }
.pt-legend-line { width: 14px; height: 2px; border-radius: 1px; }
.pt-legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.pt-legend-value { margin-left: var(--space-1); font-weight: 600; font-variant-numeric: tabular-nums; }
.pt-legend-col { flex-direction: column; gap: var(--space-2); }
.pt-legend-col li { width: 100%; }
.pt-legend-col .pt-legend-value { margin-left: auto; padding-left: var(--space-4); }

.pt-chart-tip { position: absolute; z-index: var(--z-raised); min-width: 120px; max-width: 260px; padding: var(--space-2) var(--space-3); border: var(--border-width-thin) solid var(--line); border-radius: var(--radius-md); background: var(--surface-0); box-shadow: var(--shadow-floating); font-size: 12px; line-height: 18px; pointer-events: none; }
.pt-chart-tip-title { color: var(--ink-muted); margin-bottom: 2px; white-space: nowrap; }
.pt-chart-tip-row { display: flex; align-items: center; gap: var(--space-2); white-space: nowrap; }
.pt-chart-tip-row b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.pt-chart-tip-row span:last-child { color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pt-chart-tip-title { overflow: hidden; text-overflow: ellipsis; }

/* Donut / gauge */
.pt-donut-body { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-6); }
.pt-donut-body .pt-legend-col { flex: 1; min-width: 160px; max-width: 320px; }
.pt-slice { cursor: default; transition: opacity var(--duration-fast); }
.pt-slice:focus { outline: none; }
.pt-slice:focus-visible { stroke: var(--focus); }
.pt-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; text-align: center; padding: 0 22%; }
.pt-donut-center b { font-size: 22px; line-height: 28px; font-weight: 600; color: var(--ink); }
.pt-donut-center span { font-size: 12px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.pt-gauge { position: relative; text-align: center; }
.pt-gauge svg { display: block; overflow: visible; }
.pt-gauge-value { position: absolute; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; }
.pt-gauge-value b { font-weight: 600; line-height: 1.1; color: var(--ink); }
.pt-gauge-value span { font-size: 12px; color: var(--ink-muted); }

/* Meters, top list */
.pt-meter { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pt-meter-row { display: flex; justify-content: space-between; gap: var(--space-2); font-size: 13px; line-height: 18px; }
.pt-meter-label { color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-meter-value { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pt-meter-value .pt-hint { font-weight: 400; }
.pt-meter-track { position: relative; height: 8px; border-radius: var(--radius-pill); overflow: hidden; }
.pt-meter-fill { position: absolute; inset: 0 auto 0 0; border-radius: var(--radius-pill); transition: width var(--duration-slow) var(--easing-standard); }
.pt-meter-tick { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--surface-0); }
.pt-mmeter { position: relative; display: flex; gap: 2px; width: 100%; }
.pt-mmeter-thin { height: 8px; }
.pt-mmeter-tall { height: 28px; }
.pt-mmeter-seg { flex-basis: 0; min-width: 2px; display: flex; align-items: center; padding: 0 var(--space-2); overflow: hidden; transition: opacity var(--duration-fast); }
.pt-mmeter-seg:focus { outline: none; } .pt-mmeter-seg:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-ring-offset); }
.pt-mmeter-thin .pt-mmeter-seg { border-radius: var(--radius-pill); padding: 0; }
.pt-mmeter-tall .pt-mmeter-seg { border-radius: 4px; }
.pt-mmeter-rest { flex-basis: 0; background: var(--surface-200); border-radius: 4px; }
.pt-mmeter-thin .pt-mmeter-rest { border-radius: var(--radius-pill); }
.pt-mmeter-label { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: #fff; white-space: nowrap; }
.pt-toplist-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--space-2); }
.pt-toplist-list li { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; column-gap: var(--space-2); row-gap: 4px; align-items: baseline; font-size: 13px; line-height: 18px; }
.pt-toplist-rank { color: var(--ink-muted); font-variant-numeric: tabular-nums; text-align: right; }
.pt-toplist-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-toplist-value { font-weight: 600; font-variant-numeric: tabular-nums; }
.pt-toplist-track { grid-column: 2 / 4; height: 6px; border-radius: var(--radius-pill); background: var(--surface-200); overflow: hidden; }
.pt-toplist-track span { display: block; height: 100%; border-radius: var(--radius-pill); }

/* Single value, sparkline */
.pt-spark { width: 100%; min-width: 40px; }
.pt-spark svg { display: block; overflow: visible; }
.pt-sv { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: var(--space-4); border: var(--border-width-thin) solid var(--line); border-radius: var(--radius-lg); background: var(--surface-0); }
.pt-sv-label { display: flex; align-items: center; gap: 6px; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.pt-sv-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sv-status); }
.pt-sv-value { font-family: var(--font-heading, inherit); font-size: 28px; line-height: 36px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.pt-sv-unit { margin-left: 4px; font-size: 14px; font-weight: 500; color: var(--ink-muted); letter-spacing: 0; }
.pt-sv-hero .pt-sv-value { font-size: 52px; line-height: 60px; }
.pt-sv-delta { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--ink-muted); }
.pt-sv-good { color: var(--success); } .pt-sv-bad { color: var(--danger); }
.pt-sv-period { color: var(--ink-muted); font-weight: 400; }
.pt-sv-trend { margin-top: var(--space-2); }
.pt-sv-grid { display: grid; gap: var(--space-3); }

/* Treemap, honeycomb, sankey, flame */
.pt-treemap g:focus { outline: none; }
.pt-treemap g:focus-visible rect:first-child { stroke: var(--focus); stroke-width: 2; }
.pt-tm-name { fill: var(--ink); font-size: 12px; font-weight: 500; pointer-events: none; }
.pt-tm-value { fill: var(--ink-muted); font-size: 12px; pointer-events: none; }
.pt-tm-group { fill: var(--ink); font-size: 11px; font-weight: 700; letter-spacing: .02em; pointer-events: none; }
.pt-hex { transition: opacity var(--duration-fast); }
.pt-hex:focus { outline: none; } .pt-hex:focus-visible { stroke: var(--focus); stroke-width: 2; }
.pt-hex-click { cursor: pointer; }
.pt-seq-legend { display: flex; align-items: center; gap: var(--space-2); font-size: 12px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.pt-seq-ramp { width: 120px; height: 8px; border-radius: var(--radius-pill); background: linear-gradient(90deg, color-mix(in oklab, var(--chart-2) 18%, var(--surface-0)), var(--chart-2)); }
.pt-sankey-link { transition: stroke-opacity var(--duration-fast); }
.pt-sankey-link:focus { outline: none; }
.pt-flame-frame { cursor: pointer; }
.pt-flame-frame:hover rect, .pt-flame-frame:focus-visible rect { stroke: var(--ink); stroke-width: 1; }
.pt-flame-frame:focus { outline: none; }
.pt-flame-text { fill: var(--ink); font: 11px var(--font-mono); pointer-events: none; }
.pt-flame-path { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); font-size: 12px; }
.pt-flame-path .pt-inline-btn:disabled { color: var(--ink); text-decoration: none; cursor: default; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .pt-meter-fill, .pt-chart { transition: none; } }
[data-theme="dark"] .pt-mmeter-label { color: #15171a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pt-mmeter-label { color: #15171a; } }

/* Time series: drag-to-zoom selection and annotations */
.pt-plot-zoom { cursor: crosshair; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.pt-zoom-sel { fill: var(--primary); fill-opacity: .12; stroke: var(--primary); stroke-width: var(--border-width-thin); }
.pt-annotation { pointer-events: none; }
.pt-annotation path { pointer-events: auto; }

/* Icons */
.pt-icon { flex: none; display: inline-block; vertical-align: -0.125em; }

/* Syntax tokens (text stays in ink mixes so it keeps contrast) */
.pt-tok-comment { color: var(--ink-muted); font-style: italic; }
.pt-tok-string { color: color-mix(in oklab, var(--chart-3) 70%, var(--ink)); }
.pt-tok-number, .pt-tok-literal { color: color-mix(in oklab, var(--chart-1) 72%, var(--ink)); }
.pt-tok-keyword { color: color-mix(in oklab, var(--chart-4) 75%, var(--ink)); font-weight: 600; }
.pt-tok-func { color: color-mix(in oklab, var(--chart-2) 75%, var(--ink)); }
.pt-tok-type, .pt-tok-tag { color: color-mix(in oklab, var(--chart-6) 72%, var(--ink)); }
.pt-tok-attr, .pt-tok-prop { color: color-mix(in oklab, var(--chart-2) 60%, var(--ink)); }
.pt-tok-var { color: color-mix(in oklab, var(--chart-5) 70%, var(--ink)); }
.pt-tok-op, .pt-tok-punct { color: var(--ink-muted); }

/* CodeEditor */
.pt-code-editor { display: flex; flex-direction: column; min-width: 0; border: var(--border-width-thin) solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface-100); overflow: hidden; transition: border-color var(--duration-fast), box-shadow var(--duration-fast); }
.pt-code-editor:focus-within { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.pt-code-editor.is-invalid { border-color: var(--danger); }
.pt-code-editor.is-disabled { opacity: .55; }
.pt-code-toolbar { display: flex; align-items: center; gap: var(--space-2); min-height: 36px; padding: 0 var(--space-2) 0 var(--space-3); border-bottom: var(--border-width-thin) solid var(--line); background: var(--surface-0); font-size: 13px; }
.pt-code-body { display: flex; min-height: 0; font: 13px/1.6 var(--font-mono); }
.pt-code-gutter { flex: none; overflow: hidden; padding: 8px var(--space-2) 8px var(--space-3); color: var(--ink-muted); text-align: right; user-select: none; font-variant-numeric: tabular-nums; border-right: var(--border-width-thin) solid var(--line); min-width: 2.5em; }
.pt-code-area { position: relative; flex: 1; min-width: 0; }
.pt-code-pre, .pt-code-input { position: absolute; inset: 0; margin: 0; padding: 8px var(--space-3); border: 0; font: inherit; letter-spacing: normal; white-space: pre; overflow: auto; tab-size: var(--pt-tab, 2); }
.pt-code-pre { color: var(--ink); pointer-events: none; overflow: hidden; }
.pt-code-input { width: 100%; height: 100%; resize: none; background: transparent; color: transparent; caret-color: var(--ink); outline: none; }
.pt-code-input::selection { background: color-mix(in oklab, var(--primary) 28%, transparent); color: transparent; }

/* FilterBar */
.pt-filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); min-width: 0; }
.pt-filterbar-end { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); }
.pt-filter-chip { display: inline-flex; align-items: stretch; max-width: 100%; height: var(--control-sm); border: var(--border-width-thin) solid var(--line-strong); border-radius: var(--radius-pill); background: var(--surface-0); font-size: 13px; }
.pt-filter-chip.is-negated { border-style: dashed; }
.pt-filter-chip .pt-popover-anchor { display: inline-flex; min-width: 0; }
.pt-filter-chip-main { display: inline-flex; align-items: center; gap: 4px; min-width: 0; padding: 0 var(--space-1) 0 var(--space-3); border: 0; border-radius: var(--radius-pill) 0 0 var(--radius-pill); background: none; color: var(--ink); font: inherit; cursor: pointer; }
.pt-filter-chip-main:hover { background: var(--surface-100); }
.pt-filter-chip-key { color: var(--ink-muted); white-space: nowrap; }
.pt-filter-chip-op { color: var(--ink-muted); }
.pt-filter-chip-val { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.pt-filter-chip-x { display: inline-flex; align-items: center; justify-content: center; width: 26px; border: 0; border-radius: 0 var(--radius-pill) var(--radius-pill) 0; background: none; color: var(--ink-muted); cursor: pointer; }
.pt-filter-chip-x:hover { background: var(--surface-100); color: var(--ink); }
.pt-filter-chip button:focus-visible { outline: var(--focus-ring); outline-offset: -2px; }
.pt-filter-editor { display: flex; flex-direction: column; gap: var(--space-3); width: 260px; max-width: calc(100vw - 32px); }

/* FilterField */
.pt-filter-field { min-width: 0; width: 100%; }
.pt-filter-field-box { position: relative; flex: 1; min-width: 0; height: 100%; }
.pt-filter-field-mirror, .pt-filter-field-input { position: absolute; inset: 0; width: 100%; padding: 0; border: 0; font: 13px var(--font-mono); line-height: calc(var(--control-md) - 2px); white-space: pre; letter-spacing: normal; }
.pt-filter-field-mirror { overflow: hidden; color: var(--ink); pointer-events: none; }
.pt-filter-field-input { background: transparent; color: transparent; caret-color: var(--ink); outline: none; }
.pt-filter-field-input::placeholder { color: var(--ink-muted); font-family: var(--font-sans, inherit); }
.pt-filter-field-input::selection { background: color-mix(in oklab, var(--primary) 28%, transparent); }
.pt-filter-field .pt-ctl:focus-within { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.pt-filter-sugg { font: 13px var(--font-mono); background: none; padding: 0; }

/* TimeframeSelector */
.pt-timeframe { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; min-width: 0; }
.pt-timeframe .pt-popover-anchor { display: inline-flex; min-width: 0; }
.pt-timeframe-btn { min-width: 0; }
.pt-timeframe-btn > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-timeframe-panel { display: flex; gap: var(--space-4); max-width: calc(100vw - 32px); }
.pt-timeframe-presets { list-style: none; margin: 0; padding: 0 var(--space-3) 0 0; border-right: var(--border-width-thin) solid var(--line); min-width: 140px; }
.pt-timeframe-preset { display: block; width: 100%; padding: 6px var(--space-2); border: 0; border-radius: var(--radius-sm); background: none; color: var(--ink); font: inherit; font-size: 13px; text-align: left; cursor: pointer; white-space: nowrap; }
.pt-timeframe-preset:hover { background: var(--surface-100); }
.pt-timeframe-preset.is-selected { color: var(--primary-text); font-weight: 600; background: color-mix(in oklab, var(--primary) 10%, var(--surface-0)); }
.pt-timeframe-preset:focus-visible { outline: var(--focus-ring); outline-offset: -2px; }
.pt-timeframe-custom { display: flex; flex-direction: column; gap: var(--space-2); }
.pt-timeframe-h { font-size: 13px; }
.pt-timeframe-times { display: flex; gap: var(--space-3); }
.pt-timeframe-times label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-muted); flex: 1; }
.pt-timeframe-actions { display: flex; justify-content: flex-end; gap: var(--space-2); }
@media (max-width: 639.98px) {
  .pt-timeframe-panel { flex-direction: column; }
  .pt-timeframe-presets { border-right: 0; border-bottom: var(--border-width-thin) solid var(--line); padding: 0 0 var(--space-2); display: grid; grid-template-columns: 1fr 1fr; }
}

/* WorldMap */
.pt-map-zoom { display: inline-flex; gap: 2px; }
.pt-map .pt-plot { user-select: none; -webkit-user-select: none; }
.pt-map-svg { display: block; touch-action: none; }
.pt-map-pannable { cursor: grab; }
.pt-map-pannable:active { cursor: grabbing; }
.pt-country { stroke: var(--surface-0); stroke-linejoin: round; transition: opacity var(--duration-fast); }
.pt-country-data { cursor: pointer; }
.pt-country:hover { stroke: var(--ink); }
.pt-map-marker { cursor: pointer; }
.pt-map-marker:focus { outline: none; }
.pt-map-marker:focus-visible { stroke: var(--focus); }

/* ---------- EmptyState ---------- */
.pt-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-2); padding: var(--space-10) var(--space-4); max-width: 480px; margin: 0 auto; }
.pt-empty-art { color: var(--ink-muted); margin-bottom: var(--space-2); }
.pt-empty-art svg { width: 64px; height: 64px; display: block; }
.pt-empty-error .pt-empty-art { color: var(--danger); }
.pt-empty-success .pt-empty-art { color: var(--success); }
.pt-empty-getting-started .pt-empty-art { color: var(--primary-text); }
.pt-empty-title { margin: 0; font-family: var(--font-heading, inherit); font-size: 18px; line-height: 24px; font-weight: 600; color: var(--ink); }
.pt-empty-desc { margin: 0; font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.pt-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); margin-top: var(--space-3); }
.pt-empty-sm { padding: var(--space-6) var(--space-3); }
.pt-empty-sm .pt-empty-art svg { width: 40px; height: 40px; }
.pt-empty-sm .pt-empty-title { font-size: 15px; line-height: 20px; }
.pt-empty-lg { padding: var(--space-16) var(--space-4); }
.pt-empty-lg .pt-empty-art svg { width: 96px; height: 96px; }
.pt-empty-lg .pt-empty-title { font-size: 22px; line-height: 28px; }

/* ---------- Microguide ---------- */
.pt-microguide { display: flex; gap: var(--space-4); padding: var(--space-4); border: var(--border-subtle); border-left: var(--border-width-thick) solid var(--primary); border-radius: var(--radius-lg); background: var(--surface-100); }
.pt-microguide-media { flex: 0 0 160px; border-radius: var(--radius-md); overflow: hidden; }
.pt-microguide-media > * { display: block; width: 100%; height: auto; }
.pt-microguide-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.pt-microguide-head { display: flex; align-items: flex-start; gap: var(--space-2); }
.pt-microguide-title { flex: 1 1 auto; font-weight: 600; font-size: 14px; line-height: 20px; color: var(--ink); }
.pt-microguide-close { width: 24px; height: 24px; margin: -2px -4px 0 0; }
.pt-microguide-text { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.pt-microguide-steps { margin: 0; padding-left: 1.25em; font-size: 14px; line-height: 20px; color: var(--ink); display: grid; gap: var(--space-1); }
.pt-microguide-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-1); }
@media (max-width: 639.98px) { .pt-microguide { flex-direction: column; } .pt-microguide-media { flex-basis: auto; } }

/* ---------- AI ---------- */
.pt-ai { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3) var(--space-4); border: var(--border-subtle); border-radius: var(--radius-lg); background: var(--surface-0); }
.pt-ai-label { display: inline-flex; align-items: center; gap: var(--space-1); font-size: 12px; line-height: 16px; font-weight: 500; color: var(--accent-text, var(--primary-text)); }
.pt-ai-body { font-size: 14px; line-height: 22px; color: var(--ink); }
.pt-ai-body > :first-child { margin-top: 0; }
.pt-ai-body > :last-child { margin-bottom: 0; }
.pt-ai-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding-top: var(--space-2); border-top: var(--border-subtle); }
.pt-ai-disclaimer { flex: 1 1 200px; font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.pt-ai-actions { display: inline-flex; align-items: center; gap: var(--space-1); margin-left: auto; }
.pt-ai-actions .pt-icon-btn[aria-pressed="true"] { color: var(--primary-text); background: var(--primary-soft); }
.pt-ai-loading { display: inline-flex; align-items: center; gap: var(--space-2); font-size: 14px; color: var(--ink-muted); }
.pt-ai-dots { display: inline-flex; gap: 4px; }
.pt-ai-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent, var(--primary)); animation: pt-fade-in var(--duration-slower) var(--easing-standard) infinite alternate; }
.pt-ai-dots i:nth-child(2) { animation-delay: calc(var(--duration-slower) / 3); }
.pt-ai-dots i:nth-child(3) { animation-delay: calc(var(--duration-slower) * 2 / 3); }
@media (prefers-reduced-motion: reduce) { .pt-ai-dots i { animation-duration: 1.2s; } }

/* ---------- Wizard ---------- */
.pt-wizard { display: flex; flex-direction: column; gap: var(--space-6); }
.pt-wizard-v { display: grid; grid-template-columns: minmax(180px, 240px) 1fr; grid-template-rows: 1fr auto; column-gap: var(--space-8); row-gap: var(--space-6); }
.pt-wizard-v > .pt-stepper { grid-row: 1 / span 2; }
.pt-wizard-panel { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.pt-wizard-title { margin: 0; display: flex; flex-direction: column; gap: 2px; font-family: var(--font-heading, inherit); font-size: 18px; line-height: 24px; font-weight: 600; color: var(--ink); outline: none; }
.pt-wizard-count { font-family: var(--font-sans); font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink-muted); }
.pt-wizard-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding-top: var(--space-4); border-top: var(--border-subtle); }
.pt-wizard-nav { display: inline-flex; gap: var(--space-2); margin-left: auto; }
@media (max-width: 639.98px) { .pt-wizard-v { display: flex; } }

/* ---------- Logo ---------- */
.pt-logo { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--ink); text-decoration: none; font-family: var(--font-heading, var(--font-sans)); font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.pt-logo-mark { display: inline-grid; place-items: center; flex: none; }
.pt-logo-mark > svg, .pt-logo-mark > img { width: 1.4em; height: 1.4em; display: block; }
.pt-logo-sm { font-size: 15px; }
.pt-logo-md { font-size: 18px; }
.pt-logo-lg { font-size: 24px; }
a.pt-logo:hover { color: var(--ink); }
a.pt-logo:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-ring-offset); border-radius: var(--radius-sm); }

/* ---------- Tooltips & dismiss ---------- */
.pt-kbd-tip { display: inline-flex; align-items: center; gap: var(--space-2); }
.pt-kbd-tip .pt-kbd { color: var(--ink); }
.pt-dismiss { width: 28px; height: 28px; flex: none; }
.pt-dismiss svg { width: 16px; height: 16px; }

html, body { margin: 0; height: 100%; }
body { background: var(--surface-0); }
.g-app { min-height: 100%; }
.g-top { position: sticky; top: 0; z-index: 20; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--surface-0); }
.g-top b { font-family: var(--font-heading); font-size: 17px; margin-right: auto; display: flex; gap: 8px; align-items: center; }
.g-mark { width: 22px; height: 22px; border-radius: 5px; background: var(--primary); }
.g-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.g-nav { position: sticky; top: 57px; align-self: start; max-height: calc(100vh - 57px); overflow: auto; padding: 16px 12px; border-right: 1px solid var(--line); font-size: 14px; }
.g-nav a { display: block; padding: 5px 10px; border-radius: 6px; color: var(--ink-muted); text-decoration: none; }
.g-nav a:hover { background: var(--surface-200); color: var(--ink); }
.g-nav small { display: block; margin: 14px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.g-main { padding: 24px 32px 80px; min-width: 0; }
.g-cat { margin: 40px 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.g-sec { padding: 24px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 70px; }
.g-sec > h2 { margin: 0 0 4px; font: 600 20px/1.3 var(--font-heading); }
.g-sec > p { margin: 0 0 16px; color: var(--ink-muted); font-size: 14px; max-width: 72ch; }
.g-demo { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.g-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; max-width: 560px; }
.g-wide { display: grid; gap: 16px; }
@media (max-width: 800px) { .g-body { grid-template-columns: minmax(0, 1fr); } .g-nav { display: none; } .g-main { padding: 16px; } }
.g-icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 4px; }
.g-icon-cell { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: var(--radius-md); color: var(--ink); min-width: 0; }
.g-icon-cell:hover { background: var(--surface-100); }
.g-icon-cell span { font-size: 11px; color: var(--ink-muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-json { margin: 12px 0 0; padding: 8px 12px; border-radius: var(--radius-md); background: var(--surface-100); font: 12px/1.6 var(--font-mono); white-space: pre-wrap; word-break: break-all; color: var(--ink-muted); }
.g-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.g-token-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.g-token-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 13px; }
.g-token-cell code { font: 12px var(--font-mono); color: var(--ink-muted); overflow-wrap: anywhere; }
.g-anim-stage { height: 72px; display: grid; place-items: center; border: var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-100); overflow: hidden; }
.g-anim-box { width: 28px; height: 28px; border-radius: var(--radius-sm); background: var(--primary); }
.g-ease-track { position: relative; height: 24px; border-radius: var(--radius-pill); background: var(--surface-100); border: var(--border-subtle); }
.g-ease-dot { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--primary); }
@keyframes g-ease { to { left: calc(100% - 19px); } }
.g-swatch { height: 56px; border-radius: var(--radius-md); background: var(--surface-0); }
.g-swatch-lift { background: var(--surface-0); }
.g-token-table { margin-top: 16px; }
.g-bp-bar { display: flex; flex-wrap: wrap; gap: 4px; }
.g-bp-bar span { padding: 4px 10px; border-radius: var(--radius-pill); border: var(--border-subtle); font-size: 12px; color: var(--ink-muted); }
.g-bp-bar span.is-on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.g-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-6); align-items: start; }
