:root{--accent:#11b9a2;--ink:#192f43}*{box-sizing:border-box}body{margin:0;background:#f3f6fa;color:var(--ink);font:15px 'Segoe UI',Tahoma,sans-serif}button,input,select,textarea{font:inherit}button{cursor:pointer;border:0;border-radius:9px;padding:11px 18px;background:var(--accent);color:white;font-weight:600}button.secondary{background:#e9eff4;color:var(--ink)}button.small{padding:6px 10px;font-size:12px}input,select,textarea{border:1px solid #dbe3eb;border-radius:8px;padding:11px;background:white;width:100%;color:var(--ink)}label{display:block;font-size:13px;color:#63778a;margin:0 0 6px}h1{font-size:29px;margin:0 0 7px}h2{font-size:20px;margin:0 0 20px}h3{margin:0 0 10px}p{color:#7b8b9c;line-height:1.7}.shell{display:grid;grid-template-columns:240px 1fr;min-height:100vh}.side{background:#142b40;color:white;padding:32px 20px;position:sticky;top:0;height:100vh}.brand{direction:ltr;text-align:center;font-size:26px;font-weight:800;letter-spacing:1px}.brand span{color:var(--accent)}.side p{font-size:11px;text-align:center;color:#91a8ba;letter-spacing:2px;margin-bottom:40px}.nav{display:grid;gap:9px}.nav button{text-align:right;background:transparent;color:#b4c5d4;font-weight:400}.nav button.active{background:#ffffff16;color:#48dbc2;border-right:3px solid var(--accent)}.side footer{position:absolute;bottom:30px;color:#8aa2b5;font-size:12px}.main{padding:28px 38px;min-width:0}.top{display:flex;justify-content:space-between;align-items:center;margin-bottom:35px}.badge{background:#e1f7ef;color:#138a69;border-radius:20px;padding:7px 13px;font-size:12px}.heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:24px}.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:18px;margin-bottom:26px}.card,.panel{background:white;border:1px solid #e6ecf2;border-radius:15px;padding:23px;box-shadow:0 4px 18px #19344f04}.card .num{font-size:30px;font-weight:700;margin-top:12px}.card label{color:#8291a3}.panel{margin-bottom:22px}.grid{display:grid;grid-template-columns:repeat(2,1fr);gap:18px}.formgrid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}.full{grid-column:1/-1}.filters{display:grid;grid-template-columns:2fr repeat(3,1fr);gap:10px;margin-bottom:15px}.tablewrap{overflow:auto}table{width:100%;border-collapse:collapse;white-space:nowrap;text-align:right}th{background:#f6f8fb;color:#8392a3;font-size:12px;font-weight:500}td,th{padding:15px 12px;border-bottom:1px solid #edf1f5}td{font-size:13px}.number{direction:ltr;display:inline-block;color:#159d8a;font-weight:600}.status{background:#edf3fc;color:#4a77b5;padding:5px 10px;border-radius:6px;font-size:11px}.actions{display:flex;gap:8px;align-items:center}.muted{color:#8a98a6;font-size:13px}.login{max-width:420px;margin:9vh auto;background:white;padding:40px;border-radius:20px;box-shadow:0 15px 65px #14324e12}.login input{margin-bottom:18px}.login button{width:100%;margin-top:10px}.login .brand{color:var(--ink);margin-bottom:15px}.bar{height:10px;border-radius:6px;background:#e6f6f3;margin:9px 0 22px}.bar i{display:block;height:100%;background:var(--accent);border-radius:6px}.printdoc{max-width:900px;margin:auto;background:white;padding:45px}.printhead{display:flex;justify-content:space-between;border-bottom:3px solid var(--accent);padding-bottom:25px;margin-bottom:28px}.total{font-size:26px;font-weight:800;text-align:left;padding:25px}.no-print{margin-bottom:20px}#toast{display:none;position:fixed;bottom:25px;left:30px;background:#19344f;color:white;padding:15px 24px;border-radius:10px;z-index:99}.empty{text-align:center;padding:40px;color:#8797a7}@media(max-width:1000px){.shell{grid-template-columns:180px 1fr}.main{padding:20px}.cards,.formgrid,.filters{grid-template-columns:repeat(2,1fr)}}@media(max-width:650px){.shell{display:block}.side{position:relative;height:auto;padding:15px}.side p,.side footer{display:none}.nav{display:flex;overflow:auto;margin-top:15px}.nav button{white-space:nowrap}.cards,.grid,.formgrid,.filters{grid-template-columns:1fr}.heading{gap:15px}.main{padding:18px}h1{font-size:24px}}

/* Requests have their own paper size; invoice page selection never inherits it. */
.request-doc{font-size:10pt;line-height:1.55;overflow-wrap:anywhere}
.request-doc .printhead{gap:5mm;padding-bottom:4mm;margin-bottom:4mm;align-items:flex-start}
.request-doc .printhead>div{flex:1;min-width:0}
.request-doc .printhead h1{font-size:18pt;line-height:1.25}
.request-doc .printhead h2{font-size:11pt;line-height:1.5;margin:0;flex:0 1 40%;min-width:0}
.request-doc .printhead p{font-size:8.5pt;margin:2mm 0 0;line-height:1.5}
.request-doc p{color:var(--ink);margin:3mm 0}
.request-doc .number{font-size:14pt;margin:0 0 3mm;max-width:100%}
.request-doc .grid{gap:5mm}
.request-doc .grid>p{min-width:0;margin:0 0 4mm}
.request-doc table{table-layout:fixed;white-space:normal}
.request-doc th,.request-doc td{font-size:10pt;padding:3mm 2mm;overflow-wrap:anywhere}
.request-doc .request-notes{white-space:pre-wrap;line-height:1.65;orphans:3;widows:3}
.request-doc .request-signatures{display:flex;gap:5mm;justify-content:space-between;margin-top:8mm;font-size:9pt;break-inside:avoid}
.request-doc .request-signatures span{flex:1;min-width:0}
@media screen{.request-doc{max-width:148mm;padding:9mm}}
@page{size:A4 portrait;margin:14mm}
@page smartlab-request{size:A5 portrait;margin:9mm}
@page smartlab-invoice{size:A4 portrait;margin:14mm}
@media print{
  body{background:white}
  .side,.top,.no-print,#toast{display:none!important}
  .shell{display:block;min-height:0}
  .main{padding:0}
  .printdoc{padding:10px;max-width:none}
  .panel{border:0;box-shadow:none}
  tr{break-inside:avoid}
  .request-doc{page:smartlab-request;width:auto;max-width:none;padding:0;margin:0}
  .invoice-doc{page:smartlab-invoice}
  /* A5 is narrower than the mobile breakpoint, but details remain two columns. */
  .request-doc .grid{grid-template-columns:minmax(0,1.2fr) minmax(0,1fr)}
  .invoice-doc .grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .request-doc .printhead,.request-doc .grid{break-inside:avoid}
  .request-doc .printhead h1{font-size:18pt}
}

/* Direct sponsorships are separate from lab records and all printed documents. */
.sponsor-ad{border:1px solid #dbe7ef;border-radius:15px;background:linear-gradient(110deg,#fff,#f0f8fb);padding:16px 20px;margin:0 0 24px;overflow:hidden}
.sponsor-label{color:#59758a;font-size:11px;font-weight:700;letter-spacing:.2px;margin-bottom:12px}
.sponsor-label span{font-weight:400;color:#698397}
.sponsor-link{display:flex;align-items:center;gap:24px;color:var(--ink);text-decoration:none}
.sponsor-link:hover .sponsor-cta{text-decoration:underline}
.sponsor-link:focus-visible{outline:3px solid var(--accent);outline-offset:5px;border-radius:5px}
.sponsor-link img{width:180px;height:115px;object-fit:contain;border-radius:9px;background:white;flex-shrink:0}
.sponsor-copy{min-width:0;overflow-wrap:anywhere}
.sponsor-copy h2{font-size:21px;margin:0 0 7px;color:#183b52}
.sponsor-copy p{font-size:14px;line-height:1.7;color:#567185;margin:0 0 10px;white-space:pre-wrap}
.sponsor-cta{font-size:13px;font-weight:600;color:#087f77}
.sponsor-preview{display:block;width:200px;max-height:150px;object-fit:contain;margin-top:12px;background:#f3f6fa;border-radius:8px}
.checkline{display:flex;align-items:center;gap:9px;margin:12px 0;color:var(--ink)}
.checkline input{width:auto}
@media(max-width:650px){.sponsor-link{align-items:flex-start;gap:14px}.sponsor-link img{width:85px;height:85px}.sponsor-copy h2{font-size:18px}.sponsor-ad{padding:15px}}
@media print{.sponsor-ad,.sponsor-preview{display:none!important}}

.platform-logo{width:44px;height:44px;border-radius:12px;object-fit:contain;vertical-align:middle;margin-inline-end:10px}.side .brand{font-size:23px}.side .platform-logo{display:block;width:64px;height:64px;margin:0 auto 14px}
.teeth-picker{border:1px solid #dbe7ed;border-radius:14px;padding:20px;background:#fbfdff}.teeth-heading{display:flex;gap:16px;align-items:flex-start;justify-content:space-between}.teeth-heading h2{margin-bottom:5px}.teeth-heading p{font-size:13px;margin:0 0 14px}.teeth-heading select{width:auto;min-width:140px}.teeth-tools{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:10px 0 15px}.teeth-tools strong{margin-inline-start:auto;background:#dcf8f0;color:#087f70;padding:8px 14px;border-radius:8px}.teeth-scroll{overflow-x:auto;padding:6px 0 12px}.tooth-chart{min-width:720px;text-align:center}.tooth-jaw-label{font-size:13px;font-weight:600;margin:8px 0;color:#345168}.tooth-orientation{display:flex;justify-content:space-between;color:#8a9aaa;font-size:11px;padding:0 5px}.tooth-row{display:grid;grid-template-columns:repeat(var(--tooth-columns),minmax(0,1fr));gap:4px;margin:6px 0 16px}.tooth{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:5px 2px;background:white;border:1px solid #dfe7ee;border-radius:10px;color:#53697f;min-width:0;position:relative;font-size:12px;box-shadow:none}.tooth:hover{background:#edf7f5;border-color:#73cdbb}.tooth:focus-visible{outline:3px solid #1978bd;outline-offset:2px}.tooth.selected{background:#d1f8ed;border:2px solid #0aa58d;color:#087e6a;padding:4px 1px}.tooth.selected:after{content:'✓';position:absolute;top:2px;right:3px;font-size:11px;font-weight:bold;color:#087f70}.tooth-midline{border-inline-start:2px solid #adbecb}.tooth svg{display:block;width:36px;height:80px;max-width:100%;margin:auto;overflow:visible}.tooth-outline{fill:#fff;stroke:currentColor;stroke-width:1.8;stroke-linejoin:round}.tooth-detail{fill:none;stroke:currentColor;stroke-width:1.5}.tooth.selected .tooth-outline{fill:#8ce3d0;stroke:#087f70;stroke-width:2.1}.tooth-row .tooth>span{font-weight:700;padding-top:4px}.request-teeth{margin:4mm 0;break-inside:avoid}.request-teeth h3{font-size:10pt;margin:0 0 1mm}.selected-tooth-ids{font-size:8pt!important;overflow-wrap:anywhere;text-align:right}.request-teeth .tooth-chart{min-width:0}.request-teeth .tooth-row{gap:1px;margin:1mm 0 2mm}.request-teeth .tooth{border-radius:3px;padding:1px;font-size:6pt}.request-teeth .tooth svg{height:12mm;width:100%}.request-teeth .tooth-orientation{font-size:5.5pt}.request-teeth .tooth-jaw-label{font-size:7pt;margin:1mm 0}.request-teeth .tooth.selected{padding:0;border-width:1.5px}.request-teeth .tooth.selected:after{font-size:6pt;top:0;right:0}.legacy-teeth{font-size:8pt!important;color:#6e8191!important}.print-size-hint{font-size:13px;color:#526c80}@media(max-width:650px){.teeth-heading{flex-direction:column}.teeth-picker{padding:12px}.teeth-tools strong{margin-inline-start:0}}@media print{.request-teeth{print-color-adjust:exact;-webkit-print-color-adjust:exact}.request-teeth .tooth{background:white}.request-teeth .tooth.selected{background:#d1f8ed}.request-teeth .tooth-row .tooth>span{padding-top:1px}}

@media print{.request-teeth{margin:2mm 0}.request-teeth .tooth svg{height:9mm}.request-doc .request-teeth .selected-tooth-ids{margin:1mm 0}.request-doc .request-signatures{margin-top:3mm}}
