:root{font-family:'Trebuchet MS','Segoe UI',Arial,sans-serif;color:#222b2a;background:#f9f6ea}*{box-sizing:border-box}body{margin:0;padding:25px 18px}button,input,select{font:inherit}button{cursor:pointer}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #0f735d;outline-offset:3px}.patient-shell{max-width:1090px;margin:auto;background:#fffdf5;border:2px solid #333730;border-radius:20px;box-shadow:6px 7px 0 #333730;overflow:hidden}.top{padding:20px 24px;display:flex;align-items:center;justify-content:space-between;gap:12px;background:#fffdf5}.brand{display:flex;align-items:center;gap:9px;font-size:26px;font-weight:900;letter-spacing:-1.2px}.brandmark{background:#f8dc3d;border:2px solid #333730;box-shadow:2px 2px 0 #333730;border-radius:10px;width:37px;height:37px;display:grid;place-items:center;font-size:25px;transform:rotate(-8deg)}.dot{color:#166f58}.badge{background:#f8dfe6;border:1.5px solid #333730;border-radius:6px;padding:8px 12px;font-size:11px;font-weight:900;letter-spacing:1.3px;white-space:nowrap}main{padding:0 24px 25px}.hero{background:#f8dd36;border:2px solid #333730;border-radius:15px;box-shadow:4px 5px 0 #333730;padding:30px 32px;min-height:220px;display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 5px 28px 0;overflow:hidden}.eyebrow{letter-spacing:2px;font-size:12px;font-weight:900;margin:0 0 12px}.hero h1{font-size:clamp(30px,4.3vw,53px);line-height:1.05;letter-spacing:-2px;margin:0 0 12px}.hero p:last-child{font-size:clamp(15px,2vw,22px);font-weight:650;margin:0}.sticker{width:165px;height:165px;flex:none;background:#e3f0d4;border:5px solid white;border-radius:20px;box-shadow:5px 7px 0 #333730;transform:rotate(8deg);display:grid;place-items:center}.sticker img{width:150px;height:150px;object-fit:contain}.panel{border:1.5px solid #c8c9bb;border-radius:16px;padding:20px;margin:0 0 18px;background:#fffef9}.section-heading{display:flex;align-items:center;gap:13px;margin-bottom:18px}.step{width:47px;height:47px;border-radius:50%;display:grid;place-items:center;background:#f9dc37;color:#202822;font-weight:900;font-size:19px;flex:none}.section-heading h2{margin:0;font-size:21px}.section-heading p{color:#676c66;font-size:14px;margin:3px 0 0}.visit-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}label{display:block;font-size:13px;font-weight:800;min-width:0}label small{display:block;font-size:11px;color:#626961;font-weight:400;margin-top:5px}input,select{display:block;width:100%;min-width:0;min-height:45px;margin-top:7px;padding:10px 13px;background:white;border:1.5px solid #858c83;border-radius:8px;color:#232b28;font-size:16px}input[type=file]{padding:7px;font-size:13px;max-width:100%}select{appearance:none;padding-right:38px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23232b28' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center}#medicines{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.medicine-card{position:relative;min-width:0;margin:0;padding:54px 14px 16px;border:1.5px solid #9ead99;border-radius:12px;background:#fffefa;overflow:hidden}.medicine-card[data-tone=blue]{border-color:#9ab5c5}.medicine-card:before{content:'';position:absolute;top:0;left:0;right:0;height:49px;background:#e2efd9;border-bottom:1px solid #c8d5be}.medicine-card[data-tone=blue]:before{background:#dceef9;border-color:#bbd3e1}.medicine-card legend{position:absolute;top:12px;left:16px;z-index:1;font-size:18px;font-weight:900;padding:0;margin:0}.medicine-card legend:before{content:'◇';display:inline-grid;place-items:center;width:24px;height:24px;border:2px solid #174f43;border-radius:8px;margin-right:8px;transform:rotate(-35deg)}.remove-medicine{position:absolute;right:12px;top:9px;z-index:1;background:#fff;border:1.5px solid #d64648;color:#b52a32;border-radius:7px;padding:7px 10px;min-height:32px;font-size:12px;font-weight:800}.medicine-grid{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:13px}.medicine-grid label{min-width:0}.add-button{width:100%;min-height:46px;margin-top:14px;border:1.5px dashed #353b34;border-radius:9px;background:transparent;font-weight:900;color:#222b2a}.count{font-size:12px;color:#646a60;text-align:right;margin:7px 1px 12px}.submit-button{display:block;width:100%;min-height:51px;border:1.5px solid #263c34;border-radius:9px;background:#146d58;color:white;font-size:16px;font-weight:900;box-shadow:2px 3px 0 #263c34}.submit-button:hover{background:#0e5948}.reminder,.footnote{text-align:center;color:#60675e;font-size:12px}.reminder{margin:17px 0 0}.footnote{margin:20px 0 0}#message{margin:12px 0;font-size:14px}#message:empty{display:none}#message.error,#message.success{border:1px solid #b0493c;border-radius:8px;background:#fff0e8;color:#742d24;padding:12px}#message.success{border-color:#27725a;background:#e7f3e8;color:#125741}#message:focus{outline:2px solid #17684f}button:disabled{opacity:.6;cursor:wait}button[hidden]{display:none!important}@media(max-width:700px){body{padding:10px}.top{padding:15px}.brand{font-size:20px}.badge{font-size:9px;padding:7px}main{padding:0 13px 15px}.hero{min-height:160px;padding:18px;margin-bottom:19px;gap:8px}.hero h1{font-size:clamp(24px,6vw,34px);letter-spacing:-1px}.hero p:last-child{font-size:14px;max-width:220px}.eyebrow{font-size:10px}.sticker{width:92px;height:92px;border-width:3px}.sticker img{width:86px;height:86px}.panel{padding:13px}.section-heading h2{font-size:18px}.section-heading p{font-size:12px}.visit-grid,#medicines{grid-template-columns:1fr}.medicine-grid{grid-template-columns:minmax(0,1fr) minmax(0,.72fr);gap:12px}.medicine-card{padding:54px 12px 14px}}@media(max-width:370px){.sticker{width:72px;height:72px}.sticker img{width:68px;height:68px}.hero h1{font-size:23px}.medicine-grid{grid-template-columns:1fr}}

/* Form layout repair: Safari date sizing and readable medicine fields. */
.visit-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.visit-grid>label,.medicine-grid>label,.section-heading>div{min-width:0}
input,select{box-sizing:border-box;max-width:100%;min-inline-size:0}
input[type=date]{appearance:none;-webkit-appearance:none;display:block;width:100%;max-width:100%;min-width:0;min-inline-size:0;height:48px;text-align:left;padding:10px 12px}
input[type=date]::-webkit-date-and-time-value{min-width:0;text-align:left;margin:0}
input[type=date]::-webkit-datetime-edit{padding:0;display:inline-flex;max-width:100%}
.medicine-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 14px}
.medicine-grid>label:first-child,.medicine-grid>label:last-child{grid-column:1/-1}
.medicine-grid label{font-size:14px;line-height:1.4}
.medicine-grid input,.medicine-grid select{min-height:48px;font-weight:400}
input[type=file]{height:auto;min-height:48px;font-size:13px;line-height:1.5;padding:8px;background:#f5f8ef;overflow:hidden}
input[type=file]::file-selector-button{font:inherit;border:1px solid #9cad97;border-radius:6px;padding:7px 10px;margin-right:10px;background:#e2efd9;color:#174f43;cursor:pointer}
label small{line-height:1.5;margin-top:7px}
.remove-medicine{min-height:36px}
@media(max-width:700px){
 .visit-grid,.medicine-grid{grid-template-columns:minmax(0,1fr);gap:18px}
 .medicine-grid>label{grid-column:1}
 .patient-shell{border-radius:17px;box-shadow:3px 4px 0 #333730}
 .panel{padding:15px 12px}
 .section-heading{gap:10px;align-items:flex-start;margin-bottom:20px}
 .section-heading .step{width:38px;height:38px;font-size:16px}
 .section-heading h2{font-size:19px;line-height:1.25}
 .section-heading p{font-size:13px;line-height:1.45}
 .medicine-card{padding:65px 14px 18px}
 .medicine-card:before{height:52px}
 .medicine-card legend{font-size:17px;top:14px;left:14px}
 .medicine-grid label,.visit-grid label{font-size:14px;line-height:1.45}
 .medicine-grid input,.medicine-grid select,.visit-grid input{font-size:16px;margin-top:8px;min-height:48px}
 input[type=file]{font-size:13px!important}
 label small{font-size:12px;font-weight:400}
 #medicines{gap:18px}
 .count{text-align:left;margin:10px 0 16px}
 .add-button{min-height:48px;margin-top:18px}
 .submit-button{min-height:52px}
}
