/* Profiles, persistent inbox, country library and editorial workflow. */
.profile-button { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text); background: transparent; border: 1px solid var(--line); border-radius: 10px; padding: 5px 10px 5px 5px; }
.profile-avatar { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.avatar-initial { display: inline-grid; place-items: center; color: var(--accent); background: rgba(var(--accent-rgb),.14); font-size: .9rem; font-weight: 750; }
.profile-avatar.large { width: 72px; height: 72px; font-size: 2rem; }
.profile-heading { display: flex; align-items: center; gap: 20px; margin: 20px 0; }
.profile-heading h3 { margin: 0; font-size: 1.6rem; }
.profile-heading p { margin: 5px 0; color: var(--accent); }
.profile-rights { padding-left: 20px; color: var(--muted); line-height: 1.9; }
.profile-shortcuts, .inbox-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.export-exclusions { border: 1px solid var(--line); padding: 14px; border-radius: 10px; font-size: .85rem; line-height: 1.7; }
.export-exclusions summary, .export-group summary { cursor: pointer; }
.export-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.web-chat-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0; }
#import-preview[hidden] { display: none; }
#import-preview { display: grid; gap: 16px; min-width: 0; }
#import-changes { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .8rem; }
#import-source, #import-review-source { width: 100%; min-width: 0; font-family: ui-monospace, monospace; font-size: .78rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.export-tools span { color: var(--accent); font-size: .85rem; }
.export-groups { display: grid; gap: 10px; }
.export-group { min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 13px; }
.export-group summary { overflow-wrap: anywhere; line-height: 1.5; }
.export-group summary small { color: var(--muted); margin-left: 10px; }
.export-group .export-group-toggle { padding-top: 15px; }
.export-items { max-height: 260px; overflow-y: auto; display: grid; gap: 6px; padding-top: 10px; }
.export-item { min-width: 0; overflow-wrap: anywhere; }
.export-item[hidden], #export-preview[hidden] { display: none; }
#export-preview { display: grid; gap: 16px; border-top: 1px solid var(--line); padding-top: 18px; min-width: 0; }
#export-preview textarea { width: 100%; min-width: 0; font-family: ui-monospace, monospace; font-size: .78rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.statistics-summary { text-align: left; display: grid; gap: 7px; color: var(--muted); cursor: pointer; width: 100%; }
.statistics-summary strong { color: var(--text); font-size: .82rem; }
.statistics-summary small { color: var(--accent); }
.statistics-summary:hover { background: rgba(var(--accent-rgb),.07); }
html[data-interface="classic"] .statistics-summary { background: rgba(var(--accent-rgb),.025); }
html[data-interface="classic"] .statistics-summary:hover { background: rgba(var(--accent-rgb),.07); }
.statistics-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin: 24px 0 32px; }
.statistics-grid article { border: 1px solid var(--line); background: #0b1318; border-radius: 12px; padding: 18px; display: grid; gap: 7px; }
.statistics-grid strong { color: var(--accent); font-size: clamp(1.3rem,3vw,2rem); font-variant-numeric: tabular-nums; }
.statistics-grid span, .statistics-statuses p { color: var(--muted); font-size: .82rem; }
.statistics-table-wrap { overflow-x: auto; }
.statistics-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.statistics-table th, .statistics-table td { padding: 13px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.statistics-table thead { color: var(--dim); }
.statistics-statuses { display: grid; gap: 10px; }
.statistics-statuses section { padding: 14px; background: #0c151b; border-radius: 10px; }
.country-library { display: grid; gap: 22px; }
.country-library > input { padding: 13px 16px; border-radius: 10px; background: #0a1218; border: 1px solid var(--line); color: var(--text); }
.country-library-toggle span { color: var(--dim); margin-left: 5px; }
.country-library-shortcut { border-left: 1px solid var(--line); margin-left: 4px; min-width: 30px; }
.country-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(180px,1fr)); gap: 13px; }
.country-card { display: grid; gap: 10px; border: 1px solid var(--line); padding: 16px; background: #0c151b; border-radius: 14px; }
.country-card.active { border-color: var(--accent); }
.country-open { display: grid; justify-items: start; gap: 10px; border: 0; background: transparent; color: var(--text); text-align: left; }
.country-open small { color: var(--dim); }
.country-mark { width: 42px; height: 42px; display: grid; place-items: center; color: var(--country-color); border: 1px solid currentColor; border-radius: 13px; font-size: 1.3rem; }
.country-mark-image { width: 64px; height: 64px; padding: 5px; background: rgba(var(--accent-rgb),.025); overflow: hidden; }
.country-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.country-create { border-top: 1px solid var(--line); padding-top: 20px; }
.notification-widget { position: fixed; right: 22px; bottom: 90px; z-index: 71; }
/* Open panels must cover inactive floating buttons in both visual themes. */
.assistant-widget:has(.assistant-panel.open) { z-index: 72; }
.notification-widget:has(.notification-panel.open) { z-index: 73; }
.notification-orb { position: relative; width: 56px; height: 56px; border: 1px solid var(--line-strong); border-radius: 50%; display: grid; place-items: center; background: #111f25; color: var(--accent); box-shadow: 0 12px 35px #0005; cursor: pointer; transition: background calc(180ms * var(--motion-tempo)), transform calc(180ms * var(--motion-tempo)); }
.notification-orb:hover { background: #1b3035; transform: translateY(calc(-2px * var(--motion-intensity))); }
.notification-orb svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notification-orb span:not([hidden]):not(:empty) { position: absolute; top: -3px; right: -3px; min-width: 21px; height: 21px; border-radius: 12px; display: grid; place-items: center; padding: 0 4px; background: var(--accent); color: var(--accent-on); font-size: .7rem; font-weight: 750; }
.notification-widget .notification-panel { top: auto; right: 68px; bottom: 0; width: min(450px,calc(100vw - 110px)); max-height: min(720px,calc(100dvh - 120px)); padding: 19px; border-radius: 18px; background: #0c151bf9; overscroll-behavior: contain; }
.notification-panel header { display: flex; align-items: center; justify-content: space-between; }
.notification-panel h3, .notification-panel h4 { margin: 0; }
.notification-panel .editor-note { font-size: .77rem; margin: 0; }
.notification-item { background: #101c22; }
.notification-item.unread { border-left: 3px solid var(--accent); }
.notification-item.read { opacity: .76; }
.notification-item small { color: var(--dim); font-size: .72rem; }
.notification-item p { margin: 0; font-size: .84rem; overflow-wrap: anywhere; }
.notification-item pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow-y: auto; font-size: .76rem; background: #080e12; padding: 12px; border-radius: 8px; }
.notification-actions { flex-wrap: wrap; }
.notification-actions button { font-size: .75rem; }
.site-toast { position: fixed; z-index: 180; left: 50%; bottom: 25px; transform: translateX(-50%); max-width: min(600px,calc(100vw - 40px)); border: 1px solid var(--accent); border-radius: 13px; padding: 16px 21px; color: var(--text); background: #122128; box-shadow: 0 15px 50px #0008; font-size: .88rem; line-height: 1.6; }
.site-toast.error { border-color: #ec9797; }
.editor-recovery { border: 1px solid rgba(var(--accent-rgb),.22); background: rgba(var(--accent-rgb),.045); border-radius: 12px; padding: 12px 15px; display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.editor-recovery span, .editor-recovery small { font-size: .78rem; color: var(--dim); }
.editor-recovery .editor-presence:not(:empty) { width: 100%; color: #efc97b; }
.editor-recovery small { width: 100%; }
.recovery-text { width: 100%; padding: 15px; color: var(--text); background: #091217; border: 1px solid var(--line); border-radius: 10px; }
.assistant-evidence { margin-top: 12px; border: 1px solid var(--line); background: transparent; color: var(--accent); padding: 6px 10px; border-radius: 8px; font-size: .72rem; }
.evidence-card { margin: 16px 0; padding: 20px; background: #0a141a; border: 1px solid var(--line); border-radius: 12px; }
.evidence-card h3 { font-size: 1rem; }
.evidence-card blockquote { white-space: pre-wrap; line-height: 1.8; margin: 14px 0; padding-left: 14px; border-left: 2px solid var(--accent); color: var(--muted); }
@media (max-width: 760px) {
  .notification-widget { right: 14px; bottom: 82px; }
  .notification-widget .notification-panel { right: 0; bottom: 68px; width: calc(100vw - 28px); max-height: calc(100dvh - 175px); }
  .statistics-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .statistics-grid article { padding: 14px; }
  .profile-button { max-width: 260px; }
  .profile-button > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) { .notification-orb, .notification-panel.open { animation: none; transition: none; transform: none; } }

/* Functional rules belong to both interfaces, not to a visual theme. */
.page-context { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 21px; color: var(--dim); font-size: .72rem; }
.page-context span + span::before { content: "·"; margin-right: 12px; color: var(--accent); }
.assistant-panel.open { grid-template-rows: auto auto minmax(0,1fr) auto auto; }
.assistant-phase { display: block; margin-top: 7px; color: var(--dim); font-size: .75rem; }
.assistant-stop { display: none; }
.assistant-form.generating .assistant-stop { display: block; background: transparent; color: var(--danger); border: 1px solid var(--line); }
.assistant-form.generating button[type="submit"] { display: none; }
.assistant-messages { overflow-anchor: none; }
.content > *, .quick-grid > *, .card-grid > *, .meta-grid > *, .timeline-list > *, .term-grid > *, .archive-grid > * { animation: none; }
:is(a, button, input, select, textarea):focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.user-admin { display: grid; gap: 16px; min-width: 0; }
.user-admin p { margin: 0; overflow-wrap: anywhere; }
.user-admin label { display: grid; gap: 8px; }
.user-admin input { min-width: 0; width: 100%; box-sizing: border-box; padding: 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: var(--panel, #0b1419); }
#user-admin-list { display: grid; gap: 12px; }
.user-admin-card { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.user-admin-card header, .user-admin-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.user-admin-card header strong { overflow-wrap: anywhere; min-width: 0; }
.user-admin-card header span, .user-admin-card small { color: var(--dim); }
.user-admin-actions button { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 600px) { .user-admin-actions { display: grid; grid-template-columns: minmax(0, 1fr); } }
