:root {
  --ink: #1c2d3c;
  --muted: #647589;
  --accent: #146b63;
  --accent-dark: #0d514b;
  --line: #dde6e9;
  --surface: #ffffff;
  --background: #f4f7f8;
  --danger: #b33743;
  --radius: 18px;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--background);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; line-height: 1.65; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #269a90; outline-offset: 4px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.3; letter-spacing: -.03em; }
h2 { margin-bottom: 10px; font-size: 21px; line-height: 1.4; letter-spacing: -.02em; }
p { margin-bottom: 18px; }
strong { font-weight: 650; }
.site-header { background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1240px; margin: auto; min-height: 84px; padding: 18px 32px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; gap: 12px; align-items: center; color: var(--ink); font-size: 20px; font-weight: 750; letter-spacing: .02em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; color: white; background: var(--accent); border-radius: 12px 12px 12px 3px; font-size: 25px; }
.brand-sub { font-weight: 450; font-size: 15px; color: var(--muted); }
.navigation { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; font-size: 14px; }
.navigation > a:not(.button) { color: var(--muted); padding: 5px 0; }
.navigation > a[aria-current="page"] { color: var(--accent); box-shadow: 0 2px var(--accent); font-weight: 650; }
.navigation form { margin: 0; }
.nav-user { max-width: 140px; overflow-wrap: anywhere; border-left: 1px solid var(--line); padding-left: 16px; font-weight: 600; }
.page-container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 48px 32px 64px; flex: 1; }
.site-footer { max-width: 1136px; width: calc(100% - 64px); margin: 0 auto; padding: 24px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 12px; }
.skip-link { position: fixed; top: -100px; left: 20px; z-index: 10; padding: 10px 18px; background: var(--ink); color: white; border-radius: 8px; }
.skip-link:focus { top: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.eyebrow { display: block; color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .14em; margin-bottom: 16px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.page-heading p { color: var(--muted); margin: 0; }
.page-heading h1 { overflow-wrap: anywhere; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: 0 6px 22px rgba(29, 52, 68, .035); min-width: 0; }
.card-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 22px; }
.card-heading p { margin-bottom: 0; font-size: 14px; }
.card-heading > a { white-space: nowrap; font-size: 14px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 12px; padding: 11px 20px; border: 1px solid transparent; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 650; font-size: 14px; line-height: 1.6; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s; white-space: nowrap; }
.button:hover { background: var(--accent-dark); color: #fff; text-decoration: none; }
.button-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.button-secondary:hover { background: #f0f5f5; color: var(--accent-dark); border-color: #aac9c4; }
.button-quiet { background: transparent; color: var(--muted); border-color: var(--line); }
.button-quiet:hover { background: #edf4f3; color: var(--accent); }
.button-small { padding: 7px 13px; font-size: 13px; }
.button-full { width: 100%; }
.button-danger { background: var(--danger); }
.button-danger:hover { background: #8d2430; }
.button-group, .form-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.is-disabled { opacity: .5; cursor: default; pointer-events: none; }
.auth-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; max-width: 1000px; margin: 20px auto; }
.auth-intro { padding: 20px 0; }
.auth-intro h1 { font-size: clamp(36px, 4.5vw, 56px); line-height: 1.3; margin-bottom: 24px; }
.auth-intro p { max-width: 360px; color: var(--muted); font-size: 16px; line-height: 1.95; }
.intro-note { display: flex; align-items: center; gap: 9px; margin-top: 40px; color: var(--accent); font-size: 13px; }
.status-dot { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 5px #e2efeb; }
.auth-card { padding: 36px; box-shadow: 0 18px 56px rgba(29, 52, 68, .065); }
.auth-card h2 { font-size: 26px; }
.auth-card > .muted { font-size: 14px; margin-bottom: 24px; }
.auth-switch { text-align: center; font-size: 14px; color: var(--muted); margin: 25px 0 0; padding-top: 22px; border-top: 1px solid var(--line); }
.form-stack { display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field label { font-size: 14px; font-weight: 650; }
.field input, .field select { width: 100%; min-width: 0; padding: 11px 13px; border: 1px solid #cbd7dc; border-radius: 9px; color: var(--ink); background: #fff; line-height: 1.6; font-size: 15px; transition: border-color .15s, box-shadow .15s; }
.field input:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #e0efed; outline: 2px solid transparent; }
.field input::placeholder { color: #798998; font-size: 14px; }
.field input[readonly] { background: #f4f7f8; color: var(--muted); }
.field small { font-size: 12px; color: var(--muted); }
.notice { display: flex; flex-direction: column; gap: 3px; padding: 16px 20px; border: 1px solid; border-radius: 12px; margin-bottom: 24px; font-size: 14px; overflow-wrap: anywhere; }
.notice-success { background: #ecf8f1; color: #216443; border-color: #bedecb; }
.notice-error { background: #fff1f2; color: #962f3b; border-color: #edcbd0; }
.notice-warning { background: #fff8e8; color: #806014; border-color: #ecdcae; }
.notice-info { background: #edf5fa; color: #2c607f; border-color: #c6deeb; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 28px; }
.summary-card { display: flex; flex-direction: column; gap: 10px; }
.summary-card > .muted { font-size: 13px; }
.summary-card strong { font-size: 22px; overflow-wrap: anywhere; }
.summary-card > span:last-child { font-size: 12px; color: var(--muted); }
.table-scroll { width: 100%; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: 14px; }
th { font-weight: 600; color: var(--muted); background: #f7f9fa; font-size: 12px; white-space: nowrap; }
th, td { padding: 15px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdfd; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, monospace; font-size: 13px; white-space: nowrap; }
.cell-sub { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.empty-state { padding: 54px 20px; text-align: center; color: var(--muted); }
.badge { display: inline-flex; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-success { background: #e9f5ed; color: #276848; }
.badge-danger { background: #fcebed; color: #a53a47; }
.badge-accent { background: #e7f2f1; color: var(--accent); }
.badge-neutral { background: #edf1f5; color: #536575; }
.count-pill { padding: 8px 15px; border-radius: 99px; background: #e7eeed; color: var(--accent); font-size: 13px; white-space: nowrap; }
.settings-grid { display: grid; grid-template-columns: 280px 1fr; gap: 28px; align-items: start; }
.account-aside { text-align: center; padding: 36px 24px; }
.account-aside h2 { overflow-wrap: anywhere; }
.account-aside a { font-size: 14px; }
.avatar { margin: 0 auto 20px; display: grid; place-items: center; width: 64px; height: 64px; background: #e5f1ee; border-radius: 20px; color: var(--accent); font-size: 28px; font-weight: 700; }
.form-card { padding: 32px; }
.form-card > p { font-size: 14px; margin-bottom: 26px; }
.form-card .form-stack { max-width: 520px; }
.narrow-card { max-width: 660px; }
.filter-form { display: flex; align-items: end; gap: 14px; margin-bottom: 28px; flex-wrap: wrap; }
.filter-form .field { flex: 1; min-width: 130px; }
.filter-form .filter-search { flex: 2; min-width: 230px; }
.filter-form .button { margin-bottom: 1px; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 24px; border-top: 1px solid var(--line); margin-top: 16px; font-size: 13px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.back-link { display: inline-block; margin-bottom: 18px; font-size: 13px; }
.metadata { margin: 30px 0 0; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; }
.metadata > div { display: flex; justify-content: space-between; gap: 16px; padding: 5px 0; }
.metadata dt { color: var(--muted); flex-shrink: 0; }
.metadata dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.danger-zone { margin-top: 28px; border-color: #e9c7cb; background: #fffafb; display: grid; grid-template-columns: 1fr 1fr; gap: 36px; padding: 32px; }
.danger-zone h2 { color: var(--danger); }
.danger-zone p { color: #79545a; font-size: 14px; }
.danger-zone .button { align-self: start; }
.detail-cell { min-width: 180px; max-width: 340px; overflow-wrap: anywhere; font-size: 12px; color: var(--muted); }
.error-page { display: flex; align-items: center; text-align: center; flex-direction: column; padding: 30px 16px 60px; max-width: 680px; margin: 0 auto; }
.error-code { color: #c8dcda; font-size: clamp(100px, 20vw, 170px); line-height: 1.2; font-weight: 800; letter-spacing: -.05em; margin-bottom: 24px; }
.error-page p { max-width: 500px; color: var(--muted); margin-bottom: 28px; }
@media (max-width: 1050px) {
  .header-inner { align-items: start; }
  .navigation { gap: 12px 16px; justify-content: flex-end; }
  .auth-layout { gap: 40px; }
  .summary-card strong { font-size: 19px; }
}
@media (max-width: 760px) {
  .header-inner { padding: 18px 20px; flex-direction: column; gap: 18px; }
  .navigation { justify-content: flex-start; width: 100%; font-size: 13px; }
  .nav-user { margin-left: auto; }
  .page-container { padding: 30px 20px 44px; }
  .site-footer { width: calc(100% - 40px); }
  .auth-layout { grid-template-columns: 1fr; max-width: 480px; gap: 24px; margin: 0 auto; }
  .auth-intro { padding: 0; }
  .auth-intro h1 { font-size: 34px; }
  .auth-intro h1 br { display: none; }
  .auth-intro p { max-width: none; font-size: 14px; margin-bottom: 0; }
  .intro-note { display: none; }
  .auth-card { padding: 28px; }
  .summary-grid, .settings-grid, .detail-grid, .danger-zone { grid-template-columns: 1fr; }
  .summary-grid { gap: 12px; }
  .summary-card { padding: 22px; }
  .summary-card strong { font-size: 22px; }
  .account-aside { padding: 24px; }
  .page-heading { align-items: start; flex-wrap: wrap; gap: 16px; }
  .card-heading { align-items: start; flex-direction: column; gap: 12px; }
  .card, .form-card, .danger-zone { padding: 22px; }
  .danger-zone { gap: 18px; }
  .pagination { align-items: start; }
  .filter-form .filter-search { flex-basis: 100%; min-width: 0; }
  .filter-form .field:not(.filter-search) { min-width: 100px; }
  .error-page { padding-top: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

:root { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e2ebf2;
  --muted: #a4b4c3;
  --accent: #69cbbd;
  --accent-dark: #8ddfd2;
  --line: #344552;
  --surface: #1c2a35;
  --background: #121d26;
  --danger: #e87986;
}
body, .site-header, .card, .app-dialog, input, select, th, td, .button {
  transition: background-color .2s linear, color .2s linear, border-color .2s linear;
}
body { background: var(--background); color: var(--ink); }
.page-container { animation: page-enter .2s linear; }
@keyframes page-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
:root[data-theme="dark"] .site-header { background: #18252f; }
:root[data-theme="dark"] .button-secondary,
:root[data-theme="dark"] .field input,
:root[data-theme="dark"] .field select { background: var(--surface); color: var(--ink); border-color: var(--line); }
:root[data-theme="dark"] .button:not(.button-secondary):not(.button-quiet):not(.button-danger),
:root[data-theme="dark"] .brand-mark { color: #102b27; }
:root[data-theme="dark"] .button-secondary:hover,
:root[data-theme="dark"] .button-quiet:hover { background: #2b403f; color: var(--accent-dark); }
:root[data-theme="dark"] .field input[readonly],
:root[data-theme="dark"] th { background: #23333f; }
:root[data-theme="dark"] tbody tr:hover { background: #233740; }
:root[data-theme="dark"] .field input:focus,
:root[data-theme="dark"] .field select:focus { box-shadow: 0 0 0 3px #294841; }
:root[data-theme="dark"] .field input::placeholder { color: #97a8b6; }
:root[data-theme="dark"] .notice-success,
:root[data-theme="dark"] .badge-success { background: #203e32; color: #a2dfb8; border-color: #426650; }
:root[data-theme="dark"] .notice-error,
:root[data-theme="dark"] .badge-danger { background: #422b33; color: #ffc0c7; border-color: #76505a; }
:root[data-theme="dark"] .notice-warning { background: #3d3624; color: #ecd48c; border-color: #75643f; }
:root[data-theme="dark"] .notice-info { background: #223b4a; color: #acd5ef; border-color: #426477; }
:root[data-theme="dark"] .badge-accent,
:root[data-theme="dark"] .count-pill,
:root[data-theme="dark"] .avatar { background: #25433d; color: var(--accent); }
:root[data-theme="dark"] .badge-neutral { background: #34414e; color: #c7d5df; }
:root[data-theme="dark"] .status-dot { box-shadow: 0 0 0 5px #25433d; }
:root[data-theme="dark"] .danger-zone { background: #30252e; border-color: #67434d; }
:root[data-theme="dark"] .danger-zone p { color: #dfb5bd; }
:root[data-theme="dark"] .button-danger { background: #a73f4c; color: white; }
:root[data-theme="dark"] .button-danger:hover { background: #8c303c; }
:root[data-theme="dark"] .error-code { color: #577d79; }
.email-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.email-row strong { flex: 1; min-width: 0; }
.privacy-eye { padding: 8px; flex-shrink: 0; min-width: 44px; min-height: 44px; }
.privacy-eye svg, .settings-trigger svg { width: 24px; height: 24px; }
.privacy-eye[aria-pressed="true"] .eye-slash { display: none; }
.logs-toggle { display: inline-flex; align-items: center; gap: 14px; padding: 5px 0; border: 0; background: transparent; color: var(--ink); font: inherit; cursor: pointer; text-align: left; }
.chevron { width: 22px; height: 22px; transition: transform .2s linear; }
.logs-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.logs-body { overflow: hidden; }
[hidden] { display: none !important; }
button:disabled { cursor: wait; opacity: .65; }
.settings-trigger { position: fixed; bottom: max(20px, env(safe-area-inset-bottom)); left: max(20px, env(safe-area-inset-left)); z-index: 20; display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); box-shadow: 0 4px 20px #0002; cursor: pointer; }
.settings-trigger:hover { color: var(--accent); }
.site-footer { padding-bottom: 84px; }
.app-dialog { width: min(480px, calc(100% - 32px)); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: 0 20px 70px #0005; }
.app-dialog[open] { animation: page-enter .18s linear; }
.app-dialog::backdrop { background: #07121db3; animation: backdrop-enter .18s linear; }
@keyframes backdrop-enter { from { opacity: 0; } to { opacity: 1; } }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.dialog-heading h2 { margin: 0; }
.app-dialog p { overflow-wrap: anywhere; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.theme-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.theme-options [aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: #fff; }
:root[data-theme="dark"] .theme-options [aria-pressed="true"] { background: var(--accent); color: #102b27; }
@media (max-width: 760px) {
  .app-dialog { padding: 22px; }
  .settings-trigger { left: max(14px, env(safe-area-inset-left)); bottom: max(14px, env(safe-area-inset-bottom)); }
  .logs-toggle { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.nav-user { display:inline-flex; align-items:center; gap:8px; }
.nav-avatar { width:28px; height:28px; border-radius:50%; object-fit:cover; }

.settings-trigger svg { display:block; flex:none; overflow:visible; }

.oauth-login-control { position: relative; margin-top: 1rem; }
.oauth-login-control .oauth-login-button { margin-top: 0; padding-right: 52px; }
.oauth-help-button { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.oauth-help-button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.oauth-login-button { margin-top: 1rem; gap: .6rem; }
.oauth-login-button img { flex-shrink: 0; object-fit: contain; }

.profile-sidebar { min-width: 0; display: grid; gap: 16px; }
.profile-main { min-width: 0; display: grid; gap: 28px; }
.profile-sidebar .avatar-card { margin-top: 0; padding: 20px; }
.profile-sidebar .avatar-card h2 { font-size: 18px; }
.profile-sidebar input[type="file"] { width: 100%; min-width: 0; font-size: 12px; }
.brand-mark { object-fit: contain; background: transparent; border-radius: 9px; }
.oauth-binding-actions { display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; }
.oauth-binding-actions form { margin: 0; }

/* Layout preference is applied before rendering to keep navigation stable. */
.nav-icon, .sidebar-toggle, .mobile-menu-toggle, .mobile-menu-close, .navigation-backdrop { display: none; }
:root[data-layout="sidebar"] { --sidebar-width: 256px; }
:root[data-layout="sidebar"][data-sidebar-collapsed="true"] { --sidebar-width: 80px; }
:root[data-layout="sidebar"] body { padding-left: var(--sidebar-width); transition: padding-left .2s linear; }
:root[data-layout="sidebar"] .site-header { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); z-index: 30; border-right: 1px solid var(--line); border-bottom: 0; transition: width .2s linear, background-color .2s linear; }
:root[data-layout="sidebar"] .header-inner { height: 100%; min-height: 0; padding: 20px 12px 88px; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 16px; overflow-y: auto; }
:root[data-layout="sidebar"] .brand { gap: 10px; font-size: 18px; padding: 0 6px; }
:root[data-layout="sidebar"] .brand-mark { flex-shrink: 0; }
:root[data-layout="sidebar"] .brand-sub { display: block; font-size: 12px; }
:root[data-layout="sidebar"] .navigation { flex-direction: column; align-items: stretch; flex-wrap: nowrap; justify-content: flex-start; gap: 6px; width: 100%; font-size: 14px; }
:root[data-layout="sidebar"] .navigation > a, :root[data-layout="sidebar"] .navigation form button { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 12px; border-radius: 10px; width: 100%; text-align: left; }
:root[data-layout="sidebar"] .navigation > a[aria-current="page"] { box-shadow: inset 3px 0 var(--accent); background: var(--background); }
:root[data-layout="sidebar"] .nav-icon { display: block; width: 22px; height: 22px; flex: 0 0 22px; }
:root[data-layout="sidebar"] .nav-label { min-width: 0; overflow-wrap: anywhere; }
:root[data-layout="sidebar"] .nav-user { max-width: none; margin: 12px 0 0; border-left: 0; border-top: 1px solid var(--line); padding: 14px 12px 0; }
:root[data-layout="sidebar"] .sidebar-toggle { display: flex; align-items: center; justify-content: center; min-height: 36px; align-self: flex-end; }
.sidebar-toggle svg { width: 22px; height: 22px; transition: transform .2s linear; }
:root[data-sidebar-collapsed="true"] .sidebar-toggle svg { transform: rotate(180deg); }
:root[data-layout="sidebar"][data-sidebar-collapsed="true"] .brand > span { display: none; }
:root[data-layout="sidebar"][data-sidebar-collapsed="true"] .nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:root[data-layout="sidebar"][data-sidebar-collapsed="true"] .nav-user { display: none; }
:root[data-layout="sidebar"][data-sidebar-collapsed="true"] .sidebar-toggle { align-self: center; }
:root[data-layout="sidebar"][data-sidebar-collapsed="true"] .navigation > a, :root[data-layout="sidebar"][data-sidebar-collapsed="true"] .navigation form button { justify-content: center; }
:root[data-layout="sidebar"] .page-container { min-width: 0; }
.skip-link { z-index: 60; }
@media (max-width: 760px) {
  :root[data-layout="sidebar"] body { padding-left: 0; }
  :root[data-layout="sidebar"] .site-header { position: relative; inset: auto; width: 100%; border-right: 0; border-bottom: 1px solid var(--line); z-index: 30; }
  :root[data-layout="sidebar"] .header-inner { height: auto; padding: 12px 16px; flex-direction: row; align-items: center; gap: 12px; overflow: visible; }
  :root[data-layout="sidebar"] .brand { font-size: 16px; min-width: 0; }
  :root[data-layout="sidebar"][data-sidebar-collapsed="true"] .brand > span { display: block; }
  :root[data-layout="sidebar"] .brand-mark { width: 32px; height: 32px; }
  :root[data-layout="sidebar"] .mobile-menu-toggle { display: inline-flex; flex-shrink: 0; gap: 6px; min-height: 44px; padding: 8px 12px; }
  :root[data-layout="sidebar"] .sidebar-toggle { display: none; }
  :root[data-layout="sidebar"] .navigation { position: fixed; inset: 0 auto 0 0; width: min(300px, 85vw); height: 100dvh; padding: 20px 16px max(24px, env(safe-area-inset-bottom)); background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; z-index: 42; transform: translateX(-100%); visibility: hidden; transition: transform .22s linear, visibility 0s linear .22s; box-shadow: 4px 0 24px #0002; }
  :root[data-layout="sidebar"][data-sidebar-collapsed="true"] .navigation .nav-label { position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; }
  :root[data-layout="sidebar"][data-sidebar-collapsed="true"] .navigation > a, :root[data-layout="sidebar"][data-sidebar-collapsed="true"] .navigation form button { justify-content: flex-start; }
  :root[data-layout="sidebar"][data-sidebar-collapsed="true"] .navigation .nav-user { display: inline-flex; }
  :root[data-layout="sidebar"] .mobile-menu-close { display: block; align-self: flex-end; min-height: 44px; margin-bottom: 8px; }
  :root[data-layout="sidebar"] .navigation-backdrop { display: block; position: fixed; inset: 0; z-index: 29; border: 0; border-radius: 0; background: #0006; opacity: 0; visibility: hidden; transition: opacity .22s linear, visibility 0s linear .22s; }
  :root[data-layout="sidebar"][data-menu-open="true"] .navigation { transform: translateX(0); visibility: visible; transition-delay: 0s; }
  :root[data-layout="sidebar"][data-menu-open="true"] .navigation-backdrop { opacity: 1; visibility: visible; transition-delay: 0s; }
  :root[data-layout="sidebar"][data-menu-open="true"] body { overflow: hidden; }
}
:root[data-layout="sidebar"] .settings-trigger { z-index: 35; }
@media (max-width: 760px) {
  :root[data-layout="sidebar"][data-menu-open="true"] .settings-trigger { visibility: hidden; }
}
@media (max-width: 760px) {
  :root[data-layout="sidebar"] .brand > span { white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
}

.security-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 20px; margin-bottom: 28px; }
.security-list .form-card { width: 100%; min-width: 0; }
.security-break { overflow-wrap: anywhere; }
.security-list input { width: 100%; }

.strong-auth-page .card { padding: 24px; margin-bottom: 24px; }
.strong-auth-page form { display: grid; gap: 14px; margin: 18px 0; max-width: 540px; }
.strong-auth-page label { display: grid; gap: 6px; font-weight: 600; }
.strong-auth-page input { width: 100%; min-width: 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
.strong-auth-page code { overflow-wrap: anywhere; }
.strong-auth-page img { max-width: 100%; height: auto; }

/* Keep selected navigation readable in both expanded and icon-only layouts. */
.navigation > a[aria-current="page"] { color: var(--accent-dark); font-weight: 700; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); text-decoration: none; }
:root[data-layout="sidebar"] .navigation > a[aria-current="page"] { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); box-shadow: inset 3px 0 var(--accent); }
.navigation > a[aria-current="page"] .nav-icon { stroke-width: 2.1; }
.security-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); align-items: stretch; }
.security-card { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 26px; border: 1px solid var(--line); box-shadow: 0 6px 24px #00000006; }
.security-card-icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; flex-shrink: 0; border-radius: 14px; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.security-card-icon svg { width: 26px; height: 26px; }
.security-card h2 { margin: 0; font-size: 18px; line-height: 1.5; }
.security-card > p { margin: 0; color: var(--muted); font-size: 14px; }
.security-card > .notice { padding: 12px 14px; }
.security-card > .button, .security-card > .button-group { margin-top: auto; }
.security-card > .button { align-self: flex-start; max-width: 100%; white-space: normal; }
.security-card .button-group { flex-wrap: wrap; }
.login-method-divider { border: 0; border-top: 1px solid var(--line); margin: 20px 0; width: 100%; }
@media (max-width: 760px) { .security-card { padding: 22px; } }
