:root {
    --bg: #f7f8fa;
    --surface: #ffffff;
    --surface-soft: #eef4f1;
    --text: #17202a;
    --muted: #5b6673;
    --line: #d8dee6;
    --brand: #0f6a68;
    --brand-dark: #084341;
    --accent: #b9502c;
    --focus: #1f7aec;
    --shadow: 0 12px 28px rgba(23, 32, 42, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    letter-spacing: 0;
}

body {
    margin: 0;
    min-width: 320px;
}

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

a:hover {
    color: var(--brand);
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}

.header-inner {
    min-height: 76px;
    display: grid;
    grid-template-columns: auto minmax(220px, 1fr) auto;
    gap: 18px;
    align-items: center;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: var(--brand);
    color: #ffffff;
    font-size: 0.9rem;
}

.search-form {
    display: grid;
    grid-template-columns: 1fr auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface);
}

.search-form:focus-within {
    outline: 3px solid rgba(31, 122, 236, 0.18);
    border-color: var(--focus);
}

.search-form input {
    width: 100%;
    min-width: 0;
    border: 0;
    padding: 12px 14px;
    font: inherit;
    background: transparent;
    color: var(--text);
}

.search-form input:focus {
    outline: none;
}

.search-form button,
.button-link {
    border: 0;
    padding: 12px 16px;
    background: var(--brand);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

.search-form button:hover,
.button-link:hover {
    background: var(--brand-dark);
    color: #ffffff;
}

.locale-nav {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.locale-nav a {
    min-width: 36px;
    min-height: 32px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.locale-nav a.is-active {
    border-color: var(--brand);
    color: var(--brand-dark);
    background: var(--surface-soft);
}

.main-nav {
    border-top: 1px solid var(--line);
}

.nav-scroll {
    min-height: 44px;
    display: flex;
    gap: 18px;
    align-items: center;
    overflow-x: auto;
}

.nav-scroll a {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 700;
}

.section {
    padding: 44px 0;
}

.section.compact {
    padding: 34px 0 18px;
}

.hero {
    background: var(--surface-soft);
    border-bottom: 1px solid var(--line);
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    align-items: center;
}

.hero h1,
.compact h1,
.article-header h1 {
    max-width: 780px;
    margin: 0;
    font-size: 2.25rem;
    line-height: 1.12;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.78rem;
}

.lead {
    max-width: 720px;
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.6;
}

.hero-panel {
    min-height: 148px;
    display: grid;
    align-content: center;
    gap: 8px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.hero-panel strong {
    font-size: 1.35rem;
}

.hero-panel span,
.muted {
    color: var(--muted);
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
    margin-bottom: 20px;
}

.section-head h2 {
    margin: 0;
    font-size: 1.55rem;
}

.section-head p {
    margin: 8px 0 0;
    color: var(--muted);
}

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

.tip-card,
.category-card,
.empty-state,
.article-side,
.video-placeholder {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.tip-card {
    overflow: hidden;
    box-shadow: var(--shadow);
}

.tip-card-media {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #e8edf3;
}

.tip-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tip-card-body {
    padding: 16px;
}

.tip-card-meta,
.tip-card-foot,
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.tip-card-meta a {
    color: var(--brand-dark);
}

.tip-card h2 {
    min-height: 3.2em;
    margin: 12px 0 8px;
    font-size: 1.14rem;
    line-height: 1.35;
}

.tip-card p {
    min-height: 4.8em;
    margin: 0 0 14px;
    color: var(--muted);
    line-height: 1.55;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.category-card {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 16px;
    padding: 14px;
}

.category-media {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 8px;
    background: #e8edf3;
}

.category-card h2 {
    margin: 4px 0 8px;
    font-size: 1.15rem;
}

.category-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

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

.pagination a,
.pagination span {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    font-weight: 700;
}

.article-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    grid-template-areas:
        "header side"
        "body side";
    gap: 28px;
    align-items: start;
}

.article-header {
    grid-area: header;
}

.article-side {
    grid-area: side;
    padding: 12px;
    position: sticky;
    top: 142px;
}

.article-side img {
    border-radius: 8px;
}

.side-block {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.side-block strong {
    width: 100%;
}

.side-block span,
.tag-list span {
    display: inline-flex;
    padding: 7px 9px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--brand-dark);
    font-size: 0.85rem;
    font-weight: 700;
}

.article-body {
    grid-area: body;
    max-width: 760px;
    color: #25313d;
    font-size: 1.05rem;
    line-height: 1.75;
}

.external-tip-page {
    height: 100vh;
    overflow: hidden;
}

.external-tip-page .site-header {
    position: relative;
}

.external-tip-page .site-footer {
    display: none;
}

.external-tip-page main {
    height: calc(100vh - 122px);
    overflow: hidden;
}

.external-source-reader {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.external-source-title {
    flex: 0 0 auto;
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--line);
    background: #ffffff;
}

.external-source-title h1 {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 1.1rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.external-source-open {
    flex: 0 0 auto;
    margin-left: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    background: #ffffff;
    color: var(--brand-dark);
    font-size: 0.85rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.external-source-reader iframe {
    flex: 1 1 auto;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    background: #ffffff;
}

.video-placeholder,
.empty-state {
    margin-top: 22px;
    padding: 18px;
}

.video-placeholder iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
    border-radius: 8px;
}

.ad-placeholder {
    display: grid;
    place-items: center;
    min-height: 96px;
    margin: 18px 0;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--muted);
    font-weight: 700;
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    margin-top: 8px;
    border-radius: 8px;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}

.prose {
    max-width: 760px;
    line-height: 1.75;
}

.prose h1 {
    margin-top: 0;
}

.lead-text {
    color: var(--muted);
    font-size: 1.08rem;
}

.static-section {
    margin-top: 28px;
}

.static-section h2 {
    margin: 0 0 8px;
    font-size: 1.3rem;
}

.static-section p {
    margin: 0;
}

.site-footer {
    margin-top: 34px;
    padding: 34px 0;
    border-top: 1px solid var(--line);
    background: #1f2933;
    color: #ffffff;
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
}

.footer-grid p {
    margin: 8px 0 0;
    color: #c7d0d9;
}

.footer-grid nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

.footer-grid a {
    color: #d9e4ec;
}

@media (max-width: 900px) {
    .header-inner,
    .hero-grid,
    .article-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .locale-nav {
        justify-content: flex-start;
    }

    .hero h1,
    .compact h1,
    .article-header h1 {
        font-size: 1.85rem;
    }

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

    .article-grid {
        grid-template-areas:
            "header"
            "side"
            "body";
    }

    .article-side {
        position: static;
    }

    .footer-grid nav {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .container {
        width: min(100% - 24px, 1120px);
    }

    .header-inner {
        gap: 12px;
        padding: 12px 0;
    }

    .brand {
        font-size: 1rem;
    }

    .search-form {
        grid-template-columns: 1fr;
    }

    .search-form button {
        width: 100%;
    }

    .card-grid,
    .category-grid {
        grid-template-columns: 1fr;
    }

    .category-card {
        grid-template-columns: 1fr;
    }

    .tip-card h2,
    .tip-card p {
        min-height: auto;
    }

    .section {
        padding: 30px 0;
    }
}

.admin-body {
    background: #f4f6f8;
}

.admin-header {
    min-height: 64px;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--line);
    background: #ffffff;
}

.admin-nav {
    display: flex;
    flex: 1;
    gap: 12px;
    overflow-x: auto;
}

.admin-nav a,
.admin-link-button {
    color: var(--muted);
    font-weight: 700;
}

.admin-link-button {
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
}

.admin-main {
    width: min(1180px, calc(100% - 32px));
    margin: 24px auto 56px;
}

.admin-page h1 {
    margin: 0 0 18px;
}

.admin-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.admin-card,
.admin-flash,
.admin-error {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.admin-flash {
    margin-bottom: 18px;
    border-color: #83bd93;
    background: #ecf8ef;
}

.admin-error {
    border-color: #d58d8d;
    background: #fff0f0;
}

.admin-login {
    max-width: 420px;
    margin: 60px auto;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.admin-stats div {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.admin-stats strong {
    display: block;
    font-size: 1.8rem;
}

.admin-stats span {
    color: var(--muted);
}

.admin-form {
    display: grid;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.admin-form label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

.admin-form input,
.admin-form select,
.admin-form textarea,
.admin-table input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    font: inherit;
}

.admin-checkbox {
    display: flex !important;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 8px !important;
}

.admin-checkbox input {
    width: auto;
}

.admin-check-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.admin-check-grid label {
    display: flex;
    gap: 8px;
    align-items: center;
}

.admin-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.admin-form button,
.admin-actions button,
.admin-title-row button,
.admin-card button {
    width: fit-content;
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    background: var(--brand);
    color: #ffffff;
    font-weight: 800;
    cursor: pointer;
}

.admin-inline-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.admin-inline-actions form {
    margin: 0;
}

.admin-inline-actions button,
.admin-danger-button,
.admin-text-danger {
    border: 0;
    background: transparent;
    color: #b42318;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.admin-actions .admin-danger-button {
    border: 1px solid #f2b8b5;
    background: #fff4f2;
    color: #b42318;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--line);
    background: #ffffff;
}

.admin-table th,
.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    background: #eef3f2;
}

@media (max-width: 900px) {
    .admin-header,
    .admin-grid,
    .admin-stats {
        grid-template-columns: 1fr;
    }

    .admin-header {
        display: grid;
    }

    .admin-check-grid {
        grid-template-columns: 1fr;
    }

    .admin-table {
        display: block;
        overflow-x: auto;
    }
}
