/* 알고가기 계산기 공통 스타일 — 모바일 우선. 워드프레스 테마와 충돌하지 않게 .agc- 접두사만 사용. */
.agc-calc, .agc-content {
  --agc-fg: #1f2937;
  --agc-muted: #5b6470;
  --agc-line: #d9dee4;
  --agc-bg: #ffffff;
  --agc-soft: #f4f6f8;
  --agc-accent: #2563eb;
  --agc-accent-fg: #ffffff;
  --agc-good: #1c7c44;
  --agc-bad: #b3261e;
  color: var(--agc-fg);
  font-size: 16px;
  line-height: 1.6;
  box-sizing: border-box;
  max-width: 640px;
  margin: 0 auto 32px;
}
.agc-calc *, .agc-content * { box-sizing: border-box; }
.agc-calc, .agc-content, .agc-result, .agc-table-wrap { min-width: 0; max-width: 100%; }
.agc-calc { background: var(--agc-bg); border: 1px solid var(--agc-line); border-radius: 12px; padding: 16px; }
.agc-title { font-size: 1.25rem; margin: 0 0 12px; }
.agc-field { margin-bottom: 14px; }
.agc-field label { display: block; font-weight: 600; margin-bottom: 4px; }
.agc-opt { font-weight: 400; color: var(--agc-muted); }
.agc-input {
  width: 100%; min-height: 44px; padding: 8px 12px; font-size: 16px;
  border: 1px solid var(--agc-line); border-radius: 8px; background: var(--agc-bg); color: var(--agc-fg);
}
.agc-input:focus { outline: 2px solid var(--agc-accent); outline-offset: 1px; }
.agc-aux { display: block; min-height: 1.4em; font-size: 0.875rem; color: var(--agc-accent); }
.agc-hint { margin: 2px 0 0; font-size: 0.8125rem; color: var(--agc-muted); }
.agc-check { display: flex; align-items: center; gap: 8px; }
.agc-check label { margin: 0; font-weight: 500; }
.agc-check input { width: 20px; height: 20px; }
.agc-sub { border: 1px dashed var(--agc-line); border-radius: 8px; padding: 12px; margin: 0 0 14px; }
.agc-sub legend { padding: 0 4px; font-weight: 600; font-size: 0.9375rem; }
.agc-button {
  width: 100%; min-height: 48px; border: 0; border-radius: 8px; font-size: 1rem; font-weight: 700;
  background: var(--agc-accent); color: var(--agc-accent-fg); cursor: pointer;
}
.agc-result { margin-top: 16px; padding: 14px; border-radius: 10px; background: var(--agc-soft); }
.agc-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 6px 0; border-bottom: 1px solid var(--agc-line); margin: 0; }
.agc-row-value { text-align: right; font-variant-numeric: tabular-nums; }
.agc-row-value small { display: block; color: var(--agc-muted); font-size: 0.8125rem; }
.agc-strong .agc-row-label, .agc-strong .agc-row-value, p.agc-strong { font-weight: 700; font-size: 1.0625rem; }
.agc-steps { margin-top: 12px; }
.agc-steps summary { cursor: pointer; font-weight: 600; }
.agc-steps ol { padding-left: 1.25em; margin: 8px 0 0; word-break: keep-all; overflow-wrap: anywhere; }
.agc-notes { margin: 12px 0 0; padding-left: 1.1em; font-size: 0.875rem; color: var(--agc-muted); }
.agc-disclaimer { margin: 12px 0 4px; font-size: 0.8125rem; font-weight: 600; }
.agc-sources { font-size: 0.8125rem; color: var(--agc-muted); overflow-wrap: anywhere; }
.agc-sources a, .agc-content a { color: var(--agc-accent); }
.agc-error { color: var(--agc-bad); font-weight: 600; margin: 0; }
.agc-content h2 { font-size: 1.25rem; margin: 28px 0 8px; }
.agc-content h3 { font-size: 1.0625rem; margin: 20px 0 6px; }
.agc-content table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.agc-content th, .agc-content td { border: 1px solid var(--agc-line); padding: 6px 8px; text-align: left; word-break: keep-all; overflow-wrap: anywhere; }
.agc-content .agc-formula { background: var(--agc-soft); border-radius: 8px; padding: 10px 12px; overflow-x: auto; }
.agc-table-wrap { overflow-x: auto; margin: 4px 0 0; }
.agc-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.agc-table th, .agc-table td { border-bottom: 1px solid var(--agc-line); padding: 8px 6px; text-align: right; white-space: nowrap; }
.agc-table th:first-child, .agc-table td:first-child { text-align: left; }
.agc-table th { font-size: 0.8125rem; color: var(--agc-muted); font-weight: 600; }
.agc-table tr.agc-hl td { font-weight: 700; background: var(--agc-bg); }
.agc-table tr.agc-dim td { color: var(--agc-muted); }
.agc-table td small { display: block; font-size: 0.75rem; color: var(--agc-muted); font-weight: 400; }
.agc-flag { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px; font-size: 0.6875rem; font-weight: 700; background: var(--agc-bad); color: var(--agc-bg); vertical-align: middle; }
.agc-unit { display: grid; grid-template-columns: 1fr 1.6fr auto; gap: 8px; align-items: start; margin-bottom: 8px; }
.agc-unit .agc-field { margin: 0; }
.agc-unit label { font-size: 0.8125rem; }
.agc-link-button { min-height: 44px; border: 1px dashed var(--agc-line); border-radius: 8px; background: transparent; color: var(--agc-accent); font: inherit; font-weight: 600; padding: 0 12px; cursor: pointer; }
.agc-remove { align-self: end; min-width: 44px; min-height: 44px; border: 1px solid var(--agc-line); border-radius: 8px; background: transparent; color: var(--agc-muted); font-size: 1.125rem; cursor: pointer; }
.agc-timeline { list-style: none; margin: 8px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--agc-line); }
.agc-timeline li { position: relative; padding: 4px 0 8px 10px; }
.agc-timeline li::before { content: ""; position: absolute; left: -21px; top: 11px; width: 10px; height: 10px; border-radius: 50%; background: var(--agc-accent); }
.agc-timeline li.agc-after::before { background: var(--agc-line); }
.agc-timeline time { display: block; font-weight: 700; font-variant-numeric: tabular-nums; }
.agc-timeline li.agc-after { color: var(--agc-muted); }
.agc-h3 { font-size: 1rem; margin: 16px 0 4px; }
.agc-table-kv td { white-space: normal; word-break: keep-all; overflow-wrap: anywhere; }
.agc-table-kv td:first-child { white-space: nowrap; color: var(--agc-muted); }
.agc-verdict { margin: 0 0 8px; padding: 10px 12px; border-radius: 8px; font-size: 1.0625rem; font-weight: 700; border: 1px solid currentColor; }
.agc-verdict.agc-ok { color: var(--agc-good); }
.agc-verdict.agc-no { color: var(--agc-bad); }
.agc-ok-text { color: var(--agc-good); font-weight: 700; }
.agc-no-text { color: var(--agc-bad); font-weight: 700; }
.agc-checks { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
.agc-checks li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--agc-line); word-break: keep-all; overflow-wrap: anywhere; }
.agc-checks small { display: block; font-size: 0.8125rem; color: var(--agc-muted); }
.agc-dong { grid-template-columns: 1fr 1fr 1fr; }
.agc-stages { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.agc-stages > li > details { border: 1px solid var(--agc-line); border-radius: 10px; background: var(--agc-bg); }
.agc-stages summary { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; cursor: pointer; font-weight: 700; list-style: none; }
.agc-stages summary::-webkit-details-marker { display: none; }
.agc-stages summary::after { content: "+"; margin-left: auto; color: var(--agc-muted); font-weight: 400; }
.agc-stages details[open] summary::after { content: "−"; }
.agc-stage-no { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--agc-soft); color: var(--agc-accent); font-size: 0.8125rem; font-variant-numeric: tabular-nums; flex: none; }
.agc-stage-body { padding: 0 12px 12px 48px; font-size: 0.9375rem; word-break: keep-all; overflow-wrap: anywhere; }
.agc-stage-body p { margin: 0 0 8px; }
.agc-stage-body ul { margin: 0 0 8px; padding-left: 1.1em; color: var(--agc-muted); }
.agc-stage-basis { font-size: 0.8125rem; color: var(--agc-muted); }
.agc-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.8125rem; color: var(--agc-muted); }
.agc-chip { display: inline-flex; align-items: center; min-height: 36px; padding: 4px 12px; border: 1px solid var(--agc-accent); border-radius: 999px; background: transparent; color: var(--agc-accent); font: inherit; font-size: 0.8125rem; font-weight: 600; cursor: pointer; text-decoration: none; }

/* 5분류 탭 허브 ([algogagi_calc type="hub"]) */
.agc-hub { --agc-accent: #2563eb; --agc-line: #d9dee4; --agc-soft: #f4f6f8; --agc-muted: #5b6470; max-width: 100%; }
.agc-hub-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.agc-hub-cat { flex: 0 0 auto; min-height: 44px; padding: 0 14px; border: 1px solid var(--agc-line); border-radius: 999px; background: transparent; color: inherit; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.agc-hub-cat small { font-weight: 400; color: var(--agc-muted); margin-left: 2px; }
.agc-hub-cat.is-on { background: var(--agc-accent); border-color: var(--agc-accent); color: #fff; }
.agc-hub-cat.is-on small { color: inherit; opacity: .85; }
.agc-hub-subs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; padding: 8px; background: var(--agc-soft); border-radius: 10px; }
.agc-hub-subs[hidden] { display: none; }
.agc-hub-sub { min-height: 40px; padding: 0 12px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.agc-hub-sub.is-on { background: var(--agc-bg, #fff); border-color: var(--agc-accent); color: var(--agc-accent); font-weight: 700; }
.agc-hub-panel[hidden] { display: none; }

/* ── 출시용 다듬기 (2026-09-28) ── */
.agc-calc { border-radius: 16px; padding: 20px 18px; box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.06); }
.agc-calc h2.agc-title { border: 0; padding: 0; margin: 0 0 16px; color: #0f172a; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.01em; }
.agc-input { border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
.agc-input:focus { outline: none; border-color: var(--agc-accent); box-shadow: 0 0 0 3px rgba(37,99,235,.18); }
.agc-button { border-radius: 12px; font-weight: 700; letter-spacing: -0.01em; }
.agc-result { scroll-margin-top: 96px; background: #f8fafc; border: 1px solid var(--agc-line); border-radius: 14px; padding: 16px; }
/* 결과의 핵심 숫자(굵은 줄)를 카드로 크게 */
.agc-result > .agc-row.agc-strong { display: block; background: #fff; border: 1px solid #dbe5fb; border-left: 4px solid var(--agc-accent); border-radius: 12px; padding: 12px 14px; margin: 0 0 10px; }
.agc-result > .agc-row.agc-strong .agc-row-label { display: block; font-size: .9rem; font-weight: 600; color: var(--agc-muted); }
.agc-result > .agc-row.agc-strong .agc-row-value { display: block; text-align: left; font-size: 1.6rem; font-weight: 800; color: #0f172a; line-height: 1.25; margin-top: 2px; }
.agc-result > .agc-row.agc-strong .agc-row-value small { font-size: .95rem; font-weight: 600; color: var(--agc-accent); }
.agc-result .agc-row { border-bottom-color: #e5e7eb; }
.agc-steps { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 10px 12px; }
.agc-sources a { color: var(--agc-accent); }
/* 허브: 분류 탭을 화면 위에 붙인다 */
.agc-hub { scroll-margin-top: 16px; }
.agc-hub-cats { padding: 4px 0; margin: 0 0 8px; }
/* 테마가 html/body에 overflow-x:hidden을 걸어 sticky가 안 먹는다 → 스크롤하면 위에 고정 막대를 따로 띄운다 */
.agc-hub-float { position: fixed; left: 0; right: 0; top: 0; z-index: 9990; background: rgba(255,255,255,.97); box-shadow: 0 4px 12px rgba(15,23,42,.12); padding: 8px 12px; display: flex; gap: 6px; overflow-x: auto; transform: translateY(-110%); transition: transform .18s ease; }
.agc-hub-float.is-shown { transform: none; }
.agc-hub-float .agc-hub-cat { min-height: 36px; padding: 0 12px; font-size: .9rem; }
body.admin-bar .agc-hub-float { top: 32px; }
@media (max-width: 782px) { body.admin-bar .agc-hub-float { top: 46px; } }
.agc-hub-cat { background: #fff; }
.agc-hub-cat:not(.is-on):hover { border-color: var(--agc-accent); color: var(--agc-accent); }
.agc-hub-subs { background: #f1f5f9; }
.agc-hub-sub:not(.is-on):hover { background: #fff; }
.agc-hub-panel > .agc-content, .agc-hub-panel > h2 { margin-top: 24px; }

/* 글자 크기: 테마 본문 크기(큰 편)를 물려받지 않게 계산기 영역은 고정 (2026-09-28 사용자 "폰트가 너무 크다") */
.agc-hub { font-size: 15px; line-height: 1.6; }
.agc-hub-cat { font-size: 15px; min-height: 40px; padding: 0 13px; }
.agc-hub-sub { font-size: 14px; min-height: 36px; }
body .agc-content { font-size: 15px; line-height: 1.7; }
body .agc-content p, body .agc-content li, body .agc-content dd, body .agc-content dt { font-size: 15px; }
body .agc-content h2 { font-size: 1.2rem; }
body .agc-content h3 { font-size: 1.02rem; }
body .agc-calc { font-size: 15px; }
.agc-calc h2.agc-title { font-size: 1.2rem; }
