/* =========================================================
   THC FIELD TOOLS — SHARED THEME v1
   One look for every tool: modern legible type (Inter),
   sharp edges, clean lines, equal on phone / iPad / desktop.
   Link AFTER the tool's own <style> so the variables and
   shared components below win where classes match.
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800;900&display=swap');

:root{
  /* palette */
  --thc-blue:#4A5FE0; --thc-blue-soft:#EEF0FC; --thc-blue-dk:#3A4FC0;
  --thc-ink:#1E2025; --thc-charcoal:#2D2D2D;
  --thc-bg:#F5F6F8; --thc-card:#FFFFFF;
  --thc-line:#D8DADF; --thc-line-soft:#EBECEF;
  --thc-muted:#6E7176;
  --thc-green:#149251; --thc-green-soft:#E8F5EE;
  --thc-amber:#B5610F; --thc-amber-soft:#FCF1E4;
  --thc-red:#C0392B;   --thc-red-soft:#FDEDEB;
  /* shape: sharp, precise */
  --thc-r-sm:4px; --thc-r:8px; --thc-r-lg:10px;
  /* type */
  --thc-font:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  /* elevation: hairlines over shadows */
  --thc-shadow:0 1px 2px rgba(20,22,28,.06);
  --thc-shadow-lg:0 8px 28px rgba(20,22,28,.14);
}

/* opt-in page reskin: add class="thc" to <body> */
body.thc{font-family:var(--thc-font);background:var(--thc-bg);color:var(--thc-ink);
  -webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;}
body.thc h1,body.thc h2,body.thc h3{letter-spacing:-.01em;}

/* ---------- shared components (namespaced .thc-*) ---------- */

/* top bar */
.thc-topbar{background:var(--thc-charcoal);color:#fff;padding:12px 18px;display:flex;
  align-items:center;justify-content:space-between;gap:12px;position:sticky;top:0;z-index:1100;}
.thc-topbar .t-name{font-weight:800;font-size:15px;letter-spacing:.06em;color:#fff;}
.thc-topbar .t-sub{font-size:10px;letter-spacing:.18em;color:#B9BCC2;font-weight:700;text-transform:uppercase;}

/* cards */
.thc-card{background:var(--thc-card);border:1px solid var(--thc-line);border-radius:var(--thc-r);
  box-shadow:var(--thc-shadow);padding:18px;}

/* buttons */
.thc-btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;
  padding:11px 18px;border:none;border-radius:var(--thc-r-sm);cursor:pointer;
  background:var(--thc-blue);color:#fff;font-family:inherit;font-weight:700;font-size:14px;line-height:1;}
.thc-btn:active{background:var(--thc-blue-dk);}
.thc-btn:disabled{opacity:.45;cursor:default;}
.thc-btn.ghost{background:var(--thc-card);color:var(--thc-ink);border:1px solid var(--thc-line);}
.thc-btn.danger{background:var(--thc-red);}
.thc-btn.sm{padding:7px 12px;font-size:12px;}

/* inputs — 16px stops iOS zoom */
.thc-input,.thc-select,body.thc input:not([type=checkbox]):not([type=radio]),body.thc select,body.thc textarea{
  font-family:inherit;font-size:16px;color:var(--thc-ink);background:var(--thc-card);
  border:1px solid var(--thc-line);border-radius:var(--thc-r-sm);padding:10px 12px;width:100%;}
body.thc input:focus,body.thc select:focus,body.thc textarea:focus{
  outline:2px solid var(--thc-blue);outline-offset:0;border-color:var(--thc-blue);}

/* unit hint — grey suffix INSIDE the field: wrap input in .thc-unit, set data-unit="SQ" */
.thc-unit{position:relative;display:block;}
.thc-unit>input{padding-right:52px;}
.thc-unit::after{content:attr(data-unit);position:absolute;right:11px;top:50%;transform:translateY(-50%);
  font-size:12px;font-weight:700;color:var(--thc-muted);pointer-events:none;letter-spacing:.04em;}

/* required to proceed — put .thc-req on the field wrapper; .missing when empty on submit */
.thc-req>label::after{content:' *';color:var(--thc-red);font-weight:800;}
.thc-req.missing>input,.thc-req.missing>select,.thc-req.missing>textarea,
.thc-req.missing .thc-unit>input{border-color:var(--thc-red);outline:2px solid var(--thc-red);background:var(--thc-red-soft);}
.thc-req.missing::before{content:'Required to continue';display:block;font-size:11px;font-weight:700;color:var(--thc-red);margin-bottom:3px;}

/* floating action buttons — bottom right, STACKED so they never cover each other.
   First FAB sits at the bottom; add .up1/.up2 to lift additional ones. */
.thc-fab{position:fixed;right:16px;bottom:calc(16px + env(safe-area-inset-bottom));z-index:1200;
  display:inline-flex;align-items:center;gap:8px;padding:14px 20px;border:none;cursor:pointer;
  border-radius:var(--thc-r);background:var(--thc-blue);color:#fff;font-family:var(--thc-font);
  font-weight:800;font-size:14px;box-shadow:var(--thc-shadow-lg);}
.thc-fab.up1{bottom:calc(76px + env(safe-area-inset-bottom));}
.thc-fab.up2{bottom:calc(136px + env(safe-area-inset-bottom));}
.thc-fab.alt{background:var(--thc-charcoal);}

/* help "?" — top-right of a tool; small, out of the way */
.thc-help-btn{width:30px;height:30px;border-radius:50%;border:1px solid var(--thc-line);
  background:var(--thc-card);color:var(--thc-muted);font-weight:800;font-size:15px;cursor:pointer;
  display:inline-flex;align-items:center;justify-content:center;flex:none;}
.thc-help-btn:active{background:var(--thc-blue-soft);color:var(--thc-blue);}
.thc-help-mask{position:fixed;inset:0;background:rgba(20,22,28,.5);z-index:1400;display:none;
  align-items:center;justify-content:center;padding:20px;}
.thc-help-mask.open{display:flex;}
.thc-help-card{background:var(--thc-card);border-radius:var(--thc-r);max-width:420px;width:100%;
  padding:22px;box-shadow:var(--thc-shadow-lg);}
.thc-help-card h3{font-size:15px;font-weight:800;margin:0 0 8px;}
.thc-help-card p,.thc-help-card li{font-size:13.5px;line-height:1.65;color:var(--thc-ink);margin:0 0 6px;}
.thc-help-card ol{padding-left:20px;margin:0 0 6px;}
.thc-help-card .thc-btn{width:100%;margin-top:10px;}

/* internal-only summary block — never printed */
.thc-internal{background:#FFF8E6;border:1.5px dashed var(--thc-amber);border-radius:var(--thc-r);
  padding:14px 16px;margin-top:16px;}
.thc-internal .ti-tag{font-size:10px;font-weight:900;letter-spacing:.14em;color:var(--thc-amber);text-transform:uppercase;}
.thc-internal .ti-row{display:flex;justify-content:space-between;font-size:14px;font-weight:700;padding:5px 0;border-bottom:1px solid var(--thc-line-soft);}
.thc-internal .ti-row:last-child{border-bottom:none;}
.thc-internal .ti-row b{font-size:16px;}
@media print{.thc-internal,.thc-fab,.thc-help-btn,.thc-help-mask{display:none !important;}}

/* responsive rhythm */
.thc-container{max-width:1080px;margin:0 auto;padding:0 16px;}
@media(min-width:768px){.thc-container{padding:0 24px;}}

/* tables */
.thc-table{width:100%;border-collapse:collapse;font-size:13.5px;}
.thc-table th{background:var(--thc-charcoal);color:#fff;text-align:left;padding:8px 10px;font-size:11px;
  font-weight:800;letter-spacing:.06em;text-transform:uppercase;}
.thc-table td{padding:8px 10px;border-bottom:1px solid var(--thc-line-soft);}
.thc-table tr:nth-child(even) td{background:var(--thc-bg);}

/* toast */
.thc-toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:var(--thc-charcoal);
  color:#fff;font-size:13px;font-weight:700;padding:11px 22px;border-radius:var(--thc-r-sm);
  opacity:0;transition:opacity .25s;z-index:2000;pointer-events:none;font-family:var(--thc-font);}
.thc-toast.show{opacity:1;}
