:root{
  --navy:#0f2a44; --navy-2:#173a5e; --teal:#14b8a6; --teal-dark:#0d7f73; --ground:#f6f8fa; --card:#fff;
  --text:#1b2a38; --muted:#52606d; --line:#dbe2e8; --amber:#d97706; --red:#dc2626; --green:#15803d;
  --radius:12px; --shadow:0 1px 2px rgba(15,42,68,.06),0 6px 20px rgba(15,42,68,.07);
  --font:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;font:16px/1.6 var(--font);color:var(--text);background:var(--ground);-webkit-text-size-adjust:100%}
img,svg{max-width:100%}
h1,h2,h3{line-height:1.2;color:var(--navy);margin:0 0 .5em}
h1{font-size:clamp(2rem,6vw,3.25rem);letter-spacing:-.02em}
h2{font-size:clamp(1.5rem,4vw,2.1rem);letter-spacing:-.01em}
h3{font-size:1.15rem}
a{color:var(--teal-dark)} a:hover{color:var(--navy)}
:focus-visible{outline:3px solid var(--teal);outline-offset:2px;border-radius:4px}
.wrap{max-width:68rem;margin:0 auto;padding:0 16px}
.narrow{max-width:34rem} .center{text-align:center}
.muted{color:var(--muted)} .small{font-size:.875rem}
.skip{position:absolute;left:-999px;top:0;background:#fff;color:var(--navy);padding:.5rem 1rem;z-index:100}
.skip:focus{left:8px;top:8px}
.eyebrow{text-transform:uppercase;letter-spacing:.12em;font-size:.78rem;font-weight:700;color:var(--teal-dark);margin:0 0 .5rem}
.lead{font-size:1.125rem;color:var(--muted)}

/* header */
.site-header{background:var(--navy);color:#fff;position:sticky;top:0;z-index:50}
.bar{display:flex;align-items:center;justify-content:space-between;min-height:3.75rem;position:relative}
.brand{display:flex;align-items:center;gap:.6rem;color:#fff;text-decoration:none;font-weight:700;font-size:1.1rem}
.brand:hover{color:#fff}
.brand-mark{width:1.7rem;height:1.7rem;border-radius:7px;background:var(--teal);position:relative;flex:none}
.brand-mark::after{content:"";position:absolute;inset:.45rem .3rem .4rem;background:var(--navy);border-radius:999px 999px 3px 3px}
.nav{display:flex;align-items:center;gap:1.25rem}
.nav a,.nav .linklike{color:#e6eef5;text-decoration:none;font-size:.95rem}
.nav a:hover,.nav .linklike:hover{color:#fff;text-decoration:underline}
.nav .btn{color:var(--navy);text-decoration:none}
.nav-toggle{position:absolute;opacity:0;pointer-events:none}
.nav-burger{display:none;cursor:pointer;padding:.9rem .4rem}
.nav-burger span,.nav-burger span::before,.nav-burger span::after{display:block;width:1.4rem;height:2px;background:#fff;position:relative;content:""}
.nav-burger span::before{position:absolute;top:-7px}.nav-burger span::after{position:absolute;top:7px}
.nav-toggle:focus-visible+.nav-burger{outline:3px solid var(--teal);border-radius:4px}
@media (max-width:760px){
  .nav-burger{display:block}
  .nav{display:none;position:absolute;top:100%;left:-16px;right:-16px;flex-direction:column;align-items:stretch;gap:0;background:var(--navy-2);padding:.5rem 16px 1rem}
  .nav a,.nav .linklike{padding:.7rem 0;display:block;text-align:left}
  .nav .btn{text-align:center;margin-top:.4rem}
  .nav-toggle:checked~.nav{display:flex}
}
.inline{display:inline;margin:0}
.linklike{background:none;border:0;padding:0;font:inherit;cursor:pointer}

/* buttons */
.btn{display:inline-block;background:var(--navy);color:#fff;border:2px solid var(--navy);padding:.6rem 1.1rem;border-radius:999px;font:inherit;font-weight:600;text-decoration:none;cursor:pointer;line-height:1.3;text-align:center}
.btn:hover{background:var(--navy-2);color:#fff}
.btn-accent{background:var(--teal);border-color:var(--teal);color:#06231f}
.btn-accent:hover{background:#2dd4bf;border-color:#2dd4bf;color:#06231f}
.btn-ghost{background:transparent;border-color:rgba(255,255,255,.7);color:#fff}
.btn-ghost:hover{background:rgba(255,255,255,.12);color:#fff}
.btn-outline{background:transparent;color:var(--navy)} .btn-outline:hover{background:var(--navy);color:#fff}
.btn-sm{padding:.35rem .9rem;font-size:.9rem} .btn-lg{padding:.8rem 1.6rem;font-size:1.05rem}
.btn-danger{background:var(--red);border-color:var(--red)}

/* hero */
.hero{background:radial-gradient(60rem 30rem at 85% -10%,rgba(20,184,166,.35),transparent 60%),linear-gradient(160deg,var(--navy),#0a1d31);color:#fff;padding:3.5rem 0 3rem}
.hero h1{color:#fff;margin-bottom:.3em}
.hero-in{display:grid;gap:2rem;align-items:center}
@media (min-width:900px){.hero-in{grid-template-columns:1.5fr 1fr;gap:3rem}}
.help-card{background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.18);border-radius:var(--radius);padding:1.4rem}
.help-card h2{color:#fff;font-size:1.25rem}
.help-card ul{list-style:none;margin:0 0 1rem;padding:0;display:grid;gap:.6rem}
.help-card a{display:block;padding:.75rem 1rem;border-radius:8px;background:rgba(255,255,255,.1);color:#fff;text-decoration:none}
.help-card a::after{content:" \2192";color:var(--teal)}
.help-card a:hover{background:rgba(20,184,166,.28);color:#fff}
.help-card .small{color:#b8cadb;margin:0}
.hero-sub{font-size:clamp(1.05rem,2.5vw,1.3rem);max-width:40rem;color:#d6e3ee;margin:0 0 1.5rem}
.badge{display:inline-block;background:rgba(20,184,166,.18);color:#7ff0e2;border:1px solid rgba(20,184,166,.6);padding:.25rem .8rem;border-radius:999px;font-weight:600;font-size:.85rem;margin:0 0 1rem}
.hero-actions{display:flex;flex-wrap:wrap;gap:.75rem;margin:0}
.trust{list-style:none;padding:0;margin:2rem 0 0;display:grid;gap:.5rem;color:#c9d9e6;font-size:.95rem}
.trust li::before{content:"\2713";color:var(--teal);font-weight:700;margin-right:.5rem}
@media (min-width:760px){.trust{grid-template-columns:repeat(3,auto);justify-content:start;gap:.5rem 2rem}}

/* sections */
.section{padding-top:3.5rem;padding-bottom:3.5rem}.alt{background:#eaf0f5}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(16rem,1fr));gap:1.25rem;margin-top:1.5rem}
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:1.4rem;box-shadow:var(--shadow)}
.card p{margin:.3rem 0}
.service .svc-icon{width:3rem;height:3rem;border-radius:10px;background:#e0f7f4;color:var(--teal-dark);display:grid;place-items:center;margin-bottom:.8rem}
.tag{display:inline-block;font-size:.8rem;font-weight:600;color:var(--navy);background:#eaf0f5;padding:.15rem .6rem;border-radius:999px;margin-top:.5rem!important}
.steps{list-style:none;margin:1.5rem 0 0;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(15rem,1fr));gap:1.5rem}
.steps li p{margin:0;color:var(--muted)}
.num{display:grid;place-items:center;width:2.4rem;height:2.4rem;border-radius:50%;background:var(--navy);color:#fff;font-weight:700;margin-bottom:.7rem}
.price .amount{font-size:2.2rem;font-weight:800;color:var(--navy);margin:.2rem 0 .6rem;line-height:1.1}
.price .amount span{font-size:.95rem;font-weight:500;color:var(--muted)}
.price.featured{border:2px solid var(--teal)}
.ticks{list-style:none;padding:0;margin:0;display:grid;gap:.5rem;font-size:.95rem}
.ticks li{padding-left:1.5rem;position:relative}
.ticks li::before{content:"\2713";position:absolute;left:0;color:var(--teal-dark);font-weight:700}
.contact{display:flex;flex-wrap:wrap;gap:1.5rem;align-items:center;justify-content:space-between}
.contact>div{max-width:34rem}

/* footer */
.site-footer{background:var(--navy);color:#cbd8e4;padding:2rem 0;font-size:.92rem}
.site-footer a{color:#7ff0e2}
.foot{display:grid;gap:1.25rem;grid-template-columns:repeat(auto-fit,minmax(14rem,1fr))}
.site-footer .muted{color:#9fb3c5}

/* forms */
.form-card{max-width:30rem;margin:2.5rem auto;padding:1.6rem}
.card h1{font-size:clamp(1.6rem,4vw,2rem)}
form .field{margin-bottom:1rem}
label{display:block;font-weight:600;font-size:.92rem;margin-bottom:.25rem}
input:not([type]),input[type=text],input[type=email],input[type=password],input[type=tel],input[type=number],input[type=date],input[type=time],select,textarea{width:100%;font:inherit;padding:.6rem .75rem;border:1px solid #9aa8b5;border-radius:8px;background:#fff;color:var(--text)}
input:focus,select:focus,textarea:focus{outline:3px solid rgba(20,184,166,.45);border-color:var(--teal-dark)}
.row{display:grid;gap:1rem;grid-template-columns:repeat(auto-fit,minmax(10rem,1fr))}
.hint{font-size:.85rem;color:var(--muted);margin:.25rem 0 0}
.errors{background:#fef2f2;border:1px solid #fecaca;color:#991b1b;border-radius:8px;padding:.7rem 1rem;margin-bottom:1rem}
.errors ul{margin:0;padding-left:1.1rem}
.flashes{margin-top:1rem}
.flash{padding:.7rem 1rem;border-radius:8px;margin:0 0 .5rem;background:#ecfdf5;border:1px solid #a7f3d0;color:#065f46}
.flash-error{background:#fef2f2;border-color:#fecaca;color:#991b1b}
.flash-warn{background:#fffbeb;border-color:#fde68a;color:#92400e}

/* tables & pills */
.table-wrap{overflow-x:auto}
table{border-collapse:collapse;width:100%}
th,td{text-align:left;padding:.6rem .75rem;border-bottom:1px solid var(--line);white-space:nowrap}
th{font-size:.8rem;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}
.pill{display:inline-block;padding:.1rem .6rem;border-radius:999px;font-size:.78rem;font-weight:600;background:#e5e7eb;color:#374151}
.pill-new{background:#dbeafe;color:#1e40af}.pill-open,.pill-in_progress{background:#e0f7f4;color:#0b6b61}
.pill-waiting{background:#fef3c7;color:#92400e}.pill-resolved,.pill-closed,.pill-paid{background:#dcfce7;color:#166534}
.pill-breached{background:#fee2e2;color:#991b1b}
.sla-warn{color:var(--amber);font-weight:600}.sla-breach{color:var(--red);font-weight:600}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}

/* customer portal */
.portal{padding-top:1.5rem}
.subnav{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem 1.25rem;border-bottom:1px solid var(--line);margin-bottom:1.5rem;padding-bottom:.6rem}
.subnav a:not(.btn){color:var(--muted);text-decoration:none;font-weight:600;padding:.25rem 0;border-bottom:2px solid transparent}
.subnav a:not(.btn):hover,.subnav a[aria-current=page]{color:var(--navy);border-bottom-color:var(--teal)}
.subnav-cta{margin-left:auto}
.page-title{font-size:clamp(1.5rem,4vw,2.1rem)}
.portal .card{margin-bottom:1.25rem}
.portal .card h2{font-size:1.2rem}
.card-head{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin-bottom:.5rem}
.card-head h2{margin:0}
.dash-grid{display:grid;gap:1.25rem;grid-template-columns:repeat(auto-fit,minmax(18rem,1fr));align-items:start}
.rows{list-style:none;margin:0;padding:0}
.rows li{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem .75rem;padding:.6rem 0;border-bottom:1px solid var(--line)}
.rows li:last-child{border-bottom:0}
.rows li>strong:last-child{margin-left:auto}
.meta{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem .75rem;margin:0 0 1.25rem}
.new-ticket{display:grid;gap:1.25rem;align-items:start}
.new-ticket .card{margin-bottom:0}
@media (min-width:900px){.new-ticket{grid-template-columns:minmax(0,1fr) 21rem}}
.next-steps ol{margin:0;padding-left:1.2rem;display:grid;gap:.8rem}
.next-steps h2,.form-card h2{font-size:1.2rem}
.chip{display:inline-block;font-size:.8rem;font-weight:600;color:var(--navy);background:#eaf0f5;padding:.15rem .65rem;border-radius:14px;overflow-wrap:anywhere}
fieldset.choice{border:0;padding:0;margin:0 0 1rem;display:grid;gap:.6rem}
fieldset.choice legend{font-weight:600;font-size:.92rem;padding:0;margin-bottom:.35rem}
.choice-opt{display:flex;gap:.7rem;align-items:flex-start;border:1px solid var(--line);border-radius:10px;padding:.8rem .9rem;font-weight:400;cursor:pointer;margin:0}
.choice-opt:has(input:checked){border-color:var(--teal-dark);background:#f1fbf9}
.choice-opt input{margin-top:.35rem}
.choice-opt .hint{display:block}
.timeline{list-style:none;margin:0;padding:0;display:grid;gap:.9rem}
.entry-system{font-size:.88rem;color:var(--muted);padding-left:.8rem;border-left:3px solid var(--line)}
.entry-public,.entry-internal{border:1px solid var(--line);border-radius:10px;padding:.7rem .9rem;background:#fbfcfd}
.entry-internal{background:#fffbeb;border-color:#fde68a}
.entry-meta{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem .6rem;margin-bottom:.3rem}
.entry-body{white-space:pre-wrap;overflow-wrap:anywhere}
.attach-list{list-style:none;margin:.5rem 0 0;padding:0;display:grid;gap:.2rem;font-size:.92rem}
.visit-card{border-left:4px solid var(--teal)}
.wrap-cell{white-space:normal;min-width:12rem}
.num-col{text-align:right}
tfoot td{border-bottom:0;font-weight:600}
tfoot tr.total td{font-size:1.1rem;border-top:2px solid var(--navy);color:var(--navy)}
.btn[disabled]{opacity:.55;cursor:not-allowed}
input[type=file]{font:inherit;max-width:100%;color:var(--muted)}
input[type=file]::file-selector-button{font:inherit;font-weight:600;background:transparent;color:var(--navy);border:2px solid var(--navy);border-radius:999px;padding:.35rem .9rem;margin-right:.75rem;cursor:pointer}
input[type=file]::file-selector-button:hover{background:var(--navy);color:#fff}

/* staff workspace */
.section-h{font-size:1.2rem;margin:1.75rem 0 .6rem}
.stats{display:grid;gap:.75rem;grid-template-columns:repeat(auto-fit,minmax(9.5rem,1fr));margin:0 0 1rem}
.stat{display:block;background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:.8rem 1rem;box-shadow:var(--shadow);text-decoration:none;color:var(--text)}
a.stat:hover{border-color:var(--teal-dark)}
.stat-n{display:block;font-size:1.7rem;font-weight:800;line-height:1.15;color:var(--navy);overflow-wrap:anywhere}
.stat-l{display:block;font-size:.82rem;color:var(--muted)}
.stat-warn{border-color:#fcd34d;background:#fffbeb}.stat-bad{border-color:#fca5a5;background:#fef2f2}
.banner{background:#fffbeb;border:1px solid #fcd34d;color:#92400e;border-radius:8px;padding:.7rem 1rem;margin:0 0 1rem;overflow-wrap:anywhere}
.sla{display:inline-block;padding:.1rem .6rem;border-radius:999px;font-size:.78rem;font-weight:600;white-space:nowrap;background:#e5e7eb;color:#374151}
.sla-ok{background:#e0f7f4;color:#0b6b61}
.sla-at_risk{background:#fef3c7;color:#92400e}
.sla-breached{background:#fee2e2;color:#991b1b}
.sla-met{background:#dcfce7;color:#166534}
.sla-paused{background:#e5e7eb;color:#374151}
.pill-p-critical{background:#fee2e2;color:#991b1b}.pill-p-high{background:#ffedd5;color:#9a3412}
.pill-p-medium{background:#e0e7ff;color:#3730a3}.pill-p-low{background:#f3f4f6;color:#4b5563}
.filters{display:flex;flex-wrap:wrap;gap:.6rem .75rem;align-items:flex-end;margin:0 0 1rem}
.filters .field{flex:1 1 9rem;margin:0;min-width:0}
.filters .filters-go{flex:0 0 auto}
.filters label{font-size:.8rem}
/* Ticket page. Phones: a single column in which the two wrappers dissolve (display:contents) so their cards can be
   ordered individually: Details comes right after the header instead of below the long conversation, reply and
   time form (the Customer card stays after them). Cards carry their own bottom margin, hence no row gap. Wide screens: main column + sidebar. */
.ticket-grid{display:grid;gap:0 1.25rem;align-items:start;grid-template-columns:minmax(0,1fr)}
.ticket-main,.ticket-side{display:contents}
.ticket-grid .card{min-width:0}
#details{order:-1}
@media (min-width:960px){
  .ticket-grid{grid-template-columns:minmax(0,1fr) 22rem}
  .ticket-main,.ticket-side{display:block;min-width:0}
}
.ticket-side .card h2,.ticket-main .card h2{font-size:1.2rem}
.canned{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem;margin:0 0 .75rem}
.entry-time{font-size:.9rem;padding-left:.8rem;border-left:3px solid var(--teal)}
.entry-time,.entry-system,.ticket-side .card,.staff .page-title,.attach-list li{overflow-wrap:anywhere}
.ticket-main>.card{scroll-margin-top:5rem}
.staff-form{max-width:44rem}
textarea{resize:vertical}

/* admin portal */
.example-box{border-left:4px solid var(--teal)}
.example-text{font-weight:600;color:var(--navy);overflow-wrap:anywhere}
.items{list-style:none;margin:0;padding:0}
.items .items{margin:.5rem 0 0 1.25rem}
.item{border-top:1px solid var(--line);padding:.7rem 0}
.items>.item:first-child{border-top:0}
.item-row{display:flex;flex-wrap:wrap;gap:.5rem .75rem;align-items:center}
.item-row .field{margin:0;flex:1 1 12rem;min-width:0}
.item-row.grow{flex:1 1 16rem;flex-wrap:nowrap}
.item form{margin:0}
.item-actions{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.5rem}
.item summary{cursor:pointer;font-weight:600;overflow-wrap:anywhere}
.item details[open]>summary{margin-bottom:.75rem}
.pager{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem .75rem}

/* invoice table: on phones the description and the money are all there is (Qty and Unit are hidden, the description wraps
   to whatever room is left), so the amounts and the total are always on screen without sideways scrolling */
.invoice-table .num-col{white-space:nowrap}
.invoice-table .show-narrow{display:none}
@media (max-width:640px){
  .invoice-table .hide-narrow{display:none}
  .invoice-table .show-narrow{display:table-cell}
  .invoice-table .wrap-cell{min-width:0;overflow-wrap:anywhere}
  .invoice-card{padding:.5rem .75rem}
  .invoice-table th,.invoice-table td{padding-left:.4rem;padding-right:.4rem}
}

/* pay page: the invoice, the policy line and the Pay button each get room */
.pay-page .card{margin-bottom:1.25rem}
.pay-page>.hint{margin:0 0 1.25rem}
.pay-page form{margin-top:1.25rem}
.pay-page form .hint{margin-top:.75rem}

/* staff invoice page: rows of buttons that wrap on phones, and the offline-payment fields side by side */
.btn-row{display:flex;flex-wrap:wrap;gap:.75rem;align-items:center;margin:.75rem 0 0}
.btn-row form{margin:0}
.row-paid{grid-template-columns:minmax(9rem,12rem) minmax(0,1fr)}
@media (max-width:600px){.row-paid{grid-template-columns:1fr}}
.staff-form>.choice-opt{margin-bottom:1rem}

.hp{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}
