* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

html {
    overflow-y: scroll; /* 항상 세로 스크롤 공간을 잡아둠 */
}

body {
    background: #f5f5f5;
    color: #111827;
    line-height: 1.5;
}

/* === 헤더 / 네비게이션 === */

.site-header {
    background: #0f172a;
    color: #e5e7eb;
}

.site-header-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.logo {
    font-size: 17px;
    font-weight: 700;
    color: #e5e7eb;
    text-decoration: none;
}

.main-nav {
    position: relative;
}

.nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid #4b5563;
    background: #111827;
    color: #e5e7eb;
    font-size: 18px;
    cursor: pointer;
}

.nav-links {
    list-style: none;
    position: absolute;
    right: 0;
    top: 40px;
    min-width: 150px;
    background: #020617;
    border-radius: 12px;
    padding: 6px 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    display: none;
    z-index: 20;
}

.nav-links.open {
    display: block;
}

.nav-links li + li {
    margin-top: 4px;
}

.nav-links a {
    display: block;
    padding: 6px 10px;
    border-radius: 8px;
    color: #e5e7eb;
    font-size: 13px;
    text-decoration: none;
}

.nav-links a:hover {
    background: #1e293b;
}

.nav-links a.active {
    background: #2563eb;
}

/* 데스크탑 네비게이션 */

@media (min-width: 700px) {
    .site-header-inner {
        padding: 12px 16px;
    }

    .page-wrapper {
        padding: 20px 16px 44px;
    }
}

/* === 페이지 공통 === */

.page-wrapper {
    max-width: 960px;
    margin: 0 auto;
    padding: 16px 12px 40px;
}

.header-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px 18px 16px;
    margin-top: 12px;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

h1 {
    font-size: 22px;
    margin-bottom: 6px;
}

.subtitle {
    font-size: 14px;
    color: #6b7280;
}

/* === 홈 화면 툴 목록 === */

.tool-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.tool-item {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px 16px 18px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.tool-item h2 {
    font-size: 18px;
    margin-bottom: 6px;
}

.tool-item p {
    font-size: 14px;
    color: #4b5563;
    margin-bottom: 10px;
}

.tool-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: #2563eb;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.tool-button:hover {
    background: #1d4ed8;
}

/* 날짜 계산기 등 공용 레이아웃 (툴 페이지에서 사용) */

.tool-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 18px 16px 20px;
    margin-top: 16px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

h2 {
    font-size: 18px;
    margin-bottom: 10px;
}

label {
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
}

input[type="date"],
input[type="number"],
select {
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 12px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 14px;
}

button {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    background: #2563eb;
    color: #fff;
}

button:disabled {
    opacity: 0.5;
    cursor: default;
}

.result {
    margin-top: 10px;
    font-size: 15px;
    font-weight: 600;
}

.small {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

.row {
    display: flex;
    gap: 8px;
}

.row > div {
    flex: 1;
}

.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    margin-bottom: 10px;
}

.mt-4 {
    margin-top: 4px;
}

.mb-8 {
    margin-bottom: 8px;
}

/* 탭 영역 */

.tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.tab-button {
    flex: 1;
    min-width: 120px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    padding: 6px 10px;
    font-size: 13px;
    cursor: pointer;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
}

.tab-button.active {
    background: #2563eb;
    border-color: #1d4ed8;
    color: #ffffff;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* 날짜 목록 / 요일 카운트 박스 */

.box {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    max-height: 260px;
    overflow: auto;
    font-size: 13px;
    white-space: pre-wrap;
}

/* 광고 및 푸터 (툴 페이지에서 사용) */

.ad-wrapper {
    margin: 18px 0 0;
}

.ad-label {
    font-size: 11px;
    color: #9ca3af;
    margin-bottom: 4px;
}

.ad-box {
    width: 100%;
    min-height: 80px;
    border-radius: 12px;
    border: 1px dashed #d4d4d8;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #a1a1aa;
}

.footer-text {
    margin-top: 18px;
    font-size: 13px;
    color: #6b7280;
}

.footer-text h3 {
    font-size: 14px;
    margin-bottom: 6px;
}

.footer-text p + p {
    margin-top: 4px;
}

@media (min-width: 640px) {
    .header-card {
        padding: 22px 22px 18px;
    }

    .tool-card {
        padding: 20px 20px 22px;
    }

    .tool-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tabs {
        gap: 8px;
    }

    .tab-button {
        font-size: 14px;
        padding: 8px 12px;
    }
}
