/* Account page and theme overrides; loaded after the shared workspace styles. */
.account-header { margin-bottom: 24px; }
.account-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(290px, 1fr); gap: 20px; align-items: start; }
.account-layout > .panel { margin-bottom: 20px; }
.account-profile-grid { display: grid; grid-template-columns: 156px minmax(0, 1fr); gap: 26px; align-items: start; }
.account-photo-column { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.account-avatar { overflow: hidden; }
.account-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.account-avatar-large { width: 128px; height: 128px; border-radius: 18px; border: 1px solid var(--border); background: var(--teal-bg); color: var(--primary); font-size: 36px; }
.account-avatar-form { display: flex; flex-direction: column; align-items: stretch; gap: 10px; width: 100%; margin-top: 16px; }
.account-file-picker { position: relative; cursor: pointer; overflow: hidden; }
.account-file-picker input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; }
.account-file-picker:focus-within { outline: 3px solid #60b6b8; outline-offset: 3px; }
.account-file-name { display: block; min-width: 0; overflow-wrap: anywhere; font-size: 13px; color: var(--muted); text-align: center; }
.account-file-name:empty { display: none; }
.account-avatar-form .form-hint { margin: 0; text-align: center; }
.account-preview-note { font-size: 13px; line-height: 1.6; color: var(--primary-dark); text-align: center; }
.account-inline-error { font-size: 13px; line-height: 1.6; color: #93463e; overflow-wrap: anywhere; }
.account-delete-photo { color: #9b4944; margin-top: 6px; }
.account-details-form { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.account-details-form > .button { align-self: flex-start; }
.account-role-summary > span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.account-role-summary > div { display: flex; flex-wrap: wrap; gap: 6px; }
.account-role-summary .summary-chip { white-space: normal; }
.account-theme-options { display: flex; flex-direction: column; border: 0; margin: 0 0 20px; padding: 0; gap: 10px; min-width: 0; }
.account-theme-option { display: flex; align-items: center; gap: 12px; cursor: pointer; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 13px 12px; min-height: 74px; }
.account-theme-option:has(input:checked) { border-color: var(--primary); background: var(--teal-bg); }
.account-theme-option:focus-within { outline: 3px solid #60b6b8; outline-offset: 3px; }
.account-theme-option input { accent-color: var(--primary); width: 17px; height: 17px; flex-shrink: 0; margin: 0; }
.account-theme-option strong { display: block; font-size: 14px; font-weight: 600; }
.account-theme-option small { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.account-theme-option:has(input:checked) small { color: #526977; }
.account-theme-swatch { width: 32px; height: 32px; flex-shrink: 0; border-radius: 7px; border: 1px solid #9cacb8; position: relative; overflow: hidden; }
.account-theme-swatch:after { content: ''; position: absolute; inset: 7px; border: 1px solid #8296a4; border-radius: 3px; }
.account-theme-swatch.light { background: #f3f6f8; }
.account-theme-swatch.dark { background: #152333; }
.account-theme-swatch.system { background: linear-gradient(90deg, #f3f6f8 50%, #152333 50%); }
.account-tasks .panel-heading { align-items: center; }
.account-task-list { display: flex; flex-direction: column; }
.account-task { display: flex; justify-content: space-between; align-items: center; gap: 20px; border: 1px solid var(--border); border-radius: 8px; padding: 17px 18px; background: var(--surface); margin-bottom: 10px; min-height: 102px; }
.account-task:last-child { margin-bottom: 0; }
.account-task:hover { border-color: #8ab7b8; background: var(--teal-bg); }
.account-task-main { min-width: 0; }
.account-task-role { font-size: 13px; color: var(--primary-dark); display: block; margin-bottom: 4px; font-weight: 600; }
.account-task-role-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.account-task-role-line .account-task-role { margin-bottom: 0; }
.account-task-state { padding: 3px 7px; font-size: 13px; border-radius: 5px; background: #edf3f6; color: #526977; border: 1px solid var(--border); }
.account-task-state.available { background: #fff5e5; color: #805717; }
.account-task-state.claimed { background: #eaf5ef; color: #27664b; }
.account-task-owner { display: block; font-size: 13px; color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }
.account-task-main strong { display: block; overflow-wrap: anywhere; line-height: 1.5; }
.account-task-main p { margin-top: 6px; overflow-wrap: anywhere; font-size: 13px; }
.account-task-meta { color: var(--muted); font-size: 13px; display: block; margin-top: 7px; overflow-wrap: anywhere; }
.account-task:hover :is(.account-task-meta, .account-task-owner) { color: #526977; }
.account-task-open { color: var(--primary-dark); display: inline-flex; align-items: center; gap: 8px; font-size: 13px; white-space: nowrap; flex-shrink: 0; }
.account-task-open > span { font-size: 18px; }
.account-empty { padding: 20px 12px 16px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.account-empty-check { width: 40px; height: 40px; border: 1px solid var(--border); background: var(--teal-bg); color: var(--primary); border-radius: 10px; display: grid; place-items: center; font-size: 22px; margin-bottom: 13px; }
.account-empty h3 { font-size: 16px; }
.account-empty p { color: var(--muted); max-width: 490px; margin: 8px 0 18px; font-size: 13px; }
.account-loading { color: var(--muted); }
.account-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.profile .account-avatar { border-radius: 9px; }

/* Dark workspace: headings stay light while the navigation keeps a dark surface. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --navy: #e6eff6;
  --text: #d7e2ea;
  --muted: #a6b8c6;
  --primary: #78d5d1;
  --primary-dark: #94e3dc;
  --border: #34495c;
  --surface: #152333;
  --bg: #0c1624;
  --teal-bg: #16383a;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] body { color: var(--text); background: var(--bg); }
:root[data-theme="dark"] .sidebar { background: #102033; border-color: #2c4053; }
:root[data-theme="dark"] .brand-mark { background: #087f82; color: #fff; }
:root[data-theme="dark"] .button.primary { background: #087f82; border-color: #168f92; color: #fff; }
:root[data-theme="dark"] .button.primary:hover { background: #096b70; border-color: #32a4a4; }
:root[data-theme="dark"] .button.secondary { background: #203346; border-color: #486174; color: #e0edf5; }
:root[data-theme="dark"] .button.secondary:hover { background: #294256; border-color: #6793a3; }
:root[data-theme="dark"] .button.quiet { color: #b9d1df; }
:root[data-theme="dark"] :is(.button.quiet:hover, .icon-button:hover) { background: #24384c; }
:root[data-theme="dark"] .button.danger-outline { color: #ffb0a6; border-color: #8b5855; background: #35262c; }
:root[data-theme="dark"] .button.danger-outline:hover { background: #462d34; }
:root[data-theme="dark"] :is(.metric, .process-panel, .compact-route, .discussion-entry, .modal, .login-page) { background: var(--surface); border-color: var(--border); }
:root[data-theme="dark"] :is(.metric-icon, .report-icon, .expert-icon, .object-icon, .empty-state > span, .stage-owner, .avatar, .file-type, .summary-chip, .user-roles > span, .badge) { background: #223649; color: #c2d5e1; border-color: #3b5367; }
:root[data-theme="dark"] .profile > .avatar { background: #314d65; color: #e6f0f6; }
:root[data-theme="dark"] .metric.teal { background: #153335; border-color: #3a6564; }
:root[data-theme="dark"] .metric.teal .metric-icon { background: #245253; color: #a1e2d8; }
:root[data-theme="dark"] :is(.search-field, .filters select, .field input, .field select, .field textarea) { background: #101d2e; border-color: #486174; color: #e0eaf2; }
:root[data-theme="dark"] :is(.field input::placeholder, .field textarea::placeholder) { color: #a1b4c0; }
:root[data-theme="dark"] .field > span { color: #c8d9e3; }
:root[data-theme="dark"] .field b { color: #e5a99e; }
:root[data-theme="dark"] :is(.field input[readonly], .field textarea[readonly], .field select:disabled) { background: #1b2b3d; color: #b0c2ce; border-color: #3e5467; }
:root[data-theme="dark"] :is(.table-head, .checklist, .gate-panel, .modal-footer, .readonly-note, .snapshot-hint, .waiting-summary, .document-item, .join-gate) { background: #1b2d40; color: #bbcedc; border-color: var(--border); }
:root[data-theme="dark"] .lot-row:hover { background: #203649; }
:root[data-theme="dark"] :is(.lot-row, .user-row, .detail-tabs, .object-facts, .form-section, .form-divider, .report-summary > div, .committee-return, .upload-form, .comment, .inactive-users, .modal-heading, .investor-select, .role-select, .process-map-footer, .passport-details[open] > summary, .discussion-toolbar, .shared-discussion-hint) { border-color: var(--border); }
:root[data-theme="dark"] :is(.row-owner, .row-open, .toggle, .process-steps strong, .process-steps small, .object-description, .document-item small, .empty-inline, .selected-file, .comment-meta time, .timeline small, .timeline p, .inactive-users .user-row, .investor-select legend, .role-select legend, .login-story .brand > div > span, .business-story p, .login-story footer, .login-card > .eyebrow, .login-card > p, .login-note, .admin-workspace-link, .compact-route li button, .waiting-summary li p, .waiting-summary > p, .node-role, .node-owner, .node-status, .node-counts, .node-counts > span, .node-signature time, .node-signature.unsigned, .node-missing, .process-map-footer, .passport-details summary > span, .discussion-entry p, .shared-discussion-hint) { color: var(--muted); }
:root[data-theme="dark"] :is(.your-action, .node-missing b) { color: #a4d8db; }
:root[data-theme="dark"] .step-number { background: #23374a; color: #bdd1df; border-color: #506b7d; }
:root[data-theme="dark"] .process-steps .current .step-number { background: #087f82; color: #fff; border-color: #4ab3b5; }
:root[data-theme="dark"] .process-steps .done .step-number { background: #244d3e; color: #b0e3c1; border-color: #53816a; }
:root[data-theme="dark"] :is(.detail-tabs button.active, .compact-route li button:hover, .compact-route li button[aria-current="page"]) { background: #244648; color: #b1eae4; }
:root[data-theme="dark"] .detail-tabs button { color: #b2c4d1; }
:root[data-theme="dark"] :is(.next-panel, .final-decision, .notice) { background: #19382e; border-color: #446d5b; color: #b7e2c8; }
:root[data-theme="dark"] :is(.next-panel > p, .readiness, .readiness strong, .approved-limit span, .approved-limit strong, .approved-note, .final-decision > span, .final-decision strong, .final-decision p) { color: #b7e2c8; }
:root[data-theme="dark"] :is(.notice.error, .final-decision.rejected) { background: #3a262a; border-color: #8c5954; color: #ffb9af; }
:root[data-theme="dark"] :is(.final-decision.rejected strong, .final-decision.rejected p, .final-decision.rejected > span, .account-inline-error, .account-delete-photo) { color: #ffb9af; }
:root[data-theme="dark"] :is(.stage-reviews, .review-pending) { background: #3d3222; color: #f0d08d; }
:root[data-theme="dark"] .stage-director { background: #223d53; color: #acd5f1; }
:root[data-theme="dark"] .stage-committee { background: #342b4b; color: #d5c0f0; }
:root[data-theme="dark"] :is(.stage-approved, .review-approved) { background: #234637; color: #ace1bf; }
:root[data-theme="dark"] .stage-rejected { background: #432c2f; color: #ffb9af; }
:root[data-theme="dark"] .expert-profile { background: var(--surface); border-color: var(--border); color: #c5d9e6; }
:root[data-theme="dark"] .expert-profile.active { background: #1d3b3d; border-color: #61b9b4; }
:root[data-theme="dark"] .expert-profile em { color: var(--muted); }
:root[data-theme="dark"] .expert-profile.active .expert-icon { background: #285556; color: #b0e8df; }
:root[data-theme="dark"] .auction-limit { background: #1d3549; border-color: #426981; }
:root[data-theme="dark"] :is(.auction-limit > span, .auction-limit small, .auction-limit strong) { color: #b7dced; }
:root[data-theme="dark"] .document-item > button { color: #cebcb5; }
:root[data-theme="dark"] .document-item > button:hover { background: #463038; color: #ffd1bd; }
:root[data-theme="dark"] .document-item > .icon { color: #adcadb; }
:root[data-theme="dark"] .timeline li:before { background: #40586b; }
:root[data-theme="dark"] .timeline-dot { background: #85b3c8; }
:root[data-theme="dark"] .modal-backdrop { background: #030b15bb; }
:root[data-theme="dark"] .spinner { border-color: #3c596e; border-top-color: var(--primary); }
:root[data-theme="dark"] .login-story { background: #142638; color: var(--navy); }
:root[data-theme="dark"] .welcome-photo { background: #263d50; }
:root[data-theme="dark"] .login-symbol { background: #1c3d40; border-color: #4b7b7c; }
:root[data-theme="dark"] .waiting-summary li > span { color: #d0e4f0; }
:root[data-theme="dark"] .assignment-blocker { background: #3b3220; border-color: #806c43; color: #f0d398; }
:root[data-theme="dark"] .process-node { background: #192b3d; border-color: #3d566c; color: var(--navy); }
:root[data-theme="dark"] .process-node:hover { border-color: #80b4c1; box-shadow: 0 3px 12px #0002; }
:root[data-theme="dark"] .process-node.active { background: #18373b; border-color: #579997; box-shadow: inset 0 3px #6fbcba; }
:root[data-theme="dark"] .process-node.done { background: #19362c; border-color: #547b63; }
:root[data-theme="dark"] .process-node.rejected { background: #392a30; border-color: #8c5a57; }
:root[data-theme="dark"] :is(.done .node-status, .node-signature) { color: #b0e0c0; border-color: #436153; }
:root[data-theme="dark"] .active .node-status { color: #a0e0da; }
:root[data-theme="dark"] .rejected .node-status { color: #f4b8ac; }
:root[data-theme="dark"] .node-person-note { color: #e4c18a; }
:root[data-theme="dark"] :is(.node-signature.unsigned, .node-missing) { border-color: #425c6c; }
:root[data-theme="dark"] .node-analysis:after { background: #5f7a8c; }
:root[data-theme="dark"] .parallel-lane > h3 { background: var(--surface); color: #c3dce9; }
:root[data-theme="dark"] :is(.parallel-lane:before, .parallel-lane:after, .parallel-lane .process-node:before, .parallel-lane .process-node:after, .join-gate:before) { border-color: #5f7a8c; }
:root[data-theme="dark"] :is(.join-gate > span, .join-gate small, .join-gate:after, .sequential-lane > .process-node + .process-node:before) { color: #b3d1e1; border-color: #4d6679; }
:root[data-theme="dark"] .join-gate.ready { background: #1d3b2f; border-color: #517963; color: #b4e4c5; }
:root[data-theme="dark"] .join-gate.ready > span { color: #b4e4c5; }
:root[data-theme="dark"] .account-avatar-large { background: var(--teal-bg); color: var(--primary); }
:root[data-theme="dark"] :is(.account-theme-option:has(input:checked) small, .account-task:hover .account-task-meta, .account-task:hover .account-task-owner) { color: var(--muted); }
:root[data-theme="dark"] .account-task-state { background: #223649; color: #c2d5e1; }
:root[data-theme="dark"] .account-task-state.available { background: #3d3222; color: #f0d08d; }
:root[data-theme="dark"] .account-task-state.claimed { background: #234637; color: #ace1bf; }

@media (max-width: 1150px) {
  .account-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .account-profile-grid { grid-template-columns: 166px minmax(0, 1fr); }
  .account-theme-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .account-theme-option { align-items: flex-start; flex-wrap: wrap; }
  .account-theme-option > span:last-child { flex-basis: 100%; }
}
@media (max-width: 760px) {
  .account-task { align-items: flex-start; flex-direction: column; gap: 12px; padding: 16px; }
  .account-task-open { align-self: flex-end; min-height: 28px; }
  .account-theme-options { display: flex; }
  .account-theme-option { align-items: center; flex-wrap: nowrap; }
  .account-theme-option > span:last-child { flex-basis: auto; }
  .account-tasks .panel-heading { align-items: flex-start; flex-wrap: wrap; }
  :root[data-theme="dark"] .parallel-lane { background: #142638; border-color: #425c6c; }
  :root[data-theme="dark"] .parallel-lane > h3 { background: none; }
}
@media (max-width: 520px) {
  .account-profile-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .account-photo-column { border-bottom: 1px solid var(--border); padding-bottom: 20px; }
  .account-avatar-form { max-width: 250px; }
  .account-details-form > .button { width: 100%; }
  .account-theme-card form > .button { width: 100%; }
}
