/* Real server controls added to the approved prototype components. */
body { overflow-x: visible; }
.ui-icon { width: 20px; height: 20px; flex: 0 0 auto; display: inline-block; vertical-align: middle; }
a.card-save { color: var(--text); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
select, textarea { font: inherit; color: inherit; }
select, textarea, .ui-form input:not([type=hidden],[type=checkbox]), .ui-form select, .ui-form textarea { min-height: 44px; max-width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-strong); padding: 10px 12px; color: var(--text); }
input[type=checkbox], input[type=radio], input[type=range], progress { accent-color: var(--accent); }
.ui-form { display: grid; gap: 12px; margin-block: 16px; }
.ui-form label { display: grid; gap: 8px; min-width: 0; }
.ui-form textarea { width: 100%; resize: vertical; }
.ui-check, .ui-inline-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.ui-check { min-height: 44px; }
.ui-inline-actions > form { margin: 0; }
.ui-error, .ui-feedback { padding: 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); overflow-wrap: anywhere; }
.ui-error { color: #ffb4a9; }
.ui-feedback { margin-block: 12px; }
.ui-pagination { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 20px; color: var(--muted); }
.ui-pagination > div { display: flex; flex-wrap: wrap; gap: 10px; }
.ui-pagination a[aria-busy=true] { opacity: .6; cursor: wait; }
.account-menu { position: relative; min-width: 0; }
.account-menu > summary { cursor: pointer; max-width: 145px; overflow-wrap: anywhere; }
.account-menu > div { position: absolute; right: 0; top: calc(100% + 8px); width: 240px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.account-menu a, .mobile-account a { display: block; padding: 12px; color: var(--text); text-decoration: none; }
.mobile-account { display: none; }
.profile-dialog { width: min(480px,calc(100% - 32px)); padding: 24px; max-height: calc(100dvh - 32px); border: 1px solid var(--line-strong); border-radius: 18px; background: var(--surface); color: var(--text); }
dialog::backdrop { background: #020b10ce; }
.dialog-heading { display: flex; align-items: start; gap: 16px; justify-content: space-between; }
.dialog-heading h2 { overflow-wrap: anywhere; font-size: 23px; margin-top: 0; }
.profile-avatar { overflow: hidden; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; transform: translate(var(--avatar-offset-x),var(--avatar-offset-y)); }
.profile-comment, .ui-achievement { padding: 20px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.profile-comment header { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.profile-comment p { white-space: pre-wrap; line-height: 1.6; }
.profile-comment a, .profile-about a { color: var(--accent-pale); }
.profile-about { padding: 24px; }
.library-tools { flex-wrap: wrap; }
.filter-actions { display: grid; gap: 8px; }
.filter-label { display: grid; gap: 8px; margin-block: 14px; }
.applied-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-block: 12px; }
.applied-filters > span { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.filters-dialog { width: min(420px,calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 18px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.filters-dialog .catalog-filters { display: block; border: 0; padding: 8px 0; }
.ui-filter-close { width: 100%; margin-bottom: 12px; }
.detail-sidebar .ui-form { margin-block: 14px; }
a.chapter-row, a.update-chapter { color: inherit; text-decoration: none; }
.ui-count { display: inline-block; padding: 2px 6px; border-radius: 8px; background: var(--accent); color: #142128; font-weight: 700; }
.detail-reviews { grid-column: 1; padding-top: 24px; border-top: 1px solid var(--line); }
.detail-description { white-space: pre-line; }
.settings-workspace .settings-warning { margin: 16px 24px; }
.settings-field input[type=range] { width: 100%; min-height: 44px; }
.settings-field input[type=color] { width: 64px; height: 44px; background: transparent; border: 1px solid var(--line); border-radius: 10px; }
.settings-field output { color: var(--muted); font-size: 14px; font-weight: 400; white-space: nowrap; }
.settings-theme b { overflow-wrap: anywhere; }
.profile-example-avatar { overflow: hidden; }
.profile-example-avatar img { width: 100%; height: 100%; object-fit: cover; }
body:not([data-site-theme=kage]) :is(.header-inner,.title-card,.detail-hero,.detail-sidebar,.settings-panel,.settings-sidebar,.settings-savebar,.profile-content,.profile-resume,.update-group,.catalog-filters,.profile-dialog) { background: var(--surface); }
body:not([data-site-theme=kage]) :is(.hero-description,.detail-pitch,.detail-about > p,.detail-nav a) { color: var(--text); }
body:not([data-site-theme=kage]) .hero { background: linear-gradient(100deg,var(--surface),var(--bg)); }
body[data-site-theme=paper] { color-scheme: light; }
body[data-site-theme=paper] .button.primary { color: white; background: var(--accent); }
body[data-site-theme=paper] :is(.search,.card-save,.card-cta,.rail-nav button,select,textarea,.settings-field input) { background: #e4ece7; }
body[data-ui-density=airy] :is(.card-open,.profile-row) { padding-block: 20px; }
body[data-ui-motion=soft] * { animation-duration: 150ms !important; transition-duration: 100ms !important; }
body[data-ui-motion=minimal] *, body[data-ui-motion=minimal] *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
body[data-ui-grid=off] { background-image: none; }
body[data-ui-density=compact] .title-card .card-open { padding: 8px; }
body[data-ui-density=compact] .profile-row { padding-block: 8px; }
@media (max-width: 1340px) {
 .settings-page .header-inner { grid-template-columns: auto 1fr auto; }
}
@media (max-width: 760px) {
 .settings-page .header-inner { grid-template-columns: minmax(0,1fr) auto; }
 .header-inner .account-actions { display: none; }
 .main-nav.is-open { max-width: calc(100vw - 32px); max-height: calc(100dvh - 96px); overflow-y: auto; }
 .mobile-account { display: grid; border-top: 1px solid var(--line); }
 .header-inner > .search.is-open { display: flex; grid-column: 1 / -1; grid-row: 2; }
 .ui-pagination { padding: 16px 8px; }
 .ui-pagination > div { width: 100%; }
 .ui-pagination .button { flex: 1; }
}
