.portal-header { gap: 24px; }
.preview-banner { color: #e9c16e; padding-top: 14px; font-size: 13px; }
.portal-navigation { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.portal-navigation form { display: flex; }
.portal-navigation a:hover, .portal-sidebar a:hover { color: var(--accent); }
.portal-shell { padding-top: 40px; padding-bottom: 64px; min-height: 70vh; }
.portal-content { min-width: 0; }
.portal-content h1 { font-size: 28px; line-height: 1.3; margin-bottom: 24px; letter-spacing: 0; overflow-wrap: anywhere; }
.portal-content h2 { font-size: 20px; line-height: 1.4; margin-bottom: 16px; letter-spacing: 0; overflow-wrap: anywhere; }
.portal-content h3 { font-size: 16px; margin-bottom: 8px; letter-spacing: 0; overflow-wrap: anywhere; }
.portal-content p, .portal-content dd { overflow-wrap: anywhere; }
.portal-section { padding: 28px 0; border-bottom: 1px solid var(--border); }
.portal-section:first-of-type { padding-top: 8px; }
.portal-section p + form { margin-top: 20px; }
.portal-introduction { max-width: 800px; margin-bottom: 28px; }
.section-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.section-tabs a[aria-current=page] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.portal-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; min-height: 42px; max-width: 100%; border: 1px solid var(--accent-strong); border-radius: 6px; background: var(--accent-strong); color: #fff; line-height: 1.4; text-align: center; font-size: 14px; font-weight: 600; letter-spacing: 0; overflow-wrap: anywhere; transition: background .15s, border-color .15s; }
.portal-button:hover { background: #2874d6; border-color: #63adff; }
.portal-button.secondary { background: rgba(16, 29, 47, .6); border-color: var(--border-strong); color: var(--text-main); }
.portal-button.secondary:hover { background: var(--accent-soft); border-color: var(--accent); }
.portal-button.danger:hover, .icon-button.danger:hover { background: rgba(180, 60, 60, .16); border-color: #ff9999; }
.portal-button:disabled, .icon-button:disabled { opacity: .55; cursor: wait; }
.portal-button svg, .portal-button i { flex: 0 0 auto; width: 16px; }
.portal-button.danger, .icon-button.danger { background: transparent; color: #ff9999; border-color: #8f4545; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 40px; width: 40px; height: 40px; padding: 0; border: 1px solid var(--border-strong); border-radius: 4px; background: rgba(16, 29, 47, .6); color: var(--text-main); }
.icon-button svg, .icon-button i { width: 16px; max-height: 18px; }
.icon-button:hover { background: var(--accent-soft); }
.portal-form { display: grid; gap: 20px; max-width: 900px; }
.portal-form > .portal-button { justify-self: start; }
.portal-form label, .portal-filters label { display: grid; gap: 8px; min-width: 0; font-size: 14px; }
.portal-form input:not([type=checkbox]):not([type=radio]), .portal-form select, .portal-form textarea, .portal-filters input, .portal-filters select { width: 100%; min-width: 0; padding: 10px 12px; border-radius: 4px; border: 1px solid var(--border-strong); background: #0d1726; color: var(--text-main); font: inherit; }
.portal-form input[type=color] { min-height: 42px; padding: 4px; }
.portal-form textarea { resize: vertical; }
.portal-form input:focus-visible, .portal-form textarea:focus-visible, .portal-form select:focus-visible, .portal-filters input:focus-visible, .portal-filters select:focus-visible, .portal-button:focus-visible, .icon-button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.portal-form fieldset { min-width: 0; border: 0; padding: 0; }
.portal-form legend { font-weight: bold; padding-bottom: 8px; overflow-wrap: anywhere; }
.question-field { margin-bottom: 12px; }
.question-field > p { margin-bottom: 10px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.permission-grid label, .choice-list label, .portal-form .check-label { display: flex; align-items: start; gap: 10px; }
.permission-grid input, .choice-list input, .check-label input { flex: 0 0 16px; width: 16px; height: 16px; margin-top: 3px; accent-color: var(--accent-strong); }
.choice-list { display: grid; gap: 12px; }
.portal-row { display: flex; align-items: start; justify-content: space-between; gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--border); }
.portal-row > div { min-width: 0; }
.portal-row .portal-button { flex-shrink: 0; }
.portal-notice { padding: 14px 16px; background: rgba(74, 163, 108, .15); border-left: 3px solid #68b98b; margin-bottom: 24px; }
.portal-notice.warning { background: rgba(205, 149, 49, .12); border-color: #d0a450; }
.detail-grid { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 12px; margin: 20px 0; }
.detail-grid dt, .muted, .timeline-meta, .notification-row time { color: var(--text-muted); }
.compact-form { max-width: 520px; margin-top: 20px; }
.staff-shell { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 36px; }
.portal-sidebar { display: flex; flex-direction: column; align-items: start; gap: 16px; border-right: 1px solid var(--border); padding-right: 20px; }
.portal-sidebar h2 { font-size: 16px; margin: 0 0 8px; }
.portal-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; margin-bottom: 24px; }
.portal-filters label { flex: 1 1 180px; }
.table-scroll { max-width: 100%; overflow-x: auto; }
.portal-table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
.portal-table th { color: var(--text-muted); font-weight: normal; }
.portal-table th, .portal-table td { padding: 14px 12px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; max-width: 280px; }
.portal-table th:first-child, .portal-table td:first-child { padding-left: 0; }
.status-tag { display: inline-block; font-size: 13px; color: #8fc6ff; white-space: nowrap; }
.status-accepted { color: #7fd6a1; }
.status-rejected { color: #ff9494; }
.status-withdrawn { color: var(--text-muted); }
.status-interview, .status-test { color: #e9c16e; }
.page-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading h1, .page-heading h2 { margin-bottom: 4px; }
.back-link { display: inline-flex; gap: 8px; align-items: center; margin-bottom: 24px; color: var(--accent); }
.answer-block { padding: 18px 0; border-bottom: 1px solid var(--border); }
.answer-block ul { padding-left: 22px; }
.timeline-entry { padding: 16px 0 16px 18px; border-left: 2px solid var(--border-strong); }
.timeline-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; margin-bottom: 8px; }
.timeline-entry.internal-note { border-color: #af91cf; }
.page-navigation { display: flex; align-items: center; gap: 16px; margin-top: 24px; }
.role-editor { padding: 24px 0; border-bottom: 1px solid var(--border); }
.role-editor summary { cursor: pointer; font-size: 18px; }
.role-editor .portal-form { margin-top: 24px; }
.builder-question { display: grid; gap: 14px; border: 1px solid var(--border-strong) !important; border-radius: 6px; padding: 18px !important; margin-bottom: 20px; }
.question-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.question-toolbar > div { display: flex; gap: 8px; }
.editor-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.form-builder .portal-section { display: grid; gap: 20px; }
.form-builder .portal-section h2, .form-builder .portal-section .page-heading { margin-bottom: 0; }
.form-builder .editor-actions { padding-top: 4px; }
.settings-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; list-style: none; }
.settings-summary::-webkit-details-marker { display: none; }
.settings-summary h2 { margin: 0; }
.settings-summary > svg, .settings-summary > i { width: 14px; color: var(--text-muted); }
.message-settings details[open] > .settings-summary { margin-bottom: 24px; }
.message-settings details[open] > .settings-summary > svg, .message-settings details[open] > .settings-summary > i { transform: rotate(180deg); }
.message-settings { margin-bottom: 24px; }
.message-state-selector { max-width: 300px; }
.message-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 24px; }
.message-fields { min-width: 0; display: grid; gap: 12px; }
.message-tokens { display: flex; gap: 8px; }
.message-preview { min-width: 0; border-left: 4px solid #2e8ec8; border-radius: 4px; background: #23262c; padding: 18px; margin-top: 28px; font-size: 14px; }
.message-preview-title { font-weight: 700; margin-bottom: 14px; }
.message-preview-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.message-preview-footer { margin-top: 22px; font-size: 12px; color: #c4ccd8; overflow-wrap: anywhere; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; padding-top: 16px; border-top: 1px solid var(--border); }
.notification-dialog { max-width: 640px; }
.notification-dialog .message-preview-title, .notification-dialog .message-preview-footer { margin: 0; }
.notifications-panel { scroll-margin-top: 100px; }
.notifications-panel .page-heading { align-items: center; }
.notification-count { margin-left: 8px; font-size: 14px; font-weight: 400; color: var(--text-muted); }
.notifications-scroll { max-height: 440px; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: #48617f transparent; scrollbar-width: thin; scrollbar-gutter: stable; padding-right: 12px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.notifications-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.notifications-scroll::-webkit-scrollbar { width: 6px; }
.notifications-scroll::-webkit-scrollbar-thumb { background: #48617f; border-radius: 3px; }
.notification-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 20px; padding: 22px 4px; border-bottom: 1px solid var(--border); }
.notification-row:last-child { border-bottom: 0; }
.notification-content { min-width: 0; }
.notification-content h3 { font-weight: 500; }
.notification-row.is-unread h3 { font-weight: 700; }
.notification-content h3 a { color: var(--accent); }
.notification-content time { font-size: 12px; }
.notification-content p { margin-top: 12px; color: var(--text-soft); }
.notification-actions { display: flex; gap: 8px; }
.notification-pagination { justify-content: flex-end; font-size: 13px; color: var(--text-muted); }
.notification-delivery { font-size: 12px; line-height: 1.5; margin-top: 10px; max-width: 250px; }
.delivery-warning { color: #e9c16e; }
.portal-dialog { width: min(800px, calc(100% - 32px)); max-height: 85vh; margin: auto; padding: 24px; border-radius: 8px; border: 1px solid var(--border-strong); background: #132033; color: var(--text-main); overflow: auto; }
.portal-dialog::backdrop { background: rgba(0, 0, 0, .65); }
.portal-footer { color: var(--text-muted); padding: 32px 0 24px; }
.portal-footer nav { display: flex; flex-wrap: wrap; gap: 20px; font-size: 14px; }
.portal-footer a:hover { color: var(--accent); }
.portal-sidebar a { display: flex; gap: 10px; align-items: baseline; }
.portal-sidebar a svg, .portal-sidebar h2 svg { width: 16px; flex: 0 0 16px; }
.portal-sidebar a[aria-current=page] { color: var(--accent); }
.profile-search label:first-child { flex: 0 1 160px; }
.profile-search label:nth-child(2) { flex: 1 1 300px; }
.profile-heading { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.profile-heading > div { min-width: 0; }
.profile-heading > div:nth-child(2) { flex: 1 1 auto; }
.profile-actions { margin-left: auto; flex: 0 0 auto; }
.profile-heading h1 { margin-bottom: 8px; }
.profile-symbol { display: grid; place-items: center; width: 64px; height: 64px; flex: 0 0 64px; background: var(--accent-soft); border: 1px solid var(--border-strong); border-radius: 8px; color: var(--accent); font-size: 26px; }
.identity-strip { display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 13px; overflow-wrap: anywhere; }
.linked-state { color: #7fd6a1; }
.profile-index { display: flex; flex-wrap: wrap; gap: 12px 20px; padding: 20px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 20px; font-size: 13px; }
.profile-index a { color: var(--text-muted); }
.profile-index a:hover { color: var(--accent); }
.profile-index a[aria-current="page"] { color: var(--accent); font-weight: 700; }
.profile-submenus { border-top: 0; padding-top: 0; gap: 12px 16px; }
.form-route { display: flex; align-items: center; gap: 8px; min-width: 0; margin-bottom: 20px; }
.form-route > span { flex: 0 0 auto; font-size: 13px; color: var(--text-muted); }
.form-route > input { flex: 1 1 0; width: 0; min-width: 0; }
.form-route > button { flex: 0 0 auto; }
.answer-block > p, .answer-block > ul, .answer-block > a { margin-left: 16px; color: #b3c4d9; }
.answer-block > a { display: inline-block; }
.profile-section { scroll-margin-top: 100px; }
.profile-section summary { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: space-between; cursor: pointer; list-style: none; }
.profile-section summary::-webkit-details-marker { display: none; }
.profile-section summary h2 { margin: 0; font-size: 18px; }
.profile-section summary::after { content: '+'; font-size: 20px; color: var(--accent); }
.profile-section details[open] summary::after { content: '\2212'; }
.profile-section details[open] summary { margin-bottom: 24px; }
.section-count { font-size: 13px; margin-left: auto; }
.profile-record { padding: 20px 0; border-bottom: 1px solid var(--border); }
.profile-record:first-child { padding-top: 0; }
.profile-record:last-child { border-bottom: 0; padding-bottom: 0; }
.record-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 24px; font-size: 14px; }
.record-grid > div { min-width: 0; }
.record-grid dt { color: var(--text-muted); margin-bottom: 5px; }
.record-grid dd { white-space: pre-wrap; overflow-wrap: anywhere; }
.record-grid .record-wide { grid-column: 1 / -1; }
.json-record { font-family: inherit; font-size: 13px; }
.role-list { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.identity-text { overflow-wrap: anywhere; }
.portal-error { padding-top: 80px; }
.portal-error h1, .portal-error p { margin-bottom: 24px; }
.portal-error .portal-button { margin-right: 12px; }
[hidden] { display: none !important; }
@media (max-width: 760px) {
    .portal-header { flex-direction: column; align-items: start; padding-top: 16px; padding-bottom: 16px; }
    .portal-navigation { gap: 12px 16px; width: 100%; font-size: 14px; }
    .portal-shell { padding-top: 24px; }
    .staff-shell { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .portal-sidebar { flex-direction: row; flex-wrap: wrap; gap: 12px 20px; border-right: 0; border-bottom: 1px solid var(--border); padding: 0 0 20px; font-size: 14px; }
    .portal-sidebar h2 { flex-basis: 100%; }
    .field-grid, .permission-grid { grid-template-columns: minmax(0, 1fr); }
    .detail-grid { grid-template-columns: minmax(0, 1fr); gap: 4px; }
    .detail-grid dd { margin-bottom: 12px; }
    .portal-row { flex-direction: column; }
    .page-heading { flex-wrap: wrap; }
    .record-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .profile-heading { gap: 12px; align-items: start; }
    .profile-heading { flex-wrap: wrap; }
    .profile-heading > div:nth-child(2) { flex: 1 1 calc(100% - 56px); }
    .profile-actions { flex-basis: 100%; margin: 8px 0 0; }
    .notification-row { gap: 12px; }
    .notification-actions { flex-direction: column; }
    .notifications-scroll { max-height: 400px; padding-right: 8px; }
    .message-workspace { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .message-preview { margin-top: 0; }
    .message-state-selector { max-width: none; }
    .portal-dialog { padding: 20px; }
    .profile-symbol { width: 44px; height: 44px; flex-basis: 44px; font-size: 20px; }
    .profile-search label:first-child { flex-basis: 100%; }
    .profile-section summary { gap: 8px; }
    .profile-section summary h2 { flex-basis: calc(100% - 30px); }
    .section-count { margin-left: 0; order: 3; flex-basis: 100%; }
}
