/* ============================================================
   E-計算！ Fortune — 吉日カレンダー（kichijitsu.html）だけで使う見た目
   共通（../assets/css/ek.css・css/fortune.css）の上に重ねる。色は変数だけを使う。クラス名は kc- で始める。
   ============================================================ */

.kc-quick { margin: 4px 0 20px; }
.kc-quick ul { margin: 2px 0 0; }
.kc-quick li { margin: 2px 0; }

/* 調べること（5つの切り替え。3つずつ並べ、2段目の2つは幅を広げて左右にそろえる） */
html[data-ui="v2"] .radio-row.kc-seg3.kc-seg3 {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 2px;
  background: var(--page); border-radius: var(--r); padding: 3px;
}
html[data-ui="v2"] .radio-row.kc-seg3.kc-seg3 label {
  flex: 1 1 calc(33.333% - 2px); justify-content: center; text-align: center; padding: 9px 4px; font-size: 13.5px; line-height: 1.4; min-width: 0;
  background: transparent; color: var(--ink-2); border-radius: 8px; overflow-wrap: anywhere;
}
html[data-ui="v2"] .radio-row.kc-seg3.kc-seg3 label:has(input:checked) {
  background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 12%, transparent);
}
@media (max-width: 400px) {
  html[data-ui="v2"] .radio-row.kc-seg3.kc-seg3 label { padding: 8px 2px; font-size: 12.5px; }
}
#form .field { min-width: 0; }
html[data-ui="v2"] .kc-mode .radio-row label, html[data-ui="v2"] .kc-opt .radio-row label { text-align: center; line-height: 1.4; overflow-wrap: anywhere; min-width: 0; }
html[data-ui="v2"] .kc-mode .radio-row label:has(input:disabled) { opacity: .5; }

/* 日付の欄（文字で入れる欄 ＋ カレンダーのボタン） */
.kc-date { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; }
html[data-ui="v2"] .kc-date input[type="text"] {
  flex: 1 1 auto; width: 100%; min-width: 0; height: 44px; padding: 0 12px; font-size: 15px; font-variant-numeric: tabular-nums;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r);
}
html[data-ui="v2"] .kc-date input[type="text"]:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
html[data-ui="v2"] .kc-date input.bad { border-color: var(--s2); border-width: 2px; }
.kc-pick {
  flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0;
  border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.kc-pick:hover { background: var(--accent-soft); color: var(--accent); }
.kc-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.kc-pick svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.kc-native { position: absolute; right: 0; bottom: 0; width: 44px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
@media (max-width: 560px) { html[data-ui="v2"] .kc-date input[type="text"] { font-size: 16px; } }

/* 年と月 */
.kc-ym { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; min-width: 0; }
.kc-ym select, #lY, #yY, #sP { width: 100%; max-width: 100%; min-width: 0; }
/* 期間（条件で探す） */
.kc-range { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; align-items: center; min-width: 0; }
.kc-kara { font-size: 13px; color: var(--ink-2); white-space: nowrap; }

/* 暦注の選択（チップ） */
html[data-ui="v2"] .radio-row.kc-kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
html[data-ui="v2"] .radio-row.kc-kinds label { justify-content: center; min-width: 0; padding: 8px 4px; }
html[data-ui="v2"] .radio-row.kc-rule { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
html[data-ui="v2"] .radio-row.kc-rule label { justify-content: center; padding: 8px 4px; }
html[data-ui="v2"] .radio-row.kc-rule2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
html[data-ui="v2"] .radio-row.kc-rule2 label { justify-content: center; padding: 8px 4px; }

/* くわしい条件 */
.kc-opt { margin: 4px 0 14px; border: 1px solid var(--grid); border-radius: var(--r); padding: 8px 12px; background: var(--surface); }
.kc-opt summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.kc-opt .field { margin: 10px 0 2px; }
.kc-opt .note { margin: 8px 0 0; }

/* ---- 結果 ---- */
#result { min-height: 236px; }
html[data-ui="v2"] .kc-out .res-hero .big { flex-wrap: wrap; row-gap: 0; }
html[data-ui="v2"] .kc-out .res-hero .big b { font-size: clamp(24px, 7vw, 36px); line-height: 1.3; overflow-wrap: anywhere; word-break: keep-all; }
html[data-ui="v2"] .kc-out .res-mini .v { overflow-wrap: normal; word-break: normal; }
html[data-ui="v2"] .kc-out .res-mini .s { overflow-wrap: anywhere; }
@media (max-width: 400px) {
  html[data-ui="v2"] .kc-out .res-mini .v { font-size: 15px; }
  html[data-ui="v2"] .kc-out .res-mini .v.text { font-size: 13.5px; }
}
.kc-fl { line-height: 1.8; }
.kc-p { font-size: 13.5px; line-height: 1.8; margin: 12px 0 0; }
.kc-rulenote { font-size: 12.5px; line-height: 1.7; color: var(--ink-2); margin: 14px 0 0; padding: 8px 10px; border-left: 3px solid var(--accent); background: var(--page); }
table.data.kc-next { margin-top: 18px; }
table.data.kc-next caption { caption-side: top; text-align: left; font-size: 13px; font-weight: 700; color: var(--ink-2); padding-bottom: 6px; }
table.data.kc-next td, table.data.kc-check td { white-space: nowrap; }
table.data tr.kc-on td { background: var(--accent-soft); font-weight: 600; }
table.data.kc-cmp { margin-top: 14px; }
table.data.kc-cmp caption { caption-side: top; text-align: left; font-size: 13px; font-weight: 700; color: var(--ink-2); padding-bottom: 6px; }
table.data.kc-cmp tr.kc-diff td:first-child { border-left: 3px solid var(--accent); }

/* 解釈（計算と見た目を分ける） */
.kc-interp { border-style: dashed; }
.kc-tag { display: inline-block; font-size: 12px; color: var(--ink-2); background: var(--page); border: 1px dashed var(--line-strong); border-radius: 999px; padding: 2px 10px; margin: 0 0 8px; }
.kc-means { margin: 0; padding-left: 1.2em; font-size: 13.5px; line-height: 1.8; }
details.why.kc-interp { border-style: dashed; }

/* 暦注のバッジ */
.kc-b { display: inline-block; font-size: 10px; line-height: 1.35; padding: 0 3px; margin: 1px 1px 0; border-radius: 4px; background: var(--page); color: var(--ink-2); border: 1px solid var(--grid); white-space: nowrap; }
.kc-b.kc-ichi { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 600; }
.kc-b.kc-tensha { background: var(--accent); color: var(--surface); border-color: transparent; font-weight: 600; }
.kc-b.kc-fujo { color: var(--muted); border-style: dashed; }
td.kc-bs .kc-b { font-size: 12px; padding: 1px 6px; margin: 1px 2px 1px 0; }
.kc-b.kc-sanrin { color: var(--tint-warn-ink); border-style: dashed; }
.kc-b.kc-doyo, .kc-b.kc-mabi { color: var(--ink-2); }
.kc-b.kc-ushi { color: var(--ink); font-weight: 600; }
.kc-b.kc-roku { background: var(--surface); color: var(--ink); border-color: var(--line-strong); font-weight: 600; }

/* 月のカレンダー */
.kc-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 18px 0 8px; }
.kc-nav b { font-size: 15px; white-space: nowrap; }
.kc-mv { border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 12px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.kc-mv:hover { background: var(--accent-soft); color: var(--accent); }
.kc-mv:disabled { opacity: .4; cursor: default; }
.kc-mv:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.kc-calwrap { margin: 0; }
.kc-cal { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 2px; }
.kc-cal th { font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 4px 0; text-align: center; }
.kc-cal td { position: relative; vertical-align: top; text-align: center; padding: 4px 1px 5px; border: 1px solid var(--grid); border-radius: 6px; background: var(--surface); min-width: 0; overflow: hidden; }
.kc-cal td.kc-ichiday { background: var(--accent-soft); }
.kc-cal td.kc-tenday { border: 2px solid var(--accent); }
.kc-cal td.kc-none { border-color: transparent; background: transparent; }
.kc-cal td.kc-today { box-shadow: inset 0 0 0 2px var(--ink-2); }
.kc-cal .n { display: block; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.kc-cal td.kc-sun .n { color: var(--tint-warn-ink); }
.kc-cal td.kc-sat .n { color: var(--s1); }
.kc-cal .r { display: block; font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.kc-cal .kc-b { display: block; margin: 1px auto 0; max-width: 100%; overflow: hidden; text-overflow: clip; }
.kc-cal .h { position: absolute; top: 2px; right: 2px; font-size: 8.5px; line-height: 1; color: var(--tint-warn-ink); }
.kc-cal td.kc-nearc .r::after { content: "※"; }
.kc-cal td.kc-doyoday { box-shadow: inset 0 -3px 0 var(--line-strong); }
.kc-cal td.kc-doyoday.kc-today { box-shadow: inset 0 0 0 2px var(--ink-2), inset 0 -4px 0 var(--line-strong); }
@media (max-width: 400px) {
  .kc-cal { border-spacing: 1px; }
  .kc-cal .n { font-size: 12px; }
  .kc-cal .kc-b { font-size: 9px; padding: 0 1px; }
}
th.kc-sun, td.kc-sun { color: var(--tint-warn-ink); }
th.kc-sat, td.kc-sat { color: var(--s1); }
.kc-legend { font-size: 12px; color: var(--ink-2); line-height: 1.9; margin: 8px 0 0; }
.kc-legend .kc-lg { padding: 0 5px; border-radius: 4px; }
.kc-legend .kc-ichiday { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.kc-legend .kc-tenday { border: 2px solid var(--accent); }
.kc-legend .kc-b { margin: 0 2px; }
.kc-legend .kc-doyoday { box-shadow: inset 0 -3px 0 var(--line-strong); }
.kc-hk { color: var(--tint-warn-ink); font-size: 11px; }

/* 注意（0時に近い・2033年問題） */
.kc-near, .kc-2033note { margin-top: 14px; font-size: 13.5px; line-height: 1.8; }
.kc-near b, .kc-2033note b { display: block; margin-bottom: 2px; }

/* 一覧 */
.kc-per th.n, .kc-per td.n { text-align: center; min-width: 2.2em; }
table.data.kc-list td { white-space: nowrap; }
table.data.kc-list td .sub { white-space: normal; }

/* 本文の表 */
table.data.kc-rules td:nth-child(2) { min-width: 8em; }
table.data.kc-rules td:nth-child(3) { min-width: 16em; }
table.data.kc-rules td:nth-child(4) { min-width: 7em; }
table.data.kc-ichi th, table.data.kc-ichi td { text-align: center; white-space: nowrap; }
table.data.kc-setsu td, table.data.kc-tensha td { white-space: nowrap; }
table.data.kc-mean td:nth-child(2) { min-width: 16em; }
.kc-disclaimer { margin: 20px 0 0; text-align: center; }

/* 条件で探す・土用（2026-10-18） */
table.data.kc-top { margin-top: 18px; }
table.data.kc-top caption, table.data.kc-doyo caption { caption-side: top; text-align: left; font-size: 13px; font-weight: 700; color: var(--ink-2); padding-bottom: 6px; }
table.data.kc-doyo { margin-top: 18px; }
table.data.kc-doyo td { white-space: nowrap; }
table.data.kc-purp td:nth-child(1) { min-width: 7em; }
table.data.kc-purp td:nth-child(2), table.data.kc-purp td:nth-child(3) { min-width: 9em; }
table.data.kc-purp td:nth-child(4) { min-width: 16em; }
table.data.kc-sanrin td { white-space: nowrap; }
table.data.kc-choku th, table.data.kc-choku td { text-align: center; white-space: nowrap; }
table.data.kc-chokumean td:first-child { white-space: nowrap; }
.kc-warnline { padding: 8px 10px; border-left: 3px solid var(--tint-warn-ink); background: var(--page); }
