: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; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.auth-page { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.auth-shell { width: 100%; max-width: none; min-height: 0; padding: 32px; display: grid; place-items: center; }
.auth-panel {
  width: min(100%, 460px);
  padding: 32px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--signal);
  border-radius: 4px;
  background: var(--surface);
  box-shadow: 10px 10px 0 rgb(22 25 24 / 10%);
}
.auth-panel .section-index { margin-bottom: 12px; }
.auth-panel h2 { margin: 0; font-size: 28px; }
.auth-panel p { margin: 10px 0 24px; color: var(--muted); }
.auth-panel .button { width: 100%; justify-content: center; text-decoration: none; }
.auth-scope { margin-top: 24px; padding-top: 16px; display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); color: var(--muted); font: 500 11px/1.4 "IBM Plex Mono", monospace; }

.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; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.user-session { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: 12px; }
.user-session > svg { flex: 0 0 auto; color: var(--mint); }
.user-session span { display: grid; min-width: 0; }
.user-session strong, .user-session small { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-session small { color: #aeb5b2; }
.session-login { min-height: 34px; padding: 0 12px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid #555d5a; border-radius: 3px; color: #f3f1eb; text-decoration: none; font-size: 12px; font-weight: 600; }
.session-login:hover { border-color: var(--mint); color: #fff; background: #282d2b; }
.session-login:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.language-switch { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #555d5a; border-radius: 3px; overflow: hidden; }
.language-option { min-width: 68px; height: 34px; padding: 0 10px; border: 0; color: #aeb5b2; background: transparent; font-size: 12px; font-weight: 600; }
.language-option + .language-option { border-left: 1px solid #555d5a; }
.language-option:hover { color: #fff; background: #282d2b; }
.language-option.active { color: #151817; background: #f3f1eb; }
.language-option:focus-visible { position: relative; outline: 2px solid var(--mint); outline-offset: -2px; }
main { max-width: 1480px; margin: 0 auto; padding: 24px clamp(16px, 4vw, 64px) 64px; }
.data-notice {
  min-height: 48px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #9cb9ae;
  border-left: 4px solid var(--mint);
  border-radius: 3px;
  color: #243b34;
  background: #eef7f3;
  font-size: 13px;
  font-weight: 600;
}
.data-notice svg { width: 19px; height: 19px; flex: 0 0 auto; color: #0c8c72; }

.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 {
  height: calc(10 * 1.8em + 38px);
  min-height: calc(10 * 1.8em + 38px);
  max-height: calc(10 * 1.8em + 38px);
  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;
  overflow-y: auto;
  scrollbar-gutter: stable;
  user-select: text;
}
.sensitive-preview:focus { outline: 3px solid rgb(20 125 157 / 16%); border-color: var(--focus); }
.data-actions { align-items: stretch; }
.selection-hint { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.download-controls { display: inline-flex; align-items: stretch; }
.download-controls #download-filename { width: 170px; height: 40px; padding: 0 10px; border-radius: 3px 0 0 3px; font-size: 12px; }
.download-menu { position: relative; display: inline-flex; }
.download-menu > .button { border-radius: 0 3px 3px 0; }
.download-menu-chevron { margin-left: 2px; }
.download-format-menu {
  position: absolute;
  z-index: 5;
  top: 0;
  left: calc(100% + 8px);
  width: 132px;
  padding: 5px;
  display: grid;
  gap: 2px;
  visibility: hidden;
  opacity: 0;
  transform: translateX(-6px);
  border: 1px solid #a9aca7;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 12px 28px rgb(22 25 24 / 16%);
  transition: opacity 120ms, transform 120ms, visibility 120ms;
}
.download-format-menu::before { content: ""; position: absolute; top: 0; right: 100%; width: 9px; height: 100%; }
.download-menu:hover .download-format-menu,
.download-menu.open .download-format-menu { visibility: visible; opacity: 1; transform: translateX(0); }
.download-format-menu button { min-height: 36px; padding: 7px 10px; display: flex; align-items: center; gap: 9px; border: 0; border-radius: 2px; color: #252a28; background: transparent; font-size: 12px; font-weight: 600; text-align: left; }
.download-format-menu button:hover,
.download-format-menu button:focus-visible { outline: 0; color: #fff; background: var(--signal); }
.download-format-menu svg { width: 16px; height: 16px; }
.test-panel h2, .event-console h2, .release-panel h2 { margin: 0; font-size: 20px; letter-spacing: 0; }
label { display: block; margin: 14px 0 8px; color: #3c423f; font-size: 13px; font-weight: 600; }
textarea, input[type="text"], input[type="number"], select {
  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; }
#sensitive-data-input {
  height: calc(10 * 1.65em + 30px);
  min-height: calc(10 * 1.65em + 30px);
  max-height: calc(10 * 1.65em + 30px);
  resize: none;
  overflow-y: auto;
  scrollbar-gutter: stable;
}
input[type="text"] { height: 46px; padding: 0 48px 0 13px; }
input[type="number"] { height: 44px; padding: 0 7px; }
select { height: 44px; margin-bottom: 12px; padding: 0 40px 0 12px; background-color: #fff; cursor: pointer; }
textarea:focus, input:focus, select:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgb(20 125 157 / 13%); }
.dataset-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: start; }
.dataset-row select { margin: 0; }
.quantity-controls { height: 44px; padding: 4px 7px; display: flex; align-items: center; gap: 5px; border: 1px solid #bcbdb8; border-radius: 2px; background: #fff; }
.quantity-controls > span { color: var(--muted); }
.quantity-controls label { margin: 0; display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.quantity-controls input { width: 52px; height: 34px; border-color: transparent; background: #f5f5f1; text-align: center; }
.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; }

.side-stack { position: sticky; top: 20px; height: calc(100vh - 40px); min-height: 620px; display: grid; grid-template-rows: minmax(320px, 1.1fr) minmax(260px, .9fr); gap: 16px; }
.event-console { min-height: 0; padding: 26px; display: flex; flex-direction: column; color: #e8eeeb; background: var(--console); border-radius: 4px; overflow: hidden; box-shadow: 0 14px 34px rgb(12 15 14 / 18%); }
.event-console .section-index { color: #64d8ba; }
.event-scroll { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.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: 220px; height: 100%; 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[hidden] { display: none; }
.empty-log svg { width: 30px; height: 30px; margin-bottom: 8px; }
.release-panel { min-height: 0; padding: 22px 24px; display: flex; flex-direction: column; border: 1px solid var(--line); border-top: 3px solid var(--signal); border-radius: 4px; background: var(--surface); box-shadow: 0 7px 24px rgb(29 32 31 / 8%); overflow: hidden; }
.release-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.release-heading > svg { width: 20px; height: 20px; color: var(--signal); }
.release-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.release-note { padding: 14px 0; border-top: 1px solid var(--line); }
.release-note:first-child { padding-top: 0; border-top: 0; }
.release-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.release-version { padding: 3px 6px; border-radius: 2px; color: #fff; background: var(--signal); font: 600 10px/1.2 "IBM Plex Mono", monospace; }
.release-date { color: var(--muted); font: 10px/1.2 "IBM Plex Mono", monospace; }
.release-note h3 { margin: 8px 0 7px; font-size: 13px; }
.release-note ul { margin: 0; padding-left: 18px; color: #555c58; font-size: 11px; line-height: 1.6; }
.release-note li + li { margin-top: 3px; }
.release-status { margin: 0; color: var(--muted); font-size: 12px; }
.keyword-dialog { width: min(760px, calc(100vw - 32px)); max-height: min(760px, calc(100vh - 40px)); padding: 0; border: 1px solid #8e9491; border-radius: 4px; color: var(--ink); background: var(--surface); box-shadow: 0 24px 70px rgb(0 0 0 / 28%); }
.keyword-dialog::backdrop { background: rgb(16 20 18 / 62%); }
.dialog-heading { position: sticky; top: 0; z-index: 1; padding: 20px 22px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.dialog-heading h2 { margin: 0; font-size: 20px; }
.keyword-catalog { padding: 22px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.keyword-group { min-width: 0; }
.keyword-group h3 { margin: 0 0 10px; font-size: 14px; }
.keyword-list { margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; list-style: none; }
.keyword-list li { padding: 5px 7px; border: 1px solid #d1d4cf; border-radius: 2px; background: #f4f5f1; font: 12px/1.3 "IBM Plex Mono", monospace; overflow-wrap: anywhere; }
.dialog-footer { position: sticky; bottom: 0; padding: 16px 22px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 18px; border-top: 1px solid var(--line); background: var(--surface); }
.dialog-footer p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.rule-package-commands { grid-column: 1 / -1; display: grid; gap: 6px; }
.rule-package-command { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; gap: 8px; }
.dialog-footer code { padding: 9px 11px; overflow-x: auto; border: 1px solid #d1d4cf; background: #f4f5f1; color: #343a37; font: 11px/1.5 "IBM Plex Mono", monospace; white-space: nowrap; }
.copy-command { align-self: center; }
.copy-command.copied { border-color: var(--mint); background: #e7f7f1; color: #08755f; }

@media (max-width: 980px) {
  .workspace-grid { grid-template-columns: 1fr; }
  .side-stack { position: static; height: auto; min-height: 0; grid-template-rows: 480px minmax(320px, auto); }
  .release-panel { max-height: 520px; }
}

@media (max-width: 600px) {
  .topbar { align-items: flex-start; padding: 14px 16px; }
  .brand-mark { width: 36px; height: 36px; }
  .topbar-actions { flex-direction: column; align-items: flex-end; gap: 8px; }
  .language-option { min-width: 58px; padding: 0 7px; }
  main { padding-left: 12px; padding-right: 12px; }
  .test-panel, .event-console, .release-panel { padding: 18px; }
  .side-stack { grid-template-rows: 440px minmax(320px, auto); }
  .panel-heading { flex-direction: column; gap: 10px; }
  .panel-heading > div { align-items: flex-start; }
  .control-row .button { flex: 1 1 auto; }
  .download-controls { width: 100%; }
  .download-controls #download-filename { width: min(42%, 180px); }
  .download-menu { width: 100%; }
  .download-menu > .button { flex: 1 1 auto; }
  .download-format-menu { top: calc(100% + 8px); right: 0; left: auto; width: 100%; transform: translateY(-6px); }
  .download-format-menu::before { right: 0; bottom: 100%; width: 100%; height: 9px; }
  .download-menu:hover .download-format-menu,
  .download-menu.open .download-format-menu { transform: translateY(0); }
  .picker-row .button { flex: 1 1 140px; }
  .dataset-row { grid-template-columns: 1fr; }
  .quantity-controls { justify-content: center; }
  .keyword-catalog { grid-template-columns: 1fr; }
  .dialog-footer { grid-template-columns: 1fr; }
  .rule-package-commands { grid-column: 1; }
}

/* Microsoft Fluent-inspired visual system */
:root {
  color-scheme: light;
  --paper: #f5f5f5;
  --surface: #ffffff;
  --surface-subtle: #fafafa;
  --ink: #242424;
  --muted: #616161;
  --line: #e0e0e0;
  --line-strong: #c7c7c7;
  --signal: #0f6cbd;
  --signal-dark: #115ea3;
  --signal-light: #ebf3fc;
  --mint: #107c10;
  --console: #1f1f1f;
  --console-line: #424242;
  --focus: #0f6cbd;
  --danger: #d13438;
  --radius-small: 4px;
  --radius-medium: 8px;
  --radius-large: 12px;
  --shadow-2: 0 2px 4px rgb(0 0 0 / 8%);
  --shadow-8: 0 4px 8px rgb(0 0 0 / 12%);
  --shadow-16: 0 8px 16px rgb(0 0 0 / 14%);
  --font-sans: "Segoe UI Variable", "Segoe UI", "Noto Sans KR", sans-serif;
  --font-mono: "Cascadia Code", "Cascadia Mono", Consolas, monospace;
}

html { min-width: 320px; background: var(--paper); }

body {
  min-height: 100vh;
  background: var(--paper);
  background-image: none;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font-family: inherit; }

button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.topbar {
  position: relative;
  z-index: 10;
  min-height: 64px;
  padding: 10px clamp(20px, 4vw, 56px);
  color: var(--ink);
  background: rgb(255 255 255 / 94%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 2px rgb(0 0 0 / 4%);
  backdrop-filter: saturate(180%) blur(16px);
}

.brand-block { gap: 12px; }
.brand-mark {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--radius-medium);
  color: #fff;
  background: linear-gradient(135deg, #0f6cbd, #5b5fc7);
  box-shadow: 0 2px 6px rgb(15 108 189 / 24%);
  font: inherit;
}
.brand-mark svg { width: 21px; height: 21px; stroke-width: 1.8; }
.eyebrow, .section-index {
  margin-bottom: 2px;
  color: var(--signal);
  font: 600 10px/1.2 var(--font-sans);
  letter-spacing: .08em;
}
.topbar h1 { color: #242424; font-size: clamp(15px, 1.6vw, 18px); font-weight: 600; }
.topbar-actions { gap: 12px; }
.user-session { font-size: 12px; }
.user-session > svg { color: var(--signal); }
.user-session small { color: var(--muted); }

.session-login {
  min-height: 32px;
  border-color: var(--line-strong);
  border-radius: var(--radius-small);
  color: var(--ink);
  background: #fff;
}
.session-login:hover { border-color: #adadad; color: var(--ink); background: #f5f5f5; }
.session-login:focus-visible { outline-color: var(--focus); }

.language-switch {
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f5f5f5;
}
.language-option { min-width: 64px; height: 28px; border-radius: 4px; color: var(--muted); }
.language-option + .language-option { border-left: 0; }
.language-option:hover { color: var(--ink); background: #eaeaea; }
.language-option.active { color: var(--signal-dark); background: #fff; box-shadow: var(--shadow-2); }
.language-option:focus-visible { outline-color: var(--focus); outline-offset: 0; }

main { max-width: 1500px; padding: 24px clamp(16px, 4vw, 56px) 64px; }
.data-notice {
  min-height: 44px;
  border: 1px solid #c7e0f4;
  border-left: 3px solid var(--signal);
  border-radius: var(--radius-medium);
  color: #174a70;
  background: #eff6fc;
  font-weight: 500;
}
.data-notice svg { color: var(--signal); }

.workspace-grid { grid-template-columns: minmax(0, 1.55fr) minmax(340px, .78fr); gap: 20px; padding-top: 20px; }
.test-stack { gap: 16px; }
.test-panel,
.release-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  background: var(--surface);
  box-shadow: var(--shadow-2);
}
.test-panel { padding: clamp(20px, 2.6vw, 28px); }
.test-panel:hover { border-color: #d1d1d1; box-shadow: 0 3px 8px rgb(0 0 0 / 7%); }
.panel-heading, .console-heading { margin-bottom: 20px; }
.panel-heading > div { gap: 10px; }
.test-number {
  min-width: 26px;
  height: 22px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 4px;
  color: var(--signal-dark);
  background: var(--signal-light);
  font: 600 11px var(--font-sans);
}
.data-panel { border-top: 1px solid var(--line); }
.data-panel .panel-heading > div > svg { color: var(--signal); }
.test-panel h2, .event-console h2, .release-panel h2 { font-size: 18px; font-weight: 600; }
.panel-copy { color: var(--muted); line-height: 1.55; }

label { color: #424242; font-size: 13px; font-weight: 600; }
textarea, input[type="text"], input[type="number"], select {
  border-color: var(--line-strong);
  border-radius: var(--radius-small);
  color: var(--ink);
  background: #fff;
  transition: border-color 100ms ease, box-shadow 100ms ease, background-color 100ms ease;
}
textarea:hover, input:hover, select:hover { border-color: #8a8886; }
textarea:focus, input:focus, select:focus {
  border-color: var(--focus);
  box-shadow: inset 0 -2px 0 var(--focus), 0 0 0 1px var(--focus);
}
textarea { padding: 12px; line-height: 1.55; }
input[type="text"] { height: 40px; }
input[type="number"], select { height: 40px; }
.dataset-row { gap: 8px; }
.quantity-controls { height: 40px; border-color: var(--line-strong); border-radius: var(--radius-small); }
.quantity-controls input { height: 30px; border-radius: 3px; background: #f5f5f5; }
.control-row { gap: 8px; }
.control-row .metric { font: 12px var(--font-sans); }

.button, .icon-button {
  min-height: 32px;
  border-radius: var(--radius-small);
  font-weight: 600;
  transition: background-color 100ms ease, border-color 100ms ease, color 100ms ease, box-shadow 100ms ease, transform 100ms ease;
}
.button { padding: 6px 12px; font-size: 13px; }
.button:hover:not(:disabled), .icon-button:hover:not(:disabled) { box-shadow: var(--shadow-2); }
.button:active:not(:disabled), .icon-button:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
.button.primary { border-color: var(--signal); background: var(--signal); }
.button.primary:hover { border-color: var(--signal-dark); background: var(--signal-dark); }
.button.secondary { border-color: var(--line-strong); color: var(--ink); }
.button.secondary:hover { border-color: #adadad; background: #f5f5f5; }
.button.ghost { color: var(--signal-dark); }
.button.ghost:hover { background: var(--signal-light); }
.button:disabled { opacity: .5; }
.icon-button { width: 32px; height: 32px; background: #fff; border-color: var(--line); color: #424242; }
.icon-button:hover { background: #f5f5f5; }
.icon-button.dark { background: #333; border-color: #4d4d4d; color: #fff; }

.drop-zone {
  min-height: 148px;
  border: 1px dashed #929292;
  border-radius: var(--radius-medium);
  background: var(--surface-subtle);
  background-image: none;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}
.drop-zone svg { width: 32px; height: 32px; color: var(--signal); }
.drop-zone.drag-active, .drop-zone:focus {
  border-color: var(--focus);
  background: var(--signal-light);
  box-shadow: inset 0 0 0 1px var(--focus);
}
.file-summary { color: var(--muted); font-family: var(--font-mono); }

.sensitive-preview-heading { color: #424242; }
.sensitive-preview {
  border-color: var(--line-strong);
  border-radius: var(--radius-small);
  color: #242424;
  background: #fafafa;
  font-family: var(--font-mono);
  font-size: 13px;
}
.sensitive-preview:focus { border-color: var(--focus); outline: 2px solid rgb(15 108 189 / 18%); }
.download-controls #download-filename { height: 32px; border-radius: 4px 0 0 4px; }
.download-menu > .button { border-radius: 0 4px 4px 0; }
.download-format-menu {
  border-color: var(--line);
  border-radius: var(--radius-medium);
  box-shadow: var(--shadow-16);
  transform: translateX(-4px) scale(.98);
  transform-origin: left top;
  transition: opacity 100ms ease, transform 100ms ease, visibility 100ms;
}
.download-menu:hover .download-format-menu,
.download-menu.open .download-format-menu { transform: translateX(0) scale(1); }
.download-format-menu button { border-radius: var(--radius-small); color: var(--ink); font-family: var(--font-sans); }
.download-format-menu button:hover,
.download-format-menu button:focus-visible { color: var(--ink); background: #f0f0f0; }

.side-stack { top: 16px; height: calc(100vh - 32px); gap: 16px; }
.event-console {
  padding: 24px;
  border: 1px solid #333;
  border-radius: var(--radius-large);
  background: linear-gradient(145deg, #242424, #1b1b1b);
  box-shadow: var(--shadow-8);
}
.event-console .section-index { color: #75b6e7; }
.legend { font-family: var(--font-sans); font-size: 11px; }
.browser-dot { background: #fce100; }
.server-dot { background: #6ccb5f; }
.error-dot { background: #f1707b; }
.event-item { grid-template-columns: 66px 1fr; font-family: var(--font-mono); font-size: 11px; }
.event-item.browser strong { color: #fce100; }
.event-item.server strong { color: #6ccb5f; }
.event-item.error strong { color: #f1707b; }
.empty-log { font-family: var(--font-sans); }

.release-panel { padding: 22px; border-top: 1px solid var(--line); }
.release-heading > svg { color: var(--signal); }
.release-version { border-radius: 999px; background: var(--signal); font-family: var(--font-sans); }
.release-date { font-family: var(--font-sans); }
.release-note ul { color: var(--muted); font-size: 12px; }

.keyword-dialog {
  border: 0;
  border-radius: var(--radius-large);
  box-shadow: 0 24px 64px rgb(0 0 0 / 24%);
}
.keyword-dialog::backdrop { background: rgb(0 0 0 / 42%); backdrop-filter: blur(2px); }
.dialog-heading { padding: 18px 22px; }
.keyword-list li { border-color: #d6e8f7; border-radius: 999px; color: #174a70; background: #eff6fc; font-family: var(--font-sans); }
.dialog-footer code { border-color: var(--line); border-radius: var(--radius-small); background: #f5f5f5; font-family: var(--font-mono); }
.copy-command.copied { border-color: #54b054; background: #f1faf1; color: #0e700e; }

.auth-page {
  background-color: #f5f5f5;
  background-image:
    radial-gradient(circle at 12% 15%, rgb(15 108 189 / 12%), transparent 30%),
    radial-gradient(circle at 88% 82%, rgb(91 95 199 / 12%), transparent 34%);
}
.auth-shell { padding: 48px 24px; }
.auth-panel {
  width: min(100%, 440px);
  padding: 40px;
  border: 1px solid var(--line);
  border-top: 1px solid var(--line);
  border-radius: var(--radius-large);
  box-shadow: 0 12px 36px rgb(0 0 0 / 12%);
}
.auth-panel h2 { font-size: 28px; font-weight: 600; }
.auth-panel p { line-height: 1.6; }
.auth-panel .button { min-height: 40px; }
.auth-scope { color: var(--muted); font-family: var(--font-sans); font-size: 11px; }

@media (max-width: 1100px) {
  .workspace-grid { grid-template-columns: 1fr; }
  .side-stack { position: static; height: auto; min-height: 0; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); grid-template-rows: 460px; }
  .release-panel { max-height: none; }
}

@media (max-width: 760px) {
  .topbar { align-items: flex-start; flex-direction: column; gap: 10px; }
  .topbar-actions { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .side-stack { grid-template-columns: 1fr; grid-template-rows: 440px minmax(320px, auto); }
  .dataset-row { grid-template-columns: 1fr; }
  .quantity-controls { justify-content: center; }
}

@media (max-width: 600px) {
  .topbar { padding: 12px 16px; }
  .brand-mark { width: 34px; height: 34px; }
  .topbar-actions { align-items: center; flex-direction: row; gap: 8px; }
  .user-session { order: 3; width: 100%; }
  main { padding-top: 16px; }
  .test-panel, .event-console, .release-panel { padding: 18px; border-radius: var(--radius-medium); }
  .panel-heading { flex-direction: row; }
  .control-row { align-items: stretch; }
  .control-row .button { min-height: 36px; }
  .download-format-menu { transform: translateY(-4px) scale(.98); transform-origin: top right; }
  .download-menu:hover .download-format-menu,
  .download-menu.open .download-format-menu { transform: translateY(0) scale(1); }
  .auth-shell { padding: 28px 16px; }
  .auth-panel { padding: 28px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}