/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-bg: #ffffff;
  --color-surface: #f8f9fa;
  --color-border: #e0e0e0;
  --color-text: #1a1a1a;
  --color-text-secondary: #444444;
  --color-primary: #1d4ed8;
  --color-primary-hover: #1e40af;
  --color-primary-bg: #1d4ed8;
  --color-danger: #dc2626;
  --color-danger-light: #e53e3e;
  --color-success: #16a34a;
  --color-success-bg: #22c55e;
  --color-warning: #ca8a04;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --max-width: 960px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0f0f0f;
    --color-surface: #1a1a1a;
    --color-border: #3a3a3a;
    --color-text: #f5f5f5;
    --color-text-secondary: #d0d0d0;
    --color-primary: #93c5fd;
    --color-primary-hover: #bfdbfe;
    --color-primary-bg: #2563eb;
    --color-danger: #fca5a5;
    --color-danger-light: #fca5a5;
    --color-success: #86efac;
    --color-success-bg: #4ade80;
    --color-warning: #fde047;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  }
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

code {
  font-family: 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.875em;
  background: rgba(0, 0, 0, 0.06);
  color: #c7254e;
  padding: 2px 6px;
  border-radius: 4px;
}

@media (prefers-color-scheme: dark) {
  code { background: rgba(255, 255, 255, 0.08); color: #f87171; }
}
[data-theme="dark"] code { background: rgba(255, 255, 255, 0.08); color: #f87171; }

a {
  color: var(--color-primary);
  text-decoration: none;
}

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

/* ===== Header ===== */
.site-header {
  border-bottom: 1px solid var(--color-border);
  padding: 16px 24px;
  min-height: 65px;
}

.site-header .inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header .logo {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
}

.site-header nav a {
  margin-left: 20px;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.site-header nav a:hover {
  color: var(--color-primary);
}

.lang-toggle {
  margin-left: 20px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.lang-toggle:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

/* ===== Main ===== */
.site-main {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 40px 24px;
}

/* ===== Card Sections ===== */
.card-section {
  margin-bottom: 36px;
}

.card-section:last-child {
  margin-bottom: 0;
}

.section-title {
  font-size: 1.25rem;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-border);
}

/* ===== Card Grid ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.3s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  border-color: var(--color-primary);
}

.card h2,
.card h3 {
  font-size: 1.125rem;
  margin-bottom: 8px;
  color: var(--color-text);
}

.card p {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  flex: 1;
}

.card .card-link {
  margin-top: 16px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
}

/* ===== Tool Page ===== */
.tool-header {
  margin-bottom: 32px;
}

.tool-header h1 {
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.tool-header p {
  color: var(--color-text-secondary);
}

.btn-copy-link {
  margin-top: 12px;
  padding: 6px 14px;
  font-size: 0.8125rem;
  line-height: 1.4;
  min-height: 32px;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-copy-link:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-copy-link.copied {
  border-color: var(--color-success);
  color: var(--color-success);
}

/* ===== Donut Chart (결과 영역 안) ===== */
.donut-block {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 16px;
  padding: 14px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}
.donut-canvas-wrap {
  flex: 0 0 140px;
  height: 140px;
  position: relative;
}
.donut-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.8125rem;
}
.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.donut-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.donut-legend-label { color: var(--color-text-secondary); }
.donut-legend-value { font-weight: 700; color: var(--color-text); margin-left: auto; }
@media (max-width: 540px) {
  .donut-block { flex-direction: column; gap: 12px; }
  .donut-canvas-wrap { flex: 0 0 120px; height: 120px; }
  .donut-legend { width: 100%; }
}

/* ===== Preset Cards (사례 라이브러리) ===== */
.presets-section h2 { margin-top: 0; }
.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.preset-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}
.preset-card:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-bg);
  transform: translateY(-1px);
}
.preset-card:hover .preset-label,
.preset-card:hover .preset-desc {
  color: #fff;
}
.preset-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
}
.preset-desc {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

/* ===== Latest History Row 강조 ===== */
.result-table tr.latest-history-row td {
  background: rgba(96, 165, 250, 0.1);
}
.result-table tr.latest-history-row td:first-child {
  font-weight: 700;
  color: var(--color-primary);
}

/* ===== Share Bar (계산하기 버튼 아래) ===== */
.share-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 12px;
}
.share-bar .btn-copy-link {
  margin-top: 0;
}

/* ===== Live Slider ===== */
.live-slider {
  width: 100%;
  margin: -8px 0 16px;
  accent-color: var(--color-primary);
}
.live-badge {
  display: inline-block;
  padding: 2px 8px;
  margin-left: 8px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #fff;
  background: var(--color-primary);
  border-radius: 4px;
  vertical-align: middle;
}

.tool-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.tool-section label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 6px;
}
/* tool-section 안에서 라벨이 다른 그룹 뒤에 올 때 위 여백 추가 */
.tool-section > label:not(:first-child) { margin-top: 12px; }

.tool-section input,
.tool-section select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--color-bg);
  color: var(--color-text);
  margin-bottom: 28px;
}

.tool-section select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.tool-section input:focus,
.tool-section select:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: -1px;
}

.btn-copy-link:focus-visible,
.btn-primary:focus-visible,
.news-tab:focus-visible,
.year-tabs button:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.input-hint {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  margin-top: -12px;
  margin-bottom: 28px;
}
.input-hint + label { margin-top: 12px; }
/* 한글 금액 표시: input의 margin-bottom 차이를 근본 제거 */
input:has(+ .input-hint.kor-amount) { margin-bottom: 0; }
.input-hint.kor-amount { margin: 4px 0 0; color: var(--color-primary); min-height: 1.2em; }

/* 금액 빠른 입력 버튼 */
.quick-amount-btns {
  display: flex;
  gap: 6px;
  margin: 8px 0 24px;
  flex-wrap: wrap;
}
.quick-amount-btns + .input-hint { margin-top: 4px; }
.btn-quick-amount {
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: transparent;
  font-size: 0.8125rem;
  cursor: pointer;
  color: var(--color-text);
}
.btn-quick-amount:hover { background: var(--color-primary-bg); color: #fff; border-color: var(--color-primary-bg); }
.btn-quick-reset { color: var(--color-danger); border-color: var(--color-danger); }
.btn-quick-reset:hover { background: var(--color-danger); color: #fff; }

/* 다크 모드에서 date input의 캘린더 아이콘이 잘 보이도록 보정 */
@media (prefers-color-scheme: dark) {
  .tool-section input[type="date"]::-webkit-calendar-picker-indicator,
  .tool-section input[type="time"]::-webkit-calendar-picker-indicator,
  .tool-section input[type="datetime-local"]::-webkit-calendar-picker-indicator,
  .tool-section input[type="month"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.4);
    opacity: 0.85;
    cursor: pointer;
  }
}
[data-theme="dark"] .tool-section input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] .tool-section input[type="time"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] .tool-section input[type="datetime-local"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] .tool-section input[type="month"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.4);
  opacity: 0.85;
  cursor: pointer;
}

/* 입력 필드를 한 줄에 두 열로 나란히 배치(데스크탑/태블릿). 모바일은 1열로 스택 */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 16px;
  row-gap: 32px;
}
.field-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
.field-row > .field { display: flex; flex-direction: column; }
.field-row > .field input,
.field-row > .field select { margin-bottom: 0; }
.field-row > .field .input-hint:not(.kor-amount) { margin-top: 6px; margin-bottom: 0; }
.field-row > .field .input-hint + .input-hint { margin-top: 2px; }
.field-row { margin-bottom: 32px; }
.field-row + * { margin-top: 0; }
@media (max-width: 640px) {
  .field-row,
  .field-row.cols-3 { grid-template-columns: 1fr; gap: 0; }
  .field-row > .field input,
  .field-row > .field select { margin-bottom: 24px; }
}

/* 입력 폼 안의 접이식 도움말 */
.calc-flow {
  margin: -4px 0 16px;
  font-size: 0.8125rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
}
.calc-flow > summary {
  cursor: pointer;
  padding: 10px 14px;
  font-weight: 600;
  color: var(--color-text);
  list-style: none;
}
.calc-flow > summary::-webkit-details-marker { display: none; }
.calc-flow > summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.15s;
}
.calc-flow[open] > summary::before { transform: rotate(90deg); }
.calc-flow-body {
  padding: 0 14px 14px 14px;
  color: var(--color-text-secondary);
  line-height: 1.6;
}
.calc-flow-body ol {
  margin: 0 0 10px 18px;
  padding: 0;
}
.calc-flow-body ol li { margin-bottom: 4px; }
.calc-flow-body p { margin: 8px 0 0 0; }
.calc-flow-body strong { color: var(--color-text); }

.btn-primary {
  margin-top: 32px;
  display: inline-block;
  background: #15803d;
  color: #ffffff;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #166534;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.result-table th,
.result-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.875rem;
}

.result-table th {
  font-weight: 600;
  color: var(--color-text-secondary);
}

/* ===== Result Highlight ===== */
.result-highlight {
  color: var(--color-primary);
  font-weight: 700;
}

/* ===== Floating TOC ===== */
.floating-toc {
  position: fixed;
  top: 120px;
  right: calc((100vw - var(--max-width)) / 2 - 220px);
  width: 180px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  z-index: 50;
}
.floating-toc ul {
  list-style: none;
  border-left: 2px solid var(--color-border);
  padding-left: 12px;
}
.floating-toc li { margin-bottom: 6px; }
.floating-toc a {
  font-size: 0.6875rem;
  color: var(--color-text-secondary);
  text-decoration: none;
  display: block;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.floating-toc a:hover { color: var(--color-text); }
.floating-toc a.active {
  color: var(--color-primary);
  font-weight: 600;
}
@media (max-width: 1400px) {
  .floating-toc { display: none; }
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 40px 24px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  min-height: 90px;
}
.site-footer .hit-counter {
  margin-bottom: 8px;
  font-size: 0.75rem;
  opacity: 0.8;
}
.site-footer .hit-counter #hit-count {
  font-variant-numeric: tabular-nums;
}

/* ===== Git Cheatsheet 복사 버튼 ===== */
.git-cmd-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.git-cmd-cell code {
  flex: 1;
}
.git-copy-btn {
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 2px 8px;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--color-text-secondary);
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.git-copy-btn:hover {
  background: var(--color-bg-secondary, rgba(127,127,127,0.1));
  border-color: var(--color-text-secondary);
}

/* ===== 메인 페이지 타이틀 강조 ===== */
.tool-header h1,
.section-title,
.card h3 {
  font-weight: 900;
}

/* ===== 파란색 복사 버튼 (로렘 입숨 등) ===== */
.btn-copy-blue {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1d4ed8;
  color: #ffffff;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.btn-copy-blue:hover { background: #1e40af; }
.btn-copy-blue:disabled { opacity: 0.45; cursor: not-allowed; }

/* ===== Segmented Control ===== */
.seg-control {
  display: flex;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 28px;
}

.seg-control input[type="radio"] {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.seg-control label {
  flex: 1;
  text-align: center;
  padding: 10px 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-right: 1px solid var(--color-border);
  transition: background 0.15s, color 0.15s;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.seg-control label:last-of-type {
  border-right: none;
}

.seg-control label:hover {
  background: var(--color-surface);
}

.seg-control input[type="radio"]:checked + label {
  background: var(--color-primary-bg);
  color: #ffffff;
}

.seg-desc {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  margin-top: -12px;
  margin-bottom: 16px;
  min-height: 1.5em;
}

/* ===== Term Shortcuts ===== */
.term-shortcuts button {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.term-shortcuts button:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.term-shortcuts button.active {
  background: var(--color-primary-bg);
  border-color: var(--color-primary-bg);
  color: #ffffff;
}

/* ===== History ===== */
.history-section {
  margin-top: 24px;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.history-header h2 {
  font-size: 1.125rem;
  margin: 0;
}

.btn-history-clear {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.btn-history-clear:hover {
  color: var(--color-danger);
  border-color: var(--color-danger);
}

/* ===== Ad Slot ===== */
.ad-slot {
  margin: 32px 0;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--color-border);
  border-radius: 8px;
}


/* ===== Content Section ===== */
.content-section h2 {
  font-size: 1.25rem;
  margin-bottom: 16px;
}

.content-section h3 {
  font-size: 1rem;
  margin-top: 24px;
  margin-bottom: 8px;
}

.content-section p {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.tool-section ul:not([class]) {
  padding-left: 20px;
}

.content-section ul {
  margin-bottom: 12px;
}

.content-section ul li {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

.content-section details ul:not([class]) {
  padding-left: 40px;
}

.content-section details {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0;
  margin-bottom: 8px;
}

.content-section summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 12px 16px;
  display: block;
}

.content-section summary:hover {
  background: var(--color-surface);
  border-radius: 8px;
}

.content-section details[open] summary {
  border-radius: 8px 8px 0 0;
}

.content-section details p {
  margin-top: 0;
  margin-bottom: 0;
  padding: 0 16px 12px;
}

.content-section .result-table {
  font-size: 0.875rem;
}

/* ===== Related Tools ===== */
.related-tools {
  margin-top: 64px;
  margin-bottom: 24px;
  min-height: 180px;
}

/* CLS 방어: data-related가 있는 main은 관련 도구 섹션 주입 전에 자리 예약 */
main.site-main[data-related]::after {
  content: "";
  display: block;
  min-height: 244px;
}
main.site-main[data-related]:has(.related-tools)::after {
  display: none;
}

.related-tools > h3 {
  font-size: 1rem;
  margin-bottom: 12px;
}

.related-tools-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.related-tools-list a.card {
  color: var(--color-text);
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .site-main {
    padding: 24px 16px;
  }

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

  .tool-header h1 {
    font-size: 1.375rem;
  }

  .seg-control {
    flex-wrap: wrap;
  }

  .seg-control label {
    flex: 1 1 45%;
    border-bottom: 1px solid var(--color-border);
  }

  .related-tools-list {
    grid-template-columns: 1fr;
  }
}

/* ===== 결과 영역 강조 애니메이션 ===== */
@keyframes resultFlash {
  0%   { box-shadow: 0 0 0 0 rgba(96, 165, 250, 0); }
  20%  { box-shadow: 0 0 0 2.5px rgba(96, 165, 250, 0.55); }
  35%  { box-shadow: 0 0 0 0 rgba(96, 165, 250, 0); }
  50%  { box-shadow: 0 0 0 2.5px rgba(96, 165, 250, 0.55); }
  100% { box-shadow: 0 0 0 0 rgba(96, 165, 250, 0); }
}
.result-flash {
  animation: resultFlash 2.6s ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .result-flash { animation: none; }
}

/* ===== Document / Spreadsheet Download Pages ===== */
.disclaimer { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 14px 18px; font-size: 0.8125rem; color: var(--color-text-secondary); line-height: 1.6; margin-bottom: 28px; }
.doc-download { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 32px; }
.doc-download a { display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px; border-radius: 8px; font-size: 1rem; font-weight: 600; text-decoration: none; transition: background 0.2s; }
.doc-download a svg { width: 18px; height: 18px; fill: currentColor; }
.btn-pdf { background: #dc2626; color: #fff; }
.btn-pdf:hover { background: #b91c1c; color: #fff; }
.btn-word { background: #2563eb; color: #fff; }
.btn-word:hover { background: #1d4ed8; color: #fff; }
.btn-excel { background: #15803d; color: #fff; }
.btn-excel:hover { background: #166534; color: #fff; }
.use-case-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.use-case-tags span { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 0.8125rem; background: var(--color-surface); border: 1px solid var(--color-border); color: var(--color-text-secondary); }
.sheet-structure { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 18px; margin: 16px 0; }
.sheet-structure h3 { font-size: 0.9375rem; margin: 0 0 10px; }
.sheet-structure ul { margin: 0; padding-left: 20px; font-size: 0.875rem; line-height: 1.8; color: var(--color-text-secondary); }
.breadcrumb { font-size: 0.8125rem; color: var(--color-text-secondary); margin-bottom: 8px; }
.breadcrumb a { color: var(--color-text-secondary); text-decoration: none; }
.breadcrumb a:hover { color: var(--color-primary); }
.breadcrumb span { margin: 0 6px; }
.info-grid { display: grid; grid-template-columns: 1fr; gap: 0; margin-bottom: 8px; }
@media (min-width: 768px) { .info-grid { grid-template-columns: 1fr 1fr; gap: 20px; } }

/* ===== Toast ===== */
#spemer-toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); background: #ffffff; color: #111827; padding: 10px 18px; border-radius: 8px; font-size: 0.9375rem; font-weight: 700; z-index: 9999; opacity: 0; transition: opacity 0.2s; pointer-events: none; box-shadow: 0 4px 16px rgba(0,0,0,0.18); border: 1px solid rgba(0,0,0,0.08); }

/* ===== Ad Slot Label ===== */
.ad-slot-label { color: var(--color-text-secondary); font-size: 0.75rem; }

/* ===== Footer Link ===== */
.footer-author-link { font-weight: 700; color: inherit; text-decoration: none; }

/* ===== History Table Cells ===== */
.history-time-cell { font-size: 0.75rem; color: var(--color-text-secondary); white-space: nowrap; }
.history-memo-cell { font-size: 0.8125rem; color: var(--color-text-secondary); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-share-cell { white-space: nowrap; }
.history-share-btn { padding: 4px 10px; font-size: 0.8125rem; }

/* ===== Presets Subtitle ===== */
.presets-subtitle { font-size: 0.8125rem; color: var(--color-text-secondary); margin-bottom: 12px; }

/* ===== Term Shortcuts ===== */
.term-shortcuts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -8px; margin-bottom: 28px; }
.term-shortcuts-compact { margin-bottom: 16px; }
