/* =========================================================
   定額残業代（固定残業代）計算ツール 専用スタイル
   styles.css の配色トークンを共有
   ========================================================= */

.fo-section { background: var(--bg-alt); padding-top: clamp(32px,5vw,56px); }

.fo-layout { display: grid; grid-template-columns: 360px 1fr; gap: 28px; align-items: start; }

/* ===================== 入力パネル ===================== */
.fo-panel {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 24px 22px 26px; position: sticky; top: calc(var(--header-h) + 14px);
}
.fo-step {
  font-size: 12px; font-weight: 700; color: var(--yellow-dark); letter-spacing: .06em;
  margin: 20px 0 12px; padding-bottom: 7px; border-bottom: 2px solid var(--yellow-tint);
}
.fo-step:first-child { margin-top: 0; }
.fo-field { margin-bottom: 14px; }
.fo-field label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 6px; color: #3a3f45; }
.fo-field .hint { font-weight: 400; color: var(--text-soft); font-size: 11px; letter-spacing: 0; }
.fo-field input, .fo-panel select {
  width: 100%; padding: 10px 11px; font-size: 14px; font-family: var(--font-jp);
  border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--text);
}
.fo-field input:focus, .fo-panel select:focus { outline: 2px solid var(--yellow); border-color: var(--yellow); }

/* 金額入力（¥や単位つき） */
.fo-money { position: relative; display: flex; align-items: center; }
.fo-money .cur { position: absolute; left: 12px; font-weight: 700; color: var(--text-soft); pointer-events: none; }
.fo-money .cur + input { padding-left: 26px; }
.fo-money--unit input { padding-right: 64px; }
.fo-money .unit { position: absolute; right: 12px; font-size: 12px; color: var(--text-soft); pointer-events: none; }

.fo-field--big input { font-size: 22px; font-weight: 700; padding: 12px 12px 12px 30px; letter-spacing: .02em; }
.fo-field--big .cur { font-size: 18px; left: 13px; }

/* 対象時間クイック */
.fo-quick { display: flex; gap: 6px; margin-top: 8px; }
.fo-quick button {
  flex: 1; padding: 7px 0; font-size: 13px; font-weight: 700; color: #3a3f45;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.fo-quick button:hover { border-color: var(--yellow); color: var(--yellow); }
.fo-help { font-size: 11.5px; color: var(--text-soft); line-height: 1.7; margin: 8px 0 0; }

/* 詳細設定トグル */
.fo-details-toggle {
  width: 100%; text-align: left; margin-top: 18px; padding: 11px 14px; font-size: 12.5px; font-weight: 700;
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: 9px; color: #3a3f45;
  display: flex; justify-content: space-between; align-items: center;
}
.fo-details-toggle .chev { width: 8px; height: 8px; border-right: 2px solid #888; border-bottom: 2px solid #888; transform: rotate(45deg); transition: transform .2s; }
.fo-details-toggle.open .chev { transform: rotate(-135deg); }
.fo-details { display: none; padding-top: 14px; }
.fo-details.open { display: block; }
.fo-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.fo-mini { margin-top: 8px; }
.fo-mini summary { font-size: 11.5px; color: var(--yellow-dark); cursor: pointer; }
.fo-mini .fo-row2 { margin-top: 8px; }
.fo-mini label { font-size: 11px; }

.fo-note {
  margin-top: 16px; font-size: 11.5px; color: var(--text-soft); line-height: 1.7;
  background: var(--bg-alt); border-radius: 9px; padding: 10px 12px;
}

/* ===================== 結果 ===================== */
.fo-main { min-width: 0; }
.fo-result { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: clamp(18px,3vw,30px); }
.fo-empty { color: var(--text-soft); text-align: center; padding: 40px 0; font-size: 14px; }

/* 結果カード */
.fo-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.fo-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 16px 14px; text-align: center; background: #fff;
}
.fo-card .k { display: block; font-size: 11px; color: var(--text-soft); }
.fo-card .v { display: block; font-size: 23px; font-weight: 700; margin: 6px 0 3px; color: var(--yellow-dark); letter-spacing: .01em; }
.fo-card .sub { display: block; font-size: 10.5px; color: var(--text-soft); }
.fo-card--main { background: var(--yellow); border-color: var(--yellow); grid-column: span 1; }
.fo-card--main .k { color: #f7e6c6; }
.fo-card--main .v { color: #fff; font-size: 26px; }
.fo-card--main .sub { color: #f3d9b8; }

/* 最低賃金チェック */
.fo-mw { margin-top: 16px; border-radius: 10px; padding: 12px 14px; font-size: 13px; line-height: 1.7; }
.fo-mw .ic { font-weight: 700; margin-right: 6px; }
.fo-mw.ok { background: #e8f4ec; color: #1f7a44; }
.fo-mw.ng { background: #fdecec; color: #b3261e; }

/* ブロック共通 */
.fo-block { margin-top: 28px; }
.fo-h2 { font-size: 16px; font-weight: 700; margin: 0 0 12px; padding-left: 12px; border-left: 4px solid var(--yellow); letter-spacing: .03em; }

/* 計算の内訳 */
#fo-breakdown { background: var(--bg-alt); border-radius: 12px; padding: 16px 18px; font-size: 13px; line-height: 1.9; }
.fo-formula { font-weight: 700; color: #3a3f45; }
.fo-calc-line { color: #4a4f55; margin-top: 4px; }
.fo-calc-detail { margin: 12px 0 0; padding-left: 1.2em; }
.fo-calc-detail li { margin-bottom: 5px; color: #4a4f55; }

/* 給与明細の記入例 */
.payslip { border: 2px solid #2b2f34; border-radius: 8px; overflow: hidden; background: #fff; }
.ps-title { text-align: center; font-weight: 700; font-size: 16px; letter-spacing: .5em; padding: 10px 0; border-bottom: 1px solid #c8ccd0; background: #fafbfb; }
.ps-cols { display: grid; grid-template-columns: 1.2fr 1fr; }
.ps-col { padding: 14px 18px; }
.ps-col--note { border-left: 1px dashed #c8ccd0; background: #fcfcfa; }
.ps-col-h { font-size: 12px; font-weight: 700; color: var(--yellow-dark); border-bottom: 2px solid var(--yellow-tint); padding-bottom: 6px; margin-bottom: 10px; }
.ps-row { display: flex; justify-content: space-between; align-items: baseline; padding: 7px 0; border-bottom: 1px dotted #e0e3e6; font-size: 13.5px; }
.ps-row .num { font-weight: 700; font-variant-numeric: tabular-nums; }
.ps-row .num::after { content: " 円"; font-size: 10px; font-weight: 400; color: var(--text-soft); }
.ps-row.ps-hl { background: var(--yellow-tint); margin: 4px -10px; padding: 8px 10px; border-radius: 6px; border-bottom: none; }
.ps-row.ps-hl span:first-child { font-weight: 700; color: var(--yellow-dark); }
.ps-row.ps-total { border-bottom: none; border-top: 2px solid #2b2f34; margin-top: 4px; font-size: 15px; }
.ps-row.ps-total span:first-child { font-weight: 700; }
.ps-extra-note { font-size: 12.5px; color: #4a4f55; line-height: 1.8; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }

/* 注意点 */
.fo-cautions ul { margin: 0; padding-left: 1.2em; }
.fo-cautions li { font-size: 13px; line-height: 1.85; margin-bottom: 8px; color: #4a4f55; }

/* ===================== レスポンシブ ===================== */
@media (max-width: 920px) {
  .fo-layout { grid-template-columns: 1fr; }
  .fo-panel { position: static; }
  .fo-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .ps-cols { grid-template-columns: 1fr; }
  .ps-col--note { border-left: none; border-top: 1px dashed #c8ccd0; }
}
