.assistant-page {
    --accent: #3f51b5;
    --ink: #404040;
    --muted: #667085;
    --border: #d8dce5;
    --v: 1;
    --shell-top: calc(32px * var(--v));
    --shell-bottom: calc(32px * var(--v));
    --shell-max: 720px;
    --shell-x: 32px;
    min-width: 320px;
    color: var(--ink);
}

.assistant-page [hidden] { display: none !important; }
.assistant-shell, .assistant-shell * { box-sizing: border-box; }
.assistant-shell { position: relative; display: flex; flex-direction: column; width: calc(100% - 40px); max-width: 600px; margin: var(--shell-top) auto var(--shell-bottom); padding: calc(32px * var(--v)) var(--shell-x) 44px; background: #fff; border-radius: 4px; font-size: 14px; line-height: 1.55; }
.assistant-shell.tall { min-height: min(calc(100vh - var(--shell-top) - var(--shell-bottom)), var(--shell-max)); min-height: min(calc(100dvh - var(--shell-top) - var(--shell-bottom)), var(--shell-max)); }
#registration { display: flex; flex: 1 0 auto; flex-direction: column; }
.assistant-shell .step-content { flex: 1 0 auto; }
.assistant-logo { display: block; margin: 0 auto calc(28px * var(--v)); }
.assistant-shell form { display: block; width: 100%; max-width: none; margin: 0; padding: 0; border: 0; border-radius: 0; text-align: left; }
.assistant-shell button, .assistant-shell input, .assistant-shell textarea { font-family: inherit; }
.assistant-shell textarea { width: 100%; min-height: 92px; resize: vertical; line-height: 1.5; }
.assistant-shell a { text-underline-offset: 3px; }
.assistant-shell button, .assistant-shell summary { cursor: pointer; }
.assistant-shell :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.assistant-shell input:not([type="checkbox"]):focus-visible, .assistant-shell textarea:focus-visible { outline: none; }
.assistant-shell [tabindex="-1"]:focus { outline: none; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; margin: 0 0 calc(16px * var(--v)); }
.assistant-shell .form-title { margin: 0 0 calc(8px * var(--v)); font-size: 18px; font-weight: 700; line-height: 1.2; letter-spacing: -.015em; }
.assistant-shell h2 { font: inherit; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.assistant-shell .intro { color: var(--muted); margin: 0 0 calc(24px * var(--v)); }
.progress { display: flex; gap: 7px; margin: 0 0 calc(6px * var(--v)); padding: 0; list-style: none; }
.progress li { flex: 1; height: 4px; border-radius: 2px; background: #ebedf3; }
.progress li.complete, .progress li.current { background: var(--accent); }
.assistant-shell .field { width: 100%; margin-bottom: calc(14px * var(--v)); }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.assistant-shell form > .field:last-of-type { margin-bottom: 0; }
.required { color: #d50000; }
.assistant-shell input:not([type="checkbox"]), .assistant-shell textarea { width: 100%; padding: 6px 8px; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #c43535; }
.assistant-shell .field input:disabled { background: #f2f4f7; color: var(--muted); -webkit-text-fill-color: var(--muted); opacity: 1; cursor: not-allowed; }
.assistant-shell input[type="date"] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; height: 32.5px; text-align: left; }
.assistant-shell input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.field-error { display: block; color: #d50000; font-size: 12px; margin-top: calc(4px * var(--v)); }
.field-error:empty { margin-top: 0; }
.assistant-shell .primary, .assistant-shell .secondary { display: inline-flex; align-items: center; justify-content: center; width: 100%; height: auto; min-height: 36px; margin: 0; padding: 8px 16px; white-space: normal; line-height: 1.5; text-align: center; text-decoration: none; }
.assistant-shell form > .primary, .assistant-shell .step-content > .primary { margin-top: calc(24px * var(--v)); }
.assistant-shell button:disabled { cursor: default; opacity: .45; }
.actions { display: grid; gap: calc(12px * var(--v)); margin-top: calc(24px * var(--v)); }
.hint { margin: calc(4px * var(--v)) 0 0; color: var(--muted); font-size: 13px; }
.notice { padding: calc(14px * var(--v)) 16px; margin: 0 0 calc(24px * var(--v)); border-radius: 8px; background: #fff2f0; color: #a22c20; font-size: 14px; }
.notice.success { background: #e5f7ed; color: #19834b; }
.notice:empty { display: none; }
.captcha-box { min-height: 105px; display: flex; align-items: center; justify-content: center; margin: calc(12px * var(--v)) 0; }
.code-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.assistant-shell input.code-box { width: 100%; min-width: 0; height: 48px; padding: 0; text-align: center; font-size: 20px; font-variant-numeric: tabular-nums; }
.check-input { width: 22px; height: 22px; flex: 0 0 22px; margin: 0; accent-color: var(--accent); }
.document { border: 1px solid var(--border); border-radius: 10px; margin-bottom: calc(8px * var(--v)); overflow: hidden; }
.title-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: calc(4px * var(--v)) 12px; margin: 0 0 calc(8px * var(--v)); }
.assistant-shell .title-row .form-title { flex: 1 1 auto; min-width: 0; margin: 0; }
.document-date { flex: 0 0 auto; margin-left: auto; font-size: 12px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.document-body { height: 290px; padding: calc(4px * var(--v)) 22px calc(22px * var(--v)); overflow: auto; overscroll-behavior: contain; overflow-wrap: anywhere; font-size: 14px; }
.document-body > :first-child { margin-top: calc(16px * var(--v)); }
.document-body h1 { font-size: 17px; }
.document-body h2 { font-size: 15px; }
.document-body h3 { font-size: 14px; }
.document-body table { width: 100%; border-collapse: collapse; }
.document-body td, .document-body th { padding: 6px; border: 1px solid var(--border); }
.document-body pre { white-space: pre-wrap; }
.document-body blockquote { margin-left: 0; border-left: 3px solid var(--border); padding-left: 16px; }
.document-footer .hint { margin: 0 0 calc(6px * var(--v)); text-align: center; }
.checkbox-label { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; }
.support-group { min-width: 0; margin: 0 0 calc(14px * var(--v)); padding: 0; border: 0; }
.support-legend { margin: 0 0 calc(12px * var(--v)); padding: 0; font-size: 14px; }
.support-options { display: grid; gap: calc(10px * var(--v)); }
.otp-meta { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.text-button { border: 0; background: transparent; color: var(--accent); padding: 4px 0; font-size: 13px; text-decoration: none; }
.captcha-reload { display: inline-flex; align-items: center; gap: 6px; margin: calc(-4px * var(--v)) 0 calc(12px * var(--v)); cursor: pointer; }
.reload-icon { width: 16px; height: 16px; flex: 0 0 16px; fill: currentColor; }
.verification-card { border: 1px solid var(--border); background: #fafbfe; border-radius: 12px; padding: calc(24px * var(--v)) 24px; margin: calc(28px * var(--v)) 0; }
.verification-card h2 { margin: 0 0 calc(10px * var(--v)); }
.verification-card p { margin: 0; color: var(--muted); font-size: 14px; }
.verification-card p + p { margin-top: calc(8px * var(--v)); }
.shell-footer { position: absolute; left: var(--shell-x); bottom: 8px; margin: 0; padding: 0; border: 0; text-align: left; }
.centered { text-align: center; padding-top: calc(24px * var(--v)); }
.centered .intro { margin-left: auto; margin-right: auto; }
.status-icon { display: flex; align-items: center; justify-content: center; width: 72px; height: 72px; margin: calc(12px * var(--v)) auto calc(28px * var(--v)); border-radius: 50%; background: #eef1ff; color: var(--accent); font-size: 32px; }
.status-icon.success { background: #e5f7ed; color: #19834b; }
.link-guide { padding: calc(16px * var(--v)) 20px; border: 1px solid var(--border); border-radius: 12px; background: #fafbfe; text-align: left; }
.link-guide p { margin: 0; }
.link-guide .text-button { margin-top: calc(6px * var(--v)); font-size: 14px; font-weight: 600; text-decoration: underline; }
.guide-dialog { width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); padding: 0; border: 0; border-radius: 8px; color: var(--ink); text-align: left; font-size: 14px; line-height: 1.55; }
.guide-dialog[open] { display: flex; flex-direction: column; }
.guide-dialog::backdrop { background: rgba(16, 24, 40, .5); }
.guide-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.assistant-shell .guide-header h2 { margin: 0; }
.guide-close { border: 0; background: transparent; color: var(--muted); font-size: 24px; line-height: 1; padding: 0 4px; }
.guide-body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 4px 20px 16px; }
.guide-body ol { margin: 16px 0 0; padding-left: 20px; }
.guide-body li + li { margin-top: 14px; }
.guide-body img { display: block; max-width: 100%; height: auto; margin-top: 8px; border: 1px solid var(--border); border-radius: 6px; }
.guide-footer { padding: 12px 20px 16px; border-top: 1px solid var(--border); }
.element-guide-accent { padding: 10px 12px; border-left: 3px solid var(--accent); border-radius: 6px; background: #eef1ff; }
.element-guide-server { color: var(--accent); }
.spinner { border: 3px solid #dce1f5; border-top-color: var(--accent); border-radius: 50%; width: 28px; height: 28px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .spinner { animation: none; }
}
@media (max-width: 600px) {
    .assistant-page { --v: .75; --shell-x: 16px; --shell-max: 100vh; }
    .assistant-shell { width: calc(100% - 24px); padding: calc(28px * var(--v)) var(--shell-x) 44px; min-height: min(calc(100vh - var(--shell-top) - var(--shell-bottom)), var(--shell-max)); min-height: min(calc(100dvh - var(--shell-top) - var(--shell-bottom)), var(--shell-max)); }
    .intro { font-size: 14px; }
    .field-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .code-boxes { gap: 6px; }
    .assistant-shell input.code-box { height: 44px; font-size: 18px; }
    .document-body { padding: calc(4px * var(--v)) 14px calc(16px * var(--v)); height: 260px; }
    .captcha-box { margin-left: -8px; margin-right: -8px; }
    .assistant-shell .step-content { display: flex; flex-direction: column; }
    .assistant-shell .step-content > form { display: flex; flex: 1 0 auto; flex-direction: column; }
    .assistant-shell .step-content > .captcha-box, .assistant-shell .step-content > .verification-card { margin-top: 0; }
    .assistant-shell .step-content > .primary, .assistant-shell .step-content > form > .primary { margin-top: auto; }
    .assistant-shell .step-content > .actions, .assistant-shell .step-content > form > .actions { margin-top: auto; padding-top: calc(24px * var(--v)); }
}
