  :root{
    --bg:#FFFFFF;
    --panel:#FFFFFF;
    --panel-alt:#F6F6F3;
    --ink:#141414;
    --white:#FFFFFF;
    --muted:#68685F;
    --line:#E4E4DE;
    --line-strong:#CBCBC4;

    /* text-safe accent shades (readable on white) */
    --cyan:#0092A8;
    --yellow:#9A7300;
    --magenta:#AC1791;

    /* bright brand shades (for solid fills / dark surfaces) */
    --cyan-bright:#00E0FF;
    --yellow-bright:#FFE600;
    --magenta-bright:#E619D9;
    --cyan-tint:#E3F7FA;
    --yellow-tint:#FFF6D2;
    --magenta-tint:#FBE7F8;
    --cyan-dim:#0A5A66;

    /* the ticket stub keeps its own dark surface regardless of page theme */
    --stub-bg:#0B0B0B;
    --stub-panel:#111111;
    --stub-line:#2B2B2B;
    --stub-text:#FFFFFF;
    --stub-muted:#9C9C97;
  }
  *{box-sizing:border-box;}
  html,body{margin:0;padding:0;}
  body{
    background:var(--bg);
    color:var(--ink);
    font-family:'Inter',sans-serif;
    -webkit-font-smoothing:antialiased;
  }
  h1,h2,h3,.display{
    font-family:'Poppins',sans-serif;
    font-weight:700;
  }
  .mono{font-family:'IBM Plex Mono',monospace;}

  /* ---------- Header ---------- */
  header.top{
    padding:20px 6vw;
    max-width:1200px;
    margin:0 auto;
    display:flex;
    justify-content:space-between;
    align-items:center;
    flex-wrap:wrap;
    gap:14px;
    border-bottom:1px solid var(--line);
  }
  .brand{display:flex; align-items:center; gap:14px;}
  .brand img{height:52px; width:auto; display:block;}
  .brand .brand-text{
    font-family:'IBM Plex Mono',monospace;
    font-size:11px;
    color:var(--muted);
    letter-spacing:0.08em;
    text-transform:uppercase;
    line-height:1.5;
    border-left:1px solid var(--line-strong);
    padding-left:14px;
  }
  header.top .doc-tag{
    font-family:'IBM Plex Mono',monospace;
    font-size:11px;
    color:var(--muted);
    text-align:right;
    line-height:1.7;
  }
  header.top .doc-tag b{color:var(--cyan); font-weight:600;}

  /* ---------- Intro ---------- */
  .intro{
    padding:40px 6vw 6px;
    max-width:1200px;
    margin:0 auto;
  }
  .intro .eyebrow{
    font-family:'IBM Plex Mono',monospace;
    font-size:12px;
    color:var(--yellow);
    letter-spacing:0.08em;
    text-transform:uppercase;
    margin-bottom:10px;
  }
  .intro h1{
    font-size:clamp(26px,3.6vw,40px);
    margin:0 0 12px;
    line-height:1.08;
    letter-spacing:-0.01em;
  }
  .intro h1 span{color:var(--cyan);}
  .intro p{
    font-size:14.5px;
    color:#48483F;
    max-width:640px;
    line-height:1.6;
    margin:0;
  }

  /* ---------- Stepper ---------- */
  .stepper{
    padding:32px 6vw 0;
    max-width:1200px;
    margin:0 auto;
    display:flex;
    gap:0;
    flex-wrap:wrap;
  }
  .step-pill{
    display:flex; align-items:center; gap:9px;
    padding:10px 18px 10px 10px;
    border-bottom:2px solid var(--line);
    color:var(--muted);
    font-family:'IBM Plex Mono',monospace;
    font-size:12px;
    letter-spacing:0.04em;
    text-transform:uppercase;
    transition:color .15s ease, border-color .15s ease;
  }
  .step-pill .num{
    width:22px; height:22px; border-radius:50%;
    border:1.5px solid var(--line-strong);
    display:flex; align-items:center; justify-content:center;
    font-size:11px; font-weight:600;
    color:var(--muted);
    flex-shrink:0;
    transition:all .15s ease;
  }
  .step-pill.current{ color:var(--ink); border-color:var(--cyan); }
  .step-pill.current .num{ border-color:var(--cyan); color:var(--cyan); background:rgba(0,224,255,0.08); }
  .step-pill.done{ color:var(--ink); border-color:var(--yellow); }
  .step-pill.done .num{ border-color:var(--yellow); color:var(--yellow); background:rgba(255,230,0,0.08); }

  /* ---------- Workspace ---------- */
  .workspace{
    padding:30px 6vw 70px;
    max-width:1200px;
    margin:0 auto;
    display:grid;
    grid-template-columns:1.5fr 1fr;
    gap:26px;
    align-items:start;
  }
  @media(max-width:960px){ .workspace{grid-template-columns:1fr;} }

  .panel{
    background:var(--panel);
    border:1px solid var(--line-strong);
    border-radius:6px;
    padding:30px 30px 28px;
    min-height:420px;
    display:flex;
    flex-direction:column;
    box-shadow:0 1px 2px rgba(20,20,20,0.03), 0 10px 28px rgba(20,20,20,0.05);
  }
  .panel h2{ font-size:22px; margin:0 0 4px; }
  .panel .step-sub{
    font-family:'IBM Plex Mono',monospace;
    font-size:12px;
    color:var(--muted);
    margin:0 0 26px;
  }

  .step-view{ display:none; flex:1; flex-direction:column; }
  .step-view.active{ display:flex; }

  /* Path tiles (step 1) */
  .board{
    display:grid;
    grid-template-columns:1fr;
    gap:14px;
  }
  .ticket-tab{
    position:relative;
    background:var(--panel-alt);
    border:1.5px solid var(--line-strong);
    border-radius:5px;
    padding:14px;
    cursor:pointer;
    transition:transform .12s ease, border-color .12s ease, background .12s ease;
    text-align:left;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
  }
  .ticket-tab:hover{ border-color:var(--line-strong); background:#EEEEE8; }
  .ticket-tab .tt-left{display:flex; align-items:center; gap:18px;}
  .ticket-tab .thumb{
    width:84px; height:84px; border-radius:5px; flex-shrink:0;
    display:flex; align-items:center; justify-content:center;
    position:relative;
    overflow:hidden;
  }
  .ticket-tab .thumb svg{ width:38px; height:38px; position:relative; z-index:1; }
  .ticket-tab[data-path="part"] .thumb{ background:linear-gradient(150deg, #6FEBFF 0%, #00AEC7 100%); }
  .ticket-tab[data-path="problem"] .thumb{ background:linear-gradient(150deg, #FFEE7A 0%, #D9A800 100%); }
  .ticket-tab[data-path="used"] .thumb{ background:linear-gradient(150deg, #E97FDD 0%, #AC1791 100%); }
  .ticket-tab h3{ font-size:17px; margin:0 0 3px; }
  .ticket-tab p{
    font-size:12.5px; color:var(--muted); margin:0;
    font-family:'Inter',sans-serif; font-weight:400;
  }
  .ticket-tab .select-hint svg{width:18px; height:18px; color:var(--muted); transition:all .15s ease;}
  .ticket-tab.active{ border-color:var(--cyan); background:rgba(0,146,168,0.06); }
  .ticket-tab.active .select-hint svg{ color:var(--cyan); transform:translateX(3px); }

  /* Fields */
  .field-group{margin-bottom:20px;}
  .field-row{display:grid; grid-template-columns:1fr 1fr; gap:14px;}
  @media(max-width:560px){ .field-row{grid-template-columns:1fr;} }

  label{
    display:block;
    font-family:'IBM Plex Mono',monospace;
    font-size:11px;
    letter-spacing:0.05em;
    text-transform:uppercase;
    color:#3A3A36;
    margin-bottom:7px;
  }
  label .req{color:var(--magenta);}
  label .opt{
    color:var(--muted); font-weight:400; text-transform:none;
    font-family:'Inter',sans-serif; letter-spacing:0; font-size:11px;
  }
  input[type=text], input[type=tel], input[type=number], select, textarea{
    width:100%;
    font-family:'Inter',sans-serif;
    font-size:14.5px;
    padding:11px 12px;
    border:1px solid var(--line-strong);
    border-radius:4px;
    background:#FAFAF8;
    color:var(--ink);
    outline:none;
    transition:border-color .12s ease;
  }
  input::placeholder, textarea::placeholder{color:#9C9C97;}
  input:focus, select:focus, textarea:focus{ border-color:var(--cyan); }
  textarea{resize:vertical; min-height:74px;}
  .hint{font-size:12px; color:var(--muted); margin-top:5px; line-height:1.4;}
  select{ appearance:none; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2393938F' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 14px center; }

  /* Photo dropzone */
  .dropzone{
    border:1.5px dashed var(--line-strong);
    border-radius:5px;
    padding:22px 16px;
    text-align:center;
    color:var(--muted);
    font-size:13px;
    cursor:pointer;
    transition:border-color .12s ease, background .12s ease;
    background:#FAFAF8;
  }
  .dropzone:hover{border-color:var(--cyan); background:var(--cyan-tint);}
  .dropzone svg{display:block; margin:0 auto 8px; width:26px; height:26px; color:var(--cyan);}
  .dropzone .files{margin-top:10px; font-family:'IBM Plex Mono',monospace; font-size:11.5px; color:var(--cyan);}

  /* Urgency dial — mapped to brand colors */
  .urgency{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
  .u-option{
    border:1.5px solid var(--line-strong);
    border-radius:5px;
    padding:14px 10px;
    text-align:center;
    cursor:pointer;
    background:#FAFAF8;
    transition:all .12s ease;
  }
  .u-option .dot{ width:9px; height:9px; border-radius:50%; margin:0 auto 8px; background:var(--line-strong); }
  .u-option .u-label{ font-family:'IBM Plex Mono',monospace; font-size:11px; letter-spacing:0.04em; text-transform:uppercase; color:var(--ink); }
  .u-option .u-desc{font-size:10.5px; color:var(--muted); margin-top:3px;}
  .u-option[data-level="routine"].active{ border-color:var(--cyan); background:var(--cyan-tint); }
  .u-option[data-level="routine"].active .dot{ background:var(--cyan-bright); }
  .u-option[data-level="urgent"].active{ border-color:var(--yellow); background:var(--yellow-tint); }
  .u-option[data-level="urgent"].active .dot{ background:var(--yellow-bright); }
  .u-option[data-level="critical"].active{ border-color:var(--magenta); background:var(--magenta-tint); }
  .u-option[data-level="critical"].active .dot{ background:var(--magenta-bright); }

  /* Review step */
  /* Brand pills + parts list (Find a Spare Part) */
  .brand-pills{ display:flex; flex-wrap:wrap; gap:10px; }
  .brand-pill{
    flex:1 1 180px;
    padding:14px 16px;
    border:1.5px solid var(--line-strong);
    border-radius:5px;
    background:#FAFAF8;
    cursor:pointer;
    text-align:left;
    font-family:'Inter',sans-serif;
    transition:all .12s ease;
  }
  .brand-pill:hover{ border-color:var(--line-strong); background:#F2F2EC; }
  .brand-pill .b-name{ font-size:14.5px; font-weight:700; color:var(--ink); }
  .brand-pill .b-count{
    display:block; margin-top:3px;
    font-family:'IBM Plex Mono',monospace; font-size:11px; color:var(--muted);
  }
  .brand-pill.active{ border-color:var(--yellow); background:var(--yellow-tint); }
  .brand-pill.active .b-count{ color:var(--yellow); }

  .parts-list{
    display:flex; flex-direction:column; gap:8px;
    max-height:320px; overflow-y:auto;
    border:1px solid var(--line); border-radius:5px;
    padding:8px; background:#FAFAF8;
  }
  .part-row{
    display:flex; justify-content:space-between; align-items:center; gap:12px;
    padding:11px 13px;
    border:1.5px solid var(--line); border-radius:4px;
    background:#fff; cursor:pointer;
    transition:all .12s ease;
  }
  .part-row:hover{ border-color:var(--line-strong); }
  .part-row.active{ border-color:var(--cyan); background:var(--cyan-tint); }
  .part-row .pinfo{ min-width:0; }
  .part-row .pn{ font-family:'IBM Plex Mono',monospace; font-size:12.5px; font-weight:600; color:var(--ink); }
  .part-row .pd{ font-size:12px; color:var(--muted); margin-top:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .part-row .plink{
    flex-shrink:0; font-size:11px; font-family:'IBM Plex Mono',monospace;
    color:var(--cyan); text-decoration:none; white-space:nowrap;
    border:1px solid var(--cyan); border-radius:3px; padding:5px 9px;
  }
  .part-row .plink:hover{ background:var(--cyan-tint); }
  .parts-empty{ padding:16px; font-size:12.5px; color:var(--muted); text-align:center; line-height:1.5; border:1px dashed var(--line-strong); border-radius:5px; background:#FAFAF8; }
  .parts-count{ font-family:'IBM Plex Mono',monospace; font-size:11px; color:var(--muted); margin-bottom:8px; }

  .parts-divider{ border-top:1px dashed var(--line-strong); margin:22px 0; }
  .parts-heading{ font-size:19px; margin:0 0 12px; }
  .parts-search-wrap{ position:relative; margin-bottom:12px; }
  .parts-search-wrap svg{ position:absolute; left:13px; top:50%; transform:translateY(-50%); width:15px; height:15px; color:var(--muted); pointer-events:none; }
  .parts-search-wrap input{ padding-left:38px; }

  .field-row-3{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:14px; }
  @media(max-width:700px){ .field-row-3{grid-template-columns:1fr;} }

  .fallback-card{
    margin-top:18px;
    background:var(--panel-alt);
    border:1px solid var(--line-strong);
    border-radius:6px;
    padding:20px 22px 22px;
  }
  .fallback-card h3{ font-size:16px; margin:0 0 4px; }
  .fallback-sub{ font-size:12.5px; color:var(--muted); margin:0 0 18px; line-height:1.5; }

  .review-grid{ display:grid; grid-template-columns:1fr 1fr; gap:10px 24px; margin-bottom:18px; }
  @media(max-width:560px){ .review-grid{grid-template-columns:1fr;} }
  .review-row{ padding:10px 0; border-bottom:1px dotted var(--line-strong); }
  .review-row .k{ font-family:'IBM Plex Mono',monospace; font-size:10.5px; color:var(--muted); text-transform:uppercase; letter-spacing:0.04em; }
  .review-row .v{ font-size:14px; margin-top:3px; }
  .review-row .v.empty{ color:#5C5C58; font-style:italic; }

  /* Nav buttons */
  .step-nav{
    margin-top:auto;
    padding-top:24px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    flex-wrap:wrap;
  }
  .btn{
    font-family:'Poppins',sans-serif;
    font-weight:600;
    font-size:14.5px;
    padding:13px 26px;
    border-radius:5px;
    cursor:pointer;
    border:1.5px solid var(--line-strong);
    background:transparent;
    color:var(--ink);
    transition:all .12s ease;
  }
  .btn:hover{ border-color:var(--ink); }
  .btn-next{
    background:var(--cyan-bright);
    border-color:var(--cyan-bright);
    color:#000;
  }
  .btn-next:hover{ background:#33E8FF; border-color:#33E8FF; }
  .btn-send{
    background:var(--magenta);
    border-color:var(--magenta);
    color:#fff;
  }
  .btn-send:hover{ background:#8E1379; border-color:#8E1379; }
  .btn[disabled]{ opacity:0.35; cursor:not-allowed; }
  .btn-ghost{ color:#4A4A45; border-color:transparent; padding-left:4px; }
  .btn-ghost:hover{ color:var(--ink); border-color:transparent; }
  .btn-ghost[disabled]{ color:#B8B8B2; }
  .step-count{ font-family:'IBM Plex Mono',monospace; font-size:11.5px; color:var(--muted); }

  .ack-note{
    margin-top:20px;
    background:var(--cyan-tint);
    border:1px solid var(--cyan);
    border-radius:5px;
    padding:14px 16px;
    font-size:12.5px;
    color:#054752;
    line-height:1.5;
    display:none;
  }
  .ack-note.show{display:block;}
  .ack-note b{font-family:'IBM Plex Mono',monospace; font-weight:600; color:var(--cyan);}

  /* ---------- Ticket stub (signature element) ---------- */
  .stub-wrap{position:sticky; top:26px;}
  .stub{
    background:var(--stub-panel);
    border:1px solid var(--stub-line);
    border-radius:6px;
    overflow:hidden;
    box-shadow:0 20px 40px rgba(20,20,20,0.16);
  }
  .stub-head{
    background:linear-gradient(120deg, #001318, #000);
    border-bottom:1px solid var(--cyan-dim);
    padding:16px 20px;
    display:flex; justify-content:space-between; align-items:center;
  }
  .stub-head .label{ font-family:'IBM Plex Mono',monospace; font-size:11px; letter-spacing:0.07em; text-transform:uppercase; color:var(--stub-muted); }
  .stub-head .ticket-no{ font-family:'IBM Plex Mono',monospace; font-size:15px; font-weight:600; color:var(--cyan-bright); }
  .stub-body{padding:18px 20px 4px;}
  .stub-row{ display:flex; justify-content:space-between; gap:10px; padding:9px 0; border-bottom:1px dotted var(--stub-line); font-size:13px; }
  .stub-row:last-child{border-bottom:none;}
  .stub-row .k{ font-family:'IBM Plex Mono',monospace; font-size:10.5px; color:var(--stub-muted); text-transform:uppercase; letter-spacing:0.04em; padding-top:2px; }
  .stub-row .v{ text-align:right; color:var(--stub-text); font-weight:500; max-width:60%; }
  .stub-row .v.empty{color:var(--stub-muted); font-weight:400; font-style:italic;}
  .perforation{ height:0; border-top:2px dashed var(--line-strong); margin:6px 20px 0; position:relative; }
  .perforation::before, .perforation::after{ content:""; position:absolute; top:-8px; width:16px; height:16px; background:var(--bg); border-radius:50%; }
  .perforation::before{left:-28px;} .perforation::after{right:-28px;}
  .stub-foot{ padding:16px 20px 20px; }
  .stub-status{ display:flex; align-items:center; gap:8px; font-family:'IBM Plex Mono',monospace; font-size:11.5px; letter-spacing:0.04em; text-transform:uppercase; color:var(--stub-muted); }
  .stub-status .pulse{ width:7px; height:7px; border-radius:50%; background:var(--line-strong); }
  .stub-status.armed .pulse{ background:var(--yellow-bright); box-shadow:0 0 0 3px rgba(255,230,0,0.25); }
  .stub-status.sent{ color:var(--cyan-bright); }
  .stub-status.sent .pulse{ background:var(--cyan-bright); box-shadow:0 0 0 3px rgba(0,224,255,0.25); }

  .spec-note{ margin-top:22px; font-size:11.5px; color:var(--muted); line-height:1.55; border-top:1px solid var(--line); padding-top:14px; }
  .spec-note .mono{color:var(--cyan); font-weight:600;}

  footer.foot{
    padding:26px 6vw 40px;
    max-width:1200px;
    margin:0 auto;
    font-size:11.5px;
    color:var(--muted);
    border-top:1px solid var(--line);
    line-height:1.6;
  }

  /* ---------- Additions for the live (CodeIgniter) form ---------- */
  input[type=email]{
    width:100%; font-family:'Inter',sans-serif; font-size:14.5px; padding:11px 12px;
    border:1px solid var(--line-strong); border-radius:4px; background:#FAFAF8; color:var(--ink); outline:none;
  }
  input[type=email]:focus{ border-color:var(--cyan); }
  select:disabled{ opacity:.6; cursor:not-allowed; }
  .hp-field{ position:absolute !important; left:-10000px !important; width:1px; height:1px; overflow:hidden; }
  .dropzone input[type=file]{ display:none; }
  .dropzone.has-file{ border-color:var(--cyan); background:var(--cyan-tint); }
  .dropzone .dz-clear{ margin-left:8px; color:var(--magenta); cursor:pointer; text-decoration:underline; }
  .form-error{
    display:none; margin-top:16px; padding:12px 14px; border-radius:5px;
    background:var(--magenta-tint); border:1px solid var(--magenta); color:#6b0f5b; font-size:13px; line-height:1.5;
  }
  .form-error.show{ display:block; }
  .field-invalid{ border-color:var(--magenta) !important; }
  .parts-loading{ padding:16px; font-size:12.5px; color:var(--muted); text-align:center; }
  .brand-pills .no-brands{ font-size:13px; color:var(--muted); }
  .btn-send[disabled]{ opacity:.55; cursor:progress; }
  .ack-note .new-link{ display:inline-block; margin-top:8px; color:var(--cyan); cursor:pointer; text-decoration:underline; font-weight:600; }

  /* Embedded (iframe) mode: no page chrome, tighter spacing, stub flows under the form on narrow frames */
  body.is-embed{ background:transparent; }
  body.is-embed header.top, body.is-embed footer.foot{ display:none; }
  body.is-embed .intro{ padding:20px 20px 0; }
  body.is-embed .stepper{ padding:20px 20px 0; }
  body.is-embed .workspace{ padding:20px 20px 24px; }
  body.is-embed .stub-wrap{ position:static; }
  body.is-embed.hide-intro .intro{ display:none; }
