:root {
  color-scheme: light dark;
  --accent: #3c6e5c;
  --accent-dark: #2c5347;
  --accent-warm: #8a4d38;
  --text: #2b2620;
  --muted: #756b5c;
  --bg: #f7f4ee;
  --border: #ddd4c3;
  --panel: #fdfbf6;
  --panel-2: #ffffff;
  --cat-transport: #3c6e5c;
  --cat-money: #8a4d38;
  --cat-life: #777231;
  --cat-tools: #38688a;
  --ok: #1d6f42;
  --good: #2f5f9e;
  --tight: #9a6b00;
  --hot: #a4562a;
  --no: #aa3333;
  --note-bg: #fdf8f0;
  --note-border: #e0c9a6;
  --note-text: #5a4630;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #63a68c;
    --accent-dark: #8bc4ae;
    --accent-warm: #cf9873;
    --text: #f2ede2;
    --muted: #b0a491;
    --bg: #15130f;
    --border: #37312a;
    --panel: #201d19;
    --panel-2: #262320;
    --cat-transport: #63a68c;
    --cat-money: #cf9873;
    --cat-life: #b3ac6a;
    --cat-tools: #7cb3d6;
    --ok: #6ec48f;
    --good: #7ab0e8;
    --tight: #d9a93c;
    --hot: #e0a06a;
    --no: #e88a8a;
    --note-bg: #262018;
    --note-border: #4a3c28;
    --note-text: #e6dac6;
  }
}
:root[data-theme="dark"] {
  --accent: #63a68c;
  --accent-dark: #8bc4ae;
  --accent-warm: #cf9873;
  --text: #f2ede2;
  --muted: #b0a491;
  --bg: #15130f;
  --border: #37312a;
  --panel: #201d19;
  --panel-2: #262320;
  --cat-transport: #63a68c;
  --cat-money: #cf9873;
  --cat-life: #b3ac6a;
  --cat-tools: #7cb3d6;
  --ok: #6ec48f;
  --good: #7ab0e8;
  --tight: #d9a93c;
  --hot: #e0a06a;
  --no: #e88a8a;
  --note-bg: #262018;
  --note-border: #4a3c28;
  --note-text: #e6dac6;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.85;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

header.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1em 1.25em;
}
header.site-header .wrap {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5em;
}
.logo {
  font-weight: bold;
  font-size: 1.15em;
  color: var(--text);
}
.logo:hover { text-decoration: none; }
/* nav.site-nav 는 2026-09-14에 햄버거(.hm)로 바뀌어 더 이상 쓰이지 않는다 */

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 2em 1.25em 3em;
}

h1 { font-size: 1.55em; line-height: 1.5; margin-bottom: 0.6em; }
h2 { font-size: 1.25em; margin-top: 1.8em; border-left: 4px solid var(--accent); padding-left: 0.5em; }
h3 { font-size: 1.05em; margin-top: 1.4em; color: var(--text); }
p { margin: 0.9em 0; }
ul { padding-left: 1.4em; }
li { margin: 0.4em 0; }

.table-wrap { overflow-x: auto; margin: 1.2em 0; border-radius: 4px; border: 1px solid var(--border); }
table { border-collapse: collapse; width: 100%; font-size: 0.92em; }
th, td { padding: 0.6em 0.8em; text-align: left; border-bottom: 1px solid var(--border); }
th {
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  letter-spacing: 0.01em;
  border-bottom: none;
}
td {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(odd) { background: var(--panel); }

.eyebrow {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.82em;
  letter-spacing: 0.12em;
  margin-bottom: 0.6em;
}
.eyebrow a { display: flex; align-items: center; gap: 0.4em; color: inherit; text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }

.meta { color: var(--muted); font-size: 0.85em; margin-bottom: 1.5em; }

.byline { color: var(--muted); font-size: 0.85em; font-style: italic; margin-top: -0.3em; margin-bottom: 1.8em; }

.article-hero {
  display: block;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
  margin: 0 0 1.8em;
}

.tip-box {
  margin: 1.6em 0;
  padding: 1.1em 1.4em;
  background: var(--panel);
  border-radius: 8px;
  position: relative;
}
.tip-box::before {
  content: "✎";
  position: absolute;
  left: -0.1em;
  top: -0.6em;
  font-size: 1.2em;
  color: var(--accent);
  background: var(--bg);
  padding: 0 0.25em;
}
.tip-box p { margin: 0.3em 0; }
.tip-box p:first-child { margin-top: 0; }
.tip-box p:last-child { margin-bottom: 0; }

.embed-block {
  margin: 1em 0 1.8em;
  padding: 0.9em 1.2em;
  border: 1px dashed var(--border);
  border-radius: 8px;
  font-size: 0.88em;
}
.embed-block summary { cursor: pointer; font-weight: 700; color: var(--accent); }
.embed-block p { margin: 0.6em 0; color: var(--muted); }
.embed-block pre {
  background: var(--text);
  color: var(--bg);
  padding: 0.8em 1em;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.85em;
}

section.sources {
  margin-top: 2.5em;
  padding: 1.1em 1.25em;
  background: var(--panel);
  border-radius: 12px;
  font-size: 0.88em;
}
section.sources h2 { border-left: none; padding-left: 0; margin-top: 0; font-size: 1em; color: var(--muted); }
section.sources ul { list-style: none; padding: 0; margin: 0; }
section.sources li { margin: 0.4em 0; color: var(--muted); }
section.sources a { color: var(--muted); text-decoration: underline; }

footer.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 3em;
  padding: 1.5em 1.25em;
  text-align: center;
  color: var(--muted);
  font-size: 0.85em;
}
footer.site-footer a { margin: 0 0.6em; color: var(--muted); }

.article-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.7em; }
.article-list li {
  background: var(--panel);
  border-radius: 10px;
  border-left: 3px solid var(--accent);
  padding: 1.1em 1.3em;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.article-list li:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(43, 38, 32, 0.12);
}
.article-list a { font-size: 1.05em; color: var(--text); font-weight: bold; }
.article-list a:hover { color: var(--accent); text-decoration: none; }
.article-list .desc { color: var(--muted); font-size: 0.9em; margin-top: 0.35em; }

.hero { text-align: center; padding: 2em 0 1em; }
.hero .eyebrow { justify-content: center; display: flex; }
.hero h1 { margin: 0 0 0.4em; }
.hero p { color: var(--muted); }

.cat-heading {
  display: flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.85em;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin-top: 2.6em;
  margin-bottom: 0.9em;
  padding-bottom: 0.5em;
  color: var(--accent);
  border-left: none;
  border-bottom: 1px solid var(--border);
}
.cat-heading:first-of-type { margin-top: 1.4em; }
.cat-heading:first-of-type { margin-top: 1em; }
.cat-heading a { display: flex; align-items: center; gap: 0.4em; color: inherit; text-decoration: none; }
.cat-heading a:hover { text-decoration: underline; }
.kk-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.kk-icon svg { width: 100%; height: 100%; }
.kk-icon-sm { width: 16px; height: 16px; }

nav.related {
  margin-top: 2.5em;
  padding: 1.25em 1.4em;
  background: var(--panel);
  border-radius: 12px;
  border-left: 4px solid var(--accent);
}
nav.related h2 {
  border-left: none;
  padding-left: 0;
  margin-top: 0;
  font-size: 1.05em;
  color: var(--accent);
}
nav.related ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5em; }
nav.related li { margin: 0; }
nav.related a { font-weight: bold; text-decoration: underline; }

/* 홈페이지 — 옵션D(카드그리드+매거진 혼합): 카테고리 대표 1편은 이미지 포함 큰 카드,
   나머지는 2단 미니그리드. 2026-09-08 도입 */
.home-featured {
  position: relative;
  background: var(--panel);
  border-radius: 14px;
  margin-bottom: 0.7em;
  display: flex;
  gap: 1em;
  padding: 1em;
  box-shadow: 0 1px 3px rgba(43, 38, 32, 0.08);
  border-left-width: 4px;
  border-left-style: solid;
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.home-featured:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(43, 38, 32, 0.12);
  text-decoration: none;
}
.home-featured img {
  width: 130px;
  height: 130px;
  flex: 0 0 130px;
  border-radius: 10px;
  object-fit: cover;
}
.home-featured .text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5em;
}
.home-featured .pin {
  display: inline-block;
  width: fit-content;
  font-size: 0.68em;
  letter-spacing: 0.08em;
  font-weight: bold;
  padding: 0.3em 0.7em;
  border-radius: 20px;
}
.home-featured .ttl {
  font-size: 1em;
  font-weight: bold;
  line-height: 1.5;
  color: var(--text);
}
.home-featured .desc {
  color: var(--muted);
  font-size: 0.82em;
  line-height: 1.6;
}

.home-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 2.2em;
}
.home-mini {
  background: var(--panel);
  border-radius: 10px;
  padding: 0.6em;
  display: flex;
  align-items: center;
  gap: 0.7em;
  box-shadow: 0 1px 3px rgba(43, 38, 32, 0.06);
  border-left-width: 3px;
  border-left-style: solid;
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.home-mini:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(43, 38, 32, 0.1);
  text-decoration: none;
}
.home-mini img {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 7px;
  object-fit: cover;
}
/* 🔴 홈은 공통 헤더를 숨기고 히어로 안에 자체 상단바를 둔다 (2026-09-14).
   목업은 브랜드와 메뉴가 사진 위에 얹혀 있었는데 처음 구현에서 이 구조를 통째로 빼먹어
   기존 헤더 아래에 사진만 놓였다(태근쌤 지적). 카드앱 레이아웃의 핵심이 이 겹침이다.
   메뉴 셋은 우상단 햄버거로 접었다 — <details>라서 JS가 필요 없다. */
.home-page header.site-header { display: none; }
.hero-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8em;
  padding: 0.85em 1em 0;
  color: #fff;
}
.hero-top .brand {
  font-weight: bold;
  font-size: 1.06em;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}
.hm { position: relative; flex: 0 0 auto; }
.hm > summary {
  list-style: none;
  cursor: pointer;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.32);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.hm > summary::-webkit-details-marker { display: none; }
.hm > summary::marker { content: ""; }
.hm > summary svg { width: 20px; height: 20px; }
.hm[open] > summary { background: rgba(255, 255, 255, 0.34); }
.hm > nav {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 176px;
  display: flex;
  flex-direction: column;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 28px -8px rgba(43, 38, 32, 0.34), 0 1px 3px rgba(43, 38, 32, 0.12);
  padding: 0.35em;
}
.hm > nav a {
  padding: 0.62em 0.8em;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.88em;
}
.hm > nav a:hover { background: var(--bg); text-decoration: none; }

/* 주제별 바로가기 + 밝게/어둡게 (2026-09-14 태근쌤 제안) */
.hm > nav { min-width: 196px; }
.hm .mc {
  display: flex;
  align-items: center;
  gap: 0.55em;
  font-weight: bold;
}
.hm .mc .ic { color: var(--c); display: inline-flex; }
.hm .ic svg { width: 17px; height: 17px; }
.hm .sep {
  display: block;
  height: 1px;
  background: var(--border);
  margin: 0.35em 0.5em;
}
.hm .theme-btn {
  display: flex;
  align-items: center;
  gap: 0.55em;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0.62em 0.8em;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.88em;
  font-weight: bold;
  cursor: pointer;
  text-align: left;
}
.hm .theme-btn:hover { background: var(--bg); }
.hm .theme-btn .ic { display: inline-flex; }

/* 사진 위가 아닌 곳(기사·필수 페이지 헤더)에서는 글자색을 따라간다 */
header.site-header .hm > summary {
  color: var(--text);
  background: transparent;
  border-color: var(--border);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
header.site-header .hm[open] > summary { background: var(--panel); }
header.site-header .wrap { flex-wrap: nowrap; }

/* 🔴 좁은 화면에서는 히어로를 화면 양끝까지 (2026-09-14 태근쌤 지적).
   main이 좌우 20px·위 32px를 두는데, 사진까지 그 안에 갇히니 카드앱처럼 안 보였다.
   사진만 음수 마진으로 그 여백을 상쇄하고 화면 맨 위에 붙인다. 본문은 여백을 지킨다.
   넓은 화면(760px 초과)에서는 본문 폭 안에 두는 편이 자연스러워 건드리지 않는다. */
@media (max-width: 760px) {
  .home-page main { padding-top: 0; }
  .home-page .hero-wrap {
    margin-left: -20px;
    margin-right: -20px;
  }
  .home-page .hero-img {
    border-radius: 0;
    min-height: 270px;   /* 폭이 넓어진 만큼 높이도 올려 16:9에 가깝게 */
  }
  .home-page .hero-img::after { border-radius: 0; }
  .home-page .hero-top { padding: 1em 1.25em 0; }
  .home-page .hero-text { left: 1.25em; right: 1.25em; }
  .home-page .rate-card { margin-left: 0; margin-right: 0; }
}

/* 홈 히어로 — 2026-09-14. 사진 위에 제목이 얹히고 환율 카드가 아래로 걸친다.
   첫 화면 LCP를 이 사진이 결정하므로 WebP 120KB 이하로 맞춰 둔다(scripts_이미지처리.py --hero). */
.hero-wrap { position: relative; margin: 0 0 0 0; }
.hero-img {
  /* 🔴 높이를 고정하지 않는다 (2026-09-14 태근쌤 지적).
     480px 이하에서 200px로 줄여 뒀더니 글자 블록 88px과 환율 카드 22px이 덮어
     사진이 71px(35%)만 보였다. 사진 원본이 16:9라 비율로 두면 화면 폭에 맞게 늘어난다.
     min-height로 좁은 화면의 아래끝을, max-height로 넓은 화면의 위끝을 잡는다. */
  /* 🔴 width를 명시하지 않으면 폭이 삐져나간다 (2026-09-14, 태근쌤이 폰 화면으로 잡아 주셨다).
     좁은 화면에서 비율대로 잰 높이가 min-height보다 작으면, 브라우저가 비율을 지키려고
     폭을 늘려 버려 사진이 본문 밖으로 나갔다. width를 100%로 못 박으면 폭은 그대로 두고
     높이만 늘어난다(사진은 cover라 잘릴 뿐이다). */
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 250px;
  max-height: 400px;
  border-radius: 14px;
  background-color: #1b2a33;   /* 사진이 늦게 와도 글자가 읽히게 */
  background-size: cover;
  background-position: center 45%;
  position: relative;
}
.hero-img::after {
  /* 사진 위아래를 눌러 글자를 읽히게 한다. 사진이 바뀌어도 이 층은 그대로 쓴다. */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0.62) 100%);
}
.hero-text {
  position: absolute;
  left: 1.1em;
  right: 1.1em;
  /* 환율 카드가 사진 아래로 22px 올라와 걸치므로, 글자는 그만큼 더 띄운다.
     1em이면 「ソウルは今」이 카드에 가린다(2026-09-14 실측). */
  bottom: 2.6em;
  z-index: 2;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0,0,0,0.55);
}
.hero-text .eyebrow { justify-content: flex-start; display: flex; margin: 0 0 0.2em; color: #fff; opacity: 0.92; }
.hero-text h1 { margin: 0; font-size: 1.32em; line-height: 1.4; color: #fff; }
.hero-text .now { margin: 0.45em 0 0; font-size: 0.82em; display: flex; align-items: center; gap: 0.45em; }
/* 🔴 자리를 접지 않는다(덱스 2026-09-15 지적 4). 전에는 display:none이라,
   기온이 늦게 도착하면 .hero-text가 bottom 고정인 탓에 제목과 상단 문구가 위로 밀렸다.
   값이 없을 때도 높이를 유지하고 보이기만 감춘다. 실패해도 접지 않는다. */
.hero-text .now[hidden] { display: flex; visibility: hidden; }
.hero-text .now .temp {
  display: inline-flex;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.32);
  border-radius: 20px;
  padding: 0.1em 0.6em;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
}
.rate-card {
  position: relative;
  z-index: 3;
  margin: -22px 0.8em 0;
  display: flex;
  align-items: center;
  gap: 0.7em;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7em 0.95em;
  box-shadow: 0 6px 18px -6px rgba(43,38,32,0.22), 0 1px 3px rgba(43,38,32,0.1);
  color: inherit;
  text-decoration: none;
}
/* 🔴 같은 이유로 접지 않는다(덱스 지적 4). 이 카드는 為替計算機로 가는 링크라
   값이 없어도 제 몫을 한다. 값 자리는 「—」로 두고, 실패는 실패라고 적는다 —
   낡은 숫자나 지어낸 값을 보여주지 않는다는 원칙은 그대로다. */
.rate-card[hidden] { display: flex; }
.rate-card .val .n.is-empty, .rate-card .lbl .s.is-error { color: var(--muted); }
.rate-card:hover { text-decoration: none; box-shadow: 0 8px 22px -6px rgba(43,38,32,0.26); }
.rate-card .lbl { flex: 1; min-width: 0; }
.rate-card .lbl .t { display: block; font-size: 0.85em; font-weight: bold; }
.rate-card .lbl .s { display: block; font-size: 0.66em; color: var(--muted); }
.rate-card .val { text-align: right; }
.rate-card .val .n { display: block; font-size: 1em; font-weight: bold; font-variant-numeric: tabular-nums; }
.rate-card .val .go { display: block; font-size: 0.64em; font-weight: bold; color: var(--accent); }
.hero-lead { margin: 1.1em 0 1.4em; color: var(--muted); font-size: 0.9em; line-height: 1.75; }
@media (max-width: 480px) {
  .hero-text h1 { font-size: 1.16em; }
}

/* 🔴 홈만 넓게 (2026-09-14 태근쌤 제안).
   1440px 화면에서 본문이 720px이라 좌우에 360px씩 비었고, 도구 17개 중 4개만 보였다.
   「도구를 전면에」가 개편의 취지인데 그 도구가 화면 밖에 있었다.
   ⚠️ 기사 본문은 720px 그대로 둔다 — 일본어는 한 줄 40자 안팎이 읽기 좋고,
      넓히면 눈이 줄을 놓친다. 넓혀서 득을 보는 것은 카드·목록이지 문장이 아니다. */
@media (min-width: 1100px) {
  .home-page main { max-width: 1080px; }
  .home-page .home-mini-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* 홈 검색 + 도구 캐러셀 — 2026-09-14 개편(설계지시 §4-2·§4-3).
   계산기가 기사 본문에 묻혀 첫 화면에서 하나도 안 보이던 것을 꺼내 세운다.
   기존 홈 카드(.home-featured/.home-mini)의 모양·그림자·hover를 그대로 따른다. */
.tool-search { margin: 0 0 1.6em; }
.ts-field {
  display: flex;
  align-items: center;
  gap: 0.6em;
  background: var(--panel-2);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 0.75em 1em;
  box-shadow: 0 1px 3px rgba(43, 38, 32, 0.08);
  cursor: text;
}
.ts-field:focus-within { border-color: var(--accent); }
.ts-field svg { width: 18px; height: 18px; flex: 0 0 18px; color: var(--muted); }
.ts-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 1em;
  line-height: 1.6;
  color: var(--text);
}
.ts-field input::-webkit-search-cancel-button { cursor: pointer; }
.ts-hint { margin: 0.5em 0.2em 0; font-size: 0.72em; color: var(--muted); line-height: 1.6; }
/* 🔴 listbox가 아니라 링크 목록이다(덱스 2026-09-15 지적 5). role="listbox"·role="option"은
   선택 상태와 방향키 이동이 있어야 성립하는데 둘 다 없었다. 스크린리더에 선택 위젯이라고
   알리면서 실제로는 링크였다. ul>li>a 로 되돌리고, 상태는 role="status"가 따로 알린다. */
.ts-results { margin-top: 0.7em; display: flex; flex-direction: column; gap: 6px; list-style: none; padding: 0; }
.ts-results > li { display: flex; margin: 0; }
.ts-results > li > .ts-row { flex: 1; min-width: 0; }
.ts-status { margin: 0.5em 0.2em 0; font-size: 0.74em; color: var(--muted); line-height: 1.6; }
.ts-status:empty { display: none; }
.ts-results[hidden] { display: none; }
.ts-row {
  display: flex;
  align-items: center;
  gap: 0.7em;
  background: var(--panel);
  border-radius: 0 10px 10px 0;
  border-left: 3px solid var(--accent);
  padding: 0.6em 0.9em;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(43, 38, 32, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ts-row:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(43, 38, 32, 0.1); text-decoration: none; }
.ts-row .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ts-row .tx .t { font-size: 0.9em; font-weight: bold; line-height: 1.5; }
.ts-row .tx .d { font-size: 0.74em; color: var(--muted); line-height: 1.55; }
.ts-row .go { flex: 0 0 auto; font-size: 0.78em; font-weight: bold; color: var(--accent); }
.ts-transport { border-left-color: var(--cat-transport); }
.ts-money { border-left-color: var(--cat-money); }
.ts-life { border-left-color: var(--cat-life); }
.ts-tools { border-left-color: var(--cat-tools); }
.ts-empty { margin: 0; padding: 0.8em 0.2em; font-size: 0.8em; color: var(--muted); }

.tool-strip-heading {
  margin: 0 0 0.6em;
  font-size: 1em;
  display: flex;
  align-items: baseline;
  gap: 0.5em;
}
.tool-strip-heading .n {
  font-size: 0.7em;
  font-weight: normal;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
/* 가로 스크롤 — 도구가 17개라 세로로 쌓으면 기사가 화면 밖으로 밀린다.
   기사 매거진을 그대로 두는 것이 이 개편의 전제다(안 C 하이브리드). */
.tool-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 2px 0 10px;
  margin-bottom: 2.2em;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.tool-card {
  flex: 0 0 156px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 0.4em;
  background: var(--panel);
  border: 1px solid var(--border);
  border-top-width: 3px;
  border-top-style: solid;
  border-radius: 12px;
  padding: 0.8em 0.8em 0.9em;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(43, 38, 32, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tool-card:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(43, 38, 32, 0.1); text-decoration: none; }
.tool-card .ic { display: block; }
.tool-card .ic svg { width: 22px; height: 22px; }
.tool-card .ttl { font-size: 0.82em; font-weight: bold; line-height: 1.45; }
.tool-card .dsc { font-size: 0.68em; color: var(--muted); line-height: 1.55; }
@media (max-width: 480px) {
  .tool-card { flex-basis: 142px; }
}

.home-mini .ttl {
  font-size: 0.78em;
  font-weight: bold;
  line-height: 1.45;
  color: var(--text);
}
/* 카드가 홀수 개면 마지막 한 장이 왼쪽에만 붙어 어색해지므로 전체 폭으로 채운다 */
.home-mini-grid > .home-mini:last-child:nth-child(odd) { grid-column: 1 / -1; }
.home-mini-grid > .home-mini:last-child:nth-child(odd) img { width: 64px; height: 64px; flex: 0 0 64px; }

/* 🔴 좁은 화면에서는 한 단으로 (2026-09-14 태근쌤 지적).
   375px에서 2단이면 카드가 163px이고, 썸네일 52px과 패딩을 빼면 제목에 남는 폭이 77px뿐이라
   제목이 5~8줄로 쪼개졌다(실측). 한 단으로 바꾸면 제목 폭이 250px대가 된다.
   ⚠️ 마지막 홀수 카드를 전체 폭으로 늘리던 위 규칙은 한 단에서는 의미가 없으므로 썸네일 크기만 되돌린다. */
@media (max-width: 560px) {
  .home-mini-grid { grid-template-columns: 1fr; }
  .home-mini-grid > .home-mini:last-child:nth-child(odd) img { width: 52px; height: 52px; flex: 0 0 52px; }
}

/* 계산기 위젯 공통(kage-calc/kbud-calc/kfx-calc)은 각 위젯 파일 내 <style>에서 이미 스코프돼 있음 */
