:root { --navy:#142a43; --blue:#1b5d91; --ink:#17212b; --muted:#687585; --line:#d6dee6; --paper:#fff; --wash:#eef2f5; --warn:#a45a00; --radius:14px; }
*{box-sizing:border-box} body{margin:0;background:radial-gradient(circle at top right,#e0eaf2 0,transparent 32%),var(--wash);color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans JP",sans-serif;font-size:15px;line-height:1.55}.app-header{height:64px;background:#fff;border-bottom:1px solid #ced8e1;display:flex;align-items:center;justify-content:space-between;padding:0 max(20px,calc((100vw - 1180px)/2));position:sticky;top:0;z-index:2;box-shadow:0 1px 12px #142a4309}.brand{font-weight:750;font-size:18px;letter-spacing:.03em;color:var(--navy);text-decoration:none}.app-header span{color:var(--muted);font-size:13px}.app-shell{max-width:1180px;margin:auto;padding:34px 20px 64px}h1,h2,h3,p{margin-top:0}h1{font-size:30px;line-height:1.25;margin-bottom:8px;letter-spacing:-.02em}h2{font-size:21px}.lede{color:var(--muted);margin-bottom:28px}.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:16px}.card{background:#fff;border:1px solid #d4dde5;border-radius:var(--radius);padding:20px;box-shadow:0 8px 30px #142a430a}.new-card{border:1px dashed #7994ad;display:grid;place-items:center;min-height:150px;color:var(--blue);font-weight:650;cursor:pointer}.resume-card{display:flex;flex-direction:column;min-height:150px}.resume-card h3{margin-bottom:5px}.resume-card p{color:var(--muted);font-size:13px}.card-actions{margin-top:auto;display:flex;gap:8px;padding-top:14px}.button{appearance:none;border:1px solid transparent;border-radius:8px;background:var(--navy);color:#fff;padding:10px 14px;font:inherit;font-weight:650;cursor:pointer;box-shadow:0 1px 1px #142a4326}.button:hover{background:#0d2136}.button.secondary{background:#fff;border-color:#b9c9d6;color:#174a78;box-shadow:none}.button.ghost{background:transparent;color:var(--blue);padding-left:0;box-shadow:none}.button.danger{background:transparent;color:#963434;box-shadow:none}.toolbar{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:22px}.toolbar-group{display:flex;gap:8px;flex-wrap:wrap}.editor-layout{display:grid;grid-template-columns:minmax(0,1fr) 440px;gap:24px;align-items:start}.form-panel{background:#fff;border:1px solid #cfd9e2;border-radius:var(--radius);padding:28px;box-shadow:0 12px 35px #142a4308}.preview-panel{position:sticky;top:88px}.preview-toolbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.preview-frame{height:690px;border-radius:5px;border:1px solid #8f9ba8;overflow:auto;background:#697786;padding:18px;box-shadow:0 12px 25px #142a4320}.section{border-top:1px solid #d9e1e7;padding-top:22px;margin-top:25px}.section:first-child{border:0;padding:0;margin:0}.section-title{font-size:18px;margin-bottom:4px;color:#142a43}.hint{color:var(--muted);font-size:13px;margin-bottom:15px}.fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.fields.three{grid-template-columns:repeat(3,minmax(0,1fr))}.field{display:flex;flex-direction:column;gap:5px}.field.wide{grid-column:1/-1}label{font-size:12px;font-weight:750;letter-spacing:.02em;color:#34465a}input,textarea,select{font:inherit;border:1px solid #b8c5d0;border-radius:6px;padding:10px;background:#fcfdfe;min-width:0;box-shadow:inset 0 1px 2px #142a4309}textarea{resize:vertical;min-height:100px}input:focus,textarea:focus,select:focus{outline:3px solid #b9d9f1;border-color:var(--blue);background:#fff}.photo-row{display:flex;gap:15px;align-items:flex-start}.photo-control{display:grid;gap:8px;flex:1}.photo-box{width:104px;height:136px;border:1px solid #526679;background:#f7fafc;display:grid;place-items:center;overflow:hidden;font-size:12px;color:var(--muted);text-align:center}.photo-box img{width:100%;height:100%;object-fit:cover}.entry{border:1px solid #cbd6df;border-radius:7px;padding:13px;margin-bottom:10px;background:#fbfcfd;box-shadow:0 2px 7px #142a4305}.entry-grid{display:grid;grid-template-columns:88px 70px 1fr auto;gap:8px;align-items:end}.entry-actions{display:flex;gap:4px}.icon-button{border:1px solid #c9d5df;background:#fff;color:var(--blue);border-radius:5px;padding:7px 8px;cursor:pointer}.notice{background:#f8fafc;border-left:3px solid #476a88;color:#4b5e71;padding:12px 14px;border-radius:4px;font-size:13px;margin-bottom:18px}.empty{color:var(--muted);font-size:14px}.saved{font-size:13px;color:#36764a}.hidden{display:none}
/* Document preview: deliberately formal and ink-forward, independent from the app interface. */ .resume-paper{width:210mm;min-height:297mm;background:#fff;color:#080b0e;margin:auto;padding:7mm;font-family:"Yu Mincho","Hiragino Mincho ProN",serif;font-size:8.6pt;line-height:1.25}.paper-page{height:283mm;position:relative;page-break-after:always}.paper-page:last-child{page-break-after:auto}.paper-title{font-size:21pt;letter-spacing:.42em;text-align:left;margin:1mm 0 3mm 1mm;font-weight:600}.paper-date{text-align:right;margin:-8mm 48mm 2mm 0;font-family:"Yu Gothic",Meiryo,sans-serif;font-size:8pt}.resume-table{width:100%;border-collapse:collapse;table-layout:fixed}.resume-table th,.resume-table td{border:1.2px solid #111;padding:1.4mm 1.8mm;vertical-align:middle;word-break:break-all}.resume-table th{background:#fff;font-weight:500;text-align:left}.profile-photo{width:30mm;height:40mm;object-fit:cover;display:block;margin:auto}.photo-cell{width:34mm;text-align:center;color:#555;font-size:7pt}.profile-name{font-size:15pt}.furigana{font-size:7pt}.history-table td{height:9.1mm}.history-table .ym{width:14mm;text-align:center}.history-heading td{background:#fff;font-weight:600;letter-spacing:.2em;text-align:center;height:7mm}.detail-box{height:39mm;white-space:pre-wrap;vertical-align:top!important}.wish-box{height:30mm;white-space:pre-wrap;vertical-align:top!important}.paper-note{font-size:7pt;color:#222;margin:2mm 0 0}.preview-tabs{display:none}
.paper-heading{height:14mm;position:relative}.identity-table{font-family:"Yu Gothic",Meiryo,sans-serif}.identity-table .name-row td,.identity-table .name-row th{height:26mm}.identity-table .address-row td,.identity-table .address-row th{height:19mm}.identity-table th{font-size:7.6pt}.identity-table th span{font-weight:400;font-size:6.5pt;line-height:1.15}.history-table{font-family:"Yu Gothic",Meiryo,sans-serif}.history-table .year{width:20mm}.history-table .month{width:11mm}.history-table td{height:8.4mm}.history-table .history-heading td{height:7mm}.history-first{margin-top:4mm}.end-mark{text-align:right;padding-right:4mm!important}.license-table{margin-top:4mm}.narrative-table{margin-top:4mm;font-family:"Yu Gothic",Meiryo,sans-serif}.narrative-table th{height:6.5mm;font-size:8pt}.narrative-table .detail-box{height:36mm}.narrative-table .wish-box{height:24mm}
@media(max-width:900px){.app-shell{padding:22px 14px 40px}.editor-layout{display:block}.preview-panel{position:static;margin-top:20px}.preview-frame{height:auto;max-height:620px}.fields,.fields.three{grid-template-columns:1fr}.entry-grid{grid-template-columns:76px 58px 1fr}.entry-actions{grid-column:3;justify-content:flex-end}.app-header span{display:none}.form-panel{padding:18px}.preview-toolbar{position:sticky;bottom:10px;background:#fff;border:1px solid var(--line);padding:8px;border-radius:9px;z-index:1}.resume-paper{transform-origin:top left;transform:scale(.42);margin-bottom:calc(-297mm * .58);}.preview-frame{padding:10px;overflow:hidden}}
/* Each print page owns its padding. This prevents page 2 from starting at the physical top edge. */
.resume-paper{padding:0}.paper-page{height:297mm;padding:10mm 8mm 8mm;}.one-page .paper-page{padding-top:9mm}.template-picker{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:0 0 18px;padding:13px 14px;background:#f4f7fa;border:1px solid #ccd8e2;border-radius:8px}.template-picker strong,.template-picker span{display:block}.template-picker strong{font-size:14px;color:#142a43}.template-picker span{font-size:12px;color:#687585}.template-picker select{width:235px;font-weight:650}.one-page .profile-photo{width:24mm;height:32mm}.one-page .identity-table .name-row td,.one-page .identity-table .name-row th{height:17mm}.one-page .identity-table tr:not(.name-row) td,.one-page .identity-table tr:not(.name-row) th{height:8.2mm}.one-page .identity-table th,.one-page .history-heading td,.one-page .narrative-table th{background:#f4f4f5}.one-page .one-history{margin-top:3mm}.one-page .history-table td{height:7.6mm}.one-page .one-narrative{margin-top:3mm}.one-page .one-narrative .detail-box{height:35mm}.one-page .one-narrative .wish-box{height:23mm}
@media(max-width:600px){.template-picker{align-items:stretch;flex-direction:column}.template-picker select{width:100%}}
/* Shared print refinements: visual hierarchy without relying on browser background settings. */
.identity-table th,.history-heading td,.narrative-table th{background:#f1f3f5!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.paper-note{display:none}.resume-paper{font-size:10pt}.identity-table th{font-size:9pt}.identity-table th span{font-size:7.6pt}.furigana{font-size:8pt}.profile-name{font-size:18pt;font-weight:600;letter-spacing:.08em;text-align:center}.history-table,.narrative-table{font-size:9.7pt}.history-table td{height:7.5mm}.photo-cell{border:0!important;background:transparent!important}.address-kana{font-size:8pt}.address-kana-row td,.address-kana-row th{height:6.5mm!important}.paper-page{padding-left:14mm;padding-right:14mm;height:auto;min-height:0;break-after:auto;page-break-after:auto}.paper-page + .paper-page{break-before:page;page-break-before:always}.paper-page:nth-child(2) > .history-table:not(.license-table){display:none}.resume-paper:not(.one-page) .paper-page,.one-page .paper-page{display:block}.resume-paper:not(.one-page) .history-first,.resume-paper:not(.one-page) .paper-page:last-child .narrative-table,.one-page .one-narrative{flex:none}.one-page .identity-table tr:last-of-type th:first-child{font-size:0}.one-page .identity-table tr:last-of-type th:first-child::after{content:'連絡先';font-size:9pt}.one-page .history-table,.one-page .license-table{flex:0 0 auto}.one-page .one-narrative .detail-box{height:39mm}.one-page .one-narrative .wish-box{height:28mm}
@media print{body{background:#fff}.app-header,.no-print,.form-panel,.preview-toolbar{display:none!important}.app-shell{padding:0;margin:0;max-width:none}.editor-layout{display:block}.preview-panel{display:block;position:static}.preview-frame{height:auto;border:0;padding:0;background:#fff;overflow:visible}.resume-paper{transform:none!important;margin:0!important;width:210mm;min-height:0;padding:0}.paper-page{height:auto;min-height:0;padding:10mm 14mm 8mm;break-after:auto;page-break-after:auto}.paper-page + .paper-page{break-before:page;page-break-before:always}@page{size:A4;margin:0}}

/* Refined resume layouts: restrained line hierarchy, fixed information grid, and semantic dotted rules. */
.template-v2{font-family:"Yu Mincho","Hiragino Mincho ProN",serif;font-size:9.2pt;color:#111}.template-v2 .paper-page{padding:13mm 16mm 10mm;min-height:0}.template-v2 .refined-heading{height:14mm;margin:0}.template-v2 .paper-title{font-size:17pt;letter-spacing:.28em;margin:0;font-weight:500}.template-v2 .paper-date{margin:-6mm 0 0;font-family:"Yu Gothic",Meiryo,sans-serif;font-size:8.5pt}.template-v2 .resume-table{font-family:"Yu Gothic",Meiryo,sans-serif}.template-v2 .resume-table th,.template-v2 .resume-table td{border:.45mm solid #20252b;padding:1.3mm 1.8mm}.template-v2 .refined-identity{margin-top:2mm;font-size:8.8pt}.template-v2 .refined-identity .label-col{width:20mm}.template-v2 .refined-identity .main-col{width:67mm}.template-v2 .refined-identity .small-col{width:20mm}.template-v2 .refined-identity .photo-col{width:31mm}.template-v2 .refined-identity th{font-weight:500;text-align:center;background:#f4f5f6!important}.template-v2 .refined-identity .kana-row th,.template-v2 .refined-identity .kana-row td,.template-v2 .refined-identity .address-kana-row th,.template-v2 .refined-identity .address-kana-row td{border-bottom:.35mm dotted #77808a!important}.template-v2 .refined-identity .kana-row td,.template-v2 .refined-identity .address-kana-row td{font-size:7.7pt;letter-spacing:.08em}.template-v2 .refined-identity .kana-row td,.template-v2 .refined-identity .address-kana-row td,.template-v2 .refined-identity .address-row td,.template-v2 .refined-identity .contact-row td{text-align:left}.template-v2 .refined-identity .name-row th,.template-v2 .refined-identity .name-row td{height:22mm}.template-v2 .refined-identity .profile-name{font-size:17pt;letter-spacing:.08em;font-weight:500;text-align:center!important}.template-v2 .refined-identity .birth-row td{white-space:nowrap}.template-v2 .refined-identity .address-row th,.template-v2 .refined-identity .address-row td{height:17mm;vertical-align:middle}.template-v2 .refined-identity .contact-row th,.template-v2 .refined-identity .contact-row td{height:13mm}.template-v2 .refined-identity .photo-cell{border:0!important;padding:0!important;text-align:right!important;vertical-align:top!important}.template-v2 .refined-identity .photo-cell .profile-photo{width:29mm;height:38mm;margin:0 0 0 auto;object-fit:cover}.template-v2 .right-contact{font-size:7.4pt;line-height:1.35;text-align:left!important}.template-v2 .right-contact span{display:block;font-size:7pt;font-weight:600;margin-bottom:.8mm}.template-v2 .muted-contact{color:#4d5560}.template-v2 .refined-table{margin-top:5mm;font-size:8.9pt}.template-v2 .refined-table .year{width:18mm;text-align:center}.template-v2 .refined-table .month{width:10mm;text-align:center}.template-v2 .refined-table .history-heading td{height:7mm;font-weight:600;letter-spacing:.08em;text-align:center;background:#eef0f2!important}.template-v2 .refined-table .category-row td{height:6.5mm;text-align:center;background:#fff!important;font-weight:600}.template-v2 .refined-table .record-row td{height:7.8mm}.template-v2 .refined-table .record-row td:nth-child(-n+2){text-align:center}.template-v2 .refined-table .end-row td{height:6.5mm;text-align:right;padding-right:3mm}.template-v2 .license-table{margin-top:0}.template-v2 .refined-narrative{margin-top:6mm;font-size:8.7pt}.template-v2 .refined-narrative th{height:6.5mm;text-align:left;font-weight:500;background:#eef0f2!important}.template-v2 .refined-narrative td{white-space:pre-wrap;vertical-align:top!important;line-height:1.55}.template-v2 .motivation-box,.template-v2 .pr-box{height:40mm}.template-v2 .request-box{height:28mm}.template-v2.one-page .paper-page{padding-top:11mm}.template-v2.one-page .refined-heading{height:12mm}.template-v2.one-page .refined-identity{font-size:8.2pt;margin-top:1.5mm}.template-v2.one-page .refined-identity .name-row th,.template-v2.one-page .refined-identity .name-row td{height:16mm}.template-v2.one-page .refined-identity .profile-name{font-size:14.5pt}.template-v2.one-page .refined-identity .address-row th,.template-v2.one-page .refined-identity .address-row td{height:13mm}.template-v2.one-page .refined-identity .contact-row th,.template-v2.one-page .refined-identity .contact-row td{height:10mm}.template-v2.one-page .refined-identity .photo-cell .profile-photo{width:24mm;height:31mm}.template-v2.one-page .refined-table{margin-top:3.5mm;font-size:8pt}.template-v2.one-page .refined-table .history-heading td{height:6mm}.template-v2.one-page .refined-table .record-row td{height:6.7mm}.template-v2.one-page .license-table{margin-top:3.5mm}.template-v2.one-page .refined-narrative{margin-top:3.5mm;font-size:7.8pt}.template-v2.one-page .refined-narrative th{height:5.5mm}.template-v2.one-page .summary-box{height:38mm}.template-v2.one-page .request-box{height:25mm}
@media print{.template-v2 .paper-page{padding:13mm 16mm 10mm}.template-v2 .paper-page + .paper-page{break-before:page;page-break-before:always}}

/* Contact details and typography alignment refinements. */
.template-v2 .refined-identity .contact-kana-row th,.template-v2 .refined-identity .contact-kana-row td{border-bottom:.35mm dotted #77808a!important}.template-v2 .refined-identity .contact-kana-row td{font-size:7.7pt;letter-spacing:.08em;text-align:left}.template-v2 .refined-identity .kana-row td{text-align:center!important}.template-v2 .refined-identity .birth-row th,.template-v2 .refined-identity .birth-row td{text-align:center!important}.template-v2 .refined-identity .email-row th,.template-v2 .refined-identity .email-row td{height:8.5mm}.template-v2 .refined-identity .email-row td{text-align:left}.template-v2.one-page .refined-identity .email-row th,.template-v2.one-page .refined-identity .email-row td{height:7mm}.template-v2.one-page .refined-identity .contact-kana-row td{font-size:7pt}

/* Two-page standard layout based on the supplied black-and-white reference. */
.inline-fields{display:flex;align-items:center;gap:7px}.inline-fields input{width:76px}.source-template{font-family:"Yu Mincho","Hiragino Mincho ProN",serif;color:#111;font-size:9.5pt}.source-template .paper-page{padding:12mm 13mm 8mm;min-height:0}.source-template .paper-page + .paper-page{break-before:page;page-break-before:always}.source-header{height:22mm;position:relative}.source-header h1{font-size:23pt;letter-spacing:.34em;font-weight:500;margin:0}.source-header p{position:absolute;right:42mm;bottom:2mm;margin:0;font-size:10pt;letter-spacing:.12em}.source-personal{position:relative}.source-photo{position:absolute;right:8mm;top:-18mm;width:30mm;height:40mm}.source-photo img{display:block;width:100%;height:100%;object-fit:cover}.source-name-table,.source-contact-table,.source-grid{width:100%;border-collapse:collapse;table-layout:fixed}.source-name-table{width:76%;font-size:10pt}.source-name-table th,.source-name-table td,.source-contact-table th,.source-contact-table td,.source-grid td{border:.45mm solid #111;padding:1.1mm 1.7mm;vertical-align:middle}.source-name-table th:first-child{width:24mm;text-align:left;font-weight:500}.source-name-table th:last-child{width:27mm;text-align:left;font-weight:500}.source-name-table .source-kana th,.source-name-table .source-kana td{height:7mm;border-bottom:.35mm dotted #555!important}.source-name-table .source-kana+tr th,.source-name-table .source-kana+tr td{border-top:0}.source-name-table tr:last-child th,.source-name-table tr:last-child td{height:22mm}.source-name{font-size:22pt;letter-spacing:.14em;text-align:center}.source-gender{font-size:15pt;text-align:center}.source-contact-table{margin-top:0;font-size:9.5pt}.source-contact-table th{width:24mm;text-align:left;font-weight:500}.source-contact-table td{white-space:pre-wrap}.source-contact-table tr:first-child th,.source-contact-table tr:first-child td{height:8mm}.source-contact-table .source-kana th,.source-contact-table .source-kana td{height:6.5mm;border-bottom:.35mm dotted #555!important}.source-contact-table .source-kana+tr th,.source-contact-table .source-kana+tr td{border-top:0}.source-contact-table tr:nth-child(3) th,.source-contact-table tr:nth-child(3)>td,.source-contact-table tr:nth-child(5) th,.source-contact-table tr:nth-child(5)>td{height:22mm}.source-birth{text-align:center;font-size:11pt;letter-spacing:.11em}.source-phone{width:39mm;font-size:9pt;line-height:1.45;text-align:left!important}.source-phone span{display:block;border-bottom:.35mm dotted #555;margin:-1.1mm -1.7mm 1mm;padding:1mm 1.7mm .7mm}.source-contact-table small{float:right;font-size:7.2pt}.source-grid{margin:0;font-size:10pt}.source-grid td{height:8.1mm}.source-grid .year{width:34mm;text-align:center;border-right:.35mm dotted #555!important}.source-grid .month{width:15mm;text-align:center;border-left:0!important;border-right:.35mm dotted #555!important}.source-grid td:nth-child(3){border-left:0!important}.source-grid-heading td{height:8mm;text-align:center;font-weight:500}.source-category td{height:7mm;text-align:center;font-size:11pt}.source-end td{height:7mm;text-align:right;padding-right:4mm}.source-history{margin-top:0}.source-continuation{margin-top:0}.source-license{margin-top:0}.source-details{display:grid;grid-template-columns:1.1fr 1fr;border:.45mm solid #111;border-bottom:0}.source-summary{min-height:62mm;border-right:.45mm solid #111}.source-summary h2,.source-wishes h2{margin:0;padding:1.5mm 1.8mm;font-size:10pt;font-weight:500}.source-summary p,.source-wishes p{margin:0;padding:4mm;font-size:11pt;line-height:1.7;white-space:pre-wrap}.source-facts>div{min-height:20.5mm;border-bottom:.45mm solid #111;padding:1.5mm 2mm;display:flex;flex-direction:column;justify-content:space-between}.source-facts span{font-size:9pt}.source-facts strong{font-size:13pt;font-weight:500;text-align:center}.source-facts .fact-pair{padding:0;display:grid;grid-template-columns:1fr 1fr}.fact-pair>div{padding:1.5mm 2mm;display:flex;flex-direction:column;justify-content:space-between}.fact-pair>div+div{border-left:.45mm solid #111}.source-wishes{border:.45mm solid #111;min-height:50mm}.source-wishes h2{border-bottom:.45mm solid #111}.source-wishes p{min-height:38mm}
@media print{.source-template .paper-page{padding:12mm 13mm 8mm}.source-template .paper-page + .paper-page{break-before:page;page-break-before:always}}

/* Page-fit controls and compact variant sharing the standard personal-information block. */
.source-template .source-continuation,.source-template .source-license,.source-template .source-details,.source-template .source-wishes{break-inside:avoid;page-break-inside:avoid}.source-one-page .paper-page{padding-top:10mm}.source-one-page .source-header{height:15mm}.source-one-page .source-header h1{font-size:18pt}.source-one-page .source-header p{right:31mm;bottom:1mm;font-size:8pt}.source-personal-compact .source-photo{width:24mm;height:31mm;right:7mm;top:-12mm}.source-personal-compact .source-name-table{font-size:8.3pt}.source-personal-compact .source-name-table th:first-child{width:20mm}.source-personal-compact .source-name-table th:last-child{width:23mm}.source-personal-compact .source-name-table .source-kana th,.source-personal-compact .source-name-table .source-kana td{height:5mm}.source-personal-compact .source-name-table tr:last-child th,.source-personal-compact .source-name-table tr:last-child td{height:14mm}.source-personal-compact .source-name{font-size:15pt}.source-personal-compact .source-gender{font-size:10pt}.source-personal-compact .source-contact-table{font-size:7.8pt}.source-personal-compact .source-contact-table th{width:20mm}.source-personal-compact .source-contact-table tr:first-child th,.source-personal-compact .source-contact-table tr:first-child td{height:5.5mm}.source-personal-compact .source-contact-table .source-kana th,.source-personal-compact .source-contact-table .source-kana td{height:4.5mm}.source-personal-compact .source-contact-table tr:nth-child(3) th,.source-personal-compact .source-contact-table tr:nth-child(3)>td,.source-personal-compact .source-contact-table tr:nth-child(5) th,.source-personal-compact .source-contact-table tr:nth-child(5)>td{height:11mm}.source-personal-compact .source-birth{font-size:8.5pt}.source-personal-compact .source-phone{font-size:7.2pt}.source-personal-compact .source-phone span{font-size:6.8pt}.source-personal-compact .source-contact-table small{font-size:6.2pt}.source-one-page .source-grid{font-size:7.8pt}.source-one-page .source-grid td{height:6.2mm}.source-one-page .source-grid-heading td{height:6mm}.source-one-page .source-grid .year{width:18mm}.source-one-page .source-grid .month{width:9mm}.source-one-page .source-license{margin-top:3mm}.source-one-narrative{margin-top:3mm;border:.45mm solid #111;font-family:"Yu Gothic",Meiryo,sans-serif}.source-one-narrative h2{margin:0;padding:1.4mm 1.8mm;border-bottom:.45mm solid #111;background:#f1f3f5;font-size:8pt;font-weight:500}.source-one-narrative p{margin:0;padding:2.5mm 2mm;min-height:24mm;white-space:pre-wrap;font-size:8pt;line-height:1.45}.source-one-narrative p:last-child{min-height:17mm}
@media print{.source-one-page .paper-page{padding-top:10mm}}

/* Final print-balance refinements. */
.source-name-table .source-kana td{text-align:center;letter-spacing:.18em;padding-left:1.7mm;padding-right:1.7mm}
.source-one-page .source-one-history{margin-top:3.8mm}
.source-template .source-page-two{padding-top:14mm!important}
.source-page-two.has-continuation .source-license{margin-top:4mm}
.source-page-two .source-details{margin-top:5mm}
.source-page-two .source-wishes{margin-top:4mm}
.source-page-two.starts-with-license .source-summary{min-height:97mm}
.source-page-two.starts-with-license .source-facts>div{min-height:31mm}
.source-page-two.starts-with-license .source-wishes{min-height:100mm}
.source-page-two.starts-with-license .source-wishes p{min-height:85mm}
.source-page-two .source-facts strong:empty{display:none}
@media print{.source-template .source-page-two{padding-top:14mm!important}}

/* Print rule hierarchy: frame, internal grid, and writing guides. */
.source-template{--rule-frame:.45mm;--rule-grid:.22mm;--rule-guide:.20mm;--ink:#171717;--guide:#777}
.source-template .source-name-table,.source-template .source-contact-table,.source-template .source-grid{outline:var(--rule-frame) solid var(--ink);outline-offset:0}
.source-template .source-name-table th,.source-template .source-name-table td,.source-template .source-contact-table th,.source-template .source-contact-table td,.source-template .source-grid td{border:var(--rule-grid) solid var(--ink)}
.source-template .source-name-table .source-kana th,.source-template .source-name-table .source-kana td,.source-template .source-contact-table .source-kana th,.source-template .source-contact-table .source-kana td{border-bottom:var(--rule-guide) dotted var(--guide)!important}
.source-template .source-name-table .source-kana+tr th,.source-template .source-name-table .source-kana+tr td,.source-template .source-contact-table .source-kana+tr th,.source-template .source-contact-table .source-kana+tr td{border-top:0}
.source-template .source-phone span{border-bottom:var(--rule-guide) dotted var(--guide)}
.source-template .source-grid .year{border-right:var(--rule-guide) dotted var(--guide)!important}
.source-template .source-grid .month{border-left:0!important;border-right:var(--rule-guide) dotted var(--guide)!important}
.source-template .source-grid td:nth-child(3){border-left:0!important}
.source-template .source-grid-heading td{border-bottom:.32mm solid var(--ink)}
.source-template .source-details{border:var(--rule-frame) solid var(--ink)}
.source-template .source-summary{border-right:var(--rule-grid) solid var(--ink)}
.source-template .source-facts>div{border-bottom:var(--rule-grid) solid var(--ink)}
.source-template .source-facts>div:last-child{border-bottom:0}
.source-template .fact-pair>div+div{border-left:var(--rule-grid) solid var(--ink)}
.source-template .source-wishes,.source-one-page .source-one-narrative{border:var(--rule-frame) solid var(--ink)}
.source-template .source-wishes h2,.source-one-page .source-one-narrative h2{border-bottom:var(--rule-grid) solid var(--ink)}

/* A4 pagination uses the same unscaled geometry on screen and in print. */
.print-measure{position:absolute;left:-20000px;top:0;visibility:hidden;width:210mm;pointer-events:none}
.paginated-paper{width:210mm;min-height:0;transform:none!important;padding:0;margin:0!important}
.paginated-paper .paper-page,.paginated-paper .paper-page.source-page-two{width:210mm;height:297mm;min-height:297mm;padding:14mm 16mm!important;break-after:page;break-before:auto;page-break-before:auto;page-break-after:always;overflow:visible}
.paginated-paper .paper-page:last-child{break-after:auto;page-break-after:auto}
.paginated-paper .page-content{height:269mm;display:flow-root}
.paginated-paper.source-one-page .paper-page{padding:12mm 16mm!important}
.paginated-paper.source-one-page .page-content{height:273mm}
.paginated-paper .source-grid{margin-top:4mm;font-size:10pt}
.paginated-paper .source-grid td{height:8mm;overflow-wrap:anywhere}
.paginated-paper.source-one-page .source-grid{font-size:9pt;margin-top:3mm}
.paginated-paper.source-one-page .source-grid td{height:6mm;padding:.8mm 1.3mm}
.paginated-paper .source-grid .year{width:26mm;white-space:nowrap;overflow-wrap:normal}
.paginated-paper .source-grid .month{width:14mm;white-space:nowrap;overflow-wrap:normal}
.paginated-paper .source-category td{height:6mm;font-size:10pt}
.paginated-paper .source-end td{height:6mm}
.print-narrative{border:.45mm solid #171717;margin-top:4mm;break-inside:avoid}
.print-narrative h2{font-size:10pt;font-weight:500;line-height:1.4;padding:1.4mm 2mm;margin:0;border-bottom:.22mm solid #171717;background:#f1f3f5;print-color-adjust:exact}
.print-narrative p{font-size:10.5pt;line-height:1.65;padding:2.5mm 3mm;margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
.source-one-page .print-narrative{margin-top:3mm}
.source-one-page .print-narrative h2{font-size:9pt;padding:1mm 2mm}
.source-one-page .print-narrative p{font-size:9pt;line-height:1.45;padding:2mm}
.print-facts{margin-top:4mm;border:.45mm solid #171717}
.print-facts .source-facts{display:grid;grid-template-columns:1fr 1fr 1.4fr}
.print-facts .source-facts>div{min-height:16mm;border:0;padding:2mm}
.print-facts .source-facts>div+div{border-left:.22mm solid #171717}
.print-facts .source-facts .fact-pair{padding:0}
.print-facts .source-facts strong{font-size:10pt;overflow-wrap:anywhere}
.print-confirm{max-width:560px;width:calc(100% - 32px);border:1px solid var(--line);border-radius:12px;padding:24px;color:var(--ink)}
.print-confirm::backdrop{background:#142a4366}.print-confirm h2{font-size:21px}.print-confirm button{margin:6px 6px 0 0}
@media print{.print-measure,.print-confirm{display:none!important}.preview-panel{margin:0!important}.preview-frame{max-height:none!important}.paginated-paper .paper-page+.paper-page{break-before:auto;page-break-before:auto}.paginated-paper .paper-page{box-shadow:none;margin:0!important;height:296.5mm;min-height:296.5mm}.page-content{overflow:visible}}

/* Three rule roles, shared by both templates. */
.paginated-paper{--rule-frame:.42mm;--rule-grid:.22mm;--rule-guide:.25mm;--guide:#555}
.paginated-paper .source-name-table,.paginated-paper .source-contact-table,.paginated-paper .source-grid{outline:0;border:var(--rule-frame) solid var(--ink)}
.paginated-paper .source-name-table th,.paginated-paper .source-name-table td,.paginated-paper .source-contact-table th,.paginated-paper .source-contact-table td{overflow-wrap:anywhere}
.paginated-paper .source-name-table .source-kana th:last-child{border-bottom:0!important}
.paginated-paper .source-name-table .source-kana td,.paginated-paper .source-name-table .source-kana th:first-child,.paginated-paper .source-contact-table .source-kana td:not(.source-phone),.paginated-paper .source-contact-table .source-kana th{border-bottom:.25mm dotted #555!important}
.paginated-paper .source-phone span{border-bottom:.25mm dotted #555}
.paginated-paper .source-grid .year,.paginated-paper .source-grid .month{border-right:.25mm dotted #555!important}
.paginated-paper .source-name-table{width:77%}
.paginated-paper .source-name-table th:first-child{width:21mm;text-align:center}
.paginated-paper .source-name-table th:last-child{width:20mm;text-align:center}
.paginated-paper .source-contact-table th{text-align:center}
.paginated-paper .source-contact-table .source-kana td{font-size:9pt}
.paginated-paper .source-contact-table small{display:block;float:none;font-size:7pt;margin-bottom:1mm}
.paginated-paper .source-phone{width:41mm;word-break:normal;overflow-wrap:anywhere}
.paginated-paper .source-grid-heading td{background:#f1f3f5;print-color-adjust:exact;font-size:9.5pt;letter-spacing:.04em}
.paginated-paper .source-photo{right:2mm;top:-18mm}
.paginated-paper.source-one-page .source-photo{right:2mm;top:-12mm}
.paginated-paper.source-one-page .source-contact-table{font-size:8.5pt}
.paginated-paper.source-one-page .source-contact-table .source-kana td{font-size:8pt}
.paginated-paper.source-one-page .source-birth{font-size:9pt;letter-spacing:.04em}
.paginated-paper.source-one-page .source-grid-heading td{font-size:9pt}
.paginated-paper .source-contact-table th{width:21mm}
.paginated-paper .source-name-table{border-bottom:0}
.paginated-paper .source-name-table tr:last-child th,.paginated-paper .source-name-table tr:last-child td{border-bottom:0}

/* Explicit 1.1mm dot pitch remains distinguishable when the page is reduced. */
.paginated-paper .source-name-table .source-kana th:first-child,.paginated-paper .source-name-table .source-kana td,.paginated-paper .source-contact-table .source-kana th,.paginated-paper .source-contact-table .source-kana td:not(.source-phone),.paginated-paper .source-phone span{position:relative;border-bottom:0!important}
.paginated-paper .source-grid .year,.paginated-paper .source-grid .month{position:relative;border-right:0!important}
.guide-svg{position:absolute;left:0;bottom:0;width:100%;height:.25mm;overflow:visible;pointer-events:none}
.guide-svg.vertical{left:auto;right:0;top:0;bottom:0;width:.25mm;height:100%}

/* Responsive editing and a screen-only zoom surface. */
.app-shell{max-width:1440px}.editor-layout{grid-template-columns:minmax(0,1fr) minmax(420px,1.05fr)}
.form-panel,.preview-panel,.photo-control,.field,.entry-grid{min-width:0}
.entry-grid{grid-template-columns:90px 66px minmax(0,1fr)}
.entry-actions{grid-column:1/-1;justify-content:flex-end;gap:8px}
.icon-button{min-height:44px;padding:8px 12px;font:inherit;font-size:13px}
.icon-button:disabled{opacity:.4;cursor:default}
.button:disabled{opacity:.5;cursor:not-allowed}
.icon-button.danger,.button.danger{color:#a12929;border:1px solid #e2bcbc;background:#fff8f8}
.toolbar-group .danger{margin-left:8px}.button{min-height:44px}
.photo-control input[type=file]{width:100%}.inline-fields{flex-wrap:wrap}.inline-fields input{width:62px}
.preview-toolbar{flex-wrap:wrap;gap:10px;position:static}
.preview-toolbar strong{font-size:16px}.preview-toolbar [data-action=print]{background:#1b5d91}
.preview-controls{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:8px 0 12px;font-size:13px}
.preview-controls .button{font-size:13px;padding:8px 10px;text-decoration:none}
.preview-controls button[aria-pressed=true]{background:#e8f0f7;border-color:#1b5d91}
.preview-frame{height:740px;max-height:none;padding:12px;overflow:auto;overscroll-behavior:contain}
.preview-viewport{position:relative;flex:none;margin:0 auto}
#preview .paginated-paper{transform:scale(var(--screen-scale,1))!important;transform-origin:top left}
#preview .paper-page{box-shadow:0 2px 5px #142a4333}
.pdf-check{border:1px solid #cbded0;background:#f5faf6;border-radius:8px;font-size:13px;padding:12px;margin-bottom:12px;overflow-wrap:anywhere}
.pdf-check p{margin:6px 0 0}.pdf-check.has-warning{border-color:#ddc7a5;background:#fffaf0}
.template-description{margin-top:-6px;font-size:13px;line-height:1.6}
.field-error{color:#9a4a00;font-size:12px;overflow-wrap:anywhere}
input[aria-invalid=true]{border-color:#b56820}
@media(max-width:1100px){.editor-layout{grid-template-columns:minmax(0,1fr) minmax(380px,1fr);gap:18px}.form-panel{padding:20px}.toolbar{align-items:flex-start}.toolbar-group{justify-content:flex-end}}
@media(max-width:900px){.editor-layout{display:block}.preview-panel{position:static}.preview-frame{height:660px;max-height:660px}.app-shell{padding:22px 14px 40px}}
@media(max-width:600px){
 body{font-size:16px}.app-header{padding:0 14px}.app-shell{padding:18px 12px 36px}.form-panel{padding:16px}
 .toolbar{flex-direction:column;align-items:stretch;gap:12px}.toolbar-group{display:grid;grid-template-columns:1fr 1fr;gap:8px}.toolbar-group .button{padding:10px 8px;font-size:13px}.toolbar-group .danger{grid-column:1/-1;margin:0}
 .photo-box{width:78px;height:104px;flex-shrink:0}.photo-row{gap:10px}.photo-control label{font-size:13px}.photo-control input{font-size:13px;padding:8px}
 .entry{padding:12px;background:#f8fafc}.entry-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}
 .entry-grid>.field:nth-child(3){grid-column:1/-1}.entry-actions{grid-column:1/-1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.icon-button{padding:8px 4px;font-size:13px}
 input,textarea,select{font-size:16px;width:100%}.inline-fields input{width:62px}.field label{font-size:13px}
 .preview-toolbar{gap:10px}.preview-toolbar strong{width:100%}.preview-toolbar [data-action=print]{width:100%}
 .preview-frame{height:570px;max-height:570px}.grid{grid-template-columns:minmax(0,1fr)}
}
@media print{.preview-controls,.pdf-check{display:none!important}.preview-viewport{display:contents!important;width:auto!important;height:auto!important}#preview .paginated-paper{transform:none!important}.preview-panel{margin:0!important}.preview-frame{height:auto!important;max-height:none!important;overflow:visible!important;padding:0}.paginated-paper .paper-page{box-shadow:none!important}.app-shell{max-width:none}}

/* Leave 1mm for browser A4 rounding; content and measurement share this budget. */
.paginated-paper .paper-page{height:296mm;min-height:296mm}
.paginated-paper .page-content{height:268mm}
.paginated-paper.source-one-page .page-content{height:272mm}
@media print{.app-shell{padding:0!important;margin:0!important}.paginated-paper .paper-page{height:296mm;min-height:296mm;overflow:visible}.preview-frame{box-shadow:none!important}}

/* Editing UI only: no selectors here target the paper or print geometry. */
@media screen{
 .toolbar{align-items:flex-start}.data-management{min-width:0;max-width:620px}
 .data-management h2{font-size:14px;margin:0 0 4px}.data-management .hint{margin:4px 0;font-size:12px}
 .data-management .toolbar-group{justify-content:flex-start}.data-management .button{font-size:13px}
 .data-deletion{margin-top:12px;padding-top:10px;border-top:1px solid var(--line);text-align:right}
 .data-deletion .button{font-size:12px}
 .section-navigation{display:flex;align-items:center;flex-wrap:wrap;gap:8px 16px;margin:0 0 18px;padding:10px 14px;border:1px solid var(--line);border-radius:8px;background:#fff}
 .section-navigation>label{font-size:13px;font-weight:650;white-space:nowrap}
 .section-navigation-links{display:flex;flex-wrap:wrap;gap:4px 14px}.section-navigation-links a{color:var(--blue);font-size:13px;text-underline-offset:3px;padding:5px 0}
 .section-navigation select{display:none}.editor-destination{scroll-margin-top:80px}
 .editor-destination:focus-visible{outline:2px solid var(--blue);outline-offset:4px}
}
@media screen and (min-width:901px) and (max-width:1100px){
 .form-panel .entry-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 .form-panel .entry-grid>.field:nth-child(3){grid-column:1/-1}
}
@media screen and (max-width:600px){
 .data-management{max-width:none;width:100%}.data-management .toolbar-group{grid-template-columns:minmax(0,1fr)}
 .data-deletion{text-align:left}.data-deletion .button{width:100%}
 .section-navigation{gap:6px;padding:10px 12px}.section-navigation-links{display:none}
 .section-navigation select{display:block;min-width:0;width:100%;min-height:44px}
}
