* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Noto Sans', 'Noto Sans JP', 'Noto Sans KR', 'Noto Sans SC', 'Noto Sans TC', system-ui, sans-serif;
  color: #1a1a1a;
  background: #f5f5f5;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: #1a1a1a;
  color: #fff;
}

.site-header .brand {
  font-weight: 700;
  letter-spacing: 0.05em;
}

.site-header nav {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.site-header button {
  background: none;
  border: 1px solid #fff;
  color: #fff;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
}

main {
  max-width: 48rem;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

form p {
  display: grid;
  gap: 0.25rem;
}

.settings-section {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  background: #fff;
}

.settings-section legend {
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0 0.4rem;
}

.settings-section .field {
  display: grid;
  gap: 0.2rem;
  margin-top: 0.5rem;
}

.fx-rate-block {
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
}

.fx-rate-block:last-child {
  border-bottom: none;
}

.fx-rate-block strong {
  display: inline-block;
  min-width: 3rem;
}

.fx-rate-block .field {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.25rem;
}

input[type="radio"] {
  width: auto;
  margin-right: 0.25rem;
}

input,
select {
  padding: 0.4rem;
  border: 1px solid #bbb;
  border-radius: 4px;
}

button[type="submit"] {
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.error {
  color: #b00020;
}

input.field-error {
  border: 2px solid #b00020;
  background: #fbeaea;
  color: #8b0000;
}

.error-text {
  color: #b00020;
  margin: 0.25rem 0 0;
}

.choice-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
  cursor: pointer;
}

main.wide {
  max-width: 80rem;
}

.deck-layout {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  max-width: 80rem;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.deck-layout main {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.deck-sidebar {
  flex: 0 0 13rem;
  position: sticky;
  top: 1rem;
  font-size: 0.9rem;
}

.deck-sidebar h2 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
}

.deck-nav {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.deck-nav li + li {
  margin-top: 0.15rem;
}

.deck-nav a {
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  color: #1a1a1a;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deck-nav a:hover {
  background: #f0f0f0;
}

.deck-nav li.current a {
  background: #e6ecf5;
  font-weight: 600;
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-card .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

.stat-card .stat-sub {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.25rem;
}

.ops-tile.state-ok {
  border-left: 5px solid #1a7f37;
}

.ops-tile.state-warn {
  border-left: 5px solid #e08a00;
  background: #fffaf0;
}

.ops-tile.state-crit {
  border-left: 5px solid #b00020;
  background: #fff5f6;
}

.ops-tile.state-unknown {
  border-left: 5px solid #bbb;
}

.ops-age {
  float: right;
  color: #888;
}

.ops-tabs {
  display: flex;
  gap: 0.4rem;
  margin: 0.75rem 0 1rem;
}

.ops-tab {
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  border: 1px solid #ccc;
  font-size: 0.9rem;
  text-decoration: none;
}

.ops-tab-active {
  background: #24292f;
  color: #fff;
  border-color: #24292f;
}

.ops-tab-soon {
  opacity: 0.45;
  cursor: default;
}

.ops-banner {
  border: 1px solid #b00020;
  border-radius: 8px;
  margin-bottom: 1rem;
  overflow: hidden;
}

.ops-banner-row {
  padding: 0.55rem 0.9rem;
  font-size: 0.95rem;
}

.ops-banner-row.sev-crit {
  background: #fff5f6;
}

.ops-banner-row.sev-warn {
  background: #fffaf0;
}

.ops-maintenance {
  border-color: #7a4d00;
  background: #fff7e6;
}

.ops-banner-row.sev-maintenance {
  background: #fff7e6;
  font-size: 1rem;
  font-weight: 600;
}

.ops-banner-detail {
  display: block;
  color: #666;
  font-size: 0.85rem;
}

.ops-feed {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
}

.ops-feed li {
  padding: 0.3rem 0;
  border-bottom: 1px dashed #eee;
}

.ops-feed li.sev-succeeded::before {
  content: "●";
  color: #1a7f37;
  margin-right: 0.5rem;
}

.ops-feed li.sev-failed::before {
  content: "●";
  color: #b00020;
  margin-right: 0.5rem;
}

.ops-feed li.sev-started::before {
  content: "●";
  color: #888;
  margin-right: 0.5rem;
}

.ops-feed li.sev-warn::before {
  content: "●";
  color: #e08a00;
  margin-right: 0.5rem;
}

.ops-feed-ts {
  display: inline-block;
  min-width: 11ch;
  color: #666;
}

.ops-feed-what {
  font-weight: 600;
  margin-right: 0.4rem;
}

.ops-feed-msg {
  color: #666;
}

.alerts-feed {
  list-style: none;
  padding: 0;
  margin: 0;
}

.alert-row {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid #eee;
}

.alert-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  margin-top: 0.3rem;
  flex: none;
}

.alert-row.sev-crit .alert-dot {
  background: #b00020;
}

.alert-row.sev-warn .alert-dot {
  background: #e08a00;
}

.alert-row.recovered .alert-dot {
  background: #1a7f37;
}

.alert-row.sev-crit {
  background: #fff5f6;
}

.alert-row.sev-warn {
  background: #fffaf0;
}

.alert-head {
  font-size: 0.95rem;
}

.alert-msg {
  font-size: 0.85rem;
  color: #555;
  font-family: monospace;
}

.alert-recover {
  color: #1a7f37;
}

.trend-up {
  color: #1a7f37;
}

.trend-down {
  color: #b00020;
}

.trend-flat {
  color: #666;
}

table.ops-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
}

.ops-table th,
.ops-table td {
  text-align: left;
  padding: 0.45rem 0.8rem;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
}

.ops-table th {
  background: #f0f0f0;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: #444;
}

.ops-section {
  margin-bottom: 1.5rem;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  margin: 0.75rem 0;
}

.pager a.current {
  font-weight: 700;
  text-decoration: none;
}

.pager .inline-form {
  margin-left: 0.5rem;
}

.set-icon {
  height: 1.2em;
  vertical-align: middle;
}

.ops-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.ops-badge-daily {
  background: #e3f0ff;
  color: #1a5fb4;
}

.ops-badge-digest {
  background: #eee;
  color: #555;
}

.import-task {
  margin-bottom: 2.5rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border, #ddd);
}

.import-task > .ops-section:first-child {
  margin-bottom: 1rem;
}

.ops-section h2 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.issue-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.issue-list li {
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  padding: 0.3rem 0.5rem;
  border-left: 3px solid transparent;
  overflow-wrap: anywhere;
}

.issue-list li.issue-error {
  border-left-color: #b00020;
  background: #fdf0f0;
}

.issue-list li.issue-warning {
  border-left-color: #b26a00;
  background: #fdf6e8;
}

.report-body {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1.25rem;
  overflow-x: auto;
}

.report-body table {
  border-collapse: collapse;
  margin: 0.75rem 0;
}

.report-body th,
.report-body td {
  border: 1px solid #ddd;
  padding: 0.3rem 0.6rem;
  font-size: 0.85rem;
}

.report-body code {
  background: #f0f0f0;
  padding: 0 0.25rem;
  border-radius: 3px;
  font-size: 0.85em;
}

.report-body pre {
  background: #f8f8f8;
  border: 1px solid #eee;
  padding: 0.75rem;
  overflow-x: auto;
}

.site-header nav a {
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
}

.site-header nav a:hover {
  text-decoration: underline;
}

.site-header nav a.nav-guest {
  color: #666;
  cursor: default;
}

.site-header nav a.nav-guest:hover {
  text-decoration: none;
  color: #999;
}

.tier-select {
  border: none;
  padding: 0;
  margin: 1.5rem 0;
}

.tier-select legend {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}

.tier-options {
  display: flex;
  gap: 1rem;
}

.tier-option {
  flex: 1;
  cursor: pointer;
}

.tier-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tier-card {
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 1.25rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tier-option input[type="radio"]:checked + .tier-card {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px #2563eb;
}

.tier-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.tier-card ul {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  color: #444;
}

.tier-card li {
  margin: 0.2rem 0;
}

.tier-card-premium {
  background: #fdf9e8;
  border-color: #c9b45a;
}

.tier-option input[type="radio"]:checked + .tier-card-premium {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px #2563eb;
}

.muted {
  color: #666;
  font-size: 0.85rem;
}

.sponsor-slot {
  margin: 1.5rem auto;
  text-align: center;
  width: 300px;
  height: 250px;
}

.sponsor-placeholder {
  border: 1px dashed #ccc;
  background: #e8e8e8;
  color: #666;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 300px;
  height: 250px;
}

.sponsor-placeholder h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #999;
  font-weight: 400;
}

.content-with-aside {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.content-with-aside > :first-child {
  flex: 1;
  min-width: 0;
}

.content-with-aside > .sponsor-slot {
  flex: 0 0 300px;
  margin: 0;
}

.login-divider {
  text-align: center;
  margin: 1.5rem 0 1rem;
  position: relative;
}

.login-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-top: 1px solid #ddd;
}

.login-divider span {
  background: #f5f5f5;
  padding: 0 0.75rem;
  position: relative;
  color: #666;
  font-size: 0.9rem;
}

.signup-cta {
  text-align: center;
  margin-bottom: 1rem;
}

.signup-cta .btn {
  display: inline-block;
  margin-bottom: 0.5rem;
}

.signup-cta .muted {
  font-size: 0.85rem;
}

ul.search-results {
  list-style: none;
  padding: 0;
}

ul.search-results li {
  padding: 0.4rem 0;
  border-bottom: 1px solid #eee;
}

ul.search-results a {
  color: #1a1a1a;
  text-decoration: none;
}

ul.search-results a:hover {
  text-decoration: underline;
}

.printings-sort {
  margin-bottom: 0.5rem;
}

.printings-sort label {
  font-size: 0.85rem;
  color: #666;
  margin-right: 0.25rem;
}

.printings-sort select {
  font-size: 0.85rem;
  padding: 0.2rem 0.4rem;
}

.variant-strip {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x proximity;
}

.variant-item {
  flex: 0 0 auto;
  width: 146px;
  text-align: center;
  text-decoration: none;
  color: #1a1a1a;
  border: 2px solid transparent;
  border-radius: 6px;
  padding: 0.25rem;
  scroll-snap-align: start;
}

.variant-item:hover {
  border-color: #ccc;
}

.variant-item.current {
  border-color: #7a9fd4;
  background: #f3f7fd;
}

.variant-item img {
  width: 100%;
  display: block;
  border-radius: 4px;
}

.variant-blank {
  display: block;
  width: 100%;
  height: 204px;
  background: #eee;
  border-radius: 4px;
  line-height: 204px;
  color: #888;
  font-weight: 600;
  font-size: 0.9rem;
}

.variant-set,
.variant-price {
  display: block;
  font-size: 0.75rem;
  margin-top: 0.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.variant-set {
  font-weight: 600;
}

.variant-price {
  color: #666;
}

.card-layout {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.card-info {
  flex: 1;
  min-width: 20rem;
}

.card-detail-row {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.card-detail-row > .card-info {
  flex: 1;
  min-width: 0;
}

.card-detail-row > .sponsor-slot {
  flex: 0 0 300px;
  margin: 0;
}

.oracle-text {
  margin-top: 1rem;
  white-space: pre-line;
}

.flavor-text {
  font-style: italic;
  color: #555;
  margin-top: 0.5rem;
  white-space: pre-line;
}

.graph svg {
  width: 100%;
  max-width: 34rem;
  height: auto;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
}

.graph-point {
  cursor: pointer;
}

.add-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem;
  align-items: end;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.add-field {
  display: grid;
  gap: 0.25rem;
}

.add-field label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #666;
}

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

.name-field {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.name-status {
  flex: 0 0 auto;
  width: 1.25em;
  height: 1.25em;
  line-height: 1.25em;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
}

.name-status.ok {
  color: #1a7f37;
}

.name-status.bad {
  color: #fff;
  background: #c62828;
  border-radius: 50%;
}

.add-form .add-field input,
.add-form .add-field select {
  width: 100%;
}

.sealed-total {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a7f37;
  padding: 0.35rem 0.5rem;
  background: #f0f8f1;
  border: 1px solid #cde8d0;
  border-radius: 6px;
}

.add-form button[type="submit"] {
  margin-top: 0;
  grid-column: 1 / -1;
  justify-self: start;
}

.autocomplete {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 0 0 4px 4px;
  max-height: 16rem;
  overflow-y: auto;
  z-index: 10;
}

.autocomplete li {
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
}

.autocomplete li:hover,
.autocomplete li.active {
  background: #e6ecf5;
}

.ac-title {
  display: block;
  font-weight: 600;
}

.ac-sub {
  display: block;
  color: #666;
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

.set-chip {
  display: inline-block;
  padding: 0 0.35rem;
  border: 1px solid #bbb;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #333;
  background: #fafafa;
}

details.ops-section summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.qty-input {
  width: 4.5rem;
}

.skip-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: #666;
}

.flag {
  display: inline-block;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  font-size: 0.72rem;
  color: #444;
  margin: 0.1rem 0.1rem 0 0;
}

.tag-cloud {
  line-height: 1.5;
  margin: 1.2rem 0 0;
}

.tag-cloud a {
  display: inline-block;
  margin: 0 0.7rem 0 0;
  color: #2a5db0;
  text-decoration: none;
  vertical-align: middle;
}

.tag-cloud a:hover {
  text-decoration: underline;
}

.tag-cloud .tag-new {
  color: #a00;
  font-size: 0.68em;
  margin-left: 0.15rem;
  white-space: nowrap;
}

.tag-cloud a.has-new {
  color: #a00;
}

.tag-new-flag {
  background: #fdecec;
  border-color: #dba8a8;
  color: #a00;
  font-size: 0.8rem;
}

.news-layout {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) 2.5fr;
  gap: 1.5rem;
  align-items: start;
}

.news-sidebar {
}

.news-feed {
  min-width: 0;
}

.news-pagination {
  padding-top: 0.75rem;
}

.news-feed-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.news-feed-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
}

.news-feed-item:last-child {
  border-bottom: none;
}

.news-feed-title {
  font-size: 0.95rem;
}

.news-feed-meta {
  font-size: 0.78rem;
  color: #666;
  margin-top: 0.15rem;
}

.scope-chips {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin: 0;
}

.scope-chip {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border: 1px solid #bbb;
  border-radius: 999px;
  font-size: 0.82rem;
  color: #333;
  background: #fff;
  text-decoration: none;
}

.scope-chip:hover {
  background: #f4f4f4;
}

.scope-chip.active {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

.sort-bar {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin: 0 0 1rem;
  align-items: center;
}

.sort-chip {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border: 1px solid #bbb;
  border-radius: 999px;
  font-size: 0.82rem;
  color: #333;
  background: #fff;
  text-decoration: none;
}

.sort-chip:hover {
  background: #f4f4f4;
}

.sort-chip.active {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

.upsell {
  margin: 1rem 0;
  padding: 0.9rem 1.1rem;
  border: 1px solid #c9b45a;
  border-left: 4px solid #c9b45a;
  background: #fdf9e8;
  border-radius: 6px;
}

.upsell p {
  margin: 0.25rem 0;
}

tr.row-teaser td {
  color: #666;
}

tr.row-teaser a {
  color: #666;
}

tr.row-conflict td {
  background: #fdf0f0;
}

tr.row-conflict .flag {
  background: #f5d9d9;
  border-color: #dba8a8;
}

tr.row-review td {
  background: #fdf6e8;
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #fff;
  color: #1a1a1a;
  border: 1px solid #bbb;
  border-radius: 4px;
  text-decoration: none;
  margin-left: 0.5rem;
}

.btn:hover {
  border-color: #1a1a1a;
}

.builder-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.builder-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

.hero-commanders {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-commander {
  margin: 0;
  width: 15rem;
}

.hero-commander-img {
  display: block;
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hero-commander figcaption {
  margin-top: 0.4rem;
}

.hero-stats {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem;
}

.builder-nav {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  margin-bottom: 1.5rem;
}

.builder-nav h2 {
  margin: 0 0.6rem 0 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
}

.step-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: auto;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #1a1a1a;
  padding: 0.5rem 0.8rem;
  font-size: 0.9rem;
  cursor: pointer;
  margin: 0;
}

.step-link:hover {
  background: #f5f5f5;
}

.step-link.active {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

.step-link:disabled {
  color: #aaa;
  cursor: not-allowed;
}

.step-link:disabled:hover {
  background: transparent;
}

.builder-grid .ops-section {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem;
}

.builder-grid .ops-section h2 {
  margin-top: 0;
}

.builder-grid .ops-section input,
.builder-grid .ops-section select {
  width: 100%;
}

.filter-panel {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.filter-panel input[type="search"],
.filter-panel input[type="text"],
.filter-panel input[type="date"],
.filter-panel select,
.filter-panel button {
  font-size: 0.78rem;
  padding: 0.25rem 0.4rem;
}

.color-chips {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.color-chip {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: 2px solid #bbb;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
  margin-top: 0;
  padding: 0;
}

.color-chip.active {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

ul.builder-results {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  max-height: 24rem;
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 6px;
}

.builder-results li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid #eee;
  font-size: 0.85rem;
}

.builder-results li:last-child {
  border-bottom: none;
}

.builder-results .res-name {
  font-weight: 600;
}

.builder-results button {
  margin-top: 0;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.builder-filters {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.chip-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888;
  margin-top: 0.4rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.chip {
  border: 1px solid #bbb;
  border-radius: 999px;
  background: #fff;
  color: #1a1a1a;
  padding: 0.25rem 0.7rem;
  font-size: 0.78rem;
  cursor: pointer;
  margin-top: 0;
  line-height: 1.3;
}

.chip:hover {
  border-color: #1a1a1a;
}

.chip.active {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

.chip-count {
  color: #999;
  font-size: 0.72rem;
}

.chip.active .chip-count {
  color: #bbb;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  margin-top: 0.4rem;
  cursor: pointer;
}

.toggle-row input {
  width: auto;
}

.step-locked {
  border: 1px dashed #ccc;
  border-radius: 6px;
  padding: 0.75rem;
  text-align: center;
}

.cmd-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cmd-summary .deck-zone {
  flex: 1 1 auto;
}

.cmd-summary .deck-zone li {
  border-bottom: none;
}

.mini-thumb {
  width: 2rem;
  height: auto;
  border-radius: 3px;
}

.btn-ghost {
  margin-top: 0;
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  background: #fff;
  border: 1px solid #bbb;
  border-radius: 4px;
  color: #1a1a1a;
  cursor: pointer;
}

.btn-ghost:hover {
  border-color: #1a1a1a;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.75rem;
  margin: 0.5rem 0 0;
  max-height: 28rem;
  overflow-y: auto;
  padding: 0.25rem;
}

.card-tile {
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.card-tile:hover,
.card-tile:focus-visible {
  border-color: #1a1a1a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  outline: none;
}

.card-tile-imgwrap {
  position: relative;
  line-height: 0;
}

.card-tile-imgwrap img {
  width: 100%;
  height: auto;
  display: block;
}

.card-tile-imgwrap img.no-thumb {
  aspect-ratio: 63 / 88;
  background: #f2f2f2;
  object-fit: contain;
  padding: 0.5rem;
  box-sizing: border-box;
}

.card-tile-imgwrap .owned-badge {
  position: absolute;
  top: 0.3rem;
  left: 0.3rem;
}

.card-tile-body {
  padding: 0.45rem 0.55rem 0.35rem;
  display: grid;
  gap: 0.15rem;
}

.card-tile-name {
  font-weight: 600;
  font-size: 0.82rem;
  line-height: 1.25;
}

.card-tile-meta {
  font-size: 0.72rem;
  color: #666;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.card-tile-stats {
  font-size: 0.72rem;
  color: #444;
  font-weight: 600;
}

.card-tile-add {
  margin: auto 0.5rem 0.5rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #fff;
  color: #1a1a1a;
  cursor: pointer;
}

.card-tile-add:hover {
  border-color: #1a1a1a;
  background: #f7f7f7;
}

.sealed-tile {
  cursor: default;
}

.card-tile-actions {
  margin: auto 0.5rem 0.5rem;
  display: flex;
  justify-content: center;
}

.card-tile-actions .card-tile-add {
  margin: 0;
  width: 100%;
}

.card-tile-printings {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 0.68rem;
  line-height: 1;
  padding: 0.28rem 0.4rem;
  text-align: center;
}

.printings-dialog {
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 1rem;
  width: min(32rem, calc(100vw - 2rem));
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.printings-dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

.printings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.printings-head h3 {
  margin: 0;
  font-size: 1rem;
}

.printings-list {
  max-height: 24rem;
  overflow-y: auto;
  display: grid;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.print-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.4rem;
  border: 1px solid #eee;
  border-radius: 5px;
}

.print-thumb {
  width: 2.4rem;
  height: auto;
  border-radius: 3px;
  flex: none;
}

.print-thumb.no-thumb {
  aspect-ratio: 63 / 88;
  background: #f2f2f2;
  object-fit: contain;
  padding: 0.25rem;
  box-sizing: border-box;
}

.print-info {
  flex: 1 1 auto;
  min-width: 0;
}

.print-set {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
}

.print-meta {
  font-size: 0.72rem;
  color: #666;
}

.print-row .owned-badge {
  flex: none;
}

.sealed-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #fff;
}

.sealed-stepper .sealed-step {
  border: 0;
  background: transparent;
  color: #1a1a1a;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
}

.sealed-stepper .sealed-step:hover {
  background: #f0f0f0;
}

.sealed-qty-num {
  min-width: 1.6rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1a1a1a;
}

.zone-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #666;
  margin: 1rem 0 0.35rem;
}

ul.deck-zone {
  list-style: none;
  margin: 0;
  padding: 0;
}

.deck-zone li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.85rem;
}

.deck-card-name {
  font-weight: 600;
}

.deck-qty {
  margin-left: auto;
  color: #666;
}

.inline-form {
  display: inline;
}

.inline-form button {
  margin: 0;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  background: #fff;
  color: #b00020;
  border: 1px solid #d8a0a0;
}

.inline-form button.chip {
  border: 1px solid #bbb;
  border-radius: 999px;
  color: #1a1a1a;
  padding: 0.25rem 0.7rem;
  font-size: 0.78rem;
}

.inline-form button.chip.active {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

.inline-form button.btn-ghost {
  border-radius: 4px;
  color: #1a1a1a;
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
}

.inline-form button.btn-ghost:disabled,
.btn-ghost:disabled {
  background: #f0f0f0;
  color: #999;
  border-color: #ddd;
  cursor: not-allowed;
}

.slot-picker {
  margin-bottom: 0.75rem;
}

.slot-hint {
  margin: 0 0 0.5rem;
}

ul.build-log {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 16rem;
  overflow-y: auto;
  font-size: 0.8rem;
  font-family: ui-monospace, monospace;
}

.build-log li {
  padding: 0.25rem 0.5rem;
  border-left: 3px solid #ddd;
  margin-bottom: 0.2rem;
}

.build-log li.log-ok {
  border-left-color: #1a7f37;
}

.build-log li.log-warn {
  border-left-color: #b26a00;
  background: #fdf6e8;
}

.build-log li.log-error {
  border-left-color: #c62828;
  background: #fdf0ef;
}

.legal-ok {
  color: #1a7f37;
  font-weight: 600;
}

.legal-bad {
  color: #b00020;
  font-weight: 600;
}

ul.legal-list {
  list-style: none;
  margin: 0.5rem 0 1rem;
  padding: 0.6rem 0.8rem;
  background: #fdf6f6;
  border: 1px solid #f0c8c8;
  border-radius: 6px;
  max-height: 14rem;
  overflow-y: auto;
  font-size: 0.85rem;
}

ul.legal-list li {
  padding: 0.15rem 0;
}

.rule-bad {
  display: inline-block;
  background: #fdf6f6;
  color: #b00020;
  border: 1px solid #f0c8c8;
  border-radius: 999px;
  padding: 0.02rem 0.5rem;
  font-size: 0.72rem;
  margin-left: 0.35rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.stats-grid .stat-card .stat-sub {
  font-weight: 600;
}

.focus-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.focus-chart h3 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
}

.owned-badge {
  display: inline-block;
  background: #e8f5e9;
  color: #1a7f37;
  border: 1px solid #b7dfbe;
  border-radius: 999px;
  padding: 0.02rem 0.5rem;
  font-size: 0.72rem;
  margin-left: 0.35rem;
}

.curve {
  display: grid;
  gap: 0.3rem;
}

.curve-row {
  display: grid;
  grid-template-columns: 1.2rem 1fr 1.6rem;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
}

.curve-mv {
  text-align: right;
  color: #666;
}

.curve-track {
  height: 0.65rem;
  background: #f0f0f0;
  border-radius: 3px;
  overflow: hidden;
}

.curve-bar {
  height: 100%;
  background: #1a1a1a;
  border-radius: 3px;
}

.curve-count {
  color: #666;
}

.type-breakdown {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.45rem 0.75rem;
}

.type-label {
  font-size: 0.85rem;
  min-width: 6.5rem;
}

.type-track {
  height: 0.65rem;
  background: #f0f0f0;
  border-radius: 3px;
  overflow: hidden;
}

.type-bar {
  height: 100%;
  background: #7a9fd4;
  border-radius: 3px;
}

.type-count {
  font-size: 0.85rem;
  color: #666;
  min-width: 1.6rem;
  text-align: right;
}

.hover-preview {
  position: fixed;
  pointer-events: none;
  z-index: 1000;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  overflow: hidden;
}

.hover-preview img {
  display: block;
  width: 320px;
  max-width: 40vw;
  height: auto;
}

.commander-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.commander-item {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  background: #fafafa;
  border: 1px solid #e4e4e4;
  border-radius: 8px;
  padding: 1rem;
}

.commander-img img {
  width: 260px;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.commander-info h2 {
  margin: 0 0 0.5rem;
}

.commander-info .kv {
  margin: 0 0 0.5rem;
}

.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.15rem 0.75rem;
  font-size: 0.9rem;
}

.kv dt {
  color: #666;
}

.mana-symbol {
  height: 1em;
  width: auto;
  vertical-align: -0.15em;
  display: inline;
}

.site-footer {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem 1.5rem;
  border-top: 1px solid #ddd;
  background: #ececec;
  color: #666;
  font-size: 0.8rem;
  text-align: center;
}

.site-footer a {
  color: #555;
}

.footer-legal {
  max-width: 60rem;
  margin: 0 auto 0.75rem;
  line-height: 1.5;
}

.footer-tech {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1rem;
  margin: 0;
  padding: 0;
}

.footer-tech a {
  display: inline-flex;
  align-items: center;
}

.tech-icon {
  height: 1.35em;
  width: auto;
  vertical-align: middle;
  opacity: 0.8;
}

.tech-icon:hover {
  opacity: 1;
}

.oracle {
  font-size: 0.9rem;
  color: #444;
  margin: 0;
}

.card-columns {
  columns: 3;
  column-gap: 1.75rem;
  font-size: 0.85rem;
}

.card-line {
  break-inside: avoid;
  margin-bottom: 0.2rem;
}

.card-qty {
  display: inline-block;
  min-width: 1.9rem;
  color: #666;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1200px) {
  .card-columns {
    columns: 2;
  }
}

@media (max-width: 900px) {
  .focus-charts {
    grid-template-columns: 1fr;
  }

  .builder-grid {
    grid-template-columns: 1fr;
  }

  .builder-hero {
    grid-template-columns: 1fr;
  }

  .builder-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .builder-nav h2 {
    margin: 0 0 0.4rem;
  }

  .step-link {
    width: 100%;
  }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  }

  .card-columns {
    columns: 1;
  }

  .commander-item {
    flex-direction: column;
    width: 100%;
  }

  .deck-layout {
    flex-direction: column;
  }

  .deck-sidebar {
    flex: none;
    width: 100%;
    position: static;
  }

  .deck-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
  }

  .deck-nav li {
    margin-top: 0;
  }

  .deck-nav a {
    display: inline-block;
    padding: 0.25rem 0.5rem;
  }
}

.flash-list {
  max-width: 900px;
  margin: 1rem auto;
  padding: 0 1.5rem;
}

.flash {
  margin: 0 0 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: 4px;
  border: 1px solid #ccc;
  background: #fff;
}

.flash.success {
  background: #e6f4ea;
  border-color: #b7dfc0;
}

.flash.error {
  background: #fdecea;
  border-color: #f5c2c0;
}

.flash.info {
  background: #e8f0fe;
  border-color: #c3d5f5;
}

.mode-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 0.1rem 0.25rem;
  background: #fff;
}

.qty-step {
  width: 1.7rem;
  height: 1.7rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #f6f6f6;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.qty-step:hover {
  background: #e8e8e8;
}

.qty-input {
  width: 3.2rem;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 0.9rem;
}

tr.qty-dirty td {
  background: #fff8e1;
}

tr.qty-dirty .qty-input {
  border-color: #e6a700;
  background: #fffdf4;
}

#qty-review {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 2px solid #1a1a1a;
}

#qty-log {
  max-height: 12rem;
  overflow-y: auto;
}
