/* V18 房貸試算（參考第一銀行試算欄位） */
.loan-form{display:grid;gap:26px;margin-top:8px}
.loan-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px 28px}
.loan-field{display:flex;flex-direction:column;gap:9px;font-size:15px;color:#364235;font-weight:600;min-width:0}
.loan-field>small,.loan-hint{font-size:13px;font-weight:400;color:#6c7566;line-height:1.7;margin:0}
.loan-pair{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.loan-input{display:flex;align-items:center;border:1px solid #d7d4ce;border-radius:8px;background:#fff;overflow:hidden;min-width:0}
.loan-input:focus-within{border-color:#5f7a5a;box-shadow:0 0 0 3px #a9bf9e55}
.loan-input input{flex:1;min-width:0;border:0;padding:12px 12px;font:inherit;font-size:17px;font-weight:600;color:#2f3a2e;background:transparent;outline:none}
.loan-input em{font-style:normal;font-size:14px;font-weight:500;color:#6c7566;padding:0 12px 0 4px;white-space:nowrap}
.loan-input.small input{padding:10px;font-size:16px;width:70px}
.loan-toggle{display:flex;flex-wrap:wrap;gap:8px}
.loan-toggle button,.stage-tool{font:inherit;font-size:15px;font-weight:600;padding:10px 18px;border-radius:30px;border:1px solid #cdd3c4;background:#fff;color:#46573b;cursor:pointer}
.loan-toggle button[aria-checked="true"]{background:#46573b;border-color:#46573b;color:#fff}
.loan-toggle button:focus-visible,.stage-tool:focus-visible{outline:3px solid #a9bf9e;outline-offset:2px}
.stage-tool{font-size:14px;padding:8px 14px}
.stage-tool:disabled{opacity:.45;cursor:not-allowed}
.stage-list{display:grid;gap:10px;margin-top:6px}
.stage-row{display:flex;flex-wrap:wrap;align-items:center;gap:10px 14px;padding:12px 14px;border:1px solid #e1e3da;border-radius:10px;background:#fbfaf5}
.stage-name{font-size:15px;color:#46573b;min-width:52px}
.stage-range{display:flex;align-items:center;gap:8px;font-weight:500;color:#555f50}
.stage-range b{font-weight:600;color:#364235}
.stage-tools{display:flex;gap:8px;margin-top:4px}
.loan-submit{font-size:17px;padding:15px}
.loan-result{margin-top:28px;padding:28px;border:1px solid #dfe3d6;border-radius:15px;background:linear-gradient(130deg,#f4f4ee,#eef1e7);scroll-margin-top:90px}
.loan-result[hidden]{display:none}
.loan-result-head{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:flex-end;gap:14px}
.loan-result-head h2{margin:4px 0 0;font-size:24px;color:#2f3a2e}
.loan-actions{display:flex;flex-wrap:wrap;gap:8px}
.loan-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:22px 0}
.loan-summary div{background:#fff;border:1px solid #e1e3da;border-radius:10px;padding:14px 16px}
.loan-summary dt{font-size:13px;color:#6c7566}
.loan-summary dd{margin:6px 0 0;font-size:19px;font-weight:700;color:#2f3a2e}
.loan-groups{display:grid;gap:10px}
.loan-group{display:grid;grid-template-columns:minmax(130px,auto) 1fr auto;align-items:center;gap:6px 18px;background:#fff;border:1px solid #e1e3da;border-left:4px solid #6f8a64;border-radius:10px;padding:14px 18px;font-size:15px;color:#364235}
.loan-group.is-grace{border-left-color:#c49a52}
.loan-group-label{font-weight:700}
.loan-group-label i{font-style:normal;font-size:12px;font-weight:600;color:#8a6424;background:#fbf1de;border-radius:20px;padding:2px 9px;margin-left:8px}
.loan-group-pay strong{font-size:21px;color:#b74742}
.loan-group-rate{color:#6c7566;font-size:14px}
.loan-table-title{font-size:18px;margin:28px 0 12px;color:#2f3a2e}
.loan-table-wrap{max-height:70vh;overflow:auto;border:1px solid #dfe3d6;border-radius:10px;background:#fff}
.loan-table-wrap:focus-visible{outline:3px solid #a9bf9e}
.loan-table{width:100%;border-collapse:collapse;font-size:15px;font-variant-numeric:tabular-nums}
.loan-table th,.loan-table td{padding:9px 14px;text-align:right;border-bottom:1px solid #eef0e8;white-space:nowrap}
.loan-table th:first-child,.loan-table td:first-child{text-align:center}
.loan-table thead th{position:sticky;top:0;z-index:1;background:#46573b;color:#fff;font-weight:600}
.loan-table thead small{font-size:12px;font-weight:400;opacity:.85}
.loan-table .rate-row td{text-align:left;background:#eef2e5;color:#46573b;font-weight:700;font-size:14px}
.loan-table .grace-row td{background:#fffaf0}
.loan-table tfoot th,.loan-table tfoot td{position:sticky;bottom:0;background:#f1efe6;font-weight:700;color:#2f3a2e;border-top:2px solid #cdd3c4}
@media(max-width:780px){.loan-grid{grid-template-columns:1fr}.loan-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.loan-group{grid-template-columns:1fr}.loan-result{padding:20px 16px}}
@media(max-width:600px){.loan-field{font-size:15px}.loan-toggle button{font-size:14px;padding:9px 13px}.loan-table{font-size:13px}.loan-table th,.loan-table td{padding:8px 8px}.loan-summary dd{font-size:17px}.loan-result-head h2{font-size:21px}}
@media print{body.printing-loan>*:not(main),body.printing-loan .loan-page>*:not(.loan-result),body.printing-loan .loan-actions,body.printing-loan .business-card-dialog{display:none!important}body.printing-loan .loan-result{border:0;background:#fff;padding:0;margin:0}body.printing-loan .loan-table-wrap{max-height:none;overflow:visible}body.printing-loan .loan-table thead th,body.printing-loan .loan-table tfoot td,body.printing-loan .loan-table tfoot th{position:static}body.printing-loan main .wrap{padding:0}}
.loan-submit{background:#46573b!important;border-color:#46573b!important;color:#fff!important;box-shadow:0 8px 20px #46573b33}
.loan-submit:hover{background:#3a4931!important}
.loan-input.small input{width:92px}
.loan-form .error:empty{display:none}
.loan-unit{display:none;font-size:13px;color:#6c7566;margin:0 0 8px}
@media(max-width:600px){.loan-table thead small{display:none}.loan-unit{display:block}.loan-table{font-size:12.5px}.loan-table th,.loan-table td{padding:8px 5px}.loan-table th:first-child,.loan-table td:first-child{padding-left:8px}.loan-table td:last-child,.loan-table th:last-child{padding-right:8px}.loan-table .rate-row td{font-size:13px}}
.stage-tools[hidden]{display:none}
@media(max-width:600px){.loan-table{font-size:12px;letter-spacing:-.2px}.loan-table th,.loan-table td{padding:8px 3px}.loan-table th:first-child,.loan-table td:first-child{padding-left:6px;padding-right:2px}.loan-table td:last-child,.loan-table th:last-child{padding-right:6px}.loan-result{padding:20px 12px}}
