:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #eef4f1;
  --text: #18201d;
  --muted: #63706b;
  --line: #dce3df;
  --primary: #0f766e;
  --primary-dark: #0b5f59;
  --accent: #c2410c;
  --stable: #0f766e;
  --beta: #8a5a00;
  --shadow: 0 14px 36px rgba(18, 32, 28, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "Noto Sans KR", sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  background: #10231f;
  color: #fff;
  border-bottom: 5px solid var(--primary);
}

.header-inner,
.main,
.tool-layout {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  padding: 34px 0 30px;
}

.eyebrow {
  color: #a8d8d1;
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 8px;
}

h1 {
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.08;
  margin: 0 0 12px;
  letter-spacing: 0;
}

.subtitle {
  color: #d8e6e2;
  font-size: 18px;
  margin: 0;
  max-width: 720px;
}

.main {
  padding: 28px 0 56px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-head h2,
.panel h2 {
  margin: 0;
  font-size: 22px;
}

.section-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.chip,
.ghost-button,
.button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chip.is-active,
.button.primary,
.button:hover,
.ghost-button:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

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

.tool-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.tool-card {
  min-height: 236px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.tool-card:hover,
.tool-card:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 14px 30px rgba(15, 118, 110, 0.14);
  transform: translateY(-1px);
  outline: none;
}

.card-topline,
.tool-actions,
.tool-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.category {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
}

.program-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.program-meta span {
  background: #eef4f1;
  border: 1px solid #cfe0d9;
  border-radius: 999px;
  color: #29443d;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  padding: 5px 8px;
}

.status {
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 9px;
  white-space: nowrap;
}

.status.stable {
  background: #ddf5ed;
  color: var(--stable);
}

.status.beta {
  background: #fff1cc;
  color: var(--beta);
}

.tool-card h2 {
  font-size: 20px;
  line-height: 1.25;
  margin: 16px 0 8px;
}

.tool-card p {
  color: var(--muted);
  margin: 0 0 18px;
}

.tool-card .button {
  margin-top: auto;
}

.tool-main {
  padding: 26px 0 54px;
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
}

.tool-hero {
  background: #10231f;
  color: #fff;
  padding: 28px 0;
}

.tool-hero p {
  color: #d8e6e2;
  margin: 8px 0 0;
}

.panel {
  padding: 20px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field span {
  font-weight: 800;
  font-size: 14px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 11px 12px;
}

textarea {
  min-height: 112px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: 3px solid rgba(15, 118, 110, 0.15);
  border-color: var(--primary);
}

.notice {
  background: var(--surface-soft);
  border: 1px solid #cfe0d9;
  border-radius: 8px;
  color: #29443d;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.tool-card.is-disabled {
  opacity: 0.72;
}

.status.maintenance {
  background: #f3f4f6;
  color: #4b5563;
}

.output {
  min-height: 420px;
  background: #fbfcfc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.footer {
  border-top: 1px solid var(--line);
  padding: 22px 0;
  color: var(--muted);
  text-align: center;
}

.auth-nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.auth-nav a,
.auth-nav button {
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 8px 11px;
  text-decoration: none;
}

@media (max-width: 860px) {
  .tool-grid,
  .tool-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 520px) {
  .header-inner,
  .main,
  .tool-layout {
    width: min(100% - 22px, 1120px);
  }

  .header-inner {
    padding: 26px 0 24px;
  }

  .tool-actions,
  .tool-meta {
    align-items: stretch;
    flex-direction: column;
  }

  .button,
  .ghost-button,
  .chip {
    width: 100%;
  }
}
