body {
  margin: 0;
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--chch-text);
  background:
    radial-gradient(circle at top, var(--chch-bg-radial), transparent 32%),
    linear-gradient(180deg, var(--chch-bg-start) 0%, var(--chch-bg-mid) 48%, var(--chch-bg-end) 100%);
}
a { color: var(--chch-link); text-decoration: none; }
a:hover { color: var(--chch-link-hover); text-decoration: none; }
img { max-width: 100%; height: auto; border: 0; }
.cafe-v4-header-inner, .cafe-v4-content, .cafe-v4-footer-inner, .cafe-v4-footer-bottom { width: 1240px; margin: 0 auto; }
.cafe-v4-header { padding: 10px 0; }
.cafe-v4-header-inner { display:flex; align-items:center; justify-content:space-between; gap:24px; }
.cafe-v4-brand-block { min-width:0; }
.cafe-v4-brand { display:inline-flex; flex-direction:column; gap:4px; }
.cafe-v4-brand-kr { font-size:34px; line-height:1; font-weight:700; letter-spacing:-.04em; color:var(--chch-card-heading); }
.cafe-v4-brand-en { font-size:11px; letter-spacing:.24em; text-transform:uppercase; color:var(--chch-text-muted); }
.cafe-v4-header-tools { display:flex; flex-direction:row; gap:12px; align-items:center; }
.cafe-theme-toggle { display:inline-flex; align-items:center; justify-content:center; width:40px; height:40px; padding:0; border:1px solid var(--chch-button-border); border-radius:14px; background:rgba(255,255,255,.9); color:var(--chch-text-soft); font-size:18px; line-height:1; cursor:pointer; box-shadow:var(--chch-shadow-card); }
.cafe-theme-toggle:hover, .cafe-theme-toggle:focus { border-color:#9fd2af; background:var(--chch-surface-hover); color:var(--chch-link); }
.cafe-v4-nav { display:flex; flex-wrap:wrap; gap:10px; }
.cafe-v4-nav a { display:inline-flex; align-items:center; justify-content:center; min-height:38px; padding:0 16px; border:1px solid var(--chch-button-border); border-radius:999px; background:rgba(255,255,255,.86); color:var(--chch-text-soft); font-size:13px; font-weight:700; }
.cafe-v4-nav a.is-active, .cafe-v4-nav a:hover { border-color:#9fd2af; background:var(--chch-surface-hover); color:var(--chch-link); }
.cafe-v4-search { display:flex; align-items:center; gap:10px; padding:8px; border:1px solid var(--chch-border); border-radius:18px; background:rgba(255,255,255,.9); box-shadow:var(--chch-shadow-card); box-sizing:border-box; }
.cafe-v4-search input[type="text"] { width:160px; height:40px; padding:0 14px; border:0; outline:0; background:transparent; color:var(--chch-text); font-size:14px; min-width:0; flex:1 1 auto; box-sizing:border-box; }
.cafe-v4-search button { height:40px; padding:0 18px; border:0; border-radius:12px; background:linear-gradient(135deg, #49a46c 0%, #8bd0a1 100%); color:#fff; font-size:13px; font-weight:700; cursor:pointer; flex:0 0 auto; }
.cafe-v4-content { padding-top:20px; padding-bottom:42px; }
.cafe-home-grid { display:grid; grid-template-columns:minmax(0,2fr) minmax(300px,.82fr); gap:24px; align-items:start; }
.cafe-panel, .cafe-side-card, .cafe-hero { background:var(--chch-surface); border:1px solid var(--chch-border); border-radius:28px; box-shadow:var(--chch-shadow); padding:24px; }
.cafe-double-panels { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(280px,.85fr); gap:20px; margin-top:20px; }
.cafe-panel-latest, .cafe-panel-discovery { margin-top:20px; }
.cafe-section-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:18px; margin-bottom:18px; }
.cafe-section-heading-compact { margin-bottom:14px; }
.cafe-section-kicker { display:inline-block; font-size:11px; font-weight:700; letter-spacing:.18em; text-transform:uppercase; color:var(--chch-text-muted); }
.cafe-section-heading h2, .cafe-section-heading h3, .cafe-side-heading h4 { margin:6px 0 0; color:var(--chch-card-heading); letter-spacing:-.04em; }
.cafe-section-heading h2 { font-size:38px; line-height:1.02; }
.cafe-section-heading h3 { font-size:28px; line-height:1.08; }
.cafe-side-heading h4 { font-size:24px; line-height:1.08; }
.cafe-hero-grid { display:grid; grid-template-columns:minmax(0,1.28fr) minmax(280px,.72fr); gap:18px; }
.cafe-hero-primary { display:grid; grid-template-columns:minmax(260px,.95fr) minmax(0,1.05fr); gap:18px; }
.cafe-hero-media { display:flex; align-items:stretch; min-height:320px; border-radius:24px; overflow:hidden; background:linear-gradient(135deg, #85c49a 0%, #d8f0df 100%); }
.cafe-hero-media img { width:100%; height:100%; object-fit:cover; }
.cafe-hero-media-empty, .cafe-mini-story-media span { display:flex; width:100%; align-items:center; justify-content:center; font-size:13px; font-weight:700; letter-spacing:.14em; text-transform:uppercase; color:rgba(255,255,255,.92); }
.cafe-chip { display:inline-flex; align-items:center; justify-content:center; min-height:30px; padding:0 12px; border-radius:999px; background:var(--chch-chip-bg); color:var(--chch-chip-text); font-size:12px; font-weight:700; align-self:flex-start; }
.cafe-chip-soft { background:var(--chch-stat-bg); color:#6f8b79; }
.cafe-hero-copy { display:flex; flex-direction:column; justify-content:center; min-width:0; }
.cafe-hero-copy h3 { margin:14px 0 12px; font-size:32px; line-height:1.12; letter-spacing:-.05em; }
.cafe-hero-copy p { margin:0; font-size:14px; line-height:1.8; color:var(--chch-text-soft); }
.cafe-hero-meta { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin-top:18px; color:var(--chch-text-muted); font-size:13px; }
.cafe-hero-cta { display:inline-flex; align-items:center; justify-content:center; min-height:40px; padding:0 16px; border-radius:12px; background:linear-gradient(135deg, #49a46c 0%, #87cda0 100%); color:#fff; font-weight:700; }
.cafe-hero-secondary { display:grid; gap:14px; }
.cafe-mini-story { display:grid; grid-template-columns:108px minmax(0,1fr); gap:12px; align-items:center; padding:12px; border:1px solid var(--chch-card-border-soft); border-radius:18px; background:var(--chch-surface-soft); }
.cafe-mini-story-media { display:block; position:relative; height:86px; border-radius:14px; overflow:hidden; background:linear-gradient(135deg, #8ccaa2 0%, #d8efe0 100%); }
.cafe-mini-story-media img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.cafe-mini-story-media span { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; }
.cafe-mini-story-label { display:inline-block; margin-bottom:6px; font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--chch-text-muted); }
.cafe-mini-story-copy h4, .cafe-ranked-copy h4, .cafe-latest-item h4, .cafe-discovery-item h5 { margin:0; font-size:18px; line-height:1.35; }
.cafe-ranked-list, .cafe-side-list { display:grid; gap:12px; }
.cafe-ranked-item { display:grid; grid-template-columns:48px minmax(0,1fr); gap:12px; align-items:start; padding:12px 0; border-top:1px solid var(--chch-card-border-soft); }
.cafe-ranked-item:first-child { border-top:0; padding-top:0; }
.cafe-ranked-num { display:inline-flex; align-items:center; justify-content:center; width:42px; height:42px; border-radius:14px; background:var(--chch-thumb-bg); color:var(--chch-chip-text); font-size:14px; font-weight:700; }
.cafe-ranked-meta, .cafe-latest-meta { display:flex; flex-wrap:wrap; gap:10px; margin-top:6px; color:var(--chch-text-muted); font-size:12px; }
.cafe-topic-cloud, .cafe-quick-links { display:flex; flex-wrap:wrap; gap:10px; }
.cafe-topic-chip, .cafe-quick-links a { display:inline-flex; align-items:center; justify-content:center; min-height:36px; padding:0 15px; border:1px solid var(--chch-border-strong); border-radius:999px; background:#f7fbf8; color:var(--chch-text-soft); font-size:13px; font-weight:700; }
.cafe-topic-chip:hover, .cafe-quick-links a:hover { border-color:#9fd2af; background:var(--chch-surface-hover); color:var(--chch-link); }
.cafe-topic-chip.topic-md { font-size:15px; min-height:40px; padding:0 18px; background:var(--chch-surface-hover); color:#3d8c5c; border-color:#b3d9c0; }
.cafe-topic-chip.topic-lg { font-size:17px; min-height:44px; padding:0 20px; background:#dbf0e3; color:#297548; border-color:#8bc4a0; font-weight:800; }
.cafe-thumb-grid { display:flex; flex-wrap:wrap; gap:8px; }
.cafe-thumb-item { display:flex; flex-direction:column; align-items:center; text-decoration:none; transition:transform .15s; width:48px; }
.cafe-thumb-item:hover { transform:translateY(-1px); }
.cafe-thumb-img { display:block; width:48px; height:48px; border-radius:10px; background-size:cover; background-position:center; background-color:var(--chch-thumb-bg); border:1px solid var(--chch-border-strong); }
.cafe-thumb-name { margin-top:4px; font-size:9px; color:#4e7352; font-weight:600; text-align:center; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:48px; }
.cafe-latest-featured { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:16px; margin-bottom:18px; }
.cafe-latest-card { border:1px solid var(--chch-card-border-soft); border-radius:20px; background:var(--chch-card-bg); overflow:hidden; transition:box-shadow .2s, transform .2s; }
.cafe-latest-card:hover { box-shadow:0 8px 24px rgba(50,120,80,.12); transform:translateY(-2px); }
.cafe-latest-card-thumb { display:block; height:160px; overflow:hidden; background:linear-gradient(135deg, #88c4a0 0%, #cfe7d8 100%); }
.cafe-latest-card-thumb img { width:100%; height:100%; object-fit:cover; }
.cafe-latest-card-body { padding:16px; }
.cafe-latest-card-body h4 { margin:10px 0 0; font-size:18px; line-height:1.35; }
.cafe-latest-card-excerpt { margin:8px 0 0; font-size:13px; line-height:1.65; color:var(--chch-text-soft); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.cafe-latest-grid { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:14px; }
.cafe-discovery-grid, .cafe-stat-grid { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:16px; }
.cafe-latest-item, .cafe-discovery-card { padding:16px; border:1px solid var(--chch-card-border-soft); border-radius:16px; background:var(--chch-card-bg-soft); }
.cafe-latest-item h4 { margin:10px 0 0; font-size:17px; line-height:1.4; }
.cafe-discovery-card h4 { margin:0 0 14px; color:var(--chch-card-heading); font-size:22px; }
.cafe-discovery-list { display:grid; gap:12px; }
.cafe-discovery-item { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding-top:12px; border-top:1px solid var(--chch-card-border-soft); }
.cafe-discovery-item:first-child { border-top:0; padding-top:0; }
.cafe-discovery-item p { margin:6px 0 0; color:var(--chch-text-soft); font-size:13px; line-height:1.6; }
.cafe-discovery-item span, .cafe-stat-box span { color:var(--chch-text-muted); font-size:12px; font-weight:700; }
.cafe-side-stack { display:grid; gap:18px; }
.cafe-side-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:18px; margin-bottom:12px; }
.cafe-side-heading-with-action { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.cafe-side-action { display:inline-flex; align-items:center; justify-content:center; min-height:34px; padding:0 14px; border:1px solid #9fd2af; border-radius:999px; background:linear-gradient(135deg, #49a46c 0%, #8bd0a1 100%); color:#fff !important; font-size:12px; font-weight:700; line-height:1; white-space:nowrap; box-shadow:0 10px 18px rgba(134,184,148,.16); }
.cafe-side-action:hover { border-color:#8bc9a0; background:linear-gradient(135deg, #3f9861 0%, #7dc693 100%); color:#fff !important; }
.cafe-side-list-item { padding-top:10px; border-top:1px solid var(--chch-card-border-soft); }
.cafe-side-list-item:first-child { border-top:0; padding-top:0; }
.cafe-side-list-item a { display:block; font-size:14px; line-height:1.6; }
.cafe-favorite-list { display:grid; gap:10px; }
.cafe-favorite-item { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:12px 14px; border:1px solid var(--chch-card-border-soft); border-radius:16px; background:var(--chch-card-bg-soft); }
.cafe-favorite-link { display:inline-flex; align-items:center; min-width:0; gap:8px; color:var(--chch-card-text-strong); font-size:14px; font-weight:700; line-height:1.45; }
.cafe-favorite-bullet { display:inline-block; flex:0 0 auto; color:var(--chch-text-muted); font-size:16px; line-height:1; transform:translateY(-1px); }
.cafe-favorite-badge { display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto; min-height:24px; padding:0 9px; border:1px solid #f0c4bc; border-radius:999px; background:#fff4f1; color:#c85747; font-size:10px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.cafe-side-empty { padding:14px 16px; border:1px dashed var(--chch-button-border); border-radius:16px; background:var(--chch-surface-soft); color:var(--chch-text-soft); font-size:13px; line-height:1.6; }
.cafe-favorite-editor-copy { margin:-4px 0 18px; color:var(--chch-text-soft); font-size:14px; line-height:1.7; }
.cafe-favorite-editor-body .well { margin:0; padding:18px; border:1px solid var(--chch-card-border-soft); border-radius:20px; background:var(--chch-card-bg-soft); box-shadow:none; }
.cafe-favorite-editor-body .alert { margin:0 0 16px; padding:14px 16px; border:1px solid #d9eadf; border-radius:18px; background:var(--chch-stat-bg); color:#5f7a69; }
.cafe-favorite-editor-body table.stacked { width:100%; border-collapse:collapse; background:#fff; }
.cafe-favorite-editor-body table.stacked th, .cafe-favorite-editor-body table.stacked td { padding:11px 10px; border-bottom:1px solid #e9f2ec; font-size:13px; text-align:left; vertical-align:middle; }
.cafe-favorite-editor-body table.stacked th { color:var(--chch-text-muted); font-size:12px; font-weight:700; background:#f7fbf8; }
.cafe-favorite-editor-body .button.tiny, .cafe-favorite-editor-body .button.green { display:inline-flex; align-items:center; justify-content:center; min-height:32px; padding:0 12px; border:1px solid var(--chch-button-border); border-radius:10px; background:#f7fbf8; color:var(--chch-text-soft); font-size:12px; font-weight:700; text-decoration:none; }
.cafe-favorite-editor-body .button.green { border-color:#9fd2af; background:linear-gradient(135deg, #49a46c 0%, #8bd0a1 100%); color:#fff; }
.cafe-favorite-editor-body .button.blue { border-color:#9fc2e8; background:#edf5ff; color:#2f6fb2; }
.cafe-favorite-editor-body .button.brown, .cafe-favorite-editor-body .button.orange { background:var(--chch-surface-hover); color:var(--chch-link); }
.cafe-favorite-editor-body .pagination { margin:20px 0 0; }
.cafe-favorite-editor-body .pagination ul { display:flex; flex-wrap:wrap; gap:8px; padding:0; margin:0; list-style:none; }
.cafe-favorite-editor-body .pagination li a, .cafe-favorite-editor-body .pagination li.active a, .cafe-favorite-editor-body .pagination li.active { display:inline-flex; align-items:center; justify-content:center; min-width:40px; min-height:40px; padding:0 12px; border:1px solid var(--chch-border); border-radius:12px; background:var(--chch-surface-soft); color:var(--chch-text-soft); font-size:13px; font-weight:700; text-decoration:none; }
.cafe-favorite-editor-body .pagination li.active a, .cafe-favorite-editor-body .pagination li.active { border-color:#a7d3b4; background:#ebf7ef; color:var(--chch-link); }
.cafe-favorite-editor-body .ac { margin-top:18px; text-align:center; }
.cafe-memo-tabs { display:flex; flex-wrap:wrap; gap:10px; margin-bottom:18px; }
.cafe-memo-tabs a { display:inline-flex; align-items:center; justify-content:center; min-height:36px; padding:0 14px; border:1px solid var(--chch-button-border); border-radius:999px; background:#f7fbf8; color:var(--chch-text-soft); font-size:13px; font-weight:700; text-decoration:none; }
.cafe-memo-tabs a.is-active { border-color:#9fd2af; background:var(--chch-surface-hover); color:var(--chch-link); }
.cafe-memo-toolbar { display:flex; justify-content:flex-end; gap:8px; margin-bottom:14px; }
.cafe-memo-toolbar-button { display:inline-flex; align-items:center; justify-content:center; min-height:34px; padding:0 14px; border:1px solid var(--chch-button-border); border-radius:12px; background:#f7fbf8; color:var(--chch-text-soft); font-size:12px; font-weight:700; text-decoration:none; cursor:pointer; }
.cafe-memo-toolbar-button.primary { border-color:#9fd2af; background:linear-gradient(135deg, #49a46c 0%, #8bd0a1 100%); color:#fff; }
.cafe-memo-toolbar-button.danger { border-color:#f0c4bc; background:#fff4f1; color:#c85747; }
.cafe-memo-table-wrap { overflow-x:auto; border:1px solid var(--chch-card-border-soft); border-radius:20px; background:var(--chch-card-bg-soft); }
.cafe-memo-table { width:100%; border-collapse:collapse; min-width:760px; }
.cafe-memo-table th, .cafe-memo-table td { padding:12px 10px; border-bottom:1px solid #e9f2ec; color:var(--chch-text); font-size:13px; text-align:left; vertical-align:middle; }
.cafe-memo-table th { background:#f7fbf8; color:var(--chch-text-muted); font-size:12px; font-weight:700; }
.cafe-memo-col-number { min-width:52px; white-space:nowrap; }
.cafe-memo-title-cell a { color:var(--chch-link); font-weight:700; text-decoration:none; }
.cafe-memo-status-icon { display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; border:1px solid var(--chch-button-border); border-radius:50%; background:#f7fbf8; color:#6f8b79; font-size:14px; font-weight:700; line-height:1; }
.cafe-memo-status-icon.is-unread { border-color:#f0c4bc; background:#fff4f1; color:#c85747; }
.cafe-memo-empty { padding:30px 24px; border:1px dashed var(--chch-button-border); border-radius:20px; background:var(--chch-surface-soft); color:var(--chch-text-soft); font-size:14px; text-align:center; }
.cafe-memo-pagination { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; margin-top:18px; }
.cafe-memo-pagination a { display:inline-flex; align-items:center; justify-content:center; min-width:40px; min-height:40px; padding:0 12px; border:1px solid var(--chch-border); border-radius:12px; background:var(--chch-surface-soft); color:var(--chch-text-soft); font-size:13px; font-weight:700; text-decoration:none; }
.cafe-memo-pagination a.is-active { border-color:#a7d3b4; background:#ebf7ef; color:var(--chch-link); }
.cafe-memo-view { border:1px solid var(--chch-card-border-soft); border-radius:20px; background:var(--chch-card-bg-soft); overflow:hidden; }
.cafe-memo-view-row { display:grid; grid-template-columns:120px minmax(0,1fr); border-top:1px solid var(--chch-card-border-soft); }
.cafe-memo-view-row:first-child { border-top:0; }
.cafe-memo-view-row strong { padding:16px 18px; background:#f7fbf8; color:var(--chch-text-muted); font-size:12px; }
.cafe-memo-view-row div { padding:16px 18px; color:var(--chch-text); font-size:14px; line-height:1.8; background:var(--chch-card-bg); }
.cafe-memo-view-row.is-body div { min-height:180px; }
.cafe-memo-actions { display:flex; flex-wrap:wrap; gap:10px; justify-content:center; margin-top:18px; }
.cafe-memo-write-form { display:grid; gap:16px; }
.cafe-memo-form-row { display:grid; grid-template-columns:110px minmax(0,1fr); gap:14px; align-items:start; }
.cafe-memo-form-row label { padding-top:12px; color:var(--chch-text-muted); font-size:13px; font-weight:700; }
.cafe-memo-form-field { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.cafe-memo-input, .cafe-memo-textarea { width:100%; box-sizing:border-box; padding:12px 14px; border:1px solid var(--chch-border); border-radius:14px; background:var(--chch-card-bg); color:var(--chch-text); font-size:14px; }
.cafe-memo-textarea { min-height:220px; resize:vertical; }
.cafe-v4-login-form, .cafe-v4-login-state { display:grid; gap:14px; }
.cafe-v4-login-fields { display:grid; gap:10px; }
.cafe-v4-login-fields input[type="text"], .cafe-v4-login-fields input[type="password"] { width:100%; height:44px; padding:0 14px; border:1px solid var(--chch-border); border-radius:14px; background:var(--chch-surface-soft); color:var(--chch-text); font-size:14px; box-sizing:border-box; }
.cafe-v4-login-actions { display:flex; align-items:center; justify-content:flex-end; gap:12px; }
.cafe-v4-login-save { display:inline-flex; align-items:center; gap:8px; color:var(--chch-text-soft); font-size:13px; margin-top:-2px; }
.cafe-v4-login-submit, .cafe-v4-login-link-primary, .cafe-v4-login-link-secondary, .cafe-v4-login-links a.button { display:inline-flex; align-items:center; justify-content:center; min-height:38px; padding:0 14px; border:1px solid var(--chch-button-border); border-radius:12px; background:var(--chch-surface-soft); color:var(--chch-text-soft); font-size:13px; font-weight:700; text-decoration:none; box-sizing:border-box; }
.cafe-v4-login-submit, .cafe-v4-login-link-primary { border-color:#9fd2af; background:linear-gradient(135deg, #49a46c 0%, #8bd0a1 100%); color:#fff; }
.cafe-v4-login-link-secondary, .cafe-v4-login-links a.button { background:var(--chch-surface-hover); color:var(--chch-link); }
.cafe-v4-login-link-availability { display:inline-flex; align-items:center; justify-content:center; min-height:38px; padding:0 14px; border:1px solid #f1d6b6; border-radius:12px; background:#fff4e8; color:#b56a1f; font-size:13px; font-weight:700; box-sizing:border-box; }
.cafe-v4-login-links { display:flex; flex-wrap:wrap; gap:10px; }
.cafe-v4-login-links-utility { gap:8px; }
.cafe-v4-login-links-secondary { margin-top:-4px; }
.cafe-v4-login-inline-link, .cafe-v4-login-inline-link a, .cafe-v4-login-inline-link .button { display:inline-flex; align-items:center; gap:6px; color:var(--chch-text-soft) !important; font-size:13px; font-weight:700; text-decoration:none !important; }
.cafe-v4-login-inline-link img { max-height:18px; width:auto; }
.cafe-v4-login-user { display:flex; align-items:center; gap:12px; }
.cafe-v4-login-avatar { display:flex; align-items:center; justify-content:center; width:44px; height:44px; border-radius:50%; background:var(--chch-surface-hover); overflow:hidden; }
.cafe-v4-login-avatar img { width:100%; height:100%; object-fit:cover; }
.cafe-v4-login-user-copy strong { display:block; color:var(--chch-card-heading); font-size:16px; }
.cafe-v4-login-user-copy span { display:block; margin-top:3px; color:var(--chch-text-soft); font-size:12px; }
.cafe-v4-login-stats { display:flex; flex-wrap:wrap; gap:6px; }
.cafe-v4-login-pill { display:inline-flex; align-items:center; gap:4px; padding:4px 10px; border-radius:8px; background:var(--chch-stat-bg); font-size:11px; color:#5a7a6a; }
.cafe-v4-login-pill strong { color:#2a5030; font-size:11px; margin:0; }
.cafe-stat-box { padding:16px; border-radius:18px; background:var(--chch-stat-bg); text-align:center; }
.cafe-stat-box strong { display:block; color:var(--chch-card-heading); font-size:24px; line-height:1.1; }
.cafe-v4-footer { margin-top:18px; padding:26px 0 30px; border-top:1px solid var(--chch-footer-border); background:var(--chch-footer-bg); }
.cafe-v4-footer-inner { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:20px; margin-bottom:18px; }
.cafe-v4-footer-copy strong, .cafe-v4-footer-verse strong { display:block; color:var(--chch-card-heading); font-size:18px; }
.cafe-v4-footer-copy p, .cafe-v4-footer-verse p { margin:8px 0 0; color:var(--chch-text-soft); font-size:13px; line-height:1.7; }
.cafe-v4-footer-bottom { display:grid; grid-template-columns:minmax(0,1fr) 260px; gap:24px; align-items:start; color:var(--chch-text-soft); font-size:12px; }
.cafe-v4-footer-meta { display:grid; gap:6px; }
.cafe-v4-footer-meta p { margin:0; line-height:1.7; }
.cafe-v4-footer-meta a { color:var(--chch-link); }
.cafe-v4-footer-family { display:grid; gap:8px; }
.cafe-v4-footer-family label { color:var(--chch-text-muted); font-size:12px; font-weight:700; }
.cafe-v4-footer-family select { width:100%; height:42px; padding:0 14px; border:1px solid var(--chch-border); border-radius:14px; background:rgba(255,255,255,.96); color:var(--chch-text-soft); font-size:13px; box-sizing:border-box; }
.v4-scroll-controls { position:fixed; right:24px; bottom:28px; display:flex; flex-direction:column; gap:10px; z-index:1400; opacity:0; visibility:hidden; transform:translateY(8px); transition:opacity .22s ease, transform .22s ease, visibility .22s ease; pointer-events:none; }
.v4-scroll-controls.is-visible { opacity:1; visibility:visible; transform:translateY(0); pointer-events:auto; }
.v4-scroll-button { display:inline-flex; align-items:center; justify-content:center; width:48px; height:48px; border:1px solid var(--chch-footer-border); border-radius:16px; background:rgba(255,255,255,.92); box-shadow:0 14px 28px rgba(134,184,148,.18); color:var(--chch-link); font-size:22px; font-weight:700; cursor:pointer; backdrop-filter:blur(8px); }
.v4-scroll-button:hover { background:var(--chch-surface-hover); border-color:#9fd2af; }
.v4-scroll-button[hidden] { display:none !important; }
.cafe-category-summary p { margin:12px 0 0; color:var(--chch-text-soft); font-size:14px; line-height:1.7; }
.cafe-category-path, .cafe-category-subcats { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.cafe-category-topcats { display:flex; flex-wrap:wrap; gap:10px; margin-top:16px; }
.cafe-category-path a, .cafe-category-path strong { color:var(--chch-link); font-weight:700; }
.cafe-category-path span { color:var(--chch-text-muted); font-weight:700; }
.cafe-category-subcats { margin-top:16px; }
.cafe-category-topcats .cafe-chip em, .cafe-category-subcats .cafe-chip em { margin-left:6px; font-style:normal; opacity:.72; }
.cafe-category-topcats .cafe-chip.is-active, .cafe-category-subcats .cafe-chip.is-active { background:#e4f4ea; color:var(--chch-link); border-color:#9fd2af; }
.cafe-category-list { display:grid; gap:14px; margin-top:20px; }
.cafe-category-item { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; padding:18px; border:1px solid var(--chch-card-border-soft); border-radius:20px; background:var(--chch-card-bg-soft); }
.cafe-category-item-copy { min-width:0; }
.cafe-category-item-copy h3 { margin:0; font-size:20px; line-height:1.3; }
.cafe-category-item-copy p { margin:8px 0 0; color:var(--chch-text-soft); font-size:14px; line-height:1.7; }
.cafe-category-item-meta { flex:0 0 auto; display:grid; gap:8px; text-align:right; color:var(--chch-text-muted); font-size:12px; font-weight:700; }
.cafe-category-pagination { margin-top:24px; }
.cafe-category-pagination ul { display:flex; flex-wrap:wrap; gap:8px; padding:0; margin:0; list-style:none; }
.cafe-category-pagination li a, .cafe-category-pagination li.active a, .cafe-category-pagination li.active { display:inline-flex; align-items:center; justify-content:center; min-width:40px; min-height:40px; padding:0 12px; border:1px solid var(--chch-border); border-radius:12px; background:var(--chch-surface-soft); color:var(--chch-text-soft); font-size:13px; font-weight:700; }
.cafe-category-pagination li.active a, .cafe-category-pagination li.active { border-color:#a7d3b4; background:#ebf7ef; color:var(--chch-link); }
@media (max-width: 1280px) {
  .cafe-v4-header-inner, .cafe-v4-content, .cafe-v4-footer-inner, .cafe-v4-footer-bottom { width:auto; margin-left:20px; margin-right:20px; }
}
@media (max-width: 1024px) {
  .cafe-v4-header {
    padding: 0 !important;
  }
  .cafe-home-grid, .cafe-double-panels, .cafe-hero-grid, .cafe-hero-primary, .cafe-discovery-grid, .cafe-v4-footer-inner, .cafe-v4-footer-bottom { grid-template-columns:1fr; }
  .cafe-v4-header-inner, .cafe-section-heading { align-items:flex-start; flex-direction:column; }
  .cafe-v4-header-inner {
    min-height: 78px;
    padding: 10px 12px;
    box-sizing: border-box;
  }
  .cafe-v4-header-tools { width:100%; align-items:stretch; }
  .cafe-v4-search input[type="text"] { width:100%; }
  .cafe-v4-brand-kr { font-size:30px; }
}
@media (max-width: 680px) {
  .cafe-v4-header-inner, .cafe-v4-content, .cafe-v4-footer-inner, .cafe-v4-footer-bottom { margin-left:14px; margin-right:14px; }
  .cafe-v4-login-stats, .cafe-stat-grid, .cafe-latest-grid { grid-template-columns:1fr; }
  .cafe-v4-login-fields input[type="text"], .cafe-v4-login-fields input[type="password"] { height:46px; font-size:16px; }
  .cafe-v4-search button { min-width:72px; padding-left:16px; padding-right:16px; font-size:15px; }
  .cafe-v4-nav { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); width:100%; }
  .cafe-v4-nav a { width:100%; padding-left:0; padding-right:0; }
  .cafe-v4-nav a, .cafe-topic-chip, .cafe-quick-links a, .cafe-v4-login-submit, .cafe-v4-login-link-primary, .cafe-v4-login-link-secondary, .cafe-v4-login-links a.button { min-height:42px; font-size:14px; }
  .cafe-v4-brand-kr { font-size:28px; }
  .cafe-v4-content { padding-top:12px; }
  .cafe-category-item { flex-direction:column; }
  .cafe-category-item-meta { width:100%; grid-template-columns:repeat(2, minmax(0,1fr)); text-align:left; }
  .cafe-side-heading-with-action { align-items:flex-start; }
  .cafe-favorite-editor-body { overflow-x:auto; }
  .cafe-favorite-editor-body table.stacked { min-width:760px; }
  .cafe-memo-form-row, .cafe-memo-view-row { grid-template-columns:1fr; }
  .cafe-memo-form-row label { padding-top:0; }
  .v4-scroll-controls { right:14px; bottom:76px; gap:8px; }
  .v4-scroll-button { width:44px; height:44px; border-radius:14px; font-size:20px; }
  /* 히어로 이미지 높이 고정 — 원본 비율로 세로 확장 방지 */
  .cafe-hero-media { min-height:220px; max-height:220px; }
  .cafe-mini-story-media { min-height:68px; max-height:120px; }
  .cafe-hero-copy h3 { font-size:22px; line-height:1.15; margin:10px 0 8px; }
}
@media (max-width: 480px) {
  .cafe-v4-header-inner, .cafe-v4-content, .cafe-v4-footer-inner, .cafe-v4-footer-bottom { margin-left:12px; margin-right:12px; }
  .cafe-hero-media { min-height:180px; max-height:180px; }
}

/* ===== 블로그 v5 와 동일한 레이아웃 기반 rule 이식 (2026-04-17)
 * 블로그에는 있고 카페 v5 에는 누락된 min-width/containment 규칙 추가.
 * ===== */
.cafe-v4-page { min-width: 320px; }
.cafe-home-main,
.cafe-home-side { min-width: 0; }
.cafe-mini-story-copy { min-width: 0; }
.cafe-hero-copy { min-width: 0; }
.cafe-ranked-copy,
.cafe-latest-item,
.cafe-discovery-item,
.cafe-side-list-item,
.cafe-category-item-copy { min-width: 0; }

/* 긴 한글/영문 제목 강제 줄바꿈 (min-content 기반 grid 자식 확장 방지) */
.cafe-ranked-copy h4,
.cafe-ranked-copy h4 a,
.cafe-mini-story-copy h4,
.cafe-latest-item h4,
.cafe-discovery-item h5,
.cafe-side-list-item a,
.cafe-hero-copy h3,
.cafe-hero-copy h3 a,
.cv5-feed-title,
.cv5-feed-title a,
.cv5-featured-body h4,
.cv5-featured-body h4 a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ===================================================
   HAMBURGER MOBILE NAV  (≤1024px)
   =================================================== */

/* Sticky header */
.cafe-v4-header {
  position: sticky;
  top: 0;
  z-index: 1300;
  background: var(--chch-header-bg);
  backdrop-filter: blur(8px);
}

/* Mobile nav wrapper — hidden on desktop */
.cafe-v4-mobile-nav { display: none; }

/* Hamburger toggle button */
.cafe-mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--chch-button-border);
  border-radius: 14px;
  background: rgba(255,255,255,.86);
  cursor: pointer;
}
.cafe-mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #3d7a55;
  border-radius: 2px;
}

/* Dropdown panel */
.cafe-mobile-panel {
  display: none;
  position: fixed;
  top: 66px;
  right: 12px;
  width: 288px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding: 18px;
  border: 1px solid var(--chch-button-border);
  border-radius: 22px;
  background: var(--chch-surface);
  box-shadow: var(--chch-shadow-strong);
  z-index: 1400;
  box-sizing: border-box;
}
.cafe-mobile-panel.is-open { display: block; }
.cafe-mobile-topbar { display:flex; align-items:stretch; gap:8px; margin-bottom:16px; }
.cafe-theme-toggle-mobile { flex:0 0 40px; width:40px; height:40px; margin: 0; }

/* Mobile search inside panel */
.cafe-mobile-search {
  display: flex;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  margin-bottom: 0;
}
.cafe-mobile-search input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--chch-button-border);
  border-radius: 12px;
  background: var(--chch-surface-soft);
  color: var(--chch-text);
  font-size: 14px;
  box-sizing: border-box;
}
.cafe-mobile-search button {
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #49a46c 0%, #8bd0a1 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

/* Login widget — cv4w- classes */
.cv4w-form,
.cv4w-state  { display: grid; gap: 10px; }
.cv4w-fields { display: grid; gap: 8px; }
.cv4w-fields input[type="text"],
.cv4w-fields input[type="password"] {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--chch-button-border);
  border-radius: 12px;
  background: var(--chch-surface-soft);
  color: var(--chch-text);
  font-size: 14px;
  box-sizing: border-box;
}
.cv4w-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.cv4w-save {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--chch-text-soft);
  cursor: pointer;
}
.cv4w-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--chch-button-border);
  border-radius: 12px;
  background: var(--chch-surface-soft);
  color: var(--chch-text-soft);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
}
.cv4w-btn-primary   { border-color: #9fd2af; background: linear-gradient(135deg, #49a46c 0%, #8bd0a1 100%); color: #fff; }
.cv4w-btn-secondary { background: var(--chch-surface-hover); color: var(--chch-link); }
.cv4w-links  { display: flex; flex-wrap: wrap; gap: 8px; }
.cv4w-user   { display: flex; align-items: center; gap: 10px; }
.cv4w-nick   { color: var(--chch-card-heading); font-size: 15px; font-weight: 700; }
.cv4w-online { font-size: 11px; color: var(--chch-text-soft); background: var(--chch-surface-hover); border: 1px solid var(--chch-chip-border); border-radius: 999px; padding: 2px 8px; }
.cv4w-stats  { display: flex; flex-wrap: wrap; gap: 6px; }
.cv4w-stat-pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 8px; background: var(--chch-stat-bg); font-size: 11px; color: #5a7a6a; text-decoration: none; }
.cv4w-stat-pill strong { color: #2a5030; font-size: 11px; margin: 0; }
.cv4w-actions { display: flex; gap: 8px; }
.cv4w-details { display: grid; gap: 10px; }
.cv4w-details-toggle {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--chch-button-border);
  border-radius: 12px;
  background: var(--chch-surface-soft);
  color: var(--chch-text-soft);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.cv4w-details-toggle::-webkit-details-marker { display: none; }
.cv4w-details-toggle::after { content: '▾'; font-size: 12px; }
.cv4w-details[open] .cv4w-details-toggle {
  border-color: #9fd2af;
  background: var(--chch-surface-hover);
  color: var(--chch-link);
}
.cv4w-details[open] .cv4w-details-toggle::after { transform: rotate(180deg); }
.cv4w-links-mobile,
.cv4w-actions-mobile {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 8px;
}
.cv4w-links-mobile .cv4w-btn,
.cv4w-actions-mobile .cv4w-btn {
  width: 100%;
}
.cv4w-links-mobile .cv4w-btn em {
  font-style: normal;
  font-size: 11px;
  opacity: .78;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="dark"] body {
  color: #c9d9ec;
  background:
    radial-gradient(circle at top, rgba(70, 122, 98, .18), transparent 30%),
    linear-gradient(180deg, #0c1726 0%, #122235 52%, #0d1827 100%);
}

html[data-theme="dark"] a {
  color: #8fc7ff;
}

html[data-theme="dark"] a:hover {
  color: #c2e2ff;
}

html[data-theme="dark"] .cafe-v4-header {
  background: rgba(12,23,38,.94);
}

html[data-theme="dark"] .cafe-v4-nav a,
html[data-theme="dark"] .cafe-v4-search,
html[data-theme="dark"] .cafe-theme-toggle,
html[data-theme="dark"] .cafe-mobile-toggle,
html[data-theme="dark"] .cafe-mobile-panel,
html[data-theme="dark"] .cv4w-details-toggle,
html[data-theme="dark"] .cafe-panel,
html[data-theme="dark"] .cafe-side-card,
html[data-theme="dark"] .cafe-hero,
html[data-theme="dark"] .cafe-v4-footer,
html[data-theme="dark"] .cafe-memo-table-wrap,
html[data-theme="dark"] .cafe-memo-view,
html[data-theme="dark"] .cafe-favorite-editor-body .well {
  border-color: #223954;
  background: linear-gradient(180deg, #122338 0%, #0f1d31 100%);
  box-shadow: 0 18px 36px rgba(2, 8, 18, .32);
}

html[data-theme="dark"] .cafe-v4-brand-kr,
html[data-theme="dark"] .cafe-section-heading h2,
html[data-theme="dark"] .cafe-section-heading h3,
html[data-theme="dark"] .cafe-side-heading h4,
html[data-theme="dark"] .cafe-discovery-card h4,
html[data-theme="dark"] .cafe-v4-footer-copy strong,
html[data-theme="dark"] .cafe-v4-footer-verse strong,
html[data-theme="dark"] .cafe-v4-login-user-copy strong,
html[data-theme="dark"] .cafe-stat-box strong,
html[data-theme="dark"] .cv4w-nick,
html[data-theme="dark"] .cv4w-stat strong {
  color: #f2f7ff;
}

html[data-theme="dark"] .cafe-v4-brand-en,
html[data-theme="dark"] .cafe-section-kicker,
html[data-theme="dark"] .cafe-mini-story-label,
html[data-theme="dark"] .cafe-discovery-item span,
html[data-theme="dark"] .cafe-stat-box span,
html[data-theme="dark"] .cafe-v4-footer-family label,
html[data-theme="dark"] .cv4w-online,
html[data-theme="dark"] .cv4w-stat span {
  color: #8ea8c5;
}

html[data-theme="dark"] .cafe-panel,
html[data-theme="dark"] .cafe-side-card,
html[data-theme="dark"] .cafe-hero,
html[data-theme="dark"] .cafe-panel p,
html[data-theme="dark"] .cafe-side-card p,
html[data-theme="dark"] .cafe-hero p,
html[data-theme="dark"] .cafe-ranked-meta,
html[data-theme="dark"] .cafe-latest-meta,
html[data-theme="dark"] .cafe-side-list-item a,
html[data-theme="dark"] .cafe-favorite-link,
html[data-theme="dark"] .cafe-v4-footer-bottom,
html[data-theme="dark"] .cafe-v4-footer-meta p,
html[data-theme="dark"] .cv4w-save,
html[data-theme="dark"] .cafe-v4-login-user-copy span {
  color: #9db3cc;
}

html[data-theme="dark"] .cafe-v4-nav a,
html[data-theme="dark"] .cafe-topic-chip,
html[data-theme="dark"] .cafe-quick-links a,
html[data-theme="dark"] .cafe-favorite-item,
html[data-theme="dark"] .cafe-side-empty,
html[data-theme="dark"] .cafe-latest-item,
html[data-theme="dark"] .cafe-discovery-card,
html[data-theme="dark"] .cafe-mini-story,
html[data-theme="dark"] .cafe-stat-box,
html[data-theme="dark"] .cafe-v4-login-pill,
html[data-theme="dark"] .cafe-v4-login-stat,
html[data-theme="dark"] .cv4w-stat-pill,
html[data-theme="dark"] .cv4w-stat {
  border-color: #2b425d;
  background: #13253a;
}

html[data-theme="dark"] .cafe-v4-nav a.is-active,
html[data-theme="dark"] .cafe-v4-nav a:hover,
html[data-theme="dark"] .cv4w-details[open] .cv4w-details-toggle,
html[data-theme="dark"] .cafe-topic-chip:hover,
html[data-theme="dark"] .cafe-quick-links a:hover {
  border-color: #3e648b;
  background: #173250;
  color: #d6ebff;
}

html[data-theme="dark"] .cafe-v4-search input[type="text"],
html[data-theme="dark"] .cafe-mobile-search input[type="text"],
html[data-theme="dark"] .cv4w-fields input[type="text"],
html[data-theme="dark"] .cv4w-fields input[type="password"],
html[data-theme="dark"] .cafe-v4-footer-family select {
  border-color: #2b425d;
  background: #13253a;
  color: #dbe7f7;
  box-shadow: none;
}

html[data-theme="dark"] .cafe-v4-search button,
html[data-theme="dark"] .cafe-hero-cta,
html[data-theme="dark"] .cafe-side-action,
html[data-theme="dark"] .cv4w-btn-primary {
  border-color: #2f88e6;
  background: linear-gradient(135deg, #2f88e6 0%, #67aef0 55%, #9fd0ff 100%);
  color: #fff;
}

html[data-theme="dark"] .cv4w-btn-secondary,
html[data-theme="dark"] .v4-scroll-button {
  border-color: #2b425d;
  background: #13253a;
  color: #dbe7f7;
}

html[data-theme="dark"] .cafe-v4-login-link-primary,
html[data-theme="dark"] a.cafe-v4-login-link-primary,
html[data-theme="dark"] .cafe-v4-login-links a.cafe-v4-login-link-primary {
  border-color: #2f88e6 !important;
  background: linear-gradient(135deg, #1f6fc6 0%, #4c9ee8 100%) !important;
  color: #f5faff !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .cafe-v4-login-link-secondary,
html[data-theme="dark"] a.cafe-v4-login-link-secondary,
html[data-theme="dark"] .cafe-v4-login-links a.cafe-v4-login-link-secondary,
html[data-theme="dark"] .cafe-v4-login-links a.button.small,
html[data-theme="dark"] .cafe-v4-login-inline-link a.button.small {
  border-color: #35506d !important;
  background: #173250 !important;
  color: #a9cbf0 !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .cafe-v4-login-link-availability,
html[data-theme="dark"] .cafe-v4-login-links .cafe-v4-login-link-availability {
  border-color: #5e4c22 !important;
  background: #3a2b10 !important;
  color: #ffd899 !important;
}

html[data-theme="dark"] .cafe-v4-login-inline-link,
html[data-theme="dark"] .cafe-v4-login-inline-link a,
html[data-theme="dark"] .cafe-v4-login-inline-link .button,
html[data-theme="dark"] .cafe-v4-login-links-utility,
html[data-theme="dark"] .cafe-v4-login-links-secondary {
  color: #9bb1ca !important;
}

html[data-theme="dark"] .cafe-v4-login-links a.button.small.yellow {
  border-color: #5e4c22 !important;
  background: #3a2b10 !important;
  color: #ffd899 !important;
}

html[data-theme="dark"] .cafe-v4-login-links a.button.small.brown {
  border-color: #35506d !important;
  background: #173250 !important;
  color: #a9cbf0 !important;
}

html[data-theme="dark"] .cv4w-btn,
html[data-theme="dark"] a.cv4w-btn,
html[data-theme="dark"] button.cv4w-btn,
html[data-theme="dark"] .cv4w-actions .cv4w-btn,
html[data-theme="dark"] .cv4w-links .cv4w-btn,
html[data-theme="dark"] .cv4w-row .cv4w-btn {
  color: #dbe7f7 !important;
  border-color: #2b425d !important;
  background: #13253a !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .cv4w-btn-primary,
html[data-theme="dark"] a.cv4w-btn-primary,
html[data-theme="dark"] button.cv4w-btn-primary,
html[data-theme="dark"] .cv4w-actions .cv4w-btn-primary,
html[data-theme="dark"] .cv4w-links .cv4w-btn-primary,
html[data-theme="dark"] .cv4w-row .cv4w-btn-primary {
  border-color: #2f88e6 !important;
  background: linear-gradient(135deg, #1f6fc6 0%, #4c9ee8 100%) !important;
  color: #f5faff !important;
}

html[data-theme="dark"] .cv4w-btn-secondary,
html[data-theme="dark"] a.cv4w-btn-secondary,
html[data-theme="dark"] button.cv4w-btn-secondary,
html[data-theme="dark"] .cv4w-actions .cv4w-btn-secondary,
html[data-theme="dark"] .cv4w-links .cv4w-btn-secondary {
  border-color: #35506d !important;
  background: #173250 !important;
  color: #a9cbf0 !important;
}

html[data-theme="dark"] .cafe-mobile-toggle span {
  background: #9fc6f0;
}

html[data-theme="dark"] .cafe-mini-story,
html[data-theme="dark"] .cafe-latest-item,
html[data-theme="dark"] .cafe-discovery-card,
html[data-theme="dark"] .cafe-stat-box,
html[data-theme="dark"] .cafe-v4-login-pill,
html[data-theme="dark"] .cafe-v4-login-stat,
html[data-theme="dark"] .cv4w-stat-pill,
html[data-theme="dark"] .cv4w-stat {
  background: #122338;
}

html[data-theme="dark"] .cafe-hero-media,
html[data-theme="dark"] .cafe-mini-story-media,
html[data-theme="dark"] .cafe-ranked-num,
html[data-theme="dark"] .cafe-chip,
html[data-theme="dark"] .cafe-chip-soft,
html[data-theme="dark"] .cv4w-online {
  background: #173250;
  color: #9fcbf4;
}

html[data-theme="dark"] .cafe-ranked-item,
html[data-theme="dark"] .cafe-side-list-item,
html[data-theme="dark"] .cafe-discovery-item,
html[data-theme="dark"] .cafe-category-item,
html[data-theme="dark"] .cafe-favorite-editor-body table.stacked th,
html[data-theme="dark"] .cafe-favorite-editor-body table.stacked td,
html[data-theme="dark"] .cafe-memo-table th,
html[data-theme="dark"] .cafe-memo-table td,
html[data-theme="dark"] .cafe-memo-view-row {
  border-color: #20344d;
}

html[data-theme="dark"] .cafe-hero-copy h3,
html[data-theme="dark"] .cafe-mini-story-copy h4,
html[data-theme="dark"] .cafe-ranked-copy h4,
html[data-theme="dark"] .cafe-latest-item h4,
html[data-theme="dark"] .cafe-discovery-item h5,
html[data-theme="dark"] .cafe-category-item-copy h3,
html[data-theme="dark"] .cafe-favorite-link,
html[data-theme="dark"] .cafe-side-list-item a,
html[data-theme="dark"] .cafe-v4-login-user-copy strong,
html[data-theme="dark"] .cafe-v4-login-stat strong,
html[data-theme="dark"] .cv4w-stat strong {
  color: #f2f7ff;
}

html[data-theme="dark"] .cafe-hero-copy p,
html[data-theme="dark"] .cafe-discovery-item p,
html[data-theme="dark"] .cafe-category-item-copy p,
html[data-theme="dark"] .cafe-ranked-meta,
html[data-theme="dark"] .cafe-latest-meta,
html[data-theme="dark"] .cafe-favorite-bullet,
html[data-theme="dark"] .cafe-favorite-editor-copy,
html[data-theme="dark"] .cafe-favorite-editor-body .alert,
html[data-theme="dark"] .cafe-v4-login-user-copy span,
html[data-theme="dark"] .cafe-v4-login-stat span,
html[data-theme="dark"] .cv4w-save,
html[data-theme="dark"] .cv4w-stat span {
  color: #9bb1ca;
}

html[data-theme="dark"] .cafe-favorite-badge {
  border-color: #5e4c22;
  background: #3a2b10;
  color: #ffd899;
}

html[data-theme="dark"] .cafe-favorite-editor-body table.stacked th,
html[data-theme="dark"] .cafe-memo-table th,
html[data-theme="dark"] .cafe-memo-view-row strong {
  background: #10253e;
  color: #9cc8ff;
}

html[data-theme="dark"] .cafe-favorite-editor-body table.stacked,
html[data-theme="dark"] .cafe-favorite-editor-body .alert,
html[data-theme="dark"] .cafe-memo-empty,
html[data-theme="dark"] .cafe-memo-view-row div,
html[data-theme="dark"] .cafe-memo-input,
html[data-theme="dark"] .cafe-memo-textarea {
  border-color: #29435f;
  background: #122338;
  color: #dbe7f7;
}

html[data-theme="dark"] .cafe-side-empty,
html[data-theme="dark"] .cafe-memo-empty {
  border-color: #29435f;
}

html[data-theme="dark"] .cafe-v4-footer {
  border-top-color: #20344d;
  background: linear-gradient(180deg, rgba(11, 21, 34, .96) 0%, rgba(9, 18, 30, .96) 100%);
}

html[data-theme="dark"] .cafe-theme-toggle:hover,
html[data-theme="dark"] .cafe-theme-toggle:focus,
html[data-theme="dark"] .v4-scroll-button:hover {
  border-color: #3e648b;
  background: #173250;
  color: #8fc7ff;
}

/* ≤1024px overrides for hamburger layout */
@media (max-width: 1024px) {
  .cafe-side-card-login { display: none; }
  .cafe-v4-header-inner { flex-direction: row !important; align-items: center !important; }
  .cafe-v4-header-tools { display: none !important; }
  .cafe-v4-mobile-nav   { display: flex; align-items: center; }
  .cafe-mobile-toggle   { display: flex; }
  .cafe-v4-brand-block {
    display: flex;
    align-items: center;
    min-height: 46px;
    max-width: calc(100% - 64px);
  }
  .cafe-v4-brand {
    justify-content: center;
    gap: 2px;
  }
  .cafe-v4-brand-kr {
    font-size: 24px;
    line-height: 1;
  }
  .cafe-v4-brand-en {
    font-size: 10px;
    line-height: 1.1;
    letter-spacing: .18em;
  }
}

/* ===================================================
   TABLET PORTRAIT HERO COMPACT  (681px – 1024px)
   primary: image-left + copy-right 나란히, 이미지 200px 상한
   secondary: 3-column 수평 배열
   =================================================== */
@media (min-width: 681px) and (max-width: 1024px) {
  .cafe-hero-primary {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .cafe-hero-media {
    min-height: 180px;
    max-height: 200px;
  }
  .cafe-hero-copy h3 {
    font-size: 22px;
    margin: 8px 0 8px;
    line-height: 1.22;
  }
  .cafe-hero-copy p {
    font-size: 13px;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .cafe-hero-secondary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
}

html[data-theme="dark"] .cafe-latest-card { background:#0f2418; border-color:#1e3a2a; }
html[data-theme="dark"] .cafe-latest-card-body h4 a { color:#c8e0d2; }
html[data-theme="dark"] .cafe-latest-card-excerpt { color:#7a9b88; }

@media (max-width: 1024px) {
  .cafe-home-grid { grid-template-columns:1fr; }
  .cafe-hero-grid { grid-template-columns:1fr; }
  .cafe-hero-primary { grid-template-columns:1fr; }
  .cafe-hero-media { min-height:240px; }
}

@media (max-width: 768px) {
  .cafe-home-shell { padding-top:12px; padding-bottom:24px; }
  .cafe-hero, .cafe-panel, .cafe-side-card { padding:16px; border-radius:18px; }
  .cafe-double-panels { grid-template-columns:1fr; gap:14px; }
  .cafe-latest-featured { grid-template-columns:1fr; gap:14px; }
  .cafe-latest-card-thumb { height:180px; }
  .cafe-latest-grid, .cafe-discovery-grid { grid-template-columns:1fr; gap:10px; }
  .cafe-section-heading h2 { font-size:28px; }
  .cafe-section-heading h3 { font-size:22px; }
  .cafe-hero-copy h3 { font-size:24px; }
  .cafe-hero-media { min-height:200px; }
  .cafe-mini-story { grid-template-columns:80px minmax(0,1fr); }
  .cafe-mini-story-media { height:64px; }
}

/* ============================================================
 * cv5 — New Posts section (chch_cafe_v5 redesign)
 * ============================================================ */
.cv5-cat-tabs {
  display: flex; flex-wrap: nowrap; gap: 8px;
  overflow-x: auto; padding: 6px 2px 14px; margin-bottom: 18px;
  border-bottom: 1px solid var(--cafe-border, #e5e7eb);
  scrollbar-width: thin;
}
.cv5-cat-tabs::-webkit-scrollbar { height: 6px; }
.cv5-cat-tabs::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 3px; }
.cv5-cat-tab {
  flex: 0 0 auto; display: inline-flex; align-items: center;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--cafe-border, #e5e7eb);
  background: var(--cafe-surface, #fff);
  color: var(--cafe-text-muted, #64748b);
  font-size: 13.5px; font-weight: 600;
  text-decoration: none; white-space: nowrap;
  transition: all .15s ease;
}
.cv5-cat-tab:hover { border-color: #336699; color: #336699; }
.cv5-cat-tab-active { background: #336699; border-color: #336699; color: #fff; }
.cv5-cat-tab-active:hover { color: #fff; }

.cv5-featured {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px; margin-bottom: 26px;
}
.cv5-featured-card {
  display: flex; flex-direction: column;
  background: var(--cafe-surface, #fff);
  border: 1px solid var(--cafe-border, #e5e7eb);
  border-radius: 14px; overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.cv5-featured-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(15,23,42,.08);
}
.cv5-featured-thumb {
  display: block; aspect-ratio: 16 / 10;
  overflow: hidden; background: #f1f5f9;
}
.cv5-featured-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .3s ease;
}
.cv5-featured-card:hover .cv5-featured-thumb img { transform: scale(1.04); }
.cv5-featured-body {
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px 18px 18px; flex: 1;
}
.cv5-featured-body h4 {
  margin: 0; font-size: 17px; line-height: 1.45;
  font-weight: 700; letter-spacing: -0.01em;
}
.cv5-featured-body h4 a {
  color: var(--cafe-text, #1a2a3a); text-decoration: none;
}
.cv5-featured-body h4 a:hover { color: #cc0000; }
.cv5-featured-excerpt {
  margin: 0; font-size: 13.5px; line-height: 1.6;
  color: var(--cafe-text-muted, #64748b);
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}
.cv5-featured-meta {
  margin-top: auto; display: flex; justify-content: space-between;
  gap: 12px; font-size: 12px; color: var(--cafe-text-muted, #94a3b8);
  padding-top: 6px;
}

.cv5-feed {
  list-style: none; margin: 0 0 26px; padding: 0;
  display: flex; flex-direction: column;
}
.cv5-feed-item { border-bottom: 1px solid var(--cafe-border, #eef2f6); }
.cv5-feed-item:first-child { border-top: 1px solid var(--cafe-border, #eef2f6); }
.cv5-feed-link {
  display: grid; grid-template-columns: minmax(0, 1fr) 140px;
  gap: 20px; padding: 18px 4px;
  text-decoration: none; color: inherit;
  transition: background .12s ease;
}
.cv5-feed-link:hover { background: rgba(51,102,153,.03); }
.cv5-feed-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cv5-feed-title {
  margin: 0; font-size: 16px; font-weight: 700;
  line-height: 1.4; color: var(--cafe-text, #1a2a3a);
  letter-spacing: -0.005em;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.cv5-feed-link:hover .cv5-feed-title { color: #cc0000; }
.cv5-feed-excerpt {
  margin: 0; font-size: 13px; line-height: 1.6;
  color: var(--cafe-text-muted, #64748b);
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.cv5-feed-meta {
  margin-top: 4px; display: flex; gap: 12px;
  font-size: 12px; color: var(--cafe-text-muted, #94a3b8);
}
.cv5-feed-thumb {
  width: 140px; height: 92px; border-radius: 10px;
  overflow: hidden; background: #f1f5f9;
}
.cv5-feed-thumb img { width: 100%; height: 100%; object-fit: cover; }

.cv5-pagination {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 6px; margin: 26px 0 10px;
}
.cv5-page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 12px;
  border-radius: 8px; border: 1px solid var(--cafe-border, #e5e7eb);
  background: var(--cafe-surface, #fff);
  color: var(--cafe-text, #1a2a3a);
  font-size: 14px; font-weight: 600;
  text-decoration: none; transition: all .15s ease;
}
.cv5-page-btn:hover { border-color: #336699; color: #336699; }
.cv5-page-active {
  background: #336699; border-color: #336699; color: #fff; cursor: default;
}
.cv5-page-active:hover { color: #fff; }
.cv5-page-ellipsis { padding: 0 4px; color: var(--cafe-text-muted, #94a3b8); font-weight: 700; }

.cv5-empty { text-align: center; padding: 60px 20px; color: var(--cafe-text-muted, #64748b); }
.cv5-empty-icon { font-size: 48px; margin-bottom: 12px; opacity: .7; }
.cv5-empty p { margin: 0 0 16px; font-size: 15px; }

@media (max-width: 900px) {
  .cv5-featured { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cv5-featured-card:nth-child(3) { grid-column: span 2; flex-direction: row; }
  .cv5-featured-card:nth-child(3) .cv5-featured-thumb {
    width: 40%; aspect-ratio: auto; height: auto; flex-shrink: 0;
  }
}
@media (max-width: 640px) {
  .cv5-featured { grid-template-columns: 1fr; }
  .cv5-featured-card:nth-child(3) { grid-column: auto; flex-direction: column; }
  .cv5-featured-card:nth-child(3) .cv5-featured-thumb { width: 100%; aspect-ratio: 16 / 10; }
  .cv5-feed-link { grid-template-columns: minmax(0, 1fr) 96px; gap: 12px; padding: 14px 2px; }
  .cv5-feed-thumb { width: 96px; height: 72px; }
  .cv5-feed-title { font-size: 15px; }
  .cv5-feed-excerpt { -webkit-line-clamp: 2; font-size: 12.5px; }
  .cv5-cat-tab { padding: 7px 12px; font-size: 13px; }
}

/* 다크모드 */
html[data-theme="dark"] .cv5-cat-tab {
  background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.1); color: #cbd5e1;
}
html[data-theme="dark"] .cv5-cat-tab:hover { border-color: #5b9bd5; color: #93c5fd; }
html[data-theme="dark"] .cv5-cat-tab-active { background: #336699; border-color: #336699; color: #fff; }
html[data-theme="dark"] .cv5-featured-card {
  background: rgba(255,255,255,.03); border-color: rgba(255,255,255,.08);
}
html[data-theme="dark"] .cv5-featured-body h4 a { color: #e2e8f0; }
html[data-theme="dark"] .cv5-featured-body h4 a:hover { color: #ff6b6b; }
html[data-theme="dark"] .cv5-feed-item,
html[data-theme="dark"] .cv5-feed-item:first-child { border-color: rgba(255,255,255,.08); }
html[data-theme="dark"] .cv5-feed-link:hover { background: rgba(91,155,213,.06); }
html[data-theme="dark"] .cv5-feed-title { color: #e2e8f0; }
html[data-theme="dark"] .cv5-feed-link:hover .cv5-feed-title { color: #ff6b6b; }
html[data-theme="dark"] .cv5-page-btn {
  background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.1); color: #cbd5e1;
}
html[data-theme="dark"] .cv5-page-btn:hover { border-color: #5b9bd5; color: #93c5fd; }
html[data-theme="dark"] .cv5-page-active,
html[data-theme="dark"] .cv5-page-active:hover {
  background: #336699; border-color: #336699; color: #fff;
}

/* v5: Topics moved to sidebar — compact overrides */
.cafe-side-card-topics .cafe-section-heading,
.cafe-side-card-topics .cafe-section-heading-compact {
  margin-bottom: 10px;
}
.cafe-side-card-topics .cafe-section-heading h3,
.cafe-side-card-topics .cafe-section-heading h2 {
  font-size: 17px;
}
.cafe-side-card-topics .cafe-topic-cloud {
  gap: 6px;
}
.cafe-side-card-topics .cafe-topic-cloud a {
  font-size: 12.5px;
  padding: 5px 10px;
}
.cafe-side-card-topics .cafe-thumb-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px;
}
.cafe-side-card-topics .cafe-thumb-grid a,
.cafe-side-card-topics .cafe-thumb-grid img {
  height: auto;
  aspect-ratio: 4 / 3;
}

/* v5: wide trending panel spacing */
.cafe-panel-trending-wide { margin-top: 20px; }
@media (max-width: 720px) { .cafe-panel-trending-wide { margin-top: 18px; } }

/* cv5 카테고리 탭 카운트 배지 */
.cv5-cat-tab { gap: 6px; }
.cv5-cat-count {
  display: inline-block;
  min-width: 20px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  background: rgba(0,0,0,.06);
  color: inherit;
}
.cv5-cat-tab-active .cv5-cat-count { background: rgba(255,255,255,.22); }

/* v5 메뉴얼 배너 (사이드바) */
.v5-manual-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  background-color: #2563eb;
  background-image: url('https://chch.kr/numz/_assets/manual-banner-cafe.png');
  background-size: cover;
  background-position: right center;
  background-repeat: no-repeat;
  min-height: 92px;
  border-radius: 14px;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(47,139,90,.25);
  transition: transform .18s ease, box-shadow .18s ease;
  position: relative;
  overflow: hidden;
}
.v5-manual-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(47,139,90,.35);
  color: #fff;
}
.v5-manual-banner-icon {
  display: none;
  flex: 0 0 auto;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  background: rgba(255,255,255,.18);
  border-radius: 10px;
}
.v5-manual-banner-body {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.v5-manual-banner-kicker {
  font-size: 10.5px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  opacity: .78;
}
.v5-manual-banner-body strong {
  font-size: 15px; font-weight: 700;
  letter-spacing: -0.01em;
}
.v5-manual-banner-desc {
  font-size: 11.5px; opacity: .85;
  line-height: 1.4; margin-top: 2px;
}
.v5-manual-banner-arrow {
  flex: 0 0 auto;
  font-size: 22px; font-weight: 400;
  opacity: .7;
}
html[data-theme="dark"] .v5-manual-banner {
  background: linear-gradient(135deg, #22734a 0%, #0f4a2c 100%);
  box-shadow: 0 10px 24px rgba(0,0,0,.4);
}
.v5-manual-banner-body { max-width: 60%; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
