:root {
  color-scheme: light;
  --ink: #182026;
  --muted: #68737f;
  --line: #d9e0e7;
  --panel: #ffffff;
  --soft: #f4f7f9;
  --blue: #1d64d8;
  --blue-ink: #0c3d8a;
  --red: #c83f43;
  --green: #24805a;
  --yellow: #f2c94c;
  --shadow: 0 16px 42px rgba(22, 32, 42, 0.11);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: #b8c4d0 #edf2f6;
  scrollbar-width: thin;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(29, 100, 216, 0.08), transparent 34%),
    linear-gradient(300deg, rgba(36, 128, 90, 0.1), transparent 34%),
    #edf2f6;
  font-family:
    "Segoe UI",
    "Yu Gothic UI",
    "Hiragino Sans",
    Meiryo,
    sans-serif;
  -webkit-tap-highlight-color: rgba(29, 100, 216, 0.18);
}

button,
input,
fieldset,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}

input,
textarea,
button {
  -webkit-appearance: none;
  appearance: none;
}

input[type="date"] {
  -webkit-appearance: auto;
  appearance: auto;
}

.app-shell {
  display: grid;
  grid-template-columns: 284px minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
}

.brand,
.section-head,
.member-top,
.actions,
.toolbar {
  display: flex;
  align-items: center;
}

.brand,
.section-head {
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue-ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
}

.icon-button,
.ghost-button,
.danger-button,
.tool-button,
.tab,
.rule-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.icon-button {
  width: 42px;
  font-size: 24px;
  line-height: 1;
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.search-box,
.updated-field label,
.rule-toggle,
.notes-field,
.member-fields label {
  position: relative;
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.rule-toggle {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.rule-toggle legend {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.segment {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.segment.is-active {
  border-color: var(--line);
  background: #fff;
  color: var(--blue-ink);
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
  font-size: 16px;
}

input {
  height: 38px;
  padding: 0 10px;
}

.updated-field output {
  display: flex;
  align-items: center;
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

textarea {
  min-height: 84px;
  padding: 10px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(29, 100, 216, 0.14);
}

.toolbar {
  gap: 8px;
}

.tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 0 10px;
}

.file-button input {
  display: none;
}

.usage-update {
  display: grid;
  gap: 5px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.usage-update div,
.usage-update p {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.usage-update strong {
  color: var(--ink);
}

.usage-update a {
  color: var(--blue-ink);
  text-decoration: none;
}

.usage-update.is-new {
  border-color: rgba(200, 63, 67, 0.55);
  background: #fff7f7;
}

.usage-update.is-ok {
  border-color: rgba(36, 128, 90, 0.45);
  background: #f4fbf7;
}

.usage-update.is-manual {
  background: #fffdf3;
}

.build-list {
  display: grid;
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.build-item {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  text-align: left;
}

.build-item.is-active {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(29, 100, 216, 0.12);
}

.build-item strong {
  display: block;
  font-size: 15px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.build-item span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.build-sprite-grid {
  display: grid;
  grid-template-columns: repeat(3, 42px);
  grid-auto-rows: 42px;
  gap: 5px;
  justify-content: start;
}

.build-sprite {
  display: grid;
  place-items: start;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
}

.build-sprite.is-empty {
  opacity: 0.45;
}

.build-sprite-inner {
  display: block;
  width: 128px;
  height: 128px;
  background-repeat: no-repeat;
  transform: scale(0.328125);
  transform-origin: top left;
}

.build-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 0;
}

.build-item-meta span {
  margin-top: 0;
}

.build-item-meta span:last-child {
  color: var(--blue-ink);
  font-weight: 900;
}

.workspace {
  min-width: 0;
  padding: 12px;
}

.editor-panel {
  display: grid;
  grid-template-columns: minmax(280px, max-content) auto auto minmax(220px, 300px) auto;
  align-items: end;
  gap: 12px 14px;
  width: 100%;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.title-input {
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: clamp(24px, 2.8vw, 34px);
  font-weight: 900;
  line-height: 1.18;
}

.title-input:focus {
  box-shadow: none;
}

.actions {
  grid-column: 5;
  grid-row: 1;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ghost-button,
.danger-button {
  padding: 0 12px;
}

.danger-button {
  color: #fff;
  border-color: var(--red);
  background: var(--red);
}

.updated-field {
  grid-column: 4;
  grid-row: 1;
  align-self: end;
  min-width: 0;
}

.tabs {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  display: inline-grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.rule-button {
  grid-column: 3;
  grid-row: 1;
  align-self: end;
  justify-self: start;
  min-width: 104px;
  padding: 0 14px;
  color: var(--blue-ink);
}

.tab {
  min-width: 92px;
  border-color: transparent;
  background: transparent;
}

.tab.is-active {
  background: #fff;
  border-color: var(--line);
  color: var(--blue-ink);
}

.tab-page {
  grid-column: 1 / -1;
  grid-row: 2;
  display: none;
  margin-top: 0;
}

.tab-page.is-active {
  display: block;
}

.section-head {
  display: contents;
}

.section-head > div:first-child {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(300px, 1fr));
  gap: 10px;
  max-width: 1320px;
  margin: 0 auto;
}

.member-card {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.member-top {
  position: relative;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.slot-number {
  display: inline-grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-weight: 900;
}

.pokemon-name {
  min-width: 0;
  font-weight: 900;
}

.pokemon-image {
  display: inline-grid;
  place-items: start;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.pokemon-image.is-empty {
  opacity: 0.55;
}

.pokemon-image-sprite {
  display: block;
  width: 128px;
  height: 128px;
  background-repeat: no-repeat;
  transform: scale(0.4375);
  transform-origin: top left;
}

.pokemon-input-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.pokemon-input-wrap .autocomplete-menu {
  left: 0;
}

.autocomplete-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 44px;
  right: 0;
  z-index: 20;
  max-height: 210px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(24, 32, 38, 0.16);
}

.move-suggestion-wrap {
  position: relative;
  min-width: 0;
}

.move-suggestion-wrap .move {
  display: block;
}

.move-suggestion-menu {
  left: 0;
  max-height: 218px;
}

.autocomplete-menu[hidden] {
  display: none;
}

.autocomplete-option {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.autocomplete-option.has-rate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.autocomplete-option.has-rate span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.move-rate {
  flex: 0 0 auto;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
}

.autocomplete-option:hover,
.autocomplete-option.is-active {
  background: var(--soft);
  color: var(--blue-ink);
}

.autocomplete-option:hover .move-rate,
.autocomplete-option.is-active .move-rate {
  color: var(--blue-ink);
}

.member-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 8px;
}

.stat-panel {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.stat-panel-head,
.stat-row {
  display: grid;
  align-items: center;
  grid-template-columns: 28px 42px minmax(48px, 1fr) 42px 50px;
  gap: 6px;
}

.stat-panel-head {
  grid-template-columns: auto minmax(0, 1fr) auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.stat-context {
  color: var(--blue-ink);
  justify-self: end;
}

.ev-lock-all-button,
.ev-lock-toggle {
  min-width: 0;
  height: 28px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: #fff;
  font-size: 11px;
  font-weight: 900;
}

.ev-lock-all-button {
  min-width: 62px;
}

.ev-lock-all-button.is-locked,
.ev-lock-toggle.is-locked {
  color: #fff;
  border-color: var(--blue-ink);
  background: var(--blue-ink);
}

.stat-rows {
  display: grid;
  gap: 4px;
}

.stat-row {
  min-height: 24px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.stat-value.is-up {
  color: var(--red);
}

.stat-value.is-down {
  color: var(--blue);
}

.stat-bar {
  position: relative;
  height: 14px;
  overflow: hidden;
  border: 1px solid #c6d0da;
  border-radius: 6px;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent calc(3.125% - 1px),
      rgba(24, 32, 38, 0.18) calc(3.125% - 1px),
      rgba(24, 32, 38, 0.18) 3.125%
    ),
    #eef3f7;
}

.stat-bar:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.stat-row.is-locked .stat-bar {
  cursor: not-allowed;
  opacity: 0.5;
  filter: grayscale(0.45);
}

.stat-row.is-locked .stat-ev-handle {
  opacity: 0.65;
}

.stat-ev-fill {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--yellow), #f29f05);
  transition: width 160ms ease-out;
}

.stat-ev-handle {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 3;
  width: 8px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--blue-ink);
  box-shadow: 0 1px 4px rgba(24, 32, 38, 0.25);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.stat-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(24, 32, 38, 0.55);
  z-index: 2;
}

.stat-tick.is-ten {
  left: 31.25%;
}

.stat-tick.is-twenty {
  left: 62.5%;
}

.stat-tick.is-thirty {
  left: 93.75%;
}

.stat-row .ev {
  height: 28px;
  padding: 0 5px;
  text-align: center;
}

.stat-row.is-up .stat-ev-fill {
  background: linear-gradient(90deg, #f07b69, var(--red));
}

.stat-row.is-up .stat-ev-handle {
  background: var(--red);
}

.stat-row.is-down .stat-ev-fill {
  background: linear-gradient(90deg, #6aa8f7, var(--blue));
}

.stat-row.is-down .stat-ev-handle {
  background: var(--blue);
}

.stat-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.moves {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.member-note {
  min-height: 56px;
}

@media (min-width: 1280px) and (min-height: 900px) {
  .team-grid {
    gap: 8px;
  }

  .member-card {
    gap: 7px;
    padding: 8px;
  }

  .member-top {
    gap: 6px;
  }

  .pokemon-image {
    flex-basis: 50px;
    width: 50px;
    height: 50px;
  }

  .pokemon-image-sprite {
    transform: scale(0.390625);
  }

  .member-fields {
    gap: 6px;
  }

  .stat-panel {
    gap: 4px;
    padding: 6px;
  }

  .stat-row {
    min-height: 22px;
  }

  .stat-row .ev {
    height: 24px;
  }

  .member-note {
    min-height: 46px;
  }
}

@media (min-width: 921px) and (max-width: 1360px) {
  .editor-panel {
    grid-template-columns: minmax(240px, 1fr) auto auto auto;
  }

  .actions {
    grid-column: 4;
    grid-row: 1;
  }

  .updated-field {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: end;
    width: min(300px, 100%);
  }

  .tab-page {
    grid-row: 3;
  }
}

.notes-field textarea {
  min-height: 380px;
}

#obsidianOutput {
  min-height: 520px;
  font-family: Consolas, "Yu Gothic UI", monospace;
  line-height: 1.55;
}

.summary {
  display: grid;
  gap: 10px;
}

.summary-header,
.summary-member {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.summary-header h2,
.summary-member h3 {
  margin: 0;
}

.summary-header p,
.summary-member p,
.summary-member ul {
  color: var(--muted);
  line-height: 1.65;
}

.summary-member ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px;
  margin: 10px 0 0;
  padding-left: 20px;
}

.empty-state {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  text-align: center;
}

@media (max-width: 920px) {
  .editor-panel {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .section-head > div:first-child {
    grid-column: 1;
    grid-row: 1;
  }

  .actions {
    grid-column: 2;
    grid-row: 1;
  }

  .updated-field {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .tabs {
    grid-column: 1 / -1;
    grid-row: 3;
    width: 100%;
  }

  .rule-button {
    grid-column: 1 / -1;
    grid-row: 4;
    justify-self: stretch;
  }

  .tab-page {
    grid-column: 1 / -1;
    grid-row: 5;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .build-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 260px;
  }

  .workspace {
    padding: 18px;
  }

  .team-grid,
  .updated-field {
    grid-template-columns: 1fr;
  }

  .team-grid {
    max-width: none;
  }
}

@media (min-width: 921px) and (max-width: 1280px) {
  .team-grid {
    grid-template-columns: repeat(2, minmax(270px, 1fr));
    max-width: none;
  }
}

@media (max-width: 560px) {
  body {
    background: #edf2f6;
  }

  .sidebar {
    gap: 6px;
    padding: 8px;
    padding-top: max(8px, env(safe-area-inset-top));
    padding-left: max(8px, env(safe-area-inset-left));
    padding-right: max(8px, env(safe-area-inset-right));
  }

  .workspace {
    padding: 6px;
    padding-right: max(6px, env(safe-area-inset-right));
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    padding-left: max(6px, env(safe-area-inset-left));
  }

  .editor-panel {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 8px;
    border-radius: 0;
    box-shadow: none;
  }

  .brand,
  .section-head {
    gap: 6px;
  }

  h1 {
    font-size: 20px;
  }

  .eyebrow {
    margin-bottom: 2px;
    font-size: 10px;
  }

  .icon-button {
    width: 32px;
    min-height: 32px;
    font-size: 20px;
  }

  .ghost-button,
  .danger-button,
  .tool-button,
  .tab,
  .rule-button {
    min-height: 32px;
    border-radius: 6px;
    font-size: 12px;
  }

  input {
    height: 32px;
    padding: 0 7px;
    border-radius: 6px;
  }

  .updated-field output {
    height: 32px;
    padding: 0 7px;
    border-radius: 6px;
    font-size: 12px;
  }

  textarea {
    padding: 7px;
    border-radius: 6px;
  }

  .search-box,
  .updated-field label,
  .rule-toggle,
  .notes-field,
  .member-fields label {
    gap: 4px;
    font-size: 11px;
  }

  .rule-toggle legend {
    margin-bottom: 4px;
    font-size: 11px;
  }

  .search-box > span {
    display: none;
  }

  .section-head {
    align-items: center;
    flex-direction: row;
  }

  .actions,
  .toolbar,
  .tabs {
    width: 100%;
  }

  .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    width: auto;
    min-width: 116px;
  }

  .ghost-button,
  .danger-button,
  .tool-button {
    padding: 0 6px;
    font-size: 11px;
  }

  .toolbar {
    gap: 4px;
  }

  .usage-update {
    gap: 3px;
    padding: 5px 6px;
    border-radius: 6px;
    font-size: 10px;
  }

  .usage-update div,
  .usage-update p {
    gap: 4px;
  }

  .build-list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(142px, 1fr);
    grid-template-rows: 1fr;
    grid-template-columns: none;
    gap: 4px;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
  }

  .build-item {
    padding: 6px;
    border-radius: 6px;
  }

  .build-item strong {
    font-size: 13px;
  }

  .build-item span {
    display: none;
  }

  .build-sprite-grid {
    grid-template-columns: repeat(3, 30px);
    grid-auto-rows: 30px;
    gap: 3px;
    margin-top: 6px;
  }

  .build-sprite {
    width: 30px;
    height: 30px;
    border-radius: 5px;
  }

  .build-sprite-inner {
    transform: scale(0.234375);
  }

  .build-item-meta {
    display: none;
  }

  .title-input {
    font-size: 22px;
  }

  .updated-field {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: 8px 0;
  }

  .rule-toggle {
    grid-column: 1 / -1;
  }

  .segmented-control,
  .tabs {
    border-radius: 6px;
  }

  .segment {
    min-height: 28px;
    border-radius: 5px;
    font-size: 12px;
  }

  .tabs {
    display: grid;
  }

  .tab-page {
    margin-top: 8px;
  }

  .team-grid {
    gap: 8px;
  }

  .summary-member ul {
    grid-template-columns: 1fr;
  }

  .tab {
    min-width: 0;
  }

  .member-card {
    gap: 6px;
    padding: 8px;
    border-radius: 6px;
  }

  .member-top {
    gap: 5px;
  }

  .slot-number {
    flex-basis: 26px;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    font-size: 12px;
  }

  .pokemon-image {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
    border-radius: 6px;
  }

  .pokemon-image-sprite {
    transform: scale(0.34375);
  }

  .member-fields,
  .moves {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .member-fields label:nth-child(3) {
    grid-column: 1 / -1;
  }

  .stat-panel {
    gap: 4px;
    padding: 5px;
    border-radius: 6px;
  }

  .stat-panel-head {
    font-size: 11px;
  }

  .stat-row {
    grid-template-columns: 16px 32px minmax(70px, 1fr) 34px 40px;
    gap: 4px;
    min-height: 20px;
    font-size: 11px;
  }

  .stat-rows {
    gap: 4px;
  }

  .stat-bar {
    height: 12px;
    border-radius: 5px;
  }

  .stat-row .ev {
    height: 22px;
    padding: 0 3px;
  }

  .member-note {
    min-height: 38px;
  }

  .autocomplete-menu {
    left: 0;
    max-height: 172px;
    border-radius: 6px;
  }

  .autocomplete-option {
    min-height: 28px;
    padding: 4px 6px;
    border-radius: 5px;
    font-size: 12px;
  }

  .notes-field textarea {
    min-height: 220px;
  }

  #obsidianOutput {
    min-height: 320px;
  }
}

@media (max-width: 380px) {
  .pokemon-image {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
  }

  .pokemon-image-sprite {
    transform: scale(0.3125);
  }

  .stat-row {
    grid-template-columns: 16px 32px minmax(56px, 1fr) 34px 40px;
    gap: 4px;
  }
}
