:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-soft: #f8f9fc;
    --text: #17191f;
    --muted: #6c7280;
    --line: #e1e5ee;
    --primary: #14151a;
    --primary-hover: #30323a;
    --danger: #b42318;
    --success: #137a45;
    --shadow: 0 18px 50px rgba(27, 31, 45, 0.08);
    --radius: 18px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Pretendard, "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.topbar { background: rgba(255,255,255,.9); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(12px); }
.topbar-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; background: var(--primary); color: #fff; border-radius: 11px; font-size: 14px; }
.nav { display: flex; align-items: center; gap: 18px; font-size: 14px; font-weight: 650; }
.nav a:hover { opacity: .65; }
.main-area { padding: 38px 0 80px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.hero { display: grid; grid-template-columns: 1.3fr .9fr; align-items: end; gap: 30px; margin-bottom: 26px; }
.hero h1, .section-heading h1 { margin: 4px 0 8px; font-size: clamp(30px, 4vw, 48px); line-height: 1.18; letter-spacing: -.04em; }
.hero p, .section-heading p { margin: 0; color: var(--muted); }
.eyebrow { color: #626978; font-size: 12px; font-weight: 800; letter-spacing: .14em; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.stat strong { display: block; font-size: 19px; line-height: 1.2; }
.stat span { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }
.generator-card { padding: clamp(20px, 4vw, 38px); }
.form-two-col, .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-full { grid-column: 1 / -1; }
label, .label-row { font-weight: 700; font-size: 14px; }
.label-row { display: flex; justify-content: space-between; gap: 20px; }
.label-row span { color: var(--muted); font-weight: 500; }
input, textarea, select {
    width: 100%;
    border: 1px solid #ccd2dd;
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    padding: 13px 14px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
textarea { resize: vertical; min-height: 230px; }
input:focus, textarea:focus, select:focus { border-color: #4b5261; box-shadow: 0 0 0 4px rgba(50,55,66,.08); }
small, .small { color: var(--muted); font-size: 12px; }
.inline-actions { display: flex; align-items: center; gap: 10px; min-height: 34px; }
.advanced-panel { margin: 24px 0; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 14px; padding: 0 18px 18px; }
.advanced-panel summary { cursor: pointer; font-weight: 750; padding: 16px 0; }
.range-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.range-field input { padding: 0; accent-color: var(--primary); }
.range-field label { display: flex; justify-content: space-between; }
.range-field.is-disabled { opacity: .4; }
.checkbox-row { display: inline-flex; align-items: center; gap: 10px; margin-top: 18px; font-weight: 600; }
.checkbox-row input { width: auto; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; padding: 10px 14px; font-weight: 750; cursor: pointer; white-space: nowrap; }
.btn:disabled { opacity: .55; cursor: wait; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #edf0f5; color: #2c3038; }
.btn-secondary:hover { background: #e1e5ec; }
.btn-danger { background: #fff0ef; color: var(--danger); }
.btn-small { padding: 7px 10px; font-size: 12px; }
.btn-large { padding: 14px 20px; }
.btn-generate { width: 100%; min-height: 58px; font-size: 17px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin: 40px 0 15px; }
.section-heading h2 { margin: 0; font-size: 25px; }
.section-heading p { margin: 3px 0 0; color: var(--muted); }
.table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td { border-bottom: 1px solid var(--line); padding: 15px 16px; text-align: left; vertical-align: middle; font-size: 13px; }
th { background: var(--surface-soft); color: #575e6b; font-size: 12px; }
tr:last-child td { border-bottom: 0; }
.table-sub { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.nowrap { white-space: nowrap; }
.actions-cell { display: flex; align-items: center; gap: 6px; }
.inline-form { display: inline; }
.empty-state { padding: 55px 20px; text-align: center; color: var(--muted); }
.alert { border-radius: 12px; padding: 13px 15px; margin-bottom: 16px; font-size: 14px; }
.alert-success { color: #0c6136; background: #eaf8f0; border: 1px solid #bce8ce; }
.alert-error { color: #8d1d14; background: #fff0ef; border: 1px solid #ffc8c3; }
.auth-card { width: min(460px, 100%); margin: 60px auto; padding: 34px; }
.auth-card h1 { margin: 5px 0 22px; }
.stack-form { display: grid; gap: 19px; }
.settings-card { max-width: 720px; padding: 30px; }
.footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; padding: 25px 0 40px; }
.install-body { min-height: 100vh; background: radial-gradient(circle at top, #fff 0, #f1f3f8 45%, #e8ebf2 100%); }
.install-wrap { padding: 55px 0; }
.install-card { width: min(840px, 100%); margin: 0 auto; padding: clamp(24px, 5vw, 46px); }
.install-card h1 { margin: 5px 0 5px; font-size: 38px; }
.muted { color: var(--muted); }

@media (max-width: 860px) {
    .hero { grid-template-columns: 1fr; }
    .form-two-col, .form-grid, .range-grid { grid-template-columns: 1fr; }
    .field-full { grid-column: auto; }
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 620px) {
    .container { width: min(100% - 20px, 1180px); }
    .topbar-inner { min-height: 60px; }
    .brand span:last-child { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .nav { gap: 10px; font-size: 12px; }
    .main-area { padding-top: 26px; }
    .stats-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 32px; }
    .generator-card, .settings-card, .auth-card { padding: 20px; }
}
