/* Archifact — Royal Blue. Functional color tokens, independent of layout. */
:root {
  --color-canvas: #ffffff;
  --color-surface: #ffffff;
  --color-surface-raised: #ffffff;
  --color-surface-subtle: #f7f7f7;
  --color-surface-hover: #f1f3f5;
  --color-surface-selected: #eaf1ff;
  --color-text: #34373b;
  --color-text-strong: #202124;
  --color-text-secondary: #555b62;
  --color-text-muted: #6b7076;
  --color-text-placeholder: #6f747b;
  --color-border: #dfe2e5;
  --color-border-subtle: #eceeef;
  --color-border-input: #8d949c;
  --color-rule-strong: #555b62;
  --color-action: #2054cc;
  --color-action-hover: #1945af;
  --color-action-pressed: #14388f;
  --color-on-action: #ffffff;
  --color-link: #204fb5;
  --color-focus: #3573e8;
  --color-disabled-bg: #eff0f1;
  --color-disabled-text: #777d85;
  --color-accent: #8b785e;
  --color-accent-soft: #eee9df;
  --color-success: #3d6559;
  --color-success-soft: #eaf0e9;
  --color-warning: #795c32;
  --color-warning-soft: #f5efe3;
  --color-danger: #913f40;
  --color-danger-soft: #f6ebea;
  --color-mine: #edf3ff;
  --color-mine-border: #8baef0;
  --color-overlay: rgba(22, 35, 58, .48);
  --shadow-surface: 0 2px 12px rgba(32, 59, 105, .025);
  --shadow-floating: 0 12px 38px rgba(32, 59, 105, .13);
  /* Compatibility for existing components. */
  --deep-blue: var(--color-action);
  --sidebar-logo-muted: var(--color-text-strong);
  --text-main: var(--color-text);
  --surface-white: var(--color-surface-raised);
  --soft-gray: var(--color-surface-subtle);
  --sidebar-bg: var(--color-surface-subtle);
  --line-gray: var(--color-border-subtle);
  --border-soft: var(--color-border);
  --focus-ring: 0 0 0 3px rgba(36, 95, 229, .18);
}
body.archifact-theme { background: var(--color-canvas); color: var(--color-text); }
.archifact-theme ::selection { background: var(--color-surface-selected); color: var(--color-text-strong); }
.archifact-theme a { color: var(--color-link); }
.archifact-theme :is(h1,h2,h3,h4,.field-label) { color: var(--color-text-strong); }
.archifact-theme :is(input,textarea,select) { color: var(--color-text); background-color: var(--color-surface-raised); border-color: var(--color-border-input); accent-color: var(--color-action); }
.archifact-theme :is(input,textarea)::placeholder { color: var(--color-text-placeholder); opacity: 1; }
.archifact-theme :is(button,a,input,textarea,select,summary):focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
.archifact-theme :is(input,textarea,select):focus { border-color: var(--color-focus); box-shadow: var(--focus-ring); }

/* Identity, navigation and search: restrained navy, no active underline. */
.theme-community .community-wordmark,
.theme-community .community-wordmark strong,
.theme-community .community-wordmark .wordmark-korean { color: var(--color-text-strong); }
.theme-community .community-wordmark :is(.wordmark-tagline,.wordmark-description) { color: var(--color-text-muted); }
.theme-community .portal-nav { background: var(--color-surface); border-color: var(--color-border); box-shadow: var(--shadow-surface); }
.theme-community .portal-nav .menu-btn { color: var(--color-text-secondary); }
.theme-community .portal-nav .menu-btn.active { color: var(--color-action); background: transparent; box-shadow: none; }
.theme-community .portal-nav .menu-btn:hover { color: var(--color-action); background: var(--color-surface-subtle); }
.theme-community .hero-search-input { background: var(--color-surface-raised); color: var(--color-text); border-color: var(--color-border-input); }
.theme-community .hero-search-btn { background: var(--color-action); color: var(--color-on-action); border-color: var(--color-action); }
.theme-community .hero-search-btn:hover { background: var(--color-action-hover); }
.theme-community .header-search-options { color: var(--color-text-secondary); }
.theme-community .header-search-options .search-options { background: var(--color-surface-raised); border-color: var(--color-border); box-shadow: var(--shadow-floating); }
.theme-community :is(.question-board-links,.reading-post .post-board-nav) { border-color: var(--color-rule-strong); }
.theme-community :is(.question-board-links a,.post-board-nav a) { color: var(--color-text-strong); border-color: var(--color-border-subtle); }
.theme-community :is(.question-board-links a:hover,.post-board-nav a:hover,.post-board-nav a[aria-current="page"]) { background: var(--color-surface-selected); color: var(--color-action); }
.theme-community .question-board-links .topic-hover-example { color: var(--color-text-secondary); border-color: var(--color-border); }
.theme-community .question-board-links .topic-hover-example small { color: var(--color-text-muted); }

/* Community boards retain their existing geometry and row rhythm. */
.theme-community .topic-board { background: var(--color-surface); border-color: var(--color-border); box-shadow: var(--shadow-surface); }
.theme-community .topic-board-header { border-top-color: var(--color-border); }
.theme-community .topic-board-header h3 { color: var(--color-text-strong); }
.theme-community .topic-board-header .topic-heading p { color: var(--color-text-secondary); }
.theme-community :is(.topic-list-heading,.topic-list-heading button) { color: var(--color-text-muted); }
.theme-community .topic-list-heading b { color: var(--color-link); }
.theme-community .topic-posts { background: transparent; border-color: var(--color-border-subtle); }
.theme-community .topic-posts .latest-item { border-color: var(--color-border-subtle); }
.theme-community :is(.latest-item:hover,.board-table tbody tr:hover) { background: var(--color-surface-hover); }
.theme-community :is(.topic-posts .post-title-btn,.board-table .post-title-btn) { color: var(--color-text); }
.theme-community :is(.topic-posts .post-title-btn:hover,.board-table .post-title-btn:hover) { color: var(--color-link); }
.theme-community .topic-posts .latest-item-date { color: var(--color-text-muted); }
.theme-community .topic-ask { background: var(--color-surface-subtle); color: var(--color-action); border-color: var(--color-border); }
.theme-community .topic-ask:hover { background: var(--color-surface-selected); }
.theme-community .title-meta { background: var(--color-action-hover); color: var(--color-on-action); }
.theme-community .title-meta.is-empty { background: #858a91; color: #fff; }
.theme-community :is(.new-badge,.post-new) { background: var(--color-success-soft); color: var(--color-success); }
.theme-community :is(.board-section,.member-activity-panel,.post-modal,.write-panel.open,.post-edit-form) { background: var(--color-surface); border-color: var(--color-border); box-shadow: var(--shadow-surface); }
.theme-community #homeCommunitySection:not([hidden]) ~ #integratedBoard { background: transparent; box-shadow: none; }
.theme-community :is(.board-wrap,.site-footer) { background: transparent; }
.theme-community .board-header { border-color: var(--color-border); }
.theme-community :is(.board-title,.latest-card-title,.post-modal-title) { color: var(--color-text-strong); }
.theme-community :is(.board-subtitle,.board-sort-note,.post-meta,.post-edit-note,.member-activity-caption,#memberActivityStatus) { color: var(--color-text-muted); }
.theme-community .board-table { border-color: var(--color-border); }
.theme-community .board-table th { background: var(--color-surface-subtle); color: var(--color-text-secondary); border-color: var(--color-border); }
.theme-community .board-table td { color: var(--color-text-muted); border-color: var(--color-border-subtle); }
.theme-community .post-subcategory-tag { background: var(--color-surface-selected); color: var(--color-text-secondary); }

/* Account panel, tools and main actions. Provider brand colors stay intact. */
.theme-community :is(.portal-login,.portal-login.is-member) { background: var(--color-surface); border-color: var(--color-border); box-shadow: var(--shadow-surface); }
.theme-community .portal-login.is-member { border-top-color: var(--color-rule-strong); }
.theme-community :is(.portal-login.is-member h2,.member-identity,.member-activity-links) { border-color: var(--color-border-subtle); }
.theme-community .member-identity #welcomeText { color: var(--color-text-strong); }
.theme-community .member-avatar { background: var(--color-surface-selected); color: var(--color-text-muted); }
.theme-community .member-identity .member-avatar:hover { background: var(--color-surface-hover); }
.theme-community :is(.member-joined,.member-verification-status,.portal-login p,.password-help,.member-grade-row>span) { color: var(--color-text-muted); }
.theme-community :is(.member-grade-row .member-category-label,.member-activity-links strong,.member-activity-links button,.account-actions button,.account-actions a) { color: var(--color-link); }
.archifact-theme :is(.auth-btn,.ghost-btn,.write-cancel-btn,.mini-btn,.page-btn,.search-clear,.expert-entry,.quick-tools button,.quick-tool-dialog button,.media-preview button) { background: var(--color-surface-raised); color: var(--color-text-secondary); border-color: var(--color-border-input); }
.archifact-theme :is(.auth-btn:hover,.ghost-btn:hover,.write-cancel-btn:hover,.mini-btn:hover,.page-btn:hover,.search-clear:hover,.expert-entry:hover,.quick-tools button:hover,.quick-tool-dialog button:hover) { background: var(--color-surface-hover); color: var(--color-action); border-color: var(--color-focus); }
.archifact-theme :is(.write-btn,.sidebar-write,#openLoginBtn,.auth-btn.primary,.page-btn.active,.quick-tool-dialog .tool-primary) { background: var(--color-action); color: var(--color-on-action); border-color: var(--color-action); }
.archifact-theme :is(.write-btn:hover,.sidebar-write:hover,#openLoginBtn:hover,.auth-btn.primary:hover,.quick-tool-dialog .tool-primary:hover) { background: var(--color-action-hover); color: var(--color-on-action); border-color: var(--color-action-hover); }
.archifact-theme :is(.write-btn:active,.sidebar-write:active,.hero-search-btn:active) { background: var(--color-action-pressed); }
.theme-community .sidebar-write:disabled,.theme-community .sidebar-write:disabled:hover,
.archifact-theme :is(.write-btn:disabled,.sidebar-write:disabled,.auth-btn:disabled,.mini-btn:disabled,#editOwnPost:disabled) { background: var(--color-disabled-bg); color: var(--color-disabled-text); border-color: var(--color-border); box-shadow: none; }
.theme-community :is(.post-success-toast,.quick-tool-body output) { color: var(--color-action); }
.theme-community .post-success-toast { background: var(--color-action); color: var(--color-on-action); box-shadow: var(--shadow-floating); }

/* Reading and writing: paper surface, quiet metadata, a distinct tint for mine. */
.theme-community :is(.post-content,.post-modal-content,.comment-item,.building-overview-editor) { background: transparent; color: var(--color-text); border-color: var(--color-border-subtle); }
.theme-community .post-page.is-mine .post-modal-head { background: var(--color-mine); border-color: var(--color-border); }
.theme-community :is(.post-modal-header,.post-meta,.comment-head-row,.comment-empty,.comment-media-composer) { border-color: var(--color-border-subtle); }
.theme-community .comment-main { background: var(--color-surface-subtle); }
.theme-community .comment-item.is-mine .comment-main { background: var(--color-mine); box-shadow: inset 3px 0 var(--color-mine-border); }
.theme-community .comment-item.is-mine .comment-avatar { color: var(--color-mine-border); }
.theme-community .comment-avatar { color: var(--color-border-input); }
.theme-community :is(.comment-author,.comment-body) { color: var(--color-text); }
.theme-community :is(.comment-meta,.comment-tool-btn,.comment-empty,.comment-length-hint,.comment-edit-hint,#commentMediaHelp,#commentMediaStatus,.modal-reply-disclaimer) { color: var(--color-text-muted); }
.theme-community :is(.own-content-label,.response-kind-label) { background: var(--color-surface-selected); color: var(--color-link); }
.theme-community .comment-owner-label { background: var(--color-success-soft); color: var(--color-success); }
.theme-community .comment-just-added .comment-main { outline-color: var(--color-mine-border); }
.theme-community .comment-input[readonly] { background: var(--color-surface-subtle); color: var(--color-text-muted); }
.theme-community :is(.post-media-composer,.post-building-overview,.media-preview,.attachment-block) { background: var(--color-surface-subtle); border-color: var(--color-border); }
.theme-community :is(.post-media-composer input,.post-edit-form input,.post-edit-form textarea,#memberNickname,#verificationForm input,#verificationForm select,#buildingOverviewFields input) { background: var(--color-surface-raised); border-color: var(--color-border-input); color: var(--color-text); }
.theme-community #buildingOverviewFields input::placeholder { color: var(--color-text-placeholder); }
.theme-community #buildingOverviewFields input:focus { border-color: var(--color-focus); outline-color: var(--color-focus); }
.theme-community :is(.overview-help,.overview-field>label,.overview-label,.overview-label-hint,.overview-unit span,.overview-field small,#postMediaHelp,.post-media-gallery figcaption,.post-building-overview dt) { color: var(--color-text-muted); }
.theme-community :is(.overview-help strong,#postMediaStatus,.post-building-overview dd,.submission-status,.search-result-status,.quick-auth-status) { color: var(--color-link); }
.theme-community :is(.write-panel-notice,.connection-notice,.compose-lock-note) { background: var(--color-warning-soft); border-color: var(--color-accent); color: var(--color-warning); }
.theme-community .write-panel-notice-text { color: var(--color-warning); }
.theme-community .write-panel-notice a { color: var(--color-link); }
.theme-community :is(.muted,.quick-auth-note,.quick-auth-intro,.member-type-help,.verification-help,.verification-footer,.verification-process,.verification-intro,.verification-eyebrow) { color: var(--color-text-muted); }

/* Dialogs and membership: preserve the general/practitioner white choices. */
.archifact-theme :is(.auth-modal,.verification-modal,.quick-tool-dialog,.site-guide-dialog) { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border); box-shadow: var(--shadow-floating); }
.archifact-theme :is(.auth-modal-overlay,.modal-overlay) { background-color: var(--color-overlay); }
.archifact-theme :is(.quick-tool-dialog,.site-guide-dialog)::backdrop { background: var(--color-overlay); }
.theme-community :is(.auth-modal-header,.site-guide-header,.quick-tool-dialog header,.verification-footer,.verification-process,.auth-alternatives) { border-color: var(--color-border-subtle); }
.theme-community .auth-divider { color: var(--color-text-muted); }
.theme-community .auth-divider::before,.theme-community .auth-divider::after { background: var(--color-border); }
.theme-community .member-type-choices span { color: var(--color-text-secondary); background: var(--color-surface-raised); border-color: var(--color-border-input); }
.theme-community .member-type-choices [data-requires-verification=true] span,
.theme-community #openExpertVerification { background: var(--color-surface-selected); color: var(--color-action); border-color: var(--color-mine-border); }
.theme-community .member-type-choices input:checked+span { color: var(--color-action); border-color: var(--color-action); background: var(--color-surface-selected); }
.theme-community .member-type-choices input:is([value=general],[value=practitioner])+span { background: var(--color-surface-raised); }
.theme-community .expert-badge { color: var(--color-action); background: var(--color-surface-selected); border-color: var(--color-mine-border); }
.theme-community .expert-badge[data-group=practitioner] { color: var(--color-success); background: var(--color-success-soft); border-color: var(--color-success); }
.theme-community .verification-choices button { background: var(--color-surface-raised); border-color: var(--color-border-input); color: var(--color-text-strong); }
.theme-community .verification-choices button[aria-pressed=true] { background: var(--color-surface-selected); border-color: var(--color-action); }
.theme-community .verification-choices button[data-verification-group=practitioner][aria-pressed=true] { background: var(--color-success-soft); border-color: var(--color-success); }
.theme-community .verification-choices :is(span,small) { color: var(--color-text-secondary); }
.theme-community .verification-status { color: var(--color-link); }
.theme-community :is(#accountNotice,#postEditStatus) { color: var(--color-danger); }
.theme-community #deletePostBtn { color: var(--color-danger); background: var(--color-danger-soft); border-color: var(--color-danger); }
.archifact-theme :is(.site-footer,.footer-links a,.footer-contact,.site-footer-disclaimer,.legal-foot) { color: var(--color-text-muted); border-color: var(--color-border); }
.archifact-theme :is(.footer-links strong,.site-guide-copy h3,.site-guide-header h2) { color: var(--color-text-strong); }

/* Supporting pages use the same semantic palette. */
.theme-admin :is(header,aside,.stat,.list-panel,.detail-panel,.metric-card,#gate),
.theme-reset main { background: var(--color-surface); border-color: var(--color-border); }
.theme-admin :is(button,input,select,textarea) { color: var(--color-text); background: var(--color-surface-raised); border-color: var(--color-border-input); }
.theme-admin button:hover { background: var(--color-surface-hover); }
.theme-admin :is(.primary,.primary:hover),.theme-reset button { background: var(--color-action); color: var(--color-on-action); border-color: var(--color-action); }
.theme-admin .primary:hover,.theme-reset button:hover { background: var(--color-action-hover); }
.theme-admin :is(aside .active,tr.selected) { background: var(--color-surface-selected); color: var(--color-action); }
.theme-admin :is(.brand,.stat strong,td button),.theme-reset .brand { color: var(--color-text-strong); }
.theme-admin :is(th,.operations-summary span,.badge) { background: var(--color-surface-subtle); color: var(--color-text-secondary); }
.theme-admin :is(td,.pager,.activity li,.suspension-details,#searchForm) { border-color: var(--color-border-subtle); }
.theme-admin :is(td small,.stat span,.page-title p,.nav-group,.empty,.pager>span:first-child,.detail-grid dt) { color: var(--color-text-muted); }
.theme-admin .approved { background: var(--color-success-soft); color: var(--color-success); }
.theme-admin .pending { background: var(--color-warning-soft); color: var(--color-warning); }
.theme-admin :is(.suspended,.suspension-form) { background: var(--color-danger-soft); color: var(--color-danger); border-color: var(--color-danger); }
.theme-admin :is(.suspension-alert,#status) { color: var(--color-danger); }
.theme-admin #metricsChart :is(polyline,circle) { stroke: var(--color-action-hover); }
.theme-admin #metricsChart circle { fill: var(--color-action-hover); }
.theme-admin #metricsChart line { stroke: var(--color-border); }
.theme-admin #metricsChart text { fill: var(--color-text-muted); }
.legal-page.archifact-theme :is(.legal-notice,.legal-contact-box) { background: var(--color-surface-subtle); border-color: var(--color-border); }
.legal-page.archifact-theme :is(.legal-section,.legal-table-wrap,.legal-nav,.legal-table td) { border-color: var(--color-border); }
.legal-page.archifact-theme .legal-header { border-color: var(--color-action); }
.legal-page.archifact-theme :is(.legal-section h2,.legal-section h3,.legal-contact-box strong) { color: var(--color-text-strong); }
.legal-page.archifact-theme .legal-table th { background: var(--color-surface-selected); color: var(--color-text-secondary); }
.theme-reset :is(p,small,.back) { color: var(--color-text-secondary); }
@media print { body.archifact-theme { background: white; color: black; } }

/* Neutral account navigation; blue remains the actionable accent. */
.theme-community :is(.member-activity-links button,.account-actions button,.account-actions a){color:var(--color-text-secondary)}
.theme-community :is(.member-activity-links button:hover,.account-actions button:hover,.account-actions a:hover){color:var(--color-link)}

/* Optional context for firsthand replies. */
.response-experience-fields { margin: 10px 0 14px; padding: 0; border: 0; min-width: 0; }
.response-experience-fields legend { padding: 0; font-size: 12px; font-weight: 600; color: var(--color-text-secondary); }
.response-experience-fields legend span,.response-experience-row small { font-weight: 400; color: var(--color-text-muted); }
.response-experience-help { margin-left: 8px; font-size: 12px; color: var(--color-text-muted); }
.response-experience-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.response-experience-row label { min-width: 0; font-size: 12px; color: var(--color-text-secondary); }
.archifact-theme .response-experience-row input { display: block; box-sizing: border-box; width: 100%; min-width: 0; margin-top: 4px; padding: 7px 9px; font-size: 12px; border: 1px solid var(--color-border); border-radius: 5px; background: var(--color-surface); }
.response-experience-summary { margin: 8px 0 0; color: var(--color-text-muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
@media (max-width: 480px) { .response-experience-row { grid-template-columns: 1fr; gap: 7px; } }

/* Compact reply composer: instructions stay beside their controls. */
.comment-length-hint { justify-content: flex-end; }
.response-experience-fields legend { margin-bottom: 8px; line-height: 1.6; }
.comment-media-composer:not([hidden]) { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.comment-media-composer > label { margin: 0; }
#commentMediaInput { width: 190px; min-width: 0; }
#commentMediaHelp { margin: 0; flex: 1 1 300px; }
#commentMediaPreviews, #commentMediaStatus { flex-basis: 100%; }
#commentMediaPreviews:empty { display: none; }


/* Wordmark: enlarged lettering with fine architectural hatching. */
.theme-community .community-wordmark { display: inline-grid; gap: 0; }
.theme-community .community-wordmark strong { font-size: 44px; line-height: 1.12; letter-spacing: -1.5px; white-space: nowrap; }
.theme-community .community-wordmark .wordmark-hatched { display: inline; margin: 0; padding: 0; border: 0; font: inherit; letter-spacing: inherit; color: var(--color-text-strong); }
@supports (background-clip: text) or (-webkit-background-clip: text) {
 .theme-community .community-wordmark .wordmark-hatched { background: repeating-linear-gradient(135deg, #202124 0, #202124 1.2px, #85898f 1.2px, #85898f 2.8px); background-clip: text; -webkit-background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
}
.theme-community .community-wordmark .wordmark-description { width: 0; min-width: 100%; white-space: nowrap; text-align: left; text-align-last: auto; }
@media (max-width: 760px) { .theme-community .community-wordmark strong { font-size: 39px; } }

.theme-community .community-wordmark .wordmark-tagline { position: relative; top: 4px; margin: 0 0 -3px; font-size: 13px; line-height: 1; }

/* Separate new contributions from the preceding conversation. */
.theme-community .comment-item.is-mine .comment-main { background: #f6f8fd; box-shadow: inset 3px 0 #b8cbee; }
.theme-community .comment-form { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--color-border); }
.theme-community .comment-composer-title { margin: 0 0 12px; color: var(--color-text-strong); font-size: 15px; font-weight: 700; line-height: 1.5; }
.theme-community .comment-input { background: #fff; border-color: #a5b4cc; box-shadow: 0 1px 3px rgba(32, 55, 90, .05); }
.theme-community .comment-input:focus-visible { border-color: var(--color-action); outline: 2px solid #dce7fb; outline-offset: 2px; }
@media (max-width: 480px) { .theme-community .comment-form { margin-top: 22px; padding-top: 16px; } }

/* Login is a neutral secondary action beside the blue writing button. */
.theme-community #openLoginBtn { background: #62686f; border-color: #62686f; color: #fff; }
.theme-community #openLoginBtn:hover { background: #50565d; border-color: #50565d; color: #fff; }
.theme-community #openLoginBtn:active { background: #42484f; border-color: #42484f; }

.theme-community .portal-nav .menu-list { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 400px) { .theme-community .portal-nav { padding-left: 6px; padding-right: 6px; } .theme-community .portal-nav .menu-btn { font-size: 11px; } }

.theme-community .expert-reply-label { display: inline-block; margin-left: 5px; font-size: 11px; font-weight: 700; color: var(--color-action); white-space: nowrap; }
