/* AIP access register: shared design transferred from aip-license-server. */
:root {
    --page-inset: 24px;
    --panel-inset: 24px;
    --section-gap: 24px;
    --group-gap: 16px;
    --item-gap: 8px;
    --aip-blue-400: #9eb8ee;
    --chart-count: var(--aip-accent);
    --chart-money: var(--aip-blue-400);
    --chart-secondary: var(--aip-warning);
    --chart-muted: var(--aip-text-muted);
    --chart-danger: var(--aip-danger);
    --chart-grid: var(--aip-border-strong);
}
html { scroll-padding-block-start: 24px; }
body.seller-page { background: var(--bg); font-size: var(--aip-font-body-size); line-height: 1.5; font-weight: 400; letter-spacing: 0; }
body::before, body::after { content: none; }
body, body * { scrollbar-color: var(--aip-border-control) var(--bg-soft); }
body::-webkit-scrollbar-thumb, body *::-webkit-scrollbar-thumb { background: var(--aip-border-control); }
h1, h2, h3, h4, .eyebrow, .meta-label, label > span:first-child, th { font-weight: 500; letter-spacing: 0; text-transform: none; }
h1 { margin: 0; font-size: var(--aip-font-title-1); line-height: 1.2; }
body.seller-page h2 { margin: 0; font-size: var(--aip-font-title-2); line-height: 1.3; color: var(--aip-heading-color); }
body.seller-page h3 { font-size: var(--aip-font-title-3); line-height: 1.4; }
body.seller-page :is(h1,h2,h3,h4,strong,b,.session-user,.eyebrow,.meta-label,.select-trigger-value) { font-weight: 500; letter-spacing: 0; }
body.seller-page .hero-title h1 { margin: 0; font-size: var(--aip-font-title-1); font-weight: 500; line-height: 1.2; }
body.seller-page .eyebrow { color: var(--muted); text-transform: none; font-size: var(--aip-font-caption); }
p { max-inline-size: 72ch; }
strong, b, .session-user { font-weight: 500; }
.small, .meta-label, .eyebrow { font-size: var(--aip-font-caption); line-height: 1.5; }
.eyebrow { color: var(--muted); }
.muted { color: var(--muted); }
.skip-link { position: fixed; inset-block-start: 8px; inset-inline-start: 16px; z-index: 20000; padding: 12px 16px; border-radius: 8px; color: var(--bg); background: var(--accent); transform: translateY(-160%); }
.skip-link:focus { transform: none; }
:is(button, a, input, select, textarea, summary, [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; box-shadow: none; }
.page-shell { display: grid; grid-template-columns: 240px minmax(0,1fr); align-items: start; gap: var(--section-gap); width: min(1600px,100%); margin-inline: auto; padding: var(--page-inset); }
.hero { grid-column: 1 / -1; display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: 24px; margin: 0; padding-block-end: 24px; border-block-end: 1px solid var(--line); }
.hero-title, .hero-card { min-width: 0; min-height: 0; height: auto; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none; }
.hero-title { display: grid; gap: 8px; }
.hero-card { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; max-width: 100%; }
.session-context { min-width: 0; gap: 12px; }
.session-icon { width: 32px; min-width: 32px; height: 32px; padding: 6px; border: 0; border-radius: 8px; color: var(--soft); background: var(--surface-strong); box-shadow: none; }
.session-user { max-width: 28ch; white-space: normal; overflow-wrap: anywhere; font-size: var(--aip-font-body-size); }
.session-details { min-width: 0; gap: 4px; }
.global-sales-channel-field { min-width: 0; width: 200px; max-width: 100%; }
.workspace-nav-row { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 24px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-soft); }
.workspace-tabs { display: flex; flex-direction: column; gap: 4px; min-width: 0; width: 100%; padding: 0; overflow: visible; }
.tab-button { display: flex; align-items: center; justify-content: start; gap: 12px; width: 100%; min-width: 0; min-height: 40px; padding: 8px 12px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--soft); font-size: var(--aip-font-body-size); font-weight: 400; white-space: normal; text-align: start; box-shadow: none; }
.tab-button.is-active { color: var(--accent); background: var(--surface-strong); border-color: var(--line); box-shadow: inset 2px 0 var(--accent); }
[dir="rtl"] .tab-button.is-active { box-shadow: inset -2px 0 var(--accent); }
.seller-navigation-toggle { display: none; }
.workspace-layout, .workspace-layout[data-active-tab], .workspace-main, .tab-panel-stack { display: flex; flex-direction: column; align-items: stretch; width: 100%; min-width: 0; gap: var(--section-gap); }
.workspace-layout { grid-column: 2; }
.workspace-sidebar { position: static; min-width: 0; }
.panel, .login-card { min-width: 0; margin: 0; padding: var(--panel-inset); border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: none; backdrop-filter: none; }
.page-shell .panel[data-section="list"], .workspace-layout .panel[data-section="filters"] { padding: var(--panel-inset); }
.panel > .panel-head, .page-shell .panel[data-section="list"] > .panel-head, .workspace-layout .panel[data-section="filters"] > .panel-head, .student-control-disclosure > summary.panel-head { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: 16px; min-height: 40px; margin: 0 0 24px; padding: 0; border: 0; background: transparent; }
.student-control-disclosure:not([open]) > summary.panel-head { margin: 0; }
.panel-head h2 .ui-icon, .panel-title-row > .ui-icon { width: 20px; height: 20px; padding: 0; border: 0; background: transparent; color: var(--soft); border-radius: 0; box-shadow: none; }
.panel-head-actions, .filter-actions, .paging, .modal-actions, .button-row, .editor-actions { display: flex; align-items: center; flex-wrap: wrap; min-width: 0; gap: 8px; }
.panel-head-actions > * { min-width: 0; max-width: 100%; }
.paging { justify-content: end; margin-block-start: 16px; font-variant-numeric: tabular-nums; }
.filters-stack, .student-filter-row, .student-sales-lead-filter-row, .settings-grid, .editor-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,220px),1fr)); align-items: end; min-width: 0; gap: 16px; }
.filters-stack > .filter-actions { grid-column: 1 / -1; justify-content: end; }
.filters-stack > .filter-actions > button { min-width: 0; }
.seller-filters { min-width: 0; }
.seller-filters > summary { display: flex; align-items: center; gap: 8px; min-height: 40px; width: fit-content; padding: 8px 12px; border: 1px solid var(--aip-border-control); border-radius: 8px; background: var(--bg-soft); color: var(--text); cursor: pointer; list-style: none; }
.seller-filters > summary::after { content: "⌄"; }
.seller-filters > summary::-webkit-details-marker { display: none; }
.seller-filters[open] > summary::after { rotate: 180deg; }
.seller-filters > form { margin-block-start: 16px; }
label { min-width: 0; gap: 8px; font-size: var(--aip-font-small); line-height: 1.5; }
label:not(.checkbox-line) > span:first-child { font-size: var(--aip-font-small); font-weight: 400; color: var(--soft); text-transform: none; letter-spacing: 0; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea, .select-trigger { min-width: 0; min-height: 40px; max-width: 100%; height: auto; padding: 8px 12px; border: 1px solid var(--aip-border-control); border-radius: 8px; background: var(--bg-soft); color: var(--text); font-size: var(--aip-font-body-size); font-weight: 400; line-height: 1.5; box-shadow: none; }
#filters-form :is(input,select,.select-trigger), .student-filter-row :is(input:not([type="checkbox"]):not([type="radio"]),select,.select-trigger) { height: auto; min-height: 40px; padding-block: 8px; border-radius: 8px; }
textarea { min-height: 88px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[aria-invalid="true"], textarea[aria-invalid="true"], .select-trigger[aria-invalid="true"] { border-color: var(--danger); }
.field-error { margin-block-start: 4px; color: var(--danger); font-size: var(--aip-font-small); line-height: 1.5; }
input[type="date"], input[type="datetime-local"] { background-image: none; color-scheme: dark; }
input::-webkit-calendar-picker-indicator { opacity: 1; position: static; width: 16px; height: 16px; cursor: pointer; }
body.seller-page input:is([type="checkbox"],[type="radio"]), body.seller-page input:is([type="checkbox"],[type="radio"]):checked { appearance: auto; min-width: 18px; width: 18px; min-height: 18px; height: 18px; padding: 0; accent-color: var(--accent); background: transparent; box-shadow: none; }
input[type="checkbox"]::before, input[type="checkbox"]::after, input[type="radio"]::before, input[type="radio"]::after { content: none; }
.checkbox-line { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 0; border: 0; background: transparent; cursor: pointer; font-size: var(--aip-font-body-size); }
.primary, .ghost, .small-button, .icon-button, .icon-button-large { min-height: 40px; height: auto; max-width: 100%; padding: 8px 16px; border: 1px solid var(--aip-border-control); border-radius: 8px; font-size: var(--aip-font-body-size); font-weight: 500; line-height: 1.5; letter-spacing: 0; text-transform: none; white-space: normal; box-shadow: none; }
.primary { background: var(--accent); border-color: var(--accent); color: var(--aip-text-on-accent); }
.ghost, .small-button { background: var(--surface-strong); color: var(--text); }
.ghost.is-active, .pagination-page-button.is-active { color: var(--aip-accent-strong); background: var(--accent-soft); border-color: var(--accent); box-shadow: none; }
.primary:disabled, .ghost:disabled { transform: none; translate: none; opacity: .5; }
.icon-button, .icon-button-large { min-width: 40px; width: 40px; padding: 8px; color: var(--text); background: var(--bg-soft); }
button.is-loading { color: inherit !important; padding-inline-end: 44px; }
button.is-loading::after { inset-inline-start: auto; inset-inline-end: 14px; inset-block-start: calc(50% - 8px); inset-block-end: auto; width: 16px; height: 16px; margin: 0; color: currentColor; }
.sale-action-button-danger, .ghost.danger, button[data-tone="danger"] { color: var(--danger); border-color: var(--danger); background: var(--bg-soft); }
.ui-icon { width: 18px; height: 18px; stroke-width: 1.5; }
.table-wrap { container-type: inline-size; container-name: seller-records; width: 100%; min-width: 0; margin-inline: 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: transparent; overscroll-behavior-x: contain; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: var(--aip-font-small); line-height: 1.5; }
.table-wrap th { font-size: var(--aip-font-caption); font-weight: 400; text-align: start; color: var(--muted); background: var(--bg-soft); text-transform: none; letter-spacing: 0; padding: 12px; }
.table-wrap td { min-width: 0; padding: 12px; text-align: start; border-color: var(--line); overflow-wrap: anywhere; white-space: normal; vertical-align: top; }
.table-wrap .seller-record-table { min-width: 0 !important; table-layout: fixed; }
.table-wrap .cell-stack, .table-wrap .meta-pill-row, .table-wrap td > * { min-width: 0; max-width: 100%; }
.table-wrap :is(.cell-stack strong,.cell-stack span,.meta-pill,.payment-pill) { white-space: normal; overflow-wrap: anywhere; }
.seller-record-table :is(th,td) { width: auto; }
#sales-table col, #history-sales-table col { width: auto; }
#sales-table col:nth-child(1), #history-sales-table col:nth-child(1) { width: 12%; }
#sales-table col:nth-child(2), #history-sales-table col:nth-child(2) { width: 15%; }
#sales-table col:nth-child(3), #history-sales-table col:nth-child(3) { width: 23%; }
#sales-table col:nth-child(4), #history-sales-table col:nth-child(4) { width: 17%; }
#sales-table col:nth-child(5), #history-sales-table col:nth-child(5) { width: 16%; }
#sales-table col:nth-child(6), #history-sales-table col:nth-child(6) { width: 17%; }
.table-scroll-hint { margin: 0 0 8px; font-size: var(--aip-font-caption); color: var(--muted); }
.table-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.line-clamp-2, .select-trigger-value, .compact-user-main strong, .webhook-target-preview { display: block; overflow: visible; text-overflow: clip; white-space: normal; -webkit-line-clamp: unset; overflow-wrap: anywhere; max-width: 100%; }
.meta-pill, .kind-pill, .payment-pill, .verified-pill, .unverified-pill, .inline-status { display: inline-flex; align-items: center; width: fit-content; max-width: 100%; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-soft); color: var(--soft); font-size: var(--aip-font-caption); font-weight: 400; line-height: 1.5; letter-spacing: 0; text-transform: none; white-space: normal; overflow-wrap: anywhere; }
.kind-sale, .payment-pill:not(.failed):not(.unknown), .verified-pill { color: var(--success); }
.kind-refund, .payment-pill.failed { color: var(--danger); }
.kind-referral, .payment-pill.unknown { color: var(--warning); }
.sale-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 8px; }
.sale-action-button { min-width: 40px; width: 40px; min-height: 40px; padding: 8px; }
.sale-action-button > span:last-child { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.table-comment { width: 100%; min-height: 72px; font-size: var(--aip-font-small); border-color: var(--aip-border-control); background: var(--bg-soft); }
.sale-status, .sale-status.unknown, .sale-status.failed { border-color: var(--line); background: var(--bg-soft); font-weight: 400; }
.student-status { max-width: 100%; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-soft); color: var(--soft); font-weight: 400; white-space: normal; overflow-wrap: anywhere; }
.student-status:is(.is-paid,.is-completed,.is-yes) { color: var(--success); background: var(--bg-soft); }
.student-status:is(.is-draft,.is-review,.is-correction,.is-unpaid) { color: var(--warning); background: var(--bg-soft); }
.student-status.is-no { color: var(--danger); background: var(--bg-soft); }
.student-status.is-waiting-verification { color: var(--chart-money); background: var(--bg-soft); }
.feed-item, .seller-item, .webhook-item, .payroll-sheet-card, .student-summary-card, .telegram-join-group, .statistics-day-card, .statistics-week-card, .student-statistics-metric, .student-salebot-funnel-stage { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: var(--bg-soft); box-shadow: none; backdrop-filter: none; transform: none; }
.feed-item:hover, .seller-item:hover, .webhook-item:hover, .payroll-sheet-card:hover, .telegram-join-group:hover { transform: none; box-shadow: none; }
.student-summary-card strong, .student-statistics-metric strong, .statistics-week-card strong { font-size: var(--aip-font-metric); font-weight: 500; line-height: 1.3; }
.student-summary-grid, .student-statistics-summary { grid-template-columns: repeat(auto-fit,minmax(min(100%,17rem),1fr)); gap: 16px; }
.student-work-stack { --student-space-content: 24px; gap: 24px; }
.student-view-switch { border-radius: 8px; border-color: var(--line); background: var(--bg-soft); }
.student-view-switch .ghost.is-active { color: var(--text); background: var(--surface-raised); box-shadow: inset 0 -2px var(--accent); }
.seller-list { max-height: none; overflow: visible; }
.global-request-progress { background: var(--aip-neutral-a20); backdrop-filter: none; }
.global-request-progress-card { background: var(--surface); border-color: var(--line); border-radius: 12px; }
.global-request-progress-bar::before { background: var(--accent); }
.status:empty { display: none; }
.seller-notification { position: fixed; inset-inline-end: 24px; inset-block-end: 24px; z-index: 1500; display: flex; align-items: start; gap: 12px; width: min(420px,calc(100% - 48px)); padding: 16px; border: 1px solid var(--aip-border-control); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-xl); }
.seller-notification .status { min-width: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--text); line-height: 1.5; overflow-wrap: anywhere; }
.seller-notification .status.is-error { color: var(--danger); }
.seller-notification button { flex: 0 0 40px; }
.configuration-toolbar { display: flex; align-items: end; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.configuration-toolbar label { width: min(420px,100%); }
[data-tab-panel="directory"] { gap: 12px; }
.configuration-section { padding: 0; overflow: visible; }
.configuration-section[data-search-hidden="true"] { display: none; }
.configuration-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding: 16px 24px; list-style: none; cursor: pointer; }
.configuration-summary::-webkit-details-marker { display: none; }
.configuration-summary::after { content: "⌄"; color: var(--muted); }
.configuration-section[open] > .configuration-summary::after { rotate: 180deg; }
.configuration-summary h2 { display: flex; align-items: center; gap: 12px; font-size: var(--aip-font-title-2); line-height: 1.3; }
.configuration-content { display: flex; flex-direction: column; min-width: 0; gap: 24px; padding: 0 24px 24px; }
.configuration-content > .panel-head { min-height: 0; margin: 0; padding: 0; border: 0; }
.configuration-content .compact-form { max-width: none; }
.configuration-content .seller-item { padding: 12px 16px; }
.configuration-content .compact-user-controls { gap: 12px; }
.modal-dialog { width: min(960px,calc(100% - 32px)); max-width: calc(100% - 32px); max-height: calc(100dvh - 32px); margin: auto; padding: 0; border: 1px solid var(--aip-border-control); border-radius: 16px; background: var(--surface); color: var(--text); overflow: visible; box-shadow: var(--shadow-xl); }
.modal-dialog::backdrop { background: rgb(0 0 0 / .6); backdrop-filter: none; }
.modal-dialog .modal-card { display: flex; flex-direction: column; gap: 24px; padding: 24px; max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; background: var(--surface); }
.modal-card > .modal-head { position: static; display: flex; justify-content: space-between; align-items: start; gap: 16px; margin: 0; padding: 0; min-height: 40px; border: 0; background: transparent; }
.modal-head h2 { font-size: var(--aip-font-title-2); line-height: 1.3; }
.modal-card > .modal-actions { position: sticky; bottom: 0; margin: 0; padding: 16px 0 0; background: var(--surface); border: 0; }
.student-form-vertical { grid-template-columns: minmax(0,1fr); }
.login-shell { display: grid; place-items: center; padding: 24px; }
.login-card { width: min(480px,100%); display: flex; flex-direction: column; gap: 24px; }
.login-card h1 { font-size: var(--aip-font-title-1); }
.login-card .stack { gap: 16px; }
.aip-select-control { display: grid; min-width: 0; gap: 8px; }
.select-trigger, .aip-select-trigger { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; text-align: start; }
.aip-select-value { min-width: 0; overflow-wrap: anywhere; white-space: normal; }
.select-trigger-icon { flex: 0 0 16px; width: 16px; height: 16px; color: var(--muted); }
.aip-select-menu { position: fixed; z-index: 1600; max-width: calc(100vw - 24px); padding: 4px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--aip-border-control); border-radius: 13px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-xl); font-family: var(--font-body); font-size: var(--aip-font-body-size); line-height: 1.5; }
.aip-select-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding: 8px 12px; border-radius: 8px; overflow-wrap: anywhere; cursor: pointer; }
.aip-select-option[aria-selected="true"] { color: var(--aip-accent-strong); background: var(--accent-soft); }
.aip-select-option[aria-selected="true"]::after { content: "✓"; flex: 0 0 16px; }
.aip-select-option.is-highlighted { background: var(--surface-raised); }
.aip-select-option[aria-disabled="true"] { color: var(--muted); cursor: not-allowed; }
.aip-select-menu { pointer-events: auto; touch-action: pan-y pinch-zoom; scroll-behavior: auto; scrollbar-gutter: stable; scrollbar-width: auto; }
.select-trigger[aria-expanded="true"] { border-color: var(--accent); }
.statistics-line { fill: none; stroke-width: 2.5; }
.leads-plan-line { stroke: var(--chart-count); stroke-dasharray: 6 5; opacity: .65; }
.leads-fact-line, .leads-fact-point, .telegram-join-line { stroke: var(--chart-count); }
.revenue-plan-line { stroke: var(--chart-money); stroke-dasharray: 6 5; opacity: .65; }
.revenue-fact-line, .revenue-fact-point { stroke: var(--chart-money); }
.statistics-point { fill: var(--surface); }
.statistics-axis-grid { stroke: var(--chart-grid); opacity: .65; }
.telegram-join-group-track { background: var(--surface-strong); }
.telegram-join-group-track > span { background: var(--chart-count); }
[data-motion-ghost], [data-motion-ghost] * { pointer-events: none !important; }
@container seller-records (max-width: 64rem) {
    .seller-record-table { display: block; width: 100%; }
    .seller-record-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .seller-record-table colgroup { display: none; }
    .seller-record-table tbody { display: grid; width: 100%; }
    .seller-record-table tbody > tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px 24px; padding: 16px; border-block-end: 1px solid var(--line); }
    .seller-record-table tbody > tr:last-child { border: 0; }
    .table-wrap .seller-record-table td { display: flex; flex-direction: column; width: auto; min-width: 0; gap: 8px; padding: 0; border: 0; }
    .seller-record-table td::before { content: attr(data-label); color: var(--muted); font-size: var(--aip-font-caption); font-weight: 400; letter-spacing: 0; text-transform: none; }
    .seller-record-table td:first-child, .seller-record-table td:last-child { grid-column: 1 / -1; }
}
@container seller-records (max-width: 40rem) { .seller-record-table tbody > tr { grid-template-columns: minmax(0,1fr); } }
@media (hover: hover) {
    .primary:hover:not(:disabled) { background: var(--aip-accent-strong); color: var(--aip-text-on-accent); box-shadow: none; }
    .ghost:hover:not(:disabled), .tab-button:hover { background: var(--surface-raised); box-shadow: none; }
}
@media (prefers-reduced-motion: no-preference) {
    [data-motion-entering] { opacity: 0; }
    .seller-page :is(button,summary) { transition: translate 220ms var(--aip-ease), background-color 150ms ease, border-color 150ms ease, color 150ms ease; }
    .seller-page button:active:not(:disabled) { translate: 0 2px; }
    .select-trigger > svg, .seller-filters > summary::after, .configuration-summary::after { transition: rotate 240ms var(--aip-ease); }
    .select-trigger[aria-expanded="true"] > svg { rotate: 180deg; }
    @media (hover: hover) { .seller-page button:hover:not(:disabled):not(:active) { translate: 0 -2px; } }
}
@media (max-width: 960px) {
    :root { --page-inset: 16px; --panel-inset: 16px; }
    .page-shell { grid-template-columns: minmax(0,1fr); gap: 16px; }
    .hero { gap: 16px; padding-block-end: 16px; }
    .hero-card { gap: 16px; }
    .workspace-nav-row { grid-column: 1; position: static; padding: 8px; }
    .workspace-layout { grid-column: 1; }
    .seller-navigation-toggle { display: flex; justify-content: space-between; width: 100%; }
    .workspace-nav-row:not([data-expanded="true"]) .workspace-tabs { display: none; }
    .workspace-tabs { margin-block-start: 8px; }
}
@media (max-width: 640px), (pointer: coarse) {
    .primary, .ghost, .small-button, .icon-button, .icon-button-large, .tab-button, .sale-action-button, .aip-select-trigger, .aip-select-option { min-height: 44px; }
    .sale-action-button, .icon-button, .icon-button-large { min-width: 44px; width: 44px; }
    input:not([type="checkbox"]):not([type="radio"]), select, textarea, .select-trigger, .aip-select-menu { min-height: 44px; font-size: 1rem; }
    .hero-card { width: 100%; }
    .global-sales-channel-field { flex: 1 1 180px; }
    .panel-head-actions { width: 100%; }
    .panel-head-actions > button { flex: 1 1 auto; }
    .modal-dialog .modal-card { padding: 16px; }
    .editor-grid { grid-template-columns: minmax(0,1fr); }
    .configuration-summary { padding: 16px; }
    .configuration-content { padding: 0 16px 16px; }
    .seller-notification { inset-inline-end: 16px; inset-block-end: 16px; width: calc(100% - 32px); }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    button:hover, button:focus-visible, .feed-item:hover, .seller-item:hover, .webhook-item:hover { transform: none; }
}
@media (forced-colors: active) {
    .panel, .modal-dialog, .aip-select-menu, .aip-select-option, button, input, textarea, select { border: 1px solid ButtonText; }
    :focus-visible { outline: 2px solid Highlight !important; }
}

/* The permanent halo belongs to major regions, never to every nested metric. */
body.seller-page h1 { color: var(--aip-heading-color); overflow-wrap: anywhere; }
body.seller-page h4 { font-size: 1.125rem; line-height: 1.4; }
.panel, .login-card, .modal-dialog { border-color: var(--aip-border-region); box-shadow: var(--aip-shadow-region); }
.panel { animation: none; }
.student-statistics-metric > span, .student-summary-card > .meta-label { font-size: var(--aip-font-body-size); }
.student-summary-value { min-width: 0; max-width: 100%; font-size: var(--aip-font-metric); line-height: 1.3; overflow-wrap: anywhere; }
@media (forced-colors: active) { .panel, .login-card, .modal-dialog { border-color: CanvasText; box-shadow: none; } }

/* Content-sized columns and controls keep the larger type readable. */
.hero { align-items: center; }
.hero-card > .session-action { display: inline-grid; place-items: center; flex: 0 0 44px; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; align-self: center; }
.realtime-toggle[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }
.realtime-toggle[aria-pressed="false"] { color: var(--muted); background: var(--bg-soft); border-color: var(--line); }
.student-row-actions { display: grid; grid-template-columns: repeat(2,44px); justify-content: start; align-content: start; gap: 8px; }
.student-row-actions:empty { display: none; }
.student-sales-lead-link-status {
    margin-block-start: 8px;
    inline-size: fit-content;
    max-inline-size: 100%;
    white-space: normal;
    text-align: center;
}
.student-row-actions .record-action { display: inline-grid; place-items: center; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; white-space: nowrap; overflow-wrap: normal; }
.student-status { overflow-wrap: normal; word-break: normal; }
.student-filter-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.student-filter-actions > button { min-inline-size: 10rem; }
.panel > .student-filter-row { margin-block-end: 24px; }
.student-summary-card { display: grid; grid-template-rows: minmax(3em,auto) 1fr; align-content: start; gap: 16px; }
.student-summary-card > .meta-label { line-height: 1.5; }
.student-summary-value, .student-statistics-metric strong { overflow-wrap: normal; word-break: normal; font-variant-numeric: tabular-nums; }
.money-value { overflow-wrap: normal; word-break: normal; font-variant-numeric: tabular-nums; }
.money-suffix, .record-number { white-space: nowrap; overflow-wrap: normal; word-break: normal; }
.record-details { min-width: 0; color: inherit; font-size: inherit; }
.record-details > summary { display: flex; align-items: start; justify-content: space-between; gap: 8px; min-block-size: 32px; cursor: pointer; list-style: none; text-align: start; }
.record-details > summary::-webkit-details-marker { display: none; }
.record-details > summary::after { content: "⌄"; flex: 0 0 auto; color: var(--muted); }
.record-details[open] > summary::after { rotate: 180deg; }
.record-details > summary > span { min-width: 0; }
.record-description:not([open]) > summary > .record-description-preview { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.record-description[open] > summary > .record-description-preview, .record-description:not([open]) > summary > .record-description-toggle { display: none; }
.record-description-toggle { color: var(--soft); }
.record-description-full { margin-block-start: 8px; overflow-wrap: anywhere; text-wrap: pretty; }
.record-audit { margin-block-start: 8px; color: var(--muted); font-size: var(--aip-font-caption); }
.record-audit dl { display: grid; gap: 8px; margin: 8px 0 0; }
.record-audit dl > div { display: grid; gap: 4px; }
.record-audit dd { margin: 0; color: var(--soft); overflow-wrap: anywhere; }
.table-wrap .student-payment-consent { min-width: 0; margin-block-start: 16px; }
[data-record-kind="student-orders"] th:nth-child(1) { width: 8rem; }
[data-record-kind="student-orders"] th:nth-child(3) { width: 16rem; }
[data-record-kind="student-orders"] th:nth-child(4) { width: 12rem; }
[data-record-kind="student-orders"] th:nth-child(5) { width: 9rem; }
[data-record-kind="student-payments"] th:nth-child(1) { width: 7rem; }
[data-record-kind="student-payments"] th:nth-child(3) { width: 10rem; }
[data-record-kind="student-payments"] th:nth-child(4) { width: 10rem; }
[data-record-kind="student-payments"] th:nth-child(5) { width: 12rem; }
[data-record-kind="student-orders"] th:last-child, [data-record-kind="student-payments"] th:last-child, [data-record-kind="student-sales-leads"] th:last-child { width: 7.5rem; }
[data-record-kind="student-sales-leads"] th:nth-child(1), [data-record-kind="student-sales-leads"] th:nth-child(4), [data-record-kind="student-sales-leads"] th:nth-child(5) { width: 21%; }
[data-record-kind="student-sales-leads"] th:nth-child(2) { width: 7.5%; }
.table-wrap [data-record-kind="student-price-history"] :is(th,td) { text-align: start; }
[data-record-kind="student-price-history"] th:nth-child(1) { width: 9rem; }
[data-record-kind="student-price-history"] th:nth-child(2) { width: 8rem; }
[data-record-kind="student-price-history"] th:nth-child(n+4) { width: 9rem; }
.table-wrap [data-record-kind="student-price-history"] td:nth-child(5), .table-wrap [data-record-kind="student-price-history"] td:nth-child(6) { text-align: end; }
@container seller-records (max-width: 76rem) {
    .seller-wide-records { display: block; width: 100%; }
    .seller-wide-records thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .seller-wide-records colgroup { display: none; }
    .seller-wide-records tbody { display: grid; width: 100%; }
    .seller-wide-records tbody > tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px 24px; padding: 16px; border-block-end: 1px solid var(--line); }
    .seller-wide-records tbody > tr:last-child { border: 0; }
    .table-wrap .seller-wide-records td { display: flex; flex-direction: column; width: auto; min-width: 0; gap: 8px; padding: 0; border: 0; text-align: start; }
    .seller-wide-records td::before { content: attr(data-label); color: var(--muted); font-size: var(--aip-font-caption); font-weight: 400; }
    .seller-wide-records td:first-child, .seller-wide-records td:last-child, .seller-wide-records td[data-label="Заказ"] { grid-column: 1 / -1; }
    .seller-wide-records .student-table-group-row { grid-template-columns: minmax(0,1fr); }
    .student-row-actions { display: flex; flex-wrap: wrap; }
}
@container seller-records (max-width: 40rem) { .seller-wide-records tbody > tr { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 640px) {
    .student-summary-card { grid-template-rows: auto 1fr; }
    .student-filter-actions > button { flex: 1 1 auto; }
}

/* Filters use the same disclosure, conditions and active chips as license. */
.page-shell { width: min(1920px,100%); grid-template-columns: 272px minmax(0,1fr); }
.workspace-nav-row { max-height: calc(100dvh - 48px); overflow-y: auto; overscroll-behavior: contain; gap: 24px; }
.seller-filter-rail { min-width: 0; }
.record-filters { min-width: 0; }
.record-filters > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--aip-border-control); border-radius: 8px; color: var(--text); background: var(--bg-soft); list-style: none; cursor: pointer; }
.record-filters > summary::-webkit-details-marker { display: none; }
.record-filters[open] > summary { border-color: var(--accent); }
.filter-count { min-width: 20px; color: var(--aip-accent-strong); font-variant-numeric: tabular-nums; text-align: center; }
.filter-body { display: grid; gap: 24px; min-width: 0; margin-block-start: 16px; }
.seller-filter-group { display: grid; min-width: 0; gap: 16px; }
.seller-filter-rail .compact-record-filters, .seller-filter-rail .filter-rules { display: grid; grid-template-columns: minmax(0,1fr); gap: 16px; min-width: 0; margin: 0; }
.seller-filter-rail .filter-rules:empty { display: none; }
.seller-filter-rule { display: grid; grid-template-columns: minmax(0,1fr) 40px; align-items: end; gap: 8px; min-width: 0; }
.seller-filter-rule > label { min-width: 0; }
.seller-filter-rail .filter-rule-remove { display: grid; place-items: center; width: 40px; min-width: 40px; min-height: 40px; padding: 0; font-size: 1.25rem; }
.seller-filter-rail .filter-edit-actions { display: grid; grid-template-columns: minmax(0,1fr); gap: 8px; }
.seller-filter-rail .filter-edit-actions button { width: 100%; }
.seller-filter-rail .filter-field-picker { display: grid; gap: 8px; }
.seller-filter-rail .filter-active { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 16px; }
.seller-filter-rail .filter-active:empty { display: none; }
.filter-active-chip { display: inline-flex; align-items: center; gap: 12px; max-width: 100%; min-height: 36px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--soft); background: var(--surface-strong); font-size: var(--aip-font-caption); line-height: 1.5; text-align: start; overflow-wrap: anywhere; }
.seller-quick-filters > h3 { margin: 0; font-size: 1rem !important; line-height: 1.5; font-weight: 500; }
.seller-filter-rail :is(.panel-head-actions,.student-salebot-filters,.filter-chip-row,.telegram-join-controls,.configuration-toolbar) { display: grid; grid-template-columns: minmax(0,1fr); gap: 16px; width: 100%; min-width: 0; margin: 0; padding: 0; }
.seller-filter-rail :is(label,.compact-inline-field,.configuration-toolbar label) { width: 100%; min-width: 0; max-width: 100%; }
.seller-filter-rail input { min-width: 0; width: 100%; }
.seller-filter-rail input[type="checkbox"] { width: 18px; }
.seller-filter-rail .checkbox-line { align-items: center; }
.seller-filter-rail .filter-active-chip { min-height: 40px; }
.sales-minimal .seller-filter-rail #filters-form { display: grid !important; }
.seller-rail { grid-column: 1; grid-row: 2; position: sticky; top: 24px; display: grid; align-content: start; gap: 16px; min-width: 0; max-height: calc(100dvh - 48px); overflow-y: auto; overscroll-behavior: contain; }
.seller-rail .workspace-nav-row { grid-column: auto; position: static; max-height: none; overflow: visible; }
.seller-filter-rail { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-soft); }
.filter-rail-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.filter-rail-heading h2 { font-size: 1.5rem; line-height: 1.3; }
.seller-filter-rail .filter-body { margin-block-start: 16px; }
.seller-filter-rule:has(> .filter-rule-remove[hidden]) { grid-template-columns: minmax(0,1fr); }
.filter-quick-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 16px; }
.filter-advanced { min-width: 0; }
.filter-advanced > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 8px; border: 1px solid var(--aip-border-control); border-radius: 8px; font-size: var(--aip-font-small); line-height: 1.5; list-style: none; cursor: pointer; }
.filter-advanced > summary::-webkit-details-marker { display: none; }
.filter-advanced > summary::after { content: "⌄"; flex: 0 0 auto; }
.filter-advanced[open] > summary::after { rotate: 180deg; }
.filter-advanced > :not(summary) { margin-block-start: 16px; }
.record-comment { display: grid; gap: 4px; margin-block-start: 12px; }
.record-comment > span, .record-person-label { color: var(--muted); font-size: var(--aip-font-caption); }
.record-person { display: grid; gap: 4px; }
.record-person + .record-person, td > .record-person { margin-block-start: 16px; }
.record-person > div { overflow-wrap: anywhere; }
.record-person .student-row-subtitle { margin: 0; }
.student-summary-card, .student-statistics-metric { container-type: inline-size; }
.student-summary-value, .student-statistics-metric strong { font-size: clamp(1.5rem,12cqi,2rem); }
.login-card :is(input,.primary) { min-height: 44px; }
@media (max-width: 640px) { body.seller-page.login-shell { padding: 16px; } .login-card { padding: 16px; } }
@media (max-width: 960px) {
    .page-shell { grid-template-columns: minmax(0,1fr); }
    .workspace-nav-row { position: static; max-height: none; overflow: visible; }
    .seller-rail { grid-column: 1; grid-row: auto; position: static; max-height: none; overflow: visible; }
}
