/*
 * WithOne dark theme
 * Shared by every public page. The main brand keeps its color while partner
 * artwork and surrounding surfaces are adapted for dark-mode contrast.
 */
:root{color-scheme:light dark}

@media (prefers-color-scheme:dark){
  :root{
    --gold:#d3b574;
    --navy:#102b4d;
    --navy2:#07111f;
    --ink:#f1f5fb;
    --body:#bdc8d7;
    --muted:#aebccd;
    --line:#33465f;
    --bg:#132137;
    --paper:#132137;
    --card:#1a2b43;
  }

  html,body{background:#0d1727;color:var(--ink)}
  body{color-scheme:dark}
  a{color:#bfd8fa}
  p,li,dd,td{color:inherit}
  hr{border-color:var(--line)}
  ::selection{background:#8c6f37;color:#fff}

  /* Header and navigation */
  .hdr,.header{
    border-color:#2d4059;
    background:rgba(8,18,32,.96);
    box-shadow:0 1px 0 rgba(255,255,255,.04);
  }
  .hdr .logo,.header .logo img{
    opacity:1;
    filter:brightness(2.1) saturate(1.06);
    forced-color-adjust:none;
  }
  .brand-lockup .partner-ci{
    padding:0;
    border-radius:0;
    background:transparent;
    box-shadow:none;
    opacity:1;
    filter:brightness(0) invert(1);
    forced-color-adjust:none;
  }
  .hdr .nav a,.header .back{color:#e5edf7}
  .hdr .nav svg{stroke:#aebed2!important}
  .hamb span,.hdr .hamb span{background:#e5edf7}
  .dd-in,.drawer,.drawer.open{
    border-color:var(--line);
    background:#101d30;
    color:var(--ink);
    box-shadow:0 18px 44px rgba(0,0,0,.34);
  }
  .dd-in a,.drawer a,.drawer.open a{color:#dfe8f3}
  .dd-in a:hover{background:#1b2d45;color:var(--gold)}
  .drawer .dgroup{color:var(--gold)}

  /* Main and section surfaces */
  .sec.alt,.alt,.ceo-hero,.life,.expert,.value,
  .enterprise-map-section,.enterprise-map,
  .labor-overview,.articles-overview,.axdx-overview{
    background:#101c2e;
    color:var(--ink);
  }
  .hero{background:#0d192a;color:var(--ink)}
  .hero-fade{background:linear-gradient(90deg,#0d192a 12%,rgba(13,25,42,0))}
  .hero-h,.hero-sub{color:var(--ink)}
  #service,.case{background:#102947}
  #service .sec-title{color:var(--ink)}
  #service .sec-desc{color:var(--body)}
  .service-path{border-color:var(--line)}
  .service-path-label,.service-path-list span{color:var(--gold)}
  .service-path-list li{color:var(--ink)}
  .action{background:#101c2e;color:var(--ink)}
  .cta,.cta.withone-consult-cta{
    border-color:var(--line)!important;
    background:#101c2e!important;
    color:var(--ink)!important;
  }
  .ftr,.footer{background:#07111f}

  /* Partner logos are intentionally framed as one coherent light CI rail. */
  .partners{
    border-color:var(--line);
    background:#111e31;
  }
  .partners-t,.partners-n{color:#aebccd}
  .pmarq-track{gap:28px;padding-right:28px}
  .pmarq img{
    box-sizing:content-box;
    width:132px;
    height:36px;
    padding:8px 12px;
    border:1px solid #dbe2ec;
    border-radius:10px;
    background:#f8fafc;
    box-shadow:0 7px 20px rgba(0,0,0,.18);
    object-fit:contain;
    opacity:1;
    filter:none;
    forced-color-adjust:none;
  }

  /* Cards, panels and expandable content */
  .svc-card,.topic,.point,.expert-card,.profile-box,
  .summary,.policy,.contact,.check-box,.proc-panel,.pdetail,.pdetail-body,
  details.faq,details.case-item,details.fold,
  .post-links a,.sib-chips a,.reco-card,.chat,.dmodal .chat,
  .labor-card,.axdx-step,.axdx-benefits,.insight-link,
  .enterprise-topic-grid .topic,.pdetail-outcomes li{
    border-color:var(--line);
    background:var(--card);
    color:var(--ink);
    box-shadow:none;
  }
  .topic:hover,.svc-card:hover,details.faq[open],details.case-item[open],
  .labor-overview .insight-link:hover,.insight-link:hover{
    border-color:var(--gold);
    box-shadow:0 12px 30px rgba(0,0,0,.2);
  }
  .kp-box,.cs-tip,.dm-intro,.bub.bot,.dmodal .bub.bot{
    border-color:var(--line);
    background:#15253b;
    color:var(--ink);
  }
  .pcirc,.pdetail-circ,.pager .pg,.more-btn,.chat-chip,.dmodal .chat-chip{
    border-color:var(--line);
    background:#182940;
    color:var(--ink);
  }
  .pstep.on .pcirc{background:#2b2c2f}
  .proc-panel::before,.pdetail-body::before{
    border-color:var(--line);
    background:var(--card);
  }

  /* Typography that previously used light-theme hard-coded colors */
  .sec-title,.morelink,.svc-t,.topic-t,.case-one,.case-amt,.cs-link,
  .greet-quote,.greet-sign b,.ceo-title,.ceo-name b,.ceo-message-title,
  .expert-title,.profile-title,.value-q,.loc-k,.ntc-t,
  .pdetail-body h3,.fold-body h3,.check-title,.dc-name,
  .labor-overview .sec-title,.labor-copy h2,
  .articles-overview .sec-title,.articles-card h2,
  .axdx-title,.axdx-step h2,.axdx-benefits-title,.axdx-benefit b,
  .enterprise-topic-grid .topic,.summary strong,.policy h2,.policy h1,
  main h1,main h2{color:var(--ink)}
  .art h2{color:var(--ink)!important}
  .sec .wrap>h1{color:var(--ink)!important}

  .sec-desc,.svc-d,.about-why-d,.pd,.note,.case-ind,.faq-a,.cs-text,
  .sub-body p,.greet-sign,.ceo-lead,.ceo-copy,.profile-list li,.value-d,
  .loc-v,.ntc-d,.pdetail-body p,.fold-body p,.check-ul li,.dc-desc,
  .labor-overview .lead,.labor-copy p,.labor-overview .insight-title,
  .articles-overview .lead,.articles-card p,.insight-title,
  .axdx-lead,.axdx-step p,.axdx-benefit span,
  .lead,.point p,.effective,.policy p,.policy ul,.contact{
    color:var(--body);
  }
  .case-amt,.cs-link,.greet-quote,.ceo-copy .em,.value-q,.loc-k,
  .pstep.on .pnum{color:#c7dcf6}
  .life-desc{color:var(--body)}

  /* Tables and lists */
  .tbl-wrap,.table-wrap{border-color:var(--line)}
  .tbl th,table th{background:#102947;color:#f7f9fc}
  .tbl td,table td{border-color:var(--line);color:var(--body);background:#101c2e}
  .tbl td:first-child{color:var(--ink)}
  .tbl tr:nth-child(even) td,table tr:nth-child(even) td{background:#14243a}
  .tbl tbody tr.open td:nth-child(3){background:#182b43}
  .ntc-list{border-color:#486583}

  /* Forms and native controls, including iOS Safari */
  input,textarea,select,button{
    color-scheme:dark;
  }
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  textarea,select{
    border-color:#40546d!important;
    background:#0f1c2e!important;
    color:#f1f5fb!important;
    -webkit-text-fill-color:#f1f5fb;
    caret-color:#f1f5fb;
  }
  input::placeholder,textarea::placeholder{
    color:#8798ac!important;
    -webkit-text-fill-color:#8798ac;
    opacity:1;
  }
  input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus{
    -webkit-text-fill-color:#f1f5fb;
    -webkit-box-shadow:0 0 0 1000px #0f1c2e inset;
    transition:background-color 9999s ease-out 0s;
  }
  input[type="checkbox"],input[type="radio"]{accent-color:var(--gold)}
  label,.agree{color:var(--ink)}
  .cf .msg.ok{
    border-color:#376c50;
    background:#153629;
    color:#b9e8ca;
  }
  .cf .msg.err{
    border-color:#754747;
    background:#3a2024;
    color:#f1bdc0;
  }
  .prefill-note,.prefill-note.on{
    border-color:#6d5c38;
    background:#312a1c;
    color:#e3d1a5;
  }

  /* Small colored badges use dark ink for dependable contrast. */
  .labor-num,.insight-mark,.insight-bulb{color:#07111f!important}
  .mandatory-num{color:#2457a3}
  .mandatory-card:nth-child(2) .mandatory-num{color:#315f12}

  /* Detail-page illustrations remain unfiltered and sit on a calm surface. */
  .enterprise-map img,.life-visual img,.expert-visual img,
  .labor-visual img,.articles-visual img,.axdx-step-image img{
    opacity:1;
    filter:none;
    forced-color-adjust:none;
  }
  .enterprise-map,.life-visual,.expert-visual{
    border-radius:16px;
    background:#edf2f7;
  }
  .enterprise-map::after,.life-visual::after,.expert-visual::after{display:none}
  .axdx-step:nth-child(n){border-color:var(--line);background:var(--card)}
  .axdx-step:not(:last-child)::after{border-color:var(--line);background:#182940;color:#bcd4f2}
  .axdx-benefit::before,.insight-divider,.labor-overview .insight-divider{background:var(--line)}

  /* Buttons */
  .btn-ghost,.cta .btn-ghost,.cta.withone-consult-cta .btn-ghost,
  .header .back,.more-btn{
    border-color:#526780;
    background:transparent;
    color:#e8eef6;
  }
  .btn-navy,.hdr .btn{background:#234d7d;color:#fff}
  .btn-gold{background:var(--gold);color:#101c2e!important}
  .cta .btn:not(.btn-gold):not(.btn-ghost){background:#eaf1f9;color:#102b4d}

  /* Injected mobile action bar: override its light defaults in dark mode. */
  .withone-mobile-actions{
    border-color:#3a4e68!important;
    background:rgba(10,20,35,.97)!important;
    box-shadow:0 12px 30px rgba(0,0,0,.36),inset 0 1px 0 rgba(255,255,255,.06)!important;
  }
  .withone-mobile-action{color:#edf3fa!important}
  .withone-mobile-action+.withone-mobile-action::before{background:#34465e!important}
  .withone-mobile-action:nth-child(3){background:#1a304b!important}
  .withone-mobile-action:active{background:#223b5a!important}
  .withone-mobile-chat-icon{
    box-sizing:content-box;
    padding:1px;
    border-radius:3px;
    background:#f7f9fc;
  }

  @media (max-width:640px){
    .pmarq-track{gap:18px;padding-right:18px}
    .pmarq img{width:112px;height:30px;padding:7px 10px;border-radius:8px}
    .hero-fade{background:linear-gradient(180deg,rgba(8,18,32,.22),rgba(8,18,32,.92))}
  }

  @media (max-width:1080px){
    .hdr .drawer,.hdr .drawer.open{
      border-color:var(--line)!important;
      background:#101d30!important;
      color:var(--ink)!important;
    }
    .hdr .drawer a,.hdr .drawer.open a{color:#dfe8f3!important}
    .hdr .drawer .mm-company .mm-row img{
      filter:brightness(0) invert(1)!important;
    }
  }
}
