/* ============================================================
   Quilo — 디자인 시스템 (modern, light/dark)
   - 색은 전부 토큰. 다크는 html[data-theme="dark"]에서 오버라이드.
   - 기존 클래스명은 그대로 유지(인라인 JS 의존). 레거시 토큰은 별칭으로 보존.
   ============================================================ */

:root {
  color-scheme: light;

  /* surfaces */
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f3f4f6;
  --surface-3: #ebedf1;
  --border: #e7e9ee;
  --border-strong: #d4d8e0;

  /* text */
  --text: #15171c;
  --text-muted: #5e6672;
  --text-faint: #8b929d;

  /* accent (refined blue, 계승) */
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-text: #2563eb;
  --accent-soft: #eaf1ff;
  --accent-border: #cfe0ff;
  --on-accent: #ffffff;

  /* semantic */
  --success: #0f9d6b;
  --success-soft: #e6f7ef;
  --danger: #d4453f;
  --danger-soft: #fdeceb;
  --danger-border: #f3c2bf;
  --warning: #a8741a;
  --warning-soft: #fff6e2;

  /* console */
  --console-bg: #0c1322;
  --console-text: #d8deea;

  /* effects */
  --ring: rgba(37, 99, 235, 0.28);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.05);
  --shadow: 0 4px 16px rgba(16, 24, 40, 0.07), 0 2px 6px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 24px 60px rgba(16, 24, 40, 0.18);
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 20px;
  --tap: cubic-bezier(0.2, 0.7, 0.3, 1);

  /* fonts */
  --font-sans:
    -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard",
    "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;

  /* ── legacy aliases (구 참조 호환) ── */
  --muted: var(--text-muted);
  --primary: var(--accent);
  --primary-dark: var(--accent-hover);
  --primary-soft: var(--accent-soft);
  --surface-soft: var(--surface-2);
  --surface-raised: var(--surface);
  --warning-bg: var(--warning-soft);
}

html[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0b0d12;
  --surface: #14171d;
  --surface-2: #1a1e26;
  --surface-3: #20252e;
  --border: #272c35;
  --border-strong: #363c47;

  --text: #e7ebf2;
  --text-muted: #9aa3b0;
  --text-faint: #69727f;

  --accent: #3b76ee;
  --accent-hover: #5288f5;
  --accent-text: #7aa6ff;
  --accent-soft: #172234;
  --accent-border: #2b3e60;
  --on-accent: #ffffff;

  --success: #18a572;
  --success-soft: #0f2a22;
  --danger: #e35d57;
  --danger-soft: #2c1614;
  --danger-border: #5a2a27;
  --warning: #d6a544;
  --warning-soft: #2a2210;

  --console-bg: #080b12;
  --console-text: #cfd6e2;

  --ring: rgba(91, 140, 255, 0.34);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.42);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
}

/* ============================================================ base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}
/* 스티키 상단바(66px) 아래로 가리지 않게 앵커 스크롤 여백 */
#features,
#how,
#reportTypes {
  scroll-margin-top: 84px;
}
/* 임베드 모드(?embed=1): 파일 변환기 탭 안 iframe 으로 쓸 때 자체 헤더/푸터를 숨긴다.
   .landing 계열 도구(이미지·PDF병합) + equation 페이지의 자체 chrome 모두 커버. */
html.embed .landing-nav,
html.embed .landing-bg,
html.embed .site-footer,
html.embed .site-topbar,
html.embed footer {
  display: none !important;
}
html.embed body,
html.embed .landing-shell,
html.embed .wrap {
  padding-top: 10px !important;
}

body {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 56px;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

h1 {
  margin: 0;
  font-size: 31px;
  font-weight: 820;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

h2 {
  margin: 28px 0 12px;
  font-size: 20px;
  font-weight: 760;
  letter-spacing: -0.01em;
}

h3 {
  font-weight: 740;
  letter-spacing: -0.01em;
}

p {
  margin: 10px 0;
}

small,
.hint,
.disclaimer {
  color: var(--text-muted);
  font-size: 13px;
}

.disclaimer {
  line-height: 1.65;
}

a {
  color: var(--accent-text);
  text-decoration: none;
  font-weight: 640;
  transition: color 140ms var(--tap);
}

a:hover {
  text-decoration: underline;
}

a:visited {
  color: var(--accent-text);
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 22px 0;
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

/* ============================================================ header */
.app-header {
  display: grid;
  gap: 18px;
  margin-bottom: 20px;
}

.app-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-size: 14px;
  color: var(--text-muted);
}

.header-actions #user {
  color: var(--text);
  font-weight: 700;
}

.app-hero {
  display: grid;
  gap: 14px;
}

.app-hero h1 {
  background: linear-gradient(180deg, var(--text), color-mix(in srgb, var(--text) 72%, var(--text-muted)));
  -webkit-background-clip: text;
  background-clip: text;
}

/* legacy topbar (admin/login) — 헤더 행으로 재사용 */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.topbar #user {
  margin-right: auto;
  color: var(--text);
  font-weight: 700;
}

/* ============================================================ card surfaces */
body > form,
body > details,
.tab-panel > form,
.settings-card,
#progressArea,
fieldset {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

body > form,
body > details,
.tab-panel > form,
.settings-card,
#progressArea {
  padding: 24px;
  margin: 16px 0;
}

.settings-card {
  display: grid;
  gap: 4px;
}

.settings-card h2 {
  margin-top: 0;
}

.settings-card + .settings-card {
  margin-top: 16px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card-head h2 {
  margin: 0;
}

/* ============================================================ tabs */
.page-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  margin: 0 0 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.page-tabs button {
  min-height: 38px;
  margin: 0;
  padding: 8px 18px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  transition: background-color 160ms var(--tap), color 160ms var(--tap);
}

.page-tabs button:hover {
  background: var(--surface-2);
  color: var(--text);
}

.page-tabs button.active {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-sm);
}

.page-tabs button.active:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}

.tab-panel[hidden],
.report-form[hidden],
.notice[hidden] {
  display: none !important;
}

body[data-auth="in"] #loginDd,
body[data-auth="out"] #acctDd {
  display: none !important;
}

/* ============================================================ report toolbar / type cards */
.report-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: stretch;
  margin-bottom: 16px;
}

.report-toolbar.has-balance {
  grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1.3fr);
}

.report-toolbar.has-balance #reportTypeFieldset {
  grid-column: 1 / -1;
}

.balance-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  align-content: center;
  min-height: 100%;
  padding: 16px 18px;
  margin: 0;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  background: var(--accent-soft);
}

.balance-box strong {
  margin-right: 4px;
  color: var(--text);
}

.balance-box span {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--accent-border);
  color: var(--text);
  font-weight: 650;
  font-size: 13px;
}

.workspace-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(210px, 0.85fr);
  gap: 12px;
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.workspace-summary[hidden] {
  display: none !important;
}

.workspace-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--text-faint);
  font-size: 11.5px;
  font-weight: 780;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.workspace-summary strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 15px;
}

.workspace-summary ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.workspace-summary li {
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 650;
}

.workspace-files {
  display: grid;
  align-content: start;
  gap: 5px;
}

.link-button {
  width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-text);
  font: inherit;
  font-weight: 760;
  cursor: pointer;
}

.link-button:hover {
  text-decoration: underline;
}

/* 보고서 종류 선택 — 카드 그리드 */
#reportTypeFieldset {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-height: 100%;
  padding: 16px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

#reportTypeFieldset .report-type-title {
  grid-column: 1 / -1;
  width: 100%;
  padding: 0;
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* hidden 속성이 label{display:flex} 에 가려지지 않도록(베타 탭 게이트) */
#reportTypeFieldset label[hidden]{display:none !important;}

#reportTypeFieldset label {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 64px;
  margin: 0;
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-weight: 740;
  line-height: 1.35;
  transition: border-color 160ms var(--tap), background-color 160ms var(--tap),
    transform 120ms var(--tap), box-shadow 160ms var(--tap);
}

#reportTypeFieldset label:hover {
  border-color: var(--border-strong);
  background: var(--surface-3);
}

#reportTypeFieldset label .rt-tag {
  font-size: 12px;
  font-weight: 650;
  color: var(--text-muted);
}

#reportTypeFieldset label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent) inset, var(--shadow-sm);
}

#reportTypeFieldset label:has(input:checked) .rt-tag {
  color: var(--accent-text);
}

#reportTypeFieldset label:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 라디오는 시각적으로 숨기되 접근성 유지 */
#reportTypeFieldset input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ============================================================ forms */
input[type="text"],
input:not([type]),
input[type="password"],
input[type="number"],
input[type="date"],
input[type="email"],
select,
textarea {
  width: min(360px, 100%);
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 140ms var(--tap), box-shadow 140ms var(--tap),
    background-color 140ms var(--tap);
}

textarea {
  line-height: 1.6;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-faint);
}

input:focus,
input:not([type]):focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

input[type="radio"],
input[type="checkbox"] {
  accent-color: var(--accent);
  width: 17px;
  height: 17px;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235e6672' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

form p {
  margin: 0;
}

form label {
  display: block;
  max-width: 100%;
  color: var(--text);
  font-weight: 640;
  line-height: 1.7;
}

form label input,
form label select,
form label textarea {
  margin-top: 6px;
}

/* report form: 섹션 스택 레이아웃 */
.report-form {
  display: grid;
  gap: 16px;
  align-items: start;
  scroll-margin-top: 92px;
}

.report-form.active.report-flow {
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 14px;
}

.report-form[hidden] {
  display: none !important;
}

.form-section {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.form-section > .form-section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.form-section-title {
  margin: 0;
  font-size: 12px;
  font-weight: 770;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.form-flow-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.report-flow > .form-flow-steps {
  grid-column: 1 / -1;
}

.form-flow-steps button {
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 760;
  text-align: center;
  cursor: pointer;
}

.form-flow-steps button:hover {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent-text);
}

.form-flow-steps button.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.report-flow > .optional-settings,
.report-flow > .form-actions,
.report-flow > .policy-check {
  grid-column: 1 / -1;
}

.report-flow > .form-section[data-flow-target="upload"],
.report-flow > .form-section[data-flow-target="info"] {
  min-height: 100%;
}

.report-flow > .form-actions {
  justify-content: space-between;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.report-form.active.report-flow[data-flow-step] {
  grid-template-columns: 1fr;
}

.report-flow[data-flow-step] > .form-section,
.report-flow[data-flow-step] > .optional-settings,
.report-flow[data-flow-step] > .policy-check,
.report-flow[data-flow-step] > .form-actions {
  grid-column: 1 / -1;
}

.report-flow[data-flow-step="upload"] > .form-section:not([data-flow-target="upload"]),
.report-flow[data-flow-step="upload"] > .optional-settings,
.report-flow[data-flow-step="upload"] > .policy-check,
.report-flow[data-flow-step="upload"] > .form-actions {
  display: none;
}

.report-flow[data-flow-step="info"] > .form-section:not([data-flow-target="info"]),
.report-flow[data-flow-step="info"] > .optional-settings,
.report-flow[data-flow-step="info"] > .policy-check,
.report-flow[data-flow-step="info"] > .form-actions {
  display: none;
}

.report-flow[data-flow-step="settings"] > .form-section,
.report-flow[data-flow-step="settings"] > .policy-check,
.report-flow[data-flow-step="settings"] > .form-actions {
  display: none;
}

.report-flow[data-flow-step="generate"] > .optional-settings {
  display: none;
}

.optional-settings {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.optional-settings > summary {
  cursor: pointer;
  padding: 14px 16px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  user-select: none;
}

.optional-settings-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 0 14px 14px;
}

.optional-settings-body .form-section {
  background: var(--surface-2);
}

.optional-settings-body .generated-note-section,
.optional-settings-body .form-section:has(textarea[id$="UserNotes"]) {
  grid-column: 1 / -1;
}

.form-section-note {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-faint);
}

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

.field-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 0;
  min-width: 0;
}

.field > label {
  display: grid;
  gap: 6px;
}

.field .field-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.field input,
.field select {
  width: 100%;
}

.req {
  color: var(--danger);
  font-weight: 800;
}

/* segmented control (출력 형식/스타일 라디오 그룹) */
.seg-group {
  display: grid;
  gap: 7px;
}

.seg-group > .field-label {
  font-size: 13px;
  font-weight: 700;
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.segmented label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  margin: 0;
  padding: 6px 14px;
  border-radius: 7px;
  color: var(--text-muted);
  font-weight: 680;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 140ms var(--tap), color 140ms var(--tap);
}

.segmented label:hover {
  color: var(--text);
}

.segmented label:has(input:checked) {
  background: var(--accent);
  color: var(--on-accent);
}

.segmented input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.segmented label:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* user notes */
.user-notes-field label {
  display: block;
}

.user-notes-field textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
}

.user-notes-field input[type="file"] {
  margin-top: 8px;
}

/* policy check */
.policy-check {
  padding: 14px 16px;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
}

.policy-check label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--text);
}

.policy-check input {
  flex: 0 0 auto;
  margin-top: 3px;
}

/* submit row */
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.form-actions .hint {
  margin: 0 auto 0 0;
}

/* ============================================================ file dropzone */
.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 96px;
  padding: 18px 16px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  text-align: center;
  cursor: pointer;
  transition: border-color 150ms var(--tap), background-color 150ms var(--tap);
}

.dropzone:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone.is-dragover {
  border-color: var(--accent);
  border-style: solid;
  background: var(--accent-soft);
}

.dropzone.is-filled {
  border-style: solid;
  border-color: var(--success);
  background: var(--success-soft);
  color: var(--text);
}

/* native input은 영역을 덮어 클릭/드롭을 그대로 받음 */
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.dropzone-icon {
  font-size: 22px;
  line-height: 1;
}

.dropzone-title {
  font-weight: 700;
  color: var(--text);
  font-size: 14px;
}

.dropzone-sub {
  font-size: 12.5px;
  color: var(--text-faint);
}

.dropzone-file {
  display: none;
  max-width: 100%;
  font-size: 13px;
  font-weight: 700;
  color: var(--success);
  overflow-wrap: anywhere;
}

.dropzone.is-filled .dropzone-file {
  display: block;
}

.dropzone.is-filled .dropzone-sub {
  display: none;
}

/* ============================================================ buttons */
button {
  min-height: 42px;
  margin: 0;
  padding: 10px 17px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  transition: background-color 140ms var(--tap), border-color 140ms var(--tap),
    color 140ms var(--tap), transform 90ms var(--tap), box-shadow 140ms var(--tap);
}

button:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

button:active {
  transform: translateY(1px);
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

button[type="submit"],
button.primary {
  border-color: transparent;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-sm);
}

button[type="submit"]:hover,
button.primary:hover {
  border-color: transparent;
  background: var(--accent-hover);
}

button.secondary,
.confirm-actions button.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

button.secondary:hover {
  background: var(--surface-2);
}

button.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}

button.ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

button.compact {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 13px;
}

.stop-btn {
  border-color: var(--danger-border);
  background: var(--danger-soft);
  color: var(--danger);
}

.stop-btn:hover {
  border-color: var(--danger);
  background: var(--danger-soft);
}

/* 큰 제출 버튼 */
.report-form .form-actions button[type="submit"] {
  min-height: 48px;
  padding: 12px 26px;
  font-size: 15.5px;
}

/* theme toggle / icon button */
.theme-toggle,
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
}

.theme-toggle:hover,
.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-strong);
}

.theme-toggle .theme-icon-dark {
  display: none;
}

html[data-theme="dark"] .theme-toggle .theme-icon-dark {
  display: inline;
}

html[data-theme="dark"] .theme-toggle .theme-icon-light {
  display: none;
}

/* ============================================================ progress area */
#progressArea {
  display: grid;
  gap: 4px;
}

.status-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-head .stop-btn {
  margin-left: auto;
}

#progressArea h2 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.progress-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 760;
}

.progress-step span {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 850;
}

.progress-step b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-step.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.progress-step.is-active span {
  background: var(--accent);
  color: var(--on-accent);
}

.progress-step.is-done {
  border-color: rgba(22, 163, 74, 0.36);
  background: rgba(22, 163, 74, 0.08);
  color: var(--success);
}

.progress-step.is-done span {
  background: var(--success);
  color: #fff;
}

.progress-step.is-error {
  border-color: rgba(220, 38, 38, 0.36);
  background: rgba(220, 38, 38, 0.08);
  color: var(--danger);
}

.progress-step.is-error span {
  background: var(--danger);
  color: #fff;
}

.progress-details {
  margin-top: 8px;
}

.progress-details summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -3px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#progressArea pre,
.console {
  max-height: 360px;
  overflow: auto;
  margin: 10px 0 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--console-bg);
  color: var(--console-text);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#resultArea {
  margin-top: 14px;
}

#resultArea a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  background: var(--success);
  color: #fff !important;
  text-decoration: none;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

#resultArea a::before {
  content: "⬇";
  font-size: 15px;
}

#resultArea a:hover {
  filter: brightness(1.05);
  text-decoration: none;
}

@media (max-width: 760px) {
  .workspace-summary,
  .report-toolbar.has-balance {
    grid-template-columns: 1fr;
  }

  .report-form.active.report-flow,
  .optional-settings-body {
    grid-template-columns: 1fr;
  }

  #filesPanel.active,
  #settingsPanel.active {
    grid-template-columns: 1fr;
  }

  .is-authenticated .home-hero {
    grid-template-columns: 1fr;
  }

  .is-authenticated .home-hero-cta {
    justify-content: flex-start;
  }

  .form-flow-steps,
  .progress-steps {
    grid-template-columns: 1fr;
  }

  .progress-step b {
    white-space: normal;
  }
}

#filesPanel.active {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1.3fr);
  gap: 16px;
  align-items: start;
}

#filesPanel.active .settings-card,
#settingsPanel.active .settings-card {
  margin: 0;
}

#filesPanel.active .settings-card + .settings-card,
#settingsPanel.active .settings-card + .settings-card {
  margin-top: 0;
}

#settingsPanel.active {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.settings-shortcuts {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0 2px;
}

.settings-shortcuts a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 760;
  text-decoration: none;
}

.settings-shortcuts a:hover {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent-text);
}

#settingsStyleCard,
#settingsDefaultsCard {
  min-height: 100%;
}

/* ============================================================ files list */
.file-filter {
  display: grid;
  gap: 6px;
  max-width: 360px;
  margin: 2px 0 4px;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 760;
}

.file-filter input {
  width: 100%;
  margin: 0;
}

.file-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.file-item {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.file-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.file-meta strong {
  overflow-wrap: anywhere;
}

.file-meta span {
  color: var(--text-muted);
  font-size: 13px;
}

.file-actions {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
  align-items: center;
}

.file-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 700;
  font-size: 13px;
}

.file-actions a:hover {
  text-decoration: none;
  background: var(--accent-border);
}

/* ============================================================ compact / feedback / settings */
.compact-form {
  max-width: 460px;
  padding: 0;
  margin: 14px 0 0;
  border: 0;
  box-shadow: none;
  display: grid;
  gap: 12px;
}

.feedback-form {
  max-width: 680px;
  display: grid;
  gap: 12px;
}

.feedback-form textarea,
.feedback-form input,
.feedback-form select {
  width: 100%;
}

.inline-status {
  display: inline-block;
  margin-left: 10px;
  font-size: 14px;
  font-weight: 700;
}

.settings-summary {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px 16px;
  margin: 14px 0 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.settings-summary dt {
  color: var(--text-muted);
  font-weight: 740;
}

.settings-summary dd {
  margin: 0;
  font-weight: 740;
}

/* ============================================================ notices */
.notice {
  padding: 15px 17px;
  margin: 14px 0;
  border: 1px solid var(--border);
  border-left: 3px solid var(--warning);
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
  box-shadow: none;
  font-size: 14px;
  line-height: 1.6;
}

.compliance-notice {
  margin: 0;
  border-left-color: var(--accent);
  background: var(--accent-soft);
}

/* ============================================================ tables (admin) */
.table-wrapper {
  overflow-x: auto;
  margin: 12px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  border: 0 !important;
  font-size: 13px;
}

thead {
  background: var(--surface-2) !important;
}

thead th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
}

table th,
table td {
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

table th {
  color: var(--text-muted);
  font-weight: 760;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

table tbody tr:hover {
  background: var(--surface-2);
}

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

td button,
th button {
  min-height: 30px;
  padding: 4px 9px;
  font-size: 12px;
  margin: 1px;
}

/* ============================================================ confirm modal */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 12, 22, 0.5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: overlay-in 160ms var(--tap);
}

@keyframes overlay-in {
  from {
    opacity: 0;
  }
}

.confirm-card {
  width: min(520px, 100%);
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: card-in 200ms var(--tap);
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

.confirm-card h2 {
  margin: 0 0 16px;
  font-size: 21px;
}

.confirm-list {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 11px 16px;
  margin: 0;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.confirm-list dt {
  color: var(--text-muted);
  font-weight: 740;
}

.confirm-list dd {
  margin: 0;
  color: var(--text);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.confirm-note {
  margin: 16px 0 0;
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.6;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

/* ============================================================ legal / changelog */
.legal-page {
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.legal-page h1 {
  margin-top: 0;
}

.legal-page section {
  margin-top: 26px;
}

.legal-page h2 {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.legal-page ul {
  padding-left: 20px;
}

.legal-page li {
  margin: 7px 0;
}

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 650;
  color: var(--text-muted);
}

.legal-back:hover {
  color: var(--accent-text);
}

.legal-page table {
  margin-top: 12px;
}

.legal-page table th,
.legal-page table td {
  white-space: normal;
  border: 1px solid var(--border);
}

.version-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.version-card dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 0;
}

.version-card dt {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.version-card dd {
  margin: 5px 0 0;
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.patch-notes {
  display: grid;
  gap: 12px;
  position: relative;
}

.patch-note {
  padding: 18px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.patch-note h3 {
  margin: 6px 0 10px;
  font-size: 16px;
}

.patch-note-meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

/* ============================================================ footer */
.site-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  margin: 40px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: center;
}

.footer-copy {
  color: var(--text-faint);
  font-size: 12.5px;
  text-align: center;
  line-height: 1.6;
}

.footer-copy a {
  color: var(--text-muted);
  font-weight: 600;
}

.site-footer a {
  color: var(--text-muted);
  font-weight: 600;
}

.site-footer a:hover {
  color: var(--accent-text);
}

.site-version {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 12px;
}

/* auth (login) layout */
.auth-shell {
  width: min(420px, 100%);
  margin: 0 auto;
}

.auth-card {
  display: grid;
  gap: 14px;
}

.auth-head {
  display: grid;
  gap: 6px;
  margin-bottom: 4px;
}

.auth-head h1 {
  font-size: 26px;
}

.check-line {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-top: 11px;
  font-weight: 550;
}

.check-line input {
  flex: 0 0 auto;
  margin-top: 3px;
}

.form-error,
.error {
  margin: 12px 0 0;
  color: var(--danger);
  font-weight: 700;
}

.form-error:empty {
  display: none;
}

/* ============================================================ responsive */
@media (max-width: 760px) {
  body {
    width: min(100% - 24px, 960px);
    padding-top: 18px;
  }

  h1 {
    font-size: 25px;
  }

  .app-bar {
    flex-wrap: wrap;
  }

  .header-actions {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid var(--border);
  }

  .topbar {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  #reportTypeFieldset {
    grid-template-columns: 1fr;
  }

  .report-toolbar,
  .report-toolbar.has-balance {
    grid-template-columns: 1fr;
  }

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

  body > form,
  body > details,
  .tab-panel > form,
  .settings-card,
  #progressArea,
  .legal-page {
    padding: 18px;
  }

  .form-section {
    padding: 15px;
  }

  input[type="text"],
  input:not([type]),
  input[type="password"],
  input[type="number"],
  input[type="date"],
  input[type="email"],
  select,
  textarea {
    width: 100% !important;
  }

  button {
    min-height: 44px;
  }

  .form-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .form-actions .hint {
    margin: 6px 0 0;
    text-align: center;
  }

  .report-form .form-actions button[type="submit"] {
    width: 100%;
  }

  .page-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .page-tabs button {
    width: 100%;
  }

  .file-item {
    align-items: stretch;
    flex-direction: column;
  }

  .file-actions {
    justify-content: flex-start;
  }

  .inline-status {
    display: block;
    margin: 8px 0 0;
  }

  .confirm-card {
    padding: 20px;
  }

  .confirm-list {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .confirm-list dd {
    margin-bottom: 8px;
  }

  .confirm-actions {
    flex-direction: column-reverse;
  }

  .confirm-actions button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================ landing (marketing) */
body.landing {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

.landing-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.landing-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 50% at 78% 0%, var(--accent-soft), transparent 70%),
    radial-gradient(45% 40% at 8% 12%, color-mix(in srgb, var(--accent-soft) 70%, transparent), transparent 70%);
  opacity: 0.9;
  pointer-events: none;
}

.landing-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
}

.landing-nav-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(1120px, calc(100% - 40px));
  height: 66px;
  margin: 0 auto;
}

.landing-nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.nav-link {
  display: none;
  font-weight: 650;
  color: var(--text-muted);
}

.nav-link:hover {
  color: var(--text);
  text-decoration: none;
}

@media (min-width: 620px) {
  .nav-link {
    display: inline;
  }
}

/* hero */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 44px;
  align-items: center;
  padding: 72px 0 60px;
}

.hero-copy {
  display: grid;
  gap: 22px;
  align-content: start;
}

.eyebrow {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  font-size: clamp(33px, 5.2vw, 52px);
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.hero h1 .grad,
.home-hero h1 .grad {
  background: linear-gradient(100deg, var(--accent), #8b5cf6 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin: 0;
  max-width: 48ch;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-lg {
  min-height: 52px;
  padding: 14px 26px;
  font-size: 16px;
  border-radius: 12px;
}

a.btn-lg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

a.btn-primary {
  background: var(--accent);
  color: var(--on-accent) !important;
  border: 1px solid transparent;
  font-weight: 750;
  box-shadow: var(--shadow-sm);
}

a.btn-primary:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

a.btn-outline {
  background: var(--surface);
  color: var(--text) !important;
  border: 1px solid var(--border-strong);
  font-weight: 700;
}

a.btn-outline:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.hero-points {
  display: grid;
  gap: 9px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}

.hero-points li {
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--text-muted);
  font-size: 14px;
}

.hero-points svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--success);
}

/* login card on hero */
.login-card {
  display: grid;
  gap: 14px;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.login-card .auth-head h1 {
  font-size: 22px;
}

/* marketing sections */
.section {
  padding: 60px 0;
  border-top: 1px solid var(--border);
}

.section-head {
  display: grid;
  gap: 10px;
  max-width: 62ch;
  margin: 0 auto 38px;
  text-align: center;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(24px, 3.4vw, 32px);
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.6;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.feature-card {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 180ms var(--tap), box-shadow 180ms var(--tap),
    border-color 180ms var(--tap);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-border);
  box-shadow: var(--shadow);
}

.feature-ico {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent-text);
}

.feature-ico svg {
  width: 24px;
  height: 24px;
}

.feature-card h3 {
  margin: 0;
  font-size: 18px;
}

.feature-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.6;
}

.feature-tag {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-faint);
}

/* steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.step {
  display: grid;
  gap: 9px;
  align-content: start;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.step-num {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
}

.step h3 {
  margin: 0;
  font-size: 16px;
}

.step p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

/* cta band */
.cta-band {
  display: grid;
  gap: 16px;
  justify-items: center;
  padding: 52px 28px;
  text-align: center;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
  background: linear-gradient(
    135deg,
    var(--accent-soft),
    color-mix(in srgb, var(--accent-soft) 45%, var(--surface))
  );
}

.cta-band h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 30px);
}

.cta-band p {
  margin: 0;
  max-width: 52ch;
  color: var(--text-muted);
}

/* app banner (logged-in hero strip) */
.app-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 22px 24px;
  margin: 0 0 16px;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  background: var(--accent-soft);
  background: linear-gradient(
    135deg,
    var(--accent-soft),
    color-mix(in srgb, var(--surface) 72%, var(--accent-soft))
  );
}

.app-banner-ico {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--accent-border);
  color: var(--accent-text);
  flex: 0 0 auto;
}

.app-banner-ico svg {
  width: 24px;
  height: 24px;
}

.app-banner h2 {
  margin: 0;
  font-size: 20px;
}

.app-banner p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* report-type card icon */
#reportTypeFieldset label .rt-ico {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 4px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--accent-text);
}

#reportTypeFieldset label .rt-ico svg {
  width: 20px;
  height: 20px;
}

#reportTypeFieldset label:has(input:checked) .rt-ico {
  border-color: var(--accent-border);
}

/* section-title inline icon */
.form-section-title .sec-ico,
.feature-card .ft-i {
  vertical-align: -3px;
}

.form-section-title .sec-ico {
  width: 15px;
  height: 15px;
  margin-right: 6px;
  color: var(--accent-text);
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 40px 0 36px;
  }

  .feature-grid,
  .steps {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 44px 0;
  }
}

/* ============================================================ tool pages (/tools) */
a.feature-card {
  text-decoration: none;
  color: inherit;
}
a.feature-card:hover {
  text-decoration: none;
}

.tool-page-head {
  display: grid;
  gap: 8px;
  margin: 8px 0 22px;
}
.tool-page-head h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 34px);
  letter-spacing: -0.02em;
}
.tool-page-head p {
  margin: 0;
  max-width: 70ch;
  color: var(--text-muted);
  font-size: 15.5px;
  line-height: 1.6;
}

.quick-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 24px;
}

.quick-jump a,
.quick-jump button {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font: inherit;
  font-size: 13.5px;
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
}

.quick-jump a:hover,
.quick-jump button:hover {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent-text);
  text-decoration: none;
}

.tool-card {
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

textarea.tool-input,
input.tool-input,
select.tool-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
}
textarea.tool-input {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}
.tool-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.tool-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.tool-label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 650;
  color: var(--text-muted);
}

.tool-result {
  display: grid;
  gap: 12px;
  margin-top: 2px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}
.stat-box {
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.stat-label {
  font-size: 12.5px;
  color: var(--text-muted);
}
.stat-value {
  margin-top: 3px;
  font-size: 21px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.stat-value.sm {
  font-size: 16px;
}

.tool-out-code {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 네이버 블로그 홍보 스트립 */
.blog-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.blog-cta .blog-ico {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #03c75a;
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  flex: 0 0 auto;
}
.blog-cta .blog-txt strong {
  font-size: 15px;
}
.blog-cta .blog-txt p {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 13.5px;
}
.blog-cta .btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 18px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}
.blog-cta .btn:hover {
  background: var(--accent-hover);
  text-decoration: none;
}
@media (max-width: 560px) {
  .blog-cta .btn {
    margin-left: 0;
  }
}

/* 엑셀 미리보기 표 (data-input.js) */
.prev-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12.5px;
}
.prev-table th,
.prev-table td {
  border: 1px solid var(--border);
  padding: 4px 8px;
  text-align: left;
  white-space: nowrap;
}
.prev-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 700;
}
.prev-table .prev-rn {
  background: var(--surface-2);
  color: var(--text-faint);
  text-align: right;
}

/* ── 상단 드롭다운 네비 (CANSAT식) ─────────────────────────────────── */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  /* 좁은 본문 컬럼 밖으로 빠져나가 화면 끝까지 가는 풀폭 바(답답함 해소, SNU식) */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-bottom: 18px;
}
.topnav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 66px;
}
.topnav .brand {
  margin-right: 36px;
}
.topnav-menu {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
}
/* 계정 + 테마 토글은 오른쪽 끝으로 (가운데 항목들은 넓게 펼쳐짐) */
.nav-dd.nav-dd-right {
  margin-left: auto;
}
.nav-dd {
  position: relative;
}
.nav-dd-btn {
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  padding: 9px 9px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
/* hidden 속성이 .nav-dd-btn 의 display:inline-flex 에 덮이지 않도록(베타 메뉴 가림 보장) */
.nav-dd-btn[hidden] {
  display: none !important;
}
.nav-dd-btn:hover,
.nav-dd.open .nav-dd-btn {
  background: var(--surface-2);
  color: var(--accent-text);
}
.nav-dd .caret {
  font-size: 10px;
  opacity: 0.6;
  transition: transform 0.15s var(--tap);
}
.nav-dd.open .caret {
  transform: rotate(180deg);
}
.nav-dd-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: none;
  flex-direction: column;
}
.nav-dd-right .nav-dd-menu {
  left: auto;
  right: 0;
}
.nav-dd.open .nav-dd-menu {
  display: flex;
}
.nav-dd-menu a {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: 14.5px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-dd-menu a:hover {
  background: var(--accent-soft);
  color: var(--accent-text);
}
/* hidden 속성이 위 display:flex 에 지지 않도록 (베타 링크는 테스터에게만 노출) */
.nav-dd-menu a[hidden] {
  display: none;
}
.nav-dd-menu .dd-sep {
  height: 1px;
  background: var(--border);
  margin: 5px 4px;
}
.beta-pill {
  font-size: 10px;
  font-weight: 700;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 999px;
  padding: 1px 7px;
  margin-left: auto;
}
/* 로그인 드롭다운(폼) */
.nav-login-menu {
  min-width: 320px;
  padding: 18px;
}
.nav-login-menu .field {
  margin: 0 0 10px;
}
.nav-login-menu .field-label {
  font-size: 13px;
  display: block;
  margin-bottom: 4px;
}
.nav-login-menu input[type="text"],
.nav-login-menu input[type="password"],
.nav-login-menu input:not([type]) {
  width: 100%;
}
.nav-login-menu .check-line {
  font-size: 12.5px;
  margin: 6px 0;
}
.nav-login-menu .btn {
  width: 100%;
}
.topnav-burger {
  display: none;
  background: none;
  border: 0;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
  margin-left: auto;
  padding: 6px 10px;
}
.slim-disclaimer {
  max-width: 1100px;
  margin: 12px auto 0;
  padding: 8px 18px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
.slim-disclaimer strong {
  color: var(--text);
}
/* 홈 히어로 (홍보용 첫 화면) */
.home-hero {
  text-align: center;
  padding: clamp(40px, 6vw, 72px) 20px clamp(28px, 4vw, 48px);
  margin-bottom: 10px;
  border-radius: var(--radius-lg);
  background: radial-gradient(
    1100px 420px at 50% -25%,
    var(--accent-soft),
    transparent 72%
  );
}
.home-hero h1 {
  font-size: clamp(31px, 5.6vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin: 16px 0 0;
}
.home-hero-sub {
  max-width: 680px;
  margin: 18px auto 0;
  color: var(--text-muted);
  font-size: clamp(14px, 1.6vw, 17px);
  line-height: 1.7;
}
.home-hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 28px;
}
.home-hero-points {
  list-style: none;
  padding: 0;
  margin: 30px auto 0;
  display: flex;
  gap: 10px 22px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-muted);
}
.home-hero-points li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.home-hero-points li::before {
  content: "✓";
  color: var(--success);
  font-weight: 800;
}

.is-authenticated .home-hero {
  display: none !important;
}

.is-authenticated #features,
.is-authenticated #how {
  display: none !important;
}

.is-authenticated #reportsPanel {
  padding-top: 14px;
}

.is-authenticated .report-toolbar {
  gap: 14px;
  margin-bottom: 14px;
}

.is-authenticated #reportTypeFieldset {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.is-authenticated #reportTypeFieldset label {
  min-height: 72px;
}
/* 드롭다운은 클릭으로만 연다(호버 자동 열림 없음) — SNU식, 의도치 않은 열림 방지 */
/* 항목이 많아(보고서/도구/예시/수행평가/커뮤니티/창작/공부 + 계정) 좁은 폭에서 줄바꿈으로
   글자가 세로로 쪼개지므로, 한 줄에 다 들어가지 않는 폭부터는 햄버거 메뉴로 전환한다. */
@media (max-width: 1080px) {
  .topnav-burger {
    display: inline-block;
  }
  .topnav-menu {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 8px;
  }
  .topnav-menu.open {
    display: flex;
  }
  .nav-dd-menu {
    position: static;
    box-shadow: none;
    border: 0;
    padding: 0 0 6px 14px;
    min-width: 0;
  }
  .nav-dd-right .nav-dd-menu {
    right: auto;
  }
  .topnav-menu .theme-toggle {
    align-self: flex-start;
    margin: 6px;
  }

  .is-authenticated #reportTypeFieldset {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .is-authenticated #reportTypeFieldset label {
    min-height: 108px;
  }
}


/* ── 상단 공지 티커(마퀴) ── */
.ann-ticker{display:flex;align-items:center;gap:10px;background:linear-gradient(90deg,#eef2ff,#f5f3ff);border-bottom:1px solid #e2e6f3;padding:7px 14px;overflow:hidden;position:relative}
.ann-ticker[hidden]{display:none}
.ann-ticker .ann-bell{flex:0 0 auto;font-size:14px;line-height:1}
.ann-track{display:flex;align-items:center;white-space:nowrap;animation:ann-scroll var(--ann-dur,40s) linear infinite;will-change:transform}
.ann-ticker:hover .ann-track{animation-play-state:paused}
.ann-item{display:inline-flex;align-items:center;gap:7px;padding:0 18px;font-size:13px;color:#334155;text-decoration:none}
.ann-item:hover{color:#2950e6}
.ann-item .ann-cat{font-size:11px;font-weight:700;color:#2950e6;background:#fff;border:1px solid #dfe4fb;border-radius:999px;padding:1px 8px}
.ann-dot{color:#c7cce0;font-size:12px}
@keyframes ann-scroll{from{transform:translateX(0)}to{transform:translateX(-50%)}}
@media (prefers-reduced-motion: reduce){.ann-track{animation:none}}
[data-theme="dark"] .ann-ticker{background:linear-gradient(90deg,#1c2233,#241f33);border-color:#2b3350}
[data-theme="dark"] .ann-item{color:#cbd5e1}
[data-theme="dark"] .ann-item .ann-cat{background:#161b2b;color:#93a5ff;border-color:#2b3350}

/* hidden 속성이 label{display:inline-flex} 에 가려지지 않도록 (관리자 전용 모델 게이트) */
.segmented label[hidden]{display:none !important;}
