:root {
  --bg: #0b0f17;
  --surface: #131926;
  --surface-2: #1b2334;
  --border: #263147;
  --text: #eef3fa;
  --muted: #93a2b8;
  --accent: #3b82f6;
  --accent-2: #2dd4bf;
  --accent-soft: rgba(59, 130, 246, 0.14);
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.15);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.16);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.16);
  --radius: 14px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

[data-theme="light"] {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --border: #dfe6f2;
  --text: #111827;
  --muted: #55637a;
  --accent: #2563eb;
  --accent-2: #0d9488;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --green: #16a34a;
  --green-soft: rgba(22, 163, 74, 0.12);
  --amber: #d97706;
  --amber-soft: rgba(217, 119, 6, 0.12);
  --red: #dc2626;
  --red-soft: rgba(220, 38, 38, 0.12);
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Pretendard Variable", Pretendard, "Malgun Gothic", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  overflow-x: hidden;
}

.app-shell {
  max-width: 1340px;
  margin: 0 auto;
  padding: 18px 20px 56px;
}

/* Header */
.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

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

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.live-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: livePulse 1.6s infinite;
}

@keyframes livePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.45); opacity: 0.45; }
}

.subtitle {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.date-pill {
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

/* Hero Banner with immediate auto-running motion */
.hero-banner {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(135deg, #0f172a 0%, #162238 55%, #0f2731 100%);
  border: 1px solid rgba(45, 212, 191, 0.22);
  padding: 28px 28px 22px;
  margin-bottom: 20px;
  color: #f1f5f9;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.32);
}

[data-theme="light"] .hero-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1a2844 58%, #10323e 100%);
  color: #f1f5f9;
}

.hero-aura {
  position: absolute;
  inset: -40% -20%;
  background:
    radial-gradient(circle at 18% 35%, rgba(59, 130, 246, 0.28), transparent 46%),
    radial-gradient(circle at 82% 40%, rgba(45, 212, 191, 0.24), transparent 44%);
  animation: auraDrift 11s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes auraDrift {
  0% { transform: translate3d(-2%, -1%, 0) scale(1); }
  100% { transform: translate3d(3%, 2%, 0) scale(1.06); }
}

.hero-radar-visual {
  position: absolute;
  right: 36px;
  top: 24px;
  width: 220px;
  height: 220px;
  pointer-events: none;
  opacity: 0.72;
}

.radar-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(45, 212, 191, 0.26);
}

.radar-ring.r1 { animation: radarPing 3.6s ease-out infinite; }
.radar-ring.r2 { inset: 28px; border-color: rgba(59, 130, 246, 0.34); }
.radar-ring.r3 { inset: 62px; border-color: rgba(45, 212, 191, 0.42); }

.radar-sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(45, 212, 191, 0.34), rgba(45, 212, 191, 0) 68deg, transparent 360deg);
  animation: radarSpin 4.2s linear infinite;
}

.radar-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: #2dd4bf;
  box-shadow: 0 0 18px rgba(45, 212, 191, 0.9);
}

@keyframes radarSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes radarPing {
  0% { transform: scale(0.45); opacity: 0.9; }
  100% { transform: scale(1.12); opacity: 0; }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 780px;
  animation: heroRise 0.55s ease-out both;
}

@keyframes heroRise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.pulse-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.16);
  border: 1px solid rgba(45, 212, 191, 0.38);
  color: #5eead4;
  font-size: 12px;
  font-weight: 700;
}

.hero-updated {
  font-size: 12px;
  color: #94a3b8;
}

.hero-title {
  margin: 0 0 10px;
  font-size: clamp(24px, 3.1vw, 34px);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.6px;
}

.hero-title span {
  background: linear-gradient(90deg, #5eead4, #60a5fa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-desc {
  margin: 0 0 18px;
  font-size: 14px;
  color: #cbd5e1;
  max-width: 700px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.hero-banner .btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #f8fafc;
}

.hero-banner .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: #2dd4bf;
}

/* KPI Grid inside Hero */
.kpi-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.kpi-card {
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  padding: 14px 16px;
  backdrop-filter: blur(8px);
}

.kpi-label { font-size: 12px; color: #94a3b8; font-weight: 600; }
.kpi-value { font-size: 22px; font-weight: 800; margin: 4px 0 3px; letter-spacing: -0.4px; color: #fff; }
.kpi-value.accent { color: #5eead4; }
.kpi-value.green { color: #4ade80; }
.kpi-value.warn { color: #fbbf24; }
.kpi-sub { font-size: 11.5px; color: #94a3b8; }

/* Navigation Tabs */
.tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.tab-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  padding: 10px 15px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  transition: all 0.15s ease;
}

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

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.2s ease; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Subtabs */
.subtab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.subtab-btn {
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.subtab-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.subtab-panel { display: none; }
.subtab-panel.active { display: block; }

/* Toolbar & Forms */
.panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.toolbar-left, .toolbar-right, .inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.input {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
}

.input:focus { border-color: var(--accent); }
.input-wide { min-width: 320px; }
.textarea { width: 100%; resize: vertical; }
.mono { font-family: "Cascadia Code", Consolas, "Malgun Gothic", monospace; font-size: 12.5px; }

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.btn-lg { padding: 11px 18px; font-size: 13.5px; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-full { width: 100%; padding: 12px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-accent-soft { background: var(--accent-soft); color: var(--accent); border-color: rgba(59, 130, 246, 0.35); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-danger { background: var(--red-soft); color: var(--red); }

.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12.5px;
  cursor: pointer;
  user-select: none;
}

/* Pills */
.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.cat-pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.cat-pill.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}

.pill-safe { background: var(--green-soft); color: var(--green); }
.pill-accent { background: var(--accent-soft); color: var(--accent); }
.pill-warn { background: var(--amber-soft); color: var(--amber); }
.pill-danger { background: var(--red-soft); color: var(--red); }
.pill-muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

/* Radar Feed Grid */
.radar-status-bar {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 12px;
}

.radar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

.radar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.radar-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.radar-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.radar-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.42;
}

.radar-source {
  font-size: 12px;
  color: var(--muted);
}

.radar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
  padding-top: 6px;
}

.radar-actions .btn-primary { flex: 1; }

/* Directory Channel Cards */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
}

.channel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow);
}

.channel-card.checked-today { border-color: var(--green); }
.channel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.channel-title { margin: 0; font-size: 15.5px; font-weight: 800; }
.channel-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.channel-info { font-size: 13px; }
.channel-tip { font-size: 12.5px; color: var(--muted); background: var(--surface-2); padding: 8px 10px; border-radius: 8px; }
.channel-checks { display: flex; gap: 12px; font-size: 12.5px; padding-top: 2px; }
.channel-checks label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.channel-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; }
.channel-actions a { flex: 1; }

/* Tracker Table */
.tracker-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: var(--shadow);
}

.tracker-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tracker-table th, .tracker-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.tracker-table th { color: var(--muted); font-weight: 700; font-size: 12px; background: var(--surface-2); }
.tracker-table tr:last-child td { border-bottom: none; }
.item-title { font-weight: 700; font-size: 14px; }
.item-title a { color: inherit; text-decoration: underline; text-decoration-color: var(--accent); }
.item-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Layouts & Cards */
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.stack-col { display: flex; flex-direction: column; gap: 14px; }

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

.card h2 { margin: 0 0 6px; font-size: 17px; }
.card h3 { margin: 0 0 8px; font-size: 15px; }
.muted { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.mt-8 { margin-top: 8px; }
.mt-20 { margin-top: 20px; }

.card-head-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.form-grid { display: flex; flex-direction: column; gap: 12px; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.form-grid label .input { color: var(--text); font-weight: 400; }
.form-row-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.inline-check { flex-direction: row !important; align-items: center; gap: 8px !important; color: var(--text) !important; cursor: pointer; }

.ftc-box {
  background: var(--surface-2);
  border: 1px dashed var(--accent);
  border-radius: 10px;
  padding: 12px;
  font-size: 13px;
  white-space: pre-wrap;
}

.checklist { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.checklist label { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.verify-status { margin-top: 12px; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); font-size: 12.5px; font-weight: 700; }
.verify-status.ok { background: var(--green-soft); color: var(--green); }

/* Blog Kit & Snippets */
.snippet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 13px; font-weight: 700; }
.copy-preview { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.warning-note { padding: 10px 13px; border-radius: 10px; background: var(--amber-soft); color: var(--amber); font-size: 12.5px; margin-bottom: 14px; }

.asset-cards { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.asset-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.asset-card.wide { flex-direction: column; align-items: stretch; gap: 10px; }
.asset-thumb.square { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; border: 1px solid var(--border); }
.asset-thumb.wide { width: 100%; border-radius: 10px; border: 1px solid var(--border); display: block; }
.asset-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Guide & Tax */
.guide-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.guide-table th, .guide-table td { border: 1px solid var(--border); padding: 9px 10px; text-align: left; vertical-align: top; }
.guide-table th { background: var(--surface-2); }
.bullet-list { margin: 8px 0 0; padding-left: 18px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.tax-result { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; font-size: 13.5px; display: flex; flex-direction: column; gap: 6px; }
.tip-box { background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; font-size: 13px; }
.tip-box p { margin: 6px 0 0; }

/* Footer */
.site-footer {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

/* Modal */
.modal { border: none; padding: 0; background: transparent; max-width: 560px; width: calc(100% - 24px); }
.modal::backdrop { background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(2px); }
.modal-card { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

/* Toast */
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: var(--text);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 999;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 980px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr; }
  .hero-radar-visual { width: 150px; height: 150px; right: 16px; top: 16px; opacity: 0.45; }
}

@media (max-width: 600px) {
  .hero-banner { padding: 20px 16px 18px; }
  .hero-radar-visual { display: none; }
  .kpi-grid, .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
  .input-wide { min-width: 100%; }
  .radar-grid, .channel-grid { grid-template-columns: 1fr; }
}
