:root,[data-theme="dark"]{
 --btn-radius:8px;
 --btn-height:36px;
 --btn-padding:8px 13px;
 --btn-font:400 13px/1.35 Inter,system-ui,-apple-system,sans-serif;
 --btn-gap:9px;
 --btn-weight:600;
 --nav-height:44px;
 --nav-padding:12px 14px;
 --nav-font:400 15px/1.4 Inter,system-ui,-apple-system,sans-serif;
 --nav-gap:5px;
 --nav-radius:8px;
 --btn-primary-from:#ff8b32;
 --btn-primary-to:#f4761d;
 --btn-primary-text:#152331;
 --theme-btn-bg:var(--surface-2,#142e44);
 --theme-btn-fg:var(--text,#edf4fa);
 --theme-btn-border:var(--line,#24435a);
 --theme-hover:#1d3a52;
 --theme-hover-border:#35617c;
 --theme-selected:#173247;
 --theme-selected-fg:var(--text,#edf4fa);
 --theme-disabled:#1a2531;
 --theme-disabled-fg:#718394;
 --theme-danger:#351a22;
 --theme-danger-fg:#ffb3ad;
 --theme-shadow:0 2px 6px rgba(0,0,0,.22);
 --theme-shadow-hover:0 4px 12px rgba(0,0,0,.28);
 --theme-focus:#ffab5e;
}
[data-theme="light"]{
 --btn-primary-from:#0875d1;
 --btn-primary-to:#0052a3;
 --btn-primary-text:#ffffff;
 --theme-btn-bg:#ffffff;
 --theme-btn-fg:#0f1f2e;
 --theme-btn-border:#94a3b8;
 --theme-hover:#e2e8f0;
 --theme-hover-border:#64748b;
 --theme-selected:#dbeafe;
 --theme-selected-fg:#0f1f2e;
 --theme-disabled:#e5e7eb;
 --theme-disabled-fg:#6b7280;
 --theme-danger:#fee2e2;
 --theme-danger-fg:#991b1b;
 --theme-shadow:0 1px 3px rgba(15,31,46,.10);
 --theme-shadow-hover:0 4px 12px rgba(0,82,163,.16);
 --theme-focus:#0052a3;
}
html[data-theme] body button,
html[data-theme] body .button,
html[data-theme] body a.btn{
 font:var(--btn-font);
 min-height:var(--btn-height);
 padding:var(--btn-padding);
 border-radius:var(--btn-radius);
 border:1px solid var(--btn-border,var(--theme-btn-border));
 background:var(--btn-secondary-bg,var(--theme-btn-bg));
 color:var(--btn-secondary-text,var(--theme-btn-fg));
 box-shadow:var(--theme-shadow);
 transition:background-color .18s ease,border-color .18s ease,color .18s ease,box-shadow .18s ease,transform .12s ease;
 display:inline-flex;align-items:center;justify-content:center;gap:var(--btn-gap);
 text-decoration:none;white-space:nowrap;
}
html[data-theme] body button:hover:not(:disabled):not(.primary):not(.danger),
html[data-theme] body .button:hover,
html[data-theme] body a.btn:hover{
 background:var(--btn-hover-bg,var(--theme-hover));
 border-color:var(--theme-hover-border);
 color:var(--btn-secondary-text,var(--theme-btn-fg));
 box-shadow:var(--theme-shadow-hover);
}
html[data-theme] body button:active:not(:disabled){transform:translateY(1px);box-shadow:none}
html[data-theme] body button.primary,
html[data-theme] body .primary,
html[data-theme] body .btn.primary{
 font-weight:var(--btn-weight);
 background:linear-gradient(135deg,var(--btn-primary-from),var(--btn-primary-to));
 border-color:var(--btn-primary-to);
 color:var(--btn-primary-text);
}
html[data-theme] body button.primary:hover:not(:disabled),
html[data-theme] body .primary:hover{filter:brightness(.94);box-shadow:var(--theme-shadow-hover)}
html[data-theme] body button.active,
html[data-theme] body button[aria-pressed="true"],
html[data-theme] body .theme-option.active{
 background:var(--btn-selected-bg,var(--theme-selected));
 color:var(--btn-secondary-text,var(--theme-selected-fg));
 border-color:var(--accent,var(--theme-selected-border,#ff8b32));
}
html[data-theme] body button.danger,
html[data-theme] body .danger{
 background:var(--btn-danger-bg,var(--theme-danger));
 color:var(--btn-danger-text,var(--theme-danger-fg));
 border-color:var(--btn-danger-text,var(--theme-danger-fg));
}
html[data-theme] body button.danger:hover:not(:disabled){filter:brightness(.95)}
html[data-theme] body button:disabled,
html[data-theme] body button[aria-disabled="true"]{
 background:var(--btn-disabled-bg,var(--theme-disabled));
 color:var(--btn-disabled-text,var(--theme-disabled-fg));
 border-color:transparent;
 box-shadow:none;
 cursor:not-allowed;
 opacity:1;
 filter:none;
 transform:none;
}
html[data-theme] body button:focus-visible,
html[data-theme] body a:focus-visible,
html[data-theme] body input:focus-visible,
html[data-theme] body select:focus-visible,
html[data-theme] body textarea:focus-visible{
 outline:2px solid var(--focus-ring,var(--theme-focus));
 outline-offset:2px;
}
html[data-theme] body .rail nav button{
 min-height:var(--nav-height);
 padding:var(--nav-padding);
 font:var(--nav-font);
 border-radius:var(--nav-radius);
 border:1px solid transparent;
 text-align:left;
 justify-content:flex-start;
 margin-bottom:var(--nav-gap);
 box-shadow:none;
}
html[data-theme] body .rail nav button.active{
 background:var(--btn-selected-bg,var(--theme-selected));
 color:var(--btn-secondary-text,var(--theme-selected-fg));
 border-left:3px solid var(--accent,var(--theme-selected-border,#ff8b32));
 box-shadow:none;
}
html[data-theme] body .theme-option{min-width:34px;padding:0 8px;min-height:30px}
