:root {
  --bg: #f5ead1;
  --bg-deep: #fbf4e6;
  --panel: rgba(255, 252, 245, 0.94);
  --panel-2: rgba(255, 249, 239, 0.92);
  --panel-3: rgba(243, 227, 196, 0.72);
  --panel-border: rgba(180, 146, 88, 0.2);
  --text: #5c4826;
  --muted: #9b7c49;
  --accent: #c6a15a;
  --accent-deep: #d8be8a;
  --accent-soft: rgba(198, 161, 90, 0.12);
  --danger: #f08f7e;
  --danger-soft: rgba(240, 143, 126, 0.14);
  --shadow: 0 18px 40px rgba(133, 107, 58, 0.08);
  --panel-height: 332px;
  --curve-card-width: 198px;
  --curve-grid-gap: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 252, 244, 0.92), transparent 34%),
    radial-gradient(circle at top right, rgba(232, 211, 164, 0.16), transparent 32%),
    linear-gradient(135deg, #fffdf8 0%, #f8efdc 32%, var(--bg-deep) 100%);
  color: var(--text);
  font-family: "Noto Sans KR", sans-serif;
  font-weight: 300;
  overflow-x: hidden;
}

.page-shell {
  position: fixed;
  inset: 0;
  pointer-events: none;
  display: block;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(8px);
}

.orb-left {
  top: 64px;
  left: -120px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(210, 181, 122, 0.14), transparent 68%);
}

.orb-right {
  right: -80px;
  top: 180px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(243, 227, 186, 0.26), transparent 70%);
}

.grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(198, 161, 90, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(198, 161, 90, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 95%);
}

.page {
  width: min(1180px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 30px 0 56px;
  font-size: 80%;
  position: relative;
  z-index: 1;
}

.top-header {
  width: calc((4 * var(--curve-card-width)) + (3 * var(--curve-grid-gap)) + 2px);
  max-width: 100%;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.brand-banner {
  width: 120px;
  flex: 0 0 120px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.hero {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 0;
  width: auto;
  max-width: none;
  flex: 1 1 auto;
  min-width: 0;
  padding: 22px 24px 20px;
  border: 1px solid var(--panel-border);
  background:
    linear-gradient(145deg, rgba(255, 252, 245, 0.98), rgba(244, 233, 209, 0.92)),
    linear-gradient(180deg, rgba(255, 252, 240, 0.44), transparent 42%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  pointer-events: none;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
}

.brand-mark {
  width: fit-content;
  max-width: 100%;
  margin-bottom: 2px;
  color: #a6854d;
  padding: 6px 10px 4px 6px;
  background: linear-gradient(180deg, rgba(255, 252, 245, 0.88), rgba(248, 240, 223, 0.42));
  border: 1px solid rgba(166, 133, 77, 0.08);
}

.brand-mark-image {
  display: block;
  width: 100px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.hero-eyebrow {
  color: var(--accent-deep);
  font-family: "Roboto Mono", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.28em;
}

.hero-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(198, 161, 90, 0.18);
  flex-wrap: wrap;
}

.meta,
th,
td:nth-child(2),
td:nth-child(3) {
  font-family: "Roboto Mono", monospace;
}

h1 {
  margin: 0;
  font-size: clamp(1.2rem, 2.2vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: #6b5330;
  font-weight: 400;
  white-space: nowrap;
  text-shadow: 0 0 16px rgba(255, 249, 235, 0.5);
}

.meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font-size: 0.72rem;
}

.meta span {
  display: inline-flex;
  align-items: center;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.meta-prefix {
  color: rgba(107, 83, 48, 0.72);
}

#generatedAt {
  color: #6b5330;
  font-weight: 400;
  white-space: nowrap;
}

.refresh-button {
  min-width: 92px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(220, 196, 149, 0.42);
  background: linear-gradient(180deg, #faf1dd, #e7d3aa);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 251, 0.85),
    0 8px 20px rgba(180, 146, 88, 0.12);
  color: #584220;
  font-family: "Noto Sans KR", sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
  cursor: pointer;
  transition: transform 120ms ease, color 120ms ease, opacity 120ms ease, border-color 120ms ease;
}

.refresh-button:hover:not(:disabled) {
  color: #473416;
  border-color: rgba(233, 216, 182, 0.9);
  transform: translateY(-1px);
}

.refresh-button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.curve-grid {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.curve-grid::-webkit-scrollbar {
  height: 8px;
}

.curve-grid::-webkit-scrollbar-track {
  background: rgba(198, 161, 90, 0.08);
}

.curve-grid::-webkit-scrollbar-thumb {
  background: rgba(198, 161, 90, 0.24);
  border-radius: 999px;
}

.history-board {
  margin-top: 16px;
  width: calc((4 * var(--curve-card-width)) + (3 * var(--curve-grid-gap)) + 2px);
  max-width: 100%;
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.96), rgba(246, 237, 221, 0.94));
  box-shadow: var(--shadow);
}

.comments-board {
  margin-top: 16px;
  width: calc((4 * var(--curve-card-width)) + (3 * var(--curve-grid-gap)) + 2px);
  max-width: 100%;
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.96), rgba(246, 237, 221, 0.94));
  box-shadow: var(--shadow);
}

.history-layout {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(150px, 1fr);
  gap: 0;
}

.history-chart-panel {
  padding: 12px 16px 16px;
  border-right: 1px solid var(--panel-border);
}

.history-meta {
  margin-bottom: 10px;
  color: var(--muted);
  font-family: "Roboto Mono", monospace;
  font-size: 0.66rem;
}

.history-chart {
  display: block;
  width: 100%;
  height: 250px;
}

.history-chart-frame {
  border: 1px solid rgba(205, 177, 127, 0.16);
  background:
    linear-gradient(rgba(198, 161, 90, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(198, 161, 90, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(247, 240, 227, 0.98));
  background-size: 100% 44px, 10% 100%, 100% 100%;
}

.history-table-wrap {
  max-height: 290px;
  overflow-y: auto;
}

.history-table-wrap::-webkit-scrollbar {
  width: 8px;
}

.history-table-wrap::-webkit-scrollbar-track {
  background: rgba(198, 161, 90, 0.08);
}

.history-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(198, 161, 90, 0.24);
  border-radius: 999px;
}

.history-table th,
.history-table td {
  padding: 6px 8px;
  font-size: 0.74rem;
}

.history-table td:last-child,
.history-table th:last-child {
  text-align: right;
}

.history-empty {
  color: var(--muted);
  text-align: center;
}

.board-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--panel-border);
  background: linear-gradient(180deg, rgba(251, 244, 231, 0.98), rgba(235, 223, 198, 0.96));
}

.board-header h2 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 400;
  color: #6a5330;
}

.comment-list {
  display: grid;
  gap: 0;
  padding: 0 14px 14px;
  max-height: 560px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.comment-list::-webkit-scrollbar {
  width: 8px;
}

.comment-list::-webkit-scrollbar-track {
  background: rgba(198, 161, 90, 0.08);
}

.comment-list::-webkit-scrollbar-thumb {
  background: rgba(198, 161, 90, 0.24);
  border-radius: 999px;
}

.comment-card {
  border-bottom: 1px solid rgba(198, 161, 90, 0.1);
}

.comment-summary {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0 8px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font-weight: 300;
}

.comment-summary-title {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 300;
}

.comment-summary-time {
  color: var(--muted);
  font-size: 0.66rem;
  flex: 0 0 auto;
}

.comment-detail {
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid rgba(205, 177, 127, 0.14);
  background: rgba(255, 253, 248, 0.72);
}

.comment-topbar {
  display: flex;
}

.comment-title-wrap {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: linear-gradient(180deg, rgba(255, 249, 238, 0.96), rgba(242, 233, 214, 0.88));
}

.comment-meta {
  display: flex;
  gap: 10px;
  color: rgba(160, 132, 80, 0.72);
  font-family: "Roboto Mono", monospace;
  font-size: 0.63rem;
}

.comment-headline {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 300;
  line-height: 1.45;
  letter-spacing: 0;
}

.comment-body-panel {
  margin: 14px 0 18px;
  padding: 12px 14px 14px;
  border: 1px solid rgba(205, 177, 127, 0.14);
  background: rgba(255, 252, 246, 0.92);
}

.comment-body-label {
  margin-bottom: 10px;
  color: var(--accent);
  font-family: "Roboto Mono", monospace;
  font-size: 0.64rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.comment-body {
  margin: 0;
  color: rgba(79, 52, 8, 0.88);
  white-space: pre-wrap;
  line-height: 1.7;
  font-size: 0.84rem;
}

.reply-list {
  display: grid;
  gap: 0;
  margin-bottom: 14px;
}

.reply-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid rgba(198, 161, 90, 0.1);
}

.reply-section-title {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 300;
}

.reply-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid rgba(198, 161, 90, 0.1);
  font-size: 0.8rem;
}

.reply-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: linear-gradient(180deg, #fbf2df, #e8d7b3);
  color: #584220;
}

.reply-main {
  flex: 1 1 auto;
  display: grid;
  gap: 4px;
}

.reply-author-line {
  font-size: 0.84rem;
  font-weight: 300;
}

.reply-copy {
  color: rgba(79, 52, 8, 0.82);
  font-size: 0.84rem;
  line-height: 1.5;
}

.reply-created {
  color: var(--muted);
  font-size: 0.7rem;
}

.reply-delete,
.comment-delete {
  height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(240, 143, 126, 0.34);
  background: rgba(121, 39, 29, 0.18);
  color: #ffc7be;
  font-family: "Noto Sans KR", sans-serif;
  font-size: 0.68rem;
  cursor: pointer;
}

.reply-empty {
  padding: 14px 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.reply-form {
  display: grid;
  grid-template-columns: 100px 1fr 68px;
  gap: 8px;
  padding: 0 0 18px;
}

.reply-form input {
  height: 40px;
  padding: 0 10px;
  border: 1px solid rgba(205, 177, 127, 0.18);
  background: rgba(255, 253, 248, 0.96);
  color: var(--text);
  font-family: "Noto Sans KR", sans-serif;
}

.reply-form input::placeholder {
  color: rgba(176, 151, 108, 0.72);
}

.reply-form button {
  border: 1px solid rgba(220, 196, 149, 0.32);
  background: linear-gradient(180deg, #faf1dd, #e7d3aa);
  color: #584220;
  font-family: "Noto Sans KR", sans-serif;
}

.panel,
.empty {
  flex: 0 0 auto;
  width: var(--curve-card-width);
  border: 1px solid var(--panel-border);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  position: relative;
  overflow: hidden;
  height: var(--panel-height);
  display: flex;
  flex-direction: column;
}

.empty {
  padding: 24px;
  background: var(--panel-2);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 26px;
  padding: 7px 10px;
  background: linear-gradient(180deg, rgba(251, 244, 231, 0.98), rgba(235, 223, 198, 0.96));
  border-bottom: 1px solid rgba(205, 177, 127, 0.14);
}

.panel-title-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
}

.panel-dot {
  width: 8px;
  height: 8px;
  border: 1px solid rgba(242, 217, 155, 0.5);
  border-radius: 1px;
  background:
    linear-gradient(90deg, rgba(242, 217, 155, 0.38) 1px, transparent 1px),
    linear-gradient(rgba(242, 217, 155, 0.38) 1px, transparent 1px);
  background-size: 4px 4px;
}

.panel-title {
  margin: 0;
  color: #6a5330;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.panel-table-wrap {
  overflow-y: auto;
  flex: 1 1 auto;
  padding: 0 8px 0 6px;
}

.panel-table-wrap::-webkit-scrollbar {
  width: 8px;
}

.panel-table-wrap::-webkit-scrollbar-track {
  background: rgba(198, 161, 90, 0.08);
}

.panel-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(198, 161, 90, 0.24);
  border-radius: 999px;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.col-tenor {
  width: 42px;
}

.col-bid,
.col-offer {
  width: 44px;
}

th,
td {
  padding: 2px 2px;
  border-top: 1px solid rgba(205, 177, 127, 0.1);
  white-space: nowrap;
  overflow: visible;
}

th:first-child,
td:first-child {
  text-align: left;
}

th:nth-child(2),
th:nth-child(3),
td:nth-child(2),
td:nth-child(3) {
  text-align: right;
}

th {
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.01em;
  background: rgba(249, 242, 228, 0.9);
  font-weight: 300;
}

td {
  font-size: 0.85rem;
  vertical-align: top;
  line-height: 1.11;
  font-weight: 300;
}

tbody tr {
  transition: background-color 120ms ease;
  cursor: pointer;
}

tbody tr:hover {
  background: rgba(198, 161, 90, 0.08);
}

tr.flagged {
  background: var(--danger-soft);
}

.tenor-cell {
  font-weight: 300;
  font-size: 0.76rem;
}

.row-note {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.58rem;
  line-height: 1;
}

.price-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  font-weight: 300;
  font-size: 0.76rem;
}

.price-cell.price-up {
  color: var(--accent);
}

.price-cell.price-down {
  color: var(--danger);
}

@media (max-width: 900px) {
  .top-header {
    flex-direction: column;
    gap: 12px;
  }

  .brand-banner {
    width: auto;
    flex-basis: auto;
  }

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

  .hero-toolbar {
    align-items: flex-start;
  }

  .curve-grid {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .comments-board {
    width: 100%;
  }

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

  .history-chart-panel {
    border-right: 0;
    border-bottom: 1px solid var(--panel-border);
  }
}

@media (max-width: 640px) {
  .page {
    width: min(100vw - 16px, 100%);
    padding-top: 16px;
  }

  .top-header {
    gap: 10px;
    margin-bottom: 16px;
  }

  .hero {
    padding: 16px;
  }

  .hero-toolbar {
    gap: 10px;
  }

  .meta {
    margin-left: 0;
    width: 100%;
    order: 3;
  }

  .curve-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .panel {
    width: 100%;
    height: auto;
  }

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