@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Noto+Sans+JP:wght@400;500;600;700&display=swap');

:root{font-family:"DM Sans","Noto Sans JP",system-ui,sans-serif;color:#273330;background:#f6f7f5;font-synthesis:none;text-rendering:optimizeLegibility;--ink:#273330;--muted:#78837f;--line:#e3e8e4;--green:#286858;--green-dark:#1d5245;--mint:#e8f1ec;--paper:#fff;--shadow:0 12px 36px rgba(38,58,50,.09)}
*{box-sizing:border-box}body{margin:0;min-width:320px;min-height:100vh;background:radial-gradient(ellipse at 8% 0%,#edf3ee 0,transparent 33rem),#f6f7f5}button,input,textarea,select{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.48}button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:3px solid #9bcaba;outline-offset:2px}.topbar{height:78px;padding:0 clamp(18px,5vw,76px);display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid rgba(221,229,223,.8);background:rgba(255,255,255,.72);backdrop-filter:blur(14px)}.brand{display:flex;align-items:center;gap:12px;color:var(--ink);text-decoration:none}.brand-mark{display:grid;place-items:center;width:42px;height:42px;border-radius:14px;background:var(--green);color:white;font-family:"Noto Sans JP",sans-serif;font-weight:700;box-shadow:0 5px 12px #28685833}.brand strong{display:block;font-size:15px;letter-spacing:.04em}.brand small{display:block;margin-top:2px;color:#91a09a;font-size:9px;letter-spacing:.15em}.top-actions{display:flex;align-items:center;gap:12px}.connection-status{font-size:12px;color:var(--muted)}.connection-status.connected{color:var(--green);font-weight:600}.icon-button{width:38px;height:38px;display:grid;place-items:center;border:1px solid var(--line);border-radius:12px;background:white;color:#66736e;font-size:20px}.button{min-height:42px;padding:0 17px;display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid transparent;border-radius:12px;font-size:13px;font-weight:600;transition:transform .15s,background .15s,border-color .15s}.button:not(:disabled):hover{transform:translateY(-1px)}.button-primary{background:var(--green);color:white;box-shadow:0 5px 14px #28685828}.button-primary:not(:disabled):hover{background:var(--green-dark)}.button-quiet{background:#fff;color:#5f6b66;border-color:var(--line)}.button-outline{background:#fff;color:var(--green);border-color:#bcd3c9}.button-outline:hover{background:#f3f8f4}.button-soft{background:#eef5f0;color:var(--green);border-color:#dfebe2}.page-shell{width:min(1120px,calc(100% - 48px));margin:0 auto;padding:68px 0 84px}.intro-row{display:flex;align-items:flex-end;justify-content:space-between;gap:24px}.eyebrow{margin:0 0 12px;color:#8a9b92;font-size:10px;font-weight:700;letter-spacing:.18em}.intro-row h1{margin:0;font-family:"Noto Sans JP",sans-serif;font-size:clamp(25px,4vw,36px);font-weight:600;letter-spacing:.01em}.intro-copy{margin:12px 0 0;color:#74807b;font-size:14px}.intro-row .button{min-width:140px;height:48px}.intro-row .button span{font-size:18px}.toolbar{display:flex;align-items:center;justify-content:space-between;gap:18px;margin:40px 0 24px}.search-box{width:min(460px,100%);height:46px;display:flex;align-items:center;gap:10px;padding:0 14px;border:1px solid var(--line);border-radius:14px;background:white;color:#95a19b}.search-box>span{font-size:22px}.search-box input{width:100%;border:0;outline:0;background:transparent;color:var(--ink);font-size:13px}.search-box input::placeholder{color:#a5afaa}.card-count{color:#8c9792;font-size:12px}.empty-state{min-height:330px;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:30px;border:1px dashed #d7e1da;border-radius:22px;background:#ffffff8c;text-align:center}.empty-state h2{margin:22px 0 7px;font-family:"Noto Sans JP",sans-serif;font-size:18px;font-weight:600}.empty-state p{max-width:430px;margin:0 0 22px;color:#7d8882;font-size:13px;line-height:1.8}.empty-illustration{position:relative;width:116px;height:78px;display:grid;place-items:center;transform:rotate(-6deg)}.empty-illustration span{z-index:2;width:92px;height:58px;display:grid;place-items:center;border:1px solid #d9e7de;border-radius:8px;background:#fff;color:var(--green);font-size:14px;font-weight:700;box-shadow:0 8px 20px #244d3917}.empty-illustration i,.empty-illustration b{position:absolute;width:78px;height:48px;border:1px solid #dce8df;border-radius:7px;background:#f5faf6}.empty-illustration i{left:2px;bottom:2px;transform:rotate(-14deg)}.empty-illustration b{right:1px;top:1px;transform:rotate(14deg)}.card-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.contact-card{overflow:hidden;border:1px solid #e5eae6;border-radius:17px;background:white;box-shadow:0 4px 16px #263a3210;transition:transform .18s,box-shadow .18s}.contact-card:hover{transform:translateY(-3px);box-shadow:var(--shadow)}.contact-card-image{height:172px;display:grid;place-items:center;overflow:hidden;background:#eef2ee;border-bottom:1px solid #edf0ed}.contact-card-image img{width:100%;height:100%;object-fit:contain}.image-fallback{color:#9aa69f;font-size:12px}.contact-card-body{padding:16px 17px 18px}.contact-card h3{margin:0;font-family:"Noto Sans JP",sans-serif;font-size:16px;font-weight:600}.contact-furigana{margin:4px 0 0;color:#8c9691;font-size:11px}.contact-company{margin:9px 0 0;color:#5c6862;font-size:13px}.tag-list{display:flex;flex-wrap:wrap;gap:6px;margin-top:13px}.tag-chip{padding:4px 8px;border-radius:999px;background:#eff5f0;color:#537368;font-size:10px}.contact-card-date{margin:13px 0 0;color:#9aa39e;font-size:10px}.no-results{text-align:center;color:var(--muted);padding:50px 10px}.page-footer{position:fixed;bottom:0;left:0;width:100%;display:flex;justify-content:space-between;gap:10px;padding:12px clamp(18px,5vw,76px);border-top:1px solid #e9ede9;background:#f8f9f7e8;color:#929d97;font-size:10px;backdrop-filter:blur(10px)}.dialog{width:min(700px,calc(100% - 24px));max-height:min(92vh,920px);padding:0;border:1px solid #e4e9e5;border-radius:20px;background:white;color:var(--ink);box-shadow:0 24px 80px #1e322c38}.dialog::backdrop{background:#18241f77;backdrop-filter:blur(3px)}.dialog-content{padding:25px clamp(18px,4vw,34px) 26px}.dialog-heading{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:22px}.dialog-heading .eyebrow{margin-bottom:5px}.dialog-heading h2{margin:0;font-family:"Noto Sans JP",sans-serif;font-size:22px;font-weight:600}.capture-section{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(190px,.85fr);gap:18px;align-items:center;padding:15px;border:1px solid #e8ede9;border-radius:15px;background:#f8faf8}.capture-preview{position:relative;min-height:190px;display:grid;place-items:center;overflow:hidden;border-radius:10px;background:#e9eeea}.capture-preview>img{position:absolute;width:100%;height:100%;object-fit:contain;background:#e9eeea}.preview-placeholder{display:flex;flex-direction:column;align-items:center;gap:8px;color:#92a098;font-size:11px}.preview-placeholder span:first-child{font-size:30px}.capture-preview video{position:absolute;width:100%;height:100%;object-fit:cover}.camera-guide{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none}.camera-guide span{width:78%;aspect-ratio:1.586;border:2px solid #f8fff0;border-radius:9px;box-shadow:0 0 0 999px #11201944,0 0 9px #10241c80}.camera-guide::before,.camera-guide::after{position:absolute;content:"";width:18px;height:18px;border-color:#d3ff8a;border-style:solid}.camera-guide::before{top:9%;left:8%;border-width:2px 0 0 2px}.camera-guide::after{right:8%;bottom:9%;border-width:0 2px 2px 0}.camera-hint{position:absolute;bottom:9px;left:0;width:100%;margin:0;color:white;text-align:center;font-size:11px;text-shadow:0 1px 4px #000}.capture-actions{display:flex;flex-direction:column;align-items:stretch;gap:9px}.file-button{cursor:pointer}.capture-note{margin:2px 0 0;color:#87928c;font-size:10px;line-height:1.6}.camera-controls,.preview-controls{display:flex;gap:8px}.camera-controls .button,.preview-controls .button{flex:1;padding:0 9px;font-size:11px}.ocr-row{display:flex;justify-content:space-between;align-items:center;gap:14px;margin:19px 0 4px;padding:13px 14px;border-radius:12px;background:#f5f8f5}.ocr-row strong{display:block;font-size:12px}.ocr-row small{display:block;margin-top:4px;color:#8b9690;font-size:10px}.ocr-row .button{min-height:36px;font-size:11px}.inline-message{min-height:18px;margin:0 0 8px;color:#74817b;font-size:11px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px 16px}.field{display:flex;flex-direction:column;gap:7px;min-width:0}.field>span,.phone-fieldset legend{color:#5b6861;font-size:11px;font-weight:600}.field em{margin-left:5px;color:#b1694b;font-size:9px;font-style:normal}.field input,.field textarea,.phone-row input,.phone-row select{width:100%;min-height:42px;padding:10px 11px;border:1px solid #dfe6e1;border-radius:10px;background:white;color:var(--ink);font-size:12px}.field textarea{resize:vertical;line-height:1.6}.field input::placeholder,.field textarea::placeholder{color:#b0b8b3}.phone-fieldset{margin:18px 0 15px;padding:13px 14px 10px;border:1px solid #e6ebe7;border-radius:12px}.phone-fieldset legend{padding:0 5px}.phone-fields{display:flex;flex-direction:column;gap:8px}.phone-row{display:grid;grid-template-columns:130px 1fr 34px;gap:8px}.phone-row select{padding:7px;font-size:11px}.remove-phone{border:0;border-radius:9px;background:#f8efec;color:#aa6f5b;font-size:17px}.text-button{margin-top:10px;padding:4px 0;border:0;background:none;color:var(--green);font-size:11px;font-weight:600}.form-grid-bottom{margin-top:17px}.field-full{grid-column:1/-1}.field>span small{margin-left:5px;color:#9ba59f;font-weight:400;font-size:9px}.form-error{min-height:18px;margin:10px 0;color:#b44c45;font-size:11px}.dialog-footer{display:flex;justify-content:flex-end;gap:9px;padding-top:13px;border-top:1px solid #edf0ed}.dialog-footer .button{min-width:100px}.settings-dialog{width:min(490px,calc(100% - 24px))}.settings-copy{margin:0 0 20px;color:#6f7b75;font-size:12px;line-height:1.8}.detail-dialog{width:min(600px,calc(100% - 24px))}.detail-image{width:100%;max-height:300px;object-fit:contain;border-radius:12px;background:#eff2ef}.detail-heading{display:flex;justify-content:space-between;gap:12px;margin:19px 0}.detail-heading h2{margin:0;font-size:22px}.detail-heading p{margin:5px 0 0;color:#7d8982;font-size:12px}.detail-meta{display:grid;grid-template-columns:120px 1fr;gap:12px 10px;margin:0;font-size:12px}.detail-meta dt{color:#86918b}.detail-meta dd{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}.detail-actions{display:flex;gap:8px}.detail-actions .spacer{flex:1}.button-danger{border-color:#eedbd5;color:#a95c4a;background:white}.toast{position:fixed;z-index:5;left:50%;bottom:62px;max-width:calc(100% - 30px);padding:11px 16px;border-radius:12px;background:#263a33;color:white;font-size:12px;box-shadow:0 8px 24px #18291f33;opacity:0;pointer-events:none;transform:translate(-50%,12px);transition:.2s}.toast.show{opacity:1;transform:translate(-50%,0)}
@media(max-width:800px){.card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.page-shell{padding-top:48px}.contact-card-image{height:150px}}
@media(max-width:560px){.topbar{height:66px;padding:0 14px}.brand-mark{width:36px;height:36px;border-radius:12px}.brand small{font-size:8px}.top-actions{gap:7px}.connection-status{display:none}.top-actions .button{min-height:37px;padding:0 10px;font-size:10px}.icon-button{width:35px;height:35px}.page-shell{width:calc(100% - 30px);padding:37px 0 78px}.intro-row{align-items:flex-start;flex-direction:column;gap:18px}.intro-row h1{font-size:25px}.intro-copy{font-size:12px}.intro-row .button{height:44px;min-width:100%;}.toolbar{margin:25px 0 17px;align-items:flex-start;flex-direction:column;gap:8px}.search-box{height:44px}.card-grid{grid-template-columns:1fr;gap:12px}.contact-card{display:grid;grid-template-columns:118px 1fr;min-height:130px}.contact-card-image{height:100%;min-height:130px;border-right:1px solid #edf0ed;border-bottom:0}.contact-card-body{padding:14px 12px}.contact-card h3{font-size:14px}.contact-company{margin-top:7px;font-size:12px}.tag-list{margin-top:9px}.contact-card-date{margin-top:9px}.empty-state{min-height:295px;padding:22px 16px}.empty-state h2{font-size:16px}.page-footer{position:static;margin-top:30px;padding:14px 15px;font-size:9px}.page-footer span:last-child{display:none}.dialog{max-height:94vh;border-radius:17px}.dialog-content{padding:20px 16px}.capture-section{grid-template-columns:1fr;gap:12px;padding:11px}.capture-preview{min-height:190px}.capture-actions{display:grid;grid-template-columns:1fr 1fr}.capture-note{grid-column:1/-1}.camera-controls,.preview-controls{grid-column:1/-1}.form-grid{grid-template-columns:1fr;gap:12px}.field-full{grid-column:auto}.phone-row{grid-template-columns:102px 1fr 34px;gap:6px}.phone-row select,.phone-row input{font-size:10px;padding:8px}.dialog-heading h2{font-size:19px}.dialog-footer .button{flex:1;min-width:0}.detail-meta{grid-template-columns:90px 1fr}.toast{bottom:18px}}

.image-side-field select{min-height:38px;padding:8px 10px;border:1px solid #dfe6e1;border-radius:10px;background:white;color:var(--ink);font-size:12px}
.contact-card-image.has-front-back{grid-template-columns:1fr 1fr;gap:3px;padding:6px}
.contact-card-image-side{position:relative;min-width:0;width:100%;height:100%;display:grid;place-items:center;overflow:hidden;background:#eef2ee}
.contact-card-image-side img{width:100%;height:100%;object-fit:contain}
.contact-card-image-side span{position:absolute;left:4px;bottom:4px;padding:3px 5px;border-radius:5px;background:#24362fc9;color:#fff;font-size:9px}
.detail-images{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.detail-image-frame{min-width:0;padding:9px;border:1px solid #e7ece8;border-radius:12px;background:#f8faf8;color:#839088;font-size:10px}
.detail-image-frame>span{display:block;margin:0 0 7px}
.detail-image{display:block;width:100%;max-height:300px;aspect-ratio:1.586;object-fit:contain;border-radius:8px;background:#eff2ef}
@media(max-width:560px){.detail-images{grid-template-columns:1fr}.detail-image{max-height:220px}}
