:root { font-family: "Yu Gothic UI", "Meiryo", sans-serif; color: #112844; background: #eef4f8; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 1px solid #b8cce0; border-radius: 8px; padding: .7rem 1rem; background: #f5f9fd; color: #11385e; font-weight: 700; }
button:hover { background: #e6f1fb; }
.app-header { display: flex; justify-content: space-between; gap: 2rem; align-items: center; padding: 1.3rem clamp(1rem, 4vw, 3rem); color: white; background: linear-gradient(110deg, #102f51, #195b8a); }
.app-header h1 { margin: .2rem 0; font-size: clamp(1.6rem, 3vw, 2.3rem); }
.app-header p { margin: 0; }
.eyebrow { color: #4ddde2; font-size: .72rem; letter-spacing: .14em; font-weight: 800; }
.global-nav { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.global-nav a { color: white; }
.workspace { width: min(1540px, calc(100% - 2rem)); margin: 1rem auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 1rem; align-items: start; }
.application-panel, .guide-panel section, .admin-workspace { background: white; border: 1px solid #cad9e8; border-radius: 14px; box-shadow: 0 8px 24px #16365412; }
.application-panel, .admin-workspace { padding: 1.2rem; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.panel-heading h2 { margin: .2rem 0; }
.save-state { color: #a56b00; }
.steps { display: grid; grid-template-columns: repeat(6, minmax(110px, 1fr)); gap: .45rem; margin: 1.2rem 0; overflow-x: auto; }
.steps .active { background: #123f68; color: white; }
.form-card { border-top: 1px solid #d5e0ea; padding: 1rem 0; display: grid; gap: 1rem; }
label { display: grid; gap: .35rem; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid #afc5d9; border-radius: 7px; padding: .7rem; background: white; }
textarea { min-height: 110px; resize: vertical; }
small { font-weight: 400; color: #526a80; }
.money { text-align: right; font-variant-numeric: tabular-nums; }
.primary-actions { display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; position: sticky; bottom: 0; background: #fffef4; padding: .8rem; border-top: 1px solid #e7d9a9; }
.primary-actions button:first-child { background: #0c67ce; color: white; }
.guide-panel { display: grid; gap: 1rem; }
.guide-panel section { padding: 1rem; }
.guide-panel button { width: 100%; margin-top: .45rem; }
.admin-workspace { width: min(1400px, calc(100% - 2rem)); margin: 1rem auto; }
.notice { background: #fff5d8; border-left: 4px solid #d99300; padding: .8rem; }
.login-card { width: min(480px, calc(100% - 2rem)); margin: 12vh auto; padding: 2rem; background: white; border-radius: 14px; box-shadow: 0 12px 40px #17375626; text-align: center; }
.table-wrap { overflow-x: auto; } table { width: 100%; border-collapse: collapse; } th, td { padding: .8rem; text-align: left; border-bottom: 1px solid #dbe5ee; }
.finance-table { min-width: 850px; } .finance-table input { min-width: 120px; }
@media (max-width: 900px) { .app-header { align-items: flex-start; flex-direction: column; } .workspace { grid-template-columns: 1fr; } .guide-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .workspace, .admin-workspace { width: calc(100% - 1rem); } .application-panel { padding: .75rem; } .guide-panel { grid-template-columns: 1fr; } .panel-heading { align-items: flex-start; flex-direction: column; } }

.checkbox-label { display: flex; align-items: center; gap: .5rem; font-weight: 700; }
.checkbox-label input[type=checkbox] { width: auto; }
.finance-summary { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: .6rem; }
.finance-summary div { border: 1px solid #d7e3ee; border-radius: 8px; padding: .7rem; background: #f8fbfe; }
.finance-summary strong, .finance-summary span { display: block; }
@media (max-width: 900px) { .finance-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .finance-summary { grid-template-columns: 1fr; } }

.saved-documents { display: grid; gap: .6rem; }
.document-table th, .document-table td { padding: .45rem .55rem; vertical-align: middle; }
.document-table .delete-check { width: 4rem; text-align: center; }
.document-table input[type=checkbox] { width: auto; transform: scale(.95); }
.document-table small { display: block; margin-top: .15rem; }
button.small { padding: .45rem .7rem; font-size: .9rem; justify-self: start; }

.measure-guide, .download-guide, .certification-guide { border: 1px solid #d7e3ee; border-radius: 9px; padding: .8rem; background: #f8fbfe; }
.measure-guide { display: grid; gap: .6rem; }
.measure-guide h4, .download-guide p, .certification-guide p { margin: 0; }
.measure-guide dl { display: grid; grid-template-columns: 8rem 1fr; gap: .35rem .7rem; margin: 0; }
.measure-guide dt { font-weight: 700; }
.measure-guide dd { margin: 0; }
.download-guide + .download-guide { margin-top: .7rem; }
.download-guide p { margin-top: .45rem; font-size: .92rem; line-height: 1.55; }
.download-state, .export-state { min-height: 1.4em; color: #315a7d; }
@media (max-width: 620px) { .measure-guide dl { grid-template-columns: 1fr; } }

.required-error, .ai-review-output.blocked .blocking-message { color: #a20d1a; font-weight: 700; }
.ai-review-output.blocked { border: 2px solid #c62838; background: #fff1f2; }
