﻿:root {
  color-scheme: light;
  --bg: #f3f5f2;
  --surface: #ffffff;
  --surface-2: #eef1ed;
  --header-bg: rgba(243, 245, 242, 0.92);
  --ink: #151916;
  --muted: #66706a;
  --line: #d8ded8;
  --green: #1f7a4f;
  --blue: #315f97;
  --red: #b84235;
  --amber: #b1761f;
  --focus: rgba(49, 95, 151, 0.24);
  --surface-hover: #f8faf8;
  --shadow: 0 8px 24px rgba(21, 25, 22, 0.07);
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101411;
  --surface: #171d19;
  --surface-2: #202821;
  --header-bg: rgba(17, 22, 18, 0.94);
  --ink: #f4f7f1;
  --muted: #aab7ad;
  --line: #334137;
  --green: #69d59b;
  --blue: #8dbadd;
  --red: #ff8b7e;
  --amber: #e3ba67;
  --focus: rgba(141, 186, 221, 0.24);
  --surface-hover: #1d261f;
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 9% 8%, color-mix(in srgb, var(--green) 8%, transparent) 0 16rem, transparent 26rem),
    radial-gradient(circle at 88% 3%, color-mix(in srgb, var(--blue) 7%, transparent) 0 18rem, transparent 30rem),
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 42%, transparent), transparent 18rem),
    var(--bg);
  color: var(--ink);
  transition: background 160ms ease, color 160ms ease;
}

body.mix-tree-fullscreen-active {
  overflow: hidden;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(10rem, max-content) minmax(0, 1fr) auto;
  grid-template-rows: minmax(2.8rem, auto);
  align-items: center;
  gap: 0.42rem 0.85rem;
  min-height: 3.65rem;
  padding: 0.58rem clamp(0.75rem, 2vw, 1.5rem);
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  box-shadow: 0 12px 34px rgba(21, 25, 22, 0.06);
  backdrop-filter: blur(18px);
}

.brand-area {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 0 0 auto;
  min-width: 0;
}

.brand-home {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  max-width: 100%;
  min-width: 0;
  min-height: 2.8rem;
  padding: 0.16rem 0.45rem 0.16rem 0.2rem;
  border-color: transparent;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.brand-home:hover,
.brand-home:focus-visible {
  border-color: color-mix(in srgb, var(--green) 28%, var(--line));
  background: color-mix(in srgb, var(--green) 8%, var(--surface));
}

.header-nav {
  display: contents;
  min-width: 0;
}

.header-actions {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.34rem;
  align-self: center;
  flex: 0 0 auto;
  margin-left: auto;
  padding: 0.18rem;
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #ffffff 58%, transparent),
    0 8px 22px rgba(21, 25, 22, 0.06);
  backdrop-filter: blur(12px);
}

@media (max-width: 1120px) {
  .app-header {
    gap: 0.65rem;
  }

  .member-status {
    max-width: 18rem;
  }

  .member-copy {
    max-width: 7rem;
  }

  .support-link-button {
    min-width: auto;
    padding-inline: 0.72rem;
  }

  .theme-toggle {
    min-width: 2.3rem;
    padding: 0;
  }
}

.member-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.22rem;
  max-width: min(18rem, 25vw);
  padding: 0.2rem 0.32rem;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #ffffff 58%, transparent);
}

.member-status[data-tier="premium"] {
  border-color: color-mix(in srgb, var(--green) 34%, var(--line));
  background: color-mix(in srgb, var(--green) 7%, var(--surface));
}

.member-status[data-tier="admin"] {
  border-color: color-mix(in srgb, var(--amber) 36%, var(--line));
  background: color-mix(in srgb, var(--amber) 7%, var(--surface));
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.member-status[data-tier="admin"]:hover,
.member-status[data-tier="admin"]:focus-visible {
  border-color: color-mix(in srgb, var(--amber) 54%, var(--line));
  background: color-mix(in srgb, var(--amber) 12%, var(--surface));
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #ffffff 58%, transparent),
    0 8px 18px color-mix(in srgb, var(--amber) 14%, transparent);
}

.member-status[data-tier="admin"]:active {
  transform: translateY(1px);
}

.member-status[data-tier="blocked"] {
  border-color: color-mix(in srgb, var(--red) 48%, var(--line));
  background: color-mix(in srgb, var(--red) 9%, var(--surface));
}

.member-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.72rem;
  height: 1.72rem;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 18%, var(--surface));
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 950;
}

.member-status[data-tier="admin"] .member-avatar {
  background: color-mix(in srgb, var(--amber) 22%, var(--surface));
  color: var(--amber);
}

.member-status[data-tier="admin"] .member-copy small {
  color: var(--amber);
  font-weight: 950;
}

.member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.member-copy {
  display: grid;
  min-width: 0;
  max-width: 10rem;
  line-height: 1.15;
}

.member-copy strong,
.member-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-copy strong {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 950;
}

.member-copy small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
}

.member-login-button {
  min-height: 1.72rem;
  padding: 0 0.55rem;
  border-color: color-mix(in srgb, var(--green) 34%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--green) 9%, var(--surface));
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 950;
  white-space: nowrap;
}

.member-login-link-button {
  min-height: 1.72rem;
  padding: 0 0.5rem;
  border-color: color-mix(in srgb, var(--blue) 28%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 6%, var(--surface));
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 950;
  white-space: nowrap;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: min(13.5rem, 27vw);
}

.brand-logo img {
  display: block;
  width: 100%;
  max-height: 2.65rem;
  object-fit: contain;
}

.brand-title {
  display: grid;
  min-width: 0;
}

.brand-title strong {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 950;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.support-link-button,
.theme-toggle,
.language-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 2.22rem;
  padding: 0 0.85rem;
  border-radius: 999px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 color-mix(in srgb, #ffffff 58%, transparent);
}

.support-link-button {
  padding: 0 0.85rem;
  border-color: color-mix(in srgb, var(--amber) 30%, var(--line));
  background: color-mix(in srgb, var(--amber) 7%, var(--surface));
  color: var(--amber);
}

.support-link-button.active,
.support-link-button[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--green) 42%, var(--line));
  background: color-mix(in srgb, var(--green) 14%, var(--surface));
  color: var(--green);
}

.theme-toggle,
.language-toggle {
  position: relative;
  width: 2.22rem;
  min-width: 2.22rem;
  min-height: 2.22rem;
  padding: 0;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--amber) 30%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--amber) 7%, var(--surface));
  color: #9b6b0f;
  font-weight: 950;
}

.language-toggle {
  border-color: color-mix(in srgb, var(--green) 30%, var(--line));
  background: color-mix(in srgb, var(--green) 7%, var(--surface));
  color: var(--green);
  font-size: 0.74rem;
  line-height: 1;
}

.theme-toggle-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.theme-toggle-icon {
  display: block;
  width: 1.2rem;
  height: 1.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c48218' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4.4'/%3E%3Cpath d='M12 2.5v2.2M12 19.3v2.2M4.6 4.6l1.6 1.6M17.8 17.8l1.6 1.6M2.5 12h2.2M19.3 12h2.2M4.6 19.4l1.6-1.6M17.8 6.2l1.6-1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: drop-shadow(0 1px 2px rgba(151, 101, 18, 0.16));
  transition: filter 160ms ease, transform 160ms ease;
}

.theme-toggle-icon::before {
  content: none;
}

:root[data-theme="dark"] .theme-toggle {
  border-color: color-mix(in srgb, #7db7ff 34%, var(--line));
  background: color-mix(in srgb, #7db7ff 12%, var(--surface));
  color: #cfe4ff;
}

:root[data-theme="dark"] .theme-toggle-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237db7ff' stroke-width='2.35' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.4 14.4A8.6 8.6 0 0 1 9.6 3.6 7.3 7.3 0 1 0 20.4 14.4Z'/%3E%3C/svg%3E");
  filter: drop-shadow(0 1px 2px rgba(125, 183, 255, 0.18));
}

.theme-toggle[aria-pressed="true"] .theme-toggle-icon {
  transform: none;
}

:root[data-theme="dark"] .theme-toggle-icon::before {
  content: none;
}

.theme-toggle:hover,
.theme-toggle:focus-visible,
.language-toggle:hover,
.language-toggle:focus-visible {
  border-color: color-mix(in srgb, var(--blue) 46%, var(--line));
  transform: translateY(-1px);
}

.theme-toggle:hover .theme-toggle-icon,
.theme-toggle:focus-visible .theme-toggle-icon {
  filter: drop-shadow(0 2px 4px rgba(21, 25, 22, 0.18));
}

.eyebrow {
  margin: 0 0 0.2rem;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
  overflow-wrap: anywhere;
}

.dialog-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.correction-shell {
  max-width: 46rem;
}

.correction-target-card {
  display: block;
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid color-mix(in srgb, var(--blue) 22%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue) 7%, var(--surface));
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 900;
}

.correction-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.correction-form label {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.correction-message-field {
  grid-column: 1 / -1;
}

.correction-review-note {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.5;
}

button,
select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

button,
select {
  min-height: 2.35rem;
}

button {
  padding: 0 0.8rem;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, transform 120ms ease, box-shadow 150ms ease;
}

button:not(:disabled):hover,
.relation-link:hover,
.item-badge:hover {
  box-shadow: 0 6px 16px rgba(21, 25, 22, 0.08);
}

button:not(:disabled):active {
  transform: translateY(1px);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0 0.9rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-weight: 800;
  text-decoration: none;
}

.app-footer a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.15rem;
  padding: 0 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration: none;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.45rem;
  width: min(1500px, 100%);
  margin: -0.8rem auto 1.5rem;
  padding: 0 clamp(1rem, 3vw, 2rem);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(12rem, 14rem) minmax(0, 1fr);
  gap: 0.95rem;
  align-items: start;
  width: min(1680px, 100%);
  margin: 0 auto;
  padding: 1rem clamp(1rem, 3vw, 2rem) 2rem;
}

.mix-tree-workbench-active .app-shell {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-width: none;
  padding-inline: clamp(0.5rem, 1.2vw, 1rem);
}

.mix-tree-workbench-active .shortcut-rail {
  display: none;
}

.mix-tree-workbench-active .content-area {
  grid-column: 1;
}

body[data-page-view="farm"] .app-shell,
body[data-page-view="mixPlanner"] .app-shell {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-width: none;
  padding-inline: clamp(0.65rem, 1.6vw, 1.25rem);
}

body[data-page-view="farm"] .shortcut-rail,
body[data-page-view="mixPlanner"] .shortcut-rail {
  display: none;
}

body[data-page-view="farm"] .content-area,
body[data-page-view="mixPlanner"] .content-area {
  grid-column: 1;
}

.shortcut-rail {
  display: grid;
  position: sticky;
  top: 5.2rem;
  grid-template-columns: 1fr;
  gap: 0.62rem;
  align-content: start;
  align-items: start;
  min-width: 0;
}

.rail-panel {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.62rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: 0 10px 32px rgba(21, 25, 22, 0.06);
  backdrop-filter: blur(8px);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.rail-panel:hover,
.rail-panel:focus-within {
  border-color: color-mix(in srgb, var(--green) 24%, var(--line));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 14px 38px rgba(21, 25, 22, 0.09);
}

.rail-eyebrow {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
}

.rail-panel > strong {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 950;
}

.rail-panel > small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  line-height: 1.45;
}

.rail-search {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.rail-search label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 950;
}

.rail-search-field {
  position: relative;
}

.rail-search-field input {
  min-height: 2.45rem;
  padding-inline: 0.62rem 2.2rem;
  border-color: color-mix(in srgb, var(--blue) 20%, var(--line));
  background: var(--surface);
  font-size: 0.8rem;
}

.rail-search-field input:focus {
  border-color: color-mix(in srgb, var(--blue) 58%, var(--line));
  box-shadow: 0 0 0 3px var(--focus);
}

.rail-search-field button {
  position: absolute;
  top: 50%;
  right: 0.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  min-height: 1.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  transform: translateY(-50%);
}

.quick-search-results {
  display: grid;
  gap: 0.34rem;
  max-height: 18rem;
  overflow-y: auto;
  padding-right: 0.1rem;
  scrollbar-width: thin;
}

.quick-search-result {
  display: grid;
  grid-template-columns: 2.15rem minmax(0, 1fr);
  align-items: center;
  gap: 0.42rem;
  min-height: 2.75rem;
  padding: 0.36rem;
  border-color: transparent;
  background: transparent;
  text-align: left;
}

.quick-search-result:hover,
.quick-search-result:focus-visible {
  border-color: color-mix(in srgb, var(--blue) 28%, var(--line));
  background: color-mix(in srgb, var(--blue) 8%, var(--surface));
}

.quick-search-media {
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 950;
}

.quick-search-media img,
.quick-search-media .monster-visual-stack {
  max-width: 1.9rem;
  max-height: 1.9rem;
}

.quick-search-text {
  display: grid;
  min-width: 0;
}

.quick-search-text strong,
.quick-search-text small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-search-text strong {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 950;
}

.quick-search-text small,
.quick-search-empty {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.quick-search-empty {
  padding: 0.45rem 0.2rem;
}

.rail-status-panel {
  border-color: color-mix(in srgb, var(--blue) 24%, var(--line));
}

.rail-memory-panel {
  gap: 0.65rem;
}

.rail-memory-group {
  display: grid;
  gap: 0.34rem;
}

.rail-memory-group > strong {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 950;
}

.rail-memory-list {
  display: grid;
  gap: 0.3rem;
}

.rail-memory-clear {
  justify-self: start;
  min-height: 1.8rem;
  padding: 0 0.55rem;
  border-color: color-mix(in srgb, var(--red) 20%, var(--line));
  background: color-mix(in srgb, var(--red) 5%, transparent);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
}

.rail-memory-clear:hover,
.rail-memory-clear:focus-visible {
  border-color: color-mix(in srgb, var(--red) 36%, var(--line));
  color: var(--red);
}

.rail-memory-item {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  align-items: center;
  gap: 0.42rem;
  min-height: 2.55rem;
  padding: 0.3rem;
  border-color: transparent;
  background: transparent;
  text-align: left;
}

.rail-memory-item:hover,
.rail-memory-item:focus-visible {
  border-color: color-mix(in srgb, var(--green) 28%, var(--line));
  background: color-mix(in srgb, var(--green) 8%, var(--surface));
}

.rail-memory-media {
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 2rem;
  height: 2rem;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
}

.rail-memory-media img,
.rail-memory-media .monster-visual-stack {
  width: 1.72rem;
  height: 1.72rem;
  max-width: 1.72rem;
  max-height: 1.72rem;
  object-fit: contain;
}

.rail-memory-media .monster-visual-stack {
  --visual-size: 1.72rem;
  overflow: visible;
}

.rail-memory-text {
  display: grid;
  min-width: 0;
}

.rail-memory-text strong,
.rail-memory-text small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-memory-text strong {
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 950;
}

.rail-memory-text small,
.rail-memory-empty {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.4;
}

.top-nav {
  display: contents;
  min-width: 0;
}

.top-nav .tab-list {
  display: contents;
  margin: 0;
}

.nav-shell {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  display: block;
  align-content: center;
  align-self: center;
  min-width: 0;
  max-width: min(58rem, 100%);
  min-height: 2.8rem;
}

.nav-primary,
.nav-category-strip {
  display: flex;
  min-width: 0;
  scrollbar-width: none;
}

.nav-primary {
  align-items: center;
  flex-wrap: nowrap;
  gap: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-x: contain;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-overflow-scrolling: touch;
}

.nav-primary::-webkit-scrollbar,
.nav-category-strip::-webkit-scrollbar {
  display: none;
}

.top-nav .tab,
.nav-category-strip button {
  flex: 0 0 auto;
  width: auto;
}

.top-nav .tab {
  --nav-accent: var(--green);
  position: relative;
  justify-content: center;
  isolation: isolate;
  min-width: 5.8rem;
  max-width: none;
  min-height: 2.35rem;
  padding: 0 0.92rem;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 950;
  box-shadow: none;
}

.top-nav .tab::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: auto 0.5rem 0.28rem;
  height: 0.42rem;
  border-radius: 999px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--nav-accent) 34%, transparent), color-mix(in srgb, var(--nav-accent) 14%, transparent));
  opacity: 0;
  transform: scaleX(0.7);
  transform-origin: center;
  transition: opacity 140ms ease, transform 140ms ease, background 140ms ease;
}

.top-nav .tab > span,
.top-nav .tab > strong {
  position: relative;
  z-index: 1;
}

.top-nav .tab.active {
  border-color: transparent;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}

.top-nav .tab.active::before,
.top-nav .tab:hover::before,
.top-nav .tab:focus-visible::before {
  opacity: 0.95;
  transform: scaleX(1);
}

.top-nav .tab:hover,
.top-nav .tab:focus-visible {
  border-color: transparent;
  background: color-mix(in srgb, var(--surface) 36%, transparent);
  color: var(--ink);
  box-shadow: none;
}

.nav-tab-encyclopedia { --nav-accent: #36ae6d; }
.nav-tab-map { --nav-accent: #c7a532; }
.nav-tab-mix { --nav-accent: #7d78e6; }
.nav-tab-daily { --nav-accent: #75bed0; }
.nav-tab-market { --nav-accent: #df6b78; }
.nav-tab-calculator { --nav-accent: #2f9e91; }
.nav-tab-contributions { --nav-accent: #d0a025; }
.nav-tab-drop-research { --nav-accent: #8c6ad8; }

.nav-primary .tab + .tab {
  box-shadow: inset 1px 0 0 color-mix(in srgb, var(--muted) 28%, transparent);
}

.nav-category-strip {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.28rem 0.38rem;
  width: min(42rem, calc(100vw - 2rem));
  max-height: min(55vh, 14rem);
  overflow-x: auto;
  overflow-y: auto;
  padding: 0.55rem;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 96%, var(--header-bg));
  box-shadow:
    0 18px 36px rgba(21, 25, 22, 0.13),
    inset 0 1px 0 color-mix(in srgb, #ffffff 58%, transparent);
  opacity: 1;
  transform: translateY(0) scale(1);
  transform-origin: top left;
  visibility: visible;
  pointer-events: auto;
  will-change: opacity, transform;
  transition: opacity 220ms ease, transform 220ms ease, visibility 0s linear 0s;
  animation: categoryPopoverIn 220ms ease both;
}

@keyframes categoryPopoverIn {
  from {
    opacity: 0;
    transform: translateY(-0.42rem) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.nav-category-strip button {
  --category-accent: var(--blue);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.32rem;
  min-width: 0;
  max-width: 100%;
  min-height: 1.72rem;
  padding: 0 0.62rem;
  border: 1px solid color-mix(in srgb, var(--category-accent) 16%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--category-accent) 4%, transparent);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
  text-align: center;
  box-shadow: none;
}

.nav-category-strip button::before {
  content: "";
  width: 0.28rem;
  height: 0.28rem;
  border-radius: 50%;
  background: var(--category-accent);
  opacity: 0.54;
  box-shadow: none;
}

.nav-category-strip button[data-category="monsters"] { --category-accent: #5d93ff; }
.nav-category-strip button[data-category="maps"] { --category-accent: #28a86b; }
.nav-category-strip button[data-category="items"] { --category-accent: #c6922d; }
.nav-category-strip button[data-category="materials"] { --category-accent: #8f6ee8; }
.nav-category-strip button[data-category="equipment"] { --category-accent: #d86b47; }
.nav-category-strip button[data-category="mixItems"] { --category-accent: #4c9bd8; }
.nav-category-strip button[data-category="shopItems"] { --category-accent: #d0a025; }
.nav-category-strip button[data-category="craftProductions"] { --category-accent: #a66b2f; }
.nav-category-strip button[data-category="quests"] { --category-accent: #9c67d4; }
.nav-category-strip button[data-category="mixTrees"] { --category-accent: #2b9f77; }
.nav-category-strip button[data-category="types"] { --category-accent: #c45e8d; }

.nav-category-strip button.active {
  border-color: color-mix(in srgb, var(--category-accent) 34%, var(--line));
  background: color-mix(in srgb, var(--category-accent) 13%, var(--surface));
  color: var(--ink);
  box-shadow: none;
}

.top-nav .nav-category-strip button:hover,
.top-nav .nav-category-strip button:focus-visible {
  border-color: color-mix(in srgb, var(--category-accent) 30%, var(--line));
  background: color-mix(in srgb, var(--category-accent) 10%, var(--surface));
  color: var(--ink);
  box-shadow: none;
}

.nav-category-strip button.active::before,
.top-nav .nav-category-strip button:hover::before,
.top-nav .nav-category-strip button:focus-visible::before {
  opacity: 1;
}

.nav-category-strip.is-collapsed {
  visibility: hidden;
  opacity: 0;
  transform: translateY(-0.42rem) scale(0.985);
  overflow: hidden;
  max-height: min(55vh, 14rem);
  pointer-events: none;
  animation: none;
  transition: opacity 220ms ease, transform 220ms ease, visibility 0s linear 220ms;
}

.category-toggle {
  border-style: none;
  gap: 0.45rem;
  width: auto;
  min-width: 5.8rem;
  max-width: none;
  justify-content: center;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.category-toggle::after {
  content: "";
  position: relative;
  z-index: 1;
  width: 0.42rem;
  height: 0.42rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-0.06rem);
  transition: transform 140ms ease;
}

.category-toggle[aria-expanded="true"]::after {
  transform: rotate(-135deg) translateY(-0.04rem);
}

.category-toggle.active {
  border-color: transparent;
  background: transparent;
  color: var(--ink);
}

.nav-menu {
  position: relative;
  flex: 0 0 auto;
}

.nav-menu > .tab {
  width: 100%;
}

.nav-menu > .tab small {
  margin-left: 0.25rem;
  color: currentColor;
  font-size: 0.72rem;
}

.nav-submenu {
  display: grid;
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 30;
  grid-template-columns: repeat(2, minmax(8rem, 1fr));
  gap: 0.35rem;
  width: min(23rem, calc(100vw - 2rem));
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-0.25rem);
  transition: opacity 140ms ease, transform 140ms ease;
}

.nav-menu:hover .nav-submenu,
.nav-menu:focus-within .nav-submenu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-submenu button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  min-height: 2.15rem;
  padding: 0 0.55rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-align: left;
}

.nav-submenu button.active {
  border-color: rgba(31, 122, 79, 0.38);
  background: rgba(31, 122, 79, 0.1);
  color: var(--green);
}

.database-panel,
.recent-panel,
.completeness-panel,
.farm-planner-panel,
.type-advantage-panel,
.market-panel,
.mix-calculator-panel,
.contribution-panel,
.drop-research-panel,
.premium-gate-panel,
.record-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: 0 10px 30px rgba(21, 25, 22, 0.055);
}

.database-panel,
.recent-panel,
.farm-planner-panel,
.type-advantage-panel,
.market-panel,
.mix-calculator-panel,
.contribution-panel,
.drop-research-panel,
.smart-mix-panel,
.premium-gate-panel,
.daily-panel {
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.database-panel:hover,
.recent-panel:hover,
.farm-planner-panel:hover,
.type-advantage-panel:hover,
.market-panel:hover,
.premium-gate-panel:hover,
.drop-research-panel:hover,
.daily-panel:hover {
  border-color: color-mix(in srgb, var(--green) 16%, var(--line));
  box-shadow: 0 14px 36px rgba(21, 25, 22, 0.075);
}

.record-row {
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease, background 140ms ease;
}

.market-panel,
.mix-calculator-panel,
.contribution-panel,
.drop-research-panel,
.market-panel:hover,
.mix-calculator-panel:hover,
.contribution-panel:hover,
.drop-research-panel:hover {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

#marketPanel > .farm-planner-heading {
  display: none;
}

.record-row:hover,
.record-row:focus-within {
  border-color: color-mix(in srgb, var(--blue) 28%, var(--line));
  background: var(--surface-hover);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(21, 25, 22, 0.1);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.sort-control {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
}

.search-control {
  display: grid;
  gap: 0.45rem;
  width: 100%;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
}

.search-field {
  position: relative;
}

.clear-search {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  min-height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  transform: translateY(-50%);
}

.clear-search:hover,
.clear-search:focus-visible {
  background: var(--line);
  color: var(--ink);
}

input,
select,
textarea {
  width: 100%;
  min-height: 2.6rem;
  padding: 0 0.75rem;
}

textarea {
  min-height: 16rem;
  padding: 0.8rem;
  font-family: Consolas, "Cascadia Mono", monospace;
}

.tab-list {
  display: grid;
  gap: 0.45rem;
}

.level-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.level-filter label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.level-filter input {
  min-width: 0;
}

.tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  width: 100%;
  color: var(--muted);
  font-weight: 850;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.tab span,
.tab strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab:hover,
.tab:focus-visible,
.nav-category-strip button:hover,
.nav-category-strip button:focus-visible {
  border-color: color-mix(in srgb, var(--category-accent, var(--blue)) 38%, var(--line));
  background: color-mix(in srgb, var(--category-accent, var(--blue)) 11%, var(--surface));
  color: var(--ink);
  box-shadow: 0 6px 14px rgba(21, 25, 22, 0.08);
}

.top-nav .tab:active,
.category-toggle:hover,
.category-toggle:focus-visible,
.category-toggle:active,
.nav-category-strip button:hover,
.nav-category-strip button:focus-visible,
.nav-category-strip button:active {
  transform: none;
}

.tab.active {
  border-color: var(--green);
  background: rgba(31, 122, 79, 0.1);
  color: var(--green);
  font-weight: 900;
  box-shadow: inset 0 -2px 0 var(--green);
}

.content-area {
  display: grid;
  grid-column: 2;
  gap: 0.85rem;
  min-width: 0;
}

.recent-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0;
  padding: 0.55rem 0.65rem;
  min-height: 3.9rem;
  overflow: hidden;
}

.recent-panel > div:first-child {
  flex: 0 0 9rem;
  min-width: 0;
}

.recent-panel span,
.recent-panel small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.recent-panel strong {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.92rem;
  line-height: 1.15;
}

.recent-list {
  display: flex;
  flex-wrap: nowrap;
  flex: 1 1 auto;
  gap: 0.38rem;
  min-width: 0;
  max-height: 2.75rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.1rem;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.recent-list::-webkit-scrollbar {
  display: none;
}

.recent-item {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.38rem;
  align-items: center;
  flex: 0 0 clamp(11.5rem, 22vw, 16rem);
  width: auto;
  min-width: 0;
  min-height: 2.48rem;
  padding: 0.28rem 0.38rem;
  text-align: left;
  scroll-snap-align: start;
}

.recent-thumb {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
}

.recent-thumb img {
  max-width: 1.72rem;
  max-height: 1.72rem;
  object-fit: contain;
}

.recent-item b,
.recent-item small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#clearRecent {
  flex: 0 0 auto;
  min-height: 2rem;
  padding-inline: 0.62rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.completeness-panel {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 0;
  padding: 0.85rem;
}

.completeness-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.completeness-heading span,
.completeness-score small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.completeness-heading strong {
  display: block;
  margin-top: 0.15rem;
}

.completeness-score {
  text-align: right;
}

.completeness-score span {
  display: block;
  color: var(--green);
  font-size: 1.85rem;
  font-weight: 950;
  line-height: 1;
}

.completeness-bars {
  display: grid;
  gap: 0.45rem;
}

.completeness-bar {
  display: grid;
  grid-template-columns: 3.5rem 3.5rem minmax(8rem, 1fr) 3rem;
  gap: 0.55rem;
  align-items: center;
  min-width: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.completeness-bar strong {
  color: var(--ink);
}

.completeness-bar div {
  min-width: 0;
  height: 0.55rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.completeness-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.completeness-bar.incomplete i {
  background: var(--red);
}

.issue-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.issue-chip {
  min-height: 2rem;
  padding: 0 0.6rem;
  border-color: rgba(184, 66, 53, 0.28);
  background: rgba(184, 66, 53, 0.08);
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 900;
}

.issue-chip.passive {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0 0.6rem;
  border: 1px solid rgba(31, 122, 79, 0.22);
  border-radius: 8px;
  background: rgba(31, 122, 79, 0.08);
  color: var(--green);
}

.farm-planner-panel,
.market-panel,
.type-advantage-panel,
.smart-mix-panel,
.daily-panel,
.about-support-panel {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 0.75rem;
  padding: 0.85rem;
}

.smart-mix-panel {
  grid-template-columns: minmax(0, 1fr);
  gap: 0.72rem;
  align-items: stretch;
}

.farm-planner-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.farm-planner-heading span,
.farm-summary,
.farm-empty {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.farm-planner-heading span {
  display: block;
  font-size: 0.76rem;
  font-weight: 900;
}

.farm-planner-heading strong {
  display: block;
  margin-top: 0.15rem;
}

.type-advantage-heading span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.type-advantage-heading strong {
  display: block;
  margin-top: 0.15rem;
}

.type-advantage-table-wrap {
  overflow: hidden;
}

.type-advantage-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
  table-layout: fixed;
}

.type-advantage-table th,
.type-advantage-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.type-advantage-table th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
}

.about-support-panel {
  gap: 0.7rem;
}

.about-support-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  min-width: 0;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(31, 122, 79, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(31, 122, 79, 0.08), rgba(255, 252, 246, 0.72)),
    var(--surface);
}

.about-support-hero-copy {
  display: grid;
  gap: 0.28rem;
  min-width: 0;
}

.about-support-hero-copy span,
.about-support-owner-badge span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 950;
}

.about-support-hero-copy strong {
  color: var(--ink);
  font-size: 1.12rem;
  line-height: 1.25;
}

.about-support-hero-copy p {
  max-width: 48rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.about-support-owner-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.35rem;
  padding: 0 0.7rem;
  border: 1px solid color-mix(in srgb, var(--green) 28%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--green) 8%, var(--surface));
  color: var(--text);
  font-weight: 900;
  white-space: nowrap;
}

.about-support-owner-badge strong {
  color: var(--green);
  font-size: 0.92rem;
}

.about-support-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(13.5rem, 0.58fr);
  gap: 0.8rem;
  align-items: start;
}

.about-support-card {
  display: grid;
  align-content: start;
  gap: 0.65rem;
  min-width: 0;
  padding: 0.95rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.about-owner-card {
  gap: 0.5rem;
  padding: 0.75rem;
  background: color-mix(in srgb, var(--green) 5%, var(--surface));
  box-shadow: 0 12px 28px rgba(31, 122, 79, 0.08);
}

.donation-card {
  overflow: hidden;
  padding: 0;
  border-color: rgba(209, 74, 58, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 248, 239, 0.96), rgba(255, 252, 246, 0.98)),
    color-mix(in srgb, var(--amber) 6%, var(--surface));
}

.about-support-eyebrow {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 950;
}

.about-support-card h2 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.25;
}

.about-owner-card h2 {
  font-size: 0.95rem;
}

.about-owner-identity {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
  max-width: 100%;
  padding: 0.3rem 0.52rem;
  border: 1px solid color-mix(in srgb, var(--green) 24%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--green) 8%, var(--surface));
  color: var(--text);
  font-weight: 900;
}

.about-owner-identity span {
  color: var(--muted);
  font-size: 0.76rem;
}

.about-owner-identity strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--green);
  font-size: 0.88rem;
}

.about-support-card p,
.donation-method-list small {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.about-owner-card p {
  font-size: 0.84rem;
  line-height: 1.5;
}

.about-report-note {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.48rem;
  padding: 0.56rem 0.62rem;
  border: 1px solid color-mix(in srgb, var(--amber) 28%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--amber) 9%, transparent), transparent),
    color-mix(in srgb, var(--amber) 5%, var(--surface));
}

.about-share-note {
  border-color: color-mix(in srgb, var(--green) 28%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--green) 10%, transparent), transparent),
    color-mix(in srgb, var(--green) 5%, var(--surface));
}

.about-report-copy {
  display: grid;
  gap: 0.22rem;
  min-width: 0;
}

.about-report-note strong {
  color: var(--amber-strong);
  font-size: 0.78rem;
  font-weight: 950;
}

.about-report-note span {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 760;
  line-height: 1.48;
}

.about-report-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.38rem;
  min-width: 0;
}

.about-report-actions button,
.about-report-actions span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.9rem;
  padding: 0.16rem 0.62rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 950;
  line-height: 1.1;
}

.about-report-actions button {
  border-color: color-mix(in srgb, var(--amber) 38%, var(--line));
  background: color-mix(in srgb, var(--amber) 15%, var(--surface));
  color: var(--amber-strong);
}

.about-report-actions button:hover,
.about-report-actions button:focus-visible {
  border-color: color-mix(in srgb, var(--amber) 58%, var(--line));
  background: color-mix(in srgb, var(--amber) 22%, var(--surface));
}

.about-report-actions span {
  border: 1px solid color-mix(in srgb, var(--blue) 18%, var(--line));
  background: color-mix(in srgb, var(--blue) 6%, var(--surface));
  color: var(--blue);
}

.about-share-note .about-report-actions button {
  border-color: color-mix(in srgb, var(--green) 36%, var(--line));
  background: color-mix(in srgb, var(--green) 14%, var(--surface));
  color: var(--green);
}

.about-share-note .about-report-actions span[data-tone="ok"] {
  border-color: color-mix(in srgb, var(--green) 32%, var(--line));
  background: color-mix(in srgb, var(--green) 10%, var(--surface));
  color: var(--green);
}

.about-share-note .about-report-actions span[data-tone="error"] {
  border-color: color-mix(in srgb, var(--danger) 28%, var(--line));
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
  color: var(--danger);
}

.about-support-points {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.about-support-points span {
  display: inline-flex;
  align-items: center;
  min-height: 1.85rem;
  padding: 0 0.58rem;
  border: 1px solid color-mix(in srgb, var(--green) 24%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--green) 8%, var(--surface));
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
}

.about-owner-card .about-support-points {
  gap: 0.32rem;
}

.about-owner-card .about-support-points span {
  min-height: 1.62rem;
  padding: 0 0.48rem;
  font-size: 0.7rem;
}

.donation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.donation-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.25rem 0.8rem;
  border: 1px solid color-mix(in srgb, var(--amber) 32%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--amber) 10%, var(--surface));
  color: var(--amber);
  font-size: 0.84rem;
  font-weight: 950;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.donation-button-primary {
  border-color: rgba(205, 31, 38, 0.28);
  background: rgba(205, 31, 38, 0.08);
  color: #b92328;
}

.donation-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(103, 71, 32, 0.14);
}

:root[data-theme="dark"] .donation-button {
  background: rgba(23, 27, 34, 0.72);
}

:root[data-theme="dark"] .donation-button-primary {
  color: #ff858b;
}

.donation-shell {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
  padding: 0.95rem;
}

.donation-intro {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.donation-intro h2 {
  max-width: 28rem;
}

.donation-method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  align-items: stretch;
  min-width: 0;
}

.donation-method-panel {
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid rgba(205, 31, 38, 0.18);
  border-radius: 8px;
}

.donation-primary {
  display: grid;
  gap: 0.7rem;
  align-items: start;
  background: linear-gradient(135deg, rgba(205, 31, 38, 0.08), rgba(255, 255, 255, 0.84));
}

.donation-qr-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  padding: 0.38rem;
  border: 1px solid rgba(205, 31, 38, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: inherit;
  cursor: zoom-in;
  font: inherit;
  text-decoration: none;
}

.donation-qr-frame:focus-visible {
  outline: 3px solid rgba(31, 122, 79, 0.35);
  outline-offset: 3px;
}

.donation-qr-image {
  display: block;
  width: min(100%, 11.75rem);
  height: auto;
  border-radius: 7px;
  box-shadow: 0 10px 24px rgba(72, 17, 24, 0.16);
}

.donation-primary-body {
  display: grid;
  gap: 0.7rem;
  min-width: 0;
}

.donation-provider-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  min-width: 0;
}

.donation-provider-row strong {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 950;
  text-align: right;
}

.donation-provider-pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  padding: 0 0.65rem;
  border-radius: 999px;
  background: #cd1f26;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.04em;
}

.donation-provider-pill-paypal {
  background: #003087;
}

.donation-facts {
  display: grid;
  gap: 0.38rem;
  margin: 0;
}

.donation-facts > div {
  display: grid;
  grid-template-columns: minmax(2.9rem, auto) minmax(0, 1fr);
  gap: 0.4rem;
  align-items: center;
  min-width: 0;
  padding: 0.38rem 0.45rem;
  border: 1px solid rgba(205, 31, 38, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.donation-facts dt,
.donation-facts dd {
  margin: 0;
}

.donation-facts dt {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
}

.donation-facts dd {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.donation-paypal-panel {
  display: grid;
  align-content: start;
  gap: 0.7rem;
  background:
    linear-gradient(135deg, rgba(0, 48, 135, 0.08), rgba(255, 196, 57, 0.2)),
    rgba(255, 255, 255, 0.78);
}

.donation-paypal-head strong {
  color: #173a75;
}

.donation-paypal-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.donation-paypal-address {
  display: flex;
  align-items: center;
  min-height: 2.65rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid rgba(0, 48, 135, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  color: #173a75;
  font-size: 1rem;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.donation-paypal-button {
  width: 100%;
  min-height: 2.65rem;
  border-color: rgba(161, 114, 22, 0.34);
  background: #ffc439;
  color: #173a75;
  box-shadow: 0 10px 22px rgba(120, 82, 13, 0.14);
}

.donation-paypal-button:hover {
  box-shadow: 0 14px 28px rgba(120, 82, 13, 0.2);
}

:root[data-theme="dark"] .donation-card {
  border-color: rgba(255, 112, 119, 0.28);
  background:
    linear-gradient(180deg, rgba(33, 30, 30, 0.97), rgba(24, 27, 31, 0.98)),
    var(--surface);
}

:root[data-theme="dark"] .about-support-hero {
  border-color: rgba(92, 184, 132, 0.22);
  background:
    linear-gradient(135deg, rgba(92, 184, 132, 0.12), rgba(23, 27, 34, 0.92)),
    var(--surface);
}

:root[data-theme="dark"] .about-support-owner-badge {
  background: rgba(23, 27, 34, 0.72);
}

:root[data-theme="dark"] .donation-primary {
  border-color: rgba(255, 112, 119, 0.24);
  background: linear-gradient(135deg, rgba(255, 112, 119, 0.12), rgba(23, 27, 34, 0.84));
}

:root[data-theme="dark"] .donation-qr-frame,
:root[data-theme="dark"] .donation-facts > div,
:root[data-theme="dark"] .donation-paypal-address {
  border-color: rgba(255, 112, 119, 0.18);
  background-color: rgba(23, 27, 34, 0.72);
}

:root[data-theme="dark"] .donation-paypal-panel {
  border-color: rgba(255, 196, 57, 0.24);
  background:
    linear-gradient(135deg, rgba(0, 48, 135, 0.26), rgba(255, 196, 57, 0.12)),
    rgba(23, 27, 34, 0.84);
}

:root[data-theme="dark"] .donation-paypal-head strong,
:root[data-theme="dark"] .donation-paypal-address {
  color: #ffd76f;
}

:root[data-theme="dark"] .about-report-note {
  border-color: rgba(255, 196, 57, 0.24);
  background:
    linear-gradient(135deg, rgba(255, 196, 57, 0.12), rgba(23, 27, 34, 0.72)),
    rgba(23, 27, 34, 0.84);
}

:root[data-theme="dark"] .about-share-note {
  border-color: rgba(63, 184, 124, 0.26);
  background:
    linear-gradient(135deg, rgba(63, 184, 124, 0.12), rgba(23, 27, 34, 0.72)),
    rgba(23, 27, 34, 0.84);
}

:root[data-theme="dark"] .about-report-actions button {
  border-color: rgba(255, 196, 57, 0.3);
  background: rgba(255, 196, 57, 0.12);
  color: #ffd76f;
}

:root[data-theme="dark"] .about-report-actions span {
  border-color: rgba(111, 167, 224, 0.22);
  background: rgba(111, 167, 224, 0.12);
  color: #9fc7ff;
}

:root[data-theme="dark"] .about-share-note .about-report-actions button,
:root[data-theme="dark"] .about-share-note .about-report-actions span[data-tone="ok"] {
  border-color: rgba(63, 184, 124, 0.32);
  background: rgba(63, 184, 124, 0.12);
  color: #8fe4b6;
}

:root[data-theme="dark"] .about-share-note .about-report-actions span[data-tone="error"] {
  border-color: rgba(255, 124, 124, 0.32);
  background: rgba(255, 124, 124, 0.12);
  color: #ffadad;
}

@media (max-width: 1040px) {
  .about-support-layout {
    grid-template-columns: 1fr;
  }

  .about-owner-card {
    grid-template-columns: minmax(10rem, auto) minmax(0, 1fr);
    align-items: center;
  }

  .about-owner-card .about-support-eyebrow,
  .about-owner-card h2 {
    grid-column: 1;
  }

  .about-owner-card p {
    grid-column: 2;
    grid-row: auto;
  }

  .about-owner-card .about-report-note {
    grid-column: 1 / -1;
  }

  .about-owner-card .about-support-points {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .about-support-hero {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .about-support-owner-badge {
    width: fit-content;
  }
}

@media (max-width: 540px) {
  .donation-method-grid {
    grid-template-columns: 1fr;
  }

  .about-owner-card {
    grid-template-columns: 1fr;
  }

  .about-owner-card .about-support-eyebrow,
  .about-owner-card h2,
  .about-owner-card p,
  .about-owner-card .about-report-note,
  .about-owner-card .about-support-points {
    grid-column: auto;
    grid-row: auto;
  }

  .donation-qr-image {
    width: min(100%, 15rem);
  }
}

.type-matchup-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  padding: 0.18rem 0.45rem;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
}

.type-matchup-button .type-icon {
  width: 1.45rem;
  height: 1.45rem;
}

#resetFarmFilters,
#clearPetRecommendations,
#clearMarketForm,
#clearMixCalculator,
#refreshContributionStats,
#clearSmartMix,
#resetDailyProgress {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.farm-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr));
  gap: 0.65rem;
  align-items: end;
}

.farm-controls label {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.market-sync-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid rgba(31, 122, 79, 0.22);
  border-radius: 8px;
  background: rgba(31, 122, 79, 0.055);
}

.market-sync-panel small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.market-sync-panel small[data-tone="ok"] {
  color: var(--green);
}

.market-sync-panel small[data-tone="error"] {
  color: var(--red);
}

.premium-gate-panel {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.premium-gate-copy {
  display: grid;
  gap: 0.35rem;
}

.premium-eyebrow {
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 950;
}

.premium-gate-copy strong {
  color: var(--ink);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 950;
}

.premium-gate-copy p {
  max-width: 58rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.65;
}

.premium-feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  gap: 0.6rem;
}

.premium-feature {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
  padding: 0.7rem;
  border: 1px solid color-mix(in srgb, var(--blue) 20%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue) 5%, var(--surface));
}

.premium-feature strong {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 950;
}

.premium-feature small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.45;
}

.premium-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.premium-actions button {
  min-height: 2.2rem;
  padding-inline: 0.85rem;
  font-weight: 950;
}

#premiumLoginButton {
  border-color: color-mix(in srgb, var(--green) 40%, var(--line));
  background: color-mix(in srgb, var(--green) 12%, var(--surface));
  color: var(--green);
}

#premiumCopyLoginButton {
  border-color: color-mix(in srgb, var(--blue) 32%, var(--line));
  background: color-mix(in srgb, var(--blue) 7%, var(--surface));
  color: var(--blue);
}

#premiumRefreshButton {
  border-color: color-mix(in srgb, var(--blue) 34%, var(--line));
  background: color-mix(in srgb, var(--blue) 9%, var(--surface));
  color: var(--blue);
}

#premiumGateStatus {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.farm-map-hub-panel {
  display: grid;
  gap: 0.72rem;
  padding: 0.82rem;
  border: 1px solid color-mix(in srgb, var(--green) 24%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--green) 8%, transparent), transparent 34%),
    color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 14px 34px rgba(21, 25, 22, 0.065);
}

.farm-section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.85rem;
  min-width: 0;
}

.farm-section-heading div {
  min-width: 0;
}

.farm-section-heading span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 950;
}

.farm-section-heading strong {
  display: block;
  margin-top: 0.12rem;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 950;
}

.farm-section-heading button {
  flex: 0 0 auto;
  min-height: 2.35rem;
  padding-inline: 0.85rem;
  border-color: color-mix(in srgb, var(--green) 34%, var(--line));
  background: color-mix(in srgb, var(--green) 10%, var(--surface));
  color: var(--green);
  font-weight: 950;
}

.farm-map-hub-controls {
  display: grid;
  grid-template-columns: minmax(18rem, 1fr) minmax(12rem, 0.32fr);
  gap: 0.55rem;
}

.farm-map-hub-controls label {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.farm-map-hub-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.45rem;
}

.farm-map-hub-stats span {
  min-width: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 88%, transparent);
}

.farm-map-hub-stats b,
.farm-map-hub-stats small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.farm-map-hub-stats b {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 950;
}

.farm-map-hub-stats small {
  margin-top: 0.08rem;
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 900;
}

.farm-map-hub-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(24rem, 100%), 1fr));
  gap: 0.62rem;
}

.farm-map-quick-card {
  display: grid;
  grid-template-columns: 6.2rem minmax(0, 1fr);
  gap: 0.68rem;
  min-width: 0;
  padding: 0.68rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease, background 140ms ease;
}

.farm-map-quick-card:hover,
.farm-map-quick-card:focus-visible,
.farm-map-quick-card:focus-within {
  border-color: color-mix(in srgb, var(--green) 32%, var(--line));
  background: var(--surface-hover);
  box-shadow: 0 12px 30px rgba(21, 25, 22, 0.085);
  transform: translateY(-1px);
}

.farm-map-quick-media {
  display: grid;
  min-height: 5.15rem;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: color-mix(in srgb, var(--green) 8%, var(--surface-2));
  color: var(--muted);
  font-weight: 950;
}

.farm-map-quick-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.farm-map-quick-body {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.farm-map-quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}

.farm-map-quick-tags span {
  min-height: 1.6rem;
  padding: 0.15rem 0.48rem;
  border: 1px solid color-mix(in srgb, var(--green) 22%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--green) 7%, var(--surface));
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 900;
}

.farm-map-quick-card .farm-map-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.farm-map-quick-card .farm-map-actions {
  grid-column: 1 / -1;
}

.farm-map-quick-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.pet-recommendation-panel,
.farm-egg-panel {
  display: grid;
  gap: 0.8rem;
  margin-top: 0;
  padding: 0.8rem;
  border: 1px solid rgba(49, 95, 151, 0.22);
  border-radius: 8px;
  background: rgba(49, 95, 151, 0.06);
}

.farm-egg-panel {
  border-color: rgba(31, 122, 79, 0.22);
  background: rgba(31, 122, 79, 0.055);
}

.farm-money-panel {
  display: grid;
  gap: 0.8rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--line);
}

.pet-controls {
  grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr));
}

.pet-recommendation-panel .farm-results,
.farm-egg-panel .farm-results {
  grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
}

.pet-recommendation-panel .farm-map-card,
.farm-egg-panel .farm-map-card {
  grid-template-columns: 5.2rem minmax(0, 1fr);
  gap: 0.65rem;
  padding: 0.65rem;
}

.pet-recommendation-panel .farm-map-media,
.farm-egg-panel .farm-map-media {
  min-height: 4.9rem;
}

.pet-recommendation-panel .farm-map-stats,
.farm-egg-panel .farm-map-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pet-recommendation-panel .farm-map-body p,
.farm-egg-panel .farm-map-body p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.egg-farm-card .farm-map-stats span {
  border-color: rgba(31, 122, 79, 0.18);
  background: rgba(31, 122, 79, 0.055);
}

.farm-checkbox {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.5rem;
  align-items: center;
  min-height: 2.6rem;
  padding: 0 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.farm-checkbox input {
  width: 1rem;
  min-height: 1rem;
  padding: 0;
}

.farm-summary {
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(49, 95, 151, 0.18);
  border-radius: 8px;
  background: rgba(49, 95, 151, 0.07);
  color: var(--blue);
}

.farm-audit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  gap: 0.45rem;
}

.farm-audit span {
  min-width: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.farm-audit b,
.farm-audit small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.farm-audit b {
  color: var(--ink);
  font-size: 1.05rem;
}

.farm-audit small {
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
}

.farm-reference-panel {
  display: grid;
  gap: 0.6rem;
  padding: 0.7rem;
  border: 1px solid rgba(174, 131, 42, 0.26);
  border-radius: 8px;
  background: color-mix(in srgb, #b98524 9%, var(--surface));
}

.farm-reference-panel[hidden] {
  display: none;
}

.farm-reference-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  align-items: baseline;
  justify-content: space-between;
  min-width: 0;
}

.farm-reference-heading span {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 950;
}

.farm-reference-heading small {
  min-width: min(22rem, 100%);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.farm-reference-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr));
  gap: 0.55rem;
}

.farm-reference-card {
  grid-template-columns: 5.4rem minmax(0, 1fr);
  padding: 0.65rem;
}

.farm-reference-card .farm-map-media {
  min-height: 5rem;
}

.farm-reference-status {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
  padding: 0.42rem 0.52rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.farm-reference-status strong,
.farm-reference-status small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.farm-reference-status strong {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 950;
}

.farm-reference-status small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
}

.farm-reference-status[data-tone="recommended"] {
  border-color: rgba(45, 126, 80, 0.3);
  background: rgba(45, 126, 80, 0.08);
}

.farm-reference-status[data-tone="recommended"] strong {
  color: var(--green);
}

.farm-reference-status[data-tone="blocked"],
.farm-reference-status[data-tone="filtered"] {
  border-color: rgba(185, 63, 63, 0.32);
  background: rgba(185, 63, 63, 0.08);
}

.farm-reference-status[data-tone="blocked"] strong,
.farm-reference-status[data-tone="filtered"] strong {
  color: var(--red);
}

.farm-reference-status[data-tone="missing"] {
  border-style: dashed;
}

.farm-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
  gap: 0.65rem;
}

.farm-map-card {
  display: grid;
  grid-template-columns: 6.8rem minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.farm-map-media {
  display: grid;
  min-height: 5.8rem;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 900;
}

.farm-map-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.farm-map-body {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
}

.farm-map-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.farm-map-title h3 {
  min-width: 0;
  margin: 0;
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.farm-map-title span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
}

.farm-map-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
}

.farm-map-stats span {
  min-width: 0;
  padding: 0.35rem 0.45rem;
  border: 1px solid rgba(216, 222, 216, 0.86);
  border-radius: 8px;
  background: var(--surface-2);
}

.farm-map-stats b,
.farm-map-stats small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.farm-map-stats b {
  color: var(--ink);
  font-size: 0.84rem;
}

.farm-map-stats small {
  margin-top: 0.08rem;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
}

.farm-map-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.farm-map-type-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.22rem 0.45rem;
  min-width: 0;
  padding: 0.38rem 0.5rem;
  border: 1px solid rgba(49, 95, 151, 0.18);
  border-radius: 8px;
  background: rgba(49, 95, 151, 0.065);
}

.farm-map-type-summary.is-empty {
  border-style: dashed;
  background: var(--surface-2);
}

.farm-map-type-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 950;
  white-space: nowrap;
}

.farm-map-type-summary strong {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 950;
}

.farm-map-type-summary strong span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.farm-map-type-summary small {
  grid-column: 1 / -1;
  min-width: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.farm-map-type-summary .type-icon {
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
}

.farm-price-sources {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.32rem;
  min-width: 0;
}

.farm-price-sources-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
}

.farm-price-source {
  display: inline-grid;
  grid-template-columns: minmax(0, auto) auto;
  align-items: center;
  gap: 0.25rem;
  max-width: 100%;
  min-height: 1.75rem;
  padding: 0.18rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
}

.farm-price-source b,
.farm-price-source small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.farm-price-source b {
  color: var(--ink);
  font-size: 0.73rem;
  font-weight: 950;
}

.farm-price-source small {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
}

.farm-price-source[data-tone="market"] {
  border-color: rgba(45, 126, 80, 0.3);
  background: rgba(45, 126, 80, 0.08);
}

.farm-price-source[data-tone="market"] b {
  color: var(--green);
}

.farm-price-source[data-tone="npc"] {
  border-color: rgba(49, 95, 151, 0.28);
  background: rgba(49, 95, 151, 0.08);
}

.farm-price-source[data-tone="npc"] b {
  color: var(--blue);
}

.farm-price-source[data-tone="missing"] {
  border-style: dashed;
  opacity: 0.82;
}

.farm-map-actions {
  grid-column: 1 / -1;
}

.farm-map-actions button {
  width: 100%;
  font-weight: 900;
}

.farm-empty {
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
}

.market-entry-card,
.market-display-card {
  display: grid;
  gap: 0.56rem;
  min-width: 0;
  padding: 0.72rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.055);
}

.market-entry-card {
  grid-template-columns: minmax(16rem, 0.42fr) minmax(0, 1fr);
  align-items: center;
  border-color: color-mix(in srgb, var(--green) 28%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--green) 10%, transparent), transparent 58%),
    var(--surface);
}

.market-display-card {
  grid-template-columns: minmax(10.5rem, 0.48fr) minmax(15rem, 0.76fr) minmax(0, 1.36fr);
  align-items: end;
  border-color: color-mix(in srgb, var(--blue) 22%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue) 8%, transparent), transparent 55%),
    var(--surface);
}

.market-display-card .market-filter-summary,
.market-display-card .market-price-list,
.market-display-card .farm-empty {
  grid-column: 1 / -1;
}

.market-display-card .market-section-heading {
  grid-column: 1;
  align-self: end;
  align-items: center;
  min-height: 2.35rem;
}

.market-display-card .market-section-heading div {
  gap: 0.05rem;
}

.market-display-card .market-section-heading span {
  padding: 0;
  background: transparent;
  font-size: 0.68rem;
}

.market-display-card .market-section-heading strong {
  font-size: 0.96rem;
}

.market-display-card .market-search {
  grid-column: 2;
  align-self: end;
}

.market-display-card .market-list-toolbar {
  grid-column: 3;
  align-self: end;
  grid-template-columns: repeat(3, minmax(7.2rem, 1fr));
  gap: 0.35rem;
  padding: 0.32rem;
}

.market-entry-card .market-sync-panel {
  grid-column: 2;
  align-self: center;
  min-height: 2.45rem;
  padding: 0.28rem 0.44rem;
}

.market-entry-card .market-section-heading {
  grid-column: 1;
  align-items: center;
}

.market-entry-card .market-form,
.market-entry-card .market-form-message {
  grid-column: 1 / -1;
}

.market-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.market-section-heading div {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.market-section-heading span {
  width: fit-content;
  padding: 0.15rem 0.46rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--green) 12%, var(--surface));
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 950;
}

.market-display-card .market-section-heading span {
  background: color-mix(in srgb, var(--blue) 10%, var(--surface));
  color: var(--blue);
}

.market-section-heading strong {
  color: var(--ink);
  font-size: 1rem;
}

.market-form {
  display: grid;
  grid-template-columns:
    minmax(11rem, 1.35fr)
    minmax(8.5rem, 1fr)
    minmax(4.5rem, 0.45fr)
    minmax(7rem, 0.75fr)
    minmax(8rem, 0.75fr)
    minmax(9rem, 1fr)
    minmax(6.75rem, auto);
  gap: 0.42rem;
  align-items: end;
}

.market-form label,
.market-search,
.market-list-toolbar label {
  display: grid;
  gap: 0.22rem;
  min-width: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.market-display-card .market-search,
.market-display-card .market-list-toolbar label {
  gap: 0.14rem;
  font-size: 0.72rem;
}

.market-display-card .market-search input,
.market-display-card .market-list-toolbar select {
  min-height: 2.16rem;
}

.market-entry-card .market-form input,
.market-entry-card .market-form button {
  min-height: 2.22rem;
}

.market-list-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(10rem, 100%), 1fr));
  gap: 0.55rem;
  align-items: end;
  padding: 0.5rem;
  border: 1px solid rgba(49, 95, 151, 0.18);
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue) 6%, var(--surface));
}

.market-filter-summary {
  min-width: 0;
  padding: 0.38rem 0.56rem;
  border: 1px solid color-mix(in srgb, var(--blue) 22%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue) 7%, var(--surface));
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.field-label-row {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.market-unit-help {
  position: relative;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 1.05rem;
  height: 1.05rem;
  border: 1px solid rgba(49, 95, 151, 0.28);
  border-radius: 999px;
  background: rgba(49, 95, 151, 0.08);
  color: var(--blue);
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1;
  cursor: help;
}

.market-unit-help::after {
  content: attr(data-help);
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.45rem);
  z-index: 30;
  width: max-content;
  max-width: min(20rem, 74vw);
  padding: 0.45rem 0.55rem;
  border: 1px solid rgba(32, 42, 61, 0.16);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.2rem);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.market-unit-help:hover::after,
.market-unit-help:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.market-unit-help:focus-visible {
  outline: 2px solid rgba(49, 95, 151, 0.45);
  outline-offset: 2px;
}

.market-actions {
  display: flex;
  justify-content: flex-end;
}

.market-actions-compact {
  align-self: end;
  min-width: 0;
}

.market-actions button {
  min-width: 7rem;
  font-weight: 900;
}

.market-actions-compact button {
  width: 100%;
  min-height: 2.4rem;
  white-space: nowrap;
}

.market-summary {
  min-width: 0;
}

.market-form-message {
  padding: 0.55rem 0.7rem;
  border: 1px solid color-mix(in srgb, var(--amber) 30%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--amber) 8%, var(--surface));
  color: var(--amber);
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1.45;
}

.market-form-message[data-tone="warn"] {
  border-color: color-mix(in srgb, var(--red) 28%, var(--line));
  background: color-mix(in srgb, var(--red) 8%, var(--surface));
  color: var(--red);
}

.market-summary span,
.market-price-stats span {
  min-width: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.market-summary b,
.market-summary small,
.market-price-stats b,
.market-price-stats small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-summary b,
.market-price-stats b {
  color: var(--ink);
  font-size: 0.95rem;
}

.market-summary small,
.market-price-stats small {
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
}

.market-contribution-panel {
  position: relative;
  display: grid;
  gap: 0.75rem;
  overflow: hidden;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--amber) 32%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--amber) 18%, transparent), transparent 48%),
    radial-gradient(circle at 92% 12%, color-mix(in srgb, var(--green) 12%, transparent), transparent 28%),
    var(--surface);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.07);
}

.market-contribution-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(90deg, color-mix(in srgb, var(--amber) 10%, transparent) 1px, transparent 1px),
    linear-gradient(0deg, color-mix(in srgb, var(--amber) 8%, transparent) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.32;
}

.market-contribution-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  min-width: 0;
}

.market-contribution-head div {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.market-contribution-head span {
  width: fit-content;
  padding: 0.16rem 0.45rem;
  border: 1px solid color-mix(in srgb, var(--amber) 28%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--amber) 10%, var(--surface));
  color: var(--amber);
  font-size: 0.75rem;
  font-weight: 950;
}

.market-contribution-head strong {
  color: var(--ink);
  font-size: 1.08rem;
}

.market-contribution-head small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-align: right;
}

.market-contribution-list {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.55rem;
}

.market-contribution-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.7rem;
  border: 1px solid color-mix(in srgb, var(--amber) 18%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 90%, transparent), color-mix(in srgb, var(--amber) 8%, var(--surface))),
    var(--surface);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

.market-contribution-card[data-self="true"] {
  border-color: color-mix(in srgb, var(--green) 42%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--green) 12%, var(--surface)), color-mix(in srgb, var(--amber) 8%, var(--surface))),
    var(--surface);
}

.market-contribution-card[data-rank="1"] {
  border-color: color-mix(in srgb, var(--amber) 52%, var(--line));
  box-shadow: 0 16px 30px color-mix(in srgb, var(--amber) 14%, transparent);
}

.market-contribution-card[data-rank="2"] .market-contribution-rank {
  border-color: color-mix(in srgb, var(--blue) 26%, transparent);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue) 18%, white), color-mix(in srgb, var(--blue) 7%, var(--surface)));
  color: var(--blue);
}

.market-contribution-card[data-rank="3"] .market-contribution-rank {
  border-color: color-mix(in srgb, var(--red) 24%, transparent);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--red) 16%, white), color-mix(in srgb, var(--red) 6%, var(--surface)));
  color: var(--red);
}

.market-contribution-rank {
  display: grid;
  place-items: center;
  min-width: 2.25rem;
  height: 2.25rem;
  border: 1px solid color-mix(in srgb, var(--amber) 32%, transparent);
  border-radius: 999px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--amber) 32%, white), color-mix(in srgb, var(--amber) 12%, var(--surface)));
  color: var(--amber);
  font-size: 0.76rem;
  font-weight: 950;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.market-contribution-copy {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.market-contribution-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.86rem;
}

.market-contribution-copy small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
}

.market-contribution-score {
  display: grid;
  justify-items: end;
  line-height: 1;
  min-width: 2.7rem;
}

.market-contribution-score b {
  color: var(--green);
  font-size: 1.2rem;
}

.market-contribution-score small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
}

.market-contribution-progress {
  grid-column: 1 / -1;
  display: block;
  overflow: hidden;
  height: 0.34rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 62%, transparent);
}

.market-contribution-progress::before {
  content: "";
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--amber), var(--green));
}

.market-contribution-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0.75rem;
  border: 1px dashed color-mix(in srgb, var(--amber) 28%, var(--line));
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.mix-calculator-panel,
.contribution-panel {
  display: grid;
  gap: 1rem;
}

.mix-calculator-layout {
  display: grid;
  grid-template-columns: minmax(18rem, 0.9fr) minmax(20rem, 1.1fr);
  gap: 0.9rem;
  align-items: start;
}

.mix-calculator-card {
  display: grid;
  gap: 0.82rem;
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
}

.mix-calculator-entry-card,
.mix-calculator-material-card {
  align-self: stretch;
}

.mix-calculator-result-card {
  grid-column: 1 / -1;
}

.mix-calculator-form,
.mix-calculator-material-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.mix-calculator-form label,
.mix-calculator-monster-field {
  display: grid;
  gap: 0.34rem;
  min-width: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.mix-calculator-form input,
.mix-calculator-form select,
.mix-calculator-monster-field input {
  min-width: 0;
  min-height: 2.55rem;
  width: 100%;
}

.mix-calculator-monster-field {
  padding: 0.75rem;
  border: 1px solid color-mix(in srgb, var(--green) 20%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--green) 5%, var(--surface));
}

.mix-calculator-target-preview {
  min-width: 0;
}

.mix-calculator-target-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  min-width: 0;
  padding: 0.72rem;
  border: 1px solid color-mix(in srgb, var(--green) 24%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--green) 8%, transparent), transparent 58%),
    color-mix(in srgb, var(--surface) 96%, transparent);
}

.mix-calculator-target-card[data-empty="true"] {
  opacity: 0.72;
}

.mix-calculator-panel.is-mix-calculator-empty .mix-calculator-layout {
  gap: 0.72rem;
}

.mix-calculator-panel.is-mix-calculator-empty .mix-calculator-card {
  gap: 0.62rem;
  padding: 0.82rem;
}

.mix-calculator-panel.is-mix-calculator-empty .mix-calculator-target-card[data-empty="true"] {
  grid-template-columns: minmax(0, 1fr);
  padding: 0.58rem 0.65rem;
}

.mix-calculator-panel.is-mix-calculator-empty .mix-calculator-target-card[data-empty="true"] .mix-calculator-target-media {
  display: none;
}

.mix-calculator-panel.is-mix-calculator-empty .mix-calculator-target-preview + .mix-calculator-summary {
  display: none;
}

.mix-calculator-panel.is-mix-calculator-empty .mix-calculator-monster-field {
  padding: 0.58rem 0.65rem;
}

.mix-calculator-panel.is-mix-calculator-empty .mix-calculator-monster-head {
  grid-template-columns: minmax(0, 1fr);
}

.mix-calculator-panel.is-mix-calculator-empty .mix-calculator-material-media {
  display: none;
}

.mix-calculator-panel.is-mix-calculator-empty .mix-calculator-rule-note,
.mix-calculator-panel.is-mix-calculator-empty .mix-calculator-recommendation {
  padding: 0.56rem 0.65rem;
}

.mix-calculator-monster-media {
  display: grid;
  place-items: center;
  width: 4.1rem;
  height: 4.1rem;
  border: 1px solid color-mix(in srgb, var(--green) 18%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 68%, var(--surface));
}

.mix-calculator-target-media {
  width: 4.6rem;
  height: 4.6rem;
}

.mix-calculator-monster-visual {
  --visual-size: 3.25rem;
  --visual-box-width: 3.65rem;
  --visual-box-height: 3.65rem;
  --effect-width: 3.7rem;
  --effect-height: 1.55rem;
  --effect-bottom: 0.16rem;
}

.mix-calculator-target-media .mix-calculator-monster-visual {
  --visual-size: 3.7rem;
  --visual-box-width: 4.15rem;
  --visual-box-height: 4.15rem;
  --effect-width: 4.25rem;
  --effect-height: 1.8rem;
  --effect-bottom: 0.18rem;
}

.mix-calculator-target-copy,
.mix-calculator-monster-copy {
  display: grid;
  gap: 0.16rem;
  min-width: 0;
}

.mix-calculator-target-copy strong,
.mix-calculator-monster-copy > span {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.96rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mix-calculator-target-copy small,
.mix-calculator-monster-copy small,
.mix-calculator-summary,
.mix-calculator-rule-note {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1.55;
}

.mix-calculator-target-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  min-width: 0;
}

.mix-calculator-target-tags > small {
  display: inline-flex;
  align-items: center;
  min-height: 1.65rem;
  padding: 0 0.55rem;
  border: 1px solid color-mix(in srgb, var(--blue) 20%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 7%, var(--surface));
  color: var(--blue);
  font-weight: 900;
}

.mix-calculator-monster-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.65rem;
  align-items: center;
  min-width: 0;
}

.mix-calculator-material-media {
  display: grid;
  place-items: center;
  width: 3.8rem;
  height: 3.8rem;
  border: 1px solid color-mix(in srgb, var(--green) 18%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 70%, var(--surface));
}

.mix-calculator-material-visual {
  --visual-size: 3rem;
  --visual-box-width: 3.35rem;
  --visual-box-height: 3.35rem;
  --effect-width: 3.45rem;
  --effect-height: 1.45rem;
  --effect-bottom: 0.14rem;
}

.mix-calculator-summary,
.mix-calculator-rule-note,
.mix-calculator-recommendation {
  padding: 0.72rem;
  border: 1px solid color-mix(in srgb, var(--blue) 18%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue) 5%, var(--surface));
}

.mix-calculator-result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.62rem;
}

.mix-calculator-result-chip {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 52%, var(--surface));
}

.mix-calculator-result-chip span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.mix-calculator-result-chip strong {
  color: var(--ink);
  font-size: 1.16rem;
}

.mix-calculator-result-chip small {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.mix-calculator-bonus-guide {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.mix-calculator-bonus-guide span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 1.82rem;
  padding: 0.28rem 0.58rem;
  border: 1px solid color-mix(in srgb, var(--green) 20%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 72%, var(--surface));
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.mix-calculator-bonus-guide strong {
  color: var(--green-strong);
  font-weight: 950;
}

.mix-calculator-result-chip[data-tone="ok"],
.mix-calculator-recommendation[data-tone="ok"] {
  border-color: color-mix(in srgb, var(--green) 34%, var(--line));
  background: color-mix(in srgb, var(--green) 8%, var(--surface));
}

.mix-calculator-result-chip[data-tone="warn"],
.mix-calculator-recommendation[data-tone="warn"] {
  border-color: color-mix(in srgb, var(--amber) 34%, var(--line));
  background: color-mix(in srgb, var(--amber) 8%, var(--surface));
}

.mix-calculator-recommendation[data-tone="error"] {
  border-color: color-mix(in srgb, var(--red) 34%, var(--line));
  background: color-mix(in srgb, var(--red) 7%, var(--surface));
}

.mix-calculator-recommendation {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1.55;
}

.contribution-dashboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.contribution-stat-card {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
  align-content: start;
  padding: 0.85rem;
  border: 1px solid color-mix(in srgb, var(--amber) 22%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--amber) 8%, transparent), transparent 54%),
    var(--surface);
  box-shadow: var(--shadow);
}

.contribution-stat-card[data-tone="self"] {
  border-color: color-mix(in srgb, var(--green) 34%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--green) 10%, transparent), transparent 56%),
    var(--surface);
}

.contribution-stat-card[data-tone="market"] {
  border-color: color-mix(in srgb, var(--blue) 24%, var(--line));
}

.contribution-stat-card[data-tone="daily"] {
  border-color: color-mix(in srgb, var(--green) 22%, var(--line));
}

.contribution-stat-card[data-tone="drop"] {
  border-color: color-mix(in srgb, #8c6ad8 28%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, #8c6ad8 8%, transparent), transparent 56%),
    var(--surface);
}

.contribution-stat-card span,
.contribution-stat-card small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
}

.contribution-stat-card strong {
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 950;
}

.contribution-stat-progress {
  display: block;
  overflow: hidden;
  height: 0.36rem;
  margin-top: 0.24rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 68%, transparent);
}

.contribution-stat-progress::before {
  content: "";
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--amber), var(--green));
}

.contribution-hub-board {
  min-height: 14rem;
}

.drop-research-panel {
  display: grid;
  gap: 0.82rem;
}

.drop-research-heading {
  align-items: center;
}

.drop-research-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  min-width: 0;
}

.drop-research-actions small {
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
  padding: 0 0.65rem;
  border: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
}

.drop-research-actions small[data-tone="success"] {
  border-color: color-mix(in srgb, var(--green) 26%, var(--line));
  background: color-mix(in srgb, var(--green) 8%, var(--surface));
  color: var(--green);
}

.drop-research-actions small[data-tone="warn"] {
  border-color: color-mix(in srgb, var(--amber) 32%, var(--line));
  color: var(--amber);
}

.drop-research-actions small[data-tone="error"] {
  border-color: color-mix(in srgb, var(--red) 32%, var(--line));
  color: var(--red);
}

.drop-research-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(22rem, 0.95fr);
  gap: 0.82rem;
  align-items: start;
}

.drop-research-card {
  display: grid;
  gap: 0.62rem;
  min-width: 0;
  padding: 0.9rem;
  border: 1px solid color-mix(in srgb, var(--purple, #8c6ad8) 18%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, #8c6ad8 7%, transparent), transparent 54%),
    var(--surface);
  box-shadow: var(--shadow);
}

.drop-research-panel {
  position: relative;
}

.drop-research-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(135deg, color-mix(in srgb, #8c6ad8 8%, transparent), transparent 34%),
    linear-gradient(180deg, color-mix(in srgb, var(--amber) 5%, transparent), transparent 52%);
  pointer-events: none;
}

.drop-research-insight-card {
  border-color: color-mix(in srgb, #8c6ad8 24%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, #8c6ad8 9%, transparent), transparent 42%),
    linear-gradient(180deg, color-mix(in srgb, var(--amber) 5%, transparent), transparent),
    var(--surface);
}

.drop-research-login-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  min-width: 0;
  padding: 0.68rem 0.72rem;
  border: 1px solid color-mix(in srgb, var(--amber) 30%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--amber) 9%, transparent), transparent 58%),
    var(--surface);
}

.drop-research-login-panel[hidden] {
  display: none;
}

.drop-research-login-panel strong,
.drop-research-login-panel small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-research-login-panel strong {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 950;
}

.drop-research-login-panel small {
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.drop-research-login-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
  min-width: 0;
}

.drop-research-login-actions button {
  min-height: 2.05rem;
  padding: 0 0.72rem;
  font-size: 0.78rem;
  font-weight: 950;
}

#dropResearchLoginButton {
  border-color: color-mix(in srgb, var(--green) 42%, var(--line));
  background: color-mix(in srgb, var(--green) 12%, var(--surface));
  color: var(--green);
}

#dropResearchCopyLoginButton {
  border-color: color-mix(in srgb, var(--blue) 34%, var(--line));
  background: color-mix(in srgb, var(--blue) 8%, var(--surface));
  color: var(--blue);
}

.drop-research-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.72rem;
  align-items: end;
}

.drop-research-form label {
  display: grid;
  gap: 0.28rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.drop-research-form input,
.drop-research-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 850;
}

.drop-research-form input {
  min-height: 2.55rem;
  padding: 0.58rem 0.68rem;
}

.drop-research-time-control {
  display: flex;
  align-items: stretch;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.drop-research-time-control input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.drop-research-time-control button {
  flex: 0 0 3.8rem;
  width: 3.8rem;
  min-width: 3.8rem;
  min-height: 100%;
  padding: 0 0.58rem;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: color-mix(in srgb, var(--green) 9%, var(--surface));
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 950;
  white-space: nowrap;
}

.drop-research-selection-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  min-width: 0;
}

.drop-research-selection-preview[hidden] {
  display: none;
}

.drop-research-confirm-card {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr);
  gap: 0.58rem;
  align-items: center;
  min-width: 0;
  padding: 0.52rem;
  border: 1px solid color-mix(in srgb, var(--green) 24%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--green) 6%, var(--surface));
}

.drop-research-confirm-card[data-state="warn"] {
  border-color: color-mix(in srgb, var(--red) 34%, var(--line));
  background: color-mix(in srgb, var(--red) 5%, var(--surface));
}

.drop-research-confirm-card[data-state="manual"] {
  border-color: color-mix(in srgb, var(--amber) 34%, var(--line));
  background: color-mix(in srgb, var(--amber) 6%, var(--surface));
}

.drop-research-confirm-media {
  display: grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  min-width: 0;
  overflow: hidden;
  border-radius: 8px;
  background: color-mix(in srgb, var(--green) 9%, var(--surface-2));
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 950;
}

.drop-research-confirm-media .monster-visual-stack,
.drop-research-confirm-media .monster-visual-stack.has-effect,
.drop-research-confirm-media .monster-visual-base {
  width: 2.75rem;
  height: 2.75rem;
}

.drop-research-confirm-map img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.drop-research-confirm-copy {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.drop-research-confirm-copy small,
.drop-research-confirm-copy span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-research-confirm-copy strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-research-map-candidates {
  grid-column: 1 / -1;
}

.drop-research-map-candidates .drop-research-confirm-copy {
  gap: 0.28rem;
}

.drop-research-map-candidate-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  min-width: 0;
  padding-top: 0.08rem;
}

.drop-research-map-candidate-list button {
  min-height: 1.75rem;
  max-width: 100%;
  padding: 0.12rem 0.55rem;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--green) 28%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--green) 8%, var(--surface));
  color: var(--green);
  font-size: 0.7rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-research-map-candidate-list button:hover,
.drop-research-map-candidate-list button:focus-visible {
  border-color: color-mix(in srgb, var(--green) 46%, var(--line));
  background: color-mix(in srgb, var(--green) 13%, var(--surface));
}

.drop-research-map-candidate-list small {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
}

.drop-research-form textarea {
  resize: vertical;
  min-height: 5.6rem;
  padding: 0.65rem 0.72rem;
}

.drop-research-wide-field {
  grid-column: 1 / -1;
}

.drop-research-parse-preview {
  display: grid;
  gap: 0.42rem;
  min-width: 0;
  padding: 0.62rem 0.68rem;
  border: 1px dashed color-mix(in srgb, #8c6ad8 32%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, #8c6ad8 6%, var(--surface));
}

.drop-research-parse-preview small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
}

.drop-research-parse-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}

.drop-research-parse-chips span {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  min-height: 1.75rem;
  max-width: 100%;
  padding: 0.1rem 0.55rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, #8c6ad8 22%, var(--line));
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-research-parse-chips b {
  color: color-mix(in srgb, #8c6ad8 72%, var(--ink));
  font-size: 0.68rem;
  font-weight: 950;
}

.drop-research-form-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  padding-top: 0.1rem;
}

.drop-research-form-actions button:first-child {
  border-color: color-mix(in srgb, var(--green) 42%, var(--line));
  background: color-mix(in srgb, var(--green) 12%, var(--surface));
  color: var(--green);
  font-weight: 950;
}

.drop-research-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.drop-research-stat-card {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
  padding: 0.7rem 0.75rem;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 8px;
  background: var(--surface-2);
}

.drop-research-stat-card[data-tone="strong"],
.drop-research-stat-card[data-tone="good"] {
  border-color: color-mix(in srgb, var(--green) 26%, var(--line));
  background: color-mix(in srgb, var(--green) 7%, var(--surface));
}

.drop-research-stat-card[data-tone="warn"] {
  border-color: color-mix(in srgb, var(--amber) 30%, var(--line));
}

.drop-research-stat-card span,
.drop-research-stat-card small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-research-stat-card strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-research-trends {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.62rem;
}

.drop-research-theory-card {
  display: grid;
  gap: 0.52rem;
  min-width: 0;
  padding: 0.68rem;
  border: 1px solid color-mix(in srgb, #8c6ad8 24%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, #8c6ad8 7%, transparent), transparent 58%),
    var(--surface-2);
}

.drop-research-theory-card[data-tone="strong"] {
  border-color: color-mix(in srgb, var(--green) 38%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--green) 9%, transparent), transparent 58%),
    var(--surface-2);
}

.drop-research-theory-card[data-tone="good"] {
  border-color: color-mix(in srgb, var(--blue) 34%, var(--line));
}

.drop-research-theory-card[data-tone="warn"] {
  border-color: color-mix(in srgb, var(--amber) 38%, var(--line));
}

.drop-research-theory-card[data-tone="muted"] {
  border-color: color-mix(in srgb, #8c6ad8 16%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, #8c6ad8 4%, transparent), transparent 62%),
    var(--surface-2);
}

.drop-research-theory-card:first-child {
  grid-column: 1 / -1;
  border-color: color-mix(in srgb, #8c6ad8 34%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, #8c6ad8 10%, transparent), transparent 48%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 86%, transparent), transparent),
    var(--surface-2);
}

.drop-research-theory-card:first-child .drop-research-theory-rows {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.drop-research-theory-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.48rem;
  align-items: start;
  min-width: 0;
}

.drop-research-theory-head div {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.drop-research-theory-head span,
.drop-research-theory-head small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-research-theory-head strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-research-theory-head small {
  justify-self: end;
  min-height: 1.45rem;
  padding: 0.1rem 0.48rem;
  border: 1px solid color-mix(in srgb, #8c6ad8 22%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, #8c6ad8 7%, var(--surface));
  color: color-mix(in srgb, #8c6ad8 70%, var(--ink));
}

.drop-research-theory-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 820;
  line-height: 1.48;
}

.drop-research-theory-rows {
  display: grid;
  gap: 0.28rem;
  min-width: 0;
}

.drop-research-theory-rows span,
.drop-research-theory-rows button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 1.72rem;
  min-width: 0;
  padding: 0 0.52rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 8px;
  background: var(--surface);
}

.drop-research-theory-rows button {
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.drop-research-theory-rows button:hover,
.drop-research-theory-rows button:focus-visible,
.drop-research-theory-rows button[data-active="true"] {
  border-color: color-mix(in srgb, #8c6ad8 36%, var(--line));
  background: color-mix(in srgb, #8c6ad8 7%, var(--surface));
  color: var(--ink);
}

.drop-research-theory-rows button:focus-visible {
  outline: 2px solid color-mix(in srgb, #8c6ad8 44%, transparent);
  outline-offset: 2px;
}

.drop-research-theory-rows span::before,
.drop-research-theory-rows button::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--value, 0%);
  background: linear-gradient(90deg, color-mix(in srgb, var(--amber) 18%, transparent), transparent);
  pointer-events: none;
}

.drop-research-theory-rows b,
.drop-research-theory-rows small {
  position: relative;
  z-index: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-research-theory-rows b {
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 950;
}

.drop-research-theory-rows small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
}

.drop-research-trend-group {
  display: grid;
  gap: 0.42rem;
  min-width: 0;
}

.drop-research-trend-group > strong {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 950;
}

.drop-research-trend-list {
  display: grid;
  gap: 0.32rem;
  min-width: 0;
}

.drop-research-trend-list > small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.drop-research-trend-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
  min-height: 1.95rem;
  padding: 0 0.55rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 8px;
  background: var(--surface-2);
}

.drop-research-trend-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--value, 0%);
  background: linear-gradient(90deg, color-mix(in srgb, #8c6ad8 20%, transparent), transparent);
  pointer-events: none;
}

.drop-research-trend-item b,
.drop-research-trend-item small {
  position: relative;
  z-index: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-research-trend-item b {
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 950;
}

.drop-research-trend-item small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.drop-research-list-card {
  margin-top: 0.1rem;
}

.drop-research-list {
  display: grid;
  gap: 0.55rem;
}

.drop-research-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 0.58rem 0.68rem;
  border: 1px solid color-mix(in srgb, #8c6ad8 24%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(90deg, color-mix(in srgb, #8c6ad8 9%, transparent), transparent 70%),
    var(--surface-2);
}

.drop-research-filter-bar span {
  min-width: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.drop-research-filter-bar b {
  color: var(--ink);
}

.drop-research-filter-bar button {
  min-height: 2rem;
  padding: 0 0.7rem;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 950;
  cursor: pointer;
}

.drop-research-filter-bar button:hover,
.drop-research-filter-bar button:focus-visible {
  border-color: color-mix(in srgb, #8c6ad8 36%, var(--line));
  color: color-mix(in srgb, #8c6ad8 70%, var(--ink));
  outline: none;
}

.drop-research-row {
  display: grid;
  grid-template-columns: 3.8rem minmax(0, 1fr) auto;
  gap: 0.5rem 0.68rem;
  align-items: center;
  min-width: 0;
  padding: 0.7rem;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 8px;
  background: var(--surface-2);
}

.drop-research-row-media {
  display: grid;
  place-items: center;
  width: 3.8rem;
  height: 3.8rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, #8c6ad8 18%, var(--line));
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 42%, color-mix(in srgb, #8c6ad8 12%, transparent), transparent 58%),
    var(--surface);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
}

.drop-research-row-media .monster-visual-stack,
.drop-research-row-media .monster-visual-stack.has-effect,
.drop-research-row-media .monster-visual-base {
  width: 3.25rem;
  height: 3.25rem;
}

.drop-research-row-body {
  display: grid;
  gap: 0.32rem;
  min-width: 0;
}

.drop-research-row-title,
.drop-research-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  min-width: 0;
}

.drop-research-row-title strong {
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 950;
}

.drop-research-row-title b {
  min-width: 0;
  overflow: hidden;
  color: color-mix(in srgb, #8c6ad8 74%, var(--ink));
  font-size: 0.96rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-research-row-title > span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.drop-research-row-title small,
.drop-research-row p {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.drop-research-row-meta span {
  display: inline-flex;
  min-height: 1.45rem;
  align-items: center;
  max-width: 100%;
  padding: 0.08rem 0.48rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, #8c6ad8 18%, var(--line));
  border-radius: 999px;
  color: color-mix(in srgb, #8c6ad8 74%, var(--ink));
  font-size: 0.68rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-research-row-meta span[data-tone="suggested"] {
  border-color: color-mix(in srgb, var(--amber) 32%, var(--line));
  background: color-mix(in srgb, var(--amber) 8%, var(--surface));
  color: color-mix(in srgb, var(--amber) 78%, var(--ink));
}

.drop-research-row-meta span[data-tone="missing"] {
  border-color: color-mix(in srgb, var(--red) 24%, var(--line));
  background: color-mix(in srgb, var(--red) 5%, var(--surface));
  color: color-mix(in srgb, var(--red) 72%, var(--ink));
}

.drop-research-row p {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-research-row button {
  grid-column: 3;
  min-height: 2rem;
  padding: 0 0.58rem;
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 900;
}

@media (max-width: 900px) {
  .drop-research-layout,
  .drop-research-login-panel,
  .drop-research-form,
  .drop-research-selection-preview,
  .drop-research-stats,
  .drop-research-trends {
    grid-template-columns: 1fr;
  }

  .drop-research-actions,
  .drop-research-form-actions {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .drop-research-actions small,
  .drop-research-actions button,
  .drop-research-login-actions button,
  .drop-research-form-actions button {
    width: 100%;
  }

  .drop-research-row {
    grid-template-columns: 3.4rem minmax(0, 1fr);
    align-items: start;
  }

  .drop-research-row-media {
    width: 3.4rem;
    height: 3.4rem;
  }

  .drop-research-row-media .monster-visual-stack,
  .drop-research-row-media .monster-visual-stack.has-effect,
  .drop-research-row-media .monster-visual-base {
    width: 3rem;
    height: 3rem;
  }

  .drop-research-row button {
    grid-row: auto;
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
  }
}

.market-price-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(23rem, 100%), 24.75rem));
  grid-auto-rows: 1fr;
  gap: 0.65rem;
  justify-content: center;
  align-items: stretch;
}

.market-price-card {
  position: relative;
  display: grid;
  grid-template-rows: minmax(5.95rem, auto) minmax(3.95rem, auto) minmax(3.9rem, 1fr);
  align-content: start;
  gap: 0.48rem;
  height: 100%;
  width: 100%;
  min-height: 15.3rem;
  min-width: 0;
  max-width: 100%;
  padding: 0.62rem;
  border: 1px solid rgba(49, 95, 151, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue) 5%, transparent), transparent 52%),
    var(--surface);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.market-price-card.is-expanded {
  grid-template-rows: auto auto auto auto;
  min-height: 18rem;
}

.market-price-card:hover,
.market-price-card:focus-visible,
.market-price-card.is-expanded {
  border-color: color-mix(in srgb, var(--blue) 42%, var(--line));
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
}

.market-price-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 28%, transparent);
  outline-offset: 2px;
}

.market-price-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(3.2rem, auto) minmax(2.2rem, auto);
  align-items: start;
  gap: 0.42rem;
  min-width: 0;
  min-height: 5.95rem;
}

.market-price-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  min-height: 1.65rem;
}

.market-price-head .market-target-link {
  width: 100%;
  min-height: 3.2rem;
  align-self: start;
  grid-template-columns: 3rem minmax(0, 1fr);
  padding: 0.28rem 0.55rem;
}

.market-target-link .relation-link-text {
  display: block;
  min-width: 0;
  overflow: hidden;
  line-height: 1.25;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  word-break: normal;
  white-space: nowrap;
  hyphens: none;
}

.market-target-link .monster-visual-stack,
.market-target-link .monster-visual-stack.has-effect,
.market-target-link .monster-visual-stack .monster-visual-base,
.market-target-link img {
  width: 2.65rem;
  height: 2.65rem;
}

.market-price-card:not(.is-expanded) .market-price-meta {
  max-height: 3.55rem;
  overflow: hidden;
}

.market-price-compact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.42rem;
  align-items: center;
  min-width: 0;
}

.market-price-main-value {
  display: grid;
  min-width: 0;
  padding: 0.55rem 0.62rem;
  border: 1px solid color-mix(in srgb, var(--green) 18%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--green) 8%, var(--surface));
}

.market-price-main-value b,
.market-price-main-value small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-price-main-value b {
  color: var(--green);
  font-size: 1.05rem;
}

.market-price-main-value small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.market-price-trend,
.market-price-sample {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.65rem;
  padding: 0 0.48rem;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  white-space: nowrap;
}

.market-price-trend[data-tone="up"] {
  border-color: color-mix(in srgb, var(--amber) 32%, var(--line));
  color: var(--amber);
}

.market-price-trend[data-tone="down"],
.market-price-trend[data-tone="flat"] {
  border-color: color-mix(in srgb, var(--green) 24%, var(--line));
  color: var(--green);
}

.market-price-analysis-toggle {
  min-height: 1.9rem;
  padding: 0 0.58rem;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 950;
}

.market-price-meta > small {
  min-width: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.market-freshness-badge,
.market-quality-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  max-width: 100%;
  padding: 0.18rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

.market-quality-badge {
  border-color: rgba(102, 112, 106, 0.26);
  background: rgba(102, 112, 106, 0.09);
}

.market-freshness-badge[data-tone="fresh"] {
  border-color: rgba(45, 126, 80, 0.28);
  background: rgba(45, 126, 80, 0.11);
  color: var(--green);
}

.market-freshness-badge[data-tone="recent"] {
  border-color: rgba(49, 95, 151, 0.28);
  background: rgba(49, 95, 151, 0.1);
  color: var(--blue);
}

.market-freshness-badge[data-tone="aging"] {
  border-color: rgba(177, 118, 31, 0.32);
  background: rgba(177, 118, 31, 0.11);
  color: var(--amber);
}

.market-freshness-badge[data-tone="stale"] {
  border-color: rgba(185, 63, 63, 0.32);
  background: rgba(185, 63, 63, 0.1);
  color: var(--red);
}

.market-quality-badge[data-tone="ok"] {
  border-color: rgba(45, 126, 80, 0.28);
  background: rgba(45, 126, 80, 0.1);
  color: var(--green);
}

.market-quality-badge[data-tone="limited"],
.market-quality-badge[data-tone="watch"] {
  border-color: rgba(177, 118, 31, 0.32);
  background: rgba(177, 118, 31, 0.11);
  color: var(--amber);
}

.market-quality-badge[data-tone="warn"] {
  border-color: rgba(185, 63, 63, 0.34);
  background: rgba(185, 63, 63, 0.1);
  color: var(--red);
}

.market-price-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
}

.market-price-card:not(.is-expanded) .market-price-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.market-price-card:not(.is-expanded) .market-price-stats span:nth-child(2) {
  display: none;
}

.market-price-recent {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.market-price-analysis {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
  padding-top: 0.52rem;
  border-top: 1px dashed color-mix(in srgb, var(--blue) 22%, var(--line));
}

.market-price-analysis-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
}

.market-price-analysis-summary span {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
  padding: 0.42rem 0.5rem;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 8px;
  background: var(--surface-2);
}

.market-price-analysis-summary span[data-tone="up"] {
  border-color: color-mix(in srgb, var(--amber) 28%, var(--line));
  color: var(--amber);
}

.market-price-analysis-summary span[data-tone="down"],
.market-price-analysis-summary span[data-tone="flat"] {
  border-color: color-mix(in srgb, var(--green) 24%, var(--line));
  color: var(--green);
}

.market-price-analysis-summary small,
.market-price-analysis-summary b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-price-analysis-summary small {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
}

.market-price-analysis-summary b {
  color: currentColor;
  font-size: 0.78rem;
}

.market-price-chart {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.55rem;
  border: 1px solid color-mix(in srgb, var(--blue) 18%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--blue) 7%, transparent), transparent),
    var(--surface-2);
}

.market-price-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  min-width: 0;
}

.market-price-chart-head strong {
  color: var(--ink);
  font-size: 0.8rem;
}

.market-price-chart-head small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-price-chart svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 7rem;
}

.market-chart-gridline {
  fill: none;
  stroke: color-mix(in srgb, var(--muted) 22%, transparent);
  stroke-width: 1;
}

.market-chart-median {
  fill: none;
  stroke: color-mix(in srgb, var(--amber) 42%, transparent);
  stroke-dasharray: 4 5;
  stroke-width: 1.5;
}

.market-chart-area {
  fill: color-mix(in srgb, var(--blue) 12%, transparent);
}

.market-chart-line {
  fill: none;
  stroke: var(--blue);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.5;
}

.market-chart-dot {
  fill: var(--surface);
  stroke: var(--blue);
  stroke-width: 2;
}

.market-chart-label {
  fill: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
}

.market-price-chart-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-align: center;
}

.market-price-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.market-price-entry-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.28rem;
  min-width: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.25;
}

.market-price-entry-core {
  min-width: 0;
  color: var(--ink);
  font-weight: 950;
  white-space: nowrap;
}

.market-entry-source-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: min(7rem, 100%);
  min-height: 1.36rem;
  padding: 0.08rem 0.46rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--green) 22%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--green) 7%, var(--surface));
  color: var(--green);
  font-size: 0.66rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-entry-source-badge[data-source="local"] {
  border-color: color-mix(in srgb, var(--blue) 18%, var(--line));
  background: color-mix(in srgb, var(--blue) 5%, var(--surface));
  color: var(--blue);
}

.market-entry-source-badge[title] {
  cursor: help;
}

.market-price-entry-extra {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-price-entry.is-market-outlier .market-price-entry-core,
.market-price-entry-line[data-tone="warning"] .market-price-entry-extra {
  color: var(--red);
  font-weight: 900;
}

.market-price-entry-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.25rem;
  min-width: 0;
}

.market-price-entry-actions button {
  min-height: 1.6rem;
  padding: 0 0.42rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.market-detail-summary {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
}

.market-detail-recent {
  min-width: 0;
}

.market-detail-entry {
  grid-template-columns: minmax(0, 1fr);
}

.market-detail-freshness {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}

.market-detail-empty {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.market-detail-note {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.global-search-panel {
  display: grid;
  gap: 0.6rem;
  padding: 0.75rem;
  border: 1px solid rgba(49, 95, 151, 0.2);
  border-radius: 8px;
  background: rgba(49, 95, 151, 0.055);
}

.global-search-heading span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.global-search-heading strong {
  display: block;
  margin-top: 0.15rem;
}

.global-search-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr));
  gap: 0.45rem;
  max-height: min(20rem, 42vh);
  overflow: auto;
  padding-right: 0.15rem;
  scrollbar-width: thin;
}

.global-search-card {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr);
  gap: 0.5rem;
  align-items: center;
  min-width: 0;
  min-height: 3.75rem;
  padding: 0.45rem;
  border-color: rgba(49, 95, 151, 0.18);
  background: var(--surface);
  text-align: left;
}

.global-search-card:hover,
.global-search-card:focus-visible {
  border-color: rgba(49, 95, 151, 0.42);
  box-shadow: 0 8px 20px rgba(21, 25, 22, 0.08);
}

.global-search-media {
  display: grid;
  width: 3.2rem;
  height: 3.2rem;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
}

.global-search-media img {
  max-width: 2.9rem;
  max-height: 2.9rem;
  object-fit: contain;
}

.global-search-text {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
}

.global-search-text strong,
.global-search-text small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-text small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.smart-mix-hero {
  grid-column: 1;
  align-items: center;
  margin: 0;
  padding: 0.1rem 0.05rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.smart-mix-hero strong {
  font-size: clamp(1.08rem, 1.6vw, 1.28rem);
  letter-spacing: 0;
}

.smart-mix-command-panel {
  display: flex;
  grid-column: 1;
  align-items: center;
  justify-content: flex-start;
  gap: 0.55rem;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

#smartMixPlannerPane {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
  min-width: 0;
}

.mix-workspace {
  display: grid;
  gap: 0.65rem;
  margin: 0.75rem 0;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-2) 62%, var(--surface));
}
.smart-mix-command-panel:has(+ .mix-workspace) { display: none; }

.mix-workspace-toolbar,
.mix-workspace-views,
.mix-workspace-actions,
.mix-workspace-goal-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.mix-workspace-toolbar { justify-content: space-between; }
.mix-workspace-views button.is-active { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.mix-workspace-status { color: var(--muted); font-size: 0.82rem; }
.mix-workspace-goals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 0.7rem; }
.mix-workspace-readiness { grid-column: 1 / -1; display: flex; align-items: center; gap: 1rem; padding: 0.9rem; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(135deg, var(--green-soft), var(--surface)); }
.mix-workspace-readiness > div:last-child { display: grid; gap: 0.25rem; }
.mix-workspace-readiness small { color: var(--muted); }
.mix-workspace-ring { --progress: 0deg; flex: 0 0 6.2rem; aspect-ratio: 1; display: grid; place-content: center; text-align: center; border-radius: 50%; background: radial-gradient(circle at center, var(--surface) 57%, transparent 59%), conic-gradient(var(--green) var(--progress), var(--line) 0); }
.mix-workspace-ring strong { font-size: 1.35rem; }
.mix-workspace-ring small { font-size: 0.67rem; }
.mix-workspace-goal { display: grid; gap: 0.35rem; min-width: 0; padding: 0.65rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.mix-workspace-goal.is-active { border-color: var(--green); box-shadow: inset 3px 0 var(--green); }
.mix-workspace-goal-head { display: grid; grid-template-columns: 3rem minmax(0, 1fr); align-items: center; gap: 0.15rem 0.55rem; }
.mix-workspace-goal-head img { grid-row: 1 / 3; width: 3rem; height: 3rem; object-fit: contain; }
.mix-workspace-goal-head small { color: var(--muted); }
.mix-workspace-goal-title { justify-content: flex-start; width: 100%; min-width: 0; overflow-wrap: anywhere; font-weight: 900; }
.mix-workspace-goal-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.35rem; }
.mix-workspace-goal-metrics span { display: grid; padding: 0.4rem; text-align: center; border-radius: 8px; background: var(--surface-soft); }
.mix-workspace-goal-metrics small { color: var(--muted); font-size: 0.72rem; }
.mix-workspace-next { color: var(--green); font-weight: 900; }
.mix-workspace-goal > span { font-weight: 800; }
.mix-workspace-goal > small { min-height: 2.4em; color: var(--muted); }
.mix-workspace-inventory-editor { display: grid; grid-template-columns: minmax(13rem, 0.8fr) minmax(16rem, 1.2fr); gap: 0.7rem; }
.mix-workspace-material-filters { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.mix-workspace-material-filters label { display: grid; gap: 0.25rem; }
.mix-workspace-batch { width: 100%; min-height: 9rem; }
.mix-workspace-material-rows { display: grid; gap: 0.35rem; max-height: 19rem; overflow: auto; }
.mix-workspace-material-row { display: grid; grid-template-columns: minmax(7rem, 1fr) minmax(9rem, 1.4fr) auto 5rem auto; align-items: center; gap: 0.3rem; }
.mix-workspace-material-row small { color: var(--muted); overflow-wrap: anywhere; }
.mix-workspace-material-row input { min-width: 0; text-align: center; }
.mix-workspace-material-row button { min-width: 44px; min-height: 44px; }
.mix-workspace-material-row::before { content: attr(data-level-group); grid-column: 1 / -1; color: var(--muted); font-size: 0.72rem; font-weight: 900; }
.mix-workspace-more { position: relative; }
.mix-workspace-more summary { min-height: 44px; display: grid; place-items: center; padding: 0 0.8rem; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.mix-workspace-more[open] button { position: absolute; z-index: 5; right: 0; top: calc(100% + 0.3rem); min-width: 10rem; background: var(--surface); box-shadow: var(--shadow); }
.mix-tree-svg-node-card.is-duplicate-reference { display: grid; place-content: center; gap: 0.25rem; min-height: 4.5rem; padding: 0.55rem; border-style: dashed; text-align: center; }
.mix-tree-svg-node-card.is-duplicate-reference small { color: var(--muted); }

@media (max-width: 700px) {
  .official-mix-resource-gap-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .mix-workspace-inventory-editor { grid-template-columns: 1fr; }
  .mix-workspace-material-filters { grid-template-columns: 1fr; }
  .mix-workspace-material-row { grid-template-columns: minmax(0, 1fr) auto 4.5rem auto; }
  .mix-workspace-material-row small { grid-column: 1 / -1; grid-row: 2; }
  .mix-workspace-actions { width: 100%; }
  .mix-workspace-actions button { flex: 1; }
  .mix-workspace-readiness { align-items: flex-start; }
  .mix-workspace-ring { flex-basis: 5.2rem; }
  .mix-workspace-material-rows { max-height: none; }
}

.mix-tree-tool-pane {
  grid-column: 1 / -1;
  min-width: 0;
}

.smart-mix-controls {
  display: grid;
  grid-column: 1;
  grid-row: auto;
  grid-template-columns: minmax(18rem, 0.9fr) minmax(22rem, 1.1fr) minmax(12rem, 0.5fr);
  gap: 0.55rem;
  align-items: end;
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid color-mix(in srgb, var(--green) 18%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--green) 8%, transparent), transparent 56%),
    var(--surface);
  box-shadow: 0 12px 32px rgba(21, 25, 22, 0.06);
}

#smartMixSummary {
  grid-column: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0.42rem;
  min-height: 0;
  margin: 0;
  padding: 0.5rem;
  border-color: color-mix(in srgb, var(--green) 14%, var(--line));
  border-left: 0;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--green) 7%, transparent), transparent 60%),
    var(--surface);
}

#smartMixPlannerPane > .smart-mix-audit {
  grid-column: 1;
}

#smartMixPlannerPane > .smart-mix-results,
#smartMixPlannerPane > .farm-empty {
  grid-column: 1 / -1;
}

.smart-mix-mode-tabs {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  width: fit-content;
  max-width: 100%;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.smart-mix-mode-tabs button {
  min-height: 2rem;
  padding: 0 0.75rem;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 950;
}

.smart-mix-mode-tabs button.active,
.smart-mix-mode-tabs button[aria-selected="true"] {
  border-color: rgba(31, 122, 79, 0.32);
  background: rgba(31, 122, 79, 0.12);
  color: var(--green);
}

.smart-mix-controls label {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.smart-mix-target-control {
  grid-column: auto;
}

.smart-mix-controls.smart-mix-query-only {
  grid-template-columns: minmax(0, 1fr);
}

.smart-mix-query-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: stretch;
}

.smart-mix-query-bar button {
  min-width: 6rem;
  min-height: 2.7rem;
  padding-inline: 1.1rem;
  font-weight: 900;
}

.smart-mix-target-control input {
  min-height: 2.7rem;
  font-size: 1rem;
  font-weight: 850;
}

.smart-mix-inventory-control textarea {
  min-height: 4.4rem;
}

.smart-mix-controls textarea {
  min-height: 4.4rem;
  resize: vertical;
}

.smart-mix-inventory-control textarea {
  min-height: 4.4rem;
}

.smart-mix-controls small {
  display: none;
}

.smart-mix-query-only small {
  display: block;
  color: var(--muted);
  line-height: 1.55;
}

.smart-mix-audit {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.4rem;
  min-width: 0;
  padding: 0.55rem;
  border: 1px solid color-mix(in srgb, var(--green) 14%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 94%, var(--bg));
}

.smart-mix-summary-chip {
  display: grid;
  align-content: center;
  gap: 0.05rem;
  min-width: 0;
  min-height: 2.8rem;
  padding: 0.48rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 86%, var(--surface));
}

.smart-mix-summary-chip small,
.smart-mix-summary-chip b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.smart-mix-summary-chip small {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 950;
}

.smart-mix-summary-chip b {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 950;
}

.smart-mix-summary-chip.is-target {
  border-color: color-mix(in srgb, var(--blue) 24%, var(--line));
  background: color-mix(in srgb, var(--blue) 7%, var(--surface));
}

.smart-mix-summary-chip.is-owned,
.smart-mix-summary-chip.is-ready {
  border-color: color-mix(in srgb, var(--green) 24%, var(--line));
  background: color-mix(in srgb, var(--green) 7%, var(--surface));
}

.smart-mix-summary-chip.is-missing {
  border-color: color-mix(in srgb, var(--amber) 24%, var(--line));
  background: color-mix(in srgb, var(--amber) 7%, var(--surface));
}

.smart-mix-audit span,
.smart-mix-stats span {
  min-width: 0;
  padding: 0.5rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.smart-mix-audit b,
.smart-mix-audit small,
.smart-mix-stats b,
.smart-mix-stats small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.smart-mix-audit b,
.smart-mix-stats b {
  color: var(--ink);
  font-size: 0.92rem;
}

.smart-mix-audit small,
.smart-mix-stats small {
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.smart-mix-results {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.65rem;
}

.smart-mix-starter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  min-width: 0;
  padding: 0.85rem;
  border: 1px dashed color-mix(in srgb, var(--green) 26%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--green) 8%, transparent), transparent 58%),
    var(--surface);
}

.smart-mix-starter strong {
  display: block;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 950;
}

.smart-mix-starter p {
  margin: 0.18rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.smart-mix-starter-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.42rem;
  min-width: min(24rem, 100%);
}

.smart-mix-starter-button {
  min-height: 2.35rem;
  border-color: color-mix(in srgb, var(--green) 24%, var(--line));
  background: color-mix(in srgb, var(--green) 8%, var(--surface));
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 950;
}

.smart-mix-overview {
  display: grid;
  gap: 0.65rem;
  min-width: 0;
  padding: 0.75rem;
  border: 1px solid rgba(49, 95, 151, 0.22);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(49, 95, 151, 0.08), rgba(31, 122, 79, 0.06));
}

.smart-mix-overview-head,
.smart-mix-group-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.65rem;
  min-width: 0;
}

.smart-mix-overview-head strong,
.smart-mix-group-head strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 950;
}

.smart-mix-overview-head p,
.smart-mix-group-head small {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.4;
}

.smart-mix-tier-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(9rem, 100%), 1fr));
  gap: 0.42rem;
  min-width: 0;
}

.smart-mix-tier-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0.42rem 0.55rem;
  border-color: rgba(102, 112, 106, 0.18);
  background: var(--surface);
  text-align: left;
}

.smart-mix-tier-button b {
  display: inline-grid;
  min-width: 2.15rem;
  min-height: 2.15rem;
  place-items: center;
  border-radius: 8px;
  background: rgba(49, 95, 151, 0.1);
  color: var(--blue);
  font-weight: 950;
}

.smart-mix-tier-button span {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.smart-mix-tier-button.active,
.smart-mix-tier-button:hover,
.smart-mix-tier-button:focus-visible {
  border-color: rgba(31, 122, 79, 0.36);
  background: rgba(31, 122, 79, 0.09);
}

.smart-mix-tier-button.is-ready b {
  background: rgba(31, 122, 79, 0.12);
  color: var(--green);
}

.smart-mix-tier-button.is-future b,
.smart-mix-tier-button.is-missing b {
  background: rgba(177, 118, 31, 0.12);
  color: var(--amber);
}

.smart-mix-tier-button.is-owned b {
  background: rgba(49, 95, 151, 0.12);
  color: var(--blue);
}

.smart-mix-group {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}

.smart-mix-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(31rem, 100%), 1fr));
  gap: 0.65rem;
  min-width: 0;
}

.smart-mix-results.has-target-workbench {
  gap: 0.8rem;
}

.smart-mix-workbench {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid rgba(31, 122, 79, 0.26);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(31, 122, 79, 0.08), rgba(49, 95, 151, 0.07), var(--surface));
  box-shadow: 0 14px 32px rgba(21, 25, 22, 0.08);
}

.smart-mix-workbench-head,
.smart-mix-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.65rem;
  min-width: 0;
}

.smart-mix-workbench-head strong,
.smart-mix-panel-head strong {
  display: block;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 950;
}

.smart-mix-workbench-head p,
.smart-mix-panel-head small {
  margin: 0.12rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.4;
}

.smart-mix-workbench-layout {
  display: grid;
  grid-template-columns: minmax(16rem, 0.72fr) minmax(20rem, 1fr) minmax(20rem, 1fr);
  gap: 0.75rem;
  align-items: stretch;
  min-width: 0;
}

.smart-mix-goal-hero,
.smart-mix-next-work,
.smart-mix-missing-panel,
.smart-mix-step-timeline {
  display: grid;
  align-content: start;
  gap: 0.65rem;
  min-width: 0;
  padding: 0.75rem;
  border: 1px solid rgba(49, 95, 151, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.smart-mix-goal-hero {
  border-color: rgba(31, 122, 79, 0.28);
  background: rgba(255, 255, 255, 0.82);
}

.smart-mix-next-work {
  grid-column: 2 / -1;
  border-color: rgba(49, 95, 151, 0.28);
  background:
    linear-gradient(135deg, rgba(49, 95, 151, 0.12), rgba(31, 122, 79, 0.06)),
    rgba(255, 255, 255, 0.76);
}

.smart-mix-missing-panel {
  grid-column: 1;
  border-color: rgba(177, 118, 31, 0.24);
  background: rgba(177, 118, 31, 0.06);
}

.smart-mix-step-timeline {
  grid-column: 2 / -1;
  background: rgba(255, 255, 255, 0.78);
}

.smart-mix-goal-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  min-width: 0;
}

.smart-mix-goal-visual {
  display: grid;
  width: 7.2rem;
  min-width: 7.2rem;
  height: 7.2rem;
  place-items: center;
  border: 1px solid rgba(31, 122, 79, 0.18);
  border-radius: 8px;
  background: rgba(31, 122, 79, 0.07);
}

.smart-mix-goal-visual-stack,
.smart-mix-goal-visual-stack.has-effect,
.smart-mix-goal-visual-stack .monster-visual-base {
  width: 6.25rem;
  height: 6.25rem;
}

.smart-mix-goal-identity {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.smart-mix-goal-identity > small,
.smart-mix-next-work > small,
.smart-mix-next-followup {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
}

.smart-mix-goal-identity strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 1.55rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.smart-mix-goal-identity span:not(.smart-mix-state-badge) {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.smart-mix-goal-progress {
  display: grid;
  position: relative;
  min-height: 2rem;
  overflow: hidden;
  border: 1px solid rgba(31, 122, 79, 0.2);
  border-radius: 999px;
  background: rgba(102, 112, 106, 0.08);
}

.smart-mix-goal-progress span {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(31, 122, 79, 0.32), rgba(49, 95, 151, 0.26));
}

.smart-mix-goal-progress b {
  position: relative;
  z-index: 1;
  place-self: center;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 950;
}

.smart-mix-workbench-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.42rem;
}

.smart-mix-workbench-stats span {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
  padding: 0.58rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.smart-mix-workbench-stats b,
.smart-mix-workbench-stats small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.smart-mix-workbench-stats b {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 950;
}

.smart-mix-workbench-stats small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.smart-mix-workbench-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.smart-mix-workbench-actions button {
  min-height: 2.35rem;
  font-size: 0.82rem;
  font-weight: 900;
}

.smart-mix-next-work > strong {
  min-width: 0;
  color: var(--ink);
  font-size: 1.28rem;
  font-weight: 950;
  line-height: 1.25;
}

.smart-mix-next-work p {
  margin: 0;
  color: var(--blue);
  font-size: 0.88rem;
  font-weight: 900;
  line-height: 1.45;
}

.smart-mix-next-work .smart-mix-next-formula {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.smart-mix-missing-list {
  display: grid;
  gap: 0.36rem;
  min-width: 0;
}

.smart-mix-missing-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
  min-width: 0;
  padding: 0.42rem;
  border: 1px solid rgba(177, 118, 31, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.smart-mix-missing-row > span {
  display: flex;
  align-items: center;
  gap: 0.32rem;
  min-width: 0;
}

.smart-mix-missing-row b {
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 950;
  white-space: nowrap;
}

.smart-mix-missing-done {
  margin: 0;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.45;
}

.smart-mix-step-list {
  display: grid;
  gap: 0.48rem;
  min-width: 0;
  max-height: min(38rem, 62vh);
  overflow: auto;
  padding-right: 0.18rem;
  scrollbar-width: thin;
}

.smart-mix-step-row {
  display: grid;
  grid-template-columns: 4rem minmax(12rem, 0.95fr) minmax(18rem, 1.45fr) minmax(10rem, 0.72fr);
  gap: 0.55rem;
  align-items: stretch;
  min-width: 0;
  padding: 0.55rem;
  border: 1px solid rgba(49, 95, 151, 0.16);
  border-radius: 8px;
  background: var(--surface);
}

.smart-mix-step-row.is-ready {
  border-color: rgba(49, 95, 151, 0.34);
  background: rgba(49, 95, 151, 0.07);
}

.smart-mix-step-row.is-owned,
.smart-mix-step-row.is-done {
  border-color: rgba(31, 122, 79, 0.32);
  background: rgba(31, 122, 79, 0.07);
}

.smart-mix-step-row.is-blocked {
  border-color: rgba(177, 118, 31, 0.24);
}

.smart-mix-step-index {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.05rem;
  min-width: 0;
  border-radius: 8px;
  background: rgba(49, 95, 151, 0.09);
  color: var(--blue);
}

.smart-mix-step-index small {
  font-size: 0.62rem;
  font-weight: 950;
}

.smart-mix-step-index b {
  font-size: 1.15rem;
  font-weight: 950;
}

.smart-mix-step-monster {
  display: grid;
  align-content: start;
  gap: 0.22rem;
  min-width: 0;
  padding: 0.42rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.smart-mix-step-monster.is-owned {
  border-color: rgba(31, 122, 79, 0.24);
  background: rgba(31, 122, 79, 0.08);
}

.smart-mix-step-monster.is-missing {
  border-color: rgba(177, 118, 31, 0.24);
  background: rgba(177, 118, 31, 0.08);
}

.smart-mix-step-monster > small:first-child,
.smart-mix-step-meta,
.smart-mix-step-availability {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.smart-mix-step-monster-line {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
}

.smart-mix-step-monster-line .relation-link {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

.smart-mix-step-monster-line .species-badge {
  max-width: 6rem;
}

.smart-mix-step-materials {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  min-width: 0;
}

.smart-mix-step-state {
  display: grid;
  align-content: center;
  gap: 0.25rem;
  min-width: 0;
  padding: 0.45rem;
  border-radius: 8px;
  background: rgba(102, 112, 106, 0.08);
}

.smart-mix-step-state span {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  min-height: 1.7rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: rgba(102, 112, 106, 0.12);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 950;
}

.smart-mix-step-state.is-ready span {
  background: rgba(49, 95, 151, 0.12);
  color: var(--blue);
}

.smart-mix-step-state.is-owned span,
.smart-mix-step-state.is-done span {
  background: rgba(31, 122, 79, 0.12);
  color: var(--green);
}

.smart-mix-step-state.is-blocked span {
  background: rgba(177, 118, 31, 0.12);
  color: var(--amber);
}

.smart-mix-step-state small {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  line-height: 1.35;
}

.smart-mix-results.has-target-workbench .smart-mix-group-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(24rem, 100%), 1fr));
}

.smart-mix-results.has-target-workbench .smart-mix-card {
  gap: 0.5rem;
}

.smart-mix-results.has-target-workbench .smart-mix-body {
  max-height: 13rem;
  overflow: auto;
  scrollbar-width: thin;
}

.smart-mix-card {
  display: grid;
  gap: 0.65rem;
  min-width: 0;
  align-content: start;
  padding: 0.75rem;
  border: 1px solid rgba(49, 95, 151, 0.22);
  border-radius: 8px;
  background: var(--surface);
}

.smart-mix-card.is-complete {
  border-color: rgba(31, 122, 79, 0.34);
  background: linear-gradient(135deg, rgba(31, 122, 79, 0.08), var(--surface));
}

.smart-mix-card.is-future {
  border-color: rgba(177, 118, 31, 0.34);
  background: linear-gradient(135deg, rgba(177, 118, 31, 0.08), var(--surface));
}

.smart-mix-card.is-missing {
  border-color: rgba(102, 112, 106, 0.22);
}

.smart-mix-card.is-owned {
  border-color: rgba(49, 95, 151, 0.34);
  background: linear-gradient(135deg, rgba(49, 95, 151, 0.08), var(--surface));
}

.smart-mix-card.is-focused {
  border-color: rgba(31, 122, 79, 0.54);
  box-shadow: 0 0 0 3px rgba(31, 122, 79, 0.13);
}

.smart-mix-card-head,
.smart-mix-target {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.smart-mix-card-head {
  justify-content: space-between;
}

.smart-mix-target {
  flex: 1 1 auto;
}

.smart-mix-target strong,
.smart-mix-target small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.smart-mix-target small {
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.smart-mix-target-visual {
  flex: 0 0 auto;
  width: 4.1rem;
  min-width: 4.1rem;
  height: 4.1rem;
}

.smart-mix-badge-stack {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  max-width: 9.5rem;
}

.smart-mix-state-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.55rem;
  max-width: 100%;
  padding: 0 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  white-space: nowrap;
}

.smart-mix-state-badge.is-ready {
  border-color: rgba(31, 122, 79, 0.32);
  background: rgba(31, 122, 79, 0.1);
  color: var(--green);
}

.smart-mix-state-badge.is-future {
  border-color: rgba(177, 118, 31, 0.34);
  background: rgba(177, 118, 31, 0.1);
  color: var(--amber);
}

.smart-mix-state-badge.is-missing {
  border-color: rgba(102, 112, 106, 0.24);
  background: rgba(102, 112, 106, 0.08);
  color: var(--muted);
}

.smart-mix-state-badge.is-owned {
  border-color: rgba(49, 95, 151, 0.34);
  background: rgba(49, 95, 151, 0.1);
  color: var(--blue);
}

.smart-mix-progress {
  display: grid;
  position: relative;
  min-height: 1.45rem;
  overflow: hidden;
  border: 1px solid rgba(31, 122, 79, 0.18);
  border-radius: 999px;
  background: rgba(102, 112, 106, 0.08);
}

.smart-mix-progress span {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(31, 122, 79, 0.28), rgba(49, 95, 151, 0.24));
}

.smart-mix-progress b {
  position: relative;
  z-index: 1;
  place-self: center;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
}

.smart-mix-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
}

.smart-mix-next {
  margin: 0;
  color: var(--blue);
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.45;
}

.smart-mix-next-plan {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid rgba(49, 95, 151, 0.2);
  border-radius: 8px;
  background: rgba(49, 95, 151, 0.06);
}

.smart-mix-next-plan > small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.smart-mix-next-plan > strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.smart-mix-next-plan p {
  margin: 0;
  color: var(--blue);
  font-size: 0.84rem;
  font-weight: 900;
  line-height: 1.42;
}

.smart-mix-route-preview,
.smart-mix-route-step {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
}

.smart-mix-route-step > small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 950;
}

.smart-mix-next-formula {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  min-width: 0;
}

.smart-mix-plan-monster {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.smart-mix-plan-monster > small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.smart-mix-plan-monster .relation-link {
  width: 100%;
  min-width: 0;
}

.smart-mix-plan-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.smart-mix-body {
  display: grid;
  gap: 0.5rem;
}

.smart-mix-material-table {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.smart-mix-material-row {
  display: grid;
  grid-template-columns: minmax(11rem, 1.35fr) repeat(3, minmax(3.8rem, 0.35fr));
  gap: 0.35rem;
  align-items: center;
  min-width: 0;
  padding: 0.42rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.smart-mix-material-header {
  min-height: 2rem;
  color: var(--blue);
  background: rgba(49, 95, 151, 0.08);
  font-size: 0.72rem;
  font-weight: 900;
}

.smart-mix-material-monster {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.smart-mix-material-monster .relation-link {
  width: 100%;
  min-width: 0;
}

.smart-mix-material-row > span {
  min-width: 0;
}

.smart-mix-material-row > span:not(:first-child) {
  color: var(--ink);
  font-weight: 900;
  text-align: center;
}

.smart-mix-material-row .is-missing {
  color: var(--amber);
}

.smart-mix-material-row.is-owned {
  border-color: rgba(31, 122, 79, 0.22);
  background: rgba(31, 122, 79, 0.07);
}

.smart-mix-material-more {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
}

.smart-mix-chip-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.smart-mix-route-source {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}

.smart-mix-card-source {
  justify-content: flex-start;
  padding: 0.5rem;
  border: 1px solid rgba(102, 112, 106, 0.14);
  border-radius: 8px;
  background: rgba(102, 112, 106, 0.05);
}

.smart-mix-route-source-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  max-width: 100%;
  padding: 0 0.48rem;
  border: 1px solid rgba(49, 95, 151, 0.18);
  border-radius: 999px;
  background: rgba(49, 95, 151, 0.08);
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.smart-mix-chip-group > small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.smart-mix-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  max-width: 100%;
  min-height: 2rem;
  padding: 0.14rem 0.42rem;
  border: 1px solid rgba(31, 122, 79, 0.18);
  border-radius: 999px;
  background: rgba(31, 122, 79, 0.08);
}

.smart-mix-missing .smart-mix-chip {
  border-color: rgba(177, 118, 31, 0.2);
  background: rgba(177, 118, 31, 0.1);
}

.smart-mix-owned-match .smart-mix-chip {
  border-color: rgba(31, 122, 79, 0.22);
  background: rgba(31, 122, 79, 0.09);
}

.smart-mix-missing-preview .smart-mix-chip {
  border-color: rgba(177, 118, 31, 0.22);
  background: rgba(177, 118, 31, 0.1);
}

.smart-mix-chip.muted {
  color: var(--muted);
}

.smart-mix-chip .relation-link {
  min-height: 1.5rem;
  padding: 0;
  border: 0;
  background: transparent;
}

.smart-mix-chip em {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.smart-mix-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.smart-mix-actions button {
  min-height: 2rem;
  font-size: 0.78rem;
  font-weight: 900;
}

.mix-tree-tool-pane {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
}

.smart-mix-panel.is-tree-workbench {
  gap: 0.55rem;
  width: 100%;
  max-width: none;
  margin-bottom: 0.45rem;
  padding: 0.7rem;
}

.smart-mix-panel.is-tree-workbench .farm-planner-heading {
  align-items: center;
  margin-bottom: -0.1rem;
}

.smart-mix-panel.is-tree-workbench .farm-planner-heading strong {
  font-size: 1rem;
}

.mix-tree-control-deck {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(14rem, 0.34fr);
  gap: 0.45rem;
  min-width: 0;
  padding: 0.5rem;
  border: 1px solid color-mix(in srgb, var(--blue) 18%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 82%, var(--surface-2));
}

.mix-tree-control-deck .mix-tree-tool-controls {
  grid-column: 1 / -1;
}

.mix-tree-tool-controls {
  display: grid;
  grid-template-columns: minmax(18rem, 1fr) minmax(12rem, 0.45fr) auto;
  gap: 0.6rem;
  align-items: end;
}

.smart-mix-panel.is-tree-workbench .mix-tree-tool-controls {
  grid-template-columns: minmax(18rem, 1fr) minmax(9rem, 0.24fr) auto;
  align-items: end;
  gap: 0.45rem;
}

.mix-tree-tool-controls label {
  display: grid;
  gap: 0.24rem;
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.mix-tree-tool-controls button {
  min-height: 2.35rem;
  white-space: nowrap;
}

.mix-tree-type-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}

.smart-mix-panel.is-tree-workbench .mix-tree-type-buttons {
  grid-column: 1;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 0.08rem;
  scrollbar-width: thin;
}

.mix-tree-type-buttons button {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  min-height: 2.05rem;
  padding: 0 0.55rem;
  border-color: rgba(49, 95, 151, 0.18);
  background: rgba(49, 95, 151, 0.06);
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 900;
}

.smart-mix-panel.is-tree-workbench .mix-tree-type-buttons button {
  flex: 0 0 auto;
  min-height: 1.82rem;
  padding-inline: 0.48rem;
  font-size: 0.72rem;
}

.smart-mix-panel.is-tree-workbench #mixTreeToolSummary {
  grid-column: 2;
  align-self: stretch;
  min-height: 1.85rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid color-mix(in srgb, var(--blue) 14%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue) 5%, var(--surface));
  font-size: 0.76rem;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mix-tree-type-buttons button.active {
  border-color: rgba(31, 122, 79, 0.34);
  background: rgba(31, 122, 79, 0.12);
  color: var(--green);
}

.mix-tree-type-buttons .species-badge {
  min-height: 1.4rem;
  padding: 0;
  border: 0;
  background: transparent;
}

.mix-tree-type-buttons > button > small {
  color: var(--muted);
  font-size: 0.68rem;
}

.mix-tree-tool-workspace {
  display: grid;
  gap: 0.65rem;
  min-width: 0;
}

.smart-mix-panel.is-tree-workbench .mix-tree-tool-workspace {
  gap: 0.55rem;
}

.mix-tree-dashboard {
  display: grid;
  gap: 0.6rem;
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.mix-tree-dashboard.is-collapsed > :not(.mix-tree-dashboard-head) { display: none; }

@media (min-width: 1024px) {
  .smart-mix-panel.is-tree-workbench .mix-tree-tool-workspace {
    grid-template-columns: minmax(17rem, 32%) minmax(0, 1fr);
    align-items: start;
  }
  .smart-mix-panel.is-tree-workbench .mix-tree-dashboard {
    position: sticky;
    top: 0.5rem;
    width: 100%;
    min-width: 17rem;
    max-width: min(46rem, 55vw);
    max-height: calc(100vh - 7rem);
    overflow: auto;
    resize: horizontal;
  }
  .smart-mix-panel.is-tree-workbench .mix-tree-dashboard.is-collapsed {
    width: 17rem;
    resize: none;
  }
}

.smart-mix-panel.is-tree-workbench .mix-tree-dashboard {
  gap: 0.48rem;
  padding: 0.55rem;
}

.mix-tree-dashboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.55rem;
  min-width: 0;
}

.smart-mix-panel.is-tree-workbench .mix-tree-dashboard-head {
  align-items: center;
}

.mix-tree-navigator {
  display: grid;
  grid-template-columns: minmax(13rem, 0.9fr) minmax(12rem, 1fr);
  gap: 0.5rem;
  align-items: start;
  min-width: 0;
}

.smart-mix-panel.is-tree-workbench .mix-tree-navigator {
  grid-template-columns: minmax(14rem, 0.42fr) minmax(0, 1fr);
}

.mix-tree-search-field {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.mix-tree-search-field span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
}

.mix-tree-search-field input {
  width: 100%;
  min-width: 0;
  min-height: 2.25rem;
  padding: 0.4rem 0.58rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

.mix-tree-search-field input:focus {
  border-color: rgba(49, 95, 151, 0.5);
  box-shadow: 0 0 0 3px var(--focus);
}

.mix-tree-status-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  min-width: 0;
}

.mix-tree-status-chip {
  display: grid;
  gap: 0.04rem;
  min-width: 0;
  padding: 0.38rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.mix-tree-status-chip b {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 950;
  line-height: 1;
}

.mix-tree-status-chip small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mix-tree-status-chip.is-done,
.mix-tree-status-chip.is-owned {
  border-color: rgba(31, 122, 79, 0.26);
  background: rgba(31, 122, 79, 0.08);
}

.mix-tree-status-chip.is-ready {
  border-color: rgba(49, 95, 151, 0.28);
  background: rgba(49, 95, 151, 0.08);
}

.mix-tree-status-chip.is-blocked {
  border-color: rgba(184, 66, 53, 0.24);
  background: rgba(184, 66, 53, 0.07);
}

.mix-tree-search-results {
  display: flex;
  grid-column: 1 / -1;
  gap: 0.35rem;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 0.05rem;
  scrollbar-width: thin;
}

.mix-tree-search-result {
  display: grid;
  flex: 0 0 min(13.5rem, 78vw);
  gap: 0.08rem;
  justify-items: start;
  min-height: 2.7rem;
  padding: 0.4rem 0.55rem;
  border-color: rgba(49, 95, 151, 0.2);
  background: var(--surface);
  text-align: left;
}

.mix-tree-search-result strong,
.mix-tree-search-result small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mix-tree-search-result strong {
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 950;
}

.mix-tree-search-result small,
.mix-tree-search-empty {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
}

.mix-tree-search-result.is-ready {
  border-color: rgba(49, 95, 151, 0.34);
}

.mix-tree-search-result.is-owned,
.mix-tree-search-result.is-done {
  border-color: rgba(31, 122, 79, 0.34);
}

.mix-tree-search-result.is-blocked {
  border-color: rgba(184, 66, 53, 0.28);
}

.mix-tree-dashboard-tabs,
.mix-tree-density-toggle {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}

.mix-tree-dashboard-tabs button,
.mix-tree-density-toggle button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  padding: 0 0.65rem;
  font-size: 0.8rem;
  font-weight: 950;
}

.mix-tree-dashboard-tabs button small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 950;
}

.mix-tree-dashboard-tabs button.active,
.mix-tree-density-toggle button.active {
  border-color: rgba(31, 122, 79, 0.34);
  background: rgba(31, 122, 79, 0.12);
  color: var(--green);
}

.mix-tree-dashboard-panel {
  min-width: 0;
  max-height: min(34vh, 25rem);
  overflow: auto;
  scrollbar-width: thin;
}

.smart-mix-panel.is-tree-workbench .mix-tree-dashboard-panel {
  max-height: min(16rem, 28vh);
}

.mix-tree-step-list {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.mix-tree-step-row {
  display: grid;
  grid-template-columns: 3.3rem minmax(9rem, 1fr) minmax(15rem, 1.55fr) minmax(12rem, 1.15fr);
  gap: 0.55rem;
  align-items: stretch;
  min-width: 0;
  padding: 0.5rem;
  border: 1px solid rgba(49, 95, 151, 0.14);
  border-radius: 8px;
  background: var(--surface);
}

.mix-tree-step-row.active {
  border-color: rgba(31, 122, 79, 0.42);
  background: rgba(31, 122, 79, 0.08);
}

.mix-tree-step-row.is-done {
  border-color: rgba(31, 122, 79, 0.36);
}

.mix-tree-step-row.is-owned {
  border-color: rgba(31, 122, 79, 0.28);
}

.mix-tree-step-row.is-ready {
  border-color: rgba(49, 95, 151, 0.32);
}

.mix-tree-step-row.is-blocked {
  border-color: rgba(184, 66, 53, 0.24);
}

.mix-tree-step-index {
  display: grid;
  place-items: center;
  align-content: center;
  min-width: 0;
  border-radius: 8px;
  background: rgba(49, 95, 151, 0.09);
  color: var(--blue);
}

.mix-tree-progress-toggle {
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  min-height: 1.35rem;
  padding: 0;
  border-color: rgba(49, 95, 151, 0.32);
  border-radius: 6px;
  background: var(--surface);
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 950;
  line-height: 1;
}

.mix-tree-progress-toggle[aria-pressed="true"] {
  border-color: rgba(31, 122, 79, 0.46);
  background: rgba(31, 122, 79, 0.14);
}

.mix-tree-step-index small,
.mix-tree-step-monster > small,
.mix-tree-step-requirement,
.mix-tree-formula-fixed {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.mix-tree-step-index strong {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 950;
}

.mix-tree-step-monster,
.mix-tree-step-choice {
  display: grid;
  gap: 0.2rem;
  align-content: start;
  min-width: 0;
}

.mix-tree-step-monster.is-owned {
  color: var(--green);
}

.mix-tree-step-monster.is-missing {
  color: var(--red);
}

.mix-tree-step-materials,
.mix-tree-node-detail-recipe {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  min-width: 0;
}

.mix-tree-step-monster-line {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.mix-tree-step-monster-line a,
.mix-tree-step-monster-line button {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mix-tree-step-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mix-tree-step-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  min-width: 0;
}

.mix-tree-step-status span,
.mix-tree-step-availability {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 1.35rem;
  padding: 0 0.38rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.66rem;
  font-weight: 950;
  white-space: nowrap;
}

.mix-tree-step-status small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mix-tree-step-status.is-done span,
.mix-tree-step-status.is-owned span,
.mix-tree-step-availability.is-owned {
  border-color: rgba(31, 122, 79, 0.26);
  background: rgba(31, 122, 79, 0.1);
  color: var(--green);
}

.mix-tree-step-status.is-ready span {
  border-color: rgba(49, 95, 151, 0.28);
  background: rgba(49, 95, 151, 0.1);
  color: var(--blue);
}

.mix-tree-step-status.is-blocked span,
.mix-tree-step-availability.is-missing {
  border-color: rgba(184, 66, 53, 0.28);
  background: rgba(184, 66, 53, 0.08);
  color: var(--red);
}

.mix-tree-step-formulas {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.32rem;
  min-width: 0;
}

.mix-tree-step-formulas button {
  display: inline-grid;
  gap: 0.05rem;
  min-height: 2rem;
  justify-items: start;
  padding: 0.25rem 0.55rem;
  font-size: 0.76rem;
  font-weight: 950;
}

.mix-tree-step-formulas button small {
  max-width: 11rem;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.64rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mix-tree-step-formulas button.active {
  border-color: rgba(31, 122, 79, 0.36);
  background: rgba(31, 122, 79, 0.12);
  color: var(--green);
}

.mix-tree-step-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.32rem;
}

.mix-tree-step-focus {
  min-height: 1.8rem;
  padding: 0 0.55rem;
  border-color: rgba(49, 95, 151, 0.24);
  background: rgba(49, 95, 151, 0.08);
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 950;
}

.mix-tree-step-list.is-compact .mix-tree-step-row {
  grid-template-columns: 3rem minmax(8rem, 1fr) minmax(13rem, 1.45fr) minmax(10rem, 1fr);
  padding-block: 0.42rem;
}

.mix-tree-formula-overview {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
}

.mix-tree-formula-overview-card {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.55rem;
  border: 1px solid rgba(49, 95, 151, 0.14);
  border-radius: 8px;
  background: var(--surface);
}

.mix-tree-formula-overview-card.is-off-route {
  opacity: 0.68;
}

.mix-tree-formula-overview-head,
.mix-tree-node-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
}

.mix-tree-formula-overview-head strong,
.mix-tree-node-detail-head strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mix-tree-formula-overview-head small,
.mix-tree-node-detail-head small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  white-space: nowrap;
}

.mix-tree-node-detail-panel {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.55rem;
  border: 1px solid rgba(31, 122, 79, 0.22);
  border-radius: 8px;
  background: rgba(31, 122, 79, 0.07);
}

.mix-tree-node-detail-panel[hidden] {
  display: none;
}

.mix-tree-node-detail-body {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) minmax(14rem, 1.5fr) auto;
  gap: 0.55rem;
  align-items: start;
  min-width: 0;
}

.mix-tree-node-detail-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.mix-tree-count-wrap {
  min-width: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  scrollbar-width: thin;
}

.mix-tree-count-table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  table-layout: fixed;
  color: var(--ink);
  font-size: 0.78rem;
}

.mix-tree-count-table caption {
  caption-side: top;
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-weight: 950;
  text-align: left;
}

.mix-tree-count-table th,
.mix-tree-count-table td {
  padding: 0.44rem 0.55rem;
  border-bottom: 1px solid rgba(102, 112, 106, 0.12);
  vertical-align: middle;
}

.mix-tree-count-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(49, 95, 151, 0.08);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 950;
  text-align: left;
}

.mix-tree-count-table th:nth-child(2),
.mix-tree-count-table th:nth-child(3),
.mix-tree-count-table th:nth-child(4),
.mix-tree-count-table td:nth-child(2),
.mix-tree-count-table td:nth-child(3),
.mix-tree-count-table td:nth-child(4) {
  width: 5.8rem;
  text-align: center;
  white-space: nowrap;
}

.mix-tree-count-table tbody tr:last-child td {
  border-bottom: 0;
}

.mix-tree-count-table tbody tr:hover {
  background: rgba(49, 95, 151, 0.05);
}

.mix-tree-count-name {
  min-width: 0;
}

.mix-tree-count-name a {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mix-tree-count-table .is-ok {
  color: var(--green);
  font-weight: 950;
}

.mix-tree-count-table .is-missing {
  color: var(--danger);
  font-weight: 950;
}

.mix-tree-stage {
  position: relative;
  min-width: 0;
}

.smart-mix-panel.is-tree-workbench .mix-tree-stage {
  min-height: clamp(26rem, calc(100vh - 16rem), 56rem);
}

.mix-tree-formula-panel {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
}

.mix-tree-formula-float-panel {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 8;
  display: grid;
  gap: 0.55rem;
  width: min(24rem, calc(100% - 2rem));
  max-height: min(62vh, 34rem);
  overflow: auto;
  padding: 0;
  border: 1px solid rgba(49, 95, 151, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 42px rgba(29, 42, 33, 0.22);
  backdrop-filter: blur(10px);
  scrollbar-width: thin;
}

.mix-tree-formula-float-panel[hidden] {
  display: none;
}

.mix-tree-float-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  min-width: 0;
  min-height: 2.55rem;
  padding: 0.5rem 0.55rem 0.45rem 0.65rem;
  border-bottom: 1px solid var(--line);
}

.mix-tree-float-panel-head strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mix-tree-float-panel-head button {
  flex: 0 0 2rem;
  width: 2rem;
  min-width: 2rem;
  min-height: 2rem;
  padding: 0;
  border-radius: 999px;
  font-size: 1.1rem;
  line-height: 1;
}

.mix-tree-formula-float-panel > div:last-child {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.65rem;
}

.mix-tree-formula-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.45;
}

.mix-tree-formula-list {
  display: grid;
  gap: 0.42rem;
  min-width: 0;
}

.mix-tree-formula-list button {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
  min-height: 4.1rem;
  justify-items: start;
  padding: 0.55rem;
  border-color: rgba(49, 95, 151, 0.18);
  background: var(--surface);
  text-align: left;
}

.mix-tree-formula-list button.active {
  border-color: rgba(31, 122, 79, 0.36);
  background: rgba(31, 122, 79, 0.1);
  color: var(--green);
}

.mix-tree-formula-list button span,
.mix-tree-formula-list button strong,
.mix-tree-formula-list button small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mix-tree-formula-list button span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
}

.mix-tree-formula-list button strong {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 950;
}

.mix-tree-formula-list button small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
}

.mix-tree-formula-reset,
.mix-tree-tool-open-button {
  min-height: 2rem;
  border-color: rgba(31, 122, 79, 0.28);
  background: rgba(31, 122, 79, 0.1);
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
}

.mix-tree-tool-viewer {
  width: 100%;
  min-width: 0;
}

.smart-mix-panel.is-tree-workbench .mix-tree-tool-viewer {
  height: 100%;
}

.mix-tree-layout-tool {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
}

.mix-tree-layout-tool .mix-tree-viewer {
  position: relative;
  width: 100%;
}

.mix-tree-detail-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.55rem;
}

.daily-today-board {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--green) 24%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--green) 10%, transparent), transparent 48%),
    linear-gradient(90deg, color-mix(in srgb, var(--amber) 7%, transparent), transparent 62%),
    color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--shadow);
}

.daily-today-board-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 0.55rem 1rem;
  min-width: 0;
}

.daily-today-board-head > div {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.daily-today-board-head span {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 950;
}

.daily-today-board-head strong {
  color: var(--ink);
  font-size: clamp(1.2rem, 2vw, 1.75rem);
  line-height: 1.12;
}

.daily-today-board-head small {
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  padding: 0.14rem 0.7rem;
  border: 1px solid color-mix(in srgb, var(--green) 20%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--green) 7%, var(--surface));
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
}

.daily-today-board-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(21rem, 100%), 1fr));
  gap: 0.75rem;
  min-width: 0;
}

.daily-today-card,
.daily-today-empty {
  display: grid;
  gap: 0.7rem;
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid color-mix(in srgb, var(--blue) 18%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue) 7%, transparent), transparent 62%),
    var(--surface);
}

.daily-today-card[data-shared="true"] {
  border-color: color-mix(in srgb, var(--green) 28%, var(--line));
}

.daily-today-card.is-done {
  border-color: color-mix(in srgb, var(--green) 42%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--green) 12%, transparent), transparent 62%),
    color-mix(in srgb, var(--green) 5%, var(--surface));
}

.daily-today-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.daily-today-card-title {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.daily-today-card-title span {
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 950;
}

.daily-today-card-title strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 950;
  line-height: 1.28;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-today-check {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  padding: 0.18rem 0.58rem;
  border: 1px solid color-mix(in srgb, var(--green) 24%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--green) 7%, var(--surface));
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 950;
}

.daily-today-check input {
  width: 1rem;
  min-height: 1rem;
  padding: 0;
}

.daily-today-requirements {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.daily-today-card .daily-task-tile {
  min-height: 4rem;
  padding: 0.48rem;
}

.daily-today-card .daily-task-tile-media {
  width: 2.85rem;
  height: 2.85rem;
}

.daily-today-card .daily-task-tile-media img,
.daily-today-card .daily-task-tile-media .monster-visual-stack img {
  width: 2.62rem;
  height: 2.62rem;
}

.daily-today-card .daily-task-tile-media .monster-visual-stack,
.daily-today-card .daily-task-tile-media .monster-visual-stack.has-effect {
  width: 2.85rem;
  height: 2.85rem;
}

.daily-today-rewards {
  padding-top: 0.55rem;
}

.daily-today-card-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 0.8rem;
  min-width: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.daily-source-badge,
.daily-date-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.24rem;
  max-width: min(8.4rem, 100%);
  min-width: 0;
  min-height: 1.45rem;
  padding: 0.14rem 0.52rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--green) 24%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--green) 7%, var(--surface));
  color: var(--green);
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-source-badge::before {
  content: "";
  flex: 0 0 auto;
  width: 0.34rem;
  height: 0.34rem;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.72;
}

.daily-source-badge[data-source="local"] {
  border-color: color-mix(in srgb, var(--blue) 20%, var(--line));
  background: color-mix(in srgb, var(--blue) 5%, var(--surface));
  color: var(--blue);
}

.daily-date-badge {
  margin-inline-start: auto;
  border-color: color-mix(in srgb, var(--muted) 18%, var(--line));
  background: color-mix(in srgb, var(--surface-2) 68%, transparent);
  color: var(--muted);
}

.daily-today-card-footer .daily-source-badge {
  max-width: min(7.4rem, 62%);
}

.daily-today-empty {
  align-content: center;
  min-height: 7rem;
  border-style: dashed;
  color: var(--muted);
  text-align: center;
}

.daily-today-empty strong {
  color: var(--ink);
  font-size: 1rem;
}

.daily-today-empty small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.daily-form {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 0.85fr);
  gap: 0.75rem;
  align-items: stretch;
  padding: 0.75rem;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 42%, transparent);
  animation: dailyFormReveal 180ms ease both;
}

.daily-form[hidden] {
  display: none;
}

@keyframes dailyFormReveal {
  from {
    opacity: 0;
    transform: translateY(-0.35rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.daily-form-card,
.daily-reward-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr));
  gap: 0.58rem 0.65rem;
  min-width: 0;
  padding: 0.75rem;
  border: 1px solid rgba(28, 126, 82, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(28, 126, 82, 0.055), rgba(255, 255, 255, 0.82)),
    var(--surface);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.04);
}

.daily-form-card-head {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.16rem;
  min-width: 0;
}

.daily-form-card-head span {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 950;
}

.daily-form-card-head small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.45;
}

.daily-form label {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.daily-item-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4.6rem;
  gap: 0.4rem;
  min-width: 0;
}

.daily-item-control input {
  min-width: 0;
}

.daily-reward-form {
  border: 1px solid rgba(198, 146, 45, 0.22);
  background:
    linear-gradient(135deg, rgba(198, 146, 45, 0.12), rgba(255, 255, 255, 0.78)),
    var(--surface);
}

.daily-reward-heading small {
  color: rgba(138, 91, 12, 0.82);
}

.daily-reward-form label {
  min-width: 0;
}

.daily-panel-heading {
  align-items: center;
}

.daily-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.42rem;
  min-width: 0;
}

#addDailyTask {
  flex: 0 0 auto;
  min-height: 2.25rem;
  min-width: 7.8rem;
  border-color: color-mix(in srgb, var(--green) 34%, var(--line));
  background: color-mix(in srgb, var(--green) 11%, var(--surface));
  color: var(--green);
  font-weight: 950;
}

.daily-action-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: min(18rem, 44vw);
  min-height: 1.75rem;
  min-width: 0;
  padding: 0.12rem 0.58rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--green) 18%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--green) 6%, var(--surface));
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-action-status[data-tone="error"] {
  border-color: rgba(185, 63, 63, 0.28);
  background: rgba(185, 63, 63, 0.075);
  color: var(--red);
}

.daily-action-status[data-tone="warn"] {
  border-color: color-mix(in srgb, var(--amber) 34%, var(--line));
  background: color-mix(in srgb, var(--amber) 9%, var(--surface));
  color: color-mix(in srgb, var(--amber) 72%, var(--ink));
}

.daily-action-status[data-tone="success"] {
  border-color: color-mix(in srgb, var(--green) 32%, var(--line));
  background: color-mix(in srgb, var(--green) 9%, var(--surface));
  color: var(--green);
}

.daily-contribution-panel {
  margin-top: 0.7rem;
}

.daily-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 0.45rem;
}

.daily-summary span {
  min-width: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.daily-summary b,
.daily-summary small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-summary b {
  color: var(--ink);
  font-size: 0.95rem;
}

.daily-summary small {
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
}

.daily-selected-preview {
  display: grid;
  gap: 0.55rem;
  padding: 0.7rem;
  border: 1px solid rgba(31, 122, 79, 0.22);
  border-radius: 8px;
  background: rgba(31, 122, 79, 0.06);
}

.daily-selected-preview > strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-list {
  display: grid;
  gap: 0.55rem;
}

.daily-task-row {
  display: grid;
  grid-template-columns: 6.8rem minmax(0, 1fr) 4.5rem;
  gap: 0.55rem;
  align-items: center;
  min-width: 0;
  padding: 0.7rem;
  border: 1px solid rgba(49, 95, 151, 0.18);
  border-radius: 8px;
  background: var(--surface);
}

.daily-task-row[data-shared="true"] {
  border-color: rgba(28, 126, 82, 0.2);
  background:
    linear-gradient(135deg, rgba(28, 126, 82, 0.05), transparent 56%),
    var(--surface);
}

.daily-task-row.is-done {
  border-color: rgba(31, 122, 79, 0.32);
  background: rgba(31, 122, 79, 0.07);
}

.daily-task-row input[type="checkbox"] {
  width: 1.25rem;
  min-height: 1.25rem;
  padding: 0;
}

.daily-task-meta {
  display: grid;
  gap: 0.28rem;
  align-content: center;
  min-width: 0;
}

.daily-task-date {
  display: inline-grid;
  place-items: center;
  min-height: 2.4rem;
  padding: 0.35rem;
  border: 1px solid rgba(31, 122, 79, 0.2);
  border-radius: 8px;
  background: rgba(31, 122, 79, 0.07);
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 950;
  white-space: nowrap;
}

.daily-task-body {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.daily-task-title {
  display: block;
  min-width: 0;
}

.daily-task-title strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-task-requirements {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}

.daily-task-compact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  min-width: 0;
}

.daily-task-rewards {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  padding-top: 0.35rem;
  border-top: 1px dashed rgba(102, 112, 106, 0.22);
}

.daily-task-rewards-title {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 950;
}

.daily-task-reward-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  min-width: 0;
}

.daily-task-contributor {
  justify-self: center;
  width: auto;
  max-width: min(6.4rem, 100%);
}

.daily-task-tile {
  display: grid;
  grid-template-columns: 2.35rem minmax(0, 1fr);
  grid-template-areas:
    "media name"
    "media amount";
  align-items: center;
  gap: 0.05rem 0.38rem;
  min-width: 0;
  min-height: 3rem;
  padding: 0.36rem;
  border: 1px solid rgba(49, 95, 151, 0.18);
  border-radius: 8px;
  background: rgba(49, 95, 151, 0.06);
  color: var(--blue);
  text-align: left;
}

button.daily-task-tile {
  cursor: pointer;
}

button.daily-task-tile:hover,
button.daily-task-tile:focus-visible {
  border-color: rgba(49, 95, 151, 0.46);
  background: rgba(49, 95, 151, 0.11);
}

.daily-task-tile-monster {
  border-color: rgba(31, 122, 79, 0.22);
  background: rgba(31, 122, 79, 0.07);
  color: var(--green);
}

.daily-task-reward-tile {
  border-color: rgba(198, 146, 45, 0.28);
  background: rgba(198, 146, 45, 0.08);
  color: var(--amber);
}

.daily-task-tile.muted {
  border-color: rgba(102, 112, 106, 0.16);
  background: rgba(102, 112, 106, 0.05);
  color: var(--muted);
}

.daily-task-tile-media {
  grid-area: media;
  display: inline-grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
  color: currentColor;
  font-size: 0.72rem;
  font-weight: 900;
}

.daily-task-tile-media img {
  max-width: 2.15rem;
  max-height: 2.15rem;
  object-fit: contain;
}

.daily-task-tile-media .monster-visual-stack {
  width: 2.35rem;
  height: 2.35rem;
}

.daily-task-tile-media .monster-visual-stack.has-effect {
  width: 2.35rem;
}

.daily-task-tile-media .monster-visual-stack img {
  width: 2.15rem;
  height: 2.15rem;
}

.daily-task-tile strong,
.daily-task-tile small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-task-tile strong {
  grid-area: name;
  font-size: 0.76rem;
}

.daily-task-tile small {
  grid-area: amount;
  color: currentColor;
  font-size: 0.76rem;
  font-weight: 950;
}

.daily-task-monster,
.daily-task-item {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  min-height: 1.95rem;
  max-width: 100%;
  padding: 0.08rem 0.5rem;
  border: 1px solid rgba(31, 122, 79, 0.18);
  border-radius: 999px;
  background: rgba(31, 122, 79, 0.08);
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
}

.daily-task-item {
  border-color: rgba(49, 95, 151, 0.2);
  background: rgba(49, 95, 151, 0.08);
  color: var(--blue);
}

.daily-task-monster.muted,
.daily-task-item.muted {
  border-color: rgba(102, 112, 106, 0.18);
  background: rgba(102, 112, 106, 0.08);
  color: var(--muted);
}

.daily-task-slot-label {
  flex: 0 0 auto;
  color: inherit;
  font-size: 0.65rem;
  font-weight: 900;
  opacity: 0.72;
}

.daily-task-slot-amount {
  flex: 0 0 auto;
  color: inherit;
  font-size: 0.68rem;
  font-weight: 900;
}

.daily-task-slot-amount.muted {
  color: var(--muted);
  opacity: 0.72;
}

.daily-task-slot-value {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-task-slot-value .relation-link {
  min-height: 1.6rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.daily-task-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.daily-task-detail-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.35rem;
  min-width: 0;
}

.daily-task-detail-summary span {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
  padding: 0.42rem 0.5rem;
  border: 1px solid rgba(102, 112, 106, 0.16);
  border-radius: 8px;
  background: rgba(102, 112, 106, 0.06);
}

.daily-task-detail-summary small,
.daily-task-detail-summary b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-task-detail-summary small {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
}

.daily-task-detail-summary b {
  color: var(--ink);
  font-size: 0.78rem;
}

.daily-task-actions {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
}

.daily-task-row .daily-task-remove,
.daily-task-row .daily-task-today {
  min-height: 1.85rem;
  padding: 0 0.5rem;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
}

.daily-task-row .daily-task-today {
  border-color: rgba(31, 122, 79, 0.24);
  color: var(--green);
}

.daily-task-row .daily-task-today:disabled {
  border-color: rgba(102, 112, 106, 0.16);
  color: var(--muted);
  cursor: default;
  opacity: 0.72;
}

.daily-task-row .daily-task-remove:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.reset-filters {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.record-title span,
.detail-item span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.database-panel {
  padding: 0.85rem;
}

.map-guide-panel {
  display: grid;
  grid-template-columns: minmax(11rem, 0.28fr) minmax(0, 1fr);
  align-items: center;
  gap: 0.34rem 0.74rem;
  margin: 0 0 0.68rem;
  padding: 0.58rem 0.68rem;
  border: 1px solid color-mix(in srgb, var(--green) 18%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--green) 8%, transparent), transparent 52%),
    linear-gradient(90deg, color-mix(in srgb, var(--blue) 5%, transparent), transparent 64%),
    color-mix(in srgb, var(--surface) 96%, var(--bg));
}

.map-guide-heading {
  display: grid;
  grid-column: 1;
  grid-row: 1 / span 2;
  gap: 0.08rem;
  max-width: none;
}

.map-guide-heading span {
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 950;
}

.map-guide-heading strong {
  color: var(--ink);
  font-size: clamp(1rem, 1.35vw, 1.22rem);
  line-height: 1.25;
}

.map-guide-heading p {
  display: none;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.38;
}

.map-guide-stats,
.map-region-buttons,
.map-feature-buttons {
  gap: 0.45rem;
  min-width: 0;
}

.map-guide-stats {
  display: none;
  grid-column: 1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex-wrap: wrap;
  justify-content: stretch;
  align-content: start;
}

.map-region-buttons {
  display: flex;
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.04rem 0.05rem 0.12rem;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}

.map-feature-buttons {
  display: flex;
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.02rem 0.05rem 0.04rem;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.map-guide-stats span {
  display: grid;
  gap: 0.04rem;
  min-width: 0;
  min-height: 2.1rem;
  padding: 0.28rem 0.44rem;
  border: 1px solid color-mix(in srgb, var(--green) 14%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  text-align: left;
  white-space: nowrap;
}

.map-guide-stats b {
  color: var(--green);
  min-width: 0;
  font-size: 0.92rem;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-guide-stats small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.map-region-button {
  display: inline-grid;
  grid-template-columns: minmax(0, max-content) auto;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.55rem;
  min-width: max-content;
  min-height: 2.1rem;
  justify-items: start;
  padding: 0.24rem 0.4rem 0.24rem 0.56rem;
  border-radius: 999px;
  border-color: color-mix(in srgb, var(--green) 14%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--green) 4%, transparent), transparent 62%),
    color-mix(in srgb, var(--surface) 90%, transparent);
  color: var(--muted);
  font-weight: 920;
  text-align: left;
  scroll-snap-align: start;
}

.map-region-button-copy {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
}

.map-region-button-copy strong,
.map-region-button-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-region-button-copy strong {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 950;
}

.map-region-button-copy small {
  display: none;
}

.map-region-button b {
  display: inline-grid;
  min-width: 2rem;
  min-height: 1.5rem;
  place-items: center;
  padding: 0 0.38rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--green) 10%, var(--surface-2));
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 950;
}

.map-region-button.active,
.map-region-button[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--green) 52%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--green) 13%, transparent), transparent 62%),
    color-mix(in srgb, var(--green) 6%, var(--surface));
  color: var(--green);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 18%, transparent);
}

.map-region-button.active .map-region-button-copy strong,
.map-region-button[aria-pressed="true"] .map-region-button-copy strong {
  color: var(--green);
}

.map-feature-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  min-height: 1.68rem;
  padding: 0.12rem 0.46rem;
  border-radius: 999px;
  border-color: color-mix(in srgb, var(--blue) 13%, var(--line));
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
  scroll-snap-align: start;
}

.map-feature-button b {
  display: inline-grid;
  min-width: 1.45rem;
  min-height: 1.25rem;
  place-items: center;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 8%, var(--surface-2));
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 950;
}

.map-feature-button.active,
.map-feature-button[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--blue) 46%, var(--line));
  background: color-mix(in srgb, var(--blue) 8%, var(--surface));
  color: var(--blue);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue) 13%, transparent);
}

.panel-toolbar {
  display: grid;
  grid-template-columns: minmax(14rem, 1.45fr) minmax(12rem, 0.95fr) minmax(8rem, 0.65fr) minmax(10rem, 0.85fr) minmax(9rem, 0.72fr);
  align-items: end;
  gap: 0.45rem;
  width: 100%;
  max-width: 100%;
  margin-bottom: 0.48rem;
  box-sizing: border-box;
}

.panel-toolbar > div:first-child {
  align-self: center;
  min-width: 0;
}

.panel-toolbar h2 {
  margin-bottom: 0.2rem;
  font-size: 1.25rem;
}

.panel-toolbar p {
  margin-bottom: 0;
  color: var(--muted);
}

.sort-control,
.filter-control,
.page-size-control {
  width: 100%;
}

.page-size-control,
.filter-control {
  display: grid;
  gap: 0.3rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.filter-control {
  flex: 0 1 12rem;
}

.search-control {
  order: 1;
  grid-column: 1;
  width: 100%;
  min-width: 0;
}

.toolbar-level-filter {
  order: 2;
  grid-column: 2;
  min-width: 0;
}

.sort-control {
  order: 3;
  grid-column: 3;
}

.toolbar-action-group {
  order: 4;
  grid-column: 4 / 6;
}

.utility-filter-control {
  display: none !important;
}

.type-filter-control {
  order: 5;
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.type-filter-control select {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.drop-status-filter-control {
  order: 7;
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.drop-status-filter-control select {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.type-filter-buttons,
.drop-status-buttons {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.28rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  max-height: 2.05rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.08rem 1.4rem 0.12rem 0.08rem;
  box-sizing: border-box;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 1.35rem), transparent 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 1.35rem), transparent 100%);
}

.type-filter-buttons::-webkit-scrollbar,
.drop-status-buttons::-webkit-scrollbar {
  display: none;
}

.type-filter-button,
.drop-status-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  gap: 0.28rem;
  min-height: 1.92rem;
  padding: 0 0.48rem;
  border-color: rgba(49, 95, 151, 0.28);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
  scroll-snap-align: start;
}

.type-filter-button b,
.drop-status-button b {
  color: currentColor;
  font-size: 0.76rem;
  font-weight: 950;
}

.type-filter-button > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.type-filter-button .type-icon {
  width: 1.28rem;
  height: 1.28rem;
}

.type-filter-button.active {
  border-color: color-mix(in srgb, var(--green) 52%, var(--line));
  background: color-mix(in srgb, var(--green) 18%, var(--surface));
  color: var(--green);
}

.drop-status-button[data-tone="can-drop"] {
  border-color: rgba(31, 122, 79, 0.3);
  background: rgba(31, 122, 79, 0.08);
  color: var(--green);
}

.drop-status-button[data-tone="no-drop"] {
  border-color: rgba(185, 63, 63, 0.32);
  background: rgba(185, 63, 63, 0.08);
  color: var(--red);
}

.drop-status-button[data-tone="has-data"] {
  border-color: rgba(49, 95, 151, 0.3);
  background: rgba(49, 95, 151, 0.08);
  color: var(--blue);
}

.drop-status-button[data-tone="missing-data"] {
  border-color: rgba(177, 118, 31, 0.32);
  background: rgba(177, 118, 31, 0.1);
  color: var(--amber);
}

.drop-status-button.active {
  border-color: currentColor;
  box-shadow: inset 0 -2px 0 currentColor;
}

.page-size-control {
  width: min(7.5rem, 100%);
}

.toolbar-action-group {
  display: grid;
  grid-column: span 2;
  grid-template-columns: minmax(6.6rem, 1fr) auto;
  align-items: end;
  gap: 0.42rem;
  min-width: min(14rem, 100%);
}

.panel-toolbar input,
.panel-toolbar select {
  min-height: 2.28rem;
  padding-inline: 0.62rem;
}

.panel-toolbar button {
  min-height: 2.28rem;
}

.panel-toolbar .search-control,
.panel-toolbar .sort-control,
.panel-toolbar .level-filter label {
  gap: 0.28rem;
  font-size: 0.78rem;
}

.panel-toolbar .level-filter {
  gap: 0.38rem;
}

.toolbar-action-group .page-size-control {
  width: 100%;
  min-width: 0;
}

.mobile-filter-toggle {
  display: none;
}

.mobile-filter-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.24rem;
  height: 1.24rem;
  margin-left: 0.46rem;
  padding: 0 0.34rem;
  border-radius: 999px;
  background: currentColor;
  color: var(--surface);
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--surface) 88%, transparent);
}

.result-command-bar {
  display: grid;
  grid-template-columns: minmax(13rem, 0.9fr) minmax(0, 1.6fr);
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 0.75rem;
  padding: 0.58rem 0.68rem;
  border: 1px solid color-mix(in srgb, var(--blue) 18%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 72%, var(--surface));
}

.result-command-summary {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.result-command-summary strong {
  min-width: 0;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-command-summary small {
  min-width: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-filter-chips {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}

.active-filter-chip,
.active-filter-empty {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 1.9rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
}

.active-filter-chip {
  gap: 0.34rem;
  border-color: color-mix(in srgb, var(--blue) 24%, var(--line));
  background: color-mix(in srgb, var(--blue) 9%, var(--surface));
  color: var(--blue);
}

.active-filter-chip:hover,
.active-filter-chip:focus-visible {
  border-color: color-mix(in srgb, var(--red) 36%, var(--line));
  background: color-mix(in srgb, var(--red) 9%, var(--surface));
  color: var(--red);
}

.active-filter-clear-all {
  border-color: color-mix(in srgb, var(--red) 30%, var(--line));
  background: color-mix(in srgb, var(--red) 7%, var(--surface));
  color: var(--red);
}

.active-filter-chip span {
  display: inline-grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: color-mix(in srgb, currentColor 12%, transparent);
  font-size: 0.8rem;
  line-height: 1;
}

.active-filter-empty {
  border: 1px dashed color-mix(in srgb, var(--muted) 24%, var(--line));
  color: var(--muted);
}

.level-filter-control {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  width: 100%;
  min-width: 0;
}

.toolbar-level-filter {
  display: grid;
}

.reset-filters {
  align-self: end;
  white-space: nowrap;
  color: var(--muted);
}

.record-list {
  display: grid;
  gap: 0.55rem;
}

.record-list.monster-view-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(18rem, 100%), 1fr));
  align-items: stretch;
}

.record-list.monster-view-grid .monster-record-row {
  grid-template-columns: 1fr;
}

.record-list.monster-view-grid .monster-record-icon {
  width: 100%;
  height: 7rem;
}

.record-list.monster-view-grid .monster-record-icon img {
  max-width: 6.4rem;
  max-height: 6.4rem;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(238, 241, 237, 0.58);
}

.pagination-bar p {
  margin: 0;
  color: var(--muted);
  font-weight: 900;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.page-jump-control {
  display: inline-grid;
  grid-template-columns: auto 4.4rem;
  gap: 0.35rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.page-jump-control input {
  min-height: 2.35rem;
  padding-inline: 0.5rem;
}

.page-number-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  max-width: min(34rem, 52vw);
  overflow: visible;
  scrollbar-width: none;
}

.pagination-bar button {
  flex: 0 0 auto;
  font-weight: 900;
}

.page-number {
  min-width: 2.35rem;
  padding: 0 0.45rem;
}

.page-number.active {
  border-color: var(--green);
  background: rgba(31, 122, 79, 0.12);
  color: var(--green);
}

.page-gap {
  display: grid;
  min-width: 1.5rem;
  place-items: center;
  color: var(--muted);
  font-weight: 900;
}

.record-row {
  position: relative;
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr);
  gap: 0.9rem;
  align-items: center;
  padding: 0.8rem;
  padding-right: 3.7rem;
  min-width: 0;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

.record-row:hover {
  border-color: rgba(49, 95, 151, 0.38);
  background: linear-gradient(180deg, rgba(49, 95, 151, 0.045), var(--surface));
  box-shadow: 0 14px 34px rgba(21, 25, 22, 0.12);
  transform: translateY(-1px);
}

.record-row:focus-visible {
  outline: 3px solid rgba(49, 95, 151, 0.24);
  outline-offset: 3px;
  border-color: rgba(49, 95, 151, 0.5);
}

.monster-record-row {
  grid-template-columns: 5rem minmax(0, 1fr);
  align-items: stretch;
  padding: 0.7rem;
  padding-right: 0.7rem;
}

.monster-record-icon {
  width: 5rem;
  height: 5rem;
  align-self: start;
  background: radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.72), transparent 3.2rem), var(--surface-2);
  border: 1px solid var(--line);
}

.monster-record-icon img {
  max-width: 4.4rem;
  max-height: 4.4rem;
}

.monster-record-main {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.monster-record-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.monster-record-id {
  flex: 0 0 auto;
  min-height: 1.75rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid rgba(49, 95, 151, 0.18);
  border-radius: 999px;
  background: rgba(49, 95, 151, 0.08);
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 900;
}

.monster-record-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
}

.monster-record-facts span {
  min-width: 0;
  padding: 0.35rem 0.45rem;
  border: 1px solid rgba(216, 222, 216, 0.88);
  border-radius: 8px;
  background: var(--surface-2);
}

.monster-record-facts b,
.monster-record-facts small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monster-record-facts b {
  font-size: 0.86rem;
}

.monster-record-facts small {
  margin-top: 0.08rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.monster-record-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.38rem;
}

.monster-record-tags span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  min-height: 1.8rem;
  padding: 0.16rem 0.52rem;
  border: 1px solid rgba(31, 122, 79, 0.18);
  border-radius: 999px;
  background: rgba(31, 122, 79, 0.1);
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

.monster-record-tags .monster-sprite-number-tag {
  border-color: color-mix(in srgb, var(--blue) 28%, var(--line));
  background: color-mix(in srgb, var(--blue) 9%, var(--surface));
  color: var(--blue);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.retired-monster-row {
  border-color: rgba(177, 118, 31, 0.55);
  background: linear-gradient(135deg, rgba(177, 118, 31, 0.13), rgba(255, 255, 255, 0.96));
}

.retired-monster-row .monster-record-icon {
  border-color: rgba(177, 118, 31, 0.45);
  background: radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.78), transparent 3.2rem), rgba(177, 118, 31, 0.12);
}

.monster-record-tags .special-tag {
  border-color: rgba(177, 118, 31, 0.28);
  background: rgba(177, 118, 31, 0.12);
  color: var(--amber);
}

.monster-record-tags .player-report-tag,
.monster-badges .player-report-badge {
  border-color: color-mix(in srgb, var(--blue) 34%, var(--line));
  background: linear-gradient(135deg, color-mix(in srgb, var(--blue) 14%, var(--surface)), color-mix(in srgb, var(--green) 8%, var(--surface)));
  color: var(--blue);
}

.monster-record-tags .drop-status-tag {
  border-width: 1.5px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.monster-record-tags .drop-status-tag.can-drop {
  border-color: rgba(25, 133, 72, 0.48);
  background: rgba(31, 122, 79, 0.16);
  color: #166a3f;
}

.monster-record-tags .drop-status-tag.player-override {
  border-color: color-mix(in srgb, var(--blue) 28%, rgba(25, 133, 72, 0.48));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--green) 14%, transparent), color-mix(in srgb, var(--blue) 8%, transparent)),
    rgba(31, 122, 79, 0.12);
}

.monster-record-tags .drop-status-tag.no-drop {
  border-color: rgba(185, 63, 63, 0.52);
  background: rgba(185, 63, 63, 0.14);
  color: #a72c2c;
}

.monster-record-tags .muted-tag {
  border-color: rgba(102, 112, 106, 0.22);
  background: rgba(102, 112, 106, 0.08);
  color: var(--muted);
}

.craft-table {
  display: grid;
  gap: 0.35rem;
}

.craft-row {
  display: grid;
  grid-template-columns: minmax(11rem, 1.5fr) minmax(4rem, 0.45fr) minmax(5.5rem, 0.65fr) minmax(5.5rem, 0.65fr);
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.craft-row-head {
  background: color-mix(in srgb, var(--blue) 8%, var(--surface));
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
}

.craft-name-cell {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.craft-name-cell img,
.book-evidence-card img {
  width: 2.4rem;
  height: 2.4rem;
  object-fit: contain;
  flex: 0 0 auto;
}

.craft-name-cell strong,
.craft-related-row strong,
.book-evidence-card strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.craft-status-ok,
.craft-status-review {
  display: inline-flex;
  width: fit-content;
  min-height: 1.65rem;
  align-items: center;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
}

.craft-status-ok {
  border: 1px solid rgba(31, 122, 79, 0.26);
  background: rgba(31, 122, 79, 0.1);
  color: var(--green);
}

.craft-status-review {
  border: 1px solid rgba(177, 118, 31, 0.28);
  background: rgba(177, 118, 31, 0.11);
  color: var(--amber);
}

.book-evidence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.6rem;
}

.book-evidence-card,
.craft-related-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  text-align: left;
}

.book-evidence-card {
  cursor: pointer;
}

.book-evidence-card:hover,
.craft-related-row:hover {
  border-color: rgba(49, 95, 151, 0.34);
  background: color-mix(in srgb, var(--blue) 7%, var(--surface));
}

.book-evidence-card div,
.craft-related-row {
  min-width: 0;
}

.book-evidence-card small,
.craft-related-row small {
  display: block;
  margin-top: 0.18rem;
  color: var(--muted);
  font-weight: 800;
}

.craft-related-list {
  display: grid;
  gap: 0.45rem;
}

.review-empty-note {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 720px) {
  .craft-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .craft-row-head {
    display: none;
  }
}

.retired-monster-notice {
  border-color: rgba(177, 118, 31, 0.5);
  background: rgba(177, 118, 31, 0.1);
}

.retired-monster-notice strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--amber);
}

.excluded-drop-notice {
  display: grid;
  gap: 0.35rem;
  padding: 0.65rem;
  border: 1px solid rgba(177, 118, 31, 0.38);
  border-radius: 8px;
  background: rgba(177, 118, 31, 0.08);
}

.excluded-drop-notice strong {
  color: var(--amber);
}

.excluded-drop-notice p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.retired-monster-notice p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.record-actions {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 2;
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.favorite-button {
  width: 1.95rem;
  height: 1.95rem;
  min-height: 1.95rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.46);
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 900;
  box-shadow: none;
  backdrop-filter: blur(6px);
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.favorite-button:hover,
.favorite-button:focus-visible {
  background: rgba(255, 255, 255, 0.78);
  color: var(--amber);
  transform: scale(1.04);
}

.favorite-button.active {
  background: rgba(177, 118, 31, 0.18);
  color: var(--amber);
}

.record-icon {
  display: grid;
  width: 4.25rem;
  height: 4.25rem;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--green), var(--blue));
  color: white;
  font-weight: 900;
}

.record-icon img {
  max-width: 3.75rem;
  max-height: 3.75rem;
  object-fit: contain;
}

.record-icon span {
  display: block;
}

.record-icon .monster-visual-stack {
  --visual-size: 3.75rem;
  --visual-box-width: 100%;
  --visual-box-height: 100%;
  --effect-width: 4.25rem;
  --effect-height: 1.85rem;
  --effect-bottom: 0.32rem;
  display: inline-grid;
  width: var(--visual-box-width);
  height: var(--visual-box-height);
}

.record-icon .monster-visual-stack.has-effect {
  width: 100%;
}

.record-title {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: nowrap;
  min-width: 0;
}

.record-title h3 {
  min-width: 0;
  max-width: 100%;
  margin-bottom: 0.25rem;
  font-size: 1.05rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-record-row .record-title {
  align-items: center;
  flex-wrap: wrap;
  gap: 0.32rem 0.52rem;
}

.map-record-row .record-title h3 {
  margin-bottom: 0;
}

.map-name-review-chip {
  flex: 0 0 auto;
  min-height: 1.45rem;
  padding: 0.16rem 0.42rem;
  border: 1px solid color-mix(in srgb, var(--amber) 28%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--amber) 8%, var(--surface));
  color: var(--amber);
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1.1;
}

.map-region-tag {
  border-color: color-mix(in srgb, var(--green) 26%, var(--line));
  background: color-mix(in srgb, var(--green) 8%, var(--surface));
  color: var(--green);
}

.map-region-section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.65rem;
  min-width: 0;
  padding: 0.35rem 0.1rem 0.12rem;
  color: var(--muted);
}

.map-region-section-title div {
  display: grid;
  gap: 0.06rem;
  min-width: 0;
}

.map-region-section-title span {
  color: var(--green);
  font-size: 0.68rem;
  font-weight: 950;
}

.map-region-section-title strong {
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.2;
}

.map-region-section-title small {
  min-width: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  overflow-wrap: anywhere;
  text-align: right;
}

.record-main p {
  margin-bottom: 0.45rem;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.record-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(4.5rem, 1fr));
  gap: 0.3rem;
  margin: 0 0 0.45rem;
}

.record-stats span {
  min-width: 0;
  padding: 0.34rem 0.45rem;
  border: 1px solid rgba(216, 222, 216, 0.86);
  border-radius: 8px;
  background: var(--surface-2);
}

.record-stats b,
.record-stats small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-stats b {
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.2;
}

.record-stats small {
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.map-type-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.42rem;
  min-width: 0;
  margin: 0 0 0.45rem;
}

.map-type-summary-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
}

.map-type-summary-main {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  max-width: 100%;
  min-height: 2rem;
  padding: 0.22rem 0.58rem;
  border: 1px solid color-mix(in srgb, var(--green) 28%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--green) 9%, var(--surface));
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 950;
}

.map-type-summary-main .type-icon {
  width: 1.45rem;
  height: 1.45rem;
  flex: 0 0 auto;
}

.map-type-summary-main small {
  min-width: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.record-completeness {
  display: grid;
  grid-template-columns: minmax(7rem, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
  margin: 0 0 0.45rem;
}

.monster-record-main .record-completeness {
  margin: 0;
}

.record-completeness > span {
  display: block;
  min-width: 0;
  height: 0.48rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.record-completeness i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--red);
}

.record-completeness.mid i {
  background: var(--amber);
}

.record-completeness.full i {
  background: var(--green);
}

.record-completeness small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  white-space: nowrap;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag-row span {
  max-width: 100%;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.shop-boost-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  min-width: 0;
  margin: 0 0 0.45rem;
}

.shop-boost-badges-detail {
  margin: 0;
}

.shop-boost-badge {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 0.28rem;
  align-items: center;
  min-height: 1.7rem;
  max-width: 100%;
  padding: 0.18rem 0.5rem;
  border: 1px solid rgba(31, 122, 79, 0.22);
  border-radius: 999px;
  background: rgba(31, 122, 79, 0.08);
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.shop-boost-badge b,
.shop-boost-badge small {
  min-width: 0;
  line-height: 1.1;
}

.shop-boost-badge small {
  color: inherit;
  opacity: 0.82;
}

.shop-boost-badge[data-tone="top"] {
  border-color: rgba(181, 116, 32, 0.28);
  background: rgba(181, 116, 32, 0.1);
  color: var(--amber);
}

.shop-boost-badge[data-tone="drop"],
.shop-boost-badge[data-tone="speed"] {
  border-color: rgba(49, 95, 151, 0.24);
  background: rgba(49, 95, 151, 0.08);
  color: var(--blue);
}

.shop-boost-badge[data-tone="core"],
.shop-boost-badge[data-tone="mix"] {
  border-color: rgba(122, 71, 54, 0.22);
  background: rgba(122, 71, 54, 0.08);
  color: var(--red);
}

.shop-boost-detail {
  gap: 0.7rem;
}

.shop-boost-rank-card {
  display: grid;
  gap: 0.25rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(181, 116, 32, 0.24);
  border-radius: 8px;
  background: rgba(181, 116, 32, 0.08);
}

.shop-boost-rank-card strong {
  color: var(--ink);
  line-height: 1.35;
}

.shop-boost-rank-card span,
.shop-boost-note {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
  line-height: 1.45;
}

.shop-boost-panel {
  display: grid;
  gap: 0.65rem;
  margin: 0 0 0.75rem;
  padding: 0.72rem;
  border: 1px solid color-mix(in srgb, var(--amber) 22%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--amber) 7%, var(--surface));
}

.shop-boost-panel-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  min-width: 0;
}

.shop-boost-panel-heading span {
  color: var(--amber);
  font-size: 0.82rem;
  font-weight: 950;
}

.shop-boost-panel-heading strong {
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.4;
}

.shop-boost-leader-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
  gap: 0.55rem;
  min-width: 0;
}

.shop-boost-leader-card {
  display: grid;
  grid-template-columns: minmax(4.5rem, auto) minmax(0, 1fr);
  gap: 0.45rem 0.65rem;
  align-items: center;
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid color-mix(in srgb, var(--blue) 18%, var(--line));
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  box-shadow: var(--soft-shadow);
}

.shop-boost-leader-card:hover,
.shop-boost-leader-card:focus-visible {
  border-color: color-mix(in srgb, var(--amber) 46%, var(--line));
  transform: translateY(-1px);
}

.shop-boost-leader-head,
.shop-boost-leader-body {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.shop-boost-leader-head strong {
  color: var(--amber);
  font-size: 1.28rem;
  line-height: 1.05;
}

.shop-boost-leader-head small,
.shop-boost-leader-body small {
  min-width: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-boost-leader-body b {
  min-width: 0;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-boost-leader-badges {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  min-width: 0;
}

.shop-boost-leader-badges .shop-boost-badge {
  min-height: 1.45rem;
  margin: 0;
  padding: 0.12rem 0.42rem;
  font-size: 0.69rem;
}

.empty-state {
  padding: 3rem 1rem;
  color: var(--muted);
  text-align: center;
}

.scroll-top {
  position: fixed;
  right: clamp(0.85rem, 2vw, 1.35rem);
  bottom: clamp(0.85rem, 2vw, 1.35rem);
  z-index: 20;
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border-color: rgba(21, 25, 22, 0.16);
  border-radius: 999px;
  background: var(--ink);
  color: white;
  font-size: 1.1rem;
  font-weight: 900;
  box-shadow: 0 12px 34px rgba(21, 25, 22, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.5rem);
  transition: opacity 160ms ease, transform 160ms ease;
}

.scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

dialog {
  width: min(82rem, calc(100vw - 1rem));
  max-width: calc(100vw - 1rem);
  height: min(54rem, calc(100dvh - 1rem));
  max-height: calc(100dvh - 1rem);
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
  overflow: hidden;
}

dialog::backdrop {
  background: rgba(21, 25, 22, 0.42);
}

dialog.is-mix-tree-fullscreen-dialog {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  border-radius: 0;
}

dialog.is-mix-tree-fullscreen-dialog .dialog-shell {
  padding: 0;
}

dialog.is-mix-tree-fullscreen-dialog .dialog-header,
dialog.is-mix-tree-fullscreen-dialog .dialog-actions {
  display: none;
}

dialog.is-mix-tree-fullscreen-dialog .detail-grid {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

dialog.is-mix-tree-fullscreen-dialog .detail-grid > * {
  display: none;
}

dialog.is-mix-tree-fullscreen-dialog .detail-grid > .is-mix-tree-fullscreen-section {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
}

dialog.is-mix-tree-fullscreen-dialog .is-mix-tree-fullscreen-section .mix-tree-layout-visual.is-mix-tree-fullscreen {
  position: absolute;
}

.dialog-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  max-height: none;
  padding: 1rem;
  overflow: hidden;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.dialog-header > div {
  min-width: 0;
}

.detail-back-button {
  width: fit-content;
  min-height: 1.9rem;
  margin: 0 0 0.3rem;
  padding: 0.28rem 0.55rem;
  border-color: color-mix(in srgb, var(--green) 34%, var(--line));
  color: var(--green);
  background: color-mix(in srgb, var(--green-soft) 58%, var(--surface));
  font-size: 0.78rem;
  font-weight: 900;
}

.dialog-header h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  width: 2.35rem;
  padding: 0;
  font-size: 1.2rem;
  font-weight: 900;
}

.dialog-copy {
  color: var(--muted);
  line-height: 1.6;
}

#adminDialog {
  width: min(72rem, calc(100vw - 1rem));
  height: min(44rem, calc(100dvh - 1rem));
}

.admin-shell {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.admin-panel {
  display: grid;
  align-content: start;
  gap: 0.85rem;
  min-height: 0;
  margin-top: 1rem;
  padding: 0.05rem 0.35rem 0.45rem 0.05rem;
  overflow: auto;
}

.admin-toolbar {
  display: flex;
  align-items: end;
  gap: 0.75rem;
  min-width: 0;
}

.admin-toolbar label {
  display: grid;
  flex: 1 1 auto;
  gap: 0.35rem;
  min-width: 12rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.admin-toolbar input {
  min-height: 2.5rem;
  border-radius: 8px;
}

.admin-toolbar button {
  flex: 0 0 auto;
  min-height: 2.5rem;
  border-color: color-mix(in srgb, var(--green) 28%, var(--line));
  background: color-mix(in srgb, var(--green) 8%, var(--surface));
  color: var(--green);
  font-weight: 950;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0.55rem;
}

.admin-member-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 0.9rem;
  background: color-mix(in srgb, var(--surface-2) 76%, transparent);
}

.admin-member-filters button {
  min-height: 2rem;
  padding: 0.38rem 0.72rem;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.admin-member-filters button[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--green) 46%, var(--line));
  background: color-mix(in srgb, var(--green) 14%, var(--surface));
  color: var(--green-dark);
  box-shadow: 0 0.4rem 1rem color-mix(in srgb, var(--green) 10%, transparent);
}

.admin-member-filters button:hover,
.admin-member-filters button:focus-visible {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--green) 35%, var(--line));
  color: var(--green-dark);
}

.admin-summary-item {
  appearance: none;
  display: grid;
  gap: 0.15rem;
  min-width: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 48%, var(--surface));
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.admin-summary-item[data-tone="mutual"] {
  border-color: color-mix(in srgb, var(--blue) 30%, var(--line));
  background: color-mix(in srgb, var(--blue) 8%, var(--surface));
}

.admin-summary-item[data-tone="danger"] {
  border-color: color-mix(in srgb, var(--red) 28%, var(--line));
  background: color-mix(in srgb, var(--red) 7%, var(--surface));
}

.admin-summary-item:hover,
.admin-summary-item:focus-visible {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--green) 36%, var(--line));
  box-shadow: 0 0.7rem 1.6rem color-mix(in srgb, var(--ink) 7%, transparent);
  outline: 0;
}

.admin-summary-item[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--green) 54%, var(--line));
  background: linear-gradient(135deg, color-mix(in srgb, var(--green) 15%, var(--surface)), var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 18%, transparent), 0 0.7rem 1.6rem color-mix(in srgb, var(--green) 10%, transparent);
}

.admin-summary-item strong {
  font-size: 1.05rem;
  line-height: 1;
}

.admin-summary-item small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.admin-member-list {
  display: grid;
  gap: 0.65rem;
  min-width: 0;
}

.admin-member-empty {
  margin: 0;
  padding: 1.1rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.admin-member-card {
  display: grid;
  grid-template-columns: minmax(15rem, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(21, 25, 22, 0.05);
}

.admin-member-card[data-admin="true"] {
  border-color: color-mix(in srgb, var(--amber) 38%, var(--line));
  background: color-mix(in srgb, var(--amber) 7%, var(--surface));
}

.admin-member-card[data-blocked="true"] {
  border-color: color-mix(in srgb, var(--red) 36%, var(--line));
  background: color-mix(in srgb, var(--red) 5%, var(--surface));
}

.admin-member-card[data-mutual="true"] {
  border-color: color-mix(in srgb, var(--blue) 34%, var(--line));
  background: color-mix(in srgb, var(--blue) 6%, var(--surface));
}

.admin-member-identity {
  display: grid;
  grid-template-columns: 2.45rem minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.admin-member-avatar {
  display: grid;
  place-items: center;
  width: 2.45rem;
  height: 2.45rem;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 13%, var(--surface-2));
  color: var(--blue);
  font-size: 0.88rem;
  font-weight: 950;
}

.admin-member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-member-copy {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.admin-member-name-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.admin-member-name-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
}

.admin-role-badge {
  flex: 0 0 auto;
  padding: 0.18rem 0.45rem;
  border: 1px solid color-mix(in srgb, var(--amber) 42%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--amber) 13%, var(--surface));
  color: var(--amber);
  font-size: 0.68rem;
  font-weight: 950;
}

.admin-member-copy small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.admin-member-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  min-width: 0;
}

.admin-member-meta-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 1.35rem;
  gap: 0.28rem;
  padding: 0.16rem 0.44rem;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 74%, transparent);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1.1;
}

.admin-member-meta-pill strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.69rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-member-meta-pill:first-child strong {
  max-width: 13rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  letter-spacing: 0;
}

.admin-member-meta-pill[data-tone="activity"] {
  border-color: color-mix(in srgb, var(--green) 30%, var(--line));
  background: color-mix(in srgb, var(--green) 8%, var(--surface));
  color: var(--green-dark);
}

.admin-member-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
  min-width: 0;
}

.admin-member-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.28rem 0.6rem;
  border: 1px solid color-mix(in srgb, var(--blue) 22%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 7%, var(--surface));
  color: var(--blue);
  font-size: 0.74rem;
  font-weight: 950;
  white-space: nowrap;
}

.admin-member-chip[data-tone="ok"] {
  border-color: color-mix(in srgb, var(--green) 30%, var(--line));
  background: color-mix(in srgb, var(--green) 9%, var(--surface));
  color: var(--green);
}

.admin-member-chip[data-tone="admin"] {
  border-color: color-mix(in srgb, var(--amber) 40%, var(--line));
  background: color-mix(in srgb, var(--amber) 11%, var(--surface));
  color: var(--amber);
}

.admin-member-chip[data-tone="danger"] {
  border-color: color-mix(in srgb, var(--red) 38%, var(--line));
  background: color-mix(in srgb, var(--red) 9%, var(--surface));
  color: var(--red);
}

.admin-member-chip[data-tone="mutual"] {
  border-color: color-mix(in srgb, var(--blue) 36%, var(--line));
  background: color-mix(in srgb, var(--blue) 10%, var(--surface));
  color: var(--blue);
}

.admin-member-action-button {
  min-height: 2rem;
  padding: 0.28rem 0.72rem;
  border: 1px solid color-mix(in srgb, var(--red) 38%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--red) 8%, var(--surface));
  color: var(--red);
  font-size: 0.74rem;
  font-weight: 950;
  cursor: pointer;
}

.admin-member-action-button[data-tone="neutral"] {
  border-color: color-mix(in srgb, var(--green) 32%, var(--line));
  background: color-mix(in srgb, var(--green) 8%, var(--surface));
  color: var(--green);
}

.admin-member-action-button[data-tone="mutual"] {
  border-color: color-mix(in srgb, var(--blue) 34%, var(--line));
  background: color-mix(in srgb, var(--blue) 8%, var(--surface));
  color: var(--blue);
}

.admin-member-action-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.qr-dialog {
  width: min(34rem, calc(100vw - 1rem));
  height: auto;
  max-height: calc(100dvh - 1rem);
}

.qr-dialog .dialog-shell {
  height: auto;
  max-height: calc(100dvh - 1rem);
}

.qr-dialog-body {
  display: grid;
  place-items: center;
  min-height: 0;
  padding-top: 1rem;
  overflow: auto;
}

.qr-dialog-image {
  display: block;
  width: min(100%, 28rem);
  max-height: calc(100dvh - 8rem);
  border: 1px solid rgba(205, 31, 38, 0.14);
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 18px 42px rgba(72, 17, 24, 0.18);
}

.detail-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  margin-top: 1rem;
  padding: 0.1rem 0.45rem 0.35rem 0.05rem;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-padding-block: 1rem;
}

.detail-grid > * {
  flex: 0 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.detail-item {
  min-width: 0;
  min-height: 0;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.detail-item-wide {
  grid-column: 1 / -1;
}

.detail-item strong {
  display: block;
  margin-top: 0.35rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.monster-detail-grid {
  gap: 1.1rem;
}

.database-detail-panel {
  padding: 0;
  overflow: hidden;
  contain: layout paint;
}

.database-detail-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.72rem 0.9rem;
  background: #1f2528;
  color: white;
}

.database-detail-panel-header h3 {
  min-width: 0;
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.database-detail-panel-header small {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 900;
}

.database-detail-panel-body {
  min-width: 0;
  padding: 1rem;
  overflow: visible;
  max-height: none;
  background: var(--surface);
}

.database-detail-panel.is-loading .database-detail-panel-body {
  min-height: 4.5rem;
}

.detail-loading-state {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3rem;
  color: var(--muted);
  font-weight: 850;
}

.detail-loading-state span {
  width: 0.9rem;
  height: 0.9rem;
  border: 2px solid color-mix(in srgb, var(--green) 26%, var(--line));
  border-top-color: var(--green);
  border-radius: 999px;
  animation: spin 0.85s linear infinite;
}

.detail-loading-state p {
  margin: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.map-detail-load-more {
  justify-self: center;
  min-height: 2.4rem;
  padding: 0 1rem;
  border: 1px solid color-mix(in srgb, var(--green) 28%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--green) 9%, var(--surface));
  color: var(--green);
  font-weight: 900;
  cursor: pointer;
}

.map-detail-load-more:hover {
  border-color: color-mix(in srgb, var(--green) 44%, var(--line));
  background: color-mix(in srgb, var(--green) 13%, var(--surface));
}

.database-detail-panel-body > .media-grid,
.database-detail-panel-body > .drop-map-list,
.database-detail-panel-body > .relation-list,
.database-detail-panel-body > .formula-table,
.database-detail-panel-body > .mix-tree-layout {
  margin-top: 0;
}

.detail-section-body-content {
  min-width: 0;
  display: grid;
  gap: 0.5rem;
  min-height: 0;
}

.quest-guide-content {
  gap: 0.75rem;
  line-height: 1.65;
}

.quest-guide-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.quest-guide-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 1.65rem;
  padding: 0 0.55rem;
  border: 1px solid rgba(49, 95, 151, 0.22);
  border-radius: 999px;
  background: rgba(49, 95, 151, 0.08);
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
}

.quest-guide-content p {
  margin: 0;
  white-space: pre-line;
}

.quest-guide-content small {
  color: var(--muted);
  font-weight: 800;
}

.detail-overview {
  display: grid;
  grid-template-columns: minmax(9rem, 13rem) 1fr;
  gap: 1rem;
  align-items: start;
  background: linear-gradient(180deg, rgba(238, 241, 237, 0.72), var(--surface));
}

.map-detail-overview {
  grid-template-columns: minmax(10rem, 14rem) minmax(0, 1fr);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--green) 7%, transparent), transparent 56%),
    var(--surface);
}

.detail-media {
  display: grid;
  gap: 0.65rem;
}

.detail-image-frame {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.detail-image-frame figcaption {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-align: center;
}

.detail-image {
  display: block;
  width: 100%;
  max-height: 8.5rem;
  object-fit: contain;
}

.detail-image-placeholder {
  display: grid;
  place-items: center;
  min-height: 8.5rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 900;
}

.detail-overview-body {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
}

.detail-overview-top {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.detail-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.map-detail-overview .detail-chip-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.25rem, 1fr));
  margin-bottom: 0;
}

.detail-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 1.85rem;
  max-width: 100%;
  padding: 0 0.55rem;
  border: 1px solid rgba(31, 122, 79, 0.22);
  border-radius: 999px;
  background: rgba(31, 122, 79, 0.08);
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.detail-chip-stacked {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.12rem;
  min-height: 3.25rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  text-align: center;
}

.detail-chip-stacked small {
  display: block;
  justify-self: center;
  width: fit-content;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
}

.detail-chip-stacked b {
  display: block;
  justify-self: center;
  width: fit-content;
  min-width: 0;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.detail-chip.tone-blue {
  border-color: rgba(49, 95, 151, 0.24);
  background: rgba(49, 95, 151, 0.08);
}

.detail-chip.tone-amber {
  border-color: rgba(177, 118, 31, 0.24);
  background: rgba(177, 118, 31, 0.08);
}

.detail-chip.tone-neutral {
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
}

.map-detail-overview .record-evidence-list {
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
}

.record-evidence-card {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid rgba(49, 95, 151, 0.2);
  border-radius: 8px;
  background: rgba(49, 95, 151, 0.06);
}

.record-evidence-card > strong {
  margin: 0;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 950;
}

.record-evidence-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.42rem;
  min-width: 0;
}

.record-evidence-item {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.15rem;
  min-width: 0;
  padding: 0.42rem 0.5rem;
  border: 1px solid var(--line);
  border-left: 0.22rem solid var(--muted);
  border-radius: 8px;
  background: var(--surface);
  text-align: center;
}

.record-evidence-item small,
.record-evidence-item b,
.record-evidence-item a {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-evidence-item small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.record-evidence-item b,
.record-evidence-item a {
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 950;
  text-decoration: none;
}

.record-evidence-item a:hover,
.record-evidence-item a:focus-visible {
  color: var(--blue);
  text-decoration: underline;
}

.record-evidence-item.tone-good {
  border-left-color: var(--green);
  background: rgba(31, 122, 79, 0.075);
}

.record-evidence-item.tone-warn {
  border-left-color: var(--amber);
  background: rgba(177, 118, 31, 0.08);
}

.record-evidence-item.tone-danger {
  border-left-color: var(--red);
  background: rgba(184, 66, 53, 0.075);
}

.record-player-report-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.58rem 0.65rem;
  border: 1px solid rgba(31, 122, 79, 0.22);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(31, 122, 79, 0.11), rgba(49, 95, 151, 0.06));
  color: var(--ink);
}

.record-player-report-note > div {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.record-player-report-note strong {
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 950;
}

.record-player-report-note p,
.record-player-report-note small {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  line-height: 1.35;
}

.record-player-report-note small {
  flex: 0 0 auto;
  padding: 0.25rem 0.45rem;
  border: 1px solid rgba(31, 122, 79, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--green);
  white-space: nowrap;
}

.record-evidence-note {
  margin: 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid rgba(177, 118, 31, 0.24);
  border-radius: 8px;
  background: rgba(177, 118, 31, 0.08);
  color: var(--amber);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.35;
}

.record-evidence-load {
  justify-self: start;
  min-height: 2rem;
  padding: 0.42rem 0.65rem;
  border: 1px solid rgba(49, 95, 151, 0.24);
  border-radius: 8px;
  background: var(--surface);
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 950;
  cursor: pointer;
}

.record-evidence-load:hover,
.record-evidence-load:focus-visible {
  border-color: rgba(49, 95, 151, 0.42);
  background: rgba(49, 95, 151, 0.08);
}

.record-evidence-load:disabled {
  cursor: progress;
  opacity: 0.68;
}

.type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  flex: 0 0 auto;
  background: transparent;
  line-height: 1;
  overflow: visible;
}

.type-icon img {
  display: block;
  width: 1.45rem;
  height: 1.45rem;
  object-fit: contain;
}

.type-icon-fallback {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.type-tag,
.type-fact-value {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.detail-facts {
  display: grid;
  grid-template-columns: minmax(6rem, 9rem) minmax(0, 1fr);
  gap: 0.45rem 0.8rem;
  margin: 0;
}

.detail-facts dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.detail-facts dd {
  min-width: 0;
  margin: 0;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.monster-profile {
  display: grid;
  grid-template-columns: minmax(8rem, 11rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  overflow: visible;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(238, 241, 237, 0.72));
}

.monster-portrait {
  display: grid;
  gap: 0.5rem;
  align-content: center;
  min-width: 0;
  margin: 0;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: center;
}

.monster-portrait img {
  width: 100%;
  max-height: 10.5rem;
  object-fit: contain;
}

.monster-visual-stack {
  --visual-size: 2.8rem;
  --visual-box-width: var(--visual-size);
  --visual-box-height: var(--visual-size);
  --effect-width: calc(var(--visual-size) * 1.22);
  --effect-height: calc(var(--visual-size) * 0.58);
  --effect-bottom: 0.04rem;
  --base-y: 0;
  display: inline-grid;
  position: relative;
  flex: 0 0 auto;
  place-items: center;
  width: var(--visual-box-width);
  height: var(--visual-box-height);
  isolation: isolate;
  overflow: hidden;
  vertical-align: middle;
}

.monster-visual-stack.has-effect {
  --base-y: -0.08rem;
}

.monster-visual-stack img {
  flex: 0 0 auto;
  width: var(--visual-size);
  height: var(--visual-size);
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.monster-visual-base {
  position: relative;
  z-index: 2;
  transform: translateY(var(--base-y));
}

.monster-visual-stack .monster-visual-effect {
  position: absolute;
  left: 50%;
  bottom: var(--effect-bottom);
  z-index: 1;
  width: var(--effect-width);
  height: var(--effect-height);
  max-width: none;
  max-height: none;
  transform: translateX(-50%);
  opacity: 0.94;
  object-fit: contain;
  pointer-events: none;
}

.monster-visual-card.has-effect {
  width: var(--visual-box-width);
}

.monster-visual-card .monster-visual-base {
  width: var(--visual-size);
  height: var(--visual-size);
}

.monster-visual-portrait.has-effect {
  width: var(--visual-box-width);
}

.monster-visual-portrait .monster-visual-base {
  width: var(--visual-size);
  height: var(--visual-size);
}

.monster-visual-drop.has-effect {
  width: var(--visual-box-width);
}

.monster-visual-placeholder {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.monster-visual-card {
  --visual-size: 3.85rem;
  --visual-box-width: 4.6rem;
  --visual-box-height: 4.6rem;
  --effect-width: 4.7rem;
  --effect-height: 2rem;
  --effect-bottom: 0.22rem;
}

.monster-visual-inline {
  --visual-size: 2.5rem;
  --visual-box-width: 3rem;
  --visual-box-height: 3rem;
  --effect-width: 2.95rem;
  --effect-height: 1.25rem;
  --effect-bottom: 0.18rem;
}

.monster-visual-portrait {
  --visual-size: 9.8rem;
  --visual-box-width: min(100%, 12rem);
  --visual-box-height: 11.75rem;
  --effect-width: min(11.4rem, 98%);
  --effect-height: 4.2rem;
  --effect-bottom: 0.78rem;
  width: var(--visual-box-width);
  height: var(--visual-box-height);
  justify-self: center;
}

.monster-visual-drop {
  --visual-size: 2.65rem;
  --visual-box-width: 3rem;
  --visual-box-height: 3rem;
  --effect-width: 3.05rem;
  --effect-height: 1.28rem;
  --effect-bottom: 0.16rem;
}

.monster-portrait figcaption {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
}

.monster-profile-body {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}

.monster-profile-summary {
  display: grid;
  gap: 0.4rem;
  margin: 0;
}

.monster-profile-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.monster-profile-title-text {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.monster-profile-title h3 {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monster-profile-title p {
  margin: 0;
  color: var(--muted);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.detail-favorite-button {
  justify-self: end;
  min-height: 2.15rem;
  border-color: rgba(177, 118, 31, 0.28);
  background: rgba(177, 118, 31, 0.08);
  color: var(--amber);
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.detail-favorite-button.active {
  border-color: rgba(177, 118, 31, 0.48);
  background: rgba(177, 118, 31, 0.16);
}

.monster-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.monster-badges span {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  max-width: 100%;
  padding: 0 0.55rem;
  border: 1px solid rgba(49, 95, 151, 0.22);
  border-radius: 999px;
  background: rgba(49, 95, 151, 0.08);
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.monster-badges .level-badge {
  border-color: color-mix(in srgb, var(--blue) 26%, var(--line));
  background: color-mix(in srgb, var(--blue-soft) 54%, var(--surface));
  color: var(--blue-strong);
}

.monster-badges .type-badge {
  border-color: color-mix(in srgb, var(--green) 28%, var(--line));
  background: color-mix(in srgb, var(--green-soft) 64%, var(--surface));
  color: var(--green-strong);
}

.monster-badges .drop-badge {
  border-color: color-mix(in srgb, var(--green) 34%, var(--line));
  background: color-mix(in srgb, var(--green-soft) 76%, var(--surface));
  color: var(--green-strong);
}

.monster-badges .unmarked-badge {
  border-color: color-mix(in srgb, var(--red) 30%, var(--line));
  background: color-mix(in srgb, var(--red-soft) 68%, var(--surface));
  color: var(--red);
}

.monster-fact-table,
.monster-fact-cards {
  min-width: 0;
}

.monster-fact-table {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr);
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.monster-fact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.42rem;
}

.monster-fact-cards > div {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 56%, var(--surface));
}

.monster-fact-cards small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
}

.monster-fact-cards strong {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.local-sprite-copy-button {
  justify-self: start;
  min-height: 1.78rem;
  padding: 0.24rem 0.48rem;
  border: 1px solid color-mix(in srgb, var(--blue) 26%, var(--line));
  border-radius: 8px;
  color: var(--blue-strong);
  background: color-mix(in srgb, var(--blue-soft) 62%, var(--surface));
  font-size: 0.72rem;
  font-weight: 900;
}

.monster-fact-table dd,
.monster-extra-facts dd {
  white-space: pre-wrap;
}

.detail-section-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.monster-extra-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 0.55rem 0.65rem 0.65rem;
  display: grid;
  gap: 0.45rem;
}

.monster-extra-panel h4 {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink);
  font-weight: 900;
}

.monster-extra-facts {
  display: grid;
  grid-template-columns: minmax(7rem, 10rem) minmax(0, 1fr);
  margin: 0;
}

.monster-fact-table dt,
.monster-fact-table dd,
.monster-extra-facts dt,
.monster-extra-facts dd {
  min-width: 0;
  margin: 0;
  padding: 0.62rem 0.75rem;
  border-bottom: 1px solid var(--line);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.monster-fact-table dt,
.monster-extra-facts dt {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

.monster-fact-table dd,
.monster-extra-facts dd {
  font-weight: 800;
}

.monster-fact-table dt:nth-last-child(2),
.monster-fact-table dd:last-child,
.monster-extra-facts dt:nth-last-child(2),
.monster-extra-facts dd:last-child {
  border-bottom: 0;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.35rem 1rem;
  margin-block: 0.85rem 0;
  padding-left: 1.1rem;
}

.detail-list li,
.relation-list li {
  line-height: 1.45;
  min-width: 0;
  overflow-wrap: anywhere;
}

.relation-list {
  display: grid;
  gap: 0.4rem;
  margin-block: 0.85rem 0;
  padding-left: 1.25rem;
}

.relation-list-grid {
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.5rem 1rem;
}

.relation-list small {
  display: inline-flex;
  margin-left: 0.45rem;
  color: var(--muted);
  font-weight: 800;
}

.monster-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0.55rem;
}

.monster-link-card {
  display: grid;
  gap: 0.25rem;
  align-content: start;
  min-width: 0;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.monster-link-card small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.monster-relation-table {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
}

.monster-relation-row {
  display: grid;
  grid-template-columns: minmax(12rem, 1.35fr) minmax(8rem, 0.75fr) minmax(8rem, 0.8fr);
  gap: 0.55rem;
  align-items: stretch;
  min-width: 0;
  min-height: 4.75rem;
  padding: 0.58rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.monster-relation-header {
  align-items: center;
  min-height: 2.1rem;
  padding-block: 0.42rem;
  background: rgba(49, 95, 151, 0.08);
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 900;
}

.monster-relation-cell {
  display: flex;
  align-items: center;
  min-width: 0;
}

.monster-relation-target .relation-link {
  width: 100%;
}

.monster-relation-species .species-badge {
  max-width: 100%;
}

.monster-relation-info small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monster-link-card-line,
.formula-ingredient-line,
.mix-tree-node-titleline {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
  flex-wrap: nowrap;
}

.monster-link-card-line .relation-link,
.formula-ingredient-line .relation-link,
.mix-tree-node-titleline .relation-link {
  flex: 1 1 auto;
  min-width: 0;
}

.species-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex: 0 0 auto;
  min-height: 1.6rem;
  padding: 0.12rem 0.36rem;
  border: 1px solid rgba(49, 95, 151, 0.2);
  border-radius: 999px;
  background: rgba(49, 95, 151, 0.08);
  color: var(--blue);
  font-weight: 900;
  white-space: nowrap;
}

.species-badge .type-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.species-badge small {
  color: currentColor;
  font-size: 0.72rem;
  line-height: 1;
}

.formula-table {
  display: grid;
  gap: 0.55rem;
}

.formula-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(9rem, 0.72fr);
  gap: 0.55rem;
  align-items: stretch;
  min-width: 0;
  min-height: 4.75rem;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.formula-table-header {
  align-items: center;
  min-height: 2.1rem;
  padding-block: 0.42rem;
  background: rgba(49, 95, 151, 0.08);
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 900;
}

.formula-ingredient {
  display: grid;
  gap: 0.3rem;
  align-content: center;
  min-width: 0;
}

.formula-mix-item-line {
  display: flex;
  min-width: 0;
}

.formula-mix-item-line .item-badge {
  width: 100%;
  min-height: 2rem;
  justify-content: flex-start;
  border-color: rgba(177, 118, 31, 0.24);
  background: rgba(177, 118, 31, 0.09);
  color: var(--amber);
}

.formula-ingredient-line .relation-link {
  width: 100%;
  min-height: 3.35rem;
}

.formula-ingredient-line .species-badge {
  max-width: 6.75rem;
}

.formula-ingredient > small,
.formula-required > small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.formula-row:not(.formula-table-header) .formula-ingredient > small,
.formula-row:not(.formula-table-header) .formula-required > small {
  display: none;
}

.formula-required {
  display: grid;
  gap: 0.35rem;
  align-content: center;
  min-width: 0;
}

.formula-required .item-badge,
.formula-required .formula-grade,
.formula-required .formula-none {
  width: 100%;
  justify-content: center;
}

.formula-cell-meta {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.formula-grade,
.formula-none {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  min-height: 1.8rem;
  padding: 0 0.5rem;
  border: 1px solid rgba(102, 112, 106, 0.18);
  border-radius: 999px;
  background: rgba(102, 112, 106, 0.08);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.relation-link {
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  min-height: 1.95rem;
  padding: 0.12rem 0.45rem;
  border-color: rgba(31, 122, 79, 0.28);
  background: rgba(31, 122, 79, 0.08);
  color: var(--green);
  font-size: 0.92rem;
  font-weight: 900;
  white-space: normal;
  text-align: left;
  min-width: 0;
}

.relation-link img {
  width: 1.55rem;
  height: 1.55rem;
  object-fit: contain;
}

.relation-link .monster-visual-stack {
  width: 3rem;
  height: 3rem;
}

.relation-link .monster-visual-stack.has-effect {
  width: 3rem;
}

.relation-link .monster-visual-stack .monster-visual-base {
  width: 3rem;
  height: 3rem;
}

.relation-link:not(:has(img)),
.item-badge:not(:has(img)) {
  grid-template-columns: minmax(0, 1fr);
}

.relation-link-text,
.relation-link strong {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.map-link {
  white-space: nowrap;
}

.map-link img {
  width: 2.4rem;
  height: 2.4rem;
}

.map-link .relation-link-text,
.map-link strong,
.monster-map-grid .media-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

.item-badge {
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  min-height: 1.95rem;
  padding: 0.12rem 0.45rem;
  border: 1px solid rgba(49, 95, 151, 0.28);
  border-radius: 8px;
  background: rgba(49, 95, 151, 0.08);
  color: var(--blue);
  font-size: 0.92rem;
  font-weight: 900;
  white-space: normal;
  text-align: left;
  min-width: 0;
}

button.item-badge {
  cursor: pointer;
}

.item-badge img {
  width: 1.55rem;
  height: 1.55rem;
  object-fit: contain;
}

.item-link {
  border-color: rgba(177, 118, 31, 0.28);
  background: rgba(177, 118, 31, 0.08);
  color: var(--amber);
}

.item-link:hover,
.item-link:focus-visible {
  border-color: var(--amber);
  background: rgba(177, 118, 31, 0.16);
}

.item-text-link {
  grid-template-columns: minmax(0, 1fr);
}

.mix-tree-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(13rem, 17rem);
  gap: 1rem;
  align-items: start;
  margin-top: 0;
  min-width: 0;
}

.mix-tree-viewer {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
}

.mix-tree-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-width: 0;
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.mix-tree-toolbar-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.28rem;
  min-width: 0;
  padding: 0.18rem;
  border: 1px solid rgba(102, 112, 106, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.48);
}

.mix-tree-toolbar-more { position: relative; }
.mix-tree-toolbar-more > summary { min-height: 2rem; padding: 0.4rem 0.65rem; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 900; list-style: none; }
.mix-tree-toolbar-more-body { position: absolute; z-index: 8; top: calc(100% + 0.35rem); right: 0; display: grid; gap: 0.4rem; min-width: min(24rem, calc(100vw - 2rem)); padding: 0.55rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.mix-tree-toolbar-more:not([open]) .mix-tree-toolbar-more-body { display: none; }

.mix-tree-toolbar button {
  min-height: 2rem;
  padding: 0 0.6rem;
  font-size: 0.82rem;
  font-weight: 900;
}

.mix-tree-layout-tool .mix-tree-toolbar {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  z-index: 7;
  max-width: min(56rem, calc(100% - 1.4rem));
  border-color: rgba(49, 95, 151, 0.18);
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 14px 34px rgba(29, 42, 33, 0.18);
  backdrop-filter: blur(10px);
}

.mix-tree-layout-tool .mix-tree-focus-status {
  flex: 1 1 9rem;
  max-width: 13rem;
}

.mix-tree-plan-group {
  border-color: rgba(31, 122, 79, 0.2);
  background: rgba(31, 122, 79, 0.08);
}

.mix-tree-smart-button {
  border-color: rgba(31, 122, 79, 0.35);
  background: rgba(31, 122, 79, 0.12);
  color: var(--green);
}

.mix-tree-smart-button:hover {
  border-color: rgba(31, 122, 79, 0.48);
  background: rgba(31, 122, 79, 0.18);
}

.mix-tree-focus-status {
  flex: 1 1 12rem;
  min-width: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mix-tree-zoom-value {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 3.4rem;
  height: 2rem;
  text-align: center;
  line-height: 1;
  padding: 0 0.42rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  white-space: nowrap;
}

.mix-tree-info-scale-value {
  min-width: 5.4rem;
  color: var(--green);
}

.detail-item .mix-tree-toolbar .mix-tree-zoom-value {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.mix-tree-path {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}

.mix-tree-path button {
  max-width: 13rem;
  min-height: 1.85rem;
  padding: 0 0.55rem;
  border-color: rgba(49, 95, 151, 0.2);
  background: rgba(49, 95, 151, 0.07);
  color: var(--blue);
  font-size: 0.74rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mix-tree-path button.active {
  border-color: rgba(31, 122, 79, 0.36);
  background: rgba(31, 122, 79, 0.12);
  color: var(--green);
}

.mix-tree-layout-tool .mix-tree-path {
  position: absolute;
  left: 0.7rem;
  bottom: 0.7rem;
  z-index: 7;
  max-width: calc(100% - 1.4rem);
  padding: 0.35rem;
  border: 1px solid rgba(49, 95, 151, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 28px rgba(29, 42, 33, 0.14);
  backdrop-filter: blur(10px);
}

.mix-tree-scroll {
  min-width: 0;
  min-height: 26rem;
  max-height: min(58vh, 48rem);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle, rgba(31, 122, 79, 0.18) 1px, transparent 1.4px) 0 0 / 22px 22px,
    linear-gradient(135deg, rgba(49, 95, 151, 0.04), rgba(177, 118, 31, 0.05)),
    #fbfcfb;
  cursor: grab;
  scrollbar-width: thin;
  touch-action: none;
  user-select: none;
}

.mix-tree-layout-tool .mix-tree-scroll {
  min-height: min(68vh, 46rem);
  max-height: min(72vh, 56rem);
  padding: 4.45rem 0.9rem 3.8rem;
  background:
    radial-gradient(circle, rgba(31, 122, 79, 0.18) 1px, transparent 1.4px) 0 0 / 22px 22px,
    linear-gradient(135deg, rgba(49, 95, 151, 0.06), rgba(177, 118, 31, 0.05)),
    #dfe4e1;
}

.smart-mix-panel.is-tree-workbench .mix-tree-layout-tool .mix-tree-scroll {
  min-height: clamp(26rem, calc(100vh - 16rem), 56rem);
  max-height: calc(100vh - 12rem);
  padding-inline: 1.1rem;
}

.mix-tree-layout-tool.is-mix-tree-fullscreen,
.mix-tree-layout-visual.is-mix-tree-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: block;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  background: #dfe4e1;
}

.mix-tree-layout-tool.is-mix-tree-fullscreen .mix-tree-viewer,
.mix-tree-layout-visual.is-mix-tree-fullscreen .mix-tree-viewer {
  position: static;
  width: 100%;
  height: 100%;
}

.mix-tree-fullscreen-active .smart-mix-panel.is-tree-workbench .mix-tree-layout-tool.is-mix-tree-fullscreen .mix-tree-scroll {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  padding: clamp(4.4rem, 7vh, 5.4rem) clamp(0.75rem, 1.6vw, 1.35rem) clamp(3.3rem, 6vh, 4.4rem);
  border: 0;
  border-radius: 0;
}

.mix-tree-layout-tool.is-mix-tree-fullscreen .mix-tree-toolbar,
.mix-tree-layout-visual.is-mix-tree-fullscreen .mix-tree-toolbar {
  position: fixed;
  top: max(0.65rem, env(safe-area-inset-top));
  right: max(0.65rem, env(safe-area-inset-right));
  z-index: 124;
  max-width: min(72rem, calc(100vw - 1.3rem));
}

.mix-tree-layout-tool.is-mix-tree-fullscreen .mix-tree-path,
.mix-tree-layout-visual.is-mix-tree-fullscreen .mix-tree-path {
  position: fixed;
  bottom: max(0.65rem, env(safe-area-inset-bottom));
  left: max(0.65rem, env(safe-area-inset-left));
  z-index: 124;
  max-width: calc(100vw - 1.3rem);
}

.mix-tree-fullscreen-toggle {
  border-color: rgba(49, 95, 151, 0.32);
  background: rgba(49, 95, 151, 0.1);
  color: var(--blue);
}

.mix-tree-fullscreen-toggle[aria-pressed="true"] {
  border-color: rgba(184, 66, 53, 0.28);
  background: rgba(184, 66, 53, 0.1);
  color: var(--red);
}

.smart-mix-panel.is-mix-tree-fullscreen .mix-tree-dashboard {
  position: fixed;
  top: clamp(4.35rem, 8vh, 5.4rem);
  left: max(0.75rem, env(safe-area-inset-left));
  z-index: 123;
  width: min(24rem, calc(100vw - 1.5rem));
  max-height: calc(100vh - 8.8rem);
  max-height: calc(100dvh - 8.8rem);
  overflow: auto;
  box-shadow: 0 18px 48px rgba(29, 42, 33, 0.24);
  backdrop-filter: blur(12px);
}

.smart-mix-panel.is-mix-tree-fullscreen .mix-tree-dashboard-panel {
  max-height: min(45vh, 24rem);
}

.mix-tree-scroll.dragging {
  cursor: grabbing;
}

.mix-tree-canvas {
  position: relative;
  min-width: max-content;
  min-height: max-content;
}

.mix-tree-diagram {
  display: inline-block;
  min-width: max-content;
  padding: 1rem 1.4rem 1.35rem;
  transform-origin: top left;
  will-change: transform;
}

.mix-tree-branch {
  display: flex;
  position: relative;
  flex-direction: column;
  align-items: center;
  min-width: max-content;
}

.mix-tree-branch:not(.mix-tree-leaf) > .mix-tree-node-card::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1rem;
  width: 1px;
  height: 1rem;
  background: linear-gradient(to bottom, rgba(31, 122, 79, 0.65), rgba(49, 95, 151, 0.28));
}

.mix-tree-children {
  display: flex;
  position: relative;
  gap: 1.35rem;
  justify-content: center;
  min-width: max-content;
  padding-top: 1.25rem;
}

.mix-tree-children::before {
  content: "";
  position: absolute;
  top: 0.25rem;
  left: 7.5rem;
  right: 7.5rem;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(31, 122, 79, 0.62), rgba(49, 95, 151, 0.35), transparent);
}

.mix-tree-children > .mix-tree-branch::before {
  content: "";
  position: absolute;
  top: -1rem;
  left: 50%;
  width: 1px;
  height: 1rem;
  background: linear-gradient(to bottom, rgba(49, 95, 151, 0.3), rgba(31, 122, 79, 0.62));
}

.mix-tree-node-card {
  display: grid;
  position: relative;
  align-content: start;
  gap: 0.42rem;
  width: 17.25rem;
  min-height: 11rem;
  overflow: hidden;
  padding: 0.68rem;
  border: 1px solid color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 34%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--mix-tree-type-accent-soft, rgba(49, 95, 151, 0.08)), transparent 60%),
    rgba(255, 255, 255, 0.9);
  box-shadow:
    inset 4px 0 0 color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 78%, transparent),
    0 10px 24px rgba(21, 25, 22, 0.08);
  backdrop-filter: blur(4px);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.mix-tree-node-card.is-detail-clickable {
  cursor: pointer;
}

.mix-tree-node-card.is-detail-clickable:hover,
.mix-tree-node-card.is-detail-clickable:focus-visible {
  border-color: color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 58%, var(--line));
  box-shadow:
    inset 4px 0 0 color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 84%, transparent),
    0 14px 30px rgba(21, 25, 22, 0.13);
  transform: translateY(-1px);
}

.mix-tree-node-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.mix-tree-node-card.is-selected {
  border-color: color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 72%, var(--line));
  box-shadow:
    inset 4px 0 0 color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 88%, transparent),
    0 0 0 3px color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 20%, transparent),
    0 16px 32px rgba(21, 25, 22, 0.14);
}

.mix-tree-node-card.is-droppable {
  box-shadow:
    inset 4px 0 0 color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 84%, transparent),
    inset 0 -3px 0 color-mix(in srgb, var(--green) 72%, transparent),
    0 10px 24px rgba(21, 25, 22, 0.08);
}

.mix-tree-node-card.is-done {
  border-color: rgba(31, 122, 79, 0.58);
}

.mix-tree-node-card.is-owned {
  border-color: rgba(31, 122, 79, 0.46);
}

.mix-tree-node-card.is-ready {
  border-color: rgba(49, 95, 151, 0.5);
}

.mix-tree-node-card.is-blocked {
  border-color: rgba(184, 66, 53, 0.34);
}

.mix-tree-node-card.is-done .mix-tree-node-dot,
.mix-tree-node-card.is-owned .mix-tree-node-dot {
  background: var(--green);
  box-shadow: 0 0 0 2px rgba(31, 122, 79, 0.22);
}

.mix-tree-node-card.is-ready .mix-tree-node-dot {
  background: var(--blue);
  box-shadow: 0 0 0 2px rgba(49, 95, 151, 0.22);
}

.mix-tree-node-card.is-blocked .mix-tree-node-dot {
  background: var(--red);
  box-shadow: 0 0 0 2px rgba(184, 66, 53, 0.18);
}

.mix-tree-node-target {
  border-color: rgba(31, 122, 79, 0.45);
  background: linear-gradient(135deg, rgba(31, 122, 79, 0.14), rgba(255, 255, 255, 0.94));
}

.mix-tree-node-material {
  border-color: rgba(49, 95, 151, 0.3);
}

.mix-tree-node-base {
  border-color: rgba(177, 118, 31, 0.38);
  background: linear-gradient(135deg, rgba(177, 118, 31, 0.12), rgba(255, 255, 255, 0.95));
}

.mix-tree-node-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 0.38rem;
  min-width: 0;
}

.mix-tree-node-identity {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1 1 4rem;
  min-width: 0;
}

.mix-tree-node-dot {
  display: inline-block;
  width: 0.72rem;
  height: 0.72rem;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 0 0 2px rgba(49, 95, 151, 0.18);
}

.mix-tree-node-target .mix-tree-node-dot {
  background: var(--green);
  box-shadow: 0 0 0 2px rgba(31, 122, 79, 0.22);
}

.mix-tree-node-base .mix-tree-node-dot {
  background: var(--amber);
  box-shadow: 0 0 0 2px rgba(177, 118, 31, 0.22);
}

.mix-tree-node-head small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.mix-tree-node-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(4.2rem, 1fr));
  gap: 0.28rem;
  width: 100%;
  min-width: 0;
}

.mix-tree-toggle {
  min-width: 0;
  min-height: 1.65rem;
  padding: 0 0.45rem;
  border-color: rgba(31, 122, 79, 0.24);
  background: rgba(31, 122, 79, 0.08);
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mix-tree-focus-button,
.mix-tree-detail-button {
  max-width: 100%;
  min-width: 0;
  min-height: 1.65rem;
  padding: 0 0.45rem;
  border-color: rgba(49, 95, 151, 0.24);
  background: rgba(49, 95, 151, 0.08);
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mix-tree-detail-button {
  border-color: rgba(31, 122, 79, 0.24);
  background: rgba(31, 122, 79, 0.08);
  color: var(--green);
}

.mix-tree-node-meta {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1;
}

.mix-tree-node-info {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mix-tree-node-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.28rem;
}

.mix-tree-node-stats span {
  display: grid;
  align-content: center;
  gap: 0.04rem;
  min-width: 0;
  min-height: 2.35rem;
  padding: 0.26rem 0.32rem;
  border-radius: 7px;
  background: rgba(49, 95, 151, 0.09);
  color: var(--blue);
  text-align: center;
}

.mix-tree-node-stats b,
.mix-tree-node-stats small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mix-tree-node-stats b {
  color: inherit;
  font-size: 0.74rem;
  line-height: 1.1;
}

.mix-tree-node-stats small {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 900;
}

.mix-tree-node-recipe {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
  overflow: hidden;
  padding-top: 0.25rem;
  border-top: 1px solid rgba(216, 222, 216, 0.8);
}

.mix-tree-node-recipe-title {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.mix-tree-node-recipe-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.32rem;
  min-width: 0;
}

.mix-tree-node-recipe-cell {
  display: grid;
  align-content: start;
  gap: 0.22rem;
  min-width: 0;
  padding: 0.34rem;
  border: 1px solid rgba(49, 95, 151, 0.16);
  border-radius: 7px;
  background: rgba(49, 95, 151, 0.06);
}

.mix-tree-node-recipe-cell > small:first-child,
.mix-tree-node-recipe-meta,
.mix-tree-node-recipe-requirement > small {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mix-tree-node-recipe-line {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}

.mix-tree-node-recipe-line .relation-link {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  min-height: 2rem;
  padding-inline: 0.32rem;
  font-size: 0.74rem;
}

.mix-tree-node-recipe-line .monster-visual-stack {
  width: 2.2rem;
  height: 2.2rem;
}

.mix-tree-node-recipe-line .monster-visual-stack.has-effect {
  width: 2.2rem;
}

.mix-tree-node-recipe-line .monster-visual-stack .monster-visual-base {
  width: 2.2rem;
  height: 2.2rem;
}

.mix-tree-node-recipe-line .species-badge {
  max-width: 5.2rem;
  min-height: 1.45rem;
  padding-inline: 0.28rem;
}

.mix-tree-node-recipe-line .species-badge .type-icon {
  width: 1.05rem;
  height: 1.05rem;
}

.mix-tree-node-recipe-item {
  display: flex;
  min-width: 0;
}

.mix-tree-node-recipe-item .item-badge {
  width: 100%;
  min-height: 1.75rem;
  padding-inline: 0.34rem;
  border-color: rgba(177, 118, 31, 0.24);
  background: rgba(177, 118, 31, 0.09);
  color: var(--amber);
  font-size: 0.7rem;
}

.mix-tree-node-recipe-item .item-badge img {
  width: 1.35rem;
  height: 1.35rem;
}

.mix-tree-node-recipe-requirement {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.28rem;
  min-width: 0;
}

.mix-tree-node-recipe-requirement > span {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  min-height: 1.55rem;
  padding: 0 0.42rem;
  border: 1px solid rgba(102, 112, 106, 0.16);
  border-radius: 999px;
  background: rgba(102, 112, 106, 0.08);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mix-tree-node-titleline .relation-link {
  width: auto;
}

.mix-tree-node-titleline .species-badge {
  max-width: 6rem;
}

.mix-tree-node-drops {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  min-width: 0;
  max-height: 3.05rem;
  overflow: hidden;
  padding-top: 0.2rem;
  border-top: 1px solid rgba(216, 222, 216, 0.8);
}

.mix-tree-node-drops > small {
  display: inline-flex;
  align-items: center;
  min-height: 1.35rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
}

.mix-tree-node-drop {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 1.35rem;
  padding: 0 0.36rem;
  border-radius: 999px;
  background: rgba(102, 112, 106, 0.1);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mix-tree-node-drop-equipment {
  background: rgba(177, 118, 31, 0.13);
  color: var(--amber);
}

.mix-tree-node-drop-egg {
  background: rgba(31, 122, 79, 0.12);
  color: var(--green);
}

.mix-tree-node-card .relation-link,
.mix-tree-node-card .relation-missing {
  width: 100%;
  min-width: 0;
}

.mix-tree-node-card .monster-visual-stack {
  width: 3.2rem;
  height: 3.2rem;
}

.mix-tree-node-card .monster-visual-stack.has-effect {
  width: 3.2rem;
}

.mix-tree-node-card .monster-visual-stack .monster-visual-base {
  width: 3.2rem;
  height: 3.2rem;
}

.mix-tree-node-card .relation-link-text,
.mix-tree-node-card .relation-missing {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
}

.mix-tree-inventory {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.mix-tree-layout-visual > .mix-tree-inventory {
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: 0.34rem;
  max-height: 12.5rem;
  padding: 0.5rem;
  overflow: auto;
  scrollbar-width: thin;
}

.mix-tree-inventory > strong {
  margin: 0;
}

.mix-tree-layout-visual > .mix-tree-inventory > strong {
  grid-column: 1 / -1;
  font-size: 0.92rem;
}

.mix-tree-inventory-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.22rem 0.4rem;
  min-width: 0;
  padding: 0.4rem;
  border: 1px solid rgba(216, 222, 216, 0.9);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: inset 4px 0 0 color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 72%, transparent);
}

.mix-tree-layout-visual .mix-tree-inventory-row {
  min-height: 2.65rem;
  padding: 0.28rem 0.38rem 0.28rem 0.48rem;
  gap: 0.08rem 0.28rem;
  border-radius: 7px;
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 72%, transparent);
}

.mix-tree-inventory-row > .relation-link,
.mix-tree-inventory-row > .relation-missing {
  grid-column: 1;
  min-width: 0;
}

.mix-tree-layout-visual .mix-tree-inventory-row > .relation-link,
.mix-tree-layout-visual .mix-tree-inventory-row > .relation-missing {
  width: 100%;
  min-height: 1.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  justify-content: flex-start;
}

.mix-tree-layout-visual .mix-tree-inventory-row .relation-link-text {
  font-size: 0.78rem;
  line-height: 1.1;
}

.mix-tree-layout-visual .mix-tree-inventory-row .monster-visual-inline {
  --visual-size: 1.55rem;
  --visual-box-width: 1.85rem;
  --visual-box-height: 1.85rem;
  --effect-width: 1.85rem;
  --effect-height: 0.78rem;
  --effect-bottom: 0.08rem;
}

.mix-tree-inventory-row small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.mix-tree-layout-visual .mix-tree-inventory-row small {
  font-size: 0.68rem;
  line-height: 1.05;
}

.mix-tree-layout-visual .mix-tree-inventory-row .mix-tree-drop-badge {
  min-height: 1.15rem;
  padding-inline: 0.32rem;
  font-size: 0.62rem;
}

.mix-tree-node-card,
.mix-tree-svg-node-card,
.mix-tree-inventory-row,
.mix-tree-count-table tr {
  --mix-tree-type-accent: var(--blue);
  --mix-tree-type-accent-soft: color-mix(in srgb, var(--mix-tree-type-accent) 12%, transparent);
}

.mix-tree-node-type-dragon,
.mix-tree-svg-node-type-dragon {
  --mix-tree-type-accent: #d94b3d;
}

.mix-tree-node-type-devil,
.mix-tree-svg-node-type-devil {
  --mix-tree-type-accent: #c8506b;
}

.mix-tree-node-type-animal,
.mix-tree-svg-node-type-animal {
  --mix-tree-type-accent: #c07a35;
}

.mix-tree-node-type-bird,
.mix-tree-svg-node-type-bird {
  --mix-tree-type-accent: #4f9bd9;
}

.mix-tree-node-type-insect,
.mix-tree-svg-node-type-insect {
  --mix-tree-type-accent: #e36f32;
}

.mix-tree-node-type-plant,
.mix-tree-svg-node-type-plant {
  --mix-tree-type-accent: #4b9f57;
}

.mix-tree-node-type-mystery,
.mix-tree-svg-node-type-mystery {
  --mix-tree-type-accent: #d2a125;
}

.mix-tree-node-type-metal,
.mix-tree-svg-node-type-metal {
  --mix-tree-type-accent: #8a77b8;
}

.mix-tree-drop-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.35rem;
  padding: 0 0.42rem;
  border: 1px solid rgba(31, 122, 79, 0.35);
  border-radius: 999px;
  background: rgba(31, 122, 79, 0.12);
  color: var(--green);
  font-size: var(--mix-tree-node-chip-size, 0.68rem);
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.mix-tree-drop-badge.can-drop {
  border-color: color-mix(in srgb, var(--green) 45%, var(--line));
  background: color-mix(in srgb, var(--green) 13%, var(--surface));
  color: var(--green);
}

.mix-tree-node-card .species-badge {
  border-color: color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 36%, var(--line));
  background: color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 10%, var(--surface));
  color: color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 80%, var(--ink));
}

.mix-tree-inventory-row.is-droppable {
  border-color: color-mix(in srgb, var(--green) 34%, var(--line));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--green) 8%, transparent), transparent 64%),
    var(--surface);
}


/* D3 visual mix tree */
.mix-tree-layout-visual {
  grid-template-columns: minmax(0, 1fr);
}

.mix-tree-d3-viewer {
  position: relative;
  min-width: 0;
}

.mix-tree-d3-toolbar {
  z-index: 8;
}

.mix-tree-d3-scroll {
  position: relative;
  min-height: clamp(31rem, 68vh, 54rem);
  max-height: none;
  overflow: hidden;
  padding: 0;
  background:
    radial-gradient(circle, rgba(31, 122, 79, 0.16) 1px, transparent 1.4px) 0 0 / 24px 24px,
    linear-gradient(135deg, rgba(49, 95, 151, 0.06), rgba(177, 118, 31, 0.05)),
    #eef3f0;
  cursor: grab;
}

.mix-tree-d3-scroll:focus-visible {
  box-shadow: 0 0 0 3px var(--focus);
  outline: 0;
}

.mix-tree-svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
  touch-action: none;
}

.mix-tree-svg-link {
  fill: none;
  stroke: rgba(85, 96, 90, 0.52);
  stroke-linecap: round;
  stroke-width: 4;
}

.mix-tree-svg-node-card {
  box-sizing: border-box;
  --mix-tree-node-gap: 0.28rem;
  --mix-tree-node-padding: 0.5rem;
  --mix-tree-node-visual: 3.35rem;
  --mix-tree-node-title-size: 0.94rem;
  --mix-tree-node-meta-size: 0.68rem;
  --mix-tree-node-chip-size: 0.63rem;
  --mix-tree-node-action-size: 0.64rem;
  --mix-tree-node-action-height: 1.55rem;
  display: grid;
  position: relative;
  gap: var(--mix-tree-node-gap);
  width: 100%;
  height: 100%;
  min-width: 0;
  align-content: start;
  padding: var(--mix-tree-node-padding);
  border: 2px solid color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 38%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--mix-tree-type-accent-soft, rgba(49, 95, 151, 0.08)), transparent 58%),
    rgba(255, 255, 255, 0.94);
  box-shadow:
    inset 4px 0 0 color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 82%, transparent),
    0 12px 26px rgba(21, 25, 22, 0.13);
  cursor: pointer;
  isolation: isolate;
  overflow: hidden;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.mix-tree-svg-node-card:hover,
.mix-tree-svg-node-card:focus-visible {
  border-color: color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 68%, var(--line));
  box-shadow:
    inset 4px 0 0 color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 88%, transparent),
    0 16px 34px rgba(21, 25, 22, 0.18);
  outline: 0;
  transform: translateY(-1px);
}

.mix-tree-svg-node-card.is-selected {
  border-color: color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 76%, var(--line));
  box-shadow:
    inset 4px 0 0 color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 90%, transparent),
    0 0 0 4px color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 18%, transparent),
    0 16px 34px rgba(21, 25, 22, 0.18);
}

.mix-tree-svg-node-target {
  border-color: rgba(31, 122, 79, 0.62);
  background: linear-gradient(135deg, rgba(31, 122, 79, 0.16), rgba(255, 255, 255, 0.96));
}

.mix-tree-svg-node-base {
  border-color: rgba(177, 118, 31, 0.52);
  background: linear-gradient(135deg, rgba(177, 118, 31, 0.13), rgba(255, 255, 255, 0.96));
}

.mix-tree-svg-node-card.is-done,
.mix-tree-svg-node-card.is-owned {
  border-color: rgba(31, 122, 79, 0.7);
}

.mix-tree-svg-node-card.is-ready {
  border-color: rgba(49, 95, 151, 0.68);
}

.mix-tree-svg-node-card.is-blocked {
  border-color: rgba(184, 66, 53, 0.5);
}

.mix-tree-svg-node-card.is-droppable {
  box-shadow:
    inset 4px 0 0 color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 90%, transparent),
    inset 0 -3px 0 color-mix(in srgb, var(--green) 72%, transparent),
    0 12px 26px rgba(21, 25, 22, 0.13);
}

.mix-tree-svg-node-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: max(0.4rem, var(--mix-tree-node-gap));
  align-items: center;
  min-width: 0;
}

.mix-tree-svg-visual {
  --visual-size: var(--mix-tree-node-visual);
  width: calc(var(--visual-size) + 0.2rem);
  height: calc(var(--visual-size) + 0.2rem);
  border: 2px solid rgba(23, 32, 25, 0.18);
  border-radius: 999px;
  background: rgba(238, 243, 240, 0.9);
}

.mix-tree-svg-visual-missing {
  border-style: dashed;
  color: var(--muted);
  font-size: max(0.7rem, var(--mix-tree-node-chip-size));
  font-weight: 950;
}

.mix-tree-svg-node-title {
  display: grid;
  gap: 0.04rem;
  min-width: 0;
}

.mix-tree-svg-node-title strong,
.mix-tree-svg-node-title small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mix-tree-svg-node-title strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--ink);
  font-size: var(--mix-tree-node-title-size);
  font-weight: 950;
  line-height: 1.1;
  white-space: normal;
}

.mix-tree-svg-node-title small,
.mix-tree-svg-node-role {
  color: var(--muted);
  font-size: var(--mix-tree-node-meta-size);
  font-weight: 900;
}

.mix-tree-svg-node-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.22rem;
  min-width: 0;
}

.mix-tree-svg-node-detail span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 1.32rem;
  padding: 0 0.4rem;
  border: 1px solid rgba(49, 95, 151, 0.18);
  border-radius: 999px;
  background: rgba(49, 95, 151, 0.08);
  color: var(--blue);
  font-size: var(--mix-tree-node-chip-size);
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mix-tree-svg-node-detail span.is-done,
.mix-tree-svg-node-detail span.is-owned {
  border-color: rgba(31, 122, 79, 0.24);
  background: rgba(31, 122, 79, 0.1);
  color: var(--green);
}

.mix-tree-svg-node-detail span.is-ready {
  border-color: rgba(49, 95, 151, 0.28);
  background: rgba(49, 95, 151, 0.11);
  color: var(--blue);
}

.mix-tree-svg-node-detail span.is-blocked {
  border-color: rgba(184, 66, 53, 0.24);
  background: rgba(184, 66, 53, 0.08);
  color: var(--red);
}

.mix-tree-svg-node-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.28rem;
  min-width: 0;
}

.mix-tree-svg-node-footer .species-badge {
  max-width: 6.2rem;
  min-height: 1.45rem;
  padding-inline: 0.3rem;
  border-color: color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 36%, var(--line));
  background: color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 10%, var(--surface));
  color: color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 80%, var(--ink));
}

.mix-tree-svg-node-footer .species-badge .type-icon {
  width: 1.05rem;
  height: 1.05rem;
}

.mix-tree-svg-node-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(3.45rem, 1fr));
  gap: 0.24rem;
  min-width: 0;
}

.mix-tree-svg-node-actions button {
  min-width: 0;
  min-height: var(--mix-tree-node-action-height);
  padding: 0 0.32rem;
  font-size: var(--mix-tree-node-action-size);
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mix-tree-svg-formula-cycle {
  border-color: rgba(177, 118, 31, 0.36);
  background: rgba(177, 118, 31, 0.12);
  color: var(--amber);
}

.mix-tree-svg-node-focus,
.mix-tree-svg-node-toggle,
.mix-tree-svg-node-open {
  border-color: rgba(31, 122, 79, 0.28);
  background: rgba(31, 122, 79, 0.1);
  color: var(--green);
}

.mix-tree-svg-node-open {
  border-color: rgba(49, 95, 151, 0.3);
  background: rgba(49, 95, 151, 0.1);
  color: var(--blue);
}

.mix-tree-d3-empty {
  display: grid;
  min-height: 18rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 900;
}

.smart-mix-panel.is-tree-workbench .mix-tree-tool-workspace {
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem);
  align-items: start;
}

.smart-mix-panel.is-tree-workbench .mix-tree-stage {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.smart-mix-panel.is-tree-workbench .mix-tree-dashboard {
  grid-column: 2;
  grid-row: 1;
  max-height: calc(100vh - 12.5rem);
  overflow: auto;
}

.mix-tree-layout-tool.is-mix-tree-fullscreen .mix-tree-d3-scroll,
.mix-tree-layout-visual.is-mix-tree-fullscreen .mix-tree-d3-scroll {
  position: absolute;
  inset: 0;
  min-height: 0;
  height: 100%;
  border: 0;
  border-radius: 0;
}

.mix-tree-layout-tool.is-mix-tree-fullscreen .mix-tree-svg,
.mix-tree-layout-visual.is-mix-tree-fullscreen .mix-tree-svg {
  min-height: 100%;
}

:root[data-theme="dark"] .mix-tree-d3-scroll {
  background:
    radial-gradient(circle, rgba(87, 199, 133, 0.14) 1px, transparent 1.4px) 0 0 / 24px 24px,
    linear-gradient(135deg, rgba(125, 183, 255, 0.08), rgba(240, 195, 106, 0.08)),
    #151b22;
}

:root[data-theme="dark"] .mix-tree-svg-node-card {
  border-color: color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 42%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 16%, transparent), transparent 62%),
    rgba(23, 27, 34, 0.95);
  box-shadow:
    inset 4px 0 0 color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 86%, transparent),
    0 14px 30px rgba(0, 0, 0, 0.32);
}

:root[data-theme="dark"] .mix-tree-svg-node-target {
  border-color: rgba(87, 199, 133, 0.58);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--mix-tree-type-accent, var(--green)) 16%, transparent), transparent 62%),
    linear-gradient(135deg, rgba(87, 199, 133, 0.16), rgba(23, 27, 34, 0.96));
}

:root[data-theme="dark"] .mix-tree-svg-node-base {
  border-color: rgba(240, 195, 106, 0.5);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--mix-tree-type-accent, var(--amber)) 16%, transparent), transparent 62%),
    linear-gradient(135deg, rgba(240, 195, 106, 0.12), rgba(23, 27, 34, 0.96));
}

:root[data-theme="dark"] .mix-tree-svg-node-card.is-droppable {
  box-shadow:
    inset 4px 0 0 color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 90%, transparent),
    inset 0 -3px 0 color-mix(in srgb, var(--green) 76%, transparent),
    0 14px 30px rgba(0, 0, 0, 0.32);
}

:root[data-theme="dark"] .mix-tree-drop-badge.can-drop {
  border-color: color-mix(in srgb, var(--green) 58%, var(--line));
  background: color-mix(in srgb, var(--green) 18%, var(--surface));
  color: #aaf2c7;
}

:root[data-theme="dark"] .mix-tree-inventory-row {
  border-color: color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 34%, var(--line));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 12%, transparent), transparent 72%),
    var(--surface);
}

:root[data-theme="dark"] .mix-tree-inventory-row.is-droppable {
  border-color: color-mix(in srgb, var(--green) 42%, var(--line));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--green) 13%, transparent), transparent 72%),
    var(--surface);
}

@media (max-width: 820px) {
  .mix-tree-control-deck {
    grid-template-columns: 1fr;
  }

  .smart-mix-panel.is-tree-workbench .mix-tree-type-buttons,
  .smart-mix-panel.is-tree-workbench #mixTreeToolSummary {
    grid-column: 1;
  }

  .smart-mix-panel.is-tree-workbench .mix-tree-tool-workspace {
    grid-template-columns: 1fr;
  }

  .smart-mix-panel.is-tree-workbench .mix-tree-stage,
  .smart-mix-panel.is-tree-workbench .mix-tree-dashboard {
    grid-column: 1;
    grid-row: auto;
  }

  .smart-mix-panel.is-tree-workbench .mix-tree-dashboard {
    max-height: none;
  }

  .mix-tree-d3-scroll {
    min-height: 26rem;
  }

  .mix-tree-layout-tool .mix-tree-toolbar,
  .mix-tree-layout-tool .mix-tree-path {
    position: static;
    max-width: none;
    box-shadow: none;
  }
}

:root[data-theme="dark"] .nav-category-strip {
  border-color: rgba(69, 82, 102, 0.86);
  background: rgba(22, 28, 37, 0.98);
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"] .header-actions {
  border-color: rgba(69, 82, 102, 0.82);
  background: rgba(22, 28, 37, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 24px rgba(0, 0, 0, 0.22);
}

:root[data-theme="dark"] .support-link-button,
:root[data-theme="dark"] .language-toggle,
:root[data-theme="dark"] .member-status {
  border-color: rgba(69, 82, 102, 0.78);
  background: rgba(23, 29, 38, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"] .member-status[data-tier="admin"] {
  border-color: color-mix(in srgb, var(--amber) 32%, var(--line));
  background: color-mix(in srgb, var(--amber) 8%, var(--surface));
}

:root[data-theme="dark"] button:not(:disabled):hover,
:root[data-theme="dark"] .relation-link:hover,
:root[data-theme="dark"] .item-badge:hover {
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.26);
}

:root[data-theme="dark"] .mix-tree-scroll {
  background:
    radial-gradient(circle, rgba(87, 199, 133, 0.14) 1px, transparent 1.4px) 0 0 / 22px 22px,
    linear-gradient(135deg, rgba(125, 183, 255, 0.08), rgba(240, 195, 106, 0.08)),
    #11161d;
}

:root[data-theme="dark"] .mix-tree-layout-tool .mix-tree-scroll {
  background:
    radial-gradient(circle, rgba(87, 199, 133, 0.14) 1px, transparent 1.4px) 0 0 / 22px 22px,
    linear-gradient(135deg, rgba(125, 183, 255, 0.08), rgba(240, 195, 106, 0.08)),
    #151b22;
}

:root[data-theme="dark"] .mix-tree-layout-tool.is-mix-tree-fullscreen,
:root[data-theme="dark"] .mix-tree-layout-visual.is-mix-tree-fullscreen {
  background: #151b22;
}

:root[data-theme="dark"] .mix-tree-toolbar-group {
  border-color: rgba(69, 82, 102, 0.82);
  background: rgba(23, 27, 34, 0.78);
}

:root[data-theme="dark"] .mix-tree-count-wrap,
:root[data-theme="dark"] .mix-tree-count-table th,
:root[data-theme="dark"] .mix-tree-dashboard,
:root[data-theme="dark"] .mix-tree-step-row,
:root[data-theme="dark"] .mix-tree-search-field input,
:root[data-theme="dark"] .mix-tree-status-chip,
:root[data-theme="dark"] .mix-tree-search-result,
:root[data-theme="dark"] .mix-tree-formula-overview-card,
:root[data-theme="dark"] .mix-tree-layout-tool .mix-tree-toolbar,
:root[data-theme="dark"] .mix-tree-layout-tool .mix-tree-path,
:root[data-theme="dark"] .mix-tree-formula-float-panel {
  border-color: rgba(69, 82, 102, 0.86);
  background: rgba(23, 27, 34, 0.94);
}

:root[data-theme="dark"] .mix-tree-node-detail-panel {
  border-color: rgba(87, 199, 133, 0.32);
  background: rgba(87, 199, 133, 0.09);
}

:root[data-theme="dark"] .mix-tree-tool-drawer,
:root[data-theme="dark"] .mix-tree-formula-panel,
:root[data-theme="dark"] .mix-tree-inventory-panel {
  background: var(--surface-2);
}

:root[data-theme="dark"] .mix-tree-node-card {
  border-color: color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 38%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 16%, transparent), transparent 62%),
    rgba(23, 27, 34, 0.96);
  box-shadow:
    inset 4px 0 0 color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 84%, transparent),
    0 12px 28px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .mix-tree-node-card.is-selected {
  box-shadow:
    inset 4px 0 0 color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 88%, transparent),
    0 0 0 3px color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 24%, transparent),
    0 16px 32px rgba(0, 0, 0, 0.36);
}

:root[data-theme="dark"] .mix-tree-node-card.is-droppable {
  box-shadow:
    inset 4px 0 0 color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 88%, transparent),
    inset 0 -3px 0 color-mix(in srgb, var(--green) 76%, transparent),
    0 12px 28px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .mix-tree-node-target {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--mix-tree-type-accent, var(--green)) 16%, transparent), transparent 62%),
    linear-gradient(135deg, rgba(87, 199, 133, 0.18), rgba(23, 27, 34, 0.98));
}

:root[data-theme="dark"] .mix-tree-node-base {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--mix-tree-type-accent, var(--amber)) 16%, transparent), transparent 62%),
    linear-gradient(135deg, rgba(240, 195, 106, 0.14), rgba(23, 27, 34, 0.98));
}

:root[data-theme="dark"] .type-filter-button {
  border-color: color-mix(in srgb, var(--blue) 34%, var(--line));
  background: var(--surface-2);
  color: var(--ink);
}

:root[data-theme="dark"] .drop-status-button {
  background: var(--surface-2);
}

:root[data-theme="dark"] .type-filter-button.active {
  border-color: color-mix(in srgb, var(--green) 58%, var(--line));
  background: color-mix(in srgb, var(--green) 22%, var(--surface));
  color: #9bf0bd;
}

:root[data-theme="dark"] .drop-status-button[data-tone="can-drop"] {
  border-color: color-mix(in srgb, #57c785 48%, var(--line));
  background: color-mix(in srgb, #57c785 12%, var(--surface));
  color: #aaf2c7;
}

:root[data-theme="dark"] .drop-status-button[data-tone="no-drop"] {
  border-color: color-mix(in srgb, #ff7777 48%, var(--line));
  background: color-mix(in srgb, #ff7777 11%, var(--surface));
  color: #ffc0c0;
}

:root[data-theme="dark"] .drop-status-button[data-tone="has-data"] {
  border-color: color-mix(in srgb, #9bd7ff 42%, var(--line));
  background: color-mix(in srgb, #9bd7ff 10%, var(--surface));
  color: #d9efff;
}

:root[data-theme="dark"] .drop-status-button[data-tone="missing-data"] {
  border-color: color-mix(in srgb, var(--amber) 42%, var(--line));
  background: color-mix(in srgb, var(--amber) 11%, var(--surface));
  color: #ffe2a6;
}

:root[data-theme="dark"] .monster-record-tags span,
:root[data-theme="dark"] .species-badge {
  border-color: color-mix(in srgb, #9bd7ff 34%, var(--line));
  background: color-mix(in srgb, #9bd7ff 10%, var(--surface));
  color: #d9efff;
}

:root[data-theme="dark"] .tag-row span {
  background: var(--surface-2);
  color: #d0d9d3;
}

:root[data-theme="dark"] .monster-record-tags .special-tag {
  border-color: color-mix(in srgb, var(--amber) 38%, var(--line));
  background: color-mix(in srgb, var(--amber) 12%, var(--surface));
  color: #ffe2a6;
}

:root[data-theme="dark"] .monster-record-tags .player-report-tag,
:root[data-theme="dark"] .monster-badges .player-report-badge {
  border-color: color-mix(in srgb, var(--blue) 42%, var(--line));
  background: linear-gradient(135deg, color-mix(in srgb, var(--blue) 17%, var(--surface)), color-mix(in srgb, var(--green) 11%, var(--surface)));
  color: #d9efff;
}

:root[data-theme="dark"] .monster-record-tags .drop-status-tag.can-drop {
  border-color: color-mix(in srgb, #57c785 62%, var(--line));
  background: color-mix(in srgb, #57c785 18%, var(--surface));
  color: #aaf2c7;
}

:root[data-theme="dark"] .monster-record-tags .drop-status-tag.no-drop {
  border-color: color-mix(in srgb, #ff7777 62%, var(--line));
  background: color-mix(in srgb, #ff7777 16%, var(--surface));
  color: #ffc0c0;
}

:root[data-theme="dark"] .monster-record-tags .muted-tag {
  border-color: color-mix(in srgb, var(--muted) 28%, var(--line));
  background: color-mix(in srgb, var(--muted) 9%, var(--surface));
  color: #c6d0ca;
}

:root[data-theme="dark"] .mix-tree-node-card .species-badge,
:root[data-theme="dark"] .mix-tree-svg-node-footer .species-badge {
  border-color: color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 48%, var(--line));
  background: color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 16%, var(--surface));
  color: color-mix(in srgb, var(--mix-tree-type-accent, var(--blue)) 36%, var(--ink));
}

:root[data-theme="dark"] dialog {
  background: var(--surface);
  color: var(--ink);
}

:root[data-theme="dark"] dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

:root[data-theme="dark"] .dialog-shell {
  background:
    radial-gradient(circle at 12% 10%, color-mix(in srgb, var(--green) 9%, transparent) 0 18rem, transparent 30rem),
    linear-gradient(180deg, #101511, var(--surface) 42%, #0f1411);
  color: var(--ink);
}

:root[data-theme="dark"] .dialog-header {
  border-color: color-mix(in srgb, var(--green) 18%, var(--line));
}

:root[data-theme="dark"] .detail-item,
:root[data-theme="dark"] .database-detail-panel {
  border-color: color-mix(in srgb, var(--green) 18%, var(--line));
  background: color-mix(in srgb, var(--surface) 92%, #000);
}

:root[data-theme="dark"] .monster-profile {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--green) 9%, transparent), transparent 58%),
    color-mix(in srgb, var(--surface) 94%, #000);
}

:root[data-theme="dark"] .monster-portrait,
:root[data-theme="dark"] .detail-image-frame,
:root[data-theme="dark"] .detail-image-placeholder,
:root[data-theme="dark"] .monster-fact-table,
:root[data-theme="dark"] .monster-fact-cards > div,
:root[data-theme="dark"] .monster-record-facts > div {
  border-color: color-mix(in srgb, var(--green) 18%, var(--line));
  background: color-mix(in srgb, var(--surface-2) 74%, #000);
  color: var(--ink);
}

:root[data-theme="dark"] .database-detail-panel-header {
  border-bottom: 1px solid color-mix(in srgb, var(--green) 18%, var(--line));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--green) 22%, #121813), #161d18);
  color: var(--ink);
}

:root[data-theme="dark"] .database-detail-panel-header small {
  color: var(--muted);
}

:root[data-theme="dark"] .database-detail-panel-body,
:root[data-theme="dark"] .record-evidence-card {
  border-color: color-mix(in srgb, var(--blue) 20%, var(--line));
  background: color-mix(in srgb, var(--surface-2) 54%, var(--surface));
}

:root[data-theme="dark"] .record-player-report-note {
  border-color: color-mix(in srgb, var(--green) 34%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--green) 18%, transparent), color-mix(in srgb, var(--blue) 8%, transparent)),
    color-mix(in srgb, var(--surface) 86%, #000);
}

:root[data-theme="dark"] .record-player-report-note small {
  border-color: color-mix(in srgb, var(--green) 28%, var(--line));
  background: color-mix(in srgb, var(--green) 14%, var(--surface));
}

:root[data-theme="dark"] .record-evidence-item,
:root[data-theme="dark"] .detail-chip,
:root[data-theme="dark"] .monster-badges span {
  border-color: color-mix(in srgb, var(--blue) 28%, var(--line));
  background: color-mix(in srgb, var(--blue) 10%, var(--surface));
  color: #d9efff;
}

:root[data-theme="dark"] .record-evidence-item b,
:root[data-theme="dark"] .record-evidence-item a,
:root[data-theme="dark"] .detail-chip-stacked b {
  color: var(--ink);
}

:root[data-theme="dark"] .detail-chip.tone-amber,
:root[data-theme="dark"] .record-evidence-item.tone-warn {
  border-color: color-mix(in srgb, var(--amber) 36%, var(--line));
  background: color-mix(in srgb, var(--amber) 12%, var(--surface));
  color: #ffe2a6;
}

:root[data-theme="dark"] .record-evidence-item.tone-good {
  border-color: color-mix(in srgb, var(--green) 36%, var(--line));
  background: color-mix(in srgb, var(--green) 12%, var(--surface));
  color: #aaf2c7;
}

:root[data-theme="dark"] .record-evidence-item.tone-danger {
  border-color: color-mix(in srgb, var(--red) 36%, var(--line));
  background: color-mix(in srgb, var(--red) 11%, var(--surface));
  color: #ffc0c0;
}

:root[data-theme="dark"] #detailSourceLink.primary-button {
  border-color: color-mix(in srgb, var(--green) 44%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--green) 28%, #111813), color-mix(in srgb, var(--green) 16%, #0f1511));
  color: #ecfff4;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] #detailSourceLink.primary-button:hover,
:root[data-theme="dark"] #detailSourceLink.primary-button:focus-visible {
  border-color: color-mix(in srgb, var(--green) 64%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--green) 36%, #111813), color-mix(in srgb, var(--green) 20%, #0f1511));
}

:root[data-theme="dark"] .map-drop-monster-row,
:root[data-theme="dark"] .formula-row,
:root[data-theme="dark"] .monster-relation-row {
  background: var(--surface);
}

:root[data-theme="dark"] .formula-table-header,
:root[data-theme="dark"] .monster-relation-header {
  background: rgba(143, 186, 240, 0.12);
}

.mini-inventory {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.mini-inventory .relation-link {
  font-size: 0.78rem;
}

.mini-more {
  display: inline-flex;
  align-items: center;
  min-height: 1.95rem;
  padding: 0 0.45rem;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.relation-link:hover,
.relation-link:focus-visible {
  border-color: var(--green);
  background: rgba(31, 122, 79, 0.16);
}

.map-link {
  border-color: rgba(49, 95, 151, 0.28);
  background: rgba(49, 95, 151, 0.08);
  color: var(--blue);
}

.map-link:hover,
.map-link:focus-visible {
  border-color: var(--blue);
  background: rgba(49, 95, 151, 0.16);
}

.inline-link-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.25rem;
  min-width: 0;
  flex-wrap: wrap;
}

.relation-missing {
  display: inline-flex;
  max-width: 100%;
  color: var(--muted);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.monster-map-grid {
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
}

.media-card {
  display: grid;
  gap: 0.35rem;
  align-content: start;
  min-width: 0;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.media-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
}

.monster-map-grid .media-card img {
  aspect-ratio: 16 / 9;
}

.media-card strong {
  margin-top: 0;
  font-size: 0.85rem;
}

.drop-map-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.drop-map-group {
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.drop-map-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
  margin-bottom: 0.55rem;
}

.drop-map-title small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.drop-map-heading {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 0.65rem;
  align-items: center;
  min-width: 0;
}

.drop-map-heading:not(:has(img)) {
  grid-template-columns: minmax(0, 1fr);
}

.drop-map-heading img {
  width: 5.5rem;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.drop-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(18rem, 100%), 1fr));
  gap: 0.55rem;
}

.drop-row {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 0.55rem;
  align-items: center;
  min-height: 3.2rem;
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.drop-row-compact {
  grid-template-columns: minmax(0, 1fr);
}

.drop-row > div {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.drop-row img {
  width: 3rem;
  height: 3rem;
  object-fit: contain;
}

.drop-icon-placeholder {
  display: block;
  width: 3rem;
  height: 3rem;
  border: 1px dashed var(--line);
  border-radius: 7px;
  background: var(--surface-2);
}

.drop-row strong,
.drop-row small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.drop-row small {
  margin-top: 0.15rem;
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.map-egg-summary,
.map-detail-switcher {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
}

.map-egg-summary-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  min-width: 0;
}

.map-egg-summary-column {
  display: grid;
  align-content: start;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.map-egg-summary-column.is-can {
  border-color: color-mix(in srgb, var(--green) 34%, var(--line));
  background: color-mix(in srgb, var(--green) 7%, var(--surface));
}

.map-egg-summary-column.is-cannot {
  border-color: color-mix(in srgb, var(--red) 28%, var(--line));
  background: color-mix(in srgb, var(--red) 5%, var(--surface));
}

.map-egg-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
}

.map-egg-summary-head strong {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 950;
}

.map-egg-summary-head small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.map-egg-monster-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.36rem;
  min-width: 0;
}

.map-egg-monster-chips .relation-link {
  min-height: 1.8rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.76rem;
}

.map-egg-empty,
.map-empty-state {
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.map-empty-state {
  padding: 0.75rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.map-empty-state p {
  margin: 0;
}

.map-detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-width: 0;
}

.map-detail-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 2.25rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
}

.map-detail-tabs button b {
  min-width: 1.35rem;
  padding: 0.08rem 0.35rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 12%, transparent);
  color: var(--blue);
  font-size: 0.72rem;
  line-height: 1.3;
  text-align: center;
}

.map-detail-tabs button.active {
  border-color: color-mix(in srgb, var(--green) 36%, var(--line));
  background: color-mix(in srgb, var(--green) 10%, var(--surface));
  color: var(--green);
}

.map-detail-panels {
  min-width: 0;
}

.map-detail-panel[hidden] {
  display: none;
}

.map-drop-analysis {
  display: grid;
  gap: 0.75rem;
}

.map-type-advice {
  display: grid;
  gap: 0.75rem;
}

.map-type-advice-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(7rem, 18%) auto;
  gap: 0.75rem;
  align-items: center;
  min-width: 0;
  padding: 0.75rem;
  border: 1px solid color-mix(in srgb, var(--green) 24%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--green) 8%, var(--surface));
}

.map-type-advice-main {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.map-type-advice-main > span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 950;
}

.map-type-advice-main strong {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  color: var(--green);
  font-size: 1.08rem;
  font-weight: 950;
}

.map-type-advice-main .type-icon {
  width: 1.75rem;
  height: 1.75rem;
}

.map-type-advice-main small {
  min-width: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.map-type-advice-meter,
.map-type-card-meter {
  overflow: hidden;
  height: 0.55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 72%, transparent);
}

.map-type-advice-meter span,
.map-type-card-meter span {
  display: block;
  height: 100%;
  min-width: 0.35rem;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.map-type-advice-score {
  display: grid;
  justify-items: end;
  min-width: 4.5rem;
}

.map-type-advice-score b {
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1;
}

.map-type-advice-score small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.map-type-advice-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.55rem;
}

.map-type-advice-card {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid rgba(49, 95, 151, 0.2);
  border-radius: 8px;
  background: rgba(49, 95, 151, 0.06);
}

.map-type-advice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
}

.map-type-advice-head strong {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 0.92rem;
}

.map-type-advice-card p,
.map-type-advice-card > small {
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.map-type-monster-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  min-width: 0;
}

.map-type-monster-chips .relation-link {
  min-height: 1.75rem;
  padding: 0.18rem 0.45rem;
  font-size: 0.76rem;
}

.map-type-monster-more {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  padding: 0 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.map-type-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.45rem;
}

.map-type-breakdown-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.map-type-breakdown-row > span:not(.species-badge) {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.map-type-breakdown-row b {
  margin-left: auto;
  color: var(--ink);
  font-size: 0.78rem;
  white-space: nowrap;
}

.map-drop-monster-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(24rem, 100%), 1fr));
  gap: 0.6rem;
}

.map-drop-monster-row {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid rgba(31, 122, 79, 0.22);
  border-radius: 8px;
  background: var(--surface);
}

.map-drop-monster-row.is-missing-equipment {
  border-color: rgba(177, 118, 31, 0.42);
  background: rgba(177, 118, 31, 0.08);
}

.map-drop-monster-row.is-no-drop-data {
  border-color: rgba(177, 59, 59, 0.34);
  background: rgba(177, 59, 59, 0.07);
}

.map-drop-monster-row.is-display-only {
  border-style: dashed;
}

.map-drop-monster-row.is-no-drop-data .map-drop-status-list .status-drop {
  background: rgba(177, 59, 59, 0.12);
  color: var(--red);
}

.map-drop-monster-row.is-missing-equipment .map-drop-status-list .status-equipment {
  background: rgba(177, 118, 31, 0.14);
  color: var(--amber);
}

.map-drop-monster-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  min-width: 0;
}

.map-drop-monster-head > small {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
}

.map-drop-monster-list > .map-empty-state {
  grid-column: 1 / -1;
}

.map-spawn-counter-hint {
  display: grid;
  grid-template-columns: minmax(7.5rem, 1fr) auto minmax(7.5rem, 1fr);
  align-items: center;
  gap: 0.42rem;
  min-width: 0;
  padding: 0.42rem;
  border: 1px solid color-mix(in srgb, var(--green) 28%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--green) 14%, transparent), transparent 58%),
    color-mix(in srgb, var(--green) 7%, var(--surface));
}

.map-spawn-counter-action,
.map-spawn-counter-target {
  display: grid;
  justify-items: center;
  align-content: center;
  min-width: 0;
  min-height: 3.8rem;
  gap: 0.22rem;
  padding: 0.42rem 0.5rem;
  border: 1px solid color-mix(in srgb, var(--green) 18%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  text-align: center;
}

.map-spawn-counter-action {
  align-items: stretch;
}

.map-spawn-counter-action > span,
.map-spawn-counter-target > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1;
}

.map-spawn-counter-action > strong {
  min-width: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 950;
  line-height: 1.12;
}

.map-spawn-counter-action > small {
  min-width: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  line-height: 1.25;
}

.map-spawn-counter-badge {
  grid-row: 2 / span 2;
  grid-column: 2;
  align-self: center;
}

.map-spawn-counter-connector {
  display: inline-grid;
  place-items: center;
  min-width: 2.8rem;
  min-height: 1.8rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--green) 16%, var(--surface));
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 950;
}

.map-spawn-counter-badge > strong,
.map-spawn-counter-target > strong {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.map-spawn-counter-target {
  justify-items: center;
}

.map-spawn-counter-hint .species-badge {
  justify-content: center;
  min-width: 6.2rem;
  min-height: 2.05rem;
  padding: 0.2rem 0.55rem;
  background: color-mix(in srgb, var(--green) 9%, var(--surface));
}

.map-spawn-counter-hint .species-badge .type-icon {
  width: 1.42rem;
  height: 1.42rem;
}

.map-spawn-counter-hint.is-missing {
  border-color: color-mix(in srgb, var(--amber) 28%, var(--line));
  background: color-mix(in srgb, var(--amber) 8%, var(--surface));
}

.map-spawn-counter-hint.is-missing .map-spawn-counter-connector {
  color: var(--amber);
  background: color-mix(in srgb, var(--amber) 14%, var(--surface));
}

@media (max-width: 720px) {
  .map-spawn-counter-hint {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .map-spawn-counter-action {
    grid-template-columns: minmax(0, 1fr);
  }

  .map-spawn-counter-badge {
    grid-row: auto;
    grid-column: 1;
    justify-self: center;
  }

  .map-spawn-counter-connector {
    justify-self: center;
    min-width: auto;
  }
}

.map-drop-status-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  align-items: stretch;
}

.map-drop-status-list span {
  display: grid;
  align-content: center;
  gap: 0.08rem;
  min-width: 0;
  min-height: 2.6rem;
  padding: 0.32rem 0.42rem;
  border-radius: 7px;
  background: rgba(49, 95, 151, 0.1);
  color: var(--blue);
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
}

.map-drop-status-list b,
.map-drop-status-list small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-drop-status-list b {
  color: inherit;
  font-size: 0.78rem;
}

.map-drop-status-list small {
  color: var(--muted);
  font-size: 0.62rem;
}

.map-drop-status-list .status-warning {
  background: rgba(177, 118, 31, 0.14);
  color: var(--amber);
}

.map-drop-status-list .status-danger {
  background: rgba(177, 59, 59, 0.12);
  color: var(--red);
}

.map-drop-status-list .status-can-drop,
.map-drop-status-list .status-core:not(.status-danger) {
  background: rgba(31, 122, 79, 0.13);
  color: var(--green);
}

.map-drop-monster-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.map-drop-analysis-text {
  display: grid;
  grid-template-columns: minmax(5.5rem, max-content) minmax(0, 1fr);
  gap: 0.28rem 0.55rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.map-drop-analysis-text dt {
  color: var(--ink);
  font-weight: 900;
}

.map-drop-analysis-text dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.map-spawn-sprite-file {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  min-width: 0;
  padding: 0.48rem 0.58rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue-soft) 34%, var(--surface));
  font-size: 0.78rem;
}

.map-spawn-sprite-file > span {
  color: var(--muted);
  font-weight: 900;
}

.map-spawn-sprite-file > strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.map-spawn-sprite-file .local-sprite-copy-button {
  margin-inline-start: auto;
}

.map-drop-monster-head .relation-link .monster-visual-stack {
  width: 3.4rem;
  height: 3.4rem;
}

.map-drop-monster-head .relation-link .monster-visual-stack.has-effect {
  width: 3.4rem;
}

.map-drop-monster-head .relation-link .monster-visual-stack .monster-visual-base {
  width: 3.4rem;
  height: 3.4rem;
}

.map-drop-item-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}

.map-drop-item-list .map-drop-item {
  min-height: 2.05rem;
  max-width: min(100%, 13rem);
  padding: 0.14rem 0.42rem;
  font-size: 0.78rem;
}

.map-drop-item-list .map-drop-item img {
  width: 2.1rem;
  height: 2.1rem;
}

.map-drop-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.05rem;
  padding: 0.14rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.detail-more {
  margin: 0.6rem 0 0;
  color: var(--muted);
}

.dialog-actions {
  justify-content: flex-end;
  margin: 1rem 0 0;
  padding: 0;
}

.detail-share-status {
  display: inline-flex;
  align-items: center;
  min-height: 2.35rem;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
}

.detail-share-status.is-error {
  color: var(--red);
}

@media (max-width: 1180px) {
  .app-header {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 0.48rem 0.65rem;
  }

  .brand-area {
    grid-column: 1;
    grid-row: 1;
  }

  .header-actions {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .header-nav {
    display: contents;
  }

  .nav-shell {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-width: 100%;
    min-height: auto;
  }

  .nav-primary {
    flex-wrap: wrap;
    gap: 0.08rem 0.12rem;
    width: 100%;
    overflow: visible;
    scroll-padding-inline: 0;
    mask-image: none;
  }

  .top-nav .tab {
    flex: 1 1 7.2rem;
    min-width: min(7.2rem, 100%);
    min-height: 2.16rem;
    scroll-snap-align: start;
  }

  .nav-category-strip {
    width: min(42rem, calc(100vw - 1.5rem));
  }

  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    width: min(1500px, 100%);
  }

  .shortcut-rail {
    display: none;
  }

  .content-area {
    grid-column: 1;
  }

  .farm-map-hub-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .app-header {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto;
    gap: 0.45rem 0.65rem;
    align-items: center;
  }

  .brand-area {
    grid-column: 1;
    grid-row: 1;
  }

  .header-actions {
    grid-column: 2;
    grid-row: 1;
    gap: 0.35rem;
    min-width: 0;
  }

  .member-status {
    max-width: 15.5rem;
    min-height: 2.25rem;
  }

  .member-avatar {
    width: 1.65rem;
    height: 1.65rem;
  }

  .member-copy {
    max-width: 6.2rem;
  }

  .member-copy small {
    display: none;
  }

  .member-login-button,
  .member-login-link-button {
    min-height: 1.75rem;
    padding-inline: 0.45rem;
    font-size: 0.7rem;
  }

  .support-link-button {
    min-height: 2.35rem;
    padding-inline: 0.62rem;
  }

  .theme-toggle {
    width: 2.3rem;
    min-width: 2.3rem;
    min-height: 2.3rem;
    padding: 0;
  }

  .header-nav {
    display: contents;
  }

  .nav-shell {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: 100%;
    min-height: auto;
  }

  .nav-category-strip {
    width: min(42rem, calc(100vw - 1.5rem));
  }

  .shortcut-rail {
    grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
  }

  .market-entry-card,
  .market-display-card {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .market-entry-card .market-section-heading,
  .market-entry-card .market-sync-panel,
  .market-entry-card .market-form,
  .market-entry-card .market-form-message,
  .market-display-card .market-section-heading,
  .market-display-card .market-search,
  .market-display-card .market-list-toolbar {
    grid-column: 1;
  }

  .market-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .market-actions-compact {
    grid-column: 1 / -1;
  }

  .market-price-field .market-unit-help::after {
    right: 0;
    left: auto;
  }

  .market-display-card .market-list-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rail-search-panel {
    grid-column: auto;
  }

  .panel-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-guide-panel {
    grid-template-columns: 1fr;
  }

  .map-guide-heading,
  .map-guide-stats,
  .map-region-buttons,
  .map-feature-buttons {
    grid-column: 1;
  }

  .map-guide-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-guide-stats span {
    grid-template-columns: 1fr;
    gap: 0.05rem;
  }

  .map-region-buttons,
  .map-feature-buttons {
    grid-row: auto;
  }

  .smart-mix-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .smart-mix-hero,
  .smart-mix-command-panel,
  .mix-tree-tool-pane {
    grid-column: 1;
  }

  .search-control {
    grid-column: 1 / -1;
  }

  .toolbar-level-filter {
    grid-column: 1;
  }

  .sort-control {
    grid-column: 2;
  }

  .toolbar-action-group {
    grid-column: 1;
  }

  .type-filter-control,
  .drop-status-filter-control {
    grid-column: 1 / -1;
  }

  #smartMixPlannerPane,
  .smart-mix-controls,
  .smart-mix-workbench-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .smart-mix-controls,
  #smartMixSummary,
  #smartMixPlannerPane > .smart-mix-audit,
  #smartMixPlannerPane > .smart-mix-results,
  #smartMixPlannerPane > .farm-empty {
    grid-column: 1;
    grid-row: auto;
  }

  .smart-mix-next-work,
  .smart-mix-missing-panel,
  .smart-mix-step-timeline {
    grid-column: 1;
  }

  .smart-mix-workbench-head,
  .smart-mix-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .smart-mix-step-row {
    grid-template-columns: 4rem minmax(0, 1fr);
  }

  .smart-mix-step-materials,
  .smart-mix-step-state {
    grid-column: 1 / -1;
  }

  .detail-overview,
  .monster-profile {
    grid-template-columns: minmax(8rem, 11rem) minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .panel-toolbar {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 0.58rem;
    overflow: visible;
  }

  .panel-toolbar > * {
    min-width: 0;
  }

  .search-control,
  .toolbar-level-filter,
  .sort-control,
  .toolbar-action-group,
  .type-filter-control,
  .drop-status-filter-control,
  .mobile-filter-toggle {
    grid-column: 1 / -1;
  }

  .search-control {
    order: 1;
  }

  .type-filter-control {
    order: 2;
  }

  .mobile-filter-toggle {
    order: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.34rem;
    padding: 0.48rem 0.72rem;
    border: 1px solid color-mix(in srgb, var(--green) 28%, var(--line));
    border-radius: 8px;
    color: var(--green-strong);
    background: color-mix(in srgb, var(--green-soft) 58%, var(--surface));
    font-weight: 800;
  }

  .mobile-filter-toggle::after {
    content: "";
    width: 0.42rem;
    height: 0.42rem;
    margin-left: 0.42rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-0.1rem);
    transition: transform 0.16s ease;
  }

  .mobile-filter-toggle[aria-expanded="true"]::after {
    transform: rotate(225deg) translate(-0.04rem, -0.04rem);
  }

  .panel-toolbar.mobile-filters-applied .mobile-filter-toggle {
    border-color: color-mix(in srgb, var(--blue) 38%, var(--green));
    color: var(--blue-strong);
    background: color-mix(in srgb, var(--blue-soft) 66%, var(--surface));
  }

  .toolbar-level-filter,
  .sort-control,
  .toolbar-action-group,
  .drop-status-filter-control {
    display: none;
  }

  .panel-toolbar.mobile-filters-open .toolbar-level-filter,
  .panel-toolbar.mobile-filters-open .sort-control,
  .panel-toolbar.mobile-filters-open .toolbar-action-group,
  .panel-toolbar.mobile-filters-open .drop-status-filter-control:not([hidden]) {
    display: grid;
  }

  .toolbar-level-filter {
    order: 4;
  }

  .sort-control {
    order: 5;
  }

  .toolbar-action-group {
    order: 6;
  }

  .drop-status-filter-control {
    order: 7;
  }

  .toolbar-level-filter .level-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar-action-group {
    grid-template-columns: minmax(0, 1fr) auto;
    min-width: 0;
  }

  .type-filter-control,
  .drop-status-filter-control {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.42rem;
    overflow: hidden;
  }

  .type-filter-buttons,
  .drop-status-buttons {
    width: 100%;
    max-width: 100%;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.08rem 1.35rem 0.12rem 0.08rem;
    scroll-padding-inline: 0.05rem;
    -webkit-overflow-scrolling: touch;
  }

  .type-filter-button,
  .drop-status-button {
    flex: 0 0 auto;
  }
}

@media (max-width: 640px) {
  .recent-panel,
  .completeness-heading,
  .farm-planner-heading,
  .farm-section-heading,
  .panel-toolbar,
  .record-row {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .farm-section-heading button {
    width: 100%;
  }

  .daily-task-meta {
    grid-template-columns: minmax(7rem, auto) minmax(0, 1fr);
    align-items: center;
  }

  .daily-task-contributor {
    justify-self: start;
    max-width: 100%;
  }

  .daily-today-board {
    padding: 0.75rem;
  }

  .daily-today-board-head,
  .daily-today-card-head {
    align-items: stretch;
    flex-direction: column;
  }

  .daily-today-board-head small,
  .daily-today-check {
    justify-content: center;
    width: 100%;
  }

  .daily-today-card-title strong {
    white-space: normal;
  }

  .daily-today-requirements {
    grid-template-columns: 1fr;
  }

  .daily-panel-heading {
    align-items: stretch;
  }

  .daily-heading-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .daily-heading-actions button,
  .daily-action-status {
    width: 100%;
    max-width: none;
  }

  .app-header {
    position: sticky;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    gap: 0.38rem;
    min-height: 0;
    padding: 0.48rem 0.62rem 0.42rem;
  }

  .search-control,
  .toolbar-level-filter,
  .sort-control,
  .toolbar-action-group,
  .type-filter-control,
  .drop-status-filter-control {
    grid-column: 1 / -1;
  }

  .map-egg-summary-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .map-detail-tabs button {
    flex: 1 1 9rem;
    justify-content: center;
  }

  .map-region-section-title {
    align-items: stretch;
    flex-direction: column;
  }

  .map-region-section-title small {
    text-align: left;
  }

  .header-actions {
    position: absolute;
    top: 0.48rem;
    right: 0.62rem;
    display: flex;
    gap: 0.22rem;
    width: auto;
    min-height: 2.12rem;
    margin-left: 0;
    padding: 0.12rem;
  }

  .member-status {
    display: none;
  }

  .brand-area {
    min-height: 2.36rem;
    justify-content: space-between;
    flex-wrap: wrap;
    padding-right: 6rem;
  }

  .brand-logo {
    max-width: min(12.75rem, 52vw);
  }

  .brand-logo img {
    max-height: 2.18rem;
  }

  .brand-title {
    flex: 1 1 9rem;
  }

  .brand-title strong {
    font-size: clamp(0.92rem, 4vw, 1.05rem);
  }

  .theme-toggle {
    width: 2.08rem;
    min-width: 2.08rem;
    min-height: 2.08rem;
    padding: 0;
  }

  .support-link-button {
    width: 3rem;
    min-width: 3rem;
    min-height: 2.08rem;
    padding-inline: 0;
    overflow: hidden;
    font-size: 0;
  }

  .support-link-button::before {
    content: "站長";
    font-size: 0.76rem;
  }

  .nav-shell {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    margin-top: 0.04rem;
    overflow: visible;
  }

  .nav-primary {
    flex-wrap: wrap;
    gap: 0.08rem 0.1rem;
    width: 100%;
    overflow: visible;
    scroll-padding-inline: 0;
    scroll-snap-type: none;
    mask-image: none;
  }

  .top-nav .tab {
    flex: 1 1 calc(50% - 0.1rem);
    min-width: min(8rem, 100%);
    min-height: 2.08rem;
    padding-inline: 0.62rem;
    font-size: 0.84rem;
    scroll-snap-align: start;
  }

  .nav-primary .tab + .tab {
    box-shadow: none;
  }

  .nav-category-strip {
    left: 0.08rem;
    width: min(100%, calc(100vw - 1.25rem));
    max-height: min(55vh, 14rem);
    padding: 0.48rem;
  }

  .app-shell {
    padding-inline: 0.75rem;
  }

  .shortcut-rail {
    grid-template-columns: 1fr;
  }

  .database-panel,
  .completeness-panel,
  .farm-planner-panel,
  .market-panel,
  .mix-calculator-panel,
  .contribution-panel,
  .smart-mix-panel,
  .daily-panel,
  .about-support-panel {
    padding: 0.75rem;
  }

  .pagination-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination-controls {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .page-number-list {
    flex: 1 1 100%;
    order: 3;
    max-width: 100%;
  }

  .page-jump-control {
    flex: 1 1 8rem;
    justify-content: end;
  }

  .recent-panel {
    align-items: center;
    flex-direction: row;
    gap: 0.45rem;
    min-height: 3.45rem;
    padding: 0.45rem;
  }

  .recent-panel > div:first-child {
    flex-basis: 6.75rem;
  }

  .recent-panel strong {
    font-size: 0.84rem;
  }

  .recent-list {
    flex-wrap: nowrap;
    max-height: 2.55rem;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .recent-item {
    flex-basis: 10.75rem;
    min-height: 2.3rem;
  }

  .recent-thumb {
    width: 1.85rem;
    height: 1.85rem;
  }

  .completeness-score {
    text-align: left;
  }

  .completeness-bar {
    grid-template-columns: 3.2rem 3rem minmax(6rem, 1fr);
  }

  .completeness-bar small {
    grid-column: 3;
  }

  #resetFarmFilters,
  #clearPetRecommendations,
  #clearMarketForm,
  #clearMixCalculator,
  #refreshContributionStats,
  #clearSmartMix,
  #resetDailyProgress,
  .reset-filters {
    flex: 1 1 10rem;
  }

  .farm-controls,
  .farm-map-hub-controls,
  .pet-controls,
  .farm-results,
  .farm-map-hub-results,
  .farm-map-card,
  .farm-map-quick-card,
  .farm-map-stats,
  .farm-map-hub-stats,
  .map-type-advice-hero,
  .formula-row,
  .monster-relation-row,
  .correction-form,
  .market-entry-card,
  .market-form,
  .market-display-card,
  .market-price-stats,
  .market-price-head,
  .mix-calculator-layout,
  .mix-calculator-form,
  .mix-calculator-material-grid,
  .mix-calculator-result-grid,
  .contribution-dashboard,
  .daily-today-board-list,
  .mix-tree-tool-controls,
  .mix-tree-tool-workspace,
  .mix-tree-layout-tool,
  #smartMixPlannerPane,
  .smart-mix-controls,
  .smart-mix-stats,
  .smart-mix-card-head,
  .daily-form,
  .daily-task-row,
  .about-support-layout {
    grid-template-columns: 1fr;
  }

  .market-display-card .market-search,
  .market-display-card .market-section-heading,
  .market-display-card .market-list-toolbar,
  .market-entry-card .market-section-heading,
  .market-entry-card .market-sync-panel,
  .market-entry-card .market-form,
  .market-entry-card .market-form-message {
    grid-column: 1;
  }

  .market-display-card .market-list-toolbar {
    grid-template-columns: 1fr;
  }

  .market-price-list {
    grid-auto-rows: auto;
  }

  .market-price-card {
    height: auto;
  }

  .smart-mix-next-formula {
    grid-template-columns: 1fr;
  }

  .smart-mix-starter {
    grid-template-columns: 1fr;
  }

  .smart-mix-starter-actions {
    justify-content: flex-start;
    min-width: 0;
  }

  .smart-mix-audit {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .smart-mix-workbench {
    padding: 0.65rem;
  }

  .smart-mix-workbench-head,
  .smart-mix-panel-head,
  .smart-mix-overview-head,
  .smart-mix-group-head {
    align-items: stretch;
    flex-direction: column;
  }

  .smart-mix-workbench-layout,
  .smart-mix-step-row,
  .smart-mix-step-materials,
  .smart-mix-workbench-actions {
    grid-template-columns: 1fr;
  }

  .smart-mix-next-work,
  .smart-mix-missing-panel,
  .smart-mix-step-timeline {
    grid-column: 1;
  }

  .smart-mix-goal-top {
    grid-template-columns: 1fr;
  }

  .smart-mix-goal-visual {
    width: 100%;
    min-width: 0;
    height: 7rem;
  }

  .smart-mix-goal-identity strong,
  .smart-mix-next-work > strong {
    white-space: normal;
  }

  .smart-mix-workbench-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .smart-mix-step-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .smart-mix-route-source {
    justify-content: flex-start;
  }

  .map-type-advice-score {
    justify-items: start;
  }

  .smart-mix-material-row {
    grid-template-columns: minmax(8.5rem, 1.6fr) repeat(3, minmax(2.4rem, 0.4fr));
    gap: 0.25rem;
    padding: 0.35rem;
  }

  .smart-mix-material-row > span:not(:first-child) {
    font-size: 0.78rem;
  }

  .market-price-head,
  .smart-mix-card-head {
    display: grid;
    align-items: start;
  }

  .market-price-meta {
    justify-content: flex-start;
  }

  .result-command-bar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .active-filter-chips {
    justify-content: flex-start;
  }

  .result-command-summary strong,
  .result-command-summary small {
    white-space: normal;
  }

  .daily-task-title {
    min-width: 0;
  }

  .daily-task-body,
  .daily-task-compact-grid,
  .daily-task-reward-grid,
  .daily-form-card,
  .daily-reward-form {
    grid-template-columns: 1fr;
  }

  #clearRecent {
    width: auto;
    min-width: 3rem;
    padding-inline: 0.5rem;
  }

  .search-control,
  .sort-control,
  .filter-control,
  .level-filter-control,
  .page-size-control,
  .toolbar-action-group {
    width: 100%;
  }

  .toolbar-action-group {
    grid-column: auto;
  }

  .detail-overview,
  .detail-facts,
  .monster-profile,
  .monster-fact-table,
  .monster-extra-facts,
  .mix-tree-layout {
    grid-template-columns: 1fr;
  }

  .detail-facts {
    gap: 0.2rem;
  }

  .detail-facts dd {
    margin-bottom: 0.45rem;
  }

  .record-actions {
    top: 0.45rem;
    right: 0.45rem;
    gap: 0.25rem;
  }

  .favorite-button {
    width: 1.85rem;
    height: 1.85rem;
    min-height: 1.85rem;
  }

  .monster-record-row {
    grid-template-columns: 4.6rem minmax(0, 1fr);
    align-items: center;
    gap: 0.62rem;
    min-height: 5.25rem;
    padding: 0.58rem;
    padding-right: 2.55rem;
  }

  .record-list.monster-view-grid .monster-record-row {
    grid-template-columns: 4.6rem minmax(0, 1fr);
  }

  .record-list.monster-view-grid .monster-record-icon,
  .monster-record-icon {
    width: 4.6rem;
    height: 4.6rem;
  }

  .record-list.monster-view-grid .monster-record-icon img,
  .monster-record-icon img {
    max-width: 4.15rem;
    max-height: 4.15rem;
  }

  .monster-record-heading {
    align-items: start;
    flex-direction: row;
    gap: 0.45rem;
    padding-right: 0.1rem;
  }

  .monster-record-id {
    align-self: start;
    min-height: 1.45rem;
    padding: 0.18rem 0.42rem;
    font-size: 0.68rem;
  }

  .monster-record-main {
    gap: 0.34rem;
  }

  .monster-record-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.28rem;
  }

  .monster-record-facts span {
    padding: 0.26rem 0.38rem;
  }

  .monster-record-facts b {
    font-size: 0.78rem;
  }

  .monster-record-tags {
    gap: 0.28rem;
  }

  .monster-record-tags span {
    min-height: 1.55rem;
    padding: 0.12rem 0.42rem;
    font-size: 0.66rem;
  }

  .record-title {
    padding-right: 0.2rem;
  }

  .record-title h3 {
    font-size: 0.96rem;
    line-height: 1.22;
  }

  .mix-tree-node-card {
    width: 14.5rem;
  }

  .mix-tree-scroll {
    min-height: 22rem;
    max-height: 52vh;
    padding: 0.55rem;
  }

  .mix-tree-count-table {
    min-width: 31rem;
  }

  .mix-tree-dashboard {
    padding: 0.55rem;
  }

  .mix-tree-dashboard-head {
    align-items: stretch;
    flex-direction: column;
  }

  .mix-tree-navigator {
    grid-template-columns: 1fr;
  }

  .smart-mix-panel.is-tree-workbench .mix-tree-tool-controls,
  .smart-mix-panel.is-tree-workbench .mix-tree-navigator {
    grid-template-columns: 1fr;
  }

  .smart-mix-panel.is-tree-workbench .mix-tree-stage,
  .smart-mix-panel.is-tree-workbench .mix-tree-layout-tool .mix-tree-scroll {
    min-height: 22rem;
    max-height: 55vh;
  }

  .mix-tree-status-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mix-tree-dashboard-tabs button,
  .mix-tree-density-toggle button {
    flex: 1 1 auto;
    justify-content: center;
  }

  .mix-tree-dashboard-panel {
    max-height: none;
  }

  .smart-mix-panel.is-tree-workbench .mix-tree-dashboard-panel {
    max-height: none;
  }

  .mix-tree-step-row,
  .mix-tree-step-list.is-compact .mix-tree-step-row,
  .mix-tree-node-detail-body {
    grid-template-columns: 1fr;
  }

  .mix-tree-step-index {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    padding: 0.35rem 0.5rem;
  }

  .mix-tree-progress-toggle {
    flex: 0 0 auto;
  }

  .mix-tree-step-materials,
  .mix-tree-node-detail-recipe {
    grid-template-columns: 1fr;
  }

  .mix-tree-step-actions button {
    flex: 1 1 auto;
  }

  .mix-tree-node-detail-actions {
    justify-content: stretch;
  }

  .mix-tree-node-detail-actions button {
    flex: 1 1 auto;
  }

  .mix-tree-layout-tool .mix-tree-toolbar,
  .mix-tree-layout-tool .mix-tree-path {
    position: static;
    max-width: none;
    box-shadow: none;
  }

  .mix-tree-layout-tool .mix-tree-scroll {
    padding: 0.55rem;
  }

  .mix-tree-formula-float-panel {
    position: sticky;
    top: auto;
    bottom: 0.5rem;
    left: auto;
    width: 100%;
    max-height: 55vh;
    margin-top: 0.55rem;
  }

  .mix-tree-toolbar button {
    flex: 1 1 auto;
  }

  .mix-tree-children {
    gap: 0.75rem;
  }

  .mix-tree-children::before {
    left: 6rem;
    right: 6rem;
  }

  .formula-row {
    grid-template-columns: 1fr;
  }

  .formula-table-header {
    display: none;
  }

  .formula-row:not(.formula-table-header) .formula-ingredient > small,
  .formula-row:not(.formula-table-header) .formula-required > small {
    display: block;
  }

  .detail-button {
    width: 100%;
  }

  .monster-portrait {
    justify-self: stretch;
  }

  .monster-profile-title {
    align-items: stretch;
    flex-direction: column;
  }

  .detail-favorite-button {
    justify-self: stretch;
  }

  .monster-portrait img {
    max-height: 11rem;
  }

  .monster-visual-portrait {
    height: 10.5rem;
  }

  .monster-fact-table dt,
  .monster-extra-facts dt {
    border-bottom: 0;
    padding-bottom: 0.2rem;
  }

  .monster-fact-table dd,
  .monster-extra-facts dd {
    padding-top: 0.2rem;
  }

  .drop-map-title {
    align-items: stretch;
    flex-direction: column;
  }

  .drop-map-heading {
    grid-template-columns: 4.5rem minmax(0, 1fr);
  }

  .drop-map-heading img {
    width: 4.5rem;
  }

  .dialog-shell {
    height: 100%;
    max-height: none;
    padding: 0.75rem;
  }

  dialog {
    width: calc(100vw - 1rem);
    max-width: calc(100vw - 1rem);
    height: calc(100dvh - 1rem);
    max-height: calc(100dvh - 1rem);
  }

  .qr-dialog {
    height: auto;
  }

  .qr-dialog .dialog-shell {
    height: auto;
  }

  .dialog-header {
    gap: 0.5rem;
    margin: -0.75rem -0.75rem 0;
    padding: 0.72rem 0.75rem 0.62rem;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow: 0 10px 22px rgba(21, 25, 22, 0.06);
  }

  .dialog-header h2 {
    font-size: 1.15rem;
  }

  .admin-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-toolbar label {
    min-width: 0;
  }

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

  .admin-member-card {
    grid-template-columns: 1fr;
  }

  .admin-member-badges {
    justify-content: flex-start;
  }

  .detail-grid {
    gap: 0.8rem;
    margin-top: 0.72rem;
    padding: 0.1rem 0 0.85rem;
  }

  .detail-item {
    padding: 0.7rem;
  }

  .database-detail-panel-body {
    padding: 0.75rem;
  }

  .dialog-actions {
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.38rem;
    margin: 0 -0.75rem -0.75rem;
    padding: 0.55rem 0.75rem calc(0.55rem + env(safe-area-inset-bottom));
    overflow-x: auto;
    overflow-y: hidden;
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow: 0 -10px 24px rgba(21, 25, 22, 0.07);
    scrollbar-width: none;
  }

  .dialog-actions::-webkit-scrollbar {
    display: none;
  }

  .dialog-actions > * {
    flex: 0 0 auto;
  }

  .dialog-actions button,
  .dialog-actions .primary-button {
    min-height: 2.25rem;
    white-space: nowrap;
  }

  .detail-share-status {
    flex: 0 0 min(11rem, 60vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .media-grid,
  .drop-list,
  .relation-list-grid,
  .record-stats {
    grid-template-columns: 1fr;
  }

  .drop-row {
    grid-template-columns: 2.6rem minmax(0, 1fr);
  }

  .drop-row img,
  .drop-icon-placeholder {
    width: 2.6rem;
    height: 2.6rem;
  }

  .map-drop-analysis-text {
    grid-template-columns: 1fr;
  }

  .monster-link-card-line,
  .formula-ingredient-line,
  .mix-tree-node-titleline {
    gap: 0.3rem;
  }

  .record-icon {
    width: 100%;
  }

  .mix-tree-fullscreen-active .smart-mix-panel.is-tree-workbench .mix-tree-layout-tool.is-mix-tree-fullscreen .mix-tree-scroll {
    min-height: 0;
    max-height: none;
    height: 100%;
    padding: 4.85rem 0.55rem 3.35rem;
  }

  .mix-tree-layout-tool.is-mix-tree-fullscreen .mix-tree-toolbar {
    position: fixed;
    top: max(0.5rem, env(safe-area-inset-top));
    right: max(0.5rem, env(safe-area-inset-right));
    left: max(0.5rem, env(safe-area-inset-left));
    max-width: none;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: thin;
  }

  .mix-tree-layout-tool.is-mix-tree-fullscreen .mix-tree-toolbar-group {
    flex: 0 0 auto;
    flex-wrap: nowrap;
  }

  .mix-tree-layout-tool.is-mix-tree-fullscreen .mix-tree-focus-status {
    flex: 0 0 min(10rem, 55vw);
  }

  .mix-tree-layout-tool.is-mix-tree-fullscreen .mix-tree-path {
    position: fixed;
    right: max(0.5rem, env(safe-area-inset-right));
    left: max(0.5rem, env(safe-area-inset-left));
    max-width: none;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .smart-mix-panel.is-mix-tree-fullscreen .mix-tree-dashboard {
    top: 4.85rem;
    right: max(0.5rem, env(safe-area-inset-right));
    left: max(0.5rem, env(safe-area-inset-left));
    width: auto;
    max-height: min(40vh, calc(100dvh - 9rem));
  }
}

@media (max-width: 420px) {
  .app-header {
    padding: 0.75rem;
  }

  .rail-panel:first-child {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 1.25rem;
  }

  .record-row {
    gap: 0.65rem;
    padding: 0.65rem;
  }

  .dialog-actions {
    display: flex;
  }

  .dialog-actions > * {
    width: auto;
  }

  .scroll-top {
    width: 2.5rem;
    height: 2.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

/* 2026-07-13 reference-inspired layout refinement
   Layered cards and a persistent desktop filter workspace, while preserving
   the site's original green visual identity and light/dark color tokens. */
:root {
  --shadow-card: 0 1px 2px rgba(21, 25, 22, 0.05), 0 4px 12px rgba(21, 25, 22, 0.07);
  --shadow-card-hover: 0 2px 4px rgba(21, 25, 22, 0.06), 0 10px 24px rgba(21, 25, 22, 0.11);
}

:root[data-theme="dark"] {
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.22), 0 4px 12px rgba(0, 0, 0, 0.16);
  --shadow-card-hover: 0 2px 4px rgba(0, 0, 0, 0.24), 0 10px 24px rgba(0, 0, 0, 0.26);
}

body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app-header {
  min-height: 4.25rem;
  padding-block: 0.72rem;
  border-bottom-color: color-mix(in srgb, var(--line) 68%, transparent);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--surface) 65%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
}

.brand-home {
  border-radius: 12px;
}

.brand-title strong {
  font-family: Bahnschrift, "Segoe UI Semibold", "Microsoft JhengHei", sans-serif;
  font-size: 1.04rem;
  letter-spacing: 0.012em;
}

.header-actions {
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  box-shadow: var(--shadow-card);
}

.app-shell {
  grid-template-columns: minmax(13.5rem, 15rem) minmax(0, 1fr);
  gap: 1.15rem;
  padding-top: 1.2rem;
}

.shortcut-rail {
  top: 5.65rem;
  gap: 0.72rem;
}

.rail-panel,
.database-panel,
.recent-panel,
.completeness-panel,
.farm-planner-panel,
.type-advantage-panel,
.premium-gate-panel,
.record-row {
  border-color: color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.rail-panel {
  gap: 0.52rem;
  padding: 0.82rem;
}

.rail-panel:hover,
.rail-panel:focus-within {
  border-color: color-mix(in srgb, var(--green) 36%, var(--line));
  background: var(--surface);
  box-shadow: var(--shadow-card-hover);
}

.rail-eyebrow,
.section-title,
.eyebrow {
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.rail-search-field input,
.panel-toolbar input,
.panel-toolbar select {
  border-color: transparent;
  border-radius: 9px;
  background: var(--surface-2);
}

.rail-search-field input:focus,
.panel-toolbar input:focus,
.panel-toolbar select:focus {
  border-color: var(--green);
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 12%, transparent);
}

.database-panel {
  padding: 1rem;
}

.map-guide-panel,
.result-command-bar,
.pagination-bar {
  border-radius: 12px;
}

.map-guide-panel {
  margin-bottom: 0.85rem;
  padding: 0.75rem 0.82rem;
  border-color: color-mix(in srgb, var(--green) 24%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--green) 9%, transparent), transparent 55%),
    var(--surface);
}

.panel-toolbar {
  gap: 0.58rem;
  margin-bottom: 0.72rem;
  padding: 0.72rem;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow-card);
}

.type-filter-button,
.drop-status-button,
.map-region-button,
.map-feature-button,
.active-filter-chip,
.active-filter-empty {
  border-radius: 999px;
}

.type-filter-button,
.drop-status-button {
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.type-filter-button:hover,
.drop-status-button:hover {
  color: var(--ink);
  transform: translateY(-1px);
}

.result-command-bar {
  border-color: color-mix(in srgb, var(--line) 78%, transparent);
}

.record-list {
  gap: 0.48rem;
}

.record-row {
  border-color: transparent;
  border-radius: 14px;
  box-shadow: var(--shadow-card);
}

.record-row:hover,
.record-row:focus-within {
  border-color: color-mix(in srgb, var(--green) 46%, var(--line));
  box-shadow: var(--shadow-card-hover);
}

.monster-record-id,
.record-stats span,
.monster-record-facts > * {
  border-radius: 9px;
}

dialog,
.dialog-shell {
  border-radius: 20px;
}

@media (min-width: 821px) {
  .database-panel > .panel-toolbar {
    position: sticky;
    top: 5.25rem;
    z-index: 6;
    backdrop-filter: blur(14px) saturate(1.15);
  }
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: minmax(12rem, 13.5rem) minmax(0, 1fr);
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .shortcut-rail {
    position: static;
  }

  .content-area {
    grid-column: 1;
  }
}

@media (max-width: 720px) {
  .app-header {
    min-height: auto;
    padding-block: 0.55rem;
  }

  .app-shell {
    gap: 0.75rem;
    padding: 0.75rem 0.65rem 1.5rem;
  }

  .database-panel {
    padding: 0.62rem;
  }

  .panel-toolbar {
    padding: 0.58rem;
    border-radius: 12px;
  }

  .record-row {
    border-radius: 12px;
  }
}

/* 2026-07-14 mobile-first navigation, progressive loading and accessible cards */
.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 1000;
  padding: 0.65rem 0.85rem;
  border-radius: 9px;
  background: var(--ink);
  color: var(--surface);
  font-weight: 900;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.mobile-header-controls {
  display: none;
}

.record-row {
  position: relative;
}

.record-open-button {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: transparent;
  cursor: pointer;
  box-shadow: none;
}

.record-open-button:hover {
  background: transparent;
  box-shadow: none;
}

.record-row:has(.record-open-button:focus-visible) {
  border-color: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent), var(--shadow-card-hover);
}

.record-actions {
  z-index: 2;
}

.data-loading-state {
  display: grid;
  gap: 0.75rem;
  padding: 0.75rem 0;
}

.data-loading-state[hidden] {
  display: none !important;
}

.data-loading-label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.data-loading-state.is-error {
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
}

.record-skeleton-list {
  display: grid;
  gap: 0.55rem;
}

.record-skeleton {
  min-height: 5.8rem;
  border-radius: 13px;
  background: linear-gradient(100deg, var(--surface-2) 30%, color-mix(in srgb, var(--green) 10%, var(--surface)) 50%, var(--surface-2) 70%);
  background-size: 240% 100%;
  animation: data-skeleton-shimmer 1.25s ease-in-out infinite;
}

.data-retry-button,
.mix-tree-d3-load-state button {
  justify-self: start;
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 10%, var(--surface));
  color: var(--green-dark);
  font-weight: 900;
}

@keyframes data-skeleton-shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

.mobile-nav-dialog,
.global-search-dialog {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}

.mobile-nav-dialog::backdrop,
.global-search-dialog::backdrop {
  background: rgba(12, 18, 16, 0.48);
  backdrop-filter: blur(4px);
}

.mobile-dialog-shell,
.global-search-dialog-shell {
  background: var(--surface);
  color: var(--ink);
}

.mobile-dialog-header,
.global-search-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.mobile-dialog-header h2,
.global-search-dialog-header h2 {
  margin: 0.15rem 0 0;
  font-size: 1.15rem;
}

.mobile-dialog-close {
  flex: 0 0 auto;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  border-radius: 999px;
  font-size: 1.4rem;
}

.mobile-nav-dialog {
  width: min(25rem, 92vw);
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0 0 0 auto;
}

.mobile-dialog-shell {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  max-height: 100dvh;
  overflow-y: auto;
  box-shadow: -18px 0 54px rgba(0, 0, 0, 0.18);
}

.mobile-nav-list,
.mobile-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.mobile-nav-list,
.mobile-category-list,
.mobile-nav-actions {
  padding: 0.85rem 1rem;
}

.mobile-category-list {
  display: grid;
  gap: 0.65rem;
  border-top: 1px solid var(--line);
}

.mobile-nav-actions {
  display: grid;
  gap: 0.55rem;
  margin-top: auto;
  border-top: 1px solid var(--line);
}

.mobile-nav-item {
  min-height: 2.85rem;
  padding: 0.6rem 0.75rem;
  border-color: var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 850;
  text-align: left;
}

.mobile-nav-item.active {
  border-color: color-mix(in srgb, var(--green) 65%, var(--line));
  background: color-mix(in srgb, var(--green) 13%, var(--surface));
  color: var(--green-dark);
}

.global-search-dialog {
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
}

.global-search-dialog-shell {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  width: min(100%, 70rem);
  height: 100%;
  margin: 0 auto;
}

.global-search-dialog-field {
  position: relative;
  display: block;
  padding: 1rem 1rem 0;
}

.global-search-dialog-field input {
  width: 100%;
  min-height: 3.35rem;
  padding: 0.75rem 5rem 0.75rem 1rem;
  border: 1px solid color-mix(in srgb, var(--green) 40%, var(--line));
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 1.05rem;
}

.global-search-dialog-field input:focus {
  border-color: var(--green);
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 16%, transparent);
  outline: none;
}

.global-search-dialog-field kbd {
  position: absolute;
  top: 1.75rem;
  right: 1.75rem;
  padding: 0.18rem 0.42rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.76rem;
}

.global-search-dialog-status {
  min-height: 1.5rem;
  margin: 0;
  padding: 0.55rem 1rem;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.global-search-dialog-results {
  overflow-y: auto;
  padding: 0 1rem 2rem;
  overscroll-behavior: contain;
}

.global-search-result-group {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.global-search-result-group h3 {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0;
  padding: 0.45rem 0;
  background: var(--surface);
  font-size: 0.84rem;
  color: var(--muted);
}

.global-search-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr));
  gap: 0.5rem;
}

.global-search-dialog .global-search-card {
  min-height: 4rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
}

.global-search-dialog .global-search-card.is-keyboard-active,
.global-search-dialog .global-search-card:focus-visible {
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 10%, var(--surface));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 14%, transparent);
  outline: none;
}

.global-search-dialog-empty {
  margin: 2rem auto;
  color: var(--muted);
  text-align: center;
}

.dialog-scroll-locked {
  overflow: hidden;
}

.mix-tree-d3-load-state {
  display: grid;
  place-items: center;
  gap: 0.75rem;
  min-height: 12rem;
  padding: 1rem;
  border: 1px dashed color-mix(in srgb, var(--green) 45%, var(--line));
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--muted);
  text-align: center;
}

.mix-tree-d3-load-state p {
  margin: 0;
}

@media (max-width: 720px) {
  .app-header {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 1fr;
    gap: 0.45rem;
    box-sizing: border-box;
    width: 100%;
    height: 4.25rem;
    min-height: 4.25rem;
    max-height: 4.25rem;
    padding: 0.45rem 0.65rem;
  }

  .brand-area {
    grid-column: 1;
    min-width: 0;
  }

  .brand-home {
    gap: 0.45rem;
    min-height: 2.8rem;
    padding: 0.1rem;
  }

  .brand-logo,
  .brand-logo img {
    width: 2.5rem;
    height: 2.5rem;
  }

  .brand-title strong {
    font-size: clamp(0.88rem, 4vw, 1rem);
    white-space: nowrap;
  }

  .header-nav {
    display: block;
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .top-nav,
  .header-actions {
    display: none !important;
  }

  .mobile-header-controls {
    display: flex;
    align-items: center;
    gap: 0.32rem;
  }

  .mobile-current-view {
    display: inline-block;
    max-width: 6rem;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-header-button {
    display: inline-grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    min-height: 2.75rem;
    padding: 0;
    border-color: color-mix(in srgb, var(--green) 28%, var(--line));
    border-radius: 999px;
    background: var(--surface);
    color: var(--green-dark);
    font-size: 1.2rem;
  }

  .shortcut-rail {
    display: none;
  }

  .content-area {
    min-width: 0;
  }

  .record-skeleton {
    min-height: 6.6rem;
  }

  .global-search-dialog-field kbd {
    display: none;
  }

  .global-search-dialog-field input {
    padding-right: 1rem;
  }

  .global-search-result-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .mobile-current-view {
    display: none;
  }
}

/* Official ID-based synthesis planner */
.official-mix-planner,
.official-mix-planner-content {
  min-width: 0;
}

.official-mix-planner-content {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.smart-mix-results.has-official-mix-planner {
  display: block;
}

.official-mix-hero {
  display: grid;
  grid-template-columns: auto minmax(12rem, 1fr) minmax(18rem, auto);
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--green) 32%, var(--line));
  border-radius: 1rem;
  background: linear-gradient(135deg, color-mix(in srgb, var(--green) 10%, var(--surface)), var(--surface));
  box-shadow: var(--shadow);
}

.official-mix-hero h2,
.official-mix-hero p {
  margin: 0;
}

.official-mix-hero h2 {
  margin-top: 0.15rem;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
}

.official-mix-hero p,
.official-mix-hero small {
  color: var(--muted);
}

.official-mix-hero-visual {
  width: 5rem;
  height: 5rem;
}

.official-mix-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.official-mix-controls label {
  display: grid;
  gap: 0.2rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.official-mix-controls select,
.official-mix-controls input,
.official-mix-controls button {
  min-height: 2.5rem;
}

.official-mix-controls input {
  width: 5rem;
}

.official-mix-attempt-note,
.official-mix-warning,
.official-mix-error {
  margin: 0;
  padding: 0.75rem 0.9rem;
  border-left: 0.22rem solid var(--amber);
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--amber) 9%, var(--surface));
  color: var(--muted);
  font-size: 0.86rem;
}

.official-mix-error {
  border-left-color: var(--red);
  background: color-mix(in srgb, var(--red) 9%, var(--surface));
  color: var(--red);
}

.official-mix-cost-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.official-mix-cost-grid > .official-mix-attempt-note {
  grid-column: 1 / -1;
}

.official-mix-cost-grid article {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: var(--surface);
}

.official-mix-cost-grid strong {
  overflow-wrap: anywhere;
  color: var(--green);
  font-size: clamp(1rem, 1.7vw, 1.35rem);
}

.official-mix-cost-grid small,
.official-mix-cost-grid span {
  color: var(--muted);
  font-size: 0.78rem;
}

.official-mix-warnings {
  padding: 0.75rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--amber) 35%, var(--line));
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--amber) 7%, var(--surface));
}

.official-mix-warnings summary {
  cursor: pointer;
  font-weight: 850;
}

.official-mix-warnings ul {
  max-height: 16rem;
  margin-bottom: 0;
  overflow: auto;
  color: var(--muted);
  font-size: 0.8rem;
}

.official-mix-candidates,
.official-mix-route-tree,
.official-mix-progress,
.official-mix-resources {
  min-width: 0;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--surface);
}

.official-mix-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.official-mix-section-head small {
  color: var(--muted);
  text-align: right;
}

.official-mix-candidate-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.55rem;
}

.official-mix-candidate-list > button {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
  padding: 0.75rem;
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--ink);
  text-align: left;
}

.official-mix-candidate-list > button.is-active {
  border-color: var(--green);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--green) 18%, transparent);
}

.official-mix-candidate-list span,
.official-mix-candidate-list small {
  color: var(--muted);
  font-size: 0.76rem;
}

.official-mix-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(18rem, 0.8fr);
  align-items: start;
  gap: 1rem;
}

.official-mix-route-tree {
  max-height: min(70vh, 52rem);
  overflow: auto;
}

.official-mix-node-wrap {
  min-width: 0;
}

.official-mix-node {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(12rem, auto);
  align-items: center;
  gap: 0.65rem;
  margin: 0.35rem 0 0.35rem min(calc(var(--mix-depth, 0) * 0.85rem), 7rem);
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-left: 0.22rem solid var(--blue);
  border-radius: 0.7rem;
  background: var(--surface-2);
}

.official-mix-node.is-drop-only,
.official-mix-node.is-drop-or-mix {
  border-left-color: var(--green);
}

.official-mix-node.is-unresolved,
.official-mix-node.is-special-hunting,
.official-mix-node.is-unresolved-acquisition,
.official-mix-node.is-cycle,
.official-mix-node.is-overflow,
.official-mix-node.is-depth-overflow {
  border-left-color: var(--amber);
}

.official-mix-node-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 0.55rem;
}

.official-mix-node-identity > div {
  display: grid;
  min-width: 0;
}

.official-mix-node-identity strong,
.official-mix-node-identity small {
  overflow-wrap: anywhere;
}

.official-mix-node-identity small {
  color: var(--muted);
  font-size: 0.72rem;
}

.official-mix-node-visual {
  flex: 0 0 auto;
  width: 2.6rem;
  height: 2.6rem;
}

.official-mix-node-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.official-mix-node-actions select {
  max-width: min(28rem, 42vw);
  min-height: 2.1rem;
}

.official-mix-node-actions button,
.official-mix-node-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 2.1rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.74rem;
}

.official-mix-node-warning {
  display: block;
  margin: -0.15rem 0 0.35rem min(calc(var(--mix-depth, 0) * 0.85rem + 0.7rem), 7.7rem);
  color: var(--amber);
  font-size: 0.72rem;
}

.official-mix-progress-bar {
  height: 0.48rem;
  margin-bottom: 0.75rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.official-mix-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.official-mix-missing-pets {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
  padding: 0.7rem;
  border: 1px solid color-mix(in srgb, var(--green) 34%, var(--line));
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--green) 6%, var(--surface-2));
}

.official-mix-missing-pets-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.official-mix-missing-pets-head > div {
  display: grid;
  gap: 0.15rem;
}

.official-mix-missing-pets-head small {
  color: var(--muted);
  font-size: 0.72rem;
}

.official-mix-missing-pets-copy {
  flex: 0 0 auto;
  min-height: 2rem;
  padding: 0.35rem 0.65rem;
}

.official-mix-missing-pets-list {
  max-height: 10.5rem;
  margin: 0;
  padding: 0.6rem 0.7rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: var(--surface);
  color: var(--ink);
  font: 700 0.76rem/1.55 var(--font-family, inherit);
  white-space: pre-wrap;
  user-select: text;
}

.official-mix-missing-pets-list:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.official-mix-step-list {
  display: grid;
  gap: 0.45rem;
  max-height: min(64vh, 46rem);
  overflow: auto;
}

.official-mix-step-list article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--surface-2);
}

.official-mix-step-list article.is-complete {
  border-color: color-mix(in srgb, var(--green) 40%, var(--line));
  opacity: 0.76;
}

.official-mix-step-list small {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.72rem;
}

.official-mix-step-counter {
  display: grid;
  grid-template-columns: auto 3.8rem auto;
  align-items: center;
  gap: 0.2rem;
}

.official-mix-step-counter input {
  width: 3.8rem;
  min-height: 2rem;
  text-align: center;
}

.official-mix-step-counter button {
  min-width: 2rem;
  min-height: 2rem;
  padding: 0.2rem;
}

.official-mix-step-counter small {
  grid-column: 1 / -1;
  text-align: center;
}

.official-mix-step-lead {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  min-width: 4.25rem;
}

.official-mix-step-completion,
.official-mix-tree-completion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 900;
  user-select: none;
}

.official-mix-step-completion input,
.official-mix-tree-completion input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  accent-color: var(--green);
  cursor: pointer;
}

.official-mix-resource-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.official-mix-resource-filters button {
  min-height: 2.15rem;
  padding: 0.35rem 0.65rem;
}

.official-mix-resource-filters button.is-active {
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 12%, var(--surface));
  color: var(--green);
}

.official-mix-resource-table-wrap {
  overflow: auto;
}

.official-mix-material-note {
  margin: 0.65rem 0;
  padding: 0.65rem 0.75rem;
  border-left: 3px solid var(--green);
  border-radius: 0.35rem;
  background: color-mix(in srgb, var(--green) 8%, var(--surface));
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

.official-mix-resource-gap-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0.7rem 0;
}

.official-mix-resource-gap-card {
  display: grid;
  align-content: start;
  gap: 0.28rem;
  min-width: 0;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: var(--surface-2);
}

.official-mix-resource-gap-card > small,
.official-mix-resource-gap-card > span {
  color: var(--muted);
  font-size: 0.72rem;
}

.official-mix-resource-gap-card > strong {
  color: var(--green);
  font-size: clamp(1.15rem, 2vw, 1.55rem);
}

.official-mix-resource-gap-card.is-item > strong {
  color: var(--amber);
}

.official-mix-resource-gap-bar {
  height: 0.4rem;
  margin-top: 0.2rem;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 72%, transparent);
}

.official-mix-resource-gap-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.official-mix-resources table {
  width: 100%;
  min-width: 52rem;
  border-collapse: collapse;
}

.official-mix-resources th,
.official-mix-resources td {
  padding: 0.55rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.official-mix-resources th {
  color: var(--muted);
  font-size: 0.72rem;
}

.official-mix-resources td:first-child,
.official-mix-resources td:nth-child(4) {
  display: grid;
  gap: 0.15rem;
}

.official-mix-resources td small {
  color: var(--muted);
  font-size: 0.7rem;
}

.official-mix-resources input {
  width: 8rem;
  min-height: 2.15rem;
}

.official-mix-quantity-cell {
  display: grid;
  gap: 0.5rem;
}

.official-mix-material-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.official-mix-material-counts > span {
  display: inline-flex;
  align-items: baseline;
  gap: 0.28rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: var(--surface-2);
  white-space: nowrap;
}

.official-mix-material-counts > span.is-missing {
  border-color: color-mix(in srgb, var(--red) 32%, var(--line));
  color: var(--red);
}

.official-mix-material-counts small {
  color: inherit;
}

.official-mix-owned-field {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.official-mix-owned-field > small {
  white-space: nowrap;
}

.official-mix-quantity-cell input {
  width: 5rem;
}

@media (max-width: 980px) {
  .official-mix-hero {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .official-mix-controls {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .official-mix-main-grid,
  .official-mix-cost-grid {
    grid-template-columns: 1fr;
  }

  .official-mix-route-tree,
  .official-mix-step-list {
    max-height: none;
  }
}

@media (max-width: 620px) {
  .smart-mix-query-bar {
    grid-template-columns: minmax(0, 1fr);
  }

  .smart-mix-query-bar button {
    width: 100%;
  }

  .official-mix-hero {
    grid-template-columns: 1fr;
  }

  .official-mix-hero-visual {
    width: 4rem;
    height: 4rem;
  }

  .official-mix-controls,
  .official-mix-controls label,
  .official-mix-controls select,
  .official-mix-controls input,
  .official-mix-controls button {
    width: 100%;
  }

  .official-mix-node {
    grid-template-columns: 1fr;
    margin-left: min(calc(var(--mix-depth, 0) * 0.4rem), 2.4rem);
  }

  .official-mix-node-actions {
    justify-content: flex-start;
  }

  .official-mix-node-actions select {
    width: 100%;
    max-width: 100%;
  }

  .official-mix-section-head {
    display: grid;
  }

  .official-mix-section-head small {
    text-align: left;
  }

  .official-mix-step-list article {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .official-mix-step-counter {
    grid-column: 1 / -1;
    justify-content: end;
  }
}

/* Picture-first synthesis route UI */
.official-mix-formula-pictures {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
}

.official-mix-picture-equation {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0.45rem;
  min-width: 0;
}

.official-mix-ingredient-card {
  display: grid;
  align-content: start;
  justify-items: stretch;
  gap: 0.35rem;
  width: 12.5rem;
  min-width: 0;
  padding: 0.45rem;
  border: 1px solid color-mix(in srgb, var(--green) 26%, var(--line));
  border-radius: 0.8rem;
  background: color-mix(in srgb, var(--green) 5%, var(--surface));
}

.official-mix-ingredient-card.is-compact {
  width: 9.6rem;
  padding: 0.3rem 0.2rem;
}

.official-mix-ingredient-role {
  justify-self: start;
  color: var(--blue);
  font-size: 0.62rem;
  font-weight: 900;
}

.official-mix-ingredient-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  gap: 0.25rem;
  width: 100%;
  min-width: 0;
}

.official-mix-ingredient-pair-operator {
  display: grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--amber) 12%, var(--surface-2));
  color: var(--amber);
  font-size: 0.8rem;
  font-weight: 950;
}

.official-mix-ingredient-card .official-mix-entity-picture > small {
  min-height: 1.5em;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.official-mix-ingredient-item {
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  width: 100%;
  min-width: 0;
}

.official-mix-ingredient-item.is-none {
  grid-column: 2 / 4;
  min-height: 2.5rem;
  place-items: center;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  text-align: center;
}

.official-mix-ingredient-item-picture .official-mix-entity-media {
  border-color: color-mix(in srgb, var(--amber) 42%, var(--line));
  background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--amber) 16%, var(--surface)), var(--surface-2));
}

.official-mix-formula-extra-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.4rem;
  border: 1px dashed color-mix(in srgb, var(--amber) 45%, var(--line));
  border-radius: 0.65rem;
  background: color-mix(in srgb, var(--amber) 8%, var(--surface-2));
}

.official-mix-formula-extra-item > small {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 900;
}

.official-mix-entity-picture {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  width: 5.2rem;
  min-width: 0;
  color: var(--ink);
  text-align: center;
}

.official-mix-entity-picture > small {
  width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.official-mix-entity-media {
  position: relative;
  display: grid;
  place-items: center;
  width: 4.7rem;
  height: 4.7rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--green) 24%, var(--line));
  border-radius: 0.9rem;
  background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--green) 13%, var(--surface)), var(--surface-2));
}

.official-mix-entity-media > img,
.official-mix-entity-media .monster-visual-stack,
.official-mix-entity-media .monster-visual-stack.has-effect,
.official-mix-entity-media .monster-visual-base {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.official-mix-entity-media > img,
.official-mix-entity-media .monster-visual-base {
  image-rendering: auto;
}

.official-mix-entity-media.is-placeholder {
  color: var(--muted);
  font-weight: 900;
}

.official-mix-picture-quantity {
  position: absolute;
  right: 0.18rem;
  bottom: 0.18rem;
  z-index: 3;
  min-width: 1.65rem;
  padding: 0.12rem 0.3rem;
  border: 1px solid color-mix(in srgb, var(--green) 42%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  color: var(--green);
  font-size: 0.67rem;
  line-height: 1.2;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.official-mix-entity-picture.is-compact {
  width: 3.55rem;
}

.official-mix-entity-picture.is-compact .official-mix-entity-media {
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 0.7rem;
}

.official-mix-entity-picture.is-compact > small {
  font-size: 0.62rem;
}

.official-mix-picture-operator {
  display: grid;
  flex: 0 0 auto;
  align-self: center;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--green);
  font-size: 1.15rem;
  font-weight: 950;
}

.official-mix-picture-operator.is-arrow {
  color: var(--blue);
}

.official-mix-formula-pictures.is-compact .official-mix-picture-operator {
  width: 1.35rem;
  height: 1.35rem;
  font-size: 0.9rem;
}

.official-mix-candidate-list > button .official-mix-formula-pictures {
  width: 100%;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
}

.official-mix-node-picture-formula {
  grid-column: 1 / -1;
  padding-top: 0.35rem;
  border-top: 1px dashed var(--line);
}

.official-mix-resource-identity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.official-mix-resource-identity > span:last-child {
  display: grid;
  min-width: 0;
}

.official-mix-step-list article {
  grid-template-columns: auto 3.35rem minmax(0, 1fr) auto;
  content-visibility: auto;
  contain-intrinsic-size: auto 7rem;
}

.official-mix-step-list article > div:nth-child(3) {
  display: grid;
  min-width: 0;
}

.official-mix-step-target-picture {
  align-self: start;
}

.official-mix-step-list .official-mix-formula-pictures {
  margin-top: 0.35rem;
}

.official-mix-step-list .official-mix-picture-equation {
  justify-content: flex-start;
}

.mix-workspace-material-row {
  grid-template-columns: 3.35rem minmax(7rem, 1fr) minmax(9rem, 1.4fr) auto 5rem auto;
}

.mix-workspace-material-picture {
  align-self: center;
}

@media (max-width: 700px) {
  .official-mix-resources table {
    min-width: 0;
  }

  .official-mix-resources thead {
    display: none;
  }

  .official-mix-resources tbody {
    display: grid;
    gap: 0.65rem;
  }

  .official-mix-resources tr {
    display: grid;
    padding: 0.35rem;
    border: 1px solid var(--line);
    border-radius: 0.7rem;
    background: var(--surface-2);
  }

  .official-mix-resources td,
  .official-mix-resources td:first-child,
  .official-mix-resources td:nth-child(4) {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    gap: 0.5rem;
    align-items: center;
    padding: 0.45rem;
    border-bottom: 1px solid var(--line);
  }

  .official-mix-resources td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 900;
  }

  .official-mix-resources td:last-child {
    border-bottom: 0;
  }

  .official-mix-resources td:only-child {
    grid-template-columns: minmax(0, 1fr);
  }

  .mix-workspace-material-row {
    grid-template-columns: 3.2rem minmax(0, 1fr) auto 4.5rem auto;
  }

  .mix-workspace-material-picture {
    grid-column: 1;
    grid-row: 2 / 4;
  }

  .mix-workspace-material-picture + span {
    grid-column: 2 / -1;
    grid-row: 2;
  }

  .mix-workspace-material-row small {
    grid-column: 2 / -1;
    grid-row: 3;
  }

  .mix-workspace-material-row button:first-of-type {
    grid-column: 3;
    grid-row: 4;
  }

  .mix-workspace-material-row input {
    grid-column: 4;
    grid-row: 4;
  }

  .mix-workspace-material-row button:last-of-type {
    grid-column: 5;
    grid-row: 4;
  }
}

@media (max-width: 620px) {
  .official-mix-picture-equation {
    gap: 0.25rem;
  }

  .official-mix-ingredient-card.is-compact {
    width: min(10rem, 100%);
  }

  .official-mix-step-list .official-mix-picture-equation,
  .official-mix-candidate-list .official-mix-picture-equation {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
  }

  .official-mix-step-list .official-mix-ingredient-card,
  .official-mix-candidate-list .official-mix-ingredient-card {
    width: 100%;
  }

  .official-mix-entity-picture {
    width: min(4.2rem, 22vw);
  }

  .official-mix-entity-media {
    width: min(3.8rem, 20vw);
    height: min(3.8rem, 20vw);
  }

  .official-mix-step-list article {
    grid-template-columns: auto 3.2rem minmax(0, 1fr);
  }

  .official-mix-step-counter {
    grid-column: 1 / -1;
  }

  .official-mix-step-list .official-mix-formula-pictures {
    grid-column: 1 / -1;
  }
}

/* Picture synthesis tree */
.official-mix-picture-tree-layout {
  grid-template-columns: minmax(0, 1fr);
}

.official-mix-route-tree.is-picture-tree {
  max-height: none;
  overflow: visible;
  padding: 1rem;
}

.official-mix-tree-head {
  align-items: center;
}

.official-mix-tree-heading {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.official-mix-tree-heading > strong {
  font-size: 1.05rem;
}

.official-mix-tree-heading > small {
  color: var(--muted);
  font-size: 0.75rem;
  text-align: left;
}

.official-mix-tree-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.official-mix-tree-controls button {
  min-width: 2.15rem;
  min-height: 2.15rem;
  padding: 0.35rem 0.6rem;
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.75rem;
}

.official-mix-tree-controls button:hover,
.official-mix-tree-controls button:focus-visible {
  border-color: var(--green);
}

.official-mix-tree-zoom {
  min-width: 3.4rem;
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 900;
  text-align: center;
}

.official-mix-tree-hint {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.official-mix-tree-stage {
  position: relative;
  min-height: 30rem;
  max-height: min(74vh, 58rem);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--blue) 26%, var(--line));
  border-radius: 0.85rem;
  background:
    linear-gradient(color-mix(in srgb, var(--blue) 7%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--blue) 7%, transparent) 1px, transparent 1px),
    color-mix(in srgb, var(--surface-2) 86%, transparent);
  background-size: 2rem 2rem;
  scrollbar-gutter: stable both-edges;
  touch-action: pan-x pan-y;
}

.official-mix-tree-stage[data-drag-scroll="true"] {
  cursor: grab;
}

.official-mix-tree-stage.dragging,
.official-mix-tree-stage.dragging * {
  cursor: grabbing !important;
  user-select: none;
}

.official-mix-tree-stage img {
  -webkit-user-drag: none;
}

.official-mix-tree-stage:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.official-mix-tree-canvas {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: max-content;
  min-width: 100%;
  min-height: 100%;
  padding: 1.4rem 2rem 3rem;
  transform-origin: top center;
}

.official-mix-tree-branch {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.official-mix-tree-branch-label {
  position: relative;
  z-index: 2;
  margin-bottom: 0.25rem;
  padding: 0.14rem 0.42rem;
  border: 1px solid color-mix(in srgb, var(--blue) 34%, var(--line));
  border-radius: 999px;
  background: var(--surface);
  color: var(--blue);
  font-size: 0.64rem;
  font-weight: 900;
}

.official-mix-tree-card.official-mix-node {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: stretch;
  width: 22.5rem;
  margin: 0;
  padding: 0.7rem;
  border: 1px solid color-mix(in srgb, var(--blue) 42%, var(--line));
  border-top: 0.24rem solid var(--blue);
  border-left-width: 1px;
  border-radius: 0.85rem;
  background: color-mix(in srgb, var(--surface) 94%, var(--blue));
  box-shadow: 0 0.45rem 1.25rem rgb(0 0 0 / 0.16);
}

.official-mix-tree-card.is-drop-only,
.official-mix-tree-card.is-drop-or-mix {
  border-color: color-mix(in srgb, var(--green) 42%, var(--line));
  border-top-color: var(--green);
}

.official-mix-tree-card.is-unresolved,
.official-mix-tree-card.is-special-hunting,
.official-mix-tree-card.is-unresolved-acquisition,
.official-mix-tree-card.is-cycle,
.official-mix-tree-card.is-overflow,
.official-mix-tree-card.is-depth-overflow {
  border-color: color-mix(in srgb, var(--amber) 44%, var(--line));
  border-top-color: var(--amber);
}

.official-mix-tree-card .official-mix-node-identity {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  text-align: center;
}

.official-mix-tree-card .official-mix-node-identity > div {
  justify-items: center;
}

.official-mix-tree-card .official-mix-node-identity strong {
  font-size: 0.84rem;
  line-height: 1.2;
}

.official-mix-tree-node-picture {
  width: 5rem;
}

.official-mix-tree-node-picture .official-mix-entity-media {
  width: 4.65rem;
  height: 4.65rem;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--green) 18%, var(--surface)), var(--surface-2));
}

.official-mix-tree-status {
  justify-self: center;
  padding: 0.18rem 0.48rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 12%, var(--surface-2));
  color: var(--blue);
  font-size: 0.64rem;
  font-weight: 900;
  text-align: center;
}

.official-mix-tree-card.is-drop-only .official-mix-tree-status,
.official-mix-tree-card.is-drop-or-mix .official-mix-tree-status {
  background: color-mix(in srgb, var(--green) 12%, var(--surface-2));
  color: var(--green);
}

.official-mix-tree-completion {
  justify-self: stretch;
  min-height: 2rem;
  padding: 0.3rem 0.45rem;
  border: 1px solid color-mix(in srgb, var(--green) 35%, var(--line));
  border-radius: 0.55rem;
  background: color-mix(in srgb, var(--green) 8%, var(--surface-2));
  color: var(--ink);
}

.official-mix-tree-card.is-complete {
  border-color: color-mix(in srgb, var(--green) 62%, var(--line));
  border-top-color: var(--green);
  background: color-mix(in srgb, var(--green) 9%, var(--surface));
}

.official-mix-tree-formula-preview {
  gap: 0.15rem;
  padding-top: 0.4rem;
  border-top: 1px dashed var(--line);
}

.official-mix-tree-formula-preview .official-mix-picture-equation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  justify-items: center;
}

.official-mix-tree-formula-preview .official-mix-ingredient-card {
  width: 100%;
}

.official-mix-tree-formula-preview .official-mix-entity-picture {
  width: 3.1rem;
}

.official-mix-tree-formula-preview .official-mix-entity-media {
  width: 2.85rem;
  height: 2.85rem;
}

.official-mix-tree-card .official-mix-node-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.3rem;
  width: 100%;
  padding-top: 0.4rem;
  border-top: 1px solid var(--line);
}

.official-mix-tree-card .official-mix-node-actions select,
.official-mix-tree-card .official-mix-node-actions button,
.official-mix-tree-card .official-mix-node-actions a {
  width: 100%;
  max-width: 100%;
  min-height: 1.95rem;
  justify-content: center;
  overflow: hidden;
  font-size: 0.67rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.official-mix-tree-card .official-mix-node-warning {
  margin: 0;
  padding-top: 0.35rem;
  border-top: 1px dashed color-mix(in srgb, var(--amber) 45%, var(--line));
  text-align: center;
}

.official-mix-node-children {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 1.4rem;
  padding-top: 2.15rem;
}

.official-mix-node-children::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  height: 1.08rem;
  border-left: 2px solid color-mix(in srgb, var(--blue) 58%, var(--line));
}

.official-mix-node-children > .official-mix-tree-branch::before {
  content: "";
  position: absolute;
  top: -1.08rem;
  left: 50%;
  height: 1.08rem;
  border-left: 2px solid color-mix(in srgb, var(--blue) 58%, var(--line));
}

.official-mix-node-children > .official-mix-tree-branch::after {
  content: "";
  position: absolute;
  top: -1.08rem;
  width: calc(50% + 0.7rem);
  border-top: 2px solid color-mix(in srgb, var(--blue) 58%, var(--line));
}

.official-mix-node-children > .official-mix-tree-branch:first-child::after {
  left: 50%;
}

.official-mix-node-children > .official-mix-tree-branch:last-child::after {
  right: 50%;
}

.official-mix-node-children > .official-mix-tree-branch:only-child::after {
  display: none;
}

@media (max-width: 700px) {
  .official-mix-route-tree.is-picture-tree {
    padding: 0.7rem;
  }

  .official-mix-tree-head {
    display: grid;
    align-items: start;
  }

  .official-mix-tree-controls {
    justify-content: flex-start;
  }

  .official-mix-tree-controls button {
    min-height: 2rem;
    padding: 0.3rem 0.48rem;
  }

  .official-mix-tree-stage {
    min-height: 32rem;
    max-height: 72vh;
  }

  .official-mix-tree-canvas {
    padding: 1rem 1rem 2.5rem;
  }

  .official-mix-tree-card.official-mix-node {
    width: 21rem;
    margin: 0;
  }

  .official-mix-node-children {
    gap: 0.8rem;
  }

  .official-mix-node-children > .official-mix-tree-branch::after {
    width: calc(50% + 0.4rem);
  }
}
