:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f7f1;
  --surface: #ffffff;
  --surface2: #e8f0e4;
  --border: #c4d2bd;
  --green: #356b20;
  --text: #172613;
  --muted: #50614b;
  --red: #a32929;
}
.interface-toolbar { display:flex; justify-content:flex-end; position:sticky; top:0; z-index:40; background:var(--bg); border-bottom:1px solid var(--border); padding:12px 0; margin:0 0 26px; }
.public-main>.interface-toolbar { padding:12px 6vw; }
.public-main>.flashes { margin-left:6vw; margin-right:6vw; }
.topbar { display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:24px; position:sticky; top:0; z-index:40; height:auto; min-height:80px; margin-bottom:26px; background:var(--bg); }
.topbar>.workspace-location { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.topbar>.interface-toolbar { position:static; margin:0; padding:0; border:0; letter-spacing:normal; }
.interface-preferences { display:flex; flex-wrap:wrap; align-items:end; gap:14px; }
.interface-preferences label { margin:0; min-width:130px; }
.interface-preferences .language-field { min-width:210px; }
.language-field>label { display:block; }
.interface-preferences select { margin-top:4px; }
.interface-preferences.compact { gap:12px; }
.interface-preferences.compact label { font-size:11px; min-width:110px; }
.interface-preferences.compact .language-field { min-width:210px; }
.interface-preferences.compact .language-field>label { font-size:11px; }
.interface-preferences.compact select { padding:6px 28px 6px 10px; font-size:12px; }
.language-control { display:flex; align-items:center; gap:9px; min-width:0; }
.language-control select { min-width:0; flex:1; }
.language-flag { width:28px; height:20px; flex-shrink:0; object-fit:cover; border-radius:3px; outline:1px solid var(--border); }
.language-picker { position:relative; flex:1; min-width:0; margin-top:4px; }
.language-trigger { display:flex; align-items:center; gap:10px; width:100%; padding:12px; border:1px solid var(--border); border-radius:6px; background:var(--surface); color:var(--text); font:inherit; text-align:left; cursor:pointer; }
.interface-preferences.compact .language-trigger { padding:6px 10px; font-size:12px; }
.language-chevron { margin-left:auto; }
.language-trigger[aria-expanded="true"] .language-chevron { transform:rotate(180deg); }
.language-options { position:absolute; top:calc(100% + 6px); left:0; right:0; min-width:210px; max-height:min(420px,60vh); overflow-y:auto; overscroll-behavior:contain; padding:5px; border:1px solid var(--border); border-radius:8px; background:var(--surface); color:var(--text); box-shadow:0 12px 28px #0004; z-index:50; }
.language-options>[role="option"] { display:flex; align-items:center; gap:10px; width:100%; padding:10px 8px; border:0; border-radius:4px; background:transparent; color:inherit; font:inherit; font-size:13px; text-align:left; cursor:pointer; }
.language-options>[role="option"]:hover, .language-options>[data-active] { background:var(--surface2); }
.language-selected { margin-left:auto; color:var(--green); visibility:hidden; }
.language-options>[aria-selected="true"] .language-selected { visibility:visible; }
.language-trigger:focus-visible, .language-options>[role="option"]:focus-visible { outline:2px solid var(--green); outline-offset:2px; }
:root:lang(ko) { font-family:'Malgun Gothic','Apple SD Gothic Neo','Noto Sans KR','Segoe UI',sans-serif; word-break:keep-all; overflow-wrap:anywhere; }
:lang(th) { font-family:'Leelawadee UI',Tahoma,'Noto Sans Thai','Segoe UI',sans-serif; }
:root:lang(th) { word-break:normal; overflow-wrap:anywhere; }
:root:lang(th) :is(h1,h2,h3) { line-height:1.45; letter-spacing:normal; }
:root:lang(th) :is(.eyebrow,.nav-label,.topbar,.sidebar-note) { letter-spacing:normal; }
:lang(ja) { font-family:'Yu Gothic UI',Meiryo,'Hiragino Kaku Gothic ProN','Noto Sans JP','Segoe UI',sans-serif; }
:lang(zh-CN) { font-family:'Microsoft YaHei UI','PingFang SC','Noto Sans SC','Segoe UI',sans-serif; }
:root:is(:lang(ja),:lang(zh-CN)) { word-break:normal; line-break:strict; overflow-wrap:anywhere; }
:root:is(:lang(ja),:lang(zh-CN)) :is(h1,h2,h3) { line-height:1.4; letter-spacing:normal; }
:root:is(:lang(ja),:lang(zh-CN)) :is(.eyebrow,.nav-label,.topbar,.sidebar-note) { letter-spacing:normal; }
html { scroll-padding-top:96px; }
.preferences-panel { margin-bottom:28px; }
:root[data-theme="light"] .sidebar,
:root[data-theme="light"] .public-header { background:var(--surface); }
:root[data-theme="light"] .brand-symbol { background:#b5ed87; color:#172613; }
:root[data-theme="light"] .art-tag { background:var(--surface2); color:var(--green); border-color:var(--border); }
:root[data-theme="light"] label,
:root[data-theme="light"] summary { color:var(--text); }
:root[data-theme="light"] .sidebar nav>a,
:root[data-theme="light"] .topbar,
:root[data-theme="light"] .nav-label,
:root[data-theme="light"] .stat small,
:root[data-theme="light"] .stat a,
:root[data-theme="light"] .footer,
:root[data-theme="light"] .roadmap-tags span { color:var(--muted); }
:root[data-theme="light"] th { color:var(--text); background:var(--surface2); }
:root[data-theme="light"] input[type=file]::file-selector-button { color:var(--text); background:var(--surface2); }
:root[data-theme="light"] input,
:root[data-theme="light"] select,
:root[data-theme="light"] textarea { color:var(--text); background:var(--surface); border-color:var(--border); }
:root[data-theme="light"] input::placeholder,
:root[data-theme="light"] textarea::placeholder { color:var(--muted); }
:root[data-theme="light"] .button:not(.secondary):not(.danger) { background:#b5ed87; color:#172613; }
:root[data-theme="light"] .button.secondary { background:var(--surface2); color:var(--text); }
:root[data-theme="light"] .button.danger { background:#fdeaea; color:#942323; border-color:#c47d75; }
:root[data-theme="light"] .sidebar nav a.active,
:root[data-theme="light"] .sidebar nav a:hover,
:root[data-theme="light"] .tabs a.active { background:var(--surface2); color:var(--green); }
:root[data-theme="light"] .scope-banner,
:root[data-theme="light"] .guild-banner { background:linear-gradient(120deg,#e2f0d8,#fff); }
:root[data-theme="light"] .monster-results,
:root[data-theme="light"] .monster-option,
:root[data-theme="light"] .equipment-panel,
:root[data-theme="light"] .artifact-section,
:root[data-theme="light"] .collection-savebar { background:var(--surface); color:var(--text); }
:root[data-theme="light"] .monster-option:hover,
:root[data-theme="light"] .monster-option:focus { background:var(--surface2); }
:root[data-theme="light"] .notice,
:root[data-theme="light"] .flash { color:var(--text); background:#eef3df; border-color:#b4c895; }
:root[data-theme="light"] .flash.error,
:root[data-theme="light"] [data-quick-error],
:root[data-theme="light"] [data-form-error],
:root[data-theme="light"] .collection-status.error { background:#fdeaea; color:#942323; }
:root[data-theme="light"] .flash.success,
:root[data-theme="light"] .collection-status.success { background:#e5f3dc; color:#2c5f1d; }
:root[data-theme="light"] .collection-status.collection-error { color:#942323; }
:root[data-theme="light"] .notice>span { color:var(--green); }
:root[data-theme="light"] .result-badge.win { background:#e5f3dc; color:#2c5f1d; }
:root[data-theme="light"] .result-badge.loss { background:#fdeaea; color:#942323; }
:root[data-theme="light"] .leader-mark { color:#fff; }
:root[data-theme="light"] .ownership.missing { color:var(--muted); }
:root[data-theme="light"] .chart-label { fill:var(--muted); }
:root[data-theme="light"] .chart-axis,
:root[data-theme="light"] .chart-grid { stroke:var(--border); }
:root[data-theme="light"] .bar-loss,
:root[data-theme="light"] .legend-loss { fill:#b34141; background:#b34141; }
:root[data-theme="light"] .danger-panel { border-color:#d2a39c; }
@media(max-width:1100px) {
  .topbar { grid-template-columns:minmax(0,1fr) auto; gap:10px; padding:12px 0; }
  .topbar>.interface-toolbar { grid-column:1/-1; grid-row:1; }
}
@media(max-width:760px) {
  .interface-toolbar { justify-content:stretch; }
  .interface-preferences.compact { width:100%; }
  .interface-preferences>label { flex:1; }
  .interface-preferences .language-field { flex:1.5; }
  .interface-preferences.compact .language-field { min-width:190px; }
  .interface-preferences.compact>label { min-width:96px; }
  .interface-preferences .button { width:100%; }
}
