/* PET BRO display settings: night mode and high contrast.
   Loaded last on every page. petbro-theme.js sets data-theme and data-contrast on <html>.
   Remove this <link> and the petbro-theme.js <script> to go back to light only. */

/* ---------- Colour tokens ---------- */
html[data-theme=dark]{color-scheme:dark;
  --pb-bg:#0F1013;--pb-card:#1A1C21;--pb-surface:#23262C;--pb-line:#30343B;--pb-field:#14161A;
  --pb-ink:#F2F3F5;--pb-muted:#A9AEB7;--pb-tint:#3A2116;--pb-accent-text:#FB923C;--pb-hero:#20232A;
  --pb-accent:#C2410C;--pb-accent-dark:#9A3412;
  --ink:#F2F3F5;--muted:#A9AEB7;--line:#30343B;--navy:#F2F3F5;--white:#1A1C21;--cream:#1A1C21;--accent:#FB923C}
html[data-contrast=high]:not([data-theme=dark]){
  --pb-ink:#000;--pb-muted:#2B2E33;--pb-line:#5E636C;--pb-surface:#EDEEF1;--pb-tint:#FFE4D3;
  --pb-accent:#9A3412;--pb-accent-dark:#7C2D12;--pb-accent-text:#9A3412;
  --ink:#000;--muted:#2B2E33;--line:#5E636C;--accent:#9A3412}
html[data-theme=dark][data-contrast=high]{
  --pb-bg:#000;--pb-card:#0B0B0D;--pb-surface:#17181B;--pb-line:#8A9099;--pb-field:#000;
  --pb-ink:#fff;--pb-muted:#E2E4E8;--pb-tint:#45200D;--pb-accent-text:#FDBA74;--pb-hero:#0B0B0D;
  --pb-accent:#9A3412;--pb-accent-dark:#7C2D12;
  --ink:#fff;--muted:#E2E4E8;--line:#8A9099;--accent:#FDBA74}

/* ---------- Night mode: app (index.html) ---------- */
html[data-theme=dark] body{background:var(--pb-bg);background-image:none;color:var(--pb-ink)}
html[data-theme=dark] body :is(h1,h2,h3,h4,strong,b,label){color:var(--pb-ink)}
html[data-theme=dark] body :is(p,small,li){color:inherit}
html[data-theme=dark] body .eyebrow,html[data-theme=dark] body .hero-kicker{color:var(--pb-accent-text)}
html[data-theme=dark] body .card,html[data-theme=dark] body .panel .dog-card,html[data-theme=dark] body .panel:not(#home)>.card,
html[data-theme=dark] body .pack-stat,html[data-theme=dark] body .action,html[data-theme=dark] body .panel:not(#home)>.heading,
html[data-theme=dark] body .dog,html[data-theme=dark] body .auth-card{background:var(--pb-card);border-color:var(--pb-line);color:var(--pb-ink);box-shadow:none}
html[data-theme=dark] body .action:hover{background:var(--pb-surface);border-color:var(--pb-accent-text)}
html[data-theme=dark] body .section-emblem,html[data-theme=dark] body .action .symbol,html[data-theme=dark] body .stat-icon,
html[data-theme=dark] body .pack-stat:nth-child(n) .stat-icon,html[data-theme=dark] body .avatar{background:var(--pb-tint);color:var(--pb-accent-text)}
html[data-theme=dark] body .section-emblem svg{color:var(--pb-accent-text)}
html[data-theme=dark] body .dogpic{background:var(--pb-surface)}
html[data-theme=dark] body .tag,html[data-theme=dark] body .status{background:var(--pb-surface);border-color:var(--pb-line);color:var(--pb-ink)}
html[data-theme=dark] body .status.error{background:#3B1212;border-color:#7F1D1D;color:#FECACA}
html[data-theme=dark] body .notice,html[data-theme=dark] body .pb-welcome{background:var(--pb-tint);border-color:#7C3A1A;color:#FED7C3}
html[data-theme=dark] body .notice b{color:#fff}
html[data-theme=dark] body :is(.field input,.field select,.field textarea,.panel select,.panel input:not([type=checkbox]):not([type=radio]):not([type=hidden]),.panel textarea,.auth-card input,textarea){
  background:var(--pb-field);border-color:var(--pb-line);color:var(--pb-ink)}
html[data-theme=dark] body ::placeholder{color:#7D828C}
html[data-theme=dark] body #chat-history{background:var(--pb-field);border-color:var(--pb-line)}
html[data-theme=dark] body #chat-history>div{background:var(--pb-card);border-color:var(--pb-line);color:var(--pb-ink)}
html[data-theme=dark] body #chat-history b{color:var(--pb-accent-text)}
html[data-theme=dark] body .hero{background:var(--pb-hero);border:1px solid var(--pb-line)}
html[data-theme=dark] body .auth-wrap{background:var(--pb-bg)}
html[data-theme=dark] body .auth-card p{color:var(--pb-muted)}
html[data-theme=dark] body .auth-switch,html[data-theme=dark] body :is(p,li,.pb-legal-links,.legal,.card,.notice) a:not(.btn):not(.pb-btn):not(.pb-ask){color:var(--pb-accent-text)}
html[data-theme=dark] body .btn.outline{background:var(--pb-card);color:var(--pb-ink);border-color:var(--pb-line)}
html[data-theme=dark] body .btn.outline:hover{background:var(--pb-surface)}
html[data-theme=dark] body .btn.dark{background:var(--pb-accent);color:#fff}
html[data-theme=dark] body .btn.dark:hover{background:var(--pb-accent-dark)}
html[data-theme=dark] body .topbar{background:rgba(15,16,19,.86);border-bottom-color:var(--pb-line);box-shadow:none}
html[data-theme=dark] body .topbar .user,html[data-theme=dark] body #top-user{color:var(--pb-muted)}
html[data-theme=dark] body .sidebar{background:#090A0C;border-right:1px solid var(--pb-line)}
html[data-theme=dark] body .bottom-nav{background:rgba(26,28,33,.94);border-color:var(--pb-line);box-shadow:0 6px 24px #0008}
html[data-theme=dark] body .bottom-nav button{color:var(--pb-muted)}
html[data-theme=dark] body .bottom-nav button.active,html[data-theme=dark] body .bottom-nav button[aria-current],
html[data-theme=dark] body.menu-open .mobile-menu-toggle,html[data-theme=dark] body .menu-open .mobile-menu-toggle{background:var(--pb-tint);color:var(--pb-accent-text)}
html[data-theme=dark] body .mobile-menu-toggle{color:var(--pb-muted)}
html[data-theme=dark] body .pb-note,html[data-theme=dark] body .pb-welcome p,html[data-theme=dark] body .pb-delete form>p{color:var(--pb-muted)}
html[data-theme=dark] body .pb-delete>summary{color:#F87171}
html[data-theme=dark] body [style*="color:var(--muted)"]{color:var(--pb-muted)!important}
html[data-theme=dark] body [style*="color:#526176"]{color:var(--pb-muted)!important}
html[data-theme=dark] body [style*="background:#f5f7fb"]{background:var(--pb-surface)!important}
html[data-theme=dark] body hr{border-color:var(--pb-line)}
/* Logo files are dark-on-light: keep them on a light chip so they stay readable */
html[data-theme=dark] body .topbar .mobile-brand{background:#F7F7F8}
html[data-theme=dark] body .auth-card>img{background:#F7F7F8;border-radius:12px;padding:6px}

/* ---------- Night mode: shop ---------- */
html[data-theme=dark] body.premium-shop{background:var(--pb-bg);color:var(--pb-ink)}
html[data-theme=dark] .premium-shop .top{background:rgba(15,16,19,.86);border-bottom-color:var(--pb-line);color:var(--pb-ink);box-shadow:none}
html[data-theme=dark] .premium-shop .top a:not(.top-book){background:var(--pb-card);border-color:var(--pb-line);color:var(--pb-ink);box-shadow:none}
html[data-theme=dark] .premium-shop .brand img{background:#F7F7F8;border-radius:10px;padding:3px 5px}
html[data-theme=dark] .premium-shop .brand span{color:var(--pb-muted);border-left-color:var(--pb-line)}
html[data-theme=dark] .premium-shop :is(h1,h2,h3,.section-title,.pb-cats-head,.product-price,strong){color:var(--pb-ink)}
html[data-theme=dark] .premium-shop :is(.intro,.product-type,small,.pb-shop-note){color:var(--pb-muted)}
html[data-theme=dark] .premium-shop .eyebrow,html[data-theme=dark] .pb-num,html[data-theme=dark] .pb-journey a{color:var(--pb-accent-text)}
html[data-theme=dark] .premium-shop .hero.pb-hero,html[data-theme=dark] .pb-band{background:var(--pb-hero);border:1px solid var(--pb-line)}
html[data-theme=dark] .premium-shop :is(.pb-cat,.pb-why li,.pb-trust li,.pb-journey li,.pb-filters,.product-card,.delivery,.need-browser,.catalogue-filters,.catalogue-filters select,.need-options button,.catalogue-pages button){
  background:var(--pb-card);border-color:var(--pb-line);color:var(--pb-ink);box-shadow:none}
html[data-theme=dark] .premium-shop .pb-journey li{border-top-color:var(--pb-ink)}
html[data-theme=dark] .premium-shop .pb-cat[aria-pressed=true]{background:var(--pb-tint);border-color:var(--pb-accent-text);color:var(--pb-accent-text)}
html[data-theme=dark] .premium-shop .need-options button[aria-pressed=true]{background:var(--pb-ink);border-color:var(--pb-ink);color:#17181C}
html[data-theme=dark] .premium-shop :is(.pb-why li>span:first-child){background:var(--pb-tint);color:var(--pb-accent-text)}
html[data-theme=dark] .premium-shop .pb-trust svg{color:var(--pb-accent-text)}
html[data-theme=dark] .premium-shop .product-photo{background:#F4F5F7}
html[data-theme=dark] .premium-shop .category-search{background:var(--pb-surface);border-color:var(--pb-line);color:var(--pb-ink)}
html[data-theme=dark] .premium-shop .category-search input{background:transparent;color:var(--pb-ink)}
html[data-theme=dark] .premium-shop .need-guidance,html[data-theme=dark] .premium-shop .notice{background:var(--pb-surface);border-color:var(--pb-line);color:var(--pb-muted)}
html[data-theme=dark] .premium-shop .need-guidance a{color:var(--pb-accent-text)}
html[data-theme=dark] .premium-shop .pb-ask{background:transparent;border-color:var(--pb-accent-text);color:var(--pb-accent-text)!important}
html[data-theme=dark] .premium-shop .pb-ask:hover{background:var(--pb-tint)}
html[data-theme=dark] .premium-shop .pb-btn.outline{background:transparent;color:var(--pb-ink)!important;border-color:var(--pb-ink)}
html[data-theme=dark] .premium-shop footer{background:#090A0C;border-top:1px solid var(--pb-line)}
html[data-theme=dark] .shop-bottom{background:rgba(26,28,33,.94);border-color:var(--pb-line);box-shadow:0 6px 24px #0008}
html[data-theme=dark] .shop-bottom a{color:var(--pb-muted)}
html[data-theme=dark] .shop-bottom a[aria-current]{background:var(--pb-tint);color:var(--pb-accent-text)}
html[data-theme=dark] .premium-shop .pb-sticky-cta{box-shadow:0 6px 18px #0009}

/* ---------- Night mode: privacy and terms ---------- */
html[data-theme=dark] body .legal-top{background:rgba(15,16,19,.93);border-bottom-color:var(--pb-line)}
html[data-theme=dark] body .legal-top img{background:#F7F7F8;border-radius:10px;padding:3px 6px}
html[data-theme=dark] body .legal-back{color:var(--pb-ink);border-color:var(--pb-line)}
html[data-theme=dark] body .legal-meta{color:var(--pb-muted)}
html[data-theme=dark] body .legal-kicker{color:var(--pb-accent-text)}

/* ---------- High contrast (light and dark) ---------- */
html[data-contrast=high] body{font-weight:500}
html[data-contrast=high] body :is(.card,.pack-stat,.action,.dog-card,.panel:not(#home)>.heading,.product-card,.pb-cat,.pb-why li,.pb-trust li,.pb-filters,.delivery,.status,.tag,.notice,.auth-card,.pb-welcome,.bottom-nav,.shop-bottom,.need-guidance,.category-search){
  border-width:2px!important;border-style:solid!important;border-color:var(--pb-line)!important;box-shadow:none!important}
html[data-contrast=high] body :is(input:not([type=checkbox]):not([type=radio]),select,textarea){border:2px solid var(--pb-ink)!important}
html[data-contrast=high] body :is(p,small,li,.pb-note,.product-type,.intro,.legal-meta){color:var(--pb-ink)}
html[data-contrast=high] body :is([style*="color:var(--muted)"],[style*="color:#526176"]){color:var(--pb-ink)!important}
html[data-contrast=high] body a:not(.btn):not(.pb-btn):not(.top-book):not(.pb-ask):not(.legal-back):not(.shop-bottom a):not(.top a):not(.pb-journey a){text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:2px}
html[data-contrast=high] body :is(.btn,.pb-btn,.top-book){background:var(--pb-accent);color:#fff!important}
html[data-contrast=high] body :is(.btn.outline,.pb-btn.outline){background:transparent;color:var(--pb-ink)!important;border:2px solid var(--pb-ink)!important}
html[data-contrast=high] body .btn.dark{background:var(--pb-ink);color:var(--pb-bg,#fff)!important}
html[data-contrast=high] body :where(button,a,input,select,textarea,summary,[tabindex]):focus-visible{outline:4px solid var(--pb-ink)!important;outline-offset:3px;box-shadow:0 0 0 7px var(--pb-accent-text,#9A3412)!important}
html[data-contrast=high] body :is(.bottom-nav button,.shop-bottom a,.mobile-menu-toggle){color:var(--pb-ink)}
html[data-contrast=high] body :is(.bottom-nav button.active,.bottom-nav button[aria-current],.shop-bottom a[aria-current]){background:var(--pb-ink)!important;color:var(--pb-bg,#fff)!important}
html[data-contrast=high] body .sidebar .nav button{color:#fff}
html[data-contrast=high] body .sidebar .nav button.active{outline:2px solid #fff}
html[data-contrast=high] body .hero p,html[data-contrast=high] .pb-hero p,html[data-contrast=high] .pb-band p,html[data-contrast=high] .premium-shop footer{color:#fff!important}
html[data-contrast=high]:not([data-theme=dark]) body{background:#fff;background-image:none}
html[data-contrast=high]:not([data-theme=dark]) body .topbar,html[data-contrast=high]:not([data-theme=dark]) .premium-shop .top{background:#fff;border-bottom:2px solid #000}
html[data-contrast=high]:not([data-theme=dark]) body :is(.bottom-nav,.shop-bottom){background:#fff}
html[data-contrast=high]:not([data-theme=dark]) body .hero,html[data-contrast=high]:not([data-theme=dark]) .pb-hero,html[data-contrast=high]:not([data-theme=dark]) .pb-band{background:#000}
html[data-contrast=high]:not([data-theme=dark]) body :is(.eyebrow,.hero-kicker,.auth-switch,.pb-num){color:#9A3412}
html[data-contrast=high]:not([data-theme=dark]) body .notice{color:#000;border-color:#9A3412!important}
html[data-contrast=high] *{-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
html[data-theme=dark][data-contrast=high] body :is(.bottom-nav,.shop-bottom,.topbar,.legal-top),html[data-theme=dark][data-contrast=high] .premium-shop .top{background:#000}

/* ---------- Display controls ---------- */
.pb-theme-btn{display:inline-grid;place-items:center;width:44px;height:44px;flex:none;border-radius:999px;border:1px solid var(--pb-line,#E6E7EA);background:transparent;color:var(--pb-ink,#17181C);cursor:pointer;padding:0}
.pb-theme-btn svg{width:20px;height:20px}
.pb-theme-btn:hover{background:var(--pb-surface,#F4F5F7)}
.pb-theme-btn:focus-visible{outline:3px solid var(--pb-accent,#C2410C);outline-offset:2px}
.topbar .pb-theme-btn{margin-left:auto}
.topbar .pb-theme-btn+.user{margin-left:0}
.legal-top .pb-theme-btn{margin-left:auto;margin-right:8px}
.pb-display h3{margin:0 0 4px}
.pb-display>p{margin:0 0 14px;color:var(--pb-muted);font-size:14px}
.pb-seg{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:4px;border-radius:14px;background:var(--pb-surface,#F4F5F7);border:1px solid var(--pb-line,#E6E7EA);margin:0 0 14px}
.pb-seg button{min-height:44px;border:0;border-radius:10px;background:transparent;color:var(--pb-muted,#5B5F68);font:inherit;font-size:14px;font-weight:700;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:6px}
.pb-seg button svg{width:16px;height:16px}
.pb-seg button[aria-pressed=true]{background:var(--pb-card,#fff);color:var(--pb-ink,#17181C);box-shadow:0 1px 3px #0000001f}
html[data-contrast=high] .pb-seg button[aria-pressed=true]{background:var(--pb-ink);color:var(--pb-bg,#fff);box-shadow:none}
.pb-switch-row{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:52px;padding:4px 0}
.pb-switch-row span{display:block}
.pb-switch-row strong{display:block;font-size:15px}
.pb-switch-row small{display:block;font-size:13px;color:var(--pb-muted)}
.pb-switch{position:relative;width:52px;height:32px;flex:none;border-radius:999px;border:0;background:#9CA0A8;cursor:pointer;padding:0}
.pb-switch::after{content:"";position:absolute;top:4px;left:4px;width:24px;height:24px;border-radius:50%;background:#fff;transition:transform .18s}
.pb-switch[aria-checked=true]{background:var(--pb-accent,#C2410C)}
.pb-switch[aria-checked=true]::after{transform:translateX(20px)}
.pb-switch:focus-visible{outline:3px solid var(--pb-accent,#C2410C);outline-offset:3px}
html[data-contrast=high] .pb-switch{border:2px solid var(--pb-ink)}

/* ---------- Quick wins (9 Nov) ---------- */
.pb-vaccine-card{border-color:var(--pb-accent,#C2410C)!important}
.pb-vaccine-card .section-title h3{color:var(--pb-accent,#C2410C)}
html[data-theme=dark] .pb-vaccine-card .section-title h3{color:var(--pb-accent-text)}
.pb-vaccine-sub{margin:0 0 10px;font-size:14px;color:var(--pb-muted,#5B5F68)}
html body .product-card .product-body small.pb-value{display:block;margin:2px 0 8px;font-size:14px;font-weight:800;color:var(--pb-accent,#C2410C)}
html body .product-card .product-body small.pb-value span{display:block;margin-top:2px;font-size:12px;font-weight:500;color:var(--pb-muted,#5B5F68)}
html[data-theme=dark] body .product-card .product-body small.pb-value{color:var(--pb-accent-text)}
