:root {
    --primary: #3182f6;
    --primary-dark: #1b64da;
    --primary-tint: #e8f3ff;
    --bg: #f9fafb;
    --card: #ffffff;
    --fill: #f2f4f6;
    --text: #191f28;
    --text-muted: #8b95a1;
    --border: #e5e8eb;
    --success: #04c04c;
    --success-tint: #e6f9ed;
    --danger: #f04452;
    --danger-tint: #feeeee;
    --radius: 16px;
    --radius-sm: 12px;
    --shadow: 0 2px 8px rgba(25, 31, 40, 0.04), 0 1px 2px rgba(25, 31, 40, 0.04);
    --shadow-hover: 0 8px 20px rgba(25, 31, 40, 0.08), 0 2px 6px rgba(25, 31, 40, 0.05);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
        "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

header.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 0;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

header.topbar nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 2px 4px;
    min-width: 0;
}

header.topbar a.logo {
    flex-shrink: 0;
    font-weight: 800;
    font-size: 19px;
    letter-spacing: -0.02em;
    color: var(--text);
    text-decoration: none;
}

header.topbar nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 999px;
    transition: background 0.15s ease, color 0.15s ease;
}

header.topbar nav a:hover {
    background: var(--fill);
    color: var(--text);
}

main {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 20px;
}

.hero {
    text-align: center;
    padding: 36px 12px 28px;
}

.hero h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
    line-height: 1.3;
}

.hero p {
    color: var(--text-muted);
    margin-top: 0;
    font-size: 15px;
}

.search-box, .input-row {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}

.input-row { margin-top: 0; }

.search-box input, .input-row input, .input-row select {
    flex: 1 1 auto;
    min-width: 0;
}

.search-box .btn, .input-row .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

input, select, textarea, button {
    font-family: inherit;
    font-size: 15px;
}

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=time], select, textarea {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--fill);
    color: var(--text);
    transition: border-color 0.15s ease, background 0.15s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--card);
}

textarea { resize: vertical; }

.btn {
    display: inline-block;
    padding: 13px 20px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    line-height: 1.2;
    transition: background 0.15s ease, transform 0.05s ease;
}

.btn:hover { background: var(--primary-dark); }
.btn:active { transform: scale(0.98); }

.btn.secondary {
    background: var(--fill);
    color: var(--text);
    border: none;
}

.btn.secondary:hover { background: var(--border); }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 12px;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.kg-item {
    display: block;
    text-decoration: none;
    color: inherit;
}

a.card.kg-item:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
}

.kg-item h3 {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.kg-item .tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    background: var(--primary-tint);
    color: var(--primary-dark);
    padding: 3px 10px;
    border-radius: 999px;
    margin-right: 6px;
}

.kg-item .meta {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 6px;
}

.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.rating-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.error-box {
    background: var(--danger-tint);
    color: var(--danger);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
}

.success-box {
    background: var(--success-tint);
    color: var(--success);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
}

.rating-summary {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin: 16px 0 4px;
}

.rating-summary .stat {
    text-align: center;
}

.rating-summary .stat .num {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.rating-summary .stat .label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.review-card .stars {
    color: var(--primary);
    font-size: 14px;
}

.review-card .nickname {
    font-weight: 700;
    margin-right: 8px;
}

.review-card .date {
    color: var(--text-muted);
    font-size: 12px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.link:hover {
    text-decoration: underline;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}

.back-link:hover {
    color: var(--text);
}

.report-link {
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: underline;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 0;
    font-size: 14px;
}

.empty-state-block {
    text-align: center;
    padding: 48px 20px;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    line-height: 64px;
    margin: 0 auto 16px;
    font-size: 30px;
    background: var(--fill);
    border-radius: 50%;
}

.empty-state-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
    margin-bottom: 4px;
}

.empty-state-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Bottom tab bar */
.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: flex;
    max-width: 720px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 9px 4px 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
}

.bottom-nav a svg {
    width: 23px;
    height: 23px;
    stroke: currentColor;
}

.bottom-nav a.active {
    color: var(--primary);
}

/* Kindergarten search autocomplete */
.autocomplete-wrap {
    position: relative;
}

.autocomplete-list {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-hover);
    max-height: 260px;
    overflow-y: auto;
    z-index: 30;
}

.autocomplete-list.open {
    display: block;
}

.autocomplete-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

.autocomplete-item:last-child { border-bottom: none; }

.autocomplete-item:hover,
.autocomplete-item.active {
    background: var(--primary-tint);
}

.autocomplete-item .sub {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 2px;
}

.autocomplete-empty {
    padding: 12px 14px;
    color: var(--text-muted);
    font-size: 13px;
}

/* Community hub grid */
.hub-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.hub-grid .card {
    text-align: center;
    padding: 24px 12px;
}

.hub-grid .hub-icon {
    font-size: 30px;
    margin-bottom: 10px;
}

.hub-grid h3 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 700;
}

.hub-grid p {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}
