:root {
    --ink: #172033;
    --muted: #667085;
    --line: #e4e8ef;
    --surface: #ffffff;
    --soft: #f5f7fb;
    --primary: #3157d5;
    --primary-dark: #2445b1;
    --primary-soft: #edf1ff;
    --success: #15865b;
    --success-soft: #e8f7f0;
    --danger: #c13b4d;
    --danger-soft: #fff0f2;
    --shadow: 0 16px 44px rgba(23, 32, 51, .08);
    --radius: 18px;
}

* { box-sizing: border-box; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; clip-path: inset(50%) !important; }
html { color-scheme: light; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--soft);
    font: 14px/1.55 Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(28px, 4vw, 42px); line-height: 1.18; letter-spacing: -.04em; text-wrap: balance; }
h2 { margin-bottom: 6px; font-size: 20px; line-height: 1.3; }
p { color: var(--muted); }
.mono, code { font-family: "SFMono-Regular", Consolas, monospace; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.eyebrow { margin-bottom: 6px; color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .15em; }

.topbar, .channel-topbar {
    position: sticky;
    z-index: 30;
    top: 0;
    border-bottom: 1px solid rgba(228, 232, 239, .9);
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(16px);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; width: min(1320px, calc(100% - 40px)); min-height: 68px; margin: 0 auto; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand > span:last-child { display: grid; line-height: 1.2; }
.brand strong { max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.brand small { color: var(--muted); font-size: 11px; }
.brand-mark { display: inline-grid; width: 38px; height: 38px; place-items: center; flex: 0 0 auto; border-radius: 12px; color: #fff; background: linear-gradient(135deg, #3157d5, #6881ef); box-shadow: 0 8px 18px rgba(49, 87, 213, .25); font-size: 18px; font-weight: 800; }
.brand-mark.large { width: 52px; height: 52px; border-radius: 16px; font-size: 24px; }
.topnav { display: flex; align-items: center; gap: 6px; }
.topnav a, .nav-button { border: 0; border-radius: 10px; padding: 9px 13px; color: #526078; background: transparent; cursor: pointer; font-weight: 650; }
.topnav a:hover, .topnav a.active, .nav-button:hover { color: var(--primary); background: var(--primary-soft); }
.topnav form { margin: 0; }
.nav-identity { display: grid; min-width: 74px; margin: 0 6px 0 8px; line-height: 1.2; text-align: right; }
.nav-identity small { color: #8a94a8; font-size: 10px; }
.nav-identity strong { max-width: 130px; overflow: hidden; color: #334057; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }

.page-shell { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 72px; }
.wide-page { width: min(1540px, calc(100% - 32px)); }
.narrow-page { width: min(1040px, calc(100% - 40px)); }
.form-detail-page { width: min(1880px, calc(100% - 48px)); }
.page-heading { margin-bottom: 28px; }
.page-heading > p:last-child { max-width: 720px; margin-bottom: 0; font-size: 15px; }
.split-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.detail-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.heading-actions, .card-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.back-link {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    margin-bottom: 18px;
    border: 1px solid #d7def3;
    border-radius: 10px;
    padding: 7px 13px;
    color: var(--primary);
    background: var(--primary-soft);
    box-shadow: 0 4px 12px rgba(49, 87, 213, .08);
    font-weight: 750;
    transition: transform 150ms cubic-bezier(.23, 1, .32, 1), border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}
.back-link:active { transform: scale(.97); }
.back-link:focus-visible { outline: 3px solid rgba(49, 87, 213, .2); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
    .back-link:hover {
        border-color: #b9c6ef;
        background: #e4eaff;
        box-shadow: 0 7px 18px rgba(49, 87, 213, .14);
        transform: translateY(-1px);
    }
}
.title-status { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sheet-heading { margin-bottom: 20px; }

.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 11px; padding: 9px 16px; cursor: pointer; font-weight: 750; transition: transform .15s, box-shadow .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--primary); box-shadow: 0 8px 20px rgba(49, 87, 213, .22); }
.button.primary:hover { background: var(--primary-dark); }
.button.danger { border-color: #efbdc4; color: #a82f40; background: var(--danger-soft); }
.button.danger:hover { border-color: #e49aa5; background: #ffe5e9; box-shadow: 0 7px 18px rgba(193, 59, 77, .1); }
.button.secondary { border-color: var(--line); color: var(--ink); background: #fff; }
.button.secondary:hover { border-color: #c9d2e3; box-shadow: 0 7px 18px rgba(23, 32, 51, .08); }
.button.ghost { color: var(--primary); background: var(--primary-soft); }
.button.small { min-height: 36px; padding: 7px 12px; font-size: 13px; }
.button.wide { width: 100%; }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.button.is-loading { opacity: .65; pointer-events: none; }
.text-link, .text-button { color: var(--primary); font-weight: 700; }
.text-button { border: 0; padding: 4px 0; background: transparent; cursor: pointer; }
.danger-text { color: var(--danger); }

.flash { margin-bottom: 18px; border: 1px solid; border-radius: 12px; padding: 12px 15px; font-weight: 650; }
.flash.success { border-color: #bde7d4; color: #08724a; background: var(--success-soft); }
.flash.success { transition: opacity .18s ease, transform .18s ease; }
.flash.success.is-dismissing { opacity: 0; pointer-events: none; transform: translateY(-5px); }
.flash.error { border-color: #f3c3ca; color: #a52d3e; background: var(--danger-soft); }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.form-card-grid .form-card[data-form-id] { user-select: none; cursor: grab; }
.form-card-grid .form-card :is(a, button, input, select, textarea) { user-select: auto; }
.form-card { position: relative; display: flex; min-height: 294px; overflow: hidden; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--surface); box-shadow: 0 8px 30px rgba(23, 32, 51, .04); }
.form-card::before { position: absolute; top: 0; right: 0; left: 0; height: 4px; content: ""; }
.form-card.is-enabled { border-color: #d9e9e1; background: linear-gradient(180deg, #fbfffd 0, #fff 70px); box-shadow: 0 10px 32px rgba(21, 134, 91, .06); }
.form-card.is-enabled::before { background: linear-gradient(90deg, #20ad76, #65cba5); }
.form-card.is-disabled { border-color: #d8dde7; background: linear-gradient(180deg, #f1f3f7 0, #f8f9fb 82px); box-shadow: 0 8px 24px rgba(35, 45, 66, .035); }
.form-card.is-disabled::before { background: linear-gradient(90deg, #929bad, #c0c6d1); }
.form-card.is-disabled h2 { color: #5d687b; }
.form-card.is-disabled .slug, .form-card.is-disabled .metric-row dd { color: #8c95a5; }
.form-card.is-disabled .metric-row dt { color: #687386; }
.form-card.is-disabled .metric-row { border-color: #dfe3ea; }
.form-card:hover { border-color: #ccd5e8; box-shadow: var(--shadow); }
.form-card.is-enabled:hover { border-color: #bcdccb; box-shadow: 0 17px 44px rgba(21, 134, 91, .11); }
.form-card.is-disabled:hover { border-color: #c5cbd7; box-shadow: 0 15px 38px rgba(35, 45, 66, .08); }
.form-card[data-card-master-url] { cursor: pointer; transition: border-color 160ms ease, box-shadow 180ms ease, transform 160ms cubic-bezier(.23,1,.32,1); }
.form-card[data-card-master-url]:focus-visible { border-color: #aebdec; outline: 3px solid rgba(49,87,213,.16); outline-offset: 3px; }
.form-card[data-card-master-url]:active { transform: scale(.996); }
.form-card[data-card-master-url] :is(a, button, input, select, textarea) { cursor: pointer; }
.form-card-top { display: flex; align-items: center; gap: 7px; margin-bottom: 19px; color: var(--muted); font-size: 12px; }
.form-card-drag-handle { display: inline-grid; width: 18px; height: 22px; place-items: center; flex: 0 0 auto; color: #a1aabd; }
.form-card-drag-handle svg { width: 10px; height: 15px; fill: currentColor; }
.form-card-top .slug { margin-left: auto; color: #7b87a0; }
.form-card-export-icon { position: absolute; top: 52px; right: 20px; display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid #d9e0ec; border-radius: 9px; color: #66738a; background: rgba(255,255,255,.86); box-shadow: 0 4px 12px rgba(35,45,66,.055); transition: color 150ms ease, border-color 150ms ease, background 150ms ease, transform 150ms ease, box-shadow 150ms ease; }
.form-card-export-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.form-card-export-icon:hover { border-color: #b7c5ee; color: var(--primary); background: #f3f6ff; box-shadow: 0 7px 17px rgba(49,87,213,.12); transform: translateY(-1px); }
.form-card-export-icon:focus-visible { outline: 3px solid rgba(49,87,213,.16); outline-offset: 2px; }
.form-card:has(.form-card-export-icon) h2 { padding-right: 42px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-dot.online { background: #21ae76; box-shadow: 0 0 0 4px #e5f8f0; }
.status-dot.offline { background: #98a2b3; }
.status-text { border-radius: 999px; padding: 3px 8px; font-weight: 750; line-height: 1.3; }
.form-card.is-enabled .status-text { color: #08724a; background: #e5f8f0; }
.form-card.is-disabled .status-text { color: #626d80; background: #e4e7ec; }
.form-card h2 { font-size: 21px; }
.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); margin: 20px 0 18px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric-row div { text-align: center; }
.metric-row div + div { border-left: 1px solid var(--line); }
.metric-row dt { font-size: 21px; font-weight: 800; }
.metric-row dt.metric-time { font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric-row dd { margin: 0; color: var(--muted); font-size: 12px; }
.metric-row dd small { display: block; margin-top: 1px; color: #98a2b3; font-size: 10px; }
.card-actions { justify-content: space-between; }
.form-card-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: auto; }
.form-card-actions form, .heading-actions form { margin: 0; }
.form-card-actions > .button { width: 100%; }
.button.reactivate { border-color: #159467; color: #fff; background: #159467; box-shadow: 0 7px 18px rgba(21, 148, 103, .18); }
.button.reactivate:hover { border-color: #0e7c55; background: #0e7c55; box-shadow: 0 9px 22px rgba(21, 148, 103, .24); }
.button.danger.solid { border-color: #bd3045; color: #fff; background: #bd3045; box-shadow: 0 8px 20px rgba(189, 48, 69, .2); }
.button.danger.solid:hover { border-color: #a82438; color: #fff; background: #a82438; box-shadow: 0 10px 24px rgba(189, 48, 69, .26); }
.form-order-save-state { min-width: 88px; color: var(--success); text-align: right; font-size: 12px; font-weight: 700; }
.form-order-save-state.is-error { color: var(--danger); }
.form-card-grid.is-form-card-sorting .form-card, body.is-form-card-sorting { cursor: grabbing !important; }
.form-card.is-form-card-dragging { opacity: .16; border-color: #8fa3e8; box-shadow: none; }
.form-card-drag-ghost {
    position: fixed;
    z-index: 120;
    margin: 0;
    pointer-events: none;
    transform-origin: center;
    will-change: transform;
    border-color: #9badeb;
    box-shadow: 0 24px 65px rgba(23, 32, 51, .2);
}
.form-card.is-form-card-dropping { animation: drag-drop-settle 220ms cubic-bezier(.23, 1, .32, 1); }

.app-confirm-dialog {
    width: min(470px, calc(100% - 28px));
    border: 0;
    border-radius: 20px;
    padding: 0;
    color: var(--ink);
    background: transparent;
    box-shadow: 0 34px 100px rgba(23, 32, 51, .28);
    opacity: 1;
    transform: translateY(0) scale(1);
    transform-origin: center;
    transition: opacity 190ms cubic-bezier(.23, 1, .32, 1), transform 190ms cubic-bezier(.23, 1, .32, 1), overlay 190ms allow-discrete, display 190ms allow-discrete;
}
.app-confirm-dialog::backdrop { background: rgba(20, 27, 41, .42); backdrop-filter: blur(4px); opacity: 1; transition: opacity 190ms cubic-bezier(.23, 1, .32, 1), overlay 190ms allow-discrete, display 190ms allow-discrete; }
.app-confirm-dialog.is-closing { pointer-events: none; opacity: 0; transform: translateY(5px) scale(.985); }
.app-confirm-dialog.is-closing::backdrop { opacity: 0; }
@starting-style {
    .app-confirm-dialog[open] { opacity: 0; transform: translateY(8px) scale(.97); }
    .app-confirm-dialog[open]::backdrop { opacity: 0; }
}
.app-confirm-dialog-shell { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 0 15px; border-radius: 20px; padding: 24px; background: #fff; }
.app-confirm-dialog-icon { display: grid; width: 46px; height: 46px; place-items: center; grid-row: span 2; border-radius: 14px; color: #b72f44; background: #fff0f2; }
.app-confirm-dialog-icon svg { width: 23px; height: 23px; fill: currentColor; }
.app-confirm-dialog-copy .eyebrow { margin-bottom: 4px; color: #b72f44; }
.app-confirm-dialog-copy h2 { margin-bottom: 7px; font-size: 21px; }
.app-confirm-dialog-copy > p:last-child { margin-bottom: 0; color: #5f6b7e; }
.app-confirm-dialog-copy strong { color: #273247; }
.sheet-transfer-actions { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.sheet-import-popover { position: absolute; top: calc(100% + 8px); right: 0; z-index: 36; display: grid; width: min(310px, calc(100vw - 32px)); gap: 11px; border: 1px solid #d9dfeb; border-radius: 14px; padding: 14px; background: #fff; box-shadow: 0 14px 36px rgba(21, 34, 60, .16); }
.sheet-import-popover[hidden] { display: none; }
.sheet-import-popover label { display: grid; gap: 7px; color: #344054; font-size: 12px; font-weight: 750; }
.sheet-import-popover select { width: 100%; height: 40px; border: 1px solid #ccd5e4; border-radius: 9px; padding: 0 34px 0 11px; color: var(--ink); background: #fff; font: inherit; outline: none; }
.sheet-import-popover select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(53, 91, 221, .12); }
.sheet-import-popover .button { width: 100%; }
.sheet-import-inline-error { color: #b52f43; font-size: 12px; }
.sheet-transfer-status { position: absolute; top: calc(100% + 8px); right: 0; z-index: 35; width: max-content; max-width: min(360px, calc(100vw - 32px)); border: 1px solid #d9dfeb; border-radius: 10px; padding: 8px 11px; color: #536079; background: #fff; box-shadow: 0 10px 28px rgba(21, 34, 60, .14); font-size: 12px; }
.sheet-transfer-status.is-success { border-color: #bce8d3; color: #16764a; background: #effaf4; }
.sheet-transfer-status.is-error { border-color: #f2c1c8; color: #b52f43; background: #fff3f5; }
.app-confirm-warning { grid-column: 1 / -1; margin-top: 20px; border: 1px solid #f1c8cf; border-radius: 12px; padding: 12px 14px; color: #922d3d; background: #fff6f7; font-size: 13px; line-height: 1.55; }
.app-confirm-actions { display: flex; grid-column: 1 / -1; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.panel, .sheet-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 30px rgba(23, 32, 51, .04); }
.panel { padding: 24px; }
.panel + .panel { margin-top: 18px; }

.account-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.account-stat-grid article { display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 15px; padding: 17px 19px; background: #fff; box-shadow: 0 6px 20px rgba(23,32,51,.035); }
.account-stat-grid strong { font-size: 25px; line-height: 1.2; }
.account-stat-grid span { color: var(--muted); font-size: 12px; }
.account-admin-layout { display: grid; grid-template-columns: minmax(310px, .72fr) minmax(500px, 1.28fr); align-items: start; gap: 18px; }
.account-create-panel { position: sticky; top: 86px; }
.permission-fieldset { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 0; border: 1px solid var(--line); border-radius: 12px; padding: 13px; }
.permission-fieldset legend { padding: 0 7px; color: #3b4659; font-weight: 750; }
.permission-option { display: flex; align-items: flex-start; gap: 9px; border-radius: 10px; padding: 9px; background: #f8f9fc; cursor: pointer; }
.permission-option:has(input:checked) { background: var(--primary-soft); }
.permission-option input { width: 16px; height: 16px; flex: 0 0 auto; margin: 3px 0 0; padding: 0; accent-color: var(--primary); }
.permission-option > span { display: grid; min-width: 0; gap: 3px; }
.permission-option strong { color: var(--ink); font-size: 13px; }
.permission-option small { color: #536079; font-size: 12px; font-weight: 500; line-height: 1.45; }
.form-access-fieldset { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; max-height: 260px; margin: 0; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 13px; }
.form-access-fieldset legend { padding: 0 7px; color: #3b4659; font-weight: 750; }
.form-access-option { display: flex; min-width: 0; align-items: center; gap: 9px; border-radius: 10px; padding: 10px; background: #f8f9fc; cursor: pointer; }
.form-access-option:has(input:checked) { background: var(--primary-soft); }
.form-access-option input { width: 16px; height: 16px; flex: 0 0 auto; margin: 0; padding: 0; accent-color: var(--primary); }
.form-access-option > span { display: grid; min-width: 0; gap: 2px; }
.form-access-option strong { overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.form-access-option small { color: #667085; font-size: 11px; font-weight: 500; }
.form-access-empty { grid-column: 1 / -1; margin: 0; padding: 12px; text-align: center; }
.form-access-fieldset[hidden], .form-access-super-note[hidden] { display: none; }
.form-access-super-note { margin: 0; border-radius: 10px; padding: 12px 14px; background: var(--primary-soft); color: #38549b; font-size: 13px; font-weight: 650; }
.admin-account-list { display: grid; gap: 10px; }
.admin-account-card { overflow: hidden; margin: 0; border: 1px solid var(--line); border-radius: 13px; background: #fafbfe; }
.admin-account-card[open] { border-color: #cbd5f3; background: #fff; box-shadow: 0 8px 22px rgba(23,32,51,.055); }
.admin-account-card > summary { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 13px 14px; color: var(--ink); list-style: none; }
.admin-account-card > summary::-webkit-details-marker { display: none; }
.admin-account-card > summary::marker { content: ""; }
.account-avatar { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 12px; color: var(--primary); background: var(--primary-soft); font-weight: 800; }
.account-summary-copy { display: grid; min-width: 0; gap: 2px; }
.account-summary-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-summary-copy em { margin-left: 6px; border-radius: 999px; padding: 2px 6px; color: var(--primary); background: var(--primary-soft); font-size: 10px; font-style: normal; }
.account-summary-copy small { color: var(--muted); font-weight: 500; }
.admin-account-editor { display: grid; gap: 16px; border-top: 1px solid var(--line); padding: 16px; }
.permission-fieldset.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.account-secondary-actions { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; border-top: 1px dashed #dce2ec; padding-top: 15px; }
.account-secondary-actions form { margin: 0; }
.reset-password-form { display: grid; grid-template-columns: minmax(190px, 1fr) auto; align-items: end; gap: 8px; }
.admin-master-sheet.is-readonly :is(.sheet-cell-control, .sheet-multi-select) { pointer-events: none; }
.admin-master-sheet.is-readonly .sheet-edit-cell { background: #fbfcfe; }
.master-field-header-button:disabled { cursor: default; opacity: 1; }
.section-heading { display: flex; gap: 14px; margin-bottom: 22px; }
.section-heading p { margin-bottom: 0; }
.section-heading.with-action { align-items: center; justify-content: space-between; }
.section-heading-copy { display: flex; gap: 14px; }
.step-number { display: inline-grid; width: 32px; height: 32px; place-items: center; flex: 0 0 auto; border-radius: 10px; color: var(--primary); background: var(--primary-soft); font-weight: 800; }
.builder-form > .panel + .panel { margin-top: 18px; }
.preset-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.preset-card { position: relative; display: flex; min-height: 135px; align-items: flex-start; flex-direction: column; gap: 7px; border: 1px solid var(--line); border-radius: 15px; padding: 18px; cursor: pointer; background: #fafbfe; transition: border-color .16s, box-shadow .16s, transform .16s; }
.preset-card:hover { transform: translateY(-1px); border-color: #bcc8ea; box-shadow: 0 8px 24px rgba(23, 32, 51, .07); }
.preset-card:has(input:checked) { border-color: #6f88e8; background: var(--primary-soft); box-shadow: 0 0 0 3px rgba(49, 87, 213, .08); }
.preset-card input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.preset-card-check { position: absolute; top: 15px; right: 15px; display: grid; width: 23px; height: 23px; place-items: center; border: 1px solid #cdd5e3; border-radius: 50%; color: transparent; background: #fff; font-size: 12px; }
.preset-card:has(input:checked) .preset-card-check { border-color: var(--primary); color: #fff; background: var(--primary); }
.preset-badge { border-radius: 999px; padding: 3px 8px; color: var(--primary); background: #e7ecff; font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.preset-card strong { margin-top: 3px; font-size: 18px; }
.preset-card p { flex: 1; margin-bottom: 3px; font-size: 13px; }
.preset-field-count { color: #536079; font-size: 11px; font-weight: 750; }
.preset-notice { margin: 13px 0 0; color: var(--muted); font-size: 12px; }
.form-grid { display: grid; gap: 18px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.form-grid > label { align-content: start; }
.span-two { grid-column: span 2; }
.stack-form { display: grid; gap: 18px; }
label { display: grid; gap: 7px; color: #3b4659; font-weight: 650; }
label > span b { color: var(--danger); }
label small { color: var(--muted); font-weight: 400; }
input, textarea, select { width: 100%; border: 1px solid #d7dde8; border-radius: 10px; padding: 10px 12px; outline: none; color: var(--ink); background: #fff; }
input:focus, textarea:focus, select:focus { border-color: #7790ed; box-shadow: 0 0 0 3px rgba(49, 87, 213, .11); }
textarea { resize: vertical; }
.form-description-input { min-height: 320px; line-height: 1.65; }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix span { display: grid; place-items: center; border: 1px solid #d7dde8; border-right: 0; border-radius: 10px 0 0 10px; padding: 0 11px; color: var(--muted); background: #f6f8fb; }
.input-prefix input { border-radius: 0 10px 10px 0; }
.input-action { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: stretch; gap: 8px; }
.icon-button { display: grid; width: 44px; min-height: 44px; place-items: center; border: 1px solid #d7dde8; border-radius: 10px; color: var(--primary); background: #fff; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.icon-button:hover, .icon-button:focus-visible { border-color: #aebdec; outline: 0; background: var(--primary-soft); }
.icon-button:active { transform: scale(.96); }
.icon-button:disabled { opacity: .55; cursor: wait; }
.icon-button span { font-size: 22px; line-height: 1; }
.form-submit-row { display: flex; justify-content: flex-end; }

.field-builder-panel { overflow: hidden; }
.field-builder-actions { display: flex; align-items: center; gap: 12px; }
.field-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.field-count b { color: var(--ink); font-size: 15px; }
.field-list { display: grid; gap: 10px; }
.field-summary-card { display: grid; grid-template-columns: 66px minmax(0, 1fr) auto; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 14px; padding: 14px 15px; background: #fafbfe; transform-origin: center; transition: opacity .18s ease, transform .2s cubic-bezier(.2,.75,.25,1), border-color .15s, box-shadow .2s ease, background .15s; will-change: transform; }
.field-summary-card:hover { border-color: #c6d0e5; background: #fff; box-shadow: 0 7px 20px rgba(23,32,51,.05); }
.field-summary-card:focus-visible { border-color: #7790ed; outline: 3px solid rgba(49,87,213,.11); background: #fff; }
.field-summary-card.is-dragging, .option-editor-row.is-dragging { z-index: 3; opacity: .92; border-color: #9cb0f3; background: #fff; transform: scale(1.018) rotate(.18deg); box-shadow: 0 16px 34px rgba(35, 58, 130, .2); }
.field-list.is-sorting .field-summary-card:not(.is-dragging), .option-editor-list.is-sorting .option-editor-row:not(.is-dragging) { transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s ease; }
.field-summary-card.is-dropping, .option-editor-row.is-dropping { animation: drag-drop-settle .24s cubic-bezier(.2,.75,.25,1); }
.field-order-control { display: flex; align-items: center; gap: 5px; }
.field-order { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; color: #536079; background: #e9edf5; font-size: 12px; font-weight: 800; }
.drag-control { display: grid; width: 28px; height: 24px; place-items: center; border: 0; border-radius: 7px; padding: 0; color: #8993a5; background: transparent; cursor: grab; touch-action: none; user-select: none; transition: color .15s, background .15s, transform .15s; }
.drag-control-icon { display: block; width: 18px; height: 18px; opacity: .68; pointer-events: none; transition: opacity .15s, transform .15s; }
.drag-control:hover, .drag-control:focus-visible { border-color: #aebdec; color: var(--primary); background: var(--primary-soft); outline: 0; }
.drag-control:focus-visible { box-shadow: 0 0 0 3px rgba(49,87,213,.12); }
.drag-control:active, .is-sorting .drag-control { cursor: grabbing; }
.drag-control:hover .drag-control-icon, .drag-control:focus-visible .drag-control-icon { opacity: 1; }
.is-dragging .drag-control { color: var(--primary); background: var(--primary-soft); transform: scale(1.08); }
.is-dragging .drag-control-icon { opacity: 1; transform: scale(1.06); }
.field-summary-copy { display: grid; min-width: 0; gap: 2px; }
.field-summary-card .field-summary-copy { cursor: pointer; }
.field-summary-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.field-summary-copy > span { color: var(--muted); font-size: 12px; }
.field-option-preview { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
.field-option-preview[hidden] { display: none; }
.field-option-preview span { max-width: 160px; overflow: hidden; border-radius: 6px; padding: 3px 7px; color: var(--option-fg, #536079); background: var(--option-bg, #edf0f6); text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.field-summary-actions { display: flex; align-items: center; gap: 4px; }
.field-summary-actions button, .option-row-actions button { border: 0; border-radius: 7px; padding: 6px 8px; color: var(--muted); background: transparent; cursor: pointer; font-size: 12px; font-weight: 650; }
.field-summary-actions button:hover, .option-row-actions button:hover { color: var(--primary); background: var(--primary-soft); }
.field-summary-actions .danger-text:hover, .option-row-actions .danger-text:hover { color: var(--danger); background: var(--danger-soft); }
.live-field-builder { position: relative; }
.live-save-state { border: 0; border-radius: 999px; padding: 5px 9px; color: #08724a; background: var(--success-soft); cursor: pointer; font-size: 11px; font-weight: 750; white-space: nowrap; transition: color .15s, background .15s; }
.live-save-state.is-saving { color: #3656b5; background: var(--primary-soft); }
.live-save-state.is-error { color: var(--danger); background: var(--danger-soft); }
.live-schema-note { margin: 13px 0 0; color: var(--muted); font-size: 11px; }

.field-editor-dialog { width: min(590px, calc(100% - 28px)); max-height: calc(100vh - 36px); border: 0; border-radius: 20px; padding: 0; color: var(--ink); background: #fff; box-shadow: 0 32px 100px rgba(19,28,48,.3); }
.field-editor-dialog::backdrop { background: rgba(20, 28, 45, .48); backdrop-filter: blur(3px); }
.field-editor-shell { display: flex; max-height: calc(100vh - 36px); flex-direction: column; }
.field-editor-header { display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 22px 24px 17px; }
.field-editor-header h2, .field-editor-header p { margin-bottom: 0; }
.field-editor-header .dialog-close { width: auto; min-width: 48px; padding: 0 10px; font-size: 12px; }
.field-editor-body { display: grid; gap: 21px; overflow: auto; padding: 22px 24px 26px; }
.field-editor-section { position: relative; display: grid; gap: 7px; }
.field-editor-label { color: #3b4659; font-weight: 650; }
.field-editor-label b { color: var(--danger); }
.field-type-trigger { display: flex; min-height: 56px; align-items: center; justify-content: space-between; border: 1px solid #d7dde8; border-radius: 11px; padding: 10px 13px; text-align: left; color: var(--ink); background: #fff; cursor: pointer; }
.field-type-trigger:hover, .field-type-trigger:focus-visible { border-color: #7790ed; box-shadow: 0 0 0 3px rgba(49, 87, 213, .11); outline: 0; }
.field-type-trigger span { font-weight: 700; }
.field-type-trigger-chevron { width: 14px; height: 14px; opacity: .48; }
.field-type-trigger small { color: var(--muted); }
.field-type-picker { z-index: 6; margin-top: 7px; border: 1px solid #d7dde8; border-radius: 13px; padding: 12px; background: #fff; box-shadow: 0 18px 44px rgba(23,32,51,.16); }
.field-type-picker[hidden] { display: none; }
.field-type-search { gap: 5px; margin-bottom: 10px; }
.field-type-search span { color: var(--muted); font-size: 11px; }
.field-type-search input { padding: 8px 10px; }
.field-type-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 270px; overflow: auto; gap: 6px; }
.field-type-choice { display: grid; gap: 1px; border: 1px solid transparent; border-radius: 9px; padding: 9px 10px; text-align: left; color: var(--ink); background: #f8f9fc; cursor: pointer; }
.field-type-choice:hover { border-color: #cbd4e7; background: #fff; }
.field-type-choice.selected { border-color: #aebdec; color: var(--primary); background: var(--primary-soft); }
.field-type-choice small { color: var(--muted); font-size: 10px; }
.field-option-editor { display: grid; gap: 12px; border-top: 1px solid var(--line); padding-top: 20px; }
.field-option-editor[hidden] { display: none; }
.field-option-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.field-option-heading > div { display: grid; }
.field-option-heading small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.field-option-heading .text-button { white-space: nowrap; }
.option-editor-list { display: grid; gap: 8px; }
.option-editor-row { position: relative; display: grid; grid-template-columns: auto 28px 30px minmax(0, 1fr) auto; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 7px; background: #f5f6f8; transform-origin: center; transition: opacity .18s ease, transform .2s cubic-bezier(.2,.75,.25,1), border-color .15s, box-shadow .2s ease, background .15s; will-change: transform; }
.option-order { color: #7c879b; text-align: center; font-size: 11px; font-weight: 800; }
.option-editor-row input { padding: 8px 10px; background: #fff; }
.option-color-trigger { display: grid; width: 30px; height: 30px; place-items: center; border: 0; border-radius: 8px; padding: 0; background: transparent; cursor: pointer; }
.option-color-trigger:hover, .option-color-trigger:focus-visible { outline: 0; background: #e9edf5; }
.option-color-trigger span { width: 20px; height: 20px; border: 2px solid #fff; border-radius: 6px; background: var(--option-bg, #e5e7eb); box-shadow: 0 0 0 1px rgba(28,39,58,.14); }
.option-color-palette { position: fixed; z-index: 260; display: grid; grid-template-columns: repeat(12, 20px); gap: 5px; width: max-content; border: 1px solid #d9dee8; border-radius: 10px; padding: 12px; background: #fff; box-shadow: 0 18px 48px rgba(23,32,51,.2); }
.option-color-palette[hidden] { display: none; }
.option-color-choice { width: 20px; height: 20px; border: 0; border-radius: 5px; padding: 0; background: var(--swatch-color); cursor: pointer; }
.option-color-choice:hover { transform: scale(1.08); }
.option-color-choice:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.option-color-choice.is-selected { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--primary); }
.option-row-actions { display: flex; align-items: center; gap: 1px; }
.required-toggle { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); padding-top: 20px; }
.required-toggle > span { display: grid; }
.required-toggle small { color: var(--muted); font-size: 11px; font-weight: 400; }
.required-toggle input { width: 20px; height: 20px; flex: 0 0 auto; }
.field-editor-footer { display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); padding: 15px 24px; background: #fff; }
.sticky-submit { position: sticky; z-index: 10; bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 18px; border: 1px solid #d9dfeb; border-radius: 15px; padding: 14px 16px; background: rgba(255,255,255,.94); box-shadow: 0 12px 34px rgba(23,32,51,.13); backdrop-filter: blur(14px); }
.sticky-submit > div { display: grid; }
.sticky-submit span { color: var(--muted); font-size: 12px; }
.sticky-submit.actions-only { justify-content: flex-end; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stats-grid article { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; background: #fff; }
.stats-grid span { color: var(--muted); }
.stats-grid strong { font-size: 24px; }
.form-management-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.form-management-actions form { margin: 0; }
.form-management-actions > .button { width: 100%; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; align-items: start; gap: 18px; }
.detail-layout:not(:has(aside)) { grid-template-columns: minmax(0, 1fr); }
.form-detail-page .detail-layout { grid-template-columns: minmax(0, 1fr); }
.sticky-panel { position: sticky; top: 88px; }
.copy-box { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 12px; padding: 9px; background: #f8f9fc; }
.copy-box code { min-width: 0; flex: 1; overflow: auto; padding: 0 8px; color: #344264; white-space: nowrap; }
.status-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 9px; font-size: 11px; font-weight: 750; }
.status-pill.good { color: #08724a; background: var(--success-soft); }
.status-pill.neutral { color: #667085; background: #eef1f5; }
.status-pill.danger { color: #a52d3e; background: var(--danger-soft); }
.channel-accounts { overflow: hidden; padding: 0; }
.channel-accounts-summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 24px; color: var(--ink); cursor: pointer; list-style: none; }
.channel-accounts-summary::-webkit-details-marker { display: none; }
.channel-accounts-summary::marker { content: ""; }
.channel-accounts-summary h2, .channel-accounts-summary p { margin-bottom: 0; }
.channel-accounts-toggle { display: flex; align-items: center; gap: 10px; color: var(--primary); font-size: 12px; font-weight: 750; }
.channel-count-badge { border-radius: 999px; padding: 4px 9px; color: #435070; background: #eff2f7; }
.channel-accounts .when-open { display: none; }
.channel-accounts[open] .when-open { display: inline; }
.channel-accounts[open] .when-closed { display: none; }
.channel-accounts-content { border-top: 1px solid var(--line); }
.channel-accounts-content .table-wrap { max-height: 760px; overflow: auto; }
.channel-accounts .data-table { min-width: 920px; }
.channel-accounts .data-table th { position: sticky; z-index: 2; top: 0; }
.channel-accounts .data-table th:nth-child(4), .channel-accounts .data-table td:nth-child(4) { min-width: 74px; text-align: center; }
.channel-accounts .data-table th:nth-child(5), .channel-accounts .data-table td:nth-child(5) { min-width: 132px; }
.channel-accounts .data-table th:last-child, .channel-accounts .data-table td:last-child { min-width: 174px; }
.channel-login-status { min-width: 56px; justify-content: center; white-space: nowrap; line-height: 1.2; }
.channel-created-time { white-space: nowrap; }
.channel-mode-control { display: flex; min-width: 210px; align-items: center; gap: 8px; }
.channel-mode-form { display: flex; min-width: 142px; align-items: center; gap: 7px; }
.channel-mode-form select { min-width: 124px; padding: 7px 28px 7px 9px; }
.channel-mode-form.is-saving select { opacity: .65; }
.channel-mode-save-state { color: #16805b; font-size: 11px; font-weight: 700; white-space: nowrap; }
.channel-mode-save-state.is-error { color: #bd3348; }
.channel-mode-config[hidden] { display: none; }
.independent-entry-heading { display: flex; align-items: flex-end; justify-content: space-between; }
.independent-entry-heading .eyebrow { margin-top: 18px; }
.independent-entry-heading-meta { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.independent-entry-heading-meta code { border-radius: 8px; padding: 5px 9px; color: #3b4966; background: #edf1f7; }
.independent-entry-list-panel { padding: 0; overflow: hidden; }
.independent-entry-list-panel > .section-heading { margin: 0; padding: 22px 24px; }
.independent-entry-list { border-top: 1px solid var(--line); }
.independent-entry-list-head, .independent-entry-item { display: grid; grid-template-columns: minmax(230px, .9fr) minmax(360px, 1.6fr) minmax(145px, .55fr) auto; align-items: center; gap: 14px; }
.independent-entry-list-head { min-height: 38px; padding: 0 18px; color: #68748c; background: #f7f9fc; font-size: 11px; font-weight: 750; }
.independent-entry-item { min-height: 86px; border-top: 1px solid var(--line); padding: 12px 18px; background: #fff; }
.independent-entry-list-head + .independent-entry-item { border-top: 0; }
.independent-entry-add-button { border: 0; cursor: pointer; transition: color .15s, background .15s, transform .15s; }
.independent-entry-add-button:hover { color: #fff; background: var(--primary); transform: translateY(-1px); }
.independent-entry-add-button:focus-visible { outline: 3px solid rgba(49, 87, 213, .22); outline-offset: 3px; }
.independent-entry-add-row { border-top: 1px solid var(--line); margin: 0; background: #f7f9fc; }
.independent-entry-add-row button { display: flex; width: 100%; min-height: 42px; align-items: center; gap: 8px; border: 0; padding: 0 18px; color: #60708e; background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; }
.independent-entry-add-row button:hover { color: var(--primary); background: var(--primary-soft); }
.independent-entry-add-row button span { font-size: 20px; font-weight: 400; }
.independent-entry-item.is-disabled { background: #f6f7f9; }
.independent-entry-label-form { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 7px; }
.independent-entry-index { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; color: #68748c; background: #edf1f7; font-size: 12px; font-weight: 750; }
.independent-entry-label-form input { min-width: 0; height: 36px; padding: 7px 9px; font-weight: 700; }
.personal-entry-save-state { min-width: 48px; color: #6c7890; font-size: 10px; font-weight: 700; white-space: nowrap; }
.personal-entry-save-state.is-saving { color: #60708e; }
.personal-entry-save-state.is-saved { color: #16805b; }
.personal-entry-save-state.is-error { color: #bd3348; }
.independent-entry-link-box { min-width: 0; padding: 6px; border-radius: 9px; }
.independent-entry-link-box code { font-size: 11px; }
.independent-entry-status { display: grid; justify-items: start; gap: 4px; color: var(--muted); font-size: 10px; }
.independent-entry-status time, .independent-entry-status small { white-space: nowrap; }
.independent-entry-actions { display: flex; justify-content: flex-end; gap: 6px; }
.independent-entry-actions form { margin: 0; }
.danger-text { color: #bd3348 !important; }
.channel-editor-dialog { width: min(620px, calc(100% - 28px)); }
.schema-list { display: grid; gap: 9px; }
.schema-item { display: flex; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.schema-index { display: grid; width: 28px; height: 28px; place-items: center; flex: 0 0 auto; border-radius: 8px; color: #65708a; background: #eff2f7; font-weight: 750; }
.schema-item > div:nth-child(2) { display: grid; min-width: 160px; }
.schema-item small { color: var(--muted); }
.option-chips { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-left: auto; }
.option-chips span, .channel-badge { border-radius: 999px; padding: 4px 8px; color: #435070; background: #eff2f7; font-size: 12px; }

.table-wrap { overflow: auto; }
.table-wrap.tall { max-height: calc(100vh - 255px); min-height: 260px; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; }
.data-table th, .data-table td { border-bottom: 1px solid var(--line); padding: 12px 13px; vertical-align: middle; }
.data-table th { color: #536079; background: #f8f9fc; font-size: 12px; font-weight: 750; white-space: nowrap; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #fafbfe; }
.data-table form { margin: 0; }
.empty-cell { padding: 44px !important; color: var(--muted); text-align: center; }
.sheet-panel { overflow: hidden; }
.table-summary { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 13px 16px; color: var(--muted); font-size: 12px; }
.table-summary strong { color: var(--ink); font-size: 16px; }
.sheet-filter-host { position: relative; z-index: 24; flex: 0 0 auto; margin-bottom: 9px; }
.sheet-view-strip { display: flex; min-height: 40px; align-items: center; gap: 7px; border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; padding: 5px 7px; background: #fbfcfe; }
.sheet-view-switcher, .sheet-view-fields { position: relative; }
.sheet-view-trigger, .sheet-view-fields-trigger, .sheet-view-add, .sheet-view-item-main, .sheet-view-item-action { border: 0; cursor: pointer; font: inherit; }
.sheet-view-trigger { display: inline-flex; height: 30px; align-items: center; gap: 7px; border-radius: 7px; padding: 0 9px; color: #28354e; background: #fff; box-shadow: inset 0 0 0 1px #dfe4ed; font-size: 13px; font-weight: 700; }
.sheet-view-trigger:hover, .sheet-view-trigger[aria-expanded="true"] { color: var(--primary); background: var(--primary-soft); box-shadow: none; }
.sheet-view-type-mark { color: #66738b; font-size: 15px; font-weight: 400; }
.sheet-view-chevron { color: #7b8799; font-size: 14px; }
.sheet-view-fields-trigger { height: 30px; border-radius: 7px; padding: 0 10px; color: #4b5870; background: transparent; font-size: 12px; font-weight: 650; }
.sheet-view-fields-trigger:hover, .sheet-view-fields-trigger[aria-expanded="true"] { color: var(--primary); background: var(--primary-soft); }
.sheet-view-save-state { margin-left: auto; padding-right: 4px; color: #8791a3; font-size: 11px; }
.sheet-view-save-state.is-saving { color: var(--primary); }
.sheet-view-save-state.is-error { color: var(--danger); }
.sheet-view-changes { display: inline-flex; align-items: center; gap: 12px; padding: 5px 10px; border-radius: 6px; background: #edf4ff; color: #536984; font-size: 12px; }
.sheet-view-changes[hidden] { display: none; }
.sheet-view-changes button { border: 0; padding: 3px 0; background: transparent; color: var(--primary); font: inherit; cursor: pointer; white-space: nowrap; }
.sheet-view-changes button:hover { text-decoration: underline; }
.sheet-view-changes button:disabled { opacity: .5; cursor: wait; }
.sheet-view-changes.is-error { color: var(--danger); }
.has-view-changes .sheet-view-save-state:not(.is-error) { visibility: hidden; }
.sheet-view-popover, .sheet-view-fields-popover { position: absolute; z-index: 35; top: calc(100% + 7px); left: 0; width: 310px; overflow: hidden; border: 1px solid #d8deea; border-radius: 11px; padding: 9px; background: #fff; box-shadow: 0 16px 42px rgba(23,32,51,.18); }
.sheet-view-popover[hidden], .sheet-view-fields-popover[hidden], .sheet-view-name-editor[hidden] { display: none; }
.sheet-view-popover-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 4px 8px; }
.sheet-view-popover-head strong { font-size: 13px; }
.sheet-view-popover-head span { color: var(--muted); font-size: 10px; }
.sheet-view-list { display: grid; max-height: 280px; overflow: auto; gap: 2px; }
.sheet-view-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border-radius: 7px; }
.sheet-view-item:hover { background: #f4f6fa; }
.sheet-view-item.is-active { color: var(--primary); background: var(--primary-soft); }
.sheet-view-item-main { min-width: 0; overflow: hidden; border-radius: 7px; padding: 8px 9px; text-align: left; color: inherit; background: transparent; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 650; }
.sheet-view-item-actions { display: flex; padding-right: 4px; opacity: 0; transition: opacity 120ms ease; }
.sheet-view-item:hover .sheet-view-item-actions, .sheet-view-item.is-active .sheet-view-item-actions { opacity: 1; }
.sheet-view-item-action { border-radius: 5px; padding: 4px 5px; color: #6f7a8e; background: transparent; font-size: 10px; }
.sheet-view-item-action:hover { color: var(--primary); background: #fff; }
.sheet-view-item-action.is-danger:hover { color: var(--danger); }
.sheet-view-add { width: 100%; margin-top: 7px; border-top: 1px solid var(--line); padding: 9px 8px 2px; text-align: left; color: var(--primary); background: transparent; font-size: 12px; font-weight: 700; }
.sheet-view-name-editor { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 5px; margin-top: 7px; border-top: 1px solid var(--line); padding-top: 8px; }
.sheet-view-name-editor input { min-width: 0; padding: 7px 8px; font-size: 12px; }
.sheet-view-name-editor .button { min-height: 32px; padding: 5px 8px; }
.sheet-view-fields-popover { width: 260px; }
.sheet-view-field-list { display: grid; max-height: 360px; overflow: auto; gap: 2px; }
.sheet-view-field-item { display: grid; grid-template-columns: 24px 22px minmax(0, 1fr); align-items: center; gap: 4px; border-radius: 7px; padding: 5px 7px; background: #fff; }
.sheet-view-field-item:hover, .sheet-view-field-item.is-drag-target { background: #f4f6fa; }
.sheet-view-field-item.is-dragging { opacity: .45; }
.sheet-view-field-drag { border: 0; color: #9aa3b2; background: transparent; cursor: grab; font-size: 15px; }
.sheet-view-field-item input { width: 15px; height: 15px; margin: 0; accent-color: var(--primary); }
.sheet-view-field-label { overflow: hidden; color: #3f4b61; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.is-view-hidden { display: none !important; }
.sheet-filter-toolbar { display: flex; min-height: 44px; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 6px 8px; background: #fff; box-shadow: 0 5px 18px rgba(23,32,51,.045); }
.sheet-view-strip + .sheet-filter-toolbar { border-radius: 0 0 12px 12px; }
.sheet-filter-trigger, .sheet-filter-clear-inline, .sheet-filter-add, .sheet-filter-logic button, .sheet-filter-remove, .sheet-sort-direction button, .sheet-sort-drag { border: 0; cursor: pointer; font: inherit; }
.sheet-filter-trigger { display: inline-flex; height: 32px; align-items: center; gap: 7px; border-radius: 8px; padding: 0 10px; color: #34415d; background: #f4f6fa; font-size: 13px; font-weight: 750; transition: color 150ms ease, background 150ms ease, transform 140ms cubic-bezier(.23,1,.32,1); }
.sheet-filter-trigger:hover, .sheet-filter-trigger[aria-expanded="true"], .sheet-filter-trigger.is-active { color: var(--primary); background: var(--primary-soft); }
.sheet-filter-trigger:active, .sheet-filter-add:active, .sheet-filter-logic button:active, .sheet-filter-remove:active { transform: scale(.97); }
.sheet-filter-trigger svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.8; }
.sheet-filter-count { display: grid; min-width: 18px; height: 18px; place-items: center; border-radius: 999px; padding: 0 5px; color: #fff; background: var(--primary); font-size: 11px; line-height: 1; }
.sheet-filter-count[hidden] { display: none; }
.sheet-filter-clear-inline { border-radius: 7px; padding: 6px 8px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 650; }
.sheet-filter-clear-inline:hover { color: var(--danger); background: var(--danger-soft); }
.sheet-filter-result { margin-left: auto; padding-right: 5px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.sheet-edit-tools { display: inline-flex; height: 32px; align-items: center; gap: 2px; border-left: 1px solid #e3e7ee; padding-left: 7px; }
.sheet-icon-button, .sheet-search-step, .sheet-search-close, .sheet-comment-close { display: grid; place-items: center; border: 0; color: #566278; background: transparent; cursor: pointer; }
.sheet-icon-button { width: 31px; height: 31px; border-radius: 7px; }
.sheet-icon-button:hover, .sheet-icon-button[aria-expanded="true"] { color: var(--primary); background: var(--primary-soft); }
.sheet-icon-button:disabled { color: #b7bfcc; cursor: default; background: transparent; }
.sheet-fluent-icon { font-family: "Segoe Fluent Icons", "Segoe MDL2 Assets", sans-serif; font-size: 16px; font-weight: 400; line-height: 1; }
.sheet-tool-divider { width: 1px; height: 18px; margin: 0 3px; background: #e3e7ee; }
.sheet-search-panel { position: absolute; z-index: 42; top: calc(100% + 7px); right: 0; display: grid; width: min(420px, calc(100vw - 28px)); min-height: 46px; grid-template-columns: 24px minmax(0, 1fr) auto 30px 30px 30px; align-items: center; gap: 3px; border: 1px solid #cfd8e9; border-radius: 10px; padding: 6px 7px; background: #fff; box-shadow: 0 14px 38px rgba(23,32,51,.18); }
.sheet-search-panel[hidden] { display: none; }
.sheet-search-leading { color: #5e697d; text-align: center; }
.sheet-search-panel input { width: 100%; min-width: 0; height: 32px; border: 0; padding: 0 5px; background: transparent; box-shadow: none; font-size: 13px; }
.sheet-search-panel input:focus { outline: 0; }
.sheet-search-count { min-width: 48px; color: #8791a2; text-align: center; font-size: 11px; font-variant-numeric: tabular-nums; }
.sheet-search-step, .sheet-search-close { width: 30px; height: 30px; border-radius: 7px; }
.sheet-search-step:hover, .sheet-search-close:hover { color: var(--primary); background: #f2f5fb; }
.sheet-search-step:disabled { color: #bec5d0; cursor: default; background: transparent; }
.spreadsheet-table td.is-search-match { box-shadow: inset 0 0 0 2px #f1bd3c; }
.spreadsheet-table td.is-search-current { position: relative; z-index: 2; box-shadow: inset 0 0 0 2px var(--primary), 0 0 0 1px rgba(49,87,213,.16); }
.spreadsheet-table tr.is-sheet-row-selected td.row-no { color: var(--primary); background: #edf2ff; font-weight: 800; }
.sheet-filter-popover { position: absolute; top: calc(100% + 7px); left: 0; width: min(720px, calc(100vw - 32px)); overflow: hidden; border: 1px solid #d8deea; border-radius: 14px; padding: 14px; background: #fff; box-shadow: 0 18px 48px rgba(23,32,51,.2); transform: translateY(0) scale(1); transform-origin: 32px 0; opacity: 1; transition: opacity 150ms ease-out, transform 170ms cubic-bezier(.23,1,.32,1); }
.sheet-filter-popover[hidden] { display: none; }
@starting-style { .sheet-filter-popover:not([hidden]) { opacity: 0; transform: translateY(-4px) scale(.985); } }
.sheet-filter-popover-head, .sheet-filter-popover-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-filter-popover-head { margin-bottom: 12px; }
.sheet-filter-popover-head strong { font-size: 14px; }
.sheet-filter-logic { display: inline-flex; border-radius: 8px; padding: 2px; background: #f1f3f7; }
.sheet-filter-logic button { height: 28px; border-radius: 6px; padding: 0 9px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 700; transition: color 140ms ease, background 140ms ease, box-shadow 140ms ease, transform 120ms ease-out; }
.sheet-filter-logic button[aria-pressed="true"] { color: var(--ink); background: #fff; box-shadow: 0 1px 4px rgba(23,32,51,.12); }
.sheet-filter-conditions { display: grid; gap: 8px; }
.sheet-filter-condition { display: grid; grid-template-columns: minmax(135px, .9fr) minmax(132px, .85fr) minmax(170px, 1.25fr) 32px; align-items: center; gap: 8px; }
.sheet-filter-condition select, .sheet-filter-condition input { width: 100%; height: 36px; border: 1px solid #d7deeb; border-radius: 8px; padding: 0 10px; color: var(--ink); background: #fff; box-shadow: none; font-size: 12px; }
.sheet-filter-condition select:focus, .sheet-filter-condition input:focus { border-color: var(--primary); outline: 0; box-shadow: 0 0 0 3px rgba(49,87,213,.1); }
.sheet-filter-value.is-hidden { visibility: hidden; pointer-events: none; }
.sheet-filter-remove { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 8px; color: #8893a8; background: transparent; font-size: 18px; line-height: 1; transition: color 140ms ease, background 140ms ease, transform 120ms ease-out; }
.sheet-filter-remove:hover { color: var(--danger); background: var(--danger-soft); }
.sheet-filter-add { margin-top: 10px; border-radius: 8px; padding: 8px 9px; color: var(--primary); background: transparent; font-size: 12px; font-weight: 750; transition: background 140ms ease, transform 120ms ease-out; }
.sheet-filter-add:hover { background: var(--primary-soft); }
.sheet-filter-add:disabled { opacity: .42; cursor: not-allowed; background: transparent; }
.sheet-filter-popover-foot { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.sheet-filter-popover-foot .text-button { color: var(--muted); }
.sheet-filter-popover-foot .text-button:hover { color: var(--danger); }
.sheet-sort-popover { left: 84px; width: min(640px, calc(100vw - 32px)); transform-origin: 112px 0; }
.sheet-sort-priority-hint { color: var(--muted); font-size: 11px; font-weight: 650; }
.sheet-sort-condition { display: grid; grid-template-columns: 28px minmax(150px, .8fr) minmax(250px, 1.2fr) 32px; align-items: center; gap: 8px; border-radius: 10px; padding: 4px; background: #f7f8fb; transition: opacity 140ms ease, transform 170ms cubic-bezier(.23,1,.32,1), box-shadow 140ms ease; }
.sheet-sort-condition.is-dragging { z-index: 2; opacity: .52; transform: scale(.985); box-shadow: 0 8px 20px rgba(23,32,51,.12); }
.sheet-sort-condition.is-drag-target { transform: translateY(2px); }
.sheet-sort-condition select { width: 100%; height: 36px; border: 1px solid #d7deeb; border-radius: 8px; padding: 0 10px; color: var(--ink); background: #fff; box-shadow: none; font-size: 12px; }
.sheet-sort-condition select:focus { border-color: var(--primary); outline: 0; box-shadow: 0 0 0 3px rgba(49,87,213,.1); }
.sheet-sort-drag { display: grid; width: 28px; height: 32px; place-items: center; border-radius: 7px; color: #8d98aa; background: transparent; touch-action: none; }
.sheet-sort-drag:hover { color: var(--primary); background: var(--primary-soft); }
.sheet-sort-drag svg { width: 14px; height: 20px; fill: currentColor; }
.sheet-sort-direction { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; border-radius: 8px; padding: 3px; background: #eef1f6; }
.sheet-sort-direction button { min-height: 30px; border-radius: 6px; padding: 0 10px; color: #707b90; background: transparent; font-size: 11px; font-weight: 750; transition: color 140ms ease, background 140ms ease, box-shadow 140ms ease, transform 120ms ease-out; }
.sheet-sort-direction button[aria-pressed="true"] { color: var(--primary); background: #fff; box-shadow: 0 1px 4px rgba(23,32,51,.12); }
.sheet-sort-direction button:active, .sheet-sort-drag:active { transform: scale(.97); }
[data-filter-schema] { display: none !important; }
.sheet-sync-indicator { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; color: var(--muted); font-weight: 700; white-space: nowrap; }
.sheet-sync-dot { width: 7px; height: 7px; border-radius: 50%; background: #98a2b3; }
.sheet-sync-indicator.is-synced { color: var(--success); }
.sheet-sync-indicator.is-synced .sheet-sync-dot { background: #21ae76; }
.sheet-sync-indicator.is-pending { color: #8a6a12; }
.sheet-sync-indicator.is-pending .sheet-sync-dot { background: #d9a928; }
.sheet-sync-indicator.is-syncing { color: var(--primary); }
.sheet-sync-indicator.is-syncing .sheet-sync-dot { background: var(--primary); }
.sheet-sync-indicator.is-error { color: var(--danger); }
.sheet-sync-indicator.is-error .sheet-sync-dot { background: var(--danger); }
.sheet-relogin-link { color: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.spreadsheet-table th { position: sticky; z-index: 3; top: 0; }
.spreadsheet-table th, .spreadsheet-table td { min-width: 140px; border-right: 1px solid var(--line); }
.spreadsheet-table .row-no { min-width: 54px; width: 54px; text-align: center; }
.spreadsheet-table .channel-col { min-width: 150px; left: 54px; }
.spreadsheet-table .sticky-col { position: sticky; z-index: 2; left: 0; background: #fff; }
.spreadsheet-table th.sticky-col { z-index: 5; background: #f8f9fc; }
.spreadsheet-table tbody tr:hover .sticky-col { background: #fafbfe; }
.actions-col { min-width: 110px !important; }
.spreadsheet-viewport { min-height: 330px; background: #fff; }
.editable-spreadsheet { width: max-content; min-width: 100%; }
.editable-spreadsheet th:not(.row-no) { min-width: 178px; }
.editable-spreadsheet th.master-add-field-header,
.editable-spreadsheet td.master-add-field-cell {
    width: 46px;
    min-width: 46px;
    padding: 0;
    background: #f8f9fc;
}
.master-add-field-header button {
    display: grid;
    width: 100%;
    min-height: 43px;
    place-items: center;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    transition: background 140ms ease, transform 120ms ease-out;
}
.master-add-field-header button:hover { background: #eef1f6; }
.master-add-field-header button:active { transform: scale(.94); }
.master-add-field-header button:focus-visible { outline: 0; box-shadow: inset 0 0 0 2px var(--primary); }
.master-add-field-header img { width: 18px; height: 18px; opacity: .46; transition: opacity 140ms ease; }
.master-add-field-header button:hover img,
.master-add-field-header button:focus-visible img { opacity: .78; }
.editable-spreadsheet tbody tr:hover .master-add-field-cell { background: #f8f9fc; }
.editable-spreadsheet td { height: 52px; padding: 0; background: #fff; }
.editable-spreadsheet td.row-no { padding: 0 10px; background: #fbfcfe; font-variant-numeric: tabular-nums; }
.editable-spreadsheet tbody tr:hover td { background: #fff; }
.editable-spreadsheet tbody tr:hover td.row-no { background: #f7f9fc; }
.editable-spreadsheet .sheet-edit-cell { position: relative; padding: 0; }
.admin-comment-cell.is-sheet-comment-cell-selected { box-shadow: inset 0 0 0 2px rgba(49,87,213,.42); }
.admin-comment-cell.has-comments .sheet-cell-control:not([data-colored-select]) { padding-right: 29px; }
.sheet-cell-comment-marker { position: absolute; z-index: 3; top: 4px; right: 5px; display: grid; min-width: 15px; height: 15px; place-items: center; border: 2px solid #fff; border-radius: 999px; padding: 0 3px; color: #fff; background: #3157d5; box-shadow: 0 1px 4px rgba(36,63,151,.24); font-size: 9px; font-weight: 800; line-height: 1; pointer-events: none; }
.sheet-cell-control { display: block; width: 100%; min-height: 51px; border: 0; border-radius: 0; padding: 12px 13px; background: transparent; box-shadow: none; line-height: 1.45; }
.sheet-cell-control:hover { background: #fafbfe; }
.sheet-cell-control:focus { position: relative; z-index: 1; border: 0; outline: 0; background: #fff; box-shadow: inset 0 0 0 2px var(--primary); }
textarea.sheet-cell-control { height: 51px; min-height: 51px; overflow: hidden; resize: none; }
.editable-spreadsheet tr.has-error td { background: #fff8f9; }
.spreadsheet-draft-row td { background: #f9fbff; }
.spreadsheet-draft-row td.row-no { background: #f1f5ff; }
.spreadsheet-draft-row .sheet-cell-control { background: #f9fbff; }
.spreadsheet-draft-row .sheet-cell-control:focus { background: #fff; }
.spreadsheet-add-row td { height: 34px; border-top: 1px solid var(--line); padding: 0; background: #f4f6f8; }
.spreadsheet-add-row button { display: block; width: 100%; height: 34px; border: 0; padding: 0 14px; color: #8e99aa; text-align: left; background: transparent; cursor: pointer; font-size: 20px; line-height: 1; }
.spreadsheet-add-row button:hover { color: var(--primary); background: #eef2f7; }
.spreadsheet-add-row button:focus-visible { outline: 0; box-shadow: inset 0 0 0 2px var(--primary); }
.personal-entry-sheet .spreadsheet-add-row { display: none; }
.inline-record-form { display: none !important; }
.sheet-multi-select { position: relative; height: 51px; margin: 0; }
.sheet-multi-select summary { display: flex; height: 51px; align-items: center; justify-content: space-between; overflow: hidden; padding: 0 31px 0 13px; color: var(--ink); cursor: pointer; list-style: none; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.sheet-multi-select summary::-webkit-details-marker { display: none; }
.sheet-multi-select summary::after { position: absolute; right: 12px; color: #8490a5; content: "⌄"; font-size: 13px; }
.sheet-multi-select[open] summary { position: relative; z-index: 13; background: #fff; box-shadow: inset 0 0 0 2px var(--primary); }
.sheet-multi-options { position: absolute; z-index: 12; top: calc(100% + 5px); left: 0; display: grid; width: max-content; min-width: 100%; max-height: 220px; overflow: auto; gap: 2px; border: 1px solid #d5dceb; border-radius: 11px; padding: 7px; background: #fff; box-shadow: 0 14px 34px rgba(23,32,51,.18); }
.spreadsheet-draft-row .sheet-multi-options { top: auto; bottom: calc(100% + 5px); }
.sheet-multi-options label { display: flex; min-width: 150px; align-items: center; gap: 8px; border-radius: 7px; padding: 7px 8px; cursor: pointer; font-size: 12px; font-weight: 500; white-space: nowrap; }
.sheet-multi-options label:hover { background: var(--primary-soft); }
.sheet-multi-options input { width: 15px; height: 15px; margin: 0; padding: 0; accent-color: var(--primary); }
.option-value-chip { display: inline-flex; max-width: 150px; align-items: center; overflow: hidden; border-radius: 999px; padding: 3px 8px; color: var(--option-fg, #263247); background: var(--option-bg, #e5e7eb); text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: 1.35; }
.sheet-multi-select summary { gap: 5px; justify-content: flex-start; }
.sheet-multi-select summary .option-value-chip { flex: 0 1 auto; }
.sheet-multi-options label .option-value-chip { pointer-events: none; }
.sheet-cell-control[data-colored-select][data-option-active="true"] { width: calc(100% - 16px); min-height: 33px; margin: 9px 8px; border-radius: 999px; padding: 5px 30px 5px 10px; color: var(--option-fg); background: var(--option-bg); font-weight: 600; }
.sheet-cell-control[data-colored-select][data-option-active="true"]:hover { background: var(--option-bg); filter: brightness(.98); }
.sheet-cell-control[data-colored-select][data-option-active="true"]:focus { color: var(--option-fg); background: var(--option-bg); box-shadow: inset 0 0 0 2px var(--primary); }
.sheet-cell-control option[data-option-color] { color: var(--option-fg); background: var(--option-bg); }
.sheet-row-context-menu { position: fixed; z-index: 120; display: block; width: 181px; overflow: hidden; border: 1px solid #d9dfeb; border-radius: 9px; padding: 5px 0; background: #fff; box-shadow: 0 12px 30px rgba(23,32,51,.16); transform-origin: top left; }
.sheet-row-context-menu[hidden] { display: none; }
.row-context-menu-group[hidden] { display: none; }
.row-context-menu-group + .row-context-menu-group { margin-top: 4px; border-top: 1px solid var(--line); padding-top: 4px; }
.sheet-row-context-menu button { display: flex; width: 100%; min-height: 34px; align-items: center; gap: 9px; border: 0; border-radius: 0; padding: 0 11px; text-align: left; color: var(--ink); background: transparent; cursor: pointer; font-size: 13px; font-weight: 400; }
.sheet-row-context-menu button img { width: 17px; height: 17px; flex: 0 0 auto; opacity: 1; }
.sheet-row-context-menu button:hover, .sheet-row-context-menu button:focus-visible { outline: 0; background: var(--primary-soft); }
.sheet-row-context-menu button:disabled, .sheet-row-context-menu button[aria-disabled="true"] { color: #a5adba; cursor: not-allowed; background: transparent; }
.sheet-row-context-menu button:disabled img, .sheet-row-context-menu button[aria-disabled="true"] img { opacity: .38; }
.row-context-insert-control { display: grid; grid-template-columns: minmax(0, 1fr) 38px 18px; min-height: 36px; align-items: center; padding-right: 9px; }
.row-context-insert-control button { min-width: 0; }
.row-context-insert-control input { width: 38px; height: 27px; border: 1px solid #d5dbe7; border-radius: 6px; padding: 0 4px; text-align: center; background: #fff; box-shadow: none; font-size: 12px; font-variant-numeric: tabular-nums; }
.row-context-insert-control input:focus { border-color: var(--primary); outline: 0; box-shadow: 0 0 0 2px rgba(49,87,213,.1); }
.row-context-insert-control > span { color: #5f6b7c; text-align: right; font-size: 12px; }
.sheet-row-context-menu button.danger { color: var(--ink); }
.sheet-row-context-menu button.danger:hover, .sheet-row-context-menu button.danger:focus-visible { background: var(--danger-soft); }
.record-activity-dialog { width: min(620px, calc(100% - 28px)); max-height: min(760px, calc(100dvh - 36px)); overflow: hidden; border: 1px solid #d9dfeb; border-radius: 16px; padding: 0; color: var(--ink); background: #fff; box-shadow: 0 24px 70px rgba(23,32,51,.24); }
.record-activity-dialog::backdrop { background: rgba(31,42,67,.34); backdrop-filter: blur(2px); }
.record-activity-shell { display: flex; max-height: min(760px, calc(100dvh - 36px)); flex-direction: column; }
.record-activity-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); padding: 20px 22px 16px; }
.record-activity-header h2 { margin: 3px 0 0; font-size: 20px; }
.record-activity-header .eyebrow { margin: 0; font-size: 10px; }
.record-activity-close { border: 0; border-radius: 8px; padding: 8px 10px; color: var(--muted); background: #f3f5f8; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; }
.record-activity-close:hover { color: var(--ink); background: #e9edf3; }
.record-comment-form { display: grid; gap: 10px; border-bottom: 1px solid var(--line); padding: 16px 22px; background: #fafbfe; }
.record-comment-form[hidden] { display: none; }
.record-comment-form textarea { width: 100%; min-height: 82px; resize: vertical; border: 1px solid #d7deeb; border-radius: 10px; padding: 10px 12px; background: #fff; box-shadow: none; line-height: 1.55; }
.record-comment-form textarea:focus { border-color: var(--primary); outline: 0; box-shadow: 0 0 0 3px rgba(49,87,213,.1); }
.record-comment-form > div { display: flex; min-height: 34px; align-items: center; justify-content: space-between; gap: 12px; }
.record-comment-form [data-record-comment-status] { color: var(--muted); font-size: 12px; }
.record-activity-state { padding: 26px 22px; color: var(--muted); text-align: center; font-size: 13px; }
.record-activity-state[hidden] { display: none; }
.record-activity-list { min-height: 120px; overflow: auto; padding: 8px 22px 22px; }
.record-activity-entry { position: relative; display: grid; gap: 7px; margin-top: 12px; border: 1px solid #e0e5ee; border-radius: 11px; padding: 12px 13px; background: #fff; }
.record-activity-entry-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.record-activity-entry-head strong { font-size: 13px; }
.record-activity-entry-head time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.record-activity-action { color: var(--primary); font-size: 11px; font-weight: 750; }
.record-activity-entry p { margin: 0; color: #34415d; line-height: 1.55; white-space: pre-wrap; }
.record-activity-entry details { border-top: 1px dashed #dde3ec; padding-top: 8px; }
.record-activity-entry summary { color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 700; }
.record-activity-snapshot { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.record-activity-snapshot section { min-width: 0; border-radius: 8px; padding: 9px; background: #f6f8fb; }
.record-activity-snapshot strong { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.record-activity-snapshot pre { overflow: auto; margin: 0; color: #34415d; font: inherit; font-size: 11px; line-height: 1.5; white-space: pre-wrap; }
@starting-style { .record-activity-dialog[open] { opacity: 0; transform: translateY(8px) scale(.985); } }
.record-activity-dialog[open] { opacity: 1; transform: translateY(0) scale(1); transition: opacity 160ms ease-out, transform 180ms cubic-bezier(.23,1,.32,1); }
.sheet-comment-panel { position: fixed; z-index: 70; top: 76px; right: 14px; bottom: 14px; display: flex; width: min(360px, calc(100vw - 28px)); overflow: hidden; flex-direction: column; border: 1px solid #d9dfeb; border-radius: 14px; background: #fff; box-shadow: 0 20px 56px rgba(23,32,51,.2); }
.sheet-comment-panel[hidden] { display: none; }
.sheet-comment-panel-header { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 13px 15px; }
.sheet-comment-panel-header h2 { margin: 0 0 4px; font-size: 18px; }
.sheet-comment-panel-header span { color: var(--muted); font-size: 11px; }
.sheet-comment-close { width: 32px; height: 32px; border-radius: 8px; }
.sheet-comment-close:hover { color: var(--ink); background: #f1f3f7; }
.sheet-comment-target-card { display: grid; gap: 9px; margin: 12px 14px 2px; border: 1px solid #d9e2f5; border-radius: 11px; padding: 11px 12px; background: #f6f8ff; }
.sheet-comment-target-card[hidden] { display: none; }
.sheet-comment-target-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sheet-comment-target-heading > span { color: #3157d5; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.sheet-comment-target-heading code { overflow: hidden; color: #7a8498; font-family: inherit; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.sheet-comment-target-card > strong { overflow: hidden; color: #1e2a44; font-size: 12px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.sheet-comment-target-detail { display: grid; grid-template-columns: 62px minmax(0, 1fr); align-items: start; gap: 8px; border-top: 1px solid #e4e9f5; padding-top: 8px; }
.sheet-comment-target-detail > span { color: #8a94a7; font-size: 10px; }
.sheet-comment-target-detail > b { overflow: hidden; color: #34415d; font-size: 11px; font-weight: 650; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.sheet-comment-state { padding: 24px 18px; color: var(--muted); text-align: center; font-size: 12px; }
.sheet-comment-state[hidden] { display: none; }
.sheet-comment-list { min-height: 0; overflow: auto; flex: 1; padding: 10px 14px; }
.sheet-comment-entry { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 9px; border-bottom: 1px solid #edf0f5; padding: 12px 0; }
.sheet-comment-avatar { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; color: #fff; background: #647bd9; font-size: 12px; font-weight: 800; }
.sheet-comment-entry-body { min-width: 0; }
.sheet-comment-entry-head { display: flex; align-items: baseline; justify-content: space-between; gap: 9px; }
.sheet-comment-entry-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.sheet-comment-entry-head time { color: #9aa3b2; font-size: 10px; white-space: nowrap; }
.sheet-comment-entry-actions { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.sheet-comment-delete { border: 0; padding: 2px 0; color: #d5484d; background: transparent; cursor: pointer; font-size: 10px; }
.sheet-comment-delete:hover { color: #b72f35; text-decoration: underline; }
.sheet-comment-delete:disabled { opacity: .45; cursor: wait; }
.sheet-comment-entry p { margin: 5px 0 0; color: #34415d; font-size: 13px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.sheet-comment-compose { display: grid; gap: 7px; border-top: 1px solid var(--line); padding: 12px 14px; background: #fbfcfe; }
.sheet-comment-compose textarea { width: 100%; min-height: 66px; resize: vertical; border: 1px solid #cad4e8; border-radius: 9px; padding: 9px 10px; background: #fff; box-shadow: none; font-size: 13px; line-height: 1.5; }
.sheet-comment-compose textarea:focus { border-color: var(--primary); outline: 0; box-shadow: 0 0 0 3px rgba(49,87,213,.1); }
.sheet-comment-compose > div { display: flex; min-height: 32px; align-items: center; justify-content: space-between; gap: 9px; }
.sheet-comment-compose [data-sheet-comment-status] { color: var(--muted); font-size: 11px; }
.sheet-comment-compose:has(textarea:disabled) { opacity: .62; }
.channel-topbar .topbar-inner { width: calc(100% - clamp(24px, 3vw, 64px)); max-width: none; }
.channel-sheet-page {
    display: flex;
    width: calc(100% - clamp(24px, 3vw, 64px));
    max-width: none;
    min-height: calc(100vh - 68px);
    min-height: calc(100dvh - 68px);
    flex-direction: column;
    padding: clamp(24px, 2.4vw, 42px) 0 clamp(18px, 2vw, 32px);
}
.channel-sheet-page .sheet-heading { margin-bottom: clamp(12px, 1.2vw, 20px); }
.channel-sheet-page .sheet-heading h1 { margin-bottom: 0; font-size: clamp(27px, 2.2vw, 38px); }
.sheet-title-with-description { display: flex; min-width: 0; align-items: center; flex-wrap: wrap; gap: 12px 16px; }
.sheet-description-trigger { min-height: 40px; border-radius: 11px; padding: 9px 16px; box-shadow: 0 8px 20px rgba(49,87,213,.2); white-space: nowrap; }
.sheet-description-dialog { width: min(720px, calc(100vw - 32px)); max-width: none; max-height: min(82vh, 760px); overflow: hidden; border: 0; border-radius: 20px; padding: 0; color: var(--ink); background: transparent; box-shadow: 0 26px 70px rgba(16,27,51,.24); }
.sheet-description-dialog::backdrop { background: rgba(17,27,48,.42); backdrop-filter: blur(3px); }
.sheet-description-dialog-shell { display: flex; max-height: min(82vh, 760px); flex-direction: column; background: #fff; }
.sheet-description-dialog header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); padding: 22px 24px 18px; background: linear-gradient(180deg, #f7f9ff, #fff); }
.sheet-description-dialog header h2 { margin: 2px 0 3px; font-size: 24px; }
.sheet-description-dialog header > div > p:last-child { margin: 0; color: var(--muted); font-size: 13px; }
.sheet-description-dialog header > button { display: grid; width: 36px; height: 36px; place-items: center; flex: 0 0 auto; border: 0; border-radius: 10px; color: #667085; background: #eef1f6; font-size: 24px; line-height: 1; cursor: pointer; }
.sheet-description-dialog header > button:hover { color: var(--ink); background: #e3e8f1; }
.sheet-description-content { overflow-y: auto; padding: 24px; color: #344054; white-space: pre-wrap; font-size: 15px; line-height: 1.8; }
.channel-sheet-page .inline-spreadsheet { display: flex; min-height: 0; flex: 1; flex-direction: column; }
.channel-sheet-page .spreadsheet-viewport { max-height: none; min-height: 340px; flex: 1; }
.channel-sheet-page .table-summary { flex: 0 0 auto; gap: 18px; }
.sheet-mobile-action-trigger,
.sheet-mobile-tools-toggle,
.mobile-row-edit-button,
.mobile-add-student { display: none; }
.mobile-row-editor[hidden] { display: none; }
.admin-master-body .topbar-inner { width: calc(100% - clamp(24px, 3vw, 64px)); max-width: none; }
.admin-master-page {
    display: flex;
    width: calc(100% - clamp(24px, 3vw, 64px));
    max-width: none;
    min-height: calc(100vh - 68px);
    min-height: calc(100dvh - 68px);
    flex-direction: column;
    padding: clamp(24px, 2.4vw, 42px) 0 clamp(18px, 2vw, 32px);
}
.admin-master-page .sheet-heading { margin-bottom: clamp(12px, 1.2vw, 20px); }
.admin-master-page .sheet-heading h1 { margin-bottom: 0; font-size: clamp(27px, 2.2vw, 38px); }
.admin-master-page .back-link { margin-bottom: 12px; }
.admin-master-page .admin-master-sheet,
.admin-master-page .master-table-fragment { display: flex; min-height: 0; flex: 1; flex-direction: column; }
.master-table-loading { display: flex; min-height: 340px; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 13px; font-weight: 700; }
.master-table-loading-spinner { width: 18px; height: 18px; border: 2px solid #dbe2f2; border-top-color: var(--primary); border-radius: 50%; animation: master-table-loading-spin .7s linear infinite; }
@keyframes master-table-loading-spin { to { transform: rotate(360deg); } }
.admin-master-page .master-table-fragment > .table-summary { flex: 0 0 auto; gap: 18px; }
.admin-master-page .master-table-fragment > .table-wrap.tall { max-height: none; min-height: 340px; flex: 1; }
.admin-master-page .spreadsheet-table { width: max-content; min-width: 100%; }
.master-schema-save-state { cursor: default; }
.master-field-header { padding: 0 !important; cursor: grab; transition: opacity 140ms ease, box-shadow 160ms ease, background-color 160ms ease; }
.master-field-header:active { cursor: grabbing; }
.master-field-header-button { display: flex; width: 100%; min-height: 43px; align-items: center; gap: 7px; border: 0; padding: 9px 10px; color: #465269; text-align: left; background: transparent; cursor: grab; touch-action: none; user-select: none; }
.master-field-header-button:active { cursor: grabbing; }
.master-field-header-button img { -webkit-user-drag: none; }
.master-field-header-button:hover, .master-field-header-button:focus-visible { color: var(--primary); outline: 0; background: #eef2ff; }
.master-field-type-icon { display: grid; width: 17px; height: 17px; place-items: center; flex: 0 0 auto; opacity: .66; }
.master-field-type-icon img { width: 16px; height: 16px; }
.master-field-title { min-width: 0; overflow: hidden; flex: 1; text-overflow: ellipsis; white-space: nowrap; }
.master-field-chevron { width: 14px; height: 14px; flex: 0 0 auto; opacity: .42; transition: opacity 140ms ease, transform 160ms ease; }
.master-field-header-button:hover .master-field-chevron, .master-field-header-button:focus-visible .master-field-chevron { opacity: .8; transform: translateY(1px); }
.master-field-header.is-field-dragging { opacity: .42; }
.master-field-header.is-field-dropping { animation: field-header-drop 220ms cubic-bezier(.2,.8,.2,1); }
.master-field-header.is-field-drop-before { box-shadow: inset 3px 0 0 var(--primary); }
.master-field-header.is-field-drop-after { box-shadow: inset -3px 0 0 var(--primary); }
@keyframes field-header-drop { 0% { transform: scale(.97); } 65% { transform: scale(1.015); } 100% { transform: scale(1); } }
.admin-master-add-row td { height: auto; }
.admin-master-add-row .admin-add-record-trigger { height: 34px; }
.admin-master-draft-row td { background: #f9fbff; }
.admin-master-draft-row td.row-no { background: #f1f5ff; }
.admin-master-draft-row .channel-col { padding: 0; }
.admin-master-draft-row .channel-col .sheet-cell-control { min-width: 150px; color: #38445a; font-weight: 650; }
.master-field-config-root, .master-field-builder { margin: 0; padding: 0; }
.master-field-editor.is-quick-add {
    position: fixed;
    z-index: 180;
    width: min(366px, calc(100vw - 24px));
    max-height: min(620px, calc(100vh - 24px));
    margin: 0;
    border: 1px solid #d8dee9;
    border-radius: 11px;
    box-shadow: 0 14px 38px rgba(23, 32, 51, .18);
}
.master-field-editor.is-quick-add .field-editor-shell { max-height: min(620px, calc(100vh - 24px)); }
.master-field-editor.is-quick-add .field-editor-header { display: none; }
.master-field-editor.is-quick-add .field-editor-body { gap: 14px; padding: 14px; }
.master-field-editor.is-quick-add .field-editor-body > label { gap: 7px; }
.master-field-editor.is-quick-add .field-editor-body > label > span,
.master-field-editor.is-quick-add .field-editor-label { color: #596477; font-size: 12px; font-weight: 600; }
.master-field-editor.is-quick-add input[type="text"] { min-height: 36px; padding: 8px 10px; }
.master-field-editor.is-quick-add .field-type-trigger { min-height: 40px; border-radius: 8px; padding: 8px 10px; }
.master-field-editor.is-quick-add .field-type-trigger span { font-size: 13px; font-weight: 600; }
.master-field-editor.is-quick-add .field-type-picker {
    position: fixed;
    z-index: 181;
    width: 224px;
    max-height: calc(100vh - 24px);
    overflow: auto;
    margin: 0;
    border-radius: 9px;
    padding: 7px;
    box-shadow: 0 12px 30px rgba(23, 32, 51, .16);
}
.master-field-editor.is-quick-add .field-type-search { display: none; }
.master-field-editor.is-quick-add .field-type-list { grid-template-columns: 1fr; max-height: none; gap: 2px; }
.master-field-editor.is-quick-add .field-type-choice { grid-template-columns: 18px minmax(0, 1fr); align-items: center; border-radius: 7px; padding: 8px 9px; font-size: 13px; }
.master-field-editor .field-type-choice-icon { display: grid; width: 18px; height: 18px; place-items: center; opacity: .7; }
.master-field-editor .field-type-choice-icon img { width: 16px; height: 16px; }
.master-field-editor.is-quick-add .field-option-editor { max-height: 300px; overflow: auto; gap: 8px; padding-top: 12px; }
.master-field-editor.is-quick-add .option-editor-list { gap: 5px; }
.master-field-editor.is-quick-add .option-editor-row { gap: 5px; padding: 4px; }
.master-field-editor.is-quick-add .field-editor-footer { align-items: center; flex-direction: row; padding: 11px 14px; }
.master-field-editor.is-quick-add .master-field-confirm-actions { width: auto; margin-left: auto; }
.master-field-editor.is-quick-add .master-field-confirm-actions .button { min-height: 34px; padding: 6px 15px; }
.master-field-editor-footer { align-items: center; justify-content: space-between; }
.master-field-order-actions, .master-field-confirm-actions { display: flex; align-items: center; gap: 8px; }
.master-field-order-actions[hidden] { display: none; }
.master-field-order-actions .button, .master-field-confirm-actions .button { min-height: 38px; padding: 7px 12px; }
.row-action-buttons { display: flex; gap: 12px; }
.row-action-buttons form { display: inline; }
.channel-row-actions { display: inline-flex; min-width: max-content; align-items: center; flex-wrap: nowrap; gap: 6px; white-space: nowrap; }
.channel-row-actions form { display: inline-flex; margin: 0; }
.channel-row-action { display: inline-flex; min-width: 48px; height: 32px; align-items: center; justify-content: center; border: 1px solid #d7deea; border-radius: 8px; padding: 0 10px; color: #46536b; background: #fff; font-size: 12px; font-weight: 750; line-height: 1; white-space: nowrap; cursor: pointer; transition: border-color .15s ease, color .15s ease, background .15s ease, box-shadow .15s ease; }
.channel-row-action:hover { border-color: #b9c6ec; color: var(--primary); background: #f4f6ff; box-shadow: 0 4px 12px rgba(49,87,213,.09); }
.channel-row-action.is-danger { color: #aa3446; }
.channel-row-action.is-danger:hover { border-color: #efbcc5; color: #a72b3e; background: #fff3f5; box-shadow: 0 4px 12px rgba(183,47,67,.08); }
.channel-row-action.is-success { color: #08724a; }
.channel-row-action.is-success:hover { border-color: #b9e2d1; color: #08724a; background: #effaf4; box-shadow: 0 4px 12px rgba(15,132,88,.08); }
.add-channel-panel { margin-top: 18px; }
.add-channel-form { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(320px, 1fr) auto; align-items: end; gap: 14px; }
.add-channel-form label { margin: 0; }
.add-channel-submit { min-width: 132px; min-height: 44px; }
.live-label { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 8px; color: var(--success); font-size: 12px; font-weight: 750; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #22ad77; box-shadow: 0 0 0 5px #e3f7ef; animation: pulse 1.8s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 2px #e3f7ef; } }

.timeline { position: relative; display: grid; gap: 0; }
.timeline::before { position: absolute; top: 10px; bottom: 10px; left: 9px; width: 2px; content: ""; background: var(--line); }
.timeline-item { position: relative; display: grid; grid-template-columns: 20px 1fr; gap: 15px; padding-bottom: 18px; }
.timeline-marker { z-index: 1; width: 20px; height: 20px; border: 5px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); background: var(--primary); }
.timeline-marker.channel { background: #1c9b6b; }
.timeline-card { border: 1px solid var(--line); border-radius: 13px; padding: 15px; background: #fff; }
.timeline-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.timeline-top > div { display: flex; align-items: center; gap: 8px; }
.timeline-top time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.action-badge { border-radius: 6px; padding: 3px 7px; color: var(--primary); background: var(--primary-soft); font-size: 11px; font-weight: 750; }
.actor-meta { color: var(--muted); font-size: 12px; }
.timeline-card > p { margin: 10px 0 7px; color: var(--ink); }
.log-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
details { margin-top: 10px; }
summary { color: var(--primary); cursor: pointer; font-weight: 650; }
.snapshot-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 9px; }
.snapshot-grid span { color: var(--muted); font-size: 11px; }
.snapshot-grid pre { max-height: 180px; overflow: auto; border-radius: 8px; padding: 10px; color: #344264; background: #f6f8fb; font-size: 11px; white-space: pre-wrap; }

.auth-page, .channel-auth-page { min-height: 100vh; background: radial-gradient(circle at 10% 20%, #e8edff, transparent 38%), #f5f7fb; }
.auth-page { display: flex; flex-direction: column; }
.auth-shell, .channel-auth-shell { display: grid; grid-template-columns: 1.1fr .9fr; width: min(1040px, calc(100% - 40px)); min-height: 100vh; align-items: center; gap: 72px; margin: 0 auto; padding: 50px 0; }
.auth-page .auth-shell { min-height: 0; flex: 1; }
.auth-intro h1 { max-width: 650px; font-size: clamp(36px, 4.5vw, 54px); }
.auth-intro > p:last-child { max-width: 590px; font-size: 17px; }
.auth-intro .brand-mark { margin-bottom: 28px; }
.auth-card, .channel-login-card { border: 1px solid rgba(255,255,255,.9); border-radius: 24px; padding: 34px; background: rgba(255,255,255,.9); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.auth-card > div:first-child, .channel-login-card > div:first-child { margin-bottom: 24px; }
.channel-auth-shell { width: min(1120px, calc(100% - 40px)); }
.channel-brand-panel { display: flex; min-height: 430px; flex-direction: column; justify-content: flex-start; gap: clamp(74px, 9vw, 130px); border-radius: 28px; padding: 35px; color: #fff; background: linear-gradient(145deg, #1c3279 0%, #3157d5 55%, #5875e5 100%); box-shadow: 0 24px 70px rgba(36, 69, 177, .25); }
.channel-brand-panel p, .channel-brand-panel .brand small { color: rgba(255,255,255,.73); }
.channel-brand-panel .brand-mark { color: var(--primary); background: #fff; box-shadow: none; }
.channel-brand-panel h1 { max-width: 620px; }
.channel-form-title { display: grid; justify-items: start; gap: 12px; }
.channel-form-title h1 { margin: 0; }
.remember-username { display: flex; width: fit-content; align-items: center; gap: 8px; color: #58657b; font-size: 13px; cursor: pointer; user-select: none; }
.remember-username input { width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--primary); }
.login-help { margin: 18px 0 0; text-align: center; font-size: 12px; }
.site-icp-footer { width: 100%; padding: 20px 20px 26px; color: #7a8497; text-align: center; font-size: 12px; }
.site-icp-footer a { border-bottom: 1px solid transparent; transition: border-color 150ms ease, color 150ms ease; }
.site-icp-footer a:hover { border-bottom-color: currentColor; color: var(--primary); }
.site-icp-footer a:focus-visible { border-radius: 4px; outline: 3px solid rgba(49, 87, 213, .2); outline-offset: 3px; }
.channel-auth-page.form-disabled { background: radial-gradient(circle at 10% 20%, #eceff5, transparent 38%), #f5f6f8; }
.channel-auth-page.form-disabled .channel-brand-panel {
    background: linear-gradient(145deg, #25324c 0%, #3c4c70 58%, #63708c 100%);
    box-shadow: 0 24px 70px rgba(37, 50, 76, .2);
}
.channel-login-card.is-disabled {
    display: grid;
    min-height: 330px;
    place-items: center;
    border-color: #f0d4d8;
}
.channel-disabled-state { width: min(100%, 370px); padding: 18px 8px; text-align: center; }
.channel-disabled-state .eyebrow { margin: 20px 0 7px; color: var(--danger); }
.channel-disabled-state h2 { margin-bottom: 9px; font-size: 26px; }
.channel-disabled-state > p:last-child { margin: 0; color: #596579; font-size: 15px; }
.channel-disabled-icon {
    display: inline-grid;
    width: 62px;
    height: 62px;
    place-items: center;
    border-radius: 20px;
    color: var(--danger);
    background: var(--danger-soft);
    box-shadow: inset 0 0 0 1px #f4cbd1;
}
.channel-disabled-icon svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.channel-identity { display: flex; align-items: center; gap: 16px; }
.channel-identity > span { display: grid; text-align: right; line-height: 1.25; }
.channel-identity small { color: var(--muted); }
.presence-color-0 { --presence-color: #3157d5; --presence-soft: #edf1ff; }
.presence-color-1 { --presence-color: #0e8a73; --presence-soft: #e5f7f2; }
.presence-color-2 { --presence-color: #b35b12; --presence-soft: #fff1df; }
.presence-color-3 { --presence-color: #9b3ab1; --presence-soft: #f8eafb; }
.presence-color-4 { --presence-color: #d1426b; --presence-soft: #ffebf1; }
.presence-color-5 { --presence-color: #1670b8; --presence-soft: #e7f4ff; }
.presence-color-6 { --presence-color: #657317; --presence-soft: #f1f5d9; }
.presence-color-7 { --presence-color: #7654c8; --presence-soft: #f0ecff; }
.collaboration-trigger {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    align-self: flex-end;
    gap: 9px;
    border: 1px solid #d6ddeb;
    border-radius: 12px;
    padding: 7px 12px;
    color: #34415d;
    background: #fff;
    box-shadow: 0 6px 18px rgba(23,32,51,.06);
    cursor: pointer;
    font-weight: 750;
    transition: transform 150ms cubic-bezier(.23,1,.32,1), border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}
.collaboration-trigger strong { display: grid; min-width: 22px; height: 22px; place-items: center; border-radius: 999px; padding: 0 6px; color: var(--primary); background: var(--primary-soft); font-size: 11px; }
.collaboration-trigger:active { transform: scale(.97); }
.collaboration-trigger:focus-visible { outline: 3px solid rgba(49,87,213,.18); outline-offset: 2px; }
.collaboration-avatar-stack { display: flex; padding-left: 5px; }
.collaboration-avatar {
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    overflow: hidden;
    border: 2px solid #fff;
    border-radius: 50%;
    margin-left: -6px;
    color: var(--presence-color);
    background: var(--presence-soft);
    font-size: 10px;
    font-weight: 850;
}
.collaboration-panel[hidden] { display: none; }
.collaboration-panel {
    position: fixed;
    z-index: 90;
    top: 68px;
    right: 0;
    bottom: 0;
    width: min(380px, 100vw);
    overflow-y: auto;
    border-left: 1px solid var(--line);
    padding: 24px;
    background: #fff;
    box-shadow: -20px 0 60px rgba(23,32,51,.16);
    transform: translateX(0);
    opacity: 1;
    transition: transform 220ms cubic-bezier(.23,1,.32,1), opacity 160ms ease-out;
}
@starting-style {
    .collaboration-panel:not([hidden]) { transform: translateX(18px); opacity: 0; }
}
.collaboration-panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.collaboration-panel-header .eyebrow { margin-bottom: 5px; }
.collaboration-panel-header h2 { margin: 0; font-size: 21px; }
.collaboration-close { border: 0; border-radius: 9px; padding: 7px 9px; color: var(--muted); background: #f2f4f8; cursor: pointer; font-size: 12px; font-weight: 700; }
.collaboration-close:hover { color: var(--primary); background: var(--primary-soft); }
.collaboration-close:focus-visible { outline: 3px solid rgba(49,87,213,.16); outline-offset: 2px; }
.collaboration-member-list { display: grid; gap: 4px; padding-top: 14px; }
.collaboration-member { display: grid; grid-template-columns: 38px minmax(0,1fr) 10px; align-items: center; gap: 11px; border-radius: 12px; padding: 10px 9px; }
.collaboration-member:hover { background: #f7f8fb; }
.collaboration-member-avatar { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; color: var(--presence-color); background: var(--presence-soft); font-size: 13px; font-weight: 850; }
.collaboration-member-identity { display: grid; min-width: 0; gap: 2px; }
.collaboration-member-identity strong, .collaboration-member-identity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.collaboration-member-identity strong { color: var(--ink); font-size: 13px; }
.collaboration-member-identity small { color: var(--muted); font-size: 11px; }
.collaboration-online-dot { width: 8px; height: 8px; border: 2px solid #dff6eb; border-radius: 50%; background: #20ad76; box-shadow: 0 0 0 2px #fff; }
.sheet-edit-cell.has-remote-presence { --remote-presence-color: var(--presence-color); }
.sheet-edit-cell.has-remote-presence .sheet-cell-control:not(:focus),
.sheet-edit-cell.has-remote-presence .sheet-multi-select > summary { box-shadow: inset 0 0 0 2px var(--remote-presence-color); }
.remote-presence-label {
    position: absolute;
    z-index: 8;
    top: -20px;
    left: -1px;
    max-width: calc(100% + 2px);
    overflow: hidden;
    border-radius: 5px 5px 5px 0;
    padding: 2px 6px;
    color: #fff;
    background: var(--remote-presence-color);
    box-shadow: 0 3px 9px rgba(23,32,51,.16);
    font-size: 10px;
    font-weight: 750;
    line-height: 16px;
    pointer-events: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (hover: hover) and (pointer: fine) {
    .collaboration-trigger:hover { border-color: #bcc8e9; background: #fbfcff; box-shadow: 0 9px 24px rgba(49,87,213,.12); transform: translateY(-1px); }
}
.schema-sync-notice { position: fixed; z-index: 80; top: 82px; left: 50%; transform: translateX(-50%); border: 1px solid #c9d5f8; border-radius: 12px; padding: 10px 15px; color: #2847a8; background: #f4f6ff; box-shadow: 0 12px 30px rgba(23,32,51,.14); font-size: 12px; font-weight: 700; }
.schema-sync-notice[hidden] { display: none; }
.record-dialog { width: min(720px, calc(100% - 28px)); max-height: calc(100vh - 36px); border: 0; border-radius: 20px; padding: 0; box-shadow: 0 32px 100px rgba(19,28,48,.3); }
.record-dialog::backdrop { background: rgba(20, 28, 45, .48); backdrop-filter: blur(3px); }
.record-form { display: flex; max-height: calc(100vh - 36px); flex-direction: column; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 22px 24px; }
.dialog-header p { margin-bottom: 0; }
.dialog-close { display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 9px; color: var(--muted); background: #f1f3f7; cursor: pointer; font-size: 23px; }
.dialog-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; overflow: auto; padding: 22px 24px; }
.dialog-fields label:has(textarea), .dialog-fields label:has(select[multiple]) { grid-column: span 2; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); padding: 15px 24px; }

.empty-state { display: grid; min-height: 330px; place-items: center; align-content: center; border: 1px dashed #cbd3e2; border-radius: var(--radius); padding: 35px; text-align: center; background: rgba(255,255,255,.65); }
.empty-state p { max-width: 480px; }
.empty-state.embedded { min-height: 240px; border: 0; }
.empty-icon { display: grid; width: 50px; height: 50px; place-items: center; border-radius: 15px; margin-bottom: 15px; color: var(--primary); background: var(--primary-soft); font-size: 28px; }
.error-card { position: absolute; top: 50%; left: 50%; width: min(460px, calc(100% - 36px)); transform: translate(-50%,-50%); border-radius: 22px; padding: 40px; text-align: center; background: #fff; box-shadow: var(--shadow); }
.error-code { display: block; color: var(--primary); font-size: 54px; font-weight: 900; }

@media (max-width: 980px) {
    .account-admin-layout { grid-template-columns: 1fr; }
    .account-create-panel { position: static; }
    .card-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .form-management-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detail-layout { grid-template-columns: 1fr; }
    .sticky-panel { position: static; }
    .form-detail-page .add-channel-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-detail-page .add-channel-submit { grid-column: 1 / -1; width: 100%; }
    .auth-shell, .channel-auth-shell { grid-template-columns: 1fr; gap: 28px; padding: 30px 0; }
    .auth-intro { display: none; }
    .channel-brand-panel { min-height: 270px; gap: 58px; }
    .independent-entry-list-head { display: none; }
    .independent-entry-item { grid-template-columns: minmax(260px, 1fr) minmax(300px, 1.2fr); }
    .independent-entry-status { grid-column: 1; }
    .independent-entry-actions { grid-column: 2; grid-row: 2; }
}

@media (max-width: 820px) {
    .topnav a, .nav-identity { display: none; }
    .channel-row-action { min-width: 52px; height: 44px; }
    .channel-mode-config { min-height: 44px; align-items: center; }
}

@media (max-width: 680px) {
    .page-shell, .wide-page, .narrow-page { width: min(100% - 24px, 1240px); padding-top: 26px; }
    .form-detail-page .add-channel-form { grid-template-columns: 1fr; }
    .add-channel-submit { width: 100%; }
    .topbar-inner { width: calc(100% - 24px); }
    .channel-topbar .topbar-inner { width: calc(100% - 16px); min-height: 60px; gap: 10px; }
    .channel-sheet-page {
        width: calc(100% - 16px);
        min-height: calc(100vh - 60px);
        min-height: calc(100dvh - 60px);
        padding: 18px 0 10px;
    }
    .channel-sheet-page .sheet-heading { margin-bottom: 12px; }
    .channel-sheet-page .sheet-heading h1 { font-size: clamp(22px, 6.2vw, 26px); overflow-wrap: anywhere; }
    .sheet-title-with-description { align-items: flex-start; flex-direction: column; gap: 10px; }
    .sheet-description-trigger { min-height: 38px; padding: 8px 14px; }
    .sheet-description-dialog { width: calc(100vw - 20px); max-height: 88vh; border-radius: 16px; }
    .sheet-description-dialog-shell { max-height: 88vh; }
    .sheet-description-dialog header { padding: 18px 18px 15px; }
    .sheet-description-content { padding: 18px; font-size: 14px; }
    .channel-sheet-page .collaboration-trigger { align-self: flex-start; }
    .collaboration-panel { top: 60px; width: min(360px, 100vw); padding: 20px; }
    .sheet-filter-toolbar { min-height: 42px; }
    .sheet-view-strip { overflow: visible; flex-wrap: wrap; }
    .sheet-view-changes { order: 3; width: 100%; gap: 16px; }
    .sheet-view-changes button { min-height: 34px; }
    .sheet-view-changes [data-view-changes-label] { flex: 1; }
    .sheet-view-trigger, .sheet-view-fields-trigger { height: 44px; }
    .sheet-view-save-state { display: none; }
    .sheet-view-popover { width: min(310px, calc(100vw - 28px)); }
    .sheet-view-fields-popover { right: auto; left: -70px; width: min(260px, calc(100vw - 28px)); }
    .sheet-filter-toolbar { flex-wrap: wrap; }
    .sheet-filter-trigger { height: 44px; }
    .sheet-filter-result { order: 4; overflow: hidden; max-width: 42%; margin-left: 0; text-overflow: ellipsis; white-space: nowrap; }
    .sheet-edit-tools { height: 44px; margin-left: auto; }
    .sheet-icon-button { width: 44px; height: 44px; }
    .sheet-search-panel { right: 0; }
    .sheet-filter-popover { max-height: min(72vh, 560px); overflow-y: auto; padding: 12px; }
    .sheet-filter-popover-head { align-items: flex-start; flex-direction: column; }
    .sheet-filter-condition { grid-template-columns: minmax(0, 1fr) 32px; }
    .sheet-filter-condition > :not(.sheet-filter-remove) { grid-column: 1; }
    .sheet-filter-condition .sheet-filter-remove { grid-column: 2; grid-row: 1; }
    .sheet-sort-popover { left: 0; }
    .sheet-sort-condition { grid-template-columns: 28px minmax(0, 1fr) 32px; }
    .sheet-sort-condition > select, .sheet-sort-condition > .sheet-sort-direction { grid-column: 2; }
    .sheet-sort-condition > .sheet-sort-drag { grid-column: 1; grid-row: 1; }
    .sheet-sort-condition > .sheet-filter-remove { grid-column: 3; grid-row: 1; }
    .channel-sheet-page .inline-spreadsheet { border-radius: 12px; }
    .channel-sheet-page .table-summary { justify-content: flex-start; overflow-x: auto; gap: 12px; padding: 11px 12px; }
    .channel-sheet-page .table-summary > span:last-child { margin-left: auto; }
    .channel-sheet-page .sheet-sync-indicator { margin-left: 0; }
    .channel-sheet-page .table-wrap.tall.spreadsheet-viewport { max-height: none; min-height: 360px; }

    /* 渠道手机端：压缩低频工具，记录和字段统一为纵向卡片。 */
    .sheet-body { overscroll-behavior-y: contain; }
    .channel-topbar { padding-top: env(safe-area-inset-top, 0px); }
    .channel-sheet-page { padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px)); }
    .sheet-mobile-action-trigger { display: inline-flex; }
    .sheet-body:not(.personal-entry-sheet) .channel-sheet-page .heading-actions { display: none; }
    .sheet-body:not(.personal-entry-sheet) .channel-sheet-page.is-mobile-actions-open .heading-actions {
        display: flex;
        align-items: stretch;
        border: 1px solid var(--line);
        border-radius: 12px;
        padding: 10px;
        background: #fff;
        box-shadow: 0 8px 24px rgba(23,32,51,.08);
    }
    .channel-sheet-page .heading-actions .sheet-transfer-actions {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .channel-sheet-page .heading-actions .collaboration-trigger {
        width: 100%;
        justify-content: center;
        align-self: stretch;
    }
    .channel-sheet-page .sheet-filter-toolbar {
        flex-wrap: nowrap;
        overflow: visible;
        gap: 6px;
    }
    .channel-sheet-page .sheet-mobile-tools-toggle { display: inline-flex; }
    .channel-sheet-page .sheet-view-strip { display: none; border-bottom: 1px solid var(--line); border-radius: 12px; margin-bottom: 6px; }
    .channel-sheet-page .sheet-filter-host.is-mobile-expanded .sheet-view-strip { display: flex; }
    .channel-sheet-page .sheet-filter-host.has-view-changes .sheet-view-strip { display: flex; }
    .channel-sheet-page .sheet-edit-tools [data-sheet-undo],
    .channel-sheet-page .sheet-edit-tools [data-sheet-redo],
    .channel-sheet-page .sheet-edit-tools .sheet-tool-divider { display: none; }
    .channel-sheet-page .sheet-filter-host.is-mobile-expanded .sheet-edit-tools [data-sheet-undo],
    .channel-sheet-page .sheet-filter-host.is-mobile-expanded .sheet-edit-tools [data-sheet-redo] { display: grid; }
    .channel-sheet-page .sheet-filter-host.is-mobile-expanded .sheet-edit-tools .sheet-tool-divider { display: block; }
    .channel-sheet-page .sheet-filter-result { display: none; }
    .channel-sheet-page .sheet-edit-tools { margin-left: auto; padding-left: 3px; }
    .sheet-body:not(.personal-entry-sheet) .channel-sheet-page .spreadsheet-viewport {
        min-height: 0 !important;
        overflow: visible;
        background: transparent;
    }
    .sheet-body:not(.personal-entry-sheet) .channel-sheet-page .editable-spreadsheet,
    .sheet-body:not(.personal-entry-sheet) .channel-sheet-page .editable-spreadsheet tbody {
        display: block;
        width: 100%;
        min-width: 0;
    }
    .sheet-body:not(.personal-entry-sheet) .channel-sheet-page .editable-spreadsheet thead { display: none; }
    .sheet-body:not(.personal-entry-sheet) .channel-sheet-page .editable-spreadsheet tbody {
        display: grid;
        gap: 20px;
    }
    .sheet-body:not(.personal-entry-sheet) .channel-sheet-page .editable-spreadsheet tr[data-spreadsheet-row] {
        display: grid;
        width: 100%;
        gap: 0;
        border: 1px solid #cfd8e8;
        border-top: 4px solid var(--primary);
        border-radius: 16px;
        padding: 0;
        background: #fff;
        box-shadow: 0 12px 30px rgba(23,32,51,.09);
    }
    .sheet-body:not(.personal-entry-sheet) .channel-sheet-page .editable-spreadsheet tr[hidden] { display: none; }
    .sheet-body:not(.personal-entry-sheet) .channel-sheet-page .editable-spreadsheet tr > td.row-no {
        position: static;
        display: flex;
        width: 100%;
        min-width: 0;
        height: auto;
        min-height: 44px;
        align-items: center;
        border: 0;
        border-bottom: 1px solid #dce3ef;
        border-radius: 12px 12px 0 0;
        padding: 11px 14px;
        color: #273551;
        background: #f1f5ff;
        font-size: 13px;
        font-weight: 800;
    }
    .sheet-body:not(.personal-entry-sheet) .channel-sheet-page .editable-spreadsheet td.row-no > span {
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }
    .sheet-body:not(.personal-entry-sheet) .channel-sheet-page .editable-spreadsheet td.row-no > span::before {
        content: "记录";
    }
    .sheet-body:not(.personal-entry-sheet) .channel-sheet-page .editable-spreadsheet tr > td.sheet-edit-cell {
        position: relative;
        display: block;
        width: 100%;
        min-width: 0;
        height: auto;
        min-height: 82px;
        overflow: visible;
        border: 0;
        border-bottom: 1px solid #e5eaf2;
        border-radius: 0;
        padding: 31px 14px 13px;
        background: transparent;
    }
    .sheet-body:not(.personal-entry-sheet) .channel-sheet-page .editable-spreadsheet tr > td.sheet-edit-cell:last-child {
        border-bottom: 0;
        border-radius: 0 0 15px 15px;
    }
    .sheet-body:not(.personal-entry-sheet) .channel-sheet-page .editable-spreadsheet td.sheet-edit-cell::before {
        position: absolute;
        top: 9px;
        left: 11px;
        color: #4b5870;
        content: attr(data-field-label);
        font-size: 12px;
        font-weight: 750;
    }
    .sheet-body:not(.personal-entry-sheet) .channel-sheet-page .sheet-cell-control,
    .sheet-body:not(.personal-entry-sheet) .channel-sheet-page .sheet-multi-select > summary {
        width: 100%;
        min-height: 48px;
        border: 1px solid #cad4e6;
        border-radius: 10px;
        padding: 12px;
        background: #fff;
        font-size: 16px;
    }
    .sheet-body:not(.personal-entry-sheet) .channel-sheet-page textarea.sheet-cell-control {
        height: 92px;
        min-height: 92px;
        overflow-y: auto;
        resize: vertical;
    }
    .sheet-body:not(.personal-entry-sheet) .channel-sheet-page .sheet-cell-control[data-colored-select][data-option-active="true"] {
        width: 100%;
        min-height: 48px;
        margin: 0;
        border-radius: 10px;
        padding: 10px 34px 10px 18px;
        color: #172033;
        background: #fff;
        border-left: 5px solid var(--option-bg);
        -webkit-text-fill-color: #172033;
    }
    .sheet-body:not(.personal-entry-sheet) .channel-sheet-page .sheet-multi-select { height: auto; }
    .sheet-body:not(.personal-entry-sheet) .channel-sheet-page .sheet-multi-select > summary { height: auto; padding-right: 34px; }
    .sheet-body:not(.personal-entry-sheet) .channel-sheet-page .sheet-multi-options {
        position: static;
        width: 100%;
        max-height: none;
        margin-top: 7px;
        box-shadow: none;
    }
    .sheet-body:not(.personal-entry-sheet) .channel-sheet-page .sheet-multi-options label { min-height: 44px; }
    .sheet-body:not(.personal-entry-sheet) .channel-sheet-page .remote-presence-label {
        top: 5px;
        right: 8px;
        left: auto;
        max-width: 48%;
        border-radius: 5px;
    }
    .sheet-body:not(.personal-entry-sheet) .channel-sheet-page .spreadsheet-draft-row .sheet-edit-cell { background: #fbfcff; }
    .sheet-body:not(.personal-entry-sheet) .channel-sheet-page .spreadsheet-add-row { display: none; }
    .sheet-body:not(.personal-entry-sheet) .channel-sheet-page .mobile-row-edit-button { display: none; }
    .mobile-add-student {
        position: fixed;
        z-index: 26;
        right: 14px;
        bottom: calc(14px + env(safe-area-inset-bottom, 0px));
        display: inline-flex;
        min-height: 48px;
        border-radius: 999px;
        padding: 10px 18px;
        box-shadow: 0 12px 30px rgba(49,87,213,.3);
    }

    /* 渠道手机端的逐条编辑层，直接复用原单元格，自动保存与协作状态保持一致。 */
    body.mobile-row-editor-open { overflow: hidden; }
    body.mobile-row-editor-open .mobile-add-student { display: none; }
    .inline-spreadsheet.has-mobile-row-editor { overflow: visible; }
    .mobile-row-editor:not([hidden]) {
        position: fixed;
        z-index: 180;
        inset: 0;
        display: flex;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        flex-direction: column;
        padding-top: env(safe-area-inset-top, 0px);
        background: #f5f7fb;
    }
    .mobile-row-editor-shell { display: flex; min-height: 0; flex: 1; flex-direction: column; }
    .mobile-row-editor-header {
        display: flex;
        min-height: 68px;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        border-bottom: 1px solid var(--line);
        padding: 10px 14px;
        background: rgba(255,255,255,.96);
        box-shadow: 0 5px 18px rgba(23,32,51,.05);
    }
    .mobile-row-editor-header small { color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
    .mobile-row-editor-header h2 { margin: 1px 0 0; font-size: 20px; }
    .mobile-row-editor-body {
        min-height: 0;
        overflow-y: auto;
        flex: 1;
        padding: 14px 12px 22px;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
    }
    .mobile-row-editor-tip { margin: 0 2px 10px; color: var(--success); font-size: 12px; font-weight: 700; }
    .mobile-row-editor-table { display: block; width: 100%; border-collapse: separate; border-spacing: 0; }
    .mobile-row-editor-table tbody,
    .mobile-row-editor-table tr { display: grid; width: 100%; gap: 10px; }
    .mobile-row-editor-table tr > td.row-no { display: none; }
    .mobile-row-editor-table tr > td.sheet-edit-cell {
        position: relative;
        display: block;
        width: 100%;
        min-width: 0;
        height: auto;
        min-height: 82px;
        overflow: visible;
        border: 1px solid #dde3ee;
        border-radius: 13px;
        padding: 29px 10px 10px;
        background: #fff;
        box-shadow: 0 5px 18px rgba(23,32,51,.04);
    }
    .mobile-row-editor-table td.sheet-edit-cell::before {
        position: absolute;
        top: 9px;
        left: 12px;
        color: #4b5870;
        content: attr(data-field-label);
        font-size: 12px;
        font-weight: 750;
    }
    .mobile-row-editor-table .sheet-cell-control,
    .mobile-row-editor-table .sheet-multi-select > summary {
        width: 100%;
        min-height: 48px;
        border: 1px solid #cad4e6;
        border-radius: 10px;
        padding: 12px;
        background: #fff;
        font-size: 16px;
    }
    .mobile-row-editor-table textarea.sheet-cell-control { height: 92px; min-height: 92px; overflow-y: auto; resize: vertical; }
    .mobile-row-editor-table .sheet-cell-control[data-colored-select][data-option-active="true"] {
        width: 100%;
        min-height: 48px;
        margin: 0;
        border-radius: 10px;
        padding: 10px 34px 10px 12px;
    }
    .mobile-row-editor-table .sheet-multi-select { height: auto; }
    .mobile-row-editor-table .sheet-multi-select > summary { height: auto; padding-right: 34px; }
    .mobile-row-editor-table .sheet-multi-options {
        position: static;
        width: 100%;
        max-height: none;
        margin-top: 7px;
        box-shadow: none;
    }
    .mobile-row-editor-table .sheet-multi-options label { min-height: 44px; }
    .mobile-row-editor-table .remote-presence-label { top: 5px; right: 8px; left: auto; max-width: 48%; border-radius: 5px; }
    .mobile-row-editor-footer {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        gap: 10px;
        border-top: 1px solid var(--line);
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
        background: rgba(255,255,255,.97);
    }
    .mobile-row-editor-footer > span { min-width: 58px; color: var(--muted); text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; }
    .mobile-row-editor-footer .button { width: 100%; min-height: 44px; }
    .mobile-row-placeholder td { height: 52px; background: #f7f9fc; }

    /* 独立学生手机端：单条纵向填写，不展示表格管理工具。 */
    .personal-entry-sheet .channel-sheet-page { padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
    .personal-entry-sheet .channel-sheet-page .sheet-heading { gap: 10px; }
    .personal-entry-sheet .channel-sheet-page .heading-actions { display: none; }
    .personal-entry-sheet .inline-spreadsheet { overflow: visible; border-radius: 0; background: transparent; }
    .personal-entry-sheet .table-summary {
        position: sticky;
        z-index: 20;
        top: calc(60px + env(safe-area-inset-top, 0px));
        justify-content: flex-start;
        overflow: visible;
        border: 1px solid #d9e9e1;
        border-radius: 12px;
        margin-bottom: 10px;
        padding: 11px 12px;
        background: rgba(255,255,255,.96);
        box-shadow: 0 7px 20px rgba(23,32,51,.07);
        backdrop-filter: blur(12px);
    }
    .personal-entry-sheet .table-summary .sheet-record-count,
    .personal-entry-sheet .table-summary .sheet-field-count { display: none; }
    .personal-entry-sheet .table-summary .sheet-sync-indicator { margin: 0; }
    .personal-entry-sheet .spreadsheet-viewport {
        min-height: 0 !important;
        overflow: visible;
        background: transparent;
    }
    .personal-entry-sheet .editable-spreadsheet,
    .personal-entry-sheet .editable-spreadsheet tbody { display: block; width: 100%; min-width: 0; }
    .personal-entry-sheet .editable-spreadsheet thead { display: none; }
    .personal-entry-sheet .editable-spreadsheet tbody { display: grid; gap: 12px; }
    .personal-entry-sheet .editable-spreadsheet tr[data-spreadsheet-row] {
        display: grid;
        width: 100%;
        gap: 0;
        border: 1px solid #cfd8e8;
        border-top: 4px solid var(--primary);
        border-radius: 16px;
        padding: 0;
        background: #fff;
        box-shadow: 0 12px 30px rgba(23,32,51,.09);
    }
    .personal-entry-sheet .editable-spreadsheet tr[hidden] { display: none; }
    .personal-entry-sheet .editable-spreadsheet tr > td.row-no { display: none; }
    .personal-entry-sheet .editable-spreadsheet tr > td.sheet-edit-cell {
        position: relative;
        display: block;
        width: 100%;
        min-width: 0;
        height: auto;
        min-height: 82px;
        overflow: visible;
        border: 0;
        border-bottom: 1px solid #e5eaf2;
        border-radius: 0;
        padding: 31px 14px 13px;
        background: transparent;
    }
    .personal-entry-sheet .editable-spreadsheet tr > td.sheet-edit-cell:last-child {
        border-bottom: 0;
        border-radius: 0 0 15px 15px;
    }
    .personal-entry-sheet .editable-spreadsheet td.sheet-edit-cell::before {
        position: absolute;
        top: 9px;
        left: 11px;
        color: #4b5870;
        content: attr(data-field-label);
        font-size: 12px;
        font-weight: 750;
    }
    .personal-entry-sheet .sheet-cell-control,
    .personal-entry-sheet .sheet-multi-select > summary {
        width: 100%;
        min-height: 48px;
        border: 1px solid #cad4e6;
        border-radius: 10px;
        padding: 12px;
        background: #fff;
        font-size: 16px;
    }
    .personal-entry-sheet textarea.sheet-cell-control { height: 92px; min-height: 92px; overflow-y: auto; resize: vertical; }
    .personal-entry-sheet .sheet-cell-control[data-colored-select][data-option-active="true"] {
        width: 100%;
        min-height: 48px;
        margin: 0;
        border-radius: 10px;
        padding: 10px 34px 10px 18px;
        color: #172033;
        background: #fff;
        border-left: 5px solid var(--option-bg);
        -webkit-text-fill-color: #172033;
    }
    .personal-entry-sheet .sheet-multi-select { height: auto; }
    .personal-entry-sheet .sheet-multi-select > summary { height: auto; padding-right: 34px; }
    .personal-entry-sheet .sheet-multi-options {
        position: static;
        width: 100%;
        max-height: none;
        margin-top: 7px;
        box-shadow: none;
    }
    .personal-entry-sheet .sheet-multi-options label { min-height: 44px; }
    .admin-master-body .topbar-inner { width: calc(100% - 16px); min-height: 60px; gap: 10px; }
    .admin-master-page {
        width: calc(100% - 16px);
        min-height: calc(100vh - 60px);
        min-height: calc(100dvh - 60px);
        padding: 18px 0 10px;
    }
    .admin-master-page .sheet-heading { margin-bottom: 12px; }
    .admin-master-page .sheet-heading h1 { font-size: clamp(24px, 7.5vw, 30px); }
    .admin-master-page .admin-master-sheet { border-radius: 12px; }
    .admin-master-page .master-table-fragment > .table-summary { gap: 12px; padding: 11px 12px; }
    .admin-master-page .master-table-fragment > .table-wrap.tall { max-height: none; min-height: 360px; }
    .master-field-editor-footer { align-items: stretch; flex-direction: column-reverse; }
    .master-field-order-actions, .master-field-confirm-actions { width: 100%; }
    .master-field-order-actions .button, .master-field-confirm-actions .button { flex: 1; }
    .topnav a { display: none; }
    .nav-identity { display: none; }
    .account-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .permission-fieldset, .permission-fieldset.compact, .form-access-fieldset, .form-access-fieldset.compact { grid-template-columns: 1fr; }
    .account-secondary-actions { align-items: stretch; flex-direction: column; }
    .reset-password-form { width: 100%; grid-template-columns: minmax(0, 1fr) auto; }
    .brand strong { max-width: 210px; }
    .split-heading, .detail-heading { align-items: stretch; flex-direction: column; }
    .heading-actions { width: 100%; }
    .heading-actions .button { flex: 1; }
    .card-grid, .stats-grid, .preset-grid { grid-template-columns: 1fr; }
    .form-grid.two, .dialog-fields, .snapshot-grid { grid-template-columns: 1fr; }
    .channel-mode-control { min-width: 215px; }
    .independent-entry-item { grid-template-columns: 1fr; align-items: stretch; }
    .independent-entry-status, .independent-entry-actions { grid-column: 1; grid-row: auto; }
    .independent-entry-actions { justify-content: flex-start; }
    .span-two, .dialog-fields label:has(textarea), .dialog-fields label:has(select[multiple]) { grid-column: span 1; }
    .field-builder-panel .section-heading.with-action { align-items: stretch; flex-direction: column; }
    .field-builder-actions { justify-content: space-between; }
    .field-summary-card { grid-template-columns: 66px minmax(0, 1fr); align-items: start; padding: 12px; }
    .field-summary-actions { grid-column: 2; flex-wrap: wrap; }
    .field-summary-actions button { padding: 5px 7px; }
    .field-type-list { grid-template-columns: 1fr; }
    .field-editor-header, .field-editor-body, .field-editor-footer { padding-right: 16px; padding-left: 16px; }
    .option-editor-row { grid-template-columns: auto 28px 30px minmax(0, 1fr); }
    .option-row-actions { grid-column: 4; flex-wrap: wrap; }
    .required-toggle { align-items: flex-start; }
    .copy-box { align-items: stretch; flex-wrap: wrap; }
    .copy-box code { width: 100%; flex-basis: 100%; padding: 7px; }
    .sticky-submit { align-items: stretch; flex-direction: column; }
    .sticky-submit .button { width: 100%; }
    .channel-auth-shell { width: calc(100% - 24px); }
    .channel-brand-panel { min-height: 230px; gap: 42px; padding: 24px; }
    .channel-login-card, .auth-card { padding: 24px; }
    .channel-identity > span { display: none; }
    .record-activity-dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
    .record-activity-shell { max-height: calc(100dvh - 16px); }
    .record-activity-header, .record-comment-form { padding-right: 16px; padding-left: 16px; }
    .record-activity-list { padding-right: 16px; padding-left: 16px; }
    .record-activity-snapshot { grid-template-columns: 1fr; }
    .sheet-comment-panel { top: 68px; right: 8px; bottom: 8px; width: calc(100vw - 16px); }
    .timeline-top { align-items: flex-start; flex-direction: column; gap: 5px; }
    .table-wrap.tall { max-height: calc(100vh - 300px); }
}

@media (max-width: 420px) {
    .field-editor-header { align-items: center; padding-top: 12px; padding-bottom: 11px; }
    .field-editor-header .eyebrow { display: none; }
    .field-editor-header h2 { font-size: 18px; }
    .field-editor-header .dialog-close { min-height: 34px; }
    .field-editor-body { gap: 14px; padding-top: 14px; padding-bottom: 16px; }
    .field-type-trigger { min-height: 50px; }
    .field-option-editor { gap: 8px; padding-top: 13px; }
    .field-option-heading small { display: none; }
    .option-editor-list { gap: 6px; }
    .option-editor-row { padding: 6px; }
    .field-editor-footer { padding-top: 10px; padding-bottom: 10px; }
}

@keyframes drag-drop-settle {
    0% { transform: scale(1.018); }
    48% { transform: scale(.992); }
    100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .field-summary-card, .option-editor-row, .drag-control, .sheet-filter-popover, .sheet-filter-trigger, .sheet-sort-condition, .collaboration-trigger, .collaboration-panel, .record-activity-dialog, .form-card, .app-confirm-dialog, .app-confirm-dialog::backdrop { transition-duration: .01ms !important; }
    .field-summary-card.is-dropping, .option-editor-row.is-dropping, .form-card.is-form-card-dropping { animation: none; }
}
