:root {
  --bg: #f4f6f0;
  --surface: #ffffff;
  --text: #1f2a1f;
  --muted: #617061;
  --line: #d6e0d0;
  --accent: #007b5e;
  --accent-strong: #005f49;
  --danger: #b72f2f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans KR", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 10% 10%, #d8f3dc 0%, transparent 35%),
    radial-gradient(circle at 90% 20%, #ffead5 0%, transparent 35%), var(--bg);
}

.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(90deg, transparent 24px, rgba(0, 0, 0, 0.03) 25px),
    linear-gradient(transparent 24px, rgba(0, 0, 0, 0.03) 25px);
  background-size: 25px 25px;
  opacity: 0.3;
}

.layout {
  max-width: 1080px;
  margin: 0 auto;
  padding: 44px 18px 80px;
  position: relative;
  z-index: 1;
}

.hero h1 {
  margin: 0 0 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 5vw, 3rem);
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.hero .eyebrow {
  margin: 0;
  color: var(--accent-strong);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.hero .desc {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
}

.card {
  margin-top: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 12px 20px rgba(35, 52, 35, 0.08);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

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

h2,
h3 {
  margin: 0 0 6px;
}

.sub,
.hint,
.future p {
  margin: 0;
  color: var(--muted);
}

form {
  display: grid;
  gap: 12px;
  max-width: 420px;
}

label {
  display: grid;
  gap: 5px;
  font-weight: 500;
}

input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  font: inherit;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.button-link {
  display: inline-block;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}

.button-link:hover {
  background: var(--accent-strong);
}

button:hover {
  background: var(--accent-strong);
}

.ghost {
  background: #e8f3ee;
  color: #205646;
}

.ghost:hover {
  background: #d8ece4;
}

.error {
  color: var(--danger);
  min-height: 1.2em;
  margin: 10px 0 0;
}

.hidden {
  display: none;
}

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

.table-wrap {
  margin-top: 12px;
  overflow: auto;
}

.tabs {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab-btn {
  background: #eef5f2;
  color: #2c5d4f;
  border: 1px solid #d8e4dd;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 600;
}

.tab-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.ad-shell {
  margin-top: 18px;
}

.ad-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.ad-slot {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  min-height: 120px;
  padding: 8px;
}

.ad-slot .adsbygoogle {
  display: block;
  min-height: 104px;
}

.ad-row td {
  padding: 10px 8px;
  background: #fbfcf8;
}

.unregistered-row td {
  background: #fff5df;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 12px 8px;
  font-size: 0.95rem;
}

th {
  color: #355241;
  white-space: nowrap;
}

.th-select {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.th-select input[type="checkbox"] {
  margin: 0;
}

.download-link {
  color: var(--accent-strong);
  font-weight: 700;
}

dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
  width: min(560px, 92vw);
}

.dialog-form {
  padding: 18px;
  display: grid;
  gap: 10px;
}

.dialog-message {
  white-space: pre-line;
  line-height: 1.45;
}

.danger-btn {
  background: var(--danger);
}

.danger-btn:hover {
  background: #982424;
}

.dropzone {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 768px) {
  .layout {
    padding-top: 28px;
  }

  .hero-top {
    flex-direction: column;
  }

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