:root {
    --bg: #f7f5f1;
    --surface: #ffffff;
    --surface-soft: #fbfaf8;
    --ink: #1c1c1c;
    --muted: #6e6e73;
    --line: #ece7df;
    --accent: #ea6b2d;
    --accent-dark: #cc5620;
    --container: 1120px;
    --radius: 18px;
    --shadow: 0 12px 30px rgba(24, 18, 12, 0.06);
    --font: "Segoe UI", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
}

a {
    color: inherit;
    text-decoration: none;
}

input,
select,
textarea,
button {
    font: inherit;
}

.container {
    width: min(calc(100% - 32px), var(--container));
    margin: 0 auto;
}

.site-header {
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--line);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 78px;
}

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

.brand-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 158px;
    padding: 10px 14px;
    border-radius: 16px;
    background: var(--accent);
    box-shadow: var(--shadow);
}

.brand-logo {
    display: block;
    width: 132px;
    height: auto;
}

.brand strong,
.footer-brand {
    display: block;
    font-size: 1.05rem;
}

.brand small {
    color: var(--muted);
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    color: #4a4a4a;
    font-size: 0.95rem;
}

.main-nav a:hover,
.card-link:hover,
.tool-link:hover,
.admin-link:hover {
    color: var(--accent-dark);
}

.top-ad-slot,
.bottom-ad-slot {
    width: min(calc(100% - 32px), var(--container));
    overflow: hidden;
}

.top-ad-slot {
    margin: 16px auto 0;
}

.bottom-ad-slot {
    margin: 24px auto;
}

.top-ad-slot-inner,
.bottom-ad-slot-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 970px;
    max-width: 100%;
    min-height: 250px;
    margin: 0 auto;
    overflow: hidden;
}

.etarget-hb-wrap {
    display: flex;
    justify-content: center;
    max-width: 100%;
    overflow: hidden;
}

.top-ad-slot iframe,
.top-ad-slot img,
.bottom-ad-slot iframe,
.bottom-ad-slot img {
    max-width: 100%;
}

.hero,
.page-hero {
    padding: 40px 0 24px;
}

.hero-grid,
.tool-layout,
.admin-layout,
.footer-grid {
    display: grid;
    gap: 26px;
}

.hero-grid {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: start;
}

.hero h1,
.page-hero h1 {
    margin: 0 0 12px;
    font-size: clamp(2.3rem, 5vw, 3.7rem);
    line-height: 1.05;
}

.page-hero.slim h1 {
    font-size: clamp(2rem, 4vw, 3rem);
}

.eyebrow,
.breadcrumbs {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 0.9rem;
}

.hero-copy,
.page-hero p,
.section-heading p,
.card p,
.content-card p,
.calculator-header p,
.tool-meta {
    color: var(--muted);
}

.search-shell {
    margin-top: 26px;
    position: relative;
}

.hero-search {
    width: 100%;
    max-width: 520px;
    height: 56px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.search-empty {
    margin-top: 0;
    color: var(--muted);
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 100%;
    max-width: 520px;
    padding: 10px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    z-index: 20;
}

.search-result-link {
    display: grid;
    gap: 4px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.search-result-link:last-of-type {
    border-bottom: 0;
}

.search-result-link span {
    color: var(--muted);
    font-size: 0.95rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    padding: 13px 18px;
    cursor: pointer;
}

.button.primary {
    background: var(--accent);
    color: #fff;
}

.button.secondary {
    background: #fff;
    border: 1px solid var(--line);
}

.hero-panel,
.card,
.calculator-box,
.content-card,
.notice {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-panel,
.calculator-box,
.content-card,
.notice {
    padding: 24px;
}

.tool-list {
    display: grid;
}

.tool-link,
.admin-link {
    display: block;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
}

.tool-link:last-child,
.admin-link:last-child {
    border-bottom: 0;
}

.section {
    padding: 14px 0 56px;
}

.section-tight {
    padding-top: 0;
}

.section-heading,
.category-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
}

.section-heading h2,
.category-header h3,
.card h2,
.card h4,
.content-card h2,
.content-card h3,
.calculator-header h2 {
    margin: 0;
}

.category-block {
    margin-top: 28px;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.badge,
.pill {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.88rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.blog-grid,
.subcat-grid {
    display: grid;
    gap: 16px;
}

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

.subcat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0 0 18px;
}

.subcat-card {
    display: grid;
    gap: 8px;
    padding: 18px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 16px;
}

.subcat-card span {
    color: var(--muted);
    font-size: 0.95rem;
}

.card {
    padding: 20px;
}

.card-type {
    margin: 0 0 10px;
    color: var(--accent-dark);
    font-size: 0.85rem;
    font-weight: 700;
}

.card-link {
    display: inline-flex;
    margin-top: 12px;
    font-weight: 600;
}

.tool-layout {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: start;
}

.calculator-form,
.admin-form {
    display: grid;
    gap: 14px;
}

.calculator-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 20px;
}

.calculator-form label,
.admin-form label {
    display: grid;
    gap: 8px;
    color: #4b4b4f;
    font-size: 0.95rem;
}

.calculator-form input,
.calculator-form select,
.admin-form input,
.admin-form select,
.admin-form textarea {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.calculator-actions {
    margin-top: 18px;
}

.result-box {
    margin-top: 18px;
    padding: 16px 18px;
    min-height: 68px;
    border: 1px solid #f0d7c9;
    border-radius: 14px;
    background: #fff8f4;
    font-weight: 600;
}

.content-card + .content-card {
    margin-top: 16px;
}

.bottom-content-card {
    max-width: 860px;
    margin: 0 auto;
}

.admin-list {
    margin-top: 18px;
    border-top: 1px solid var(--line);
    padding-top: 8px;
}

.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
}

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

.custom-calculator-box form {
    display: grid;
    gap: 14px;
}

.custom-calculator-box style + * {
    margin-top: 0;
}

.custom-calculator-box input,
.custom-calculator-box select,
.custom-calculator-box textarea,
.custom-calculator-box button {
    font: inherit;
}

.content-list {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
}

.content-list li + li {
    margin-top: 8px;
}

.calc-history {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.calc-history strong {
    display: block;
    margin-bottom: 10px;
}

.admin-layout {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: start;
}

.login-card {
    max-width: 560px;
}

.admin-form.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-form .full,
.admin-form button,
.checkbox {
    grid-column: 1 / -1;
}

.admin-help {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
    color: var(--muted);
}

.admin-main {
    display: grid;
    gap: 16px;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox input {
    width: auto;
}

.notice {
    margin-bottom: 18px;
}

.site-footer {
    padding: 28px 0 32px;
    background: #fff;
    border-top: 1px solid var(--line);
}

.footer-grid {
    grid-template-columns: 1.35fr 0.65fr 1fr 0.9fr;
    align-items: start;
}

.site-footer a {
    display: block;
    margin-bottom: 10px;
    color: var(--muted);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    color: var(--muted);
}

@media (max-width: 980px) {
    .hero-grid,
    .tool-layout,
    .admin-layout,
    .footer-grid,
    .card-grid {
        grid-template-columns: 1fr;
    }

    .calculator-form,
    .admin-form.two-col {
        grid-template-columns: 1fr;
    }

    .nav,
    .section-heading,
    .category-header,
    .footer-bottom {
        align-items: start;
        flex-direction: column;
    }

    .top-ad-slot,
    .bottom-ad-slot {
        display: none;
    }
}
