:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --ink: #172026;
  --muted: #64717d;
  --line: #dfe6eb;
  --blue: #2563eb;
  --green: #168047;
  --teal: #0f766e;
  --sun: #f2b84b;
  --red: #c24135;
  --amber: #b7791f;
  --chip: #eef4f6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #eef8f5 0, #f7f8fb 260px, var(--bg) 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.search-surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 14px 32px rgba(25, 55, 70, 0.08);
}

.topbar {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.08), rgba(242, 184, 75, 0.1) 48%, rgba(37, 99, 235, 0.05));
}

.brand-heading {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 14px;
}

.discussion-ticker {
  width: min(520px, calc(100% - 170px));
  min-height: 30px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 999px;
  padding: 3px 5px 3px 12px;
  background: rgba(255, 255, 255, 0.72);
  color: #31515c;
  font-size: 12px;
  font-weight: 850;
}

.discussion-ticker[hidden] {
  display: none;
}

.discussion-ticker strong {
  color: var(--teal);
  font-size: 11px;
  text-transform: uppercase;
  white-space: nowrap;
}

.ticker-viewport {
  height: 24px;
  overflow: hidden;
  min-width: 0;
}

.ticker-track {
  display: grid;
  animation: tickerMove 16s linear infinite;
}

.discussion-ticker:hover .ticker-track {
  animation-play-state: paused;
}

.ticker-item {
  height: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
}

.ticker-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticker-item em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

@keyframes tickerMove {
  0%,
  10% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-50%);
  }
}

.brand-mark {
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.16);
}

.topbar-meta {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 8px;
  order: -1;
}

.trust-links,
.site-nav {
  display: grid;
  grid-template-columns: auto auto auto auto auto;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.trust-links a,
.site-nav a {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 6px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.76);
  color: #31515c;
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.site-nav a:nth-child(n+4) {
  min-height: 26px;
  padding: 0 6px;
  font-size: 11px;
}

.site-nav a:nth-child(-n+3) {
  min-width: 74px;
  justify-content: center;
}

.language-switcher {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
}

.data-status {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
}

.trust-links a:hover,
.site-nav a:hover,
.site-nav a.active {
  color: var(--teal);
  border-color: rgba(15, 118, 110, 0.38);
  background: #fff;
}

.site-nav a.active {
  box-shadow: 0 1px 2px rgba(23, 32, 38, 0.08);
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
}

.language-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 30px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.language-link + .language-link {
  border-left: 1px solid var(--line);
}

.language-link:hover,
.language-link.active {
  color: var(--blue);
  background: #f3f7ff;
}

.stats-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--muted);
  background: #fbfcfd;
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.stats-link:hover {
  color: var(--blue);
  border-color: rgba(37, 99, 235, 0.35);
}

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

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0;
}

.beta-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.data-status {
  min-width: 0;
  width: fit-content;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #31515c;
  background: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.search-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 18px;
  padding: 18px 24px 20px;
}

.query-panel {
  min-width: 0;
}

.condition-list {
  display: grid;
  gap: 10px;
}

.condition-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 10px;
  align-items: center;
}

.condition-list.is-advanced .condition-row {
  grid-template-columns: minmax(0, 1fr) 156px 38px;
  align-items: start;
}

.ingredient-input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--ink);
  outline: none;
}

.ingredient-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 38px;
  padding: 3px;
  background: #edf1f4;
  border-radius: 6px;
}

.segmented[hidden],
.condition-list:not(.is-advanced) .segmented,
.condition-list:not(.is-advanced) .amount-filter {
  display: none;
}

.condition-list.is-advanced .segmented:not([hidden]) {
  grid-column: 2;
  grid-row: 1;
}

.condition-list.is-advanced .remove-condition {
  grid-column: 3;
  grid-row: 1;
}

.segmented button,
.icon-button,
.ghost-button,
.primary-button,
.small-button,
.chip {
  border: 0;
  cursor: pointer;
}

.segmented button {
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.condition-row[data-mode="include"] [data-mode="include"],
.condition-row[data-mode="exclude"] [data-mode="exclude"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(23, 32, 38, 0.08);
}

.amount-filter {
  display: grid;
  grid-template-columns: 86px minmax(110px, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.amount-filter[hidden],
.advanced-help[hidden] {
  display: none;
}

.condition-list.is-advanced .amount-filter:not([hidden]) {
  grid-column: 1 / -1;
  grid-row: 2;
}

.amount-operator,
.amount-input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
  font-weight: 850;
  outline: none;
}

.amount-operator:disabled,
.amount-input:disabled {
  color: #8a98a3;
  background: #edf1f4;
  cursor: not-allowed;
}

.amount-input:focus,
.amount-operator:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.amount-unit-label {
  min-width: 58px;
  color: #31515c;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.amount-unit-label.muted,
.amount-unit-label[aria-disabled="true"] {
  color: var(--muted);
}

.advanced-help {
  margin-top: 10px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 8px;
  padding: 9px 11px;
  color: #31515c;
  background: #f3fbf8;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.5;
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: #f3f5f6;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.ghost-button,
.primary-button {
  min-height: 40px;
  border-radius: 6px;
  padding: 0 14px;
  font-weight: 850;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #eef4f6;
  color: var(--ink);
}

.ghost-button span {
  font-size: 18px;
  line-height: 1;
}

.primary-button {
  background: var(--blue);
  color: white;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.18);
}

.recommend-panel {
  min-width: 0;
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-radius: 8px;
  padding: 14px;
  background: #fbfefd;
  box-shadow: inset 0 3px 0 rgba(15, 118, 110, 0.38);
}

.quick-suggestion-panel[hidden],
.brand-filter-list[hidden] {
  display: none;
}

.quick-suggestion-panel {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfefd;
}

.recommend-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.panel-kicker {
  margin: 0 0 3px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.recommend-panel h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.small-button {
  min-height: 34px;
  border-radius: 6px;
  padding: 0 12px;
  background: var(--teal);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.recommend-panel textarea {
  width: 100%;
  min-height: 86px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  outline: none;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
}

.recommend-panel textarea::placeholder {
  color: #485765;
  opacity: 1;
  font-weight: 750;
}

.recommend-panel textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.recommend-disclaimer {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.recommend-results {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.recommend-card {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: #fff;
}

.recommend-source {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.recommend-source strong {
  color: var(--blue);
  font-weight: 900;
}

.recommend-source.basic {
  background: #fff9ec;
}

.recommend-source.basic strong {
  color: var(--amber);
}

.recommend-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.recommend-name {
  font-size: 13px;
  font-weight: 900;
}

.recommend-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.recommend-caution {
  color: #8a5a14;
}

.add-recommend-button {
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  background: #e8f5ee;
  color: var(--green);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.summary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.summary-row strong {
  color: var(--ink);
  font-size: 20px;
}

.sort-controls,
.product-type-controls {
  display: inline-grid;
  gap: 3px;
  padding: 3px;
  border-radius: 6px;
  background: #edf1f4;
}

.sort-controls {
  grid-template-columns: 1fr 1fr;
  min-width: 210px;
}

.product-type-controls {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-width: min(100%, 500px);
}

.sort-button,
.type-button {
  min-height: 32px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.type-button span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.sort-button.active,
.type-button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(23, 32, 38, 0.08);
}

.food-filter-button.active {
  color: #087f6f;
}

.type-button.active span {
  color: var(--teal);
}

.results-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
  height: calc(100vh - 252px);
  min-height: 420px;
}

.ingredient-panel {
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.results-column {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
}

.result-help {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.panel-title {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.brand-filter-panel {
  margin-top: 0;
}

.brand-filter-panel[hidden] {
  display: none;
}

.brand-filter-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 0;
}

.brand-filter-title strong {
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
}

.brand-filter-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}

.text-button:disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.55;
}

.brand-filter-list {
  display: grid;
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
  margin-top: 10px;
  padding-right: 3px;
}

.brand-filter-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
  color: var(--ink);
  cursor: pointer;
  padding: 7px 9px;
  text-align: left;
}

.brand-filter-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
}

.brand-filter-option strong {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.brand-filter-option.active {
  border-color: rgba(37, 99, 235, 0.45);
  background: #f3f7ff;
}

.brand-filter-option.active strong {
  color: var(--blue);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  max-width: 100%;
  border-radius: 999px;
  background: var(--chip);
  color: var(--ink);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 750;
}

.result-list {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
  scrollbar-gutter: stable;
}

.result-list::-webkit-scrollbar {
  width: 10px;
}

.result-list::-webkit-scrollbar-track {
  background: #e9eef2;
  border-radius: 999px;
}

.result-list::-webkit-scrollbar-thumb {
  background: #aab7c2;
  border: 2px solid #e9eef2;
  border-radius: 999px;
}

.result-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 8px 20px rgba(25, 55, 70, 0.05);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.result-card:hover {
  border-color: rgba(15, 118, 110, 0.28);
  box-shadow: 0 10px 24px rgba(25, 55, 70, 0.08);
}

.product-image {
  width: 88px;
  height: 88px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafafa;
}

.product-image-link,
.product-image-frame {
  display: block;
  width: 88px;
  height: 88px;
}

.product-image-link {
  border-radius: 6px;
  outline: none;
}

.product-image-link:hover .product-image {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.product-image-link:focus-visible .product-image {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.product-main {
  min-width: 0;
}

.product-title {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.35;
}

.product-title a {
  color: inherit;
  text-decoration: none;
}

.product-title a:hover {
  color: var(--blue);
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.match-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.match-pill {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 800;
}

.match-pill.included {
  background: #e8f6ee;
  color: var(--green);
}

.match-pill.missing {
  background: #f9e9e7;
  color: var(--red);
}

.match-pill.excluded-ok {
  background: #eef4f6;
  color: var(--muted);
}

.match-pill .amount {
  color: rgba(23, 32, 38, 0.72);
  font-weight: 700;
}

.empty-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px dashed #cfd9df;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-weight: 800;
  text-align: center;
  padding: 24px;
}

.pagination-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 92px;
  gap: 10px;
  align-items: center;
}

.pagination-row[hidden] {
  display: none;
}

.page-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.page-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.page-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.info-shell {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.info-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 32px rgba(25, 55, 70, 0.08);
  overflow: hidden;
}

.info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(15, 118, 110, 0.08), rgba(242, 184, 75, 0.12));
}

.info-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.info-body {
  display: grid;
  gap: 22px;
  padding: 24px;
  color: #27343d;
  line-height: 1.65;
}

.info-body h2 {
  margin: 0 0 8px;
  font-size: 20px;
  letter-spacing: 0;
}

.info-body p {
  margin: 0;
}

.info-body ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.info-body li + li {
  margin-top: 6px;
}

.info-note {
  border-left: 4px solid var(--teal);
  border-radius: 6px;
  padding: 12px 14px;
  background: #f1faf7;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.info-mini-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.info-mini-card strong {
  color: var(--ink);
  font-size: 16px;
}

.info-mini-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.howto-steps {
  display: grid;
  gap: 12px;
  counter-reset: howtoStep;
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.howto-steps li {
  position: relative;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px 12px 54px;
  background: #fff;
}

.howto-steps li::before {
  counter-increment: howtoStep;
  content: counter(howtoStep);
  position: absolute;
  left: 14px;
  top: 13px;
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #e8f5ee;
  color: var(--teal);
  font-size: 13px;
  font-weight: 950;
}

.howto-steps strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
}

.howto-steps span {
  color: #44535f;
  font-size: 13px;
  line-height: 1.55;
}

.info-tip {
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 8px;
  padding: 12px 14px;
  background: #f5f8ff;
}

.info-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.info-link-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

.info-link-button.primary {
  border-color: rgba(37, 99, 235, 0.2);
  background: var(--blue);
  color: #fff;
}

.discussion-shell {
  width: min(1120px, calc(100% - 32px));
}

.discussion-app {
  display: grid;
  gap: 18px;
  padding: 22px 24px 28px;
}

.discussion-notice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border-left: 4px solid var(--teal);
  border-radius: 6px;
  padding: 12px 14px;
  background: #f0faf7;
  color: #31515c;
  font-size: 13px;
  line-height: 1.55;
}

.discussion-composer,
.discussion-board,
.thread-detail-card,
.comment-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.92);
}

.discussion-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.discussion-section-head h2,
.thread-detail-card h2,
.comment-panel h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: 0;
}

.discussion-nickname {
  width: min(180px, 42vw);
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.discussion-input,
.discussion-textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.discussion-input {
  height: 42px;
}

.discussion-delete-password {
  max-width: 320px;
}

.discussion-textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.55;
}

.discussion-input:focus,
.discussion-textarea:focus,
.discussion-nickname:focus {
  border-color: rgba(15, 118, 110, 0.55);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.discussion-composer {
  display: grid;
  gap: 10px;
}

.discussion-composer-body {
  display: grid;
  gap: 10px;
}

.discussion-composer-body[hidden] {
  display: none;
}

.discussion-admin-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 8px;
  padding: 7px 8px;
  background: #eef8f6;
  color: #0d3e3a;
  font-size: 12px;
  font-weight: 800;
}

.discussion-admin-mode em {
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}

.discussion-composer.is-collapsed {
  padding-bottom: 12px;
}

.discussion-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 240px);
  gap: 10px;
}

.discussion-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.discussion-status {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.discussion-sort {
  display: inline-grid;
  grid-template-columns: auto auto;
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: var(--chip);
}

.discussion-tags,
.thread-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.discussion-tags {
  margin-bottom: 14px;
}

.discussion-tag,
.discussion-tag-filter,
.translation-badge {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.discussion-tag,
.discussion-tag-filter {
  color: #31515c;
  background: var(--chip);
  cursor: pointer;
}

.discussion-tag-filter.active,
.discussion-tag:hover,
.discussion-tag-filter:hover {
  color: var(--teal);
  border-color: rgba(15, 118, 110, 0.26);
  background: #fff;
}

.discussion-tag-filter span {
  margin-left: 4px;
  color: var(--blue);
}

.translation-badge {
  color: var(--teal);
  background: #e6f7ef;
}

.thread-list {
  display: grid;
  gap: 12px;
}

.thread-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.thread-card:hover {
  border-color: rgba(15, 118, 110, 0.28);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.07);
  transform: translateY(-1px);
}

.thread-card:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.24);
  outline-offset: 2px;
}

.thread-card.selected {
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.08);
}

.thread-card h3 {
  margin: 6px 0 7px;
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: 0;
}

.thread-card p,
.thread-detail-body,
.comment-card p {
  margin: 0 0 10px;
  color: #2f3f49;
  line-height: 1.58;
}

.thread-preview {
  position: relative;
  max-height: 7.55em;
  overflow: hidden;
  white-space: normal;
}

.thread-preview.has-fade::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 42px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 82%);
  box-shadow: inset 0 -18px 24px rgba(255, 255, 255, 0.92);
  pointer-events: none;
}

.thread-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.thread-meta strong {
  color: var(--ink);
}

.thread-meta .admin-author-name {
  color: #0f766e;
}

.admin-badge {
  border-radius: 999px;
  padding: 2px 7px;
  background: #dff5eb;
  color: #047857;
  font-size: 11px;
  font-weight: 900;
}

.moderation-badge {
  border-radius: 999px;
  padding: 2px 7px;
  background: #fff1f2;
  color: #be123c;
  font-size: 11px;
  font-weight: 900;
}

.thread-card-actions {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 96px;
  text-align: right;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.thread-vote {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.thread-vote:hover {
  color: var(--teal);
  border-color: rgba(15, 118, 110, 0.35);
}

.danger-lite {
  color: #be123c;
  border-color: rgba(190, 18, 60, 0.22);
  background: #fff7f8;
}

.admin-lite {
  color: #0f766e;
  border-color: rgba(15, 118, 110, 0.24);
  background: #f0fdfa;
}

.thread-vote:disabled,
.page-button[data-vote]:disabled {
  opacity: 0.72;
  cursor: wait;
}

.vote-pop {
  animation: votePop 0.38s ease;
}

@keyframes votePop {
  0% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.14);
    color: var(--teal);
    border-color: rgba(15, 118, 110, 0.42);
    box-shadow: 0 8px 18px rgba(15, 118, 110, 0.18);
  }
  100% {
    transform: scale(1);
  }
}

.discussion-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  background: #fbfcfd;
  font-size: 13px;
  font-weight: 750;
  text-align: center;
}

.discussion-load-more {
  margin-top: 12px;
  width: 100%;
}

.thread-detail {
  display: grid;
  gap: 14px;
}

.thread-detail:empty {
  display: none;
}

.thread-detail-card {
  display: grid;
  gap: 10px;
  border-color: rgba(15, 118, 110, 0.24);
  background: linear-gradient(180deg, #ffffff, #f7fcfa);
}

.thread-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.thread-product-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--blue);
  background: #f5f8ff;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.comment-panel {
  display: grid;
  gap: 12px;
}

.comment-list {
  display: grid;
  gap: 10px;
}

.comment-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.comment-replies {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-left: 14px;
  border-left: 2px solid rgba(15, 118, 110, 0.18);
}

.comment-depth-1,
.comment-depth-2,
.comment-depth-3,
.comment-depth-4 {
  background: #fbfcfd;
}

.comment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.danger-text {
  color: #be123c;
}

.admin-text {
  color: #0f766e;
}

.comment-form {
  display: grid;
  gap: 8px;
}

.comment-reply-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 6px;
  padding: 8px 10px;
  background: #eef8f5;
  color: #31515c;
  font-size: 12px;
  font-weight: 850;
}

.comment-reply-banner[hidden] {
  display: none;
}

.comment-form label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.stack-shell {
  max-width: 1120px;
}

.stack-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.stack-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
  gap: 18px;
  padding: 18px 24px 22px;
}

.stack-builder,
.stack-score-panel,
.stack-card-preview,
.stack-post-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.stack-builder,
.stack-score-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.stack-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stack-section-head h2,
.stack-score-panel h2,
.stack-post-panel h2 {
  margin: 0;
  line-height: 1.25;
  letter-spacing: 0;
}

.stack-label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.stack-purpose-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.stack-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.stack-rows {
  display: grid;
  gap: 9px;
}

.stack-item-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(86px, 110px) minmax(82px, 96px) 38px;
  gap: 8px;
  align-items: center;
}

.stack-unit-select {
  height: 42px;
  appearance: auto;
}

.stack-add-button {
  width: fit-content;
}

.stack-disclaimer {
  margin: 0;
}

.stack-score-panel {
  align-content: start;
  border-color: rgba(15, 118, 110, 0.24);
  background: linear-gradient(180deg, #ffffff, #f7fcfa);
}

.score-ring {
  --score: 0deg;
  width: 142px;
  height: 142px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  justify-self: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 0 58%, transparent 59%),
    conic-gradient(var(--teal) var(--score), #e8eff2 0);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.08), 0 16px 26px rgba(15, 118, 110, 0.12);
  color: var(--ink);
}

.score-ring strong {
  display: block;
  font-size: 42px;
  line-height: 1;
}

.score-ring span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.stack-score-summary {
  margin: 8px 0 0;
  color: #31515c;
  font-size: 14px;
  line-height: 1.5;
}

.stack-reasons {
  display: grid;
  gap: 7px;
}

.stack-reasons div {
  border-radius: 8px;
  padding: 9px 10px;
  background: #eef8f6;
  color: #31515c;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.stack-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stack-preview-layout {
  display: grid;
  grid-template-columns: minmax(0, 460px) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.stack-card-preview {
  min-height: 520px;
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 24px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.1), rgba(242, 184, 75, 0.12) 50%, rgba(37, 99, 235, 0.08)),
    #fff;
  box-shadow: 0 14px 28px rgba(25, 55, 70, 0.08);
}

.stack-card-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.stack-card-brand img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fff;
}

.stack-card-purpose {
  width: fit-content;
  margin: 0;
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.78);
  color: #31515c;
  font-weight: 900;
}

.stack-card-preview h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: 0;
}

.stack-card-items {
  display: grid;
  gap: 8px;
}

.stack-card-items div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  border-radius: 8px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.82);
}

.stack-card-items strong,
.stack-card-items span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.stack-card-score {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.stack-card-score strong {
  color: var(--blue);
  font-size: 48px;
  line-height: 1;
}

.stack-card-score span {
  color: var(--teal);
  font-size: 18px;
  font-weight: 950;
}

.stack-card-note {
  margin: 0;
  color: #31515c;
  font-weight: 750;
  line-height: 1.55;
}

.stack-card-preview small {
  margin-top: auto;
  color: var(--teal);
  font-weight: 950;
}

.stack-post-panel {
  align-self: start;
  padding: 18px;
}

.stack-post-panel p {
  color: #31515c;
  line-height: 1.62;
}

.stack-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stack-pill-row span {
  border-radius: 999px;
  padding: 7px 10px;
  background: var(--chip);
  color: #31515c;
  font-size: 12px;
  font-weight: 900;
}

.stack-deck-hero {
  overflow: hidden;
}

.stack-deck-topbar {
  display: grid;
  gap: 22px;
}

.stack-deck-topbar .topbar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stack-deck-topbar .site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.stack-deck-topbar .site-nav a {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.deck-marquee {
  margin: 6px -24px -24px;
  border-top: 1px solid var(--line);
  padding: 18px 0 20px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(248, 251, 252, 0.96), rgba(248, 251, 252, 0) 8%, rgba(248, 251, 252, 0) 92%, rgba(248, 251, 252, 0.96)),
    rgba(239, 246, 248, 0.54);
}

.deck-track {
  width: max-content;
  display: flex;
  gap: 14px;
  padding: 0 18px;
  animation: stackDeckFlow 42s linear infinite;
}

.deck-track:hover {
  animation-play-state: paused;
}

@keyframes stackDeckFlow {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

.deck-card-mini {
  width: 188px;
  flex: 0 0 auto;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.mini-card-frame,
.trading-card-frame {
  border: 2px solid #b7791f;
  border-radius: 8px;
  padding: 10px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 244, 224, 0.92)),
    #fff7e8;
  box-shadow: 0 14px 24px rgba(25, 55, 70, 0.12);
}

.mini-card-frame {
  display: grid;
  gap: 8px;
  min-height: 250px;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.deck-card-mini:hover .mini-card-frame {
  transform: translateY(-4px) rotate(-1deg);
  box-shadow: 0 18px 30px rgba(25, 55, 70, 0.18);
}

.mini-card-title,
.trading-card-titlebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border-radius: 5px;
  padding: 8px 9px;
  background: rgba(255, 255, 255, 0.76);
}

.mini-card-title strong,
.trading-card-titlebar strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-card-title span,
.trading-card-titlebar span {
  border-radius: 999px;
  padding: 4px 7px;
  color: #fff;
  background: var(--teal);
  font-size: 11px;
  font-weight: 950;
}

.mini-card-frame img,
.trading-card-image img {
  width: 100%;
  height: 116px;
  display: block;
  border: 1px solid rgba(183, 121, 31, 0.28);
  border-radius: 6px;
  object-fit: contain;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.1), rgba(37, 99, 235, 0.08)),
    #fff;
}

.mini-card-text {
  display: grid;
  gap: 8px;
}

.mini-card-text p {
  height: 42px;
  margin: 0;
  overflow: hidden;
  color: #31515c;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.45;
}

.mini-card-text span {
  color: var(--teal);
  font-size: 11px;
  font-weight: 950;
  line-height: 1.35;
}

.stack-game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 380px);
  gap: 18px;
  padding: 18px 24px;
}

.stack-game-builder {
  display: grid;
  gap: 16px;
}

.stack-section-head.compact {
  align-items: end;
}

.panel-kicker {
  margin: 0 0 3px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.stack-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr) 120px;
  gap: 10px;
}

.stack-form-grid label,
.stack-wide-label {
  display: grid;
  gap: 6px;
}

.stack-form-grid span,
.stack-wide-label span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
}

.product-pick-panel {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 8px;
  padding: 12px;
  background: #f8fcfb;
}

.product-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.product-search-results,
.selected-products,
.detail-product-list {
  display: grid;
  gap: 9px;
}

.product-pick-card,
.selected-product-chip,
.detail-product-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.product-pick-card img,
.selected-product-chip img,
.detail-product-card img {
  width: 62px;
  height: 62px;
  border: 1px solid var(--line);
  border-radius: 7px;
  object-fit: contain;
  background: #fff;
}

.product-pick-card strong,
.selected-product-chip strong,
.detail-product-card strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-pick-card span,
.selected-product-chip span,
.detail-product-card span,
.product-pick-card small,
.detail-product-card p {
  display: block;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
}

.trading-card {
  align-self: start;
  border-color: rgba(183, 121, 31, 0.28);
  background:
    radial-gradient(circle at 30% 10%, rgba(242, 184, 75, 0.22), transparent 30%),
    radial-gradient(circle at 80% 18%, rgba(15, 118, 110, 0.16), transparent 28%),
    #fff;
}

.trading-card-frame {
  display: grid;
  gap: 10px;
}

.trading-card-titlebar strong {
  font-size: 18px;
}

.trading-card-image img {
  height: 230px;
}

.trading-card-body {
  min-height: 124px;
  border: 1px solid rgba(183, 121, 31, 0.22);
  border-radius: 6px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.trading-card-body p {
  margin: 0 0 10px;
  color: #31515c;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.52;
}

.card-product-lines {
  display: grid;
  gap: 6px;
}

.card-product-lines div {
  display: grid;
  gap: 2px;
  border-radius: 6px;
  padding: 7px 8px;
  background: rgba(239, 248, 246, 0.92);
}

.card-product-lines strong,
.card-product-lines span {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-product-lines span {
  color: var(--muted);
  font-weight: 750;
}

.trading-card-scoreline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.trading-card-scoreline span {
  border-radius: 6px;
  padding: 8px;
  color: #31515c;
  background: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.trading-card-scoreline strong {
  color: var(--blue);
}

.trading-card-frame small {
  justify-self: end;
  color: var(--teal);
  font-size: 12px;
  font-weight: 950;
}

.stack-detail-panel {
  margin: 0 24px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 16px 32px rgba(25, 55, 70, 0.08);
}

.stack-detail-grid {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 18px;
}

.stack-detail-card {
  min-width: 0;
}

.detail-card-visual {
  max-width: 340px;
}

.user-score-buttons {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
}

.notes-shell {
  width: min(1080px, calc(100% - 32px));
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.note-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--ink);
  background: #fff;
  text-decoration: none;
}

.note-card:hover {
  border-color: rgba(15, 118, 110, 0.36);
  box-shadow: 0 8px 18px rgba(25, 55, 70, 0.08);
}

.note-card strong {
  font-size: 17px;
}

.note-card span,
.note-meta,
.note-source-list,
.note-small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.note-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
}

.note-main,
.note-side {
  min-width: 0;
}

.note-hero-summary {
  border-left: 4px solid var(--teal);
  border-radius: 6px;
  padding: 14px 16px;
  background: #effaf7;
  font-size: 16px;
  font-weight: 760;
}

.note-section {
  display: grid;
  gap: 12px;
  padding-top: 22px;
  margin-top: 18px;
  border-top: 1px solid rgba(133, 158, 170, 0.28);
}

.note-section:first-child {
  padding-top: 0;
  margin-top: 0;
  border-top: 0;
}

.note-section h2 {
  width: fit-content;
  margin: 0 0 2px;
  border-radius: 8px;
  padding: 5px 10px;
  background: #eef8f6;
  color: #0d3e3a;
  line-height: 1.25;
}

.note-section p,
.note-section ul {
  margin: 0;
}

.note-section p,
.note-section li {
  line-height: 1.7;
}

.note-section ul {
  padding-left: 20px;
}

.note-side-card {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.note-pill-list,
.note-related {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.note-pill,
.note-related a {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--chip);
  color: #31515c;
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.note-related-inline {
  margin-top: 2px;
}

.note-inline-cta {
  width: fit-content;
  margin-top: 8px;
  margin-bottom: 6px;
}

.note-comment-box {
  display: grid;
  gap: 8px;
  margin-top: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfd;
}

.note-comment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 220px) auto;
  gap: 8px;
}

.note-comment-input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
}

.note-comment-list {
  display: grid;
  gap: 8px;
}

.note-comment {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.note-comment p {
  margin: 3px 0 0;
}

.note-comment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.note-comment-replies {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-left: 12px;
  border-left: 2px solid rgba(15, 118, 110, 0.16);
}

.note-comment-depth-1,
.note-comment-depth-2,
.note-comment-depth-3 {
  background: #fbfcfd;
}

.note-comment-extra[hidden],
.note-comment-toggle[hidden] {
  display: none;
}

.note-comment-toggle {
  width: max-content;
}

.note-source-list {
  margin-top: 6px;
}

.note-source-list a {
  color: var(--blue);
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 14px;
  }

  .topbar {
    padding: 12px 12px 16px;
    align-items: stretch;
    gap: 12px;
  }

  .brand-mark {
    width: 52px;
    height: 52px;
  }

  .topbar-meta {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    justify-items: stretch;
    gap: 6px;
  }

  .stats-link,
  .language-switcher {
    justify-content: center;
  }

  .language-switcher {
    position: static;
    grid-column: 2;
    grid-row: 1;
    min-width: 66px;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(25, 55, 70, 0.08);
  }

  .language-link {
    min-width: 32px;
    min-height: 28px;
    padding: 0 7px;
    font-size: 11px;
  }

  .site-nav {
    display: grid;
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: 0.78fr 1.08fr 1fr 0.74fr 0.88fr;
    gap: 4px;
    width: 100%;
    min-width: 0;
    padding: 4px;
    border: 1px solid rgba(15, 118, 110, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    overflow: hidden;
  }

  .site-nav a {
    justify-content: center;
    min-width: 0;
    min-height: 32px;
    border-color: transparent;
    padding: 0 3px;
    font-size: 10px;
    letter-spacing: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .site-nav a:nth-child(-n+3) {
    min-width: 0;
    min-height: 34px;
    font-size: 10px;
    font-weight: 900;
  }

  .site-nav a:nth-child(n+4) {
    min-height: 28px;
    padding: 0 2px;
    font-size: 8.5px;
    font-weight: 850;
  }

  .data-status {
    display: none;
  }

  .discussion-ticker {
    width: 100%;
    grid-template-columns: 1fr;
    gap: 2px;
    border-radius: 8px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 4px 12px rgba(25, 55, 70, 0.06);
  }

  .discussion-ticker strong {
    font-size: 10px;
  }

  .condition-row {
    grid-template-columns: minmax(0, 1fr) 34px;
    gap: 8px;
  }

  .condition-list.is-advanced .condition-row {
    grid-template-columns: minmax(0, 1fr) 34px;
  }

  .condition-list.is-advanced .segmented:not([hidden]),
  .condition-list.is-advanced .amount-filter:not([hidden]) {
    grid-column: 1 / -1;
  }

  .condition-list.is-advanced .segmented:not([hidden]) {
    grid-row: 2;
  }

  .condition-list.is-advanced .remove-condition {
    grid-column: 2;
    grid-row: 1;
  }

  .condition-list.is-advanced .amount-filter:not([hidden]) {
    grid-row: 3;
  }

  .amount-filter {
    grid-template-columns: 88px minmax(0, 1fr) auto;
  }

  .segmented {
    height: 36px;
  }

  .segmented button {
    font-size: 11px;
  }

  .icon-button {
    width: 34px;
    height: 34px;
  }

  .search-tools {
    grid-template-columns: 1fr;
    padding: 14px 16px 16px;
  }

  .summary-row {
    padding: 10px 16px;
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .sort-controls {
    width: 100%;
  }

  .product-type-controls {
    width: 100%;
  }

  .results-layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .results-column {
    display: block;
  }

  .result-help {
    margin-bottom: 10px;
  }

  .result-list {
    overflow-x: visible !important;
    overflow-y: visible !important;
    overscroll-behavior: auto;
    max-height: none;
    padding-right: 0;
    scrollbar-gutter: auto;
  }

  .result-card {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .product-image {
    width: 72px;
    height: 72px;
  }

  .product-image-link,
  .product-image-frame {
    width: 72px;
    height: 72px;
  }

  .pagination-row {
    margin-top: 12px;
  }

  .info-shell {
    width: min(100% - 20px, 920px);
    padding-top: 14px;
  }

  .discussion-shell {
    width: min(100% - 20px, 1120px);
  }

  .info-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
  }

  .info-body {
    padding: 18px;
  }

  .discussion-app {
    padding: 14px;
    gap: 14px;
  }

  .discussion-notice {
    grid-template-columns: 1fr;
  }

  .discussion-composer,
  .discussion-board,
  .thread-detail-card,
  .comment-panel {
    padding: 14px;
  }

  .discussion-section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .discussion-nickname {
    width: 100%;
  }

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

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

  .thread-card-actions {
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    min-width: 0;
    text-align: left;
  }

  .notes-shell {
    width: min(100% - 20px, 1080px);
  }

  .note-layout {
    grid-template-columns: 1fr;
  }

  .note-side-card {
    position: static;
  }

  .note-comment-row {
    grid-template-columns: 1fr;
  }

  .comment-replies,
  .note-comment-replies {
    padding-left: 9px;
  }

  .stack-workspace,
  .stack-preview-layout,
  .stack-game-layout,
  .stack-detail-grid {
    grid-template-columns: 1fr;
  }

  .stack-workspace,
  .stack-game-layout {
    padding: 14px;
  }

  .stack-deck-topbar .topbar-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .stack-deck-topbar .language-switcher {
    align-self: flex-end;
  }

  .stack-form-grid {
    grid-template-columns: 1fr;
  }

  .stack-item-row {
    grid-template-columns: minmax(0, 1fr) minmax(74px, 92px) 38px;
  }

  .stack-unit-select {
    grid-column: 1 / -1;
  }

  .stack-card-preview {
    min-height: 0;
  }

  .stack-detail-panel {
    margin: 0 14px 18px;
  }

  .product-pick-card,
  .selected-product-chip,
  .detail-product-card {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .product-pick-card img,
  .selected-product-chip img,
  .detail-product-card img {
    width: 52px;
    height: 52px;
  }

  .product-pick-card .small-button,
  .selected-product-chip .icon-button,
  .detail-product-card .text-button {
    grid-column: 1 / -1;
    justify-self: stretch;
  }
}

@media (max-width: 520px) {
  .condition-row {
    grid-template-columns: 1fr 34px;
  }

  .condition-list.is-advanced .segmented:not([hidden]) {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .results-layout {
    height: auto;
    min-height: 0;
  }

  .result-list {
    max-height: none;
  }

  .stack-section-head,
  .stack-share-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .stack-card-preview h2 {
    font-size: 28px;
  }

  .deck-card-mini {
    width: 164px;
  }

  .mini-card-frame img {
    height: 98px;
  }

  .product-search-row {
    grid-template-columns: 1fr;
  }

  .trading-card-image img {
    height: 190px;
  }

  .trading-card-scoreline,
  .user-score-buttons {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
