/* JEB Atelier / Calculateurs — experimental, reversible visual layer.
   Keeps all calculations, field semantics and Excel exports untouched. */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Oswald:wght@600;700&display=swap');
:root{--jeb-ivory:#f8f5ee;--jeb-paper:#fffdf9;--jeb-ink:#242622;--jeb-green:#174c3c;--jeb-blue:#193b68;--jeb-red:#8e2530;--jeb-gold:#b08a49;--jeb-border:#ddd5c7;font-family:"DM Sans",system-ui,sans-serif;color:var(--jeb-ink);background:var(--jeb-ivory)}
body{background:var(--jeb-ivory);color:var(--jeb-ink);padding:0;font-family:"DM Sans",system-ui,sans-serif}
main{max-width:1500px;background:var(--jeb-paper);padding:clamp(16px,2.3vw,32px);border-radius:0;box-shadow:none;min-height:100vh;border-inline:1px solid var(--jeb-border)}
h1,h2,h3{color:var(--jeb-ink);font-family:"DM Sans",system-ui,sans-serif}
h1{font-size:clamp(1.35rem,2vw,1.85rem);line-height:1.2}h2{font-size:1.06rem}
button,input,select,textarea{font-family:"DM Sans",system-ui,sans-serif}
button{background:var(--jeb-green);border-radius:5px;padding:10px 14px}
button:hover:not(:disabled){filter:brightness(1.1)}
button.secondary{background:#eee9df;color:var(--jeb-ink);border:1px solid var(--jeb-border)}
input,select,textarea{background:white;border-color:#bdb6aa;border-radius:5px;padding:9px 10px;color:var(--jeb-ink)}
:focus-visible{outline:3px solid var(--jeb-blue)!important;outline-offset:3px}
small,.note{color:#625f58}
a{color:var(--jeb-blue)}
.home-hero{position:relative;isolation:isolate;overflow:hidden;margin:calc(-1 * clamp(16px,2.3vw,32px)) calc(-1 * clamp(16px,2.3vw,32px)) 0;padding:clamp(30px,4vw,56px) clamp(20px,3vw,45px) 40px;background:linear-gradient(119deg,transparent 0 65%,var(--jeb-green) 65% 73%,var(--jeb-ivory) 73% 74%,var(--jeb-red) 74% 79%,var(--jeb-ivory) 79% 80%,var(--jeb-blue) 80% 100%),var(--jeb-ivory);border-bottom:3px solid var(--jeb-gold)}
.home-hero:before{content:"";position:absolute;right:7%;top:-75px;width:230px;height:230px;border:16px solid #ffffff55;border-radius:50%;z-index:-1}
.home-hero:after{content:"";position:absolute;right:0;bottom:0;width:28%;height:58%;background:repeating-linear-gradient(112deg,transparent 0 25px,#ffffff66 26px 33px,transparent 34px 55px);z-index:-1}
.home-hero h1{font-family:Oswald,"Arial Narrow",sans-serif;text-transform:uppercase;font-size:clamp(2.6rem,5.5vw,5.2rem);font-weight:700;letter-spacing:.012em;line-height:1.06;max-width:700px}
.home-hero p{max-width:600px;color:#4d4a43;font-size:.9rem}
.calculator-grid{gap:14px;margin-top:24px}
.calc-card{position:relative;border:1px solid var(--jeb-border);border-radius:7px;padding:22px 20px;background:white;box-shadow:0 3px 13px #1a20130a;overflow:hidden}
.calc-card:before{content:"";position:absolute;top:0;left:0;width:40%;height:5px;background:linear-gradient(105deg,var(--jeb-green) 0 34%,var(--jeb-blue) 34% 67%,var(--jeb-red) 67%)}
.calc-card h2{font-size:1.2rem;margin-top:5px}
.calc-card p{color:#5d5b54}
.badge{background:#e9f0ea;color:var(--jeb-green);font-size:.73rem;border-radius:4px;padding:4px 8px}
.calc-card.placeholder{background:#f5f1e9}
.backbar{border-bottom:2px solid var(--jeb-gold);padding:8px 0 15px;position:relative}
.backbar:after{content:"";position:absolute;bottom:-4px;right:0;width:110px;height:6px;background:linear-gradient(110deg,var(--jeb-green) 0 33%,var(--jeb-paper) 33% 37%,var(--jeb-blue) 37% 66%,var(--jeb-paper) 66% 70%,var(--jeb-red) 70%)}
.top-meta{color:#655f56}
.card,.atp-block,.pgp-block,.standard-zone,.export-box{border:1px solid var(--jeb-border);background:white;border-radius:7px}
.card{padding:12px}.result{background:#f7f4ed;border-color:var(--jeb-border);border-radius:7px}
th{background:#eee9df;color:var(--jeb-ink)}
th,td{border-color:var(--jeb-border);padding:8px 7px}
.protected-zone,.protected-help,.pgp-convention-note{background:#fff6df;border-color:#b98a39}
.calculated-field,.inline-result,.calculated-help{background:#eaf4ee!important;border-color:#4d9471!important;color:#174c3c}
.proposed-field,.proposed-help{background:#fff0f1!important;border-color:#c65d6a!important;color:#80212c}
.capitalisation-zone,.capitalisation-help{background:#edf3f9;border-color:#6182aa}
.atp-result-card,.pgp-result-card{background:#f7f4ed;border-color:var(--jeb-border);border-radius:6px}
.source-box,.legal-note,.deduction-detail-box,.changelog-panel{background:#f7f4ed;border-color:var(--jeb-border)}
.about-box{border-color:var(--jeb-border);color:#625f56}
#homePage main:after{content:"";display:block;margin-top:26px;height:9px;background:repeating-linear-gradient(125deg,var(--jeb-green) 0 22px,var(--jeb-ivory) 22px 27px,var(--jeb-blue) 27px 49px,var(--jeb-ivory) 49px 54px,var(--jeb-red) 54px 76px,var(--jeb-ivory) 76px 81px)}
@media(max-width:800px){.home-hero{background:linear-gradient(116deg,var(--jeb-ivory) 0 78%,var(--jeb-green) 78% 85%,var(--jeb-red) 85% 92%,var(--jeb-blue) 92%);padding-bottom:26px}.home-hero h1{max-width:78%;font-size:clamp(2.2rem,8vw,3.4rem)}.home-hero:before,.home-hero:after{display:none}.calculator-grid{grid-template-columns:1fr}.backbar{flex-wrap:wrap}.atp-mini-grid,.pgp-mini-grid{grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{transition:none!important;animation:none!important}}

/* ==========================================================
   ATP — compositional UI study, CSS only (no calculation changes).
   Shared geometry, functional hierarchy and restrained ivory surfaces.
   ========================================================== */
#atpPage main{--atp-space:clamp(14px,1.7vw,24px)}
#atpPage .backbar{margin:calc(-1 * clamp(16px,2.3vw,32px)) calc(-1 * clamp(16px,2.3vw,32px)) 20px;
  padding:22px clamp(18px,3vw,40px);min-height:92px;display:flex;align-items:center;gap:20px;
  background:linear-gradient(118deg,transparent 0 83%,var(--jeb-green) 83% 89%,var(--jeb-paper) 89% 89.5%,var(--jeb-red) 89.5% 94%,var(--jeb-paper) 94% 94.5%,var(--jeb-blue) 94.5% 100%),var(--jeb-ivory);
  border-bottom:3px solid var(--jeb-gold)}
#atpPage .backbar h1{font-family:Oswald,"Arial Narrow",sans-serif;text-transform:uppercase;font-weight:700;
  font-size:clamp(1.7rem,3vw,2.65rem);line-height:1.1;letter-spacing:.01em}
#atpPage .backbar .note{font-size:.84rem;margin-top:6px;max-width:620px;color:#55534b}
#atpPage .backbar button{margin-left:auto;flex-shrink:0}
#atpPage .top-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;
  margin-bottom:18px;padding-bottom:12px;border-bottom:1px solid var(--jeb-border)}
#atpPage .protected-help,#atpPage .calculated-help,#atpPage .capitalisation-help{
  font-size:.8rem;line-height:1.4;margin:5px 0;padding:8px 12px;border-radius:5px}
#atpPage .atp-grid{gap:var(--atp-space);align-items:stretch}
#atpPage .atp-block{position:relative;overflow:hidden;padding:0 16px 18px;border:1px solid var(--jeb-border);
  border-radius:8px;background:#fffdf9;box-shadow:0 3px 16px rgba(36,38,34,.045)}
#atpPage .atp-block:before{content:"";position:absolute;top:0;left:0;right:0;height:5px;
  background:linear-gradient(110deg,var(--jeb-green) 0 33%,var(--jeb-paper) 33% 35%,var(--jeb-blue) 35% 67%,var(--jeb-paper) 67% 69%,var(--jeb-red) 69% 100%)}
#atpPage .atp-block h2{position:relative;margin:0 -16px 17px;padding:22px 16px 15px;
  background:#f6f2e9;border-bottom:1px solid var(--jeb-border);font-size:1.03rem;
  font-weight:800;letter-spacing:-.015em;line-height:1.3;min-height:68px}
#atpPage .atp-block:nth-child(1) h2{border-left:5px solid var(--jeb-green)}
#atpPage .atp-block:nth-child(2) h2{border-left:5px solid var(--jeb-blue)}
#atpPage .atp-block:nth-child(3) h2{border-left:5px solid var(--jeb-red)}
#atpPage .atp-mini-grid{gap:14px 12px}
#atpPage .atp-mini-grid>div{min-width:0}
#atpPage .atp-mini-grid label{font-size:.82rem;line-height:1.35;margin-bottom:6px;color:#272a26}
#atpPage .atp-mini-grid small{display:block;margin-top:5px;line-height:1.4;color:#69645c}
#atpPage .atp-mini-grid input,#atpPage .atp-mini-grid textarea{min-height:39px}
#atpPage .atp-mini-grid .protected-zone,#atpPage .atp-mini-grid .capitalisation-zone{
  padding:10px;border-radius:6px}
#atpPage .inline-result{position:relative;margin:0;padding:12px 12px 11px;background:#eef4ef!important;
  border:1px solid #bad0bf;border-left:4px solid var(--jeb-green);border-radius:6px;
  font-size:.8rem;line-height:1.45;min-width:0}
#atpPage .inline-result strong{font-size:clamp(1.04rem,1.3vw,1.35rem);line-height:1.2;
  font-weight:800;letter-spacing:-.02em;margin:6px 0;color:var(--jeb-green);font-variant-numeric:tabular-nums}
#atpPage .green-calc-note{display:block;font-size:.72rem;color:#52665b;overflow-wrap:anywhere}
#atpPage .atp-total{gap:12px}
#atpPage .atp-result-card{background:white;border:1px solid var(--jeb-border);border-top:4px solid var(--jeb-blue);
  padding:15px;border-radius:6px;font-size:.82rem;line-height:1.4;min-width:0}
#atpPage .atp-result-card strong{font-size:clamp(1.12rem,1.5vw,1.5rem);line-height:1.2;
  font-weight:800;color:var(--jeb-green);letter-spacing:-.025em;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
#atpPage .atp-result-card:nth-child(4){background:var(--jeb-green);color:white;border-top-color:var(--jeb-gold)}
#atpPage .atp-result-card:nth-child(4) strong{color:white;font-size:clamp(1.35rem,1.9vw,1.85rem)}
#atpPage .result{border-top:3px solid var(--jeb-gold);margin-top:18px;padding:18px;background:#f7f4ed}
#atpPage .result h2{font-size:1.25rem;font-weight:800;letter-spacing:-.02em}
#atpPage .result table{font-variant-numeric:tabular-nums}
#atpPage .result th{background:#ebe6db}
#atpPage .result td{background:#fffdf9}
#atpPage .result tr:nth-child(even) td{background:#f6f3ec}
#atpPage .result th,#atpPage .result td{padding:10px 8px}
#atpPage button{min-height:36px}
@media(max-width:1200px){#atpPage .atp-grid{grid-template-columns:1fr}#atpPage .atp-block h2{min-height:0}}
@media(max-width:650px){#atpPage .backbar{align-items:flex-start;flex-direction:column;padding:20px 18px;
 background:linear-gradient(112deg,var(--jeb-ivory) 0 88%,var(--jeb-green) 88% 92%,var(--jeb-red) 92% 96%,var(--jeb-blue) 96%)}
 #atpPage .backbar button{margin-left:0}#atpPage .atp-mini-grid{grid-template-columns:1fr 1fr;gap:10px}
 #atpPage .atp-block{padding-left:12px;padding-right:12px}
 #atpPage .atp-block h2{margin-left:-12px;margin-right:-12px;padding-left:12px;padding-right:12px}
 #atpPage .atp-result-card{padding:12px}
}
@media(max-width:390px){#atpPage .atp-mini-grid{grid-template-columns:1fr}}

/* JEB Atelier — PSP + PGP detail screens. CSS-only; calculations unchanged. */
#calculatorPage .backbar,#pgpPage .backbar{position:relative;overflow:hidden;isolation:isolate;
 margin:calc(-1 * clamp(16px,2.3vw,32px)) calc(-1 * clamp(16px,2.3vw,32px)) 20px;
 padding:22px clamp(18px,3vw,40px);min-height:92px;display:flex;align-items:center;gap:20px;
 background:linear-gradient(118deg,transparent 0 83%,var(--jeb-green) 83% 89%,var(--jeb-paper) 89% 89.5%,var(--jeb-red) 89.5% 94%,var(--jeb-paper) 94% 94.5%,var(--jeb-blue) 94.5% 100%),var(--jeb-ivory);
 border-bottom:3px solid var(--jeb-gold)}
#calculatorPage .backbar h1,#pgpPage .backbar h1{font-family:Oswald,"Arial Narrow",sans-serif;text-transform:uppercase;
 font-weight:700;font-size:clamp(1.7rem,3vw,2.65rem);line-height:1.1;letter-spacing:.01em}
#calculatorPage .backbar .note,#pgpPage .backbar .note{font-size:.84rem;margin-top:6px;max-width:620px;color:#55534b}
#calculatorPage .backbar button,#pgpPage .backbar button{margin-left:auto;flex-shrink:0}
#calculatorPage .top-meta,#pgpPage .top-meta{display:flex;align-items:center;justify-content:space-between;
 gap:12px;margin-bottom:18px;padding-bottom:12px;border-bottom:1px solid var(--jeb-border)}
#calculatorPage .result,#pgpPage .result{border-top:3px solid var(--jeb-gold);margin-top:18px;padding:18px;background:#f7f4ed}
#calculatorPage .result h2,#pgpPage .result h2{font-size:1.25rem;font-weight:800;letter-spacing:-.02em}
#calculatorPage .result table,#pgpPage .result table{font-variant-numeric:tabular-nums}
#calculatorPage .result th,#pgpPage .result th{background:#ebe6db}
#calculatorPage .result td,#pgpPage .result td{background:#fffdf9}
#calculatorPage .result tr:nth-child(even) td,#pgpPage .result tr:nth-child(even) td{background:#f6f3ec}
#calculatorPage .result th,#calculatorPage .result td,#pgpPage .result th,#pgpPage .result td{padding:10px 8px}
#calculatorPage button,#pgpPage button{min-height:36px}
#calculatorPage .protected-help,#calculatorPage .calculated-help,#pgpPage .protected-help,
#pgpPage .calculated-help,#pgpPage .capitalisation-help,#pgpPage .proposed-help{
 font-size:.8rem;line-height:1.4;margin:5px 0;padding:8px 12px;border-radius:5px}
#calculatorPage .standard-zone{position:relative;border:1px solid var(--jeb-border);border-radius:8px;
 background:#fffdf9;padding:14px;box-shadow:0 3px 16px rgba(36,38,34,.04)}
#calculatorPage .standard-zone h2,#calculatorPage .standard-zone h3{font-weight:800;letter-spacing:-.015em}
#calculatorPage .standard-zone .protected-zone{border-radius:6px}
#calculatorPage .card{border:1px solid var(--jeb-border);border-radius:7px;background:#fffdf9;
 box-shadow:0 2px 12px rgba(36,38,34,.035)}
#calculatorPage .card>h2,#calculatorPage .card>h3{font-weight:800;letter-spacing:-.015em}
#calculatorPage .result .card,#calculatorPage .result .result-card{border-top:3px solid var(--jeb-blue)}
#calculatorPage .result strong,#pgpPage .result strong{font-variant-numeric:tabular-nums}
#calculatorPage .inline-result,#pgpPage .inline-result{border-left:4px solid var(--jeb-green);
 border-radius:6px;padding:11px;background:#eef4ef!important}
#pgpPage .pgp-grid{gap:clamp(14px,1.7vw,24px)}
#pgpPage .pgp-block{position:relative;overflow:hidden;border:1px solid var(--jeb-border);
 border-radius:8px;background:#fffdf9;box-shadow:0 3px 16px rgba(36,38,34,.045);padding:0 16px 18px}
#pgpPage .pgp-block:before{content:"";position:absolute;top:0;left:0;right:0;height:5px;
 background:linear-gradient(110deg,var(--jeb-green) 0 33%,var(--jeb-paper) 33% 35%,var(--jeb-blue) 35% 67%,var(--jeb-paper) 67% 69%,var(--jeb-red) 69% 100%)}
#pgpPage .pgp-block>h2{margin:0 -16px 17px;padding:22px 16px 15px;background:#f6f2e9;
 border-bottom:1px solid var(--jeb-border);font-size:1.08rem;font-weight:800;letter-spacing:-.015em;
 line-height:1.3;border-left:5px solid var(--jeb-green)}
#pgpPage .pgp-block:nth-child(2)>h2{border-left-color:var(--jeb-blue)}
#pgpPage .pgp-block:nth-child(3)>h2{border-left-color:var(--jeb-red)}
#pgpPage .pgp-mini-grid{gap:14px 12px}
#pgpPage .pgp-mini-grid label{font-size:.82rem;line-height:1.35;margin-bottom:6px;color:#272a26}
#pgpPage .pgp-mini-grid small{display:block;margin-top:5px;line-height:1.4;color:#69645c}
#pgpPage .pgp-period-row{background:white;border:1px solid var(--jeb-border);
 border-left:4px solid var(--jeb-blue);border-radius:7px;padding:12px;margin-bottom:12px}
#pgpPage .pgp-period-row h3{font-weight:800;letter-spacing:-.015em}
#pgpPage .pgp-period-results{gap:10px}
#pgpPage .pgp-result-card{background:white;border:1px solid var(--jeb-border);
 border-top:4px solid var(--jeb-blue);border-radius:6px;padding:14px;font-size:.82rem;line-height:1.4}
#pgpPage .pgp-result-card strong{font-size:clamp(1.05rem,1.4vw,1.45rem);
 font-weight:800;color:var(--jeb-green);letter-spacing:-.02em;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
#pgpPage .pgp-result-grid{gap:12px}
#pgpPage .pgp-formula-note{background:#f7f4ed;border:1px solid var(--jeb-border);border-radius:6px}
#pgpPage .pgp-convention-note{border-radius:6px}
@media(max-width:650px){
 #calculatorPage .backbar,#pgpPage .backbar{align-items:flex-start;flex-direction:column;padding:20px 18px;
 background:linear-gradient(112deg,var(--jeb-ivory) 0 88%,var(--jeb-green) 88% 92%,var(--jeb-red) 92% 96%,var(--jeb-blue) 96%)}
 #calculatorPage .backbar button,#pgpPage .backbar button{margin-left:0}
 #pgpPage .pgp-block{padding-left:12px;padding-right:12px}
 #pgpPage .pgp-block>h2{margin-left:-12px;margin-right:-12px;padding-left:12px;padding-right:12px}
}
