/* Sidebar preferences affect the frame without re-rendering the working page. */
.sidebar { padding: 12px; overflow: hidden; }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; margin-bottom: 12px; flex-shrink: 0; }
.sidebar-heading .sidebar-label { margin: 0 0 0 8px; font-size: 14px; }
.sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 48px; width: 48px; height: 48px; padding: 12px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; }
.sidebar-toggle:hover { background: var(--green-soft); color: var(--green); }
.sidebar nav { min-height: 0; overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; margin-bottom: 12px; }
.sidebar-footer { flex-shrink: 0; }
.sidebar .nav-item { flex-shrink: 0; }
.sidebar .sidebar-footer .sidebar-settings, .sidebar .sidebar-footer .sidebar-logout { width: 100%; justify-content: flex-start; gap: 12px; padding: 11px 12px; }
.sidebar-settings { color: var(--muted); }
.sidebar .nav-icon, .sidebar .sidebar-footer .icon { flex-shrink: 0; }
.sidebar-copy { min-width: 0; }
.sidebar-toggle .sidebar-expand-icon { display: none; }
.preferences-dialog { width: min(600px, 100%); }
.preferences-dialog #modal-error:empty { display: none; }
.preference-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.preference-group + .preference-group { margin-top: 24px; }
.preference-group legend { margin-bottom: 12px; padding: 0; font-size: 16px; font-weight: 600; }
.preference-languages, .preference-themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.preference-option { position: relative; display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 16px; cursor: pointer; text-align: center; }
.preference-option input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.preference-option:has(input:checked) { border-color: var(--green); color: var(--green); background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green); }
.preference-option:focus-within { outline: 2px solid var(--green); outline-offset: 3px; }
.preference-code { font-size: 14px; font-weight: 600; }
.preference-theme { flex-direction: column; }
.theme-preview { display: flex; align-items: flex-start; flex-direction: column; gap: 8px; width: 100%; min-height: 80px; padding: 12px; border: 1px solid #a1aaa5; border-radius: 4px; }
.theme-preview > span { width: 85%; height: 3px; border-radius: 2px; background: currentColor; opacity: .65; }
.theme-preview > span:last-child { width: 60%; }
.theme-preview-light { background: #ffffff; color: #35413b; }
.theme-preview-dark { background: #212826; color: #e8edea; }
.theme-preview-sepia { background: #faf4e8; color: #645c4e; }
@media (min-width: 1024px) {
  html[data-sidebar-collapsed="true"] .app-shell { padding-left: 72px; }
  html[data-sidebar-collapsed="true"] .sidebar { width: 72px; }
  html[data-sidebar-collapsed="true"] .sidebar:not([data-peek="true"]) .sidebar-copy,
  html[data-sidebar-collapsed="true"] .sidebar:not([data-peek="true"]) .sidebar-label,
  html[data-sidebar-collapsed="true"] .sidebar:not([data-peek="true"]) .sidebar-identity-text { display: none; }
  html[data-sidebar-collapsed="true"] .sidebar:not([data-peek="true"]) .sidebar-heading { justify-content: center; }
  html[data-sidebar-collapsed="true"] .sidebar:not([data-peek="true"]) .sidebar-identity { justify-content: center; padding: 8px 0; }
  html[data-sidebar-collapsed="true"] .sidebar .sidebar-collapse-icon { display: none; }
  html[data-sidebar-collapsed="true"] .sidebar .sidebar-expand-icon { display: inline-flex; }
  html[data-sidebar-collapsed="true"] .sidebar[data-peek="true"] { width: var(--sidebar-width); box-shadow: 12px 0 24px rgb(0 0 0 / 12%); }
}
@media (max-width: 1023px) {
  .sidebar-toggle { display: none; }
  .sidebar-heading { min-height: 32px; }
  .menu-open .sidebar { padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 480px) {
  .preference-languages, .preference-themes { gap: 8px; }
  .preference-option { font-size: 14px; }
  .preference-languages .preference-option { flex-direction: column; }
  .theme-preview { padding: 8px; min-height: 72px; }
}
