@font-face{font-family:'Cormorant';src:url('../fonts/Cormorant-Bold.woff') format('woff');font-weight:700}
@font-face{font-family:'Cormorant';src:url('../fonts/Cormorant-Medium.woff') format('woff');font-weight:500}
@font-face{font-family:'DM Sans';src:url('../fonts/DMSans-Regular.woff') format('woff');font-weight:400}
@font-face{font-family:'DM Sans';src:url('../fonts/DMSans-Bold.woff') format('woff');font-weight:700}
*{box-sizing:border-box}
body{margin:0;font:400 15px/1.5 'DM Sans',system-ui,sans-serif;color:#2C4A47;background:#FAF7F0}
a{color:#165252}a:hover{color:#0F3D3D}
h1,h2,h3{font-family:'Cormorant',Georgia,serif;color:#0F3D3D;margin:0}
.shell{display:flex;flex-wrap:wrap;min-height:100vh}
.side{flex:1 1 232px;max-width:260px;background:#0F3D3D;color:#fff;padding:22px 14px;display:flex;flex-direction:column;gap:6px}
.brand{display:flex;gap:10px;align-items:center;padding:0 6px 16px}
.brand b{font:700 22px/1.1 'Cormorant',Georgia,serif;display:block}
.brand small{font-size:12px;color:#E3C27A;font-weight:700;letter-spacing:.06em;text-transform:uppercase}
.nav{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border-radius:8px;color:#DDE8E6;text-decoration:none;font-weight:600;min-height:44px}
.nav:hover,.nav.on{background:#165252;color:#fff}
.side .who{margin-top:auto;padding:14px 6px 0;font-size:13px;color:#BFD3D0}
.side form{margin:0}
.main{flex:999 1 560px;min-width:0;padding:26px 32px 56px}
.k{font-size:12px;text-transform:uppercase;letter-spacing:.08em;color:#4A706E;font-weight:700}
.muted{color:#4A706E}
.card{background:#fff;border:1px solid #E4E0D8;border-radius:12px;padding:20px;margin-bottom:16px}
.card.gold{border:2px solid #C8993A}
.btn{display:inline-flex;align-items:center;justify-content:center;padding:10px 18px;min-height:44px;border-radius:8px;font:600 14px 'DM Sans',system-ui,sans-serif;text-decoration:none;border:1.5px solid #165252;background:#165252;color:#fff;cursor:pointer}
.btn:hover{background:#0F3D3D;color:#fff}
.btn.gold{background:#C8993A;border-color:#C8993A;color:#0F3D3D}.btn.gold:hover{background:#B8892E;color:#0F3D3D}
.btn.o{background:#fff;color:#165252}.btn.o:hover{background:#F0EEE6;color:#0F3D3D}
.btn.red{background:#fff;border-color:#B83232;color:#8E2424}.btn.red:hover{background:#FBEAEA;color:#8E2424}
.btn.sm{min-height:36px;padding:4px 12px}
.chip{display:inline-block;padding:3px 10px;border-radius:999px;font-size:12px;font-weight:700;white-space:nowrap}
.c-ai{background:#F6E3B3;color:#4F3A00}.c-ok{background:#CFE8DB;color:#0F4A33}.c-ed{background:#D6E4F0;color:#123C5E}.c-fl{background:#F3D4D4;color:#7A1F1F}.c-gr{background:#E9E5DA;color:#34403E}
.t{width:100%;border-collapse:collapse;font-size:14px}
.t th{text-align:left;background:#165252;color:#fff;font-size:12px;letter-spacing:.06em;text-transform:uppercase;padding:10px 12px}
.t td{padding:12px;border-bottom:1px solid #E4E0D8;vertical-align:top;background:#fff}
.t tr:nth-child(even) td{background:#FDFBF6}
.scroll{overflow-x:auto}
.field{width:100%;min-height:44px;padding:10px 12px;border:1.5px solid #CFC8B6;border-radius:8px;background:#fff;font:400 15px 'DM Sans',system-ui,sans-serif;color:#1E3A37}
.field:focus{outline:3px solid rgba(200,153,58,.5);border-color:#165252}
textarea.field{min-height:84px;resize:vertical}
.lbl{display:block;font-size:13px;font-weight:700;margin:0 0 4px}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px}
.grid.s{grid-template-columns:repeat(auto-fit,minmax(130px,1fr))}
.row{display:flex;flex-wrap:wrap;gap:12px;align-items:center}
.split{display:flex;flex-wrap:wrap;gap:20px;align-items:flex-start}
.split>.l{flex:999 1 560px;min-width:0}.split>.r{flex:1 1 300px;max-width:400px}
.head{display:flex;flex-wrap:wrap;gap:14px;align-items:flex-end;justify-content:space-between;margin-bottom:16px}
.head h1{font-size:40px;line-height:1.1}
.flash{padding:12px 16px;border-radius:8px;margin-bottom:14px;font-weight:600}
.flash.ok{background:#CFE8DB;color:#0F4A33}.flash.bad{background:#F3D4D4;color:#7A1F1F}
.consent{display:flex;gap:12px;align-items:flex-start;padding:14px 0;border-top:1px solid #E4E0D8}
.consent input{width:22px;height:22px;flex:none;margin-top:3px}
.consent b{color:#0F3D3D}
.chips{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:10px}
.chips .chip{display:inline-flex;gap:6px;align-items:center;font-size:13px;padding:6px 6px 6px 12px}
.chips .chip button{border:0;background:transparent;font-size:18px;line-height:1;cursor:pointer;color:#34403E;min-width:32px;min-height:32px}
.sig{border:1.5px dashed #8C9A98;border-radius:8px;background:#FFFEFA;touch-action:none;width:100%;height:130px;display:block}
.ro{background:#F6F2E6;border-radius:8px;padding:12px;white-space:pre-wrap}
.center{max-width:460px;margin:8vh auto;padding:0 16px}
.keybox{font:600 15px/1.6 ui-monospace,Consolas,monospace;word-break:break-all;background:#F6F2E6;border:1.5px solid #C8993A;border-radius:8px;padding:14px}
.sav{font-size:13px;color:#4A706E}
hr.s{border:0;border-top:1px solid #E4E0D8;margin:14px 0}
@media print{.side,.noprint{display:none}}

.pwwrap{position:relative;display:block}
.pwwrap .field{padding-right:68px}
.pwtoggle{position:absolute;right:6px;top:50%;transform:translateY(-50%);min-height:34px;padding:0 12px;border:0;border-radius:6px;background:#EFEBDD;color:#165252;font:700 13px 'DM Sans',system-ui,sans-serif;cursor:pointer}
.pwtoggle:hover{background:#E3DDC8}
.pwtoggle:focus-visible{outline:3px solid rgba(200,153,58,.6)}

.sugg{position:absolute;left:0;right:0;top:100%;z-index:20;background:#fff;border:1px solid #D9CFB6;border-radius:8px;box-shadow:0 6px 18px rgba(15,61,61,.12);overflow:hidden}
.sugg button{display:block;width:100%;text-align:left;padding:10px 12px;min-height:44px;border:0;border-bottom:1px solid #EFEBDD;background:#fff;font:500 14px 'DM Sans',system-ui,sans-serif;color:#0F3D3D;cursor:pointer}
.sugg button:hover,.sugg button:focus-visible{background:#F6F2E6}
.dgcard{margin:10px 0 16px;max-width:720px}
.dgbar{gap:8px;margin-bottom:8px}
.dgcanvas{display:block;width:100%;aspect-ratio:10/7;background:#fff;border:1.5px solid #D9CFB6;border-radius:8px;touch-action:none;cursor:crosshair;margin-bottom:8px}
.dgadd{margin-top:8px}

.medinfo td{background:#FDFBF6;font-size:13px;padding:8px 12px}
.dwarn{background:#FBF1D9;border-left:4px solid #C8993A;padding:6px 10px;margin-bottom:6px;font-weight:600;color:#5A4210}
.dnote{margin-top:4px;color:#34403E}
.dtop{display:flex;flex-wrap:wrap;gap:12px;align-items:center;justify-content:space-between;background:#0F3D3D;color:#fff;padding:12px 24px}
.dtop .brand{padding:0}.dtop form{margin:0}
.dtop .btn.o{background:transparent;color:#fff;border-color:#8FB3AF}.dtop .btn.o:hover{background:#165252}
.dmain{max-width:980px;margin:0 auto;padding:26px 20px 56px}
.dnarrow{max-width:520px;margin:20px auto}
.qrbox{background:#fff;display:flex;justify-content:center;padding:10px}.qrbox svg{width:220px;height:220px}
/* v0.2.3: bigger, growing boxes; pens; growth panel; history */
.field{min-height:48px;font-size:16px;padding:12px 14px}
textarea.field{min-height:120px;line-height:1.5;resize:vertical;overflow:hidden}
textarea.field[data-f="exam"],textarea.field[data-f="impression"],textarea.field[data-f="plan"],textarea.field[data-f="history"]{min-height:150px}
textarea.field[data-f="past"]{min-height:84px}
.t .field{min-width:130px}.t td:first-child .field{min-width:230px}
.grid.s{grid-template-columns:repeat(auto-fit,minmax(170px,1fr))}
.btn.pen{border-left:12px solid var(--pen,#222)}.btn.on{background:#0F3D3D;color:#fff}.btn.pen.on{background:#F6F2E6;color:#0F3D3D;outline:2px solid #0F3D3D}
.dgbar{flex-wrap:wrap;gap:6px}
.growth{margin-top:12px}.growth table{border-collapse:collapse;width:100%;max-width:760px}.growth th,.growth td{text-align:left;padding:6px 10px;border-bottom:1px solid #E4DCC4;font-size:14px}.growth th{font-weight:600;color:#4A706E}
.growth .flag{color:#8E2424;font-weight:600}.growth .gnote{font-size:13px;color:#4A706E;margin:4px 0}.growth canvas{width:100%;max-width:760px;height:auto;border:1px solid #E4DCC4;border-radius:8px;background:#fff;margin-top:8px}
.histbox{background:#FBF9F1;border:1px solid #E4DCC4;border-radius:10px;padding:10px 12px;margin-bottom:6px}
.histbox summary{cursor:pointer;font-weight:600;color:#0F3D3D}
.histitem{display:flex;gap:8px;align-items:center;padding:4px 0;border-bottom:1px dashed #E4DCC4}.histitem span{flex:1}
.dgadd{margin-top:8px;display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.dgtiles{display:flex;flex-wrap:wrap;gap:10px;width:100%}
.dgtile{display:flex;flex-direction:column;align-items:center;gap:4px;padding:8px;border:1.5px solid #CFC8B6;border-radius:10px;background:#fff;cursor:pointer;font:600 13px 'DM Sans',system-ui,sans-serif;color:#0F3D3D;min-width:132px}
.dgtile:hover,.dgtile:focus-visible{border-color:#14676B;background:#F6F2E6}.dgtile canvas{width:120px;height:84px;border:1px solid #E4DCC4;border-radius:6px}
.btn.swatch{width:34px;height:34px;min-height:34px;min-width:34px;padding:0;border-radius:50%;background:var(--pen,#222)!important;border:3px solid #fff;box-shadow:0 0 0 1.5px #9aa}
.btn.swatch.on{box-shadow:0 0 0 3px #0F3D3D;transform:scale(1.12)}
[hidden]{display:none!important}
