@media (max-width: 900px) {
    .topbar-inner { grid-template-columns: 1fr auto; gap: 12px; }
    .site-search { grid-column: 1 / -1; grid-row: 2; margin-bottom: 10px; }
    .topnav { grid-column: 2; grid-row: 1; }
    .blog-shell { grid-template-columns: 1fr; gap: 24px; }
    .blog-sidebar { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
    .profile-block { grid-column: 1 / -1; }
    .article-shell { grid-template-columns: 1fr; }
    .article-sidebar { position: static; display: none; }
    .admin-summary { grid-template-columns: 1fr; }
    .backup-split-grid { grid-template-columns: 1fr; }
    .backup-console { grid-template-columns: 1fr; }
    .backup-primary-action { align-items: stretch; flex-direction: column; }
    .backup-choice-actions { align-items: stretch; flex-direction: column; }
    .backup-choice-actions form { width: 100%; }
    .backup-choice-actions button { width: 100%; }
    .backup-primary-action .backup-download-form { width: 100%; }
    .backup-primary-action .primary-button { width: 100%; }
    .backup-rehearsal-card { align-items: stretch; flex-direction: column; }
    .backup-rehearsal-card form,
    .backup-rehearsal-card button { width: 100%; }
    .backup-auto-form { grid-template-columns: 1fr; }
    .backup-auto-status { grid-template-columns: 1fr; }
    .full-restore-form { grid-template-columns: 1fr; }
    .full-restore-form button { width: 100%; }
    .dashboard-support-grid,
    .dashboard-news-grid { grid-template-columns: 1fr; }
    .realtime-news-status-card { grid-template-columns: 1fr; }
    .realtime-news-sources { grid-template-columns: 1fr; }
    .today-command-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .health-check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .operation-check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .operation-calendar-head { grid-template-columns: 1fr; }
    .operation-calendar-head strong { order: -1; }
    .calendar-day { min-height: 92px; padding: 7px; }
    .calendar-day-top {
        display: grid;
        gap: 3px;
    }
    .calendar-day small {
        text-align: left;
    }
    .calendar-item,
    .calendar-more {
        grid-template-columns: auto auto;
        padding: 3px 4px;
    }
    .calendar-item em {
        display: none;
    }
    .system-status-grid,
    .dashboard-support-grid .system-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .news-log-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .news-diagnostics-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .news-candidate-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .news-quality-checks,
    .dashboard-news-grid .news-quality-checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ai-settings-split { grid-template-columns: 1fr; }
    .ai-run-grid { grid-template-columns: 1fr; }
    .ai-progress-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .radio-controls { grid-template-columns: 1fr; }
    .radio-controls button { width: 100%; }
    .radio-station-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .blog-cover { height: clamp(420px, 64vw, 540px); }
    .cover-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .feed-post { grid-template-columns: 190px minmax(0, 1fr); gap: 20px; }
    .admin-section-nav { top: 64px; }
    .admin-section-hero {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
    .admin-section-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .topbar-inner { width: min(100% - 24px, 1180px); min-height: 56px; }
    .wordmark { font-size: 19px; }
    .topnav a, .nav-button { padding: 7px 6px; font-size: 12px; }
    .blog-cover { height: 520px; }
    .national-flag-badge {
        top: 14px;
        right: 12px;
        gap: 9px;
        padding: 9px 11px;
    }
    .national-flag-badge small { display: none; }
    .taegukgi-mark { width: 54px; height: 36px; }
    .cover-copy { width: calc(100% - 32px); }
    .cover-copy h1 { font-size: clamp(36px, 12vw, 54px); }
    .cover-copy > span { font-size: 14px; }
    .cover-actions { margin-top: 16px; }
    .cover-latest {
        margin-top: 16px;
        padding: 13px 14px;
    }
    .cover-news-ticker {
        grid-template-columns: 1fr;
        row-gap: 10px;
    }
    .cover-news-controls {
        justify-self: end;
        grid-template-columns: repeat(2, 32px);
    }
    .cover-news-controls button {
        width: 32px;
        height: 32px;
        font-size: 23px;
    }
    .cover-latest strong {
        font-size: 17px;
        white-space: normal;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }
    .cover-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 18px; }
    .cover-stats span { padding: 10px 11px; font-size: 11px; }
    .cover-stats b { font-size: 18px; }
    .blog-shell { width: calc(100% - 20px); margin-top: 18px; }
    .blog-sidebar { grid-template-columns: 1fr; }
    .profile-block, .sidebar-section {
        padding: 15px;
        margin-bottom: 10px;
    }
    .profile-block { grid-column: auto; }
    .archive-section { display: none; }
    .post-feed { padding: 22px 14px; }
    .feed-header {
        padding-bottom: 18px;
    }
    .feed-header { align-items: start; }
    .ai-search-card { padding: 16px; }
    .feed-post { min-height: 0; grid-template-columns: 108px minmax(0, 1fr); gap: 13px; margin-top: 14px; padding: 12px; }
    .feed-thumb { align-self: stretch; aspect-ratio: 1 / 1; }
    .post-meta { flex-wrap: wrap; row-gap: 3px; }
    .feed-copy h3 { font-size: 19px; }
    .feed-copy p { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 13px; }
    .feed-copy small { display: block; margin-top: 10px; padding-top: 8px; font-size: 11px; }
    .article-shell { width: calc(100% - 20px); margin-top: 18px; }
    .post-article { padding: 28px 18px; }
    .article-header h1 { font-size: 31px; }
    .news-article .article-header h1 {
        font-size: 32px;
        line-height: 1.18;
    }
    .news-article .article-header {
        padding-bottom: 26px;
    }
    .article-stats { display: none; }
    .article-actions button { flex: 1 1 130px; justify-content: center; }
    .article-gallery { grid-template-columns: 1fr; }
    .article-gallery img { height: auto; aspect-ratio: auto; }
    .article-content { font-size: 16px; }
    .news-article .article-content { line-height: 1.9; }
    .article-content h2 { font-size: 22px; }
    .article-content h2.news-summary-title + ul li,
    .article-content h2.news-reference-title + ul li {
        padding: 12px;
    }
    .news-brief-card { padding: 14px; }
    .news-article .news-brief-card {
        padding: 16px 15px 16px 18px;
    }
    .news-article .news-brief-card::before {
        top: 16px;
        bottom: 16px;
    }
    .news-brief-card p { font-size: 15px; }
    .news-article .news-brief-card a {
        display: inline-flex;
        max-width: 100%;
        overflow-wrap: anywhere;
    }
    .news-article > .news-date-note {
        display: block;
    }
    .news-article > .news-date-note::before {
        display: inline-block;
        margin: 0 7px 6px 0;
    }
    .news-candidate-grid { grid-template-columns: 1fr; }
    .news-diagnostics-strip,
    .news-diagnostics-strip.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .news-quality-card { grid-template-columns: 1fr; }
    .news-quality-checks { grid-template-columns: 1fr; }
    .inline-admin-form { justify-content: stretch; }
    .inline-admin-form button { width: 100%; }
    .post-navigation { grid-template-columns: 1fr; }
    .post-navigation a.older { text-align: left; }
    .comment-fields { grid-template-columns: 1fr; }
    .comments-title { align-items: start; }
    .comments-title > p { display: none; }
    .admin-layout { width: calc(100% - 20px); margin-top: 18px; }
    .admin-section-nav {
        top: 58px;
        gap: 6px;
        padding: 8px;
        margin-bottom: 12px;
    }
    .admin-section-nav a {
        padding: 9px 11px;
        font-size: 12px;
    }
    .admin-section-hero {
        padding: 16px;
    }
    .admin-section-stats {
        grid-template-columns: 1fr;
    }
    .admin-section-actions {
        grid-template-columns: 1fr;
    }
    .dashboard-panel,
    .dashboard-grid,
    .dashboard-grid > *,
    .top-posts-card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: hidden;
    }
    .admin-summary { grid-template-columns: 1fr; }
    .admin-summary article { padding: 14px; }
    .admin-summary div { padding: 8px 0; }
    .today-command-grid { grid-template-columns: 1fr; }
    .today-command-card { min-height: auto; }
    .health-check-summary { grid-template-columns: 1fr; align-items: stretch; }
    .health-check-summary .secondary-button { width: 100%; text-align: center; }
    .health-check-grid { grid-template-columns: 1fr; }
    .operation-check-grid { grid-template-columns: 1fr; }
    .operation-calendar {
        gap: 0;
    }
    .calendar-weekday {
        min-height: 28px;
        font-size: 11px;
    }
    .calendar-day {
        min-height: 78px;
        padding: 5px 4px;
    }
    .calendar-day b {
        font-size: 13px;
    }
    .calendar-day small {
        font-size: 0;
    }
    .calendar-day small::before {
        content: attr(data-mobile-label);
    }
    .calendar-item,
    .calendar-more {
        border-left-width: 2px;
        border-radius: 4px;
        font-size: 9px;
        gap: 2px;
    }
    .calendar-item time {
        display: none;
    }
    .backup-actions { align-items: stretch; flex-direction: column; }
    .backup-rehearsal-result li {
        grid-template-columns: 1fr;
        align-items: start;
    }
    .backup-rehearsal-result .backup-health {
        justify-self: start;
    }
    .system-status-grid,
    .dashboard-support-grid .system-status-grid { grid-template-columns: 1fr; }
    .stats-chart-wrap {
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 6px;
        padding: 12px 8px 10px;
        overflow: hidden;
    }
    .stats-y-axis {
        font-size: 9px;
        padding-bottom: 24px;
    }
    .stats-chart {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 5px;
        padding-inline: 8px;
        overflow: hidden;
    }
    .stats-chart span:nth-last-child(n+6) { display: none; }
    .stats-chart span { min-width: 0; }
    .stats-chart b { font-size: 9px; justify-self: center; }
    .admin-panel { padding: 0; overflow: hidden; }
    .admin-collapse-toggle {
        display: flex;
        width: 100%;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        border: 0;
        background: transparent;
        color: var(--ink);
        padding: 18px;
        text-align: left;
        font-family: var(--title-font);
        font-size: 18px;
        font-weight: 900;
    }
    .admin-collapse-toggle b {
        width: 10px;
        height: 10px;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: rotate(45deg);
        transition: transform .18s ease;
    }
    .admin-panel.is-collapsed .admin-collapse-toggle b { transform: rotate(-45deg); }
    .admin-panel-body {
        display: block;
        border-top: 1px solid var(--soft-line);
        padding: 20px 18px 24px;
    }
    .admin-panel.is-collapsed .admin-panel-body { display: none; }
    .admin-panel-body > .panel-heading:first-child,
    .admin-panel-body > h1:first-child,
    .admin-panel-body > h2:first-child { display: none; }
    .panel-heading { align-items: start; }
    .panel-heading > span { display: none; }
    .ai-writing-actions a { width: 100%; }
    .news-log-grid { grid-template-columns: 1fr; }
    .news-log-detail p { grid-template-columns: 1fr; gap: 3px; }
    .news-diagnostics-strip,
    .news-diagnostics-strip.compact { grid-template-columns: 1fr; }
    .scheduler-copy { grid-template-columns: 1fr; }
    .scheduler-copy button { width: 100%; }
    .editor-preview-head { display: grid; align-items: start; }
    .preview-refresh { justify-self: start; }
    .ai-progress-top { display: grid; gap: 4px; }
    .radio-station-grid { grid-template-columns: 1fr; }
    .ai-progress-steps { grid-template-columns: 1fr; }
    .selected-images, .existing-images { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-list article { display: grid; gap: 12px; }
    .admin-filter-bar {
        grid-template-columns: 1fr;
    }
    .admin-filter-actions {
        align-items: stretch;
        flex-direction: column;
    }
    .admin-filter-actions .primary-button,
    .admin-filter-actions a {
        width: 100%;
    }
    .row-actions { justify-content: flex-start; }
    .peter-chat { right: 12px; bottom: 12px; }
    .peter-panel { width: calc(100vw - 24px); max-height: calc(100vh - 110px); }
    .peter-log { max-height: calc(100vh - 240px); }
}

@media (max-width: 480px) {
    .topbar-inner { width: calc(100% - 18px); gap: 8px; }
    .wordmark { font-size: 18px; }
    .topnav { gap: 2px; }
    .theme-toggle { width: 34px; height: 34px; }
    .blog-cover { height: 560px; }
    .cover-copy { width: calc(100% - 24px); }
    .cover-copy h1 { font-size: clamp(34px, 13vw, 48px); }
    .cover-copy > span { max-width: 100%; line-height: 1.55; }
    .cover-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }
    .blog-shell { width: calc(100% - 14px); }
    .post-feed { padding: 18px 12px; }
    .feed-header h2 { font-size: 28px; line-height: 1.22; }
    .feed-post {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 12px;
    }
    .feed-thumb {
        width: 100%;
        aspect-ratio: 16 / 10;
    }
    .feed-copy + .feed-thumb { display: none; }
    .feed-copy h3 {
        margin-top: 7px;
        font-size: 21px;
        line-height: 1.28;
    }
    .feed-copy p {
        -webkit-line-clamp: 3;
        line-height: 1.65;
    }
    .article-shell { width: calc(100% - 14px); }
    .post-article { padding: 24px 15px; }
    .article-header h1,
    .news-article .article-header h1 {
        font-size: 29px;
        line-height: 1.2;
    }
    .article-byline {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
    }
    .article-actions { gap: 8px; }
    .article-actions button { min-width: 0; padding: 8px 10px; }
    .article-content,
    .news-article .article-content {
        font-size: 15.5px;
        line-height: 1.86;
    }
    .news-article .article-content > p:first-of-type {
        font-size: 1.03em;
    }
    .news-article .article-content h2.news-section-title {
        font-size: 21px;
        gap: 8px;
    }
    .news-article .article-content h2.news-reference-title + ul a {
        align-items: flex-start;
    }
}

@media (max-width: 900px) {
    .gallery-hero {
        grid-template-columns: 1fr;
        align-items: start;
    }
    .gallery-stats {
        width: 100%;
    }
    .gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .gallery-shell {
        width: calc(100% - 18px);
        margin-top: 18px;
    }
    .gallery-hero,
    .gallery-filter {
        padding: 16px;
    }
    .gallery-stats {
        grid-template-columns: 1fr;
    }
    .gallery-stats span {
        border-left: 0;
        border-top: 1px solid rgba(51, 126, 92, .14);
    }
    .gallery-stats span:first-child { border-top: 0; }
    .gallery-filter {
        grid-template-columns: 1fr;
    }
    .gallery-filter button,
    .gallery-filter a {
        width: 100%;
    }
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .gallery-card span,
    .gallery-card strong,
    .gallery-card small {
        margin-inline: 10px;
    }
    .gallery-card strong {
        min-height: 42px;
        font-size: 14px;
    }
}

@media (max-width: 380px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

:root[data-theme="dark"] body.admin-page .ai-run-card,
:root[data-theme="dark"] body.admin-page .news-run-card,
:root[data-theme="dark"] body.admin-page .scheduler-copy,
:root[data-theme="dark"] body.admin-page .ai-progress {
    background: #101b23 !important;
    background-image: none !important;
    border-color: rgba(255,255,255,.13) !important;
    box-shadow: none !important;
}

:root[data-theme="dark"] body.admin-page .scheduler-copy button,
:root[data-theme="dark"] body.admin-page .scheduler-copy button:disabled,
:root[data-theme="dark"] body.admin-page .ai-run-card button:disabled,
:root[data-theme="dark"] body.admin-page .news-run-card button:disabled {
    background: #1a252d !important;
    background-image: none !important;
    border-color: rgba(255,255,255,.16) !important;
    color: #9aabb4 !important;
    opacity: 1 !important;
}

:root[data-theme="dark"] body.admin-page .ai-progress-track,
:root[data-theme="dark"] body.admin-page .upload-progress-track {
    background: #22323c !important;
    background-image: none !important;
}

:root[data-theme="dark"] body.admin-page .ai-progress-top,
:root[data-theme="dark"] body.admin-page .scheduler-copy strong {
    color: #e5edf1 !important;
}

:root[data-theme="dark"] body.admin-page .scheduler-copy span {
    color: #b9c8d0 !important;
}

.memory-index-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.memory-index-summary article {
    min-width: 0;
    border: 1px solid var(--line);
    border-top: 3px solid var(--naver);
    background: linear-gradient(180deg, #fff, #f7fbf9);
    padding: 15px;
}
.memory-index-summary span,
.memory-index-summary strong { display: block; }
.memory-index-summary span { color: var(--muted); font-size: 11px; font-weight: 800; }
.memory-index-summary strong { margin-top: 7px; color: var(--ink); font-family: var(--title-font); font-size: 22px; }
.memory-index-actions {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-top: 12px;
    border: 1px dashed var(--line);
    padding: 14px;
}
.memory-index-actions strong,
.memory-index-actions small { display: block; }
.memory-index-actions small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.memory-index-panel .hint code { overflow-wrap: anywhere; }

:root[data-theme="dark"] .memory-index-summary article,
:root[data-theme="dark"] .memory-index-actions {
    background: #102029;
    border-color: rgba(255,255,255,.12);
}
:root[data-theme="dark"] .memory-index-summary strong,
:root[data-theme="dark"] .memory-index-actions strong { color: var(--ink); }

@media (max-width: 760px) {
    .memory-index-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .memory-index-actions { align-items: stretch; flex-direction: column; }
    .memory-index-actions .primary-button { width: 100%; }
}

@media (max-width: 420px) {
    .memory-index-summary { grid-template-columns: 1fr; }
}
