:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #d8dde5;
  --text: #171b22;
  --muted: #647084;
  --primary: #175cd3;
  --primary-dark: #0f3f9a;
  --danger-bg: #fff2f0;
  --danger: #a32016;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.25;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 18px;
}

.panel,
.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel {
  padding: 22px;
}

.quote-form label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  font-size: 15px;
}

button,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
}

button {
  border: 0;
  background: var(--primary);
  color: #fff;
  padding: 0 18px;
  cursor: pointer;
}

button:hover {
  background: var(--primary-dark);
}

.secondary-link {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 0 14px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  padding: 16px;
}

.metric span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  font-size: 22px;
}

.listing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.share-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.share-info {
  flex: 1 1 280px;
  min-width: 0;
}

.share-info p {
  margin: 4px 0;
  font-size: 14px;
  line-height: 1.5;
}

.share-info .eyebrow {
  margin-bottom: 4px;
}

.share-copy-button {
  flex: 0 0 auto;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  padding: 0 18px;
  height: 40px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.share-copy-button:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.price-vote-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px 20px;
  align-items: start;
  margin-bottom: 16px;
}

.price-vote-copy,
.standard-price-details,
.standard-breakdown {
  min-width: 0;
  max-width: 100%;
}

.price-vote-copy h2 {
  font-size: 20px;
}

.price-warning {
  margin: 8px 0 0;
  border-left: 3px solid #d97706;
  background: #fff7ed;
  color: #7c2d12;
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.standard-price-details {
  margin-top: 8px;
}

.standard-price-details summary {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}

.standard-price-details summary::-webkit-details-marker {
  display: none;
}

.standard-price-details summary::after {
  content: "상세";
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 8px;
  background: #f9fafb;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.standard-price-details[open] summary::after {
  content: "닫기";
}

.standard-price-details summary strong {
  color: var(--text);
  font-size: 18px;
}

.standard-price-details summary small {
  color: var(--muted);
}

.standard-breakdown {
  grid-column: 1 / -1;
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.standard-table {
  min-width: 860px;
}

.snapshot-history {
  margin: -4px 0 16px;
}

.snapshot-history summary {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: #f9fafb;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.history-table {
  min-width: 520px;
}

.vote-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: min(100%, 360px);
}

.vote-button {
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  white-space: nowrap;
  text-transform: lowercase;
}

.vote-button:hover {
  border-color: var(--primary);
  background: #eef4ff;
  color: var(--primary-dark);
}

.vote-button.is-selected,
.vote-button.is-selected:disabled {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.vote-button:disabled {
  cursor: default;
  opacity: 0.72;
}

.vote-button strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #edf2f7;
  color: var(--text);
  font-size: 12px;
}

.vote-button.is-selected strong {
  background: #fff;
  color: var(--primary-dark);
}

.vote-message {
  grid-column: 1 / -1;
}

.muted {
  color: var(--muted);
  margin: 6px 0 0;
}

.alert {
  margin-bottom: 18px;
  border: 1px solid #ffb3ad;
  border-radius: 6px;
  background: var(--danger-bg);
  color: var(--danger);
  padding: 12px;
  font-weight: 700;
}

.table-wrap {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  vertical-align: top;
  text-align: left;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.4;
}

.strong {
  font-weight: 700;
}

.price {
  white-space: nowrap;
  font-weight: 700;
}

.benchmark-cell {
  min-width: 150px;
}

.benchmark-cell a {
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: #f9fafb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

pre {
  margin: 14px 0 0;
  white-space: pre-wrap;
  word-break: keep-all;
  line-height: 1.65;
  color: #2c3440;
}

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

  .topbar,
  .listing {
    align-items: stretch;
    flex-direction: column;
  }

  .input-row,
  .summary-grid,
  .price-vote-panel,
  .vote-actions {
    grid-template-columns: 1fr;
  }

  .vote-actions {
    width: 100%;
  }

  button,
  .secondary-link {
    width: 100%;
  }
}
