.jpc-calc { border: 1px solid #cfd8e3; border-radius: 8px; background: #f7f9fc; padding: 20px; margin: 1.5em 0; max-width: 680px; color: #1f2933; box-sizing: border-box; }
.jpc-calc *, .jpc-calc *::before, .jpc-calc *::after { box-sizing: border-box; }
.jpc-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.jpc-field[hidden] { display: none; }
.jpc-field label { font-weight: 600; font-size: 0.95em; }
.jpc-input { display: flex; align-items: center; gap: 8px; }
.jpc-input input, .jpc-input select, .jpc-input textarea { flex: 1; min-width: 0; padding: 8px 10px; font-size: 1em; border: 1px solid #9aa5b1; border-radius: 4px; background: #fff; color: inherit; font-family: inherit; }
.jpc-input textarea { resize: vertical; line-height: 1.5; }
.jpc-unit { white-space: nowrap; color: #52606d; }
.jpc-check { flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 8px; }
.jpc-check .jpc-input { flex: 0 0 auto; }
.jpc-check .jpc-input input { flex: 0 0 auto; width: 1.2em; height: 1.2em; }
.jpc-actions { display: flex; gap: 8px; margin-top: 4px; }
.jpc-btn { padding: 9px 22px; font-size: 1em; border: 1px solid #9aa5b1; border-radius: 4px; background: #fff; color: #1f2933; cursor: pointer; }
.jpc-btn-primary { background: #1a6fc9; border-color: #1a6fc9; color: #fff; font-weight: 600; }
.jpc-btn-primary:hover { background: #15589f; }
.jpc-result:not(:empty) { margin-top: 18px; padding: 14px 16px; background: #fff; border: 1px solid #cfd8e3; border-radius: 6px; }
.jpc-result.jpc-error { background: #fff4f4; border-color: #e0a4a4; color: #9b1c1c; }
.jpc-result dl { margin: 0; }
.jpc-result dt { font-size: 0.85em; color: #52606d; margin-top: 8px; }
.jpc-result dd { margin: 0; font-size: 1.05em; overflow-wrap: anywhere; }
.jpc-result dd.jpc-main { font-size: 1.5em; font-weight: 700; color: #0b4f9c; }
.jpc-note { font-size: 0.85em; color: #52606d; margin: 12px 0 0; }
.jpc-table-wrap { overflow-x: auto; margin-top: 14px; }
.jpc-table { border-collapse: collapse; width: 100%; font-size: 0.9em; white-space: nowrap; }
.jpc-table th, .jpc-table td { border: 1px solid #d3dae3; padding: 5px 9px; text-align: right; }
.jpc-table th { background: #eef2f7; text-align: center; }
.jpc-table td:first-child { text-align: left; }
.jpc-disclaimer { font-size: 0.8em; color: #7b8794; margin: 14px 0 0; }
.jpc-list { list-style: none; padding: 0; margin: 0 0 1em; }
.jpc-list li { padding: 8px 0; border-bottom: 1px solid #e4e7eb; }
.jpc-list li span { display: block; font-size: 0.85em; color: #52606d; }

/* 電卓 */
.jpc-keypad { max-width: 420px; }
.jpc-display { width: 100%; padding: 12px; font-size: 1.3em; text-align: right; border: 1px solid #9aa5b1; border-radius: 4px; background: #fff; color: inherit; }
.jpc-display-result { min-height: 1.8em; text-align: right; font-size: 1.5em; font-weight: 700; color: #0b4f9c; padding: 6px 4px; overflow-wrap: anywhere; }
.jpc-display-result.jpc-error { color: #9b1c1c; font-size: 0.95em; font-weight: 400; }
.jpc-angle { margin-bottom: 8px; padding: 6px 8px; border: 1px solid #9aa5b1; border-radius: 4px; background: #fff; color: inherit; }
.jpc-keys { display: grid; gap: 6px; margin-top: 6px; }
.jpc-key { padding: 12px 0; font-size: 1.05em; border: 1px solid #b4bfcc; border-radius: 4px; background: #e9eef4; color: #1f2933; cursor: pointer; }
.jpc-key:hover { background: #dbe3ec; }
.jpc-key-num { background: #fff; }
.jpc-key-eq { background: #1a6fc9; border-color: #1a6fc9; color: #fff; font-weight: 700; }
.jpc-history { list-style: none; margin: 12px 0 0; padding: 0; font-size: 0.85em; color: #52606d; }
.jpc-history li { padding: 2px 0; text-align: right; overflow-wrap: anywhere; }

@media (max-width: 480px) {
	.jpc-calc { padding: 14px; }
	.jpc-input { flex-wrap: wrap; }
}

/* 計算後の自動スクロール：固定ヘッダーに隠れないよう余白を取る */
.jpc-result, .jpc-display-result { scroll-margin-top: 110px; }

/* 計算機一覧のカード表示 */
.jpc-index { --jpc-main: #fa0f00; --jpc-sub: #6b7785; }
.jpc-search-wrap { margin: 0 0 28px; }
.jpc-search { width: 100%; max-width: 420px; padding: 10px 14px; font-size: 1em; border: 1px solid #ddd; border-radius: 4px; background: #fff; color: #333; box-sizing: border-box; }
.jpc-cat { margin: 0 0 40px; }
.jpc-cat[hidden], .jpc-index .jpc-empty[hidden] { display: none; }
.jpc-cat-title { margin: 0 0 16px; padding: 0 0 6px; font-size: 1.25em; font-weight: 700; line-height: 1.5; border-bottom: 2px solid #eee; }
.jpc-hub { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 0 0 8px; }
@media (max-width: 959px) { .jpc-hub { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) { .jpc-hub { grid-template-columns: minmax(0, 1fr); gap: 16px; } }
.jpc-index a.jpc-card { display: flex; flex-direction: column; gap: 8px; padding: 28px 24px; background: #fff; border: 1px solid #ddd; border-top: 4px solid var(--jpc-main); border-radius: 4px; color: #333; text-decoration: none; transition: .15s; }
.jpc-index a.jpc-card[hidden] { display: none; }
.jpc-index a.jpc-card:hover { box-shadow: 0 8px 20px rgba(250, 15, 0, .15); transform: translateY(-2px); }
.jpc-card-icon { display: block; font-size: 2em; line-height: 1.2; }
.jpc-index a.jpc-card strong { display: block; font-size: 1.1em; font-weight: 700; line-height: 1.5; color: var(--jpc-main); }
.jpc-card-desc { display: block; font-size: .875em; line-height: 1.7; color: var(--jpc-sub); }

/* PC幅：左に入力欄、右に計算結果（計算前から結果の置き場所が分かるようにする） */
@media (min-width: 900px) {
	.jpc-calc.jpc-split { max-width: 980px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 28px; align-items: start; }
	.jpc-split .jpc-form { grid-column: 1; grid-row: 1; }
	.jpc-split .jpc-result { grid-column: 2; grid-row: 1; position: sticky; top: 110px; min-height: 220px; max-height: calc(100vh - 140px); overflow: auto; margin-top: 0; }
	.jpc-split .jpc-result:not(:empty) { margin-top: 0; }
	.jpc-split .jpc-result:empty { display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; white-space: pre-line; line-height: 1.8; color: #7b8794; background: #fff; border: 2px dashed #cfd8e3; border-radius: 6px; }
	.jpc-split .jpc-result:empty::before { content: "計算結果がここに表示されます\A左の入力欄を入力して「計算する」を押してください"; }
	.jpc-split .jpc-disclaimer { grid-column: 1 / -1; }
}

/* 計算機一覧ページ（PC）：全幅表示・大きなカードの4列 */
@media (min-width: 960px) {
	.jpc-index--hub { width: 100vw; position: relative; left: 50%; margin-left: -50vw; padding: 0 40px; box-sizing: border-box; }
	.jpc-index--hub > * { max-width: 1680px; margin-left: auto; margin-right: auto; }
	.jpc-index--hub .jpc-hub { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
	.jpc-index--hub a.jpc-card { padding: 36px 30px; gap: 10px; }
	.jpc-index--hub .jpc-card-icon { font-size: 2.8em; }
	.jpc-index--hub a.jpc-card strong { font-size: 1.25em; }
	.jpc-index--hub .jpc-card-desc { font-size: 1em; }
	.jpc-index--hub .jpc-cat-title { font-size: 1.4em; }
	.jpc-index--hub .jpc-search { max-width: 520px; }
}
@media (min-width: 1100px) {
	.jpc-index--hub .jpc-hub { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
