:root {
  --paper: #f3f1eb;
  --surface: #fffefa;
  --ink: #161918;
  --muted: #656b68;
  --line: #d6d5cf;
  --signal: #d8482b;
  --signal-dark: #a82d18;
  --mint: #17a88b;
  --console: #171b1a;
  --console-line: #313837;
  --focus: #147d9d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image: linear-gradient(#deddd7 1px, transparent 1px), linear-gradient(90deg, #deddd7 1px, transparent 1px);
  background-size: 32px 32px;
  font-family: "Noto Sans KR", sans-serif;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }

.topbar {
  min-height: 80px;
  padding: 14px clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #f7f7f2;
  background: var(--ink);
  border-bottom: 4px solid var(--signal);
}

.brand-block { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #5d6562;
  color: var(--signal);
  font: 600 24px/1 "IBM Plex Mono", monospace;
}
.eyebrow, .section-index {
  margin: 0 0 4px;
  color: var(--signal);
  font: 600 11px/1.2 "IBM Plex Mono", monospace;
  letter-spacing: 0;
}
.topbar h1 { margin: 0; font-size: clamp(15px, 2vw, 20px); letter-spacing: 0; }
.server-state { display: flex; align-items: center; gap: 9px; font-size: 13px; white-space: nowrap; }
.state-dot { width: 9px; height: 9px; border-radius: 50%; background: #d8a62b; }
.server-state.online .state-dot { background: #38c99e; box-shadow: 0 0 0 4px rgb(56 201 158 / 14%); }
.server-state.offline .state-dot { background: #ef5a3c; }

main { max-width: 1480px; margin: 0 auto; padding: 24px clamp(16px, 4vw, 64px) 64px; }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(340px, .8fr); gap: 24px; padding-top: 24px; align-items: start; }
.test-stack { display: grid; gap: 16px; }
.test-panel { padding: clamp(20px, 3vw, 32px); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 7px 24px rgb(29 32 31 / 5%); }
.panel-heading, .console-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.panel-heading > div { display: flex; align-items: baseline; gap: 12px; }
.test-number { color: var(--signal); font: 600 12px "IBM Plex Mono", monospace; }
.data-panel { border-top: 3px solid var(--mint); }
.data-panel .panel-heading > div > svg { width: 20px; color: var(--mint); }
.sensitive-preview-heading { display: flex; justify-content: space-between; gap: 16px; margin: 24px 0 8px; color: #3c423f; font-size: 13px; font-weight: 600; }
.sensitive-preview {
  min-height: 120px;
  padding: 18px;
  border: 1px solid #8f9692;
  background: #eef5f1;
  color: #18201d;
  font: 500 14px/1.8 "IBM Plex Mono", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: text;
}
.sensitive-preview:focus { outline: 3px solid rgb(20 125 157 / 16%); border-color: var(--focus); }
.preview-actions { justify-content: space-between; }
.selection-hint { color: var(--muted); font-size: 12px; }
.test-panel h2, .event-console h2 { margin: 0; font-size: 20px; letter-spacing: 0; }
.method-tag { padding: 5px 7px; border: 1px solid #bbbcb7; color: var(--muted); font: 500 10px "IBM Plex Mono", monospace; white-space: nowrap; }
label { display: block; margin: 14px 0 8px; color: #3c423f; font-size: 13px; font-weight: 600; }
textarea, input[type="text"] {
  width: 100%;
  border: 1px solid #bcbdb8;
  border-radius: 2px;
  background: #fff;
  color: var(--ink);
  outline: 0;
  transition: border-color 150ms, box-shadow 150ms;
}
textarea { min-height: 132px; resize: vertical; padding: 14px; line-height: 1.65; }
input[type="text"] { height: 46px; padding: 0 48px 0 13px; }
textarea:focus, input:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgb(20 125 157 / 13%); }
.control-row { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.control-row .metric { margin-right: auto; color: var(--muted); font: 12px "IBM Plex Mono", monospace; }
.button, .icon-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 3px;
  border: 1px solid transparent;
  font-weight: 600;
  transition: background-color 150ms, border-color 150ms, color 150ms;
}
.button { padding: 9px 14px; font-size: 13px; }
.button svg, .icon-button svg { width: 17px; height: 17px; }
.button.primary { background: var(--signal); color: #fff; }
.button.primary:hover { background: var(--signal-dark); }
.button.secondary { border-color: #a9aca7; background: #fff; color: #252a28; }
.button.secondary:hover { border-color: #6e7471; background: #f4f5f1; }
.button.ghost { background: transparent; color: #626865; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.icon-button { width: 36px; height: 36px; padding: 0; background: #f2f2ee; border-color: #d3d4cf; color: #323735; }
.icon-button.dark { background: #252a29; border-color: #414846; color: #d6dcda; }
.picker-row { display: flex; gap: 10px; flex-wrap: wrap; }
.file-picker { margin: 0; }
.drop-zone {
  min-height: 156px;
  margin-top: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px dashed #9ca19e;
  background-color: #f7f8f4;
  background-image: radial-gradient(#d1d4cf 1px, transparent 1px);
  background-size: 12px 12px;
  text-align: center;
  outline: 0;
}
.drop-zone svg { width: 28px; height: 28px; color: var(--signal); }
.drop-zone span { color: var(--muted); font-size: 12px; }
.drop-zone.drag-active, .drop-zone:focus { border-color: var(--focus); background-color: #edf7f6; }
.file-summary { margin-top: 12px; max-height: 110px; overflow: auto; color: #4f5653; font: 12px/1.7 "IBM Plex Mono", monospace; white-space: pre-line; }
.panel-copy { color: var(--muted); font-size: 13px; }

.event-console { position: sticky; top: 20px; min-height: 620px; max-height: calc(100vh - 40px); padding: 26px; color: #e8eeeb; background: var(--console); border-radius: 4px; overflow: auto; box-shadow: 0 14px 34px rgb(12 15 14 / 18%); }
.event-console .section-index { color: #64d8ba; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; padding-bottom: 16px; border-bottom: 1px solid var(--console-line); color: #9fa8a5; font: 10px "IBM Plex Mono", monospace; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend b { width: 7px; height: 7px; border-radius: 50%; }
.browser-dot { background: #e4a739; }
.server-dot { background: #3fd1ac; }
.error-dot { background: #ef6348; }
.event-list { margin: 0; padding: 0; list-style: none; }
.event-item { padding: 14px 0; display: grid; grid-template-columns: 70px 1fr; gap: 10px; border-bottom: 1px solid var(--console-line); font: 12px/1.5 "IBM Plex Mono", monospace; }
.event-time { color: #697370; }
.event-message { color: #dfe5e3; overflow-wrap: anywhere; }
.event-message strong { display: block; margin-bottom: 3px; color: #fff; font-weight: 500; }
.event-item.browser strong { color: #efbc5c; }
.event-item.server strong { color: #62ddbd; }
.event-item.error strong { color: #ff755a; }
.event-detail { color: #8e9995; }
.empty-log { min-height: 380px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #68726f; text-align: center; font: 12px/1.7 "IBM Plex Mono", monospace; }
.empty-log svg { width: 30px; height: 30px; margin-bottom: 8px; }

@media (max-width: 980px) {
  .workspace-grid { grid-template-columns: 1fr; }
  .event-console { position: static; min-height: 480px; max-height: 700px; }
}

@media (max-width: 600px) {
  .topbar { align-items: flex-start; padding: 14px 16px; }
  .brand-mark { width: 36px; height: 36px; }
  .server-state span:last-child { display: none; }
  main { padding-left: 12px; padding-right: 12px; }
  .test-panel, .event-console { padding: 18px; }
  .panel-heading { flex-direction: column; gap: 10px; }
  .panel-heading > div { align-items: flex-start; }
  .control-row .button { flex: 1 1 auto; }
  .picker-row .button { flex: 1 1 140px; }
}