:root {
  color-scheme: light;
  --background: #fffdf9;
  --foreground: #2d251e;
  --muted: #71675c;
  --surface: #f5eee6;
  --control-bg: #efe3d4;
  --border: #cbb9a4;
  --accent: #765334;
  --action: #765334;
  --selected: #ead8c0;
}

* { box-sizing: border-box; }
body { margin: 0; padding: 24px; background: var(--background); color: var(--foreground); font: 16px/1.45 system-ui, sans-serif; }
:is(html, body)[data-theme="dark"] { color-scheme: dark; --background: #211a14; --foreground: #f5eee6; --muted: #c4b6a5; --surface: #30261e; --control-bg: #392d22; --border: #61503d; --accent: #c09a6d; --action: #795936; --selected: #493828; }
.container { max-width: 1400px; margin: 0 auto; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
h1 { margin: 0; font-size: 2rem; } h1 img { height: 1.8rem; vertical-align: -0.15em; }
.site-header p, .muted, footer, .team-intro p { color: var(--muted); }
.tabs { display: flex; gap: 8px; margin: 20px 0; border-bottom: 1px solid var(--border); }
button, input { font: inherit; }
.tab, .secondary-button { cursor: pointer; border: 1px solid var(--border); border-radius: 6px 6px 0 0; padding: 9px 15px; background: var(--surface); color: var(--foreground); }
.tab.active { border-color: var(--accent); color: var(--accent); font-weight: 700; border-bottom-color: var(--background); margin-bottom: -1px; }
.badge { display: inline-block; min-width: 1.4em; margin-left: 4px; border-radius: 99px; padding: 0 5px; background: var(--accent); color: #fff; text-align: center; font-size: .8em; }
.secondary-button { border-radius: 6px; }
.page[hidden] { display: none; }
.toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 8px; }
#search { min-width: min(100%, 280px); padding: 9px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--control-bg); color: var(--foreground); }
.settings { display: flex; flex-wrap: wrap; gap: 14px; font-size: .9rem; }
.pokemon-card { margin: 18px 0 26px; padding: 10px 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--background); content-visibility: auto; contain-intrinsic-size: auto 420px; }
.pokemon-card[hidden] { display: none; }
.pokemon-title { display: flex; align-items: center; gap: 8px; min-height: 1.5rem; margin-bottom: 4px; }
.pokemon-title h2 { flex: 1; margin: 0; padding: 0; font-size: 1.25rem; line-height: 1.2; }
.team-toggle { flex: 0 0 1.25rem; width: 1.25rem; height: 1.25rem; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--foreground); cursor: pointer; font-size: .85rem; line-height: 1; }
.team-toggle[aria-pressed="true"] { border-color: var(--accent); background: var(--selected); color: var(--accent); }
.leagues { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0; }
.league { display: flex; align-items: center; gap: 7px; min-width: 105px; text-align: center; }
.league img { width: 34px; height: 34px; object-fit: contain; }
.league strong, .league small { display: block; }
.rank-one { font-size: 1.1rem; font-weight: 700; }
.table-scroll { overflow-x: auto; }
table { width: max-content; min-width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { min-width: 88px; padding: 7px 9px; border: 1px solid var(--border); text-align: center; }
th:first-child { min-width: 150px; text-align: left; }
.pokemon-types { min-width: 130px; }
.move-heading { font-weight: 600; }
.move-heading small, .charged-heading small { display: block; margin-top: 4px; font-weight: 400; }
.type-icon { width: 1.1em; height: 1.1em; object-fit: contain; vertical-align: -0.18em; }
.power { margin-top: 3px; font-size: .85em; }
tbody tr:nth-child(odd) { background: var(--surface); }
tbody tr:nth-child(even) { background: var(--background); }
.deltas { color: var(--muted); font-size: .75rem; }
.team-card { background: var(--background); }
.move-title { position: relative; display: block; min-height: 1.45rem; box-sizing: border-box; padding: 0 1.55rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.45rem; text-align: center; }
.move-title .type-icon { position: absolute; top: 50%; left: 0; transform: translateY(-50%); }
.charged-heading .move-title { text-align: left; }
.hide-move { position: absolute; top: 0; right: 0; width: 1.45rem; height: 1.45rem; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--control-bg); color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; }
.hide-move:focus-visible { outline-offset: -2px; }
.hide-move:hover, .restore-moves:hover, .team-toggle:hover, .team-toggle:focus-visible { border-color: var(--accent); color: var(--accent); }
.restore-moves { flex: 0 0 1.25rem; width: 1.25rem; height: 1.25rem; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--foreground); cursor: pointer; font-size: .85rem; line-height: 1; }
.restore-moves:disabled { opacity: .4; cursor: default; }
.team-layout { display: flex; align-items: center; gap: 10px; margin: 16px 0; }
.column-options { display: inline-flex; gap: 4px; }
.column-options button { min-width: 2.2rem; padding: 5px 9px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); color: var(--foreground); cursor: pointer; }
.column-options button[aria-pressed="true"] { border-color: var(--accent); background: var(--selected); color: var(--accent); font-weight: 700; }
.team-grid { display: grid; gap: 14px; align-items: start; }
.team-grid.columns-1 { grid-template-columns: minmax(0, 1fr); }
.team-grid.columns-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.team-grid.columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.team-grid .team-card { min-width: 0; margin: 0; padding: 9px; }
.team-grid .team-card .table-scroll { min-width: 0; }
.team-grid .team-card th, .team-grid .team-card td { min-width: 72px; padding: 5px 6px; font-size: .82rem; }
.team-grid .team-card th:first-child { min-width: 132px; }
.team-grid .team-card .pokemon-title h2 { font-size: 1.05rem; }
.team-grid .team-card .team-toggle, .team-grid .team-card .restore-moves { flex-basis: 1.05rem; width: 1.05rem; height: 1.05rem; font-size: .7rem; }
.team-grid .team-card .leagues { gap: 6px; }
.team-grid .team-card .league { min-width: 83px; gap: 4px; font-size: .82rem; }
.team-grid .team-card .league img { width: 27px; height: 27px; }
th[hidden], td[hidden], tr[hidden] { display: none !important; }
.empty-state { padding: 18px; border: 1px dashed var(--border); border-radius: 8px; color: var(--muted); }
.team-intro h2 { margin-bottom: 0; }
footer { margin-top: 36px; border-top: 1px solid var(--border); font-size: .9rem; }
body:not(.show-deltas) .deltas { display: none; }
body:not(.show-power) .power { display: none; }
body:not(.show-leagues) .leagues { display: none; }
@media (max-width: 700px) { body { padding: 14px; } .site-header { align-items: flex-start; } .toolbar { align-items: stretch; } .settings { gap: 8px 12px; } .pokemon-card { margin-inline: -5px; padding-inline: 7px; } .team-layout { flex-wrap: wrap; } }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.header-actions { display: flex; gap: 8px; }
.custom-data-banner { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:14px 0; padding:11px 14px; border:1px solid #b42318; border-radius:7px; background:#fee4e2; color:#7a1710; }
.custom-data-banner[hidden] { display:none; }
.custom-data-banner button { flex:0 0 auto; border:1px solid #b42318; border-radius:5px; background:#fff; color:#7a1710; padding:6px 10px; cursor:pointer; }
:is(html, body)[data-theme="dark"] .custom-data-banner { background:#4a2424; border-color:#ff8a80; color:#ffdad6; }
:is(html, body)[data-theme="dark"] .custom-data-banner button { background:#302222; border-color:#ff8a80; color:#ffdad6; }
dialog#settings-dialog { width:min(500px,calc(100vw - 28px)); padding:0; border:1px solid var(--border); border-radius:12px; background:var(--background); color:var(--foreground); box-shadow:0 14px 65px #0005; }
dialog#settings-dialog::backdrop { background:#0008; }
.settings-dialog-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 18px; border-bottom:1px solid var(--border); }
.settings-dialog-head h2 { margin:0; font-size:1.25rem; }
.settings-dialog-head button { width:2.2rem; height:2.2rem; border:1px solid var(--border); border-radius:50%; background:var(--surface); color:var(--foreground); font-size:1.3rem; cursor:pointer; }
.settings-dialog-body { display:grid; gap:16px; padding:18px; }
.setting-row { display:grid; gap:6px; font-weight:600; }
.setting-row select,.language-buttons button,.file-picker { padding:9px 11px; border:1px solid var(--border); border-radius:6px; background:var(--surface); color:var(--foreground); font:inherit; }
.language-choice { margin:0; padding:0; border:0; }
.language-choice legend { margin-bottom:7px; font-weight:600; }
.language-buttons { display:flex; flex-wrap:wrap; gap:7px; }
.language-buttons button { min-width:88px; cursor:pointer; }
.language-buttons button[aria-pressed="true"] { border-color:var(--accent); box-shadow:inset 0 0 0 1px var(--accent); }
.file-picker { display:block; cursor:pointer; text-align:center; }
.file-picker input { display:block; width:100%; margin-top:8px; }
a.secondary-button { color:var(--foreground); text-decoration:none; text-align:center; }
@media (max-width:700px) { .custom-data-banner { align-items:stretch; flex-direction:column; } .header-actions { margin-left:auto; } }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { scroll-behavior:auto!important; animation-duration:.01ms!important; animation-iteration-count:1!important; transition-duration:.01ms!important; } }


.about-page{max-width:900px;margin:24px auto;padding:0 20px 50px;color:var(--foreground,var(--text,#f2f4f8))}
.about-page h1{margin:0 0 12px}.about-page h2{margin:24px 0 8px}.about-page p,.about-page li{line-height:1.65;color:var(--muted,#a9afbd)}.about-page li+li{margin-top:8px}.about-page a{color:var(--accent,#81b8ff)}.about-page .disclaimer{margin-top:32px;padding-top:14px;border-top:1px solid var(--border,#343946);font-size:.9rem}
