@font-face {
  font-family: Pretendard;
  src: url("../../assets/fonts/Pretendard-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Pretendard;
  src: url("../../assets/fonts/Pretendard-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: Pretendard;
  src: url("../../assets/fonts/Pretendard-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

:root {
  --canvas: #eef1ed;
  --surface: #ffffff;
  --surface-soft: #f7f8f5;
  --ink: #17201d;
  --muted: #62706a;
  --line: #cfd6d1;
  --line-strong: #aeb9b2;
  --accent: #287153;
  --accent-soft: #e2efe8;
  --accent-ink: #15523a;
  --warn: #9b6211;
  --warn-soft: #fff2d8;
  --danger: #a33f47;
  --danger-soft: #fae8e9;
  --info: #315f91;
  --info-soft: #e7eef7;
  --shadow: 0 14px 34px rgba(24, 38, 31, 0.08);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Pretendard, "Noto Sans KR", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

button,
select {
  min-height: 44px;
}

button,
select,
input,
textarea {
  border-radius: 4px;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 100;
  padding: 12px 16px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.demo-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  min-height: 64px;
  align-items: center;
  gap: 20px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.demo-brand {
  display: flex;
  min-height: 44px;
  min-width: 0;
  align-items: center;
  gap: 12px;
  margin-right: auto;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.brand-copy {
  min-width: 0;
}

.brand-copy strong,
.brand-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy strong {
  font-size: 14px;
}

.brand-copy span {
  color: var(--muted);
  font-size: 11px;
}

.return-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.return-link:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}

.boundary-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 20px;
  border-bottom: 1px solid #dccb9e;
  background: #fff7e3;
  color: #665125;
  font-size: 12px;
  text-align: center;
}

.boundary-note strong {
  font-weight: 800;
}

.app-shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 42px;
}

.workspace-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.workspace-heading h1 {
  margin: 0;
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.15;
  word-break: keep-all;
}

.workspace-heading p {
  max-width: 680px;
  margin: 6px 0 0;
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 5px !important;
  color: var(--accent-ink) !important;
  font-size: 11px !important;
  font-weight: 800;
  text-transform: uppercase;
}

.evidence-chip {
  flex: 0 0 auto;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
}

.evidence-chip b {
  color: var(--ink);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.field-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.field-inline label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.select,
.input,
.textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
}

.select,
.input {
  min-height: 44px;
  padding: 9px 11px;
}

.textarea {
  min-height: 112px;
  resize: vertical;
  padding: 11px 12px;
  line-height: 1.6;
}

.select:focus,
.input:focus,
.textarea:focus {
  border-color: var(--accent);
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-weight: 700;
  white-space: nowrap;
}

.button-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.button-primary:hover {
  filter: brightness(0.92);
}

.button-secondary {
  border-color: var(--line-strong);
  background: #fff;
}

.button-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}

.button-danger {
  border-color: #dbb5b8;
  background: #fff;
  color: var(--danger);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric-card {
  min-width: 0;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.metric-card span,
.metric-card strong,
.metric-card small {
  display: block;
}

.metric-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.metric-card strong {
  overflow: hidden;
  margin-top: 3px;
  font-size: 24px;
  line-height: 1.2;
  text-overflow: ellipsis;
}

.metric-card small {
  min-height: 18px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.5fr) minmax(250px, 0.72fr);
  gap: 14px;
  align-items: start;
}

.workspace-grid.two-column {
  grid-template-columns: minmax(320px, 0.78fr) minmax(0, 1.22fr);
}

.stack {
  display: grid;
  gap: 14px;
}

.panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.panel-header {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.panel-header h2,
.panel-header h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
}

.panel-header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.panel-body {
  padding: 15px;
}

.badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.badge-success {
  border-color: #acd0bc;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.badge-warning {
  border-color: #e0c48c;
  background: var(--warn-soft);
  color: var(--warn);
}

.badge-danger {
  border-color: #dfb2b6;
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-info {
  border-color: #b7c9dd;
  background: var(--info-soft);
  color: var(--info);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field {
  min-width: 0;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: #425049;
  font-size: 11px;
  font-weight: 800;
}

.field-help {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
}

.segmented button {
  min-width: 80px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
}

.status-line {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap;
}

caption {
  padding: 0;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.empty-row td {
  height: 76px;
  color: var(--muted);
  text-align: center;
}

.log-list {
  display: grid;
  max-height: 282px;
  gap: 0;
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}

.log-list li {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: #3f4b45;
  font-size: 11px;
}

.log-list li:last-child {
  border-bottom: 0;
}

.log-list time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.notice-box {
  padding: 12px;
  border-left: 3px solid var(--info);
  background: var(--info-soft);
  color: #294e73;
  font-size: 11px;
}

.notice-box strong {
  display: block;
  margin-bottom: 3px;
}

.result-block {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.result-block:first-child {
  padding-top: 0;
}

.result-block:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.result-block h3 {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.result-block p {
  margin: 0;
}

.kv-list {
  display: grid;
  margin: 0;
}

.kv-list div {
  display: grid;
  grid-template-columns: 98px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.kv-list div:last-child {
  border-bottom: 0;
}

.kv-list dt {
  color: var(--muted);
  font-size: 11px;
}

.kv-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 700;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid #6f4a00;
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1120px) {
  .workspace-grid {
    grid-template-columns: minmax(250px, 0.75fr) minmax(0, 1.25fr);
  }

  .workspace-grid > .stack:last-child {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .demo-topbar {
    padding-inline: 14px;
  }

  .app-shell {
    width: min(100% - 20px, 1480px);
    padding-top: 18px;
  }

  .workspace-heading,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-group,
  .field-inline {
    width: 100%;
  }

  .field-inline {
    align-items: stretch;
    flex-direction: column;
    gap: 4px;
  }

  .field-inline .select {
    width: 100%;
  }

  .toolbar-group .button {
    flex: 1 1 0;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-grid,
  .workspace-grid.two-column,
  .workspace-grid > .stack:last-child {
    grid-template-columns: 1fr;
  }

  .workspace-grid > .stack:last-child {
    grid-column: auto;
  }
}

@media (max-width: 480px) {
  .demo-topbar {
    min-height: 58px;
    gap: 8px;
  }

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

  .brand-copy span {
    display: none;
  }

  .return-link {
    padding-inline: 10px;
    font-size: 11px;
  }

  .boundary-note {
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
    padding-inline: 12px;
    text-align: left;
  }

  .workspace-heading h1 {
    font-size: 25px;
  }

  .evidence-chip {
    width: 100%;
  }

  .toolbar-group {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-group .button {
    width: 100%;
  }

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

  .field.full {
    grid-column: auto;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    min-width: 0;
  }

  .metric-card {
    padding: 13px;
  }

  .metric-card strong {
    font-size: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
