:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-soft: #f8f9fd;
  --text: #172033;
  --muted: #667085;
  --line: #e4e7ec;
  --primary: #4757e8;
  --primary-dark: #3442c5;
  --danger: #d92d20;
  --success: #067647;
  --warning: #b54708;
  --shadow-sm: 0 8px 24px rgba(21, 31, 56, 0.07);
  --shadow-lg: 0 24px 64px rgba(21, 31, 56, 0.13);
  --radius: 22px;
  --radius-sm: 14px;
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(71, 87, 232, 0.09), transparent 30%),
    var(--bg);
  color: var(--text);
}
button, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }

.shell { min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(16px);
  background: rgba(244, 246, 251, 0.86);
  border-bottom: 1px solid rgba(228, 231, 236, 0.8);
}
.topbar-inner {
  max-width: 1360px;
  margin: 0 auto;
  min-height: 76px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(145deg, #5868f4, #2837bd);
  box-shadow: 0 10px 24px rgba(71, 87, 232, 0.28);
}
.brand-copy strong { display: block; font-size: 16px; letter-spacing: -0.02em; }
.brand-copy span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 10px; }

.btn {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 700;
  transition: 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: white; box-shadow: 0 10px 20px rgba(71, 87, 232, 0.2); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-soft { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.btn-danger { background: #fff1f0; color: var(--danger); border: 1px solid #fecdca; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-sm { padding: 8px 11px; border-radius: 10px; font-size: 13px; }

.main { max-width: 1360px; margin: 0 auto; padding: 48px 28px 70px; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px;
  margin-bottom: 34px;
}
.hero-kicker { color: var(--primary); font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.hero h1 { margin: 10px 0 12px; font-size: clamp(30px, 4vw, 48px); line-height: 1.13; letter-spacing: -0.045em; }
.hero p { margin: 0; max-width: 720px; color: var(--muted); line-height: 1.75; font-size: 16px; }
.hero-stat {
  min-width: 180px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.72);
  box-shadow: var(--shadow-sm);
}
.hero-stat span { display: block; color: var(--muted); font-size: 12px; }
.hero-stat strong { display: block; margin-top: 4px; font-size: 28px; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.search-box {
  flex: 1 1 320px;
  position: relative;
}
.search-box input {
  width: 100%;
  height: 50px;
  padding: 0 18px 0 46px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  outline: none;
  box-shadow: 0 6px 18px rgba(21, 31, 56, 0.04);
}
.search-box input:focus { border-color: #aeb6ff; box-shadow: 0 0 0 4px rgba(71,87,232,0.1); }
.search-box::before { content: '⌕'; position: absolute; left: 17px; top: 50%; transform: translateY(-50%); font-size: 23px; color: var(--muted); }
.category-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  padding: 9px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}
.chip.active { color: var(--primary); border-color: #c6ccff; background: #f1f3ff; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.app-card {
  position: relative;
  overflow: hidden;
  min-height: 245px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.app-card::after {
  content: '';
  position: absolute;
  right: -65px;
  top: -65px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--accent-soft, rgba(71, 87, 232, 0.08));
}
.app-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: rgba(71, 87, 232, 0.22); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; position: relative; z-index: 1; }
.app-icon {
  width: 54px;
  height: 54px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  font-size: 27px;
  color: #fff;
  background: var(--accent, var(--primary));
  box-shadow: 0 12px 24px color-mix(in srgb, var(--accent, var(--primary)) 28%, transparent);
}
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 700; }
.status-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #12b76a; }
.status-dot.beta::before { background: #f79009; }
.status-dot.maintenance::before { background: #98a2b3; }
.app-card h2 { margin: 23px 0 8px; font-size: 21px; letter-spacing: -0.025em; position: relative; z-index: 1; }
.app-card p { margin: 0; color: var(--muted); line-height: 1.65; font-size: 14px; position: relative; z-index: 1; }
.card-footer { margin-top: auto; padding-top: 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; position: relative; z-index: 1; }
.badge { display: inline-flex; padding: 7px 10px; border-radius: 999px; background: var(--surface-soft); color: var(--muted); font-size: 12px; font-weight: 700; }
.launch { color: var(--accent, var(--primary)); font-weight: 800; font-size: 13px; }
.empty-state { grid-column: 1 / -1; padding: 64px 24px; text-align: center; border: 1px dashed #cfd4dc; border-radius: var(--radius); color: var(--muted); background: rgba(255,255,255,0.62); }

.setting-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 24px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.panel-head { padding: 22px 24px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 18px; }
.panel-head p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.panel-body { padding: 24px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; color: #344054; font-weight: 800; }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}
.field textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: #98a2ff; box-shadow: 0 0 0 4px rgba(71, 87, 232, 0.09); }
.field small { color: var(--muted); font-size: 12px; }
.toggle-row { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; padding-top: 4px; }
.check { display: inline-flex; align-items: center; gap: 8px; color: #344054; font-size: 13px; font-weight: 700; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.app-list { display: flex; flex-direction: column; gap: 12px; }
.list-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
}
.list-card.hidden { opacity: 0.55; }
.list-icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: white; font-size: 21px; background: var(--accent); }
.list-copy { min-width: 0; }
.list-copy strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-copy span { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-actions { display: flex; gap: 6px; }
.icon-btn { width: 34px; height: 34px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; }
.icon-btn:hover { border-color: #b7bfff; color: var(--primary); }

.preview-wrap { position: sticky; top: 100px; }
.preview-label { margin: 0 0 10px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.mode-banner { margin-bottom: 18px; padding: 13px 16px; border-radius: 13px; background: #eef4ff; border: 1px solid #c7d7fe; color: #344054; font-size: 13px; }
.mode-banner strong { color: var(--primary); }

.modal-backdrop { position: fixed; inset: 0; z-index: 60; display: none; place-items: center; padding: 18px; background: rgba(16, 24, 40, 0.55); }
.modal-backdrop.show { display: grid; }
.modal { width: min(760px, 100%); max-height: calc(100vh - 36px); overflow: auto; background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-lg); }
.modal-head { padding: 22px 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; }
.modal-close { border: 0; background: transparent; font-size: 25px; color: var(--muted); }


.auth-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  color: #4285f4;
  font-size: 24px;
  font-weight: 900;
}
.auth-help {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.toast { position: fixed; right: 22px; bottom: 22px; z-index: 100; transform: translateY(25px); opacity: 0; pointer-events: none; transition: 0.2s ease; background: #101828; color: white; padding: 13px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 13px; }
.toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 1050px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .setting-layout { grid-template-columns: 1fr; }
  .preview-wrap { position: static; }
}
@media (max-width: 680px) {
  .topbar-inner, .main { padding-left: 18px; padding-right: 18px; }
  .topbar-inner { min-height: 68px; }
  .brand-copy span { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-stat { width: 100%; }
  .card-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .list-card { grid-template-columns: auto minmax(0, 1fr); }
  .list-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .top-actions .label { display: none; }
}
