:root {
  --paper: #f5f0e7;
  --surface: #fffdf8;
  --ink: #17201e;
  --muted: #68716d;
  --line: #d9d5cc;
  --red: #e2513f;
  --red-dark: #be3f31;
  --blue: #5479ab;
  --amber: #dfa443;
  --mint: #63a88b;
  --shadow: 0 18px 50px rgba(34, 41, 38, 0.07);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; background: var(--paper); }
body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 8%, rgba(226,81,63,.08), transparent 24rem),
    linear-gradient(rgba(23,32,30,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23,32,30,.025) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 32px 32px, 32px 32px, auto;
  font-family: "DM Sans", sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

button, input, textarea, select { font: inherit; }
button { color: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

.topbar {
  min-height: calc(72px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) max(clamp(20px, 5vw, 72px), env(safe-area-inset-right, 0px)) 0 max(clamp(20px, 5vw, 72px), env(safe-area-inset-left, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(23,32,30,.12);
  background: rgba(245,240,231,.82);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { display: inline-flex; gap: 11px; align-items: center; color: var(--ink); text-decoration: none; font: 800 14px/1 "Manrope"; letter-spacing: .14em; }
.brand-mark { width: 26px; aspect-ratio: 1; border: 2px solid currentColor; border-radius: 50%; position: relative; display: inline-grid; place-items: center; overflow: hidden; }
.brand-mark::before { content: ""; position: absolute; width: 100%; height: 50%; top: 0; background: var(--red); border-bottom: 2px solid currentColor; }
.brand-mark i { width: 8px; aspect-ratio: 1; border-radius: 50%; background: var(--surface); border: 2px solid currentColor; z-index: 1; }
.header-actions { display: flex; align-items: center; gap: 18px; }
.sync-state { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.sync-state::before { content: ""; flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: #55a57f; box-shadow: 0 0 0 4px rgba(85,165,127,.12); }
.sync-state[data-status="error"]::before, .sync-state[data-status="conflict"]::before { background: #c75b48; box-shadow: 0 0 0 4px rgba(199,91,72,.12); }
.sync-state[data-status="pending"]::before, .sync-state[data-status="syncing"]::before, .sync-state[data-status="setup"]::before, .sync-state[data-status="signed-out"]::before { background: var(--amber); box-shadow: 0 0 0 4px rgba(224,158,45,.12); }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; }
.install-button { min-height: 36px; border: 1px solid var(--line); border-radius: 999px; padding: 0 12px; background: var(--surface); font-size: 11px; font-weight: 800; cursor: pointer; }

.app-navigation {
  position: sticky;
  top: calc(72px + env(safe-area-inset-top, 0px));
  z-index: 9;
  display: grid;
  gap: 8px;
  padding: 10px max(clamp(20px, 5vw, 72px), env(safe-area-inset-right, 0px)) 9px max(clamp(20px, 5vw, 72px), env(safe-area-inset-left, 0px));
  border-bottom: 1px solid rgba(23,32,30,.12);
  background: rgba(245,240,231,.94);
  backdrop-filter: blur(16px);
}
.primary-navigation, .team-navigation { display: flex; align-items: center; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.primary-navigation::-webkit-scrollbar, .team-navigation::-webkit-scrollbar { display: none; }
.app-navigation a { flex: 0 0 auto; min-height: 34px; display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid transparent; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 800; white-space: nowrap; }
.app-navigation a:hover { color: var(--ink); border-color: var(--line); }
.app-navigation a.active { color: white; border-color: var(--ink); background: var(--ink); }
.team-navigation { padding-top: 8px; border-top: 1px dashed var(--line); }
.team-navigation a { min-height: 30px; padding-inline: 10px; font-size: 10px; }

.install-guide { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: max(20px, env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) max(20px, env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px)); background: rgba(23,32,30,.58); backdrop-filter: blur(8px); }
.install-guide-card { position: relative; width: min(100%, 480px); max-height: 90dvh; overflow: auto; padding: 34px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 28px 80px rgba(0,0,0,.24); }
.install-guide-card h2 { margin: 22px 0 14px; }
.install-guide-card ol { margin: 0; padding-left: 21px; color: var(--ink); line-height: 1.65; }
.install-guide-card li + li { margin-top: 8px; }
.install-guide-card p { margin: 18px 0 0; color: var(--muted); line-height: 1.55; }
.install-guide-close { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; font-size: 28px; cursor: pointer; }

main { width: min(1180px, calc(100% - 40px)); margin: auto; }
.app-page { min-height: calc(100dvh - 145px); animation: page-in .22s ease both; }
.hero { padding: 84px 0 54px; max-width: 780px; }
.eyebrow { font: 700 11px/1 "Manrope"; letter-spacing: .17em; color: var(--muted); margin-bottom: 22px; }
.eyebrow span { color: var(--red); margin: 0 5px; }
h1 { margin: 0; font: 800 clamp(48px, 7vw, 88px)/.97 "Manrope"; letter-spacing: -.065em; }
h1 em { color: var(--red); font-style: normal; }
.hero > p { max-width: 610px; font-size: 18px; line-height: 1.65; color: var(--muted); margin: 27px 0; }
.hero-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-pills span { border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 700; background: rgba(255,253,248,.6); }
.home-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.home-actions a { min-width: 170px; text-decoration: none; }
.home-actions .outline-button { display: inline-flex; align-items: center; justify-content: center; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .8fr); gap: 20px; align-items: start; }
.workspace.app-page { padding: 48px 0 90px; }
.panel { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.entry-panel { padding: clamp(24px, 4vw, 42px); }
.guide-panel { padding: 32px; }
.panel-heading, .section-title { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 32px; }
.panel-heading > div, .section-title > div:first-child { display: flex; align-items: center; gap: 14px; }
.step { display: grid; place-items: center; width: 36px; height: 24px; background: var(--ink); color: var(--paper); border-radius: 2px; font: 700 10px/1 "Manrope"; letter-spacing: .12em; }
h2 { font: 800 clamp(19px, 2vw, 25px)/1.2 "Manrope"; letter-spacing: -.035em; margin: 0; }
.text-button { border: 0; border-bottom: 1px solid currentColor; background: transparent; padding: 2px 0; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--muted); }
.text-button:hover { color: var(--red); }
.text-button.active { color: var(--red); border-bottom-width: 2px; }
.text-button.danger { color: var(--red); }
.entry-modes { display: flex; align-items: center; gap: 16px; }
.scan-link { color: var(--red); }

form { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 16px; }
.span-2 { grid-column: span 2; }
.field label, fieldset legend { display: block; font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; margin-bottom: 9px; color: var(--muted); }
.field label span, fieldset legend span { text-transform: none; font-weight: 500; letter-spacing: 0; }
input, textarea, .field select { width: 100%; border: 1px solid var(--line); color: var(--ink); background: #faf8f2; border-radius: 3px; outline: 0; transition: border .2s, box-shadow .2s, background .2s; }
input { height: 48px; padding: 0 14px; }
.field select { height: 48px; padding: 0 14px; }
textarea { padding: 14px; resize: vertical; line-height: 1.6; }
input:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23,32,30,.07); background: var(--surface); }
.field-error { color: var(--red); font-size: 11px; margin: 5px 0 0; min-height: 0; }
.iv-fieldset, .tag-fieldset, .progress-fieldset { padding: 0; margin: 0; border: 0; }
.iv-fieldset legend { width: 100%; display: flex; justify-content: space-between; }
.iv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.iv-grid label { padding: 9px 12px 8px; border: 1px solid var(--line); background: #faf8f2; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.iv-grid input { border: 0; padding: 0; height: 27px; background: transparent; font-size: 17px; font-weight: 700; box-shadow: none; }
.progress-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.progress-grid.three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.progress-grid label { display: grid; gap: 6px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.progress-grid select, .progress-grid input { width: 100%; min-height: 42px; height: 42px; border: 1px solid var(--line); background: #faf8f2; color: var(--ink); padding: 0 10px; font-size: 11px; }
.progress-grid .buddy-boost-option { align-content: start; }
.progress-grid .inline-check { min-height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); background: #faf8f2; color: var(--ink); font-size: 10px; text-transform: none; letter-spacing: 0; }
.progress-grid .inline-check input { width: 16px; height: 16px; min-height: 0; padding: 0; }
.progress-grid .buddy-boost-option small { color: var(--muted); font-size: 8px; line-height: 1.4; letter-spacing: 0; text-transform: none; }
.tag-options { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-options input { position: absolute; opacity: 0; pointer-events: none; }
.tag-options span { display: block; border: 1px solid var(--line); border-radius: 999px; padding: 8px 13px; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; transition: .2s; }
.tag-options input:checked + span { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.duplicate-warning { border: 1px solid rgba(199,91,72,.42); background: rgba(199,91,72,.07); padding: 14px; }
.duplicate-warning > strong { display: block; color: #a84435; font: 800 13px/1.3 "Manrope"; }
.duplicate-warning > p { margin: 4px 0 10px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.duplicate-match { display: grid; gap: 4px; padding: 10px 0; border-top: 1px solid rgba(199,91,72,.22); }
.duplicate-match b { font-size: 11px; }
.duplicate-match span { color: var(--muted); font-size: 9px; line-height: 1.45; overflow-wrap: anywhere; }
.form-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.form-actions .primary-button { flex: 1 1 220px; }
.primary-button { min-height: 52px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 3px; background: var(--red); color: white; font-weight: 800; cursor: pointer; box-shadow: 0 8px 18px rgba(226,81,63,.2); transition: transform .2s, background .2s; }
.primary-button:hover { transform: translateY(-2px); background: var(--red-dark); }
.primary-button b { font-size: 20px; }

.bulk-entry { border-top: 1px dashed var(--line); margin-top: 27px; padding-top: 27px; }
.bulk-help { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.bulk-help strong { font-size: 13px; }
.bulk-help span, .bulk-message { color: var(--muted); font-size: 11px; }
.bulk-entry .primary-button { width: 100%; margin-top: 10px; }

.scan-entry { border-top: 1px dashed var(--line); margin-top: 27px; padding-top: 27px; }
.privacy-note { display: flex; gap: 11px; padding: 13px 14px; background: rgba(99,168,139,.11); margin-bottom: 14px; }
.privacy-note > span { flex: 0 0 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: var(--mint); color: white; font-size: 12px; font-weight: 800; }
.privacy-note strong { display: block; font-size: 12px; margin-bottom: 3px; }
.privacy-note p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.iv-warning { display: flex; gap: 11px; align-items: center; padding: 11px 14px; border: 1px solid rgba(223,164,67,.38); background: rgba(223,164,67,.08); margin: -5px 0 14px; }
.iv-warning > span { flex: 0 0 27px; height: 22px; display: grid; place-items: center; border-radius: 2px; background: var(--amber); color: white; font-size: 8px; font-weight: 800; }
.iv-warning p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.dropzone { min-height: 190px; border: 1.5px dashed #b9b4aa; background: #faf8f2; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; cursor: pointer; transition: .2s; }
.dropzone:hover, .dropzone.dragging { border-color: var(--red); background: rgba(226,81,63,.035); }
.dropzone input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.upload-icon { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--ink); border-radius: 50%; font-size: 20px; margin-bottom: 11px; }
.dropzone strong { font: 800 14px/1.3 "Manrope"; }
.dropzone small { color: var(--muted); font-size: 10px; margin: 5px 0 12px; }
.dropzone b { background: var(--ink); color: var(--surface); padding: 7px 11px; border-radius: 3px; font-size: 10px; }
.scan-files { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; margin-top: 10px; }
.scan-file { position: relative; min-width: 0; border: 1px solid var(--line); background: #faf8f2; padding: 5px; }
.scan-file img, .scan-file video { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #161b19; }
.scan-file .media-badge { position: absolute; left: 8px; top: 8px; margin: 0; width: auto; padding: 3px 5px; border-radius: 2px; background: var(--red); color: white; font-size: 8px; font-weight: 800; letter-spacing: .06em; }
.scan-file span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 9px; margin-top: 5px; }
.scan-file button { position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: rgba(23,32,30,.82); color: white; cursor: pointer; }
.scan-button { width: 100%; margin-top: 10px; }
.scan-button:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.scan-progress { padding: 14px 0 4px; }
.scan-progress > div { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; margin-bottom: 7px; }
.scan-progress > i { height: 5px; display: block; background: #e2ded5; overflow: hidden; }
.scan-progress > i span { width: 0; height: 100%; display: block; background: var(--red); transition: width .2s; }
.scan-review { margin-top: 28px; padding-top: 25px; border-top: 1px solid var(--line); }
.review-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 12px; }
.review-heading-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 6px; }
.review-heading strong { display: block; font: 800 14px/1.3 "Manrope"; }
.review-heading span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.review-labels, .review-row { display: grid; grid-template-columns: 24px minmax(120px,1.3fr) 72px minmax(150px,1.2fr) 64px 105px 24px; gap: 7px; align-items: center; }
.review-labels { padding: 0 6px 7px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.review-row { padding: 7px 6px; border-top: 1px solid var(--line); }
.review-row input, .review-row select { height: 36px; min-width: 0; width: 100%; border: 1px solid var(--line); background: #faf8f2; color: var(--ink); border-radius: 2px; padding: 0 8px; font-size: 11px; }
.review-row input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--red); }
.review-row .iv-mini { display: grid; grid-template-columns: repeat(3,1fr); gap: 3px; }
.review-row .iv-mini input { padding: 0 4px; text-align: center; }
.scan-tag-editor { min-width: 0; display: grid; gap: 4px; }
.scan-tag-editor select { height: 32px; padding-inline: 6px; }
.scan-tag-pills { display: flex; flex-wrap: wrap; gap: 3px; }
.scan-tag-pills button { border: 1px solid rgba(226,81,63,.32); border-radius: 999px; background: rgba(226,81,63,.08); color: var(--red); padding: 3px 6px; font-size: 8px; font-weight: 800; cursor: pointer; }
.review-row .remove-review { border: 0; background: transparent; color: var(--muted); font-size: 16px; cursor: pointer; padding: 0; }
.scan-candidate-note { grid-column: 2 / -2; color: var(--muted); font-size: 9px; line-height: 1.45; }
.scan-quick-decision { grid-column: 2 / -2; display: grid; grid-template-columns: minmax(105px,.32fr) 1fr; gap: 8px; align-items: center; padding: 8px 10px; border-left: 3px solid var(--muted); background: rgba(126,133,129,.08); }
.scan-quick-decision strong { font: 800 10px/1.25 "Manrope"; letter-spacing: .04em; }
.scan-quick-decision span { color: var(--muted); font-size: 9px; line-height: 1.45; }
.scan-quick-decision.keep { border-color: var(--mint); background: rgba(99,168,139,.10); }
.scan-quick-decision.evolve { border-color: var(--blue); background: rgba(64,133,173,.09); }
.scan-quick-decision.transfer { border-color: var(--red); background: rgba(226,81,63,.09); }
.scan-quick-decision.hold { border-color: var(--amber); background: rgba(223,164,67,.10); }
.scan-quick-decision.duplicate { border-color: #7b61a8; background: rgba(123,97,168,.09); }
.scan-candidate-note.has-issues { color: #a84435; font-weight: 700; }
.scan-candidate-note.has-warning { color: #8a5d12; font-weight: 700; }
.scan-evidence { grid-column: 2 / -2; display: grid; grid-template-columns: minmax(160px,260px) 1fr; gap: 10px; align-items: center; }
.scan-evidence img { width: 100%; max-height: 150px; object-fit: contain; object-position: left center; border: 1px solid var(--line); background: #eef0ed; }
.scan-evidence span { color: var(--muted); font-size: 9px; line-height: 1.5; }
.review-row input[data-field="verified"]:disabled { opacity: .35; cursor: not-allowed; }
.scan-review > .primary-button { width: 100%; margin-top: 15px; }

.guide-list { display: grid; }
.guide-list article { display: grid; grid-template-columns: 38px 1fr; gap: 13px; padding: 17px 0; border-top: 1px solid var(--line); }
.guide-icon { display: grid; place-items: center; width: 34px; height: 34px; color: white; border-radius: 3px; font-weight: 800; }
.coral { background: var(--red); }.blue { background: var(--blue); }.amber { background: var(--amber); }.mint { background: var(--mint); }.purple { background: #7b61a8; }.green { background: #43866c; }.gray { background: #7e8581; }
.guide-list h3 { font: 800 13px/1.2 "Manrope"; margin: 1px 0 5px; }
.guide-list p { font-size: 12px; line-height: 1.45; color: var(--muted); margin: 0; }
.notice { display: flex; gap: 11px; padding: 14px; background: #f3eee4; margin-top: 16px; }
.notice > span { flex: 0 0 20px; height: 20px; display: grid; place-items: center; border: 1px solid var(--muted); border-radius: 50%; font: 700 11px/1 serif; }
.notice p { color: var(--muted); font-size: 11px; line-height: 1.5; margin: 0; }
.move-fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.move-picker { margin-top: 0; min-height: 42px; height: 42px !important; padding: 0 10px !important; color: var(--ink) !important; font-size: 10px; }
.move-picker:disabled { opacity: .55; cursor: not-allowed; }
.move-data-note { grid-column: 1 / -1; margin: -2px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.game-search-tool { display: grid; grid-template-columns: minmax(190px,.8fr) minmax(260px,1.2fr); gap: 12px 20px; align-items: end; margin: 18px 0; padding: 16px; border: 1px solid var(--line); background: var(--surface); }
.game-search-tool > div:first-child strong { display: block; font: 800 13px/1.3 "Manrope"; }
.game-search-tool > div:first-child span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.game-search-controls { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.game-search-controls select { min-width: 0; height: 40px; border: 1px solid var(--line); background: #faf8f2; color: var(--ink); padding: 0 9px; }
.game-search-tool textarea { grid-column: 1 / -1; width: 100%; resize: vertical; border: 1px solid var(--line); background: #faf8f2; color: var(--ink); padding: 10px; font: 600 11px/1.5 monospace; }
.game-search-footer { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.game-search-footer span { color: var(--muted); font-size: 9px; line-height: 1.4; }

.team-section { padding: 72px 0 10px; }
.team-live { color: var(--mint); border: 1px solid currentColor; border-radius: 999px; padding: 7px 10px; font-size: 10px; font-weight: 800; }
.team-lead { max-width: 760px; margin: -11px 0 22px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.battle-targets { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin: -7px 0 18px; }
.battle-targets label { display: grid; gap: 6px; }
.battle-targets label > span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.battle-targets select, .battle-targets input[type="text"], .battle-targets input[type="number"] { min-height: 42px; height: 42px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 0 11px; outline: 0; font-size: 11px; }
.battle-targets .check-control { min-height: 42px; align-content: center; grid-template-columns: auto 1fr; padding: 0 11px; border: 1px solid var(--line); background: var(--surface); }
.battle-targets .check-control input { width: 16px; height: 16px; }
.battle-targets .check-control > span { align-self: center; }
.team-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 14px; }
.team-panel { background: var(--surface); border: 1px solid var(--line); padding: 19px; }
.team-panel > header { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.team-panel > header > div { display: flex; gap: 10px; align-items: center; }
.team-panel h3 { margin: 0; font: 800 14px/1.2 "Manrope"; }
.team-panel header b { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.team-icon { display: grid; place-items: center; width: 31px; height: 31px; color: white; border-radius: 3px; font: 800 10px/1 "Manrope"; }
.team-members { display: grid; }
.team-member { display: grid; grid-template-columns: 27px 1fr auto; gap: 10px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.team-member:last-child { border-bottom: 0; padding-bottom: 0; }
.team-rank { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: var(--paper); color: var(--muted); font: 800 10px/1 "Manrope"; }
.team-member h4 { margin: 0 0 3px; font: 800 13px/1.2 "Manrope"; text-transform: capitalize; }
.team-member p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.team-member small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.transfer-explanation { margin-top: 7px; border: 1px solid var(--line); border-radius: 6px; background: rgba(118,124,121,.05); }
.transfer-explanation summary { padding: 7px 9px; color: var(--ink); font-size: 10px; font-weight: 800; line-height: 1.4; cursor: pointer; }
.transfer-explanation ul { margin: 0; padding: 0 10px 9px 27px; color: var(--muted); }
.transfer-explanation li { margin-top: 6px; font-size: 10px; line-height: 1.55; }
.pokemon-card > .transfer-explanation { margin: 10px 0; }
.pokemon-card > .transfer-explanation summary { font-size: 11px; }
.team-member.core-member { background: linear-gradient(90deg,rgba(50,111,166,.07),transparent); }
.core-label { display: inline-block; margin-top: 4px; color: var(--blue); font-size: 8px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.league-status { display: inline-block; margin: 4px 0 0 7px; padding: 3px 6px; border-radius: 999px; font-size: 8px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.league-status.ready { color: #28694f; background: rgba(67,134,108,.13); }
.league-status.investment { color: #9c6608; background: rgba(224,158,45,.14); }
.league-status.hold { color: var(--blue); background: rgba(50,111,166,.12); }
.team-readiness { margin: 12px 0 0; padding: 9px 11px; border: 1px solid var(--line); font-size: 10px; font-weight: 700; line-height: 1.5; }
.team-readiness.ready { color: #28694f; background: rgba(67,134,108,.08); border-color: rgba(67,134,108,.35); }
.team-readiness.waiting { color: #9c6608; background: rgba(224,158,45,.08); border-color: rgba(224,158,45,.35); }
.team-edit { border: 1px solid var(--line); background: transparent; color: var(--muted); padding: 6px 8px; border-radius: 3px; cursor: pointer; font-size: 9px; font-weight: 800; }
.team-edit:hover { border-color: var(--blue); color: var(--blue); }
.team-actions { display: grid; gap: 5px; }
.team-delete { border: 1px solid rgba(232,74,56,.45); background: transparent; color: var(--red); padding: 6px 8px; border-radius: 3px; cursor: pointer; font-size: 9px; font-weight: 800; }
.team-delete:hover { background: var(--red); color: white; border-color: var(--red); }
.team-empty { padding: 18px 0 3px; color: var(--muted); font-size: 11px; }
.team-notice { display: flex; gap: 10px; align-items: center; margin-top: 14px; padding: 12px 14px; border: 1px dashed var(--line); color: var(--muted); }
.team-notice > span { flex: 0 0 19px; width: 19px; height: 19px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font: 700 10px/1 serif; }
.team-notice p { margin: 0; font-size: 10px; line-height: 1.5; }
.collection-section { padding: 72px 0 100px; }
.section-title { margin-bottom: 24px; }
.collection-tools { display: grid; justify-items: end; gap: 9px; font-size: 12px; color: var(--muted); }
.collection-data-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px 13px; }
.collection-data-actions .text-button { white-space: nowrap; }
.cloudkit-panel { margin: 0 0 14px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(99,168,139,.06); }
.cloudkit-panel > div:first-child { display: grid; gap: 3px; }
.cloudkit-panel strong { font: 800 11px/1.2 "Manrope"; }
.cloudkit-panel span { color: var(--muted); font-size: 9px; line-height: 1.4; }
.cloudkit-auth, .cloudkit-conflict { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.remote-sync-panel { background: rgba(65,122,190,.07); }
.remote-sync-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.remote-sync-controls input { min-width: 220px; min-height: 38px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); padding: 0 10px; font-size: 10px; }
.cloudkit-conflict { justify-content: flex-end; }
.cloudkit-conflict .outline-button { min-height: 32px; padding: 6px 10px; font-size: 9px; }
.collection-controls { display: grid; grid-template-columns: minmax(240px,2fr) repeat(3,minmax(120px,1fr)) repeat(2,100px) auto; gap: 9px; align-items: end; margin-bottom: 16px; }
.collection-controls > label:not(.collection-search) { display: grid; gap: 6px; }
.collection-controls > label:not(.collection-search) > span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.collection-controls select, .collection-controls .cp-limit input { min-height: 44px; border: 1px solid var(--line); background: var(--surface); padding: 0 10px; color: var(--ink); outline: 0; font-size: 11px; }
.collection-search { display: flex; align-items: center; gap: 9px; min-height: 44px; border: 1px solid var(--line); background: var(--surface); padding: 0 13px; }
.collection-search span { color: var(--muted); font-size: 20px; }
.collection-search input { width: 100%; border: 0; background: transparent; padding: 12px 0; outline: 0; }
.reset-filters { min-height: 44px; white-space: nowrap; }
.filter-row { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.filter { white-space: nowrap; border: 0; background: transparent; border-radius: 999px; padding: 8px 13px; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.filter.active { background: var(--ink); color: var(--surface); }
.filter span { opacity: .65; margin-left: 5px; }
.empty-state { min-height: 390px; display: grid; place-items: center; align-content: center; text-align: center; }
.empty-orbit { width: 96px; height: 96px; border: 1px dashed #bcb7ae; border-radius: 50%; display: grid; place-items: center; margin-bottom: 20px; }
.brand-mark.large { width: 42px; color: var(--ink); background: var(--surface); }
.brand-mark.large i { width: 12px; }
.empty-state h3 { font: 800 18px/1.2 "Manrope"; margin: 0 0 8px; }
.empty-state p { max-width: 420px; margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.outline-button { border: 1px solid var(--ink); background: transparent; padding: 9px 15px; border-radius: 3px; font-size: 12px; font-weight: 800; cursor: pointer; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; padding-top: 24px; }
.collection-pagination { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 28px 0 0; }
.collection-pagination span { min-width: 100px; color: var(--muted); text-align: center; font-size: 12px; font-weight: 800; }
.collection-pagination button:disabled { opacity: .4; cursor: default; }
.pokemon-card { background: var(--surface); border: 1px solid var(--line); padding: 22px; position: relative; animation: rise .35s ease both; }
.pokemon-card.editing { grid-column: 1 / -1; border-color: var(--blue); box-shadow: var(--shadow); }
.pokemon-card.editing > :not(.inline-edit-slot) { display: none; }
.inline-edit-slot:empty { display: none; }
.inline-edit-slot::before { content: "BU POKÉMON’U DÜZENLİYORSUN"; display: block; margin-bottom: 17px; color: var(--blue); font: 800 10px/1 "Manrope"; letter-spacing: .08em; }
.inline-card-form { width: 100%; }
.inline-edit-notice { margin: 0; padding: 14px; border: 1px dashed var(--blue); color: var(--blue); font-size: 11px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } }
.card-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.dex-number { color: var(--muted); font: 800 11px/1 "Manrope"; letter-spacing: .08em; }
.star-rating { border: 1px solid var(--line); border-radius: 999px; padding: 5px 8px; color: var(--muted); font: 800 10px/1 "Manrope"; }
.star-rating.star-3 { border-color: var(--amber); color: #b67508; background: rgba(224,158,45,.08); }
.star-rating.star-4 { border-color: var(--red); color: var(--red); background: rgba(226,81,63,.08); }
.card-top { display: flex; justify-content: space-between; gap: 14px; align-items: start; }
.pokemon-name { font: 800 20px/1.2 "Manrope"; margin: 0; text-transform: capitalize; }
.cp { font-size: 11px; font-weight: 800; color: var(--muted); margin-top: 5px; }
.score-ring { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font: 800 12px/1 "Manrope"; background: conic-gradient(var(--red) var(--score), #e8e4dc 0); position: relative; }
.score-ring::before { content: ""; position: absolute; inset: 5px; background: var(--surface); border-radius: 50%; }
.score-ring span { position: relative; }
.mini-tags { display: flex; gap: 5px; flex-wrap: wrap; margin: 12px 0 16px; min-height: 22px; }
.mini-tags span { padding: 4px 8px; border-radius: 999px; background: #efebe3; font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.mini-tags .mega-detail { background: rgba(226,81,63,.09); color: var(--red); }
.mini-tags .league-team-tag { color: white; }
.mini-tags .league-team-tag.great { background: var(--blue); }
.mini-tags .league-team-tag.ultra { background: var(--amber); }
.mini-tags .league-team-tag.master { background: var(--red); }
.mini-tags .dynamax-team-tag { background: #7b61a8; color: white; }
.mini-tags .transfer-rank-tag { background: #737a76; color: white; }
.mini-tags .evolution-rank-tag { background: #43866c; color: white; }
.mini-tags .investment-rank-tag { background: #7b61a8; color: white; }
.mini-tags .role-team-tag { color: white; }
.mini-tags .raid-role { background: var(--red); }
.mini-tags .rocket-role { background: var(--amber); }
.mini-tags .gym-role { background: #43866c; }
.missing-info { display: flex; gap: 7px; align-items: center; margin: -3px 0 13px; padding: 9px 10px; border: 1px solid rgba(224,158,45,.42); background: rgba(224,158,45,.08); color: #9c6608; font-size: 9px; font-weight: 800; }
.missing-info::before { content: "!"; flex: 0 0 17px; width: 17px; height: 17px; display: grid; place-items: center; border-radius: 50%; background: var(--amber); color: white; }
.decision-facts { display: grid; gap: 8px; margin: 0 0 14px; padding: 11px 12px; border: 1px solid var(--line); background: rgba(84,121,171,.045); }
.decision-facts > div:first-child { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 7px; font-size: 10px; }
.decision-facts > div:first-child strong { color: var(--blue); }
.decision-facts em { flex-basis: 100%; color: var(--red); font-style: normal; }
.decision-facts p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.league-facts, .progress-facts { display: grid; gap: 5px; }
.league-facts span { color: var(--muted); font-size: 9px; line-height: 1.4; }
.league-facts b { display: inline-block; min-width: 22px; color: var(--ink); }
.progress-facts { display: flex; flex-wrap: wrap; }
.progress-facts span { padding: 4px 7px; border-radius: 999px; background: rgba(99,168,139,.12); color: #43866c; font-size: 8px; font-weight: 800; }
.evaluation-report { margin: 0 0 14px; padding: 15px 17px; border-left: 4px solid var(--mint); background: rgba(99,168,139,.09); }
.evaluation-report strong { font: 800 12px/1.2 "Manrope"; }
.evaluation-report p, .evaluation-report li, .evaluation-report small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.evaluation-report p { margin: 5px 0; }.evaluation-report ul { margin: 8px 0 0; padding-left: 18px; }
.data-version { margin: -4px 0 15px; color: var(--muted); font-size: 9px; }
.iv-breakdown { display: grid; gap: 8px; margin-bottom: 16px; padding: 13px 0; border-top: 1px solid var(--line); }
.iv-stat { display: grid; grid-template-columns: 58px 1fr 43px; gap: 9px; align-items: center; }
.iv-stat > span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.iv-stat > b { text-align: right; font: 800 10px/1 "Manrope"; }
.iv-track { height: 7px; overflow: hidden; border-radius: 999px; background: #e6e3dc; }
.iv-track i { display: block; height: 100%; border-radius: inherit; background: var(--amber); }
.iv-stat:nth-child(3) .iv-track i { background: var(--red); }
.move-set { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; }
.move-chip { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 3px; padding: 6px 8px; font-size: 9px; font-weight: 800; }
.move-chip small { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.move-chip.fast::before { content: "H"; color: var(--blue); }
.move-chip.charged::before { content: "Y"; color: var(--red); }
.move-advice { margin: 0 0 14px; padding: 11px 12px; border-left: 3px solid var(--blue); background: rgba(50,111,166,.06); }
.move-advice strong { display: block; margin-bottom: 4px; font: 800 9px/1 "Manrope"; color: var(--blue); letter-spacing: .06em; text-transform: uppercase; }
.move-advice p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.move-advice p + p { margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--line); }
.move-advice.good { border-color: var(--mint); background: rgba(76,165,138,.07); }
.move-advice.good strong { color: var(--mint); }
.move-advice.warn { border-color: var(--amber); background: rgba(224,158,45,.07); }
.move-advice.warn strong { color: #b67508; }
.evolution-advice { margin: 0 0 14px; padding: 11px 12px; border-left: 3px solid #43866c; background: rgba(67,134,108,.07); }
.evolution-advice strong { display: block; margin-bottom: 4px; font: 800 9px/1 "Manrope"; color: #43866c; letter-spacing: .06em; text-transform: uppercase; }
.evolution-advice p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.evolution-advice.blocked { border-color: #8b8176; background: rgba(115,122,118,.07); }
.evolution-advice.blocked strong { color: #737a76; }
.evolution-advice.caution { border-color: var(--amber); background: rgba(224,158,45,.07); }
.evolution-advice.caution strong { color: #b67508; }
.recommendations { display: flex; flex-wrap: wrap; gap: 7px; padding-top: 15px; border-top: 1px solid var(--line); }
.rec { border-radius: 3px; padding: 7px 9px; font-size: 10px; font-weight: 800; color: white; }
.rec.raid { background: var(--red); }.rec.league { background: var(--blue); }.rec.rocket { background: var(--amber); }.rec.buddy { background: var(--mint); }.rec.transfer { background: #767c79; }.rec.review { background: #8b938f; }
.card-note { color: var(--muted); font-size: 11px; line-height: 1.45; margin: 13px 0 0; }
.card-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 15px; }
.card-actions button { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 3px; padding: 6px 9px; cursor: pointer; font-size: 10px; font-weight: 800; }
.edit-card:hover { border-color: var(--blue); color: var(--blue); }
.delete-card:hover { border-color: var(--red); color: var(--red); }
.toast { position: fixed; left: 50%; bottom: 25px; transform: translate(-50%, 20px); background: var(--ink); color: white; padding: 11px 16px; border-radius: 3px; font-size: 12px; font-weight: 700; opacity: 0; pointer-events: none; transition: .25s; z-index: 20; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

body.dark { --paper:#171b1a; --surface:#202624; --ink:#edf0e9; --muted:#a6aea9; --line:#39413e; --shadow:0 18px 50px rgba(0,0,0,.18); }
body.dark { background-color: var(--paper); }
body.dark .topbar { background: rgba(23,27,26,.86); }
body.dark .app-navigation { background: rgba(23,27,26,.94); }
body.dark input, body.dark textarea, body.dark .iv-grid label, body.dark .progress-grid select { background: #1b201e; }
body.dark .collection-controls select, body.dark .iv-track { background: #2b312e; }
body.dark .battle-targets select { background: #2b312e; }
body.dark .dropzone, body.dark .scan-file, body.dark .review-row input, body.dark .review-row select, body.dark .game-search-controls select, body.dark .game-search-tool textarea { background: #1b201e; }
body.dark .notice, body.dark .mini-tags span { background: #2b312e; }
body.dark .team-rank { background: #2b312e; }
body.dark .move-advice { background: #252d2b; }
body.dark .evolution-advice { background: #252d2b; }
body.dark .decision-facts, body.dark .evaluation-report { background: #252d2b; }
body.dark .score-ring::before { background: var(--surface); }

@media (max-width: 820px) {
  .workspace { grid-template-columns: 1fr; }
  .guide-panel { order: 2; }
  .cards { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; }
  .battle-targets { grid-template-columns: 1fr; }
  .progress-grid, .progress-grid.three { grid-template-columns: 1fr; }
  .collection-controls { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .collection-search { grid-column: 1 / -1; }
  .hero { padding-top: 58px; }
}
@media (max-width: 540px) {
  main { width: min(100% - 24px, 1180px); }
  .collection-controls { grid-template-columns: 1fr; }
  .collection-search { grid-column: auto; }
  .topbar { min-height: calc(62px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) max(14px, env(safe-area-inset-right, 0px)) 0 max(14px, env(safe-area-inset-left, 0px)); }
  .app-navigation { top: calc(62px + env(safe-area-inset-top, 0px)); padding: 8px max(12px, env(safe-area-inset-right, 0px)) 7px max(12px, env(safe-area-inset-left, 0px)); }
  .app-navigation a { min-height: 36px; }
  .sync-state { display: none; }
  .hero { padding: 46px 2px 36px; }
  .hero > p { font-size: 15px; }
  .home-actions { display: grid; }
  .home-actions a { width: 100%; }
  .collection-pagination { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
  .collection-pagination span { grid-column: 1 / -1; grid-row: 1; }
  .entry-panel, .guide-panel { padding: 22px 18px; }
  .panel-heading { align-items: flex-start; margin-bottom: 25px; }
  form { gap: 17px 9px; }
  .field.span-2, .iv-fieldset.span-2, .tag-fieldset.span-2, .progress-fieldset.span-2, .primary-button.span-2 { grid-column: span 2; }
  .move-fields { grid-template-columns: 1fr; }
  .bulk-help { display: grid; gap: 4px; }
  .entry-modes { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px 12px; }
  .scan-files { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .review-labels { display: none; }
  .review-row { grid-template-columns: 22px 1fr 62px 22px; align-items: start; padding: 10px 4px; }
  .review-row .iv-mini { grid-column: 2 / 4; }
  .review-row input[data-field="level"] { grid-column: 2; }
  .review-row .scan-tag-editor { grid-column: 3 / 4; }
  .scan-quick-decision { grid-template-columns: 1fr; }
  .review-row .remove-review { grid-column: 4; grid-row: 1; }
  .scan-evidence { grid-template-columns: 1fr; }
  .game-search-tool { grid-template-columns: 1fr; }
  .game-search-controls, .game-search-tool textarea, .game-search-footer { grid-column: 1; }
  .section-title { align-items: flex-start; }
  .team-section .section-title { display: grid; }
  .team-panel > header { align-items: flex-start; }
  .collection-tools { justify-items: start; }
  .collection-data-actions { justify-content: flex-start; }
  .cloudkit-panel { align-items: flex-start; flex-direction: column; }
  .cloudkit-conflict { justify-content: flex-start; }
  input, textarea, select { font-size: 16px; }
  .icon-button, .install-button, .text-button, .outline-button, .primary-button { min-height: 44px; }
  .header-actions { gap: 8px; }
  .install-button { padding-inline: 10px; }
  .install-guide-card { padding: 28px 22px; }
}
