/* Nordic Legacy — reference 1536 × 1024, independent graphical assets, live HTML. */
:root{--med-bg:#08090b;--med-panel:#151515;--med-gold:#c99549;--med-light:#f0bc62;--med-bronze:#79502a;--med-ivory:#f3e9d7;--med-texture:url('../assets/medieval/backgrounds/texture.webp');--gold:#d4a158;--gold-2:#f0bc62;--text:#f3e9d7;--muted:#bdb1a1;--pos:#50d86a;--neg:#df8073;--bg:#08090b;--surface:#151515;--line:#6c5136;--heritage:Georgia,'Times New Roman',serif}
body{background:#08090b;color:var(--med-ivory)} .medieval-shell{font-family:Georgia,'Times New Roman',serif;background:#090a0b}.medieval-shell button,.medieval-shell input,.medieval-shell select{font-family:inherit}.medieval-shell .view{max-width:1600px}.medieval-shell .top{background:#101012;border-bottom:1px solid #70502c}.medieval-shell .top .icon{color:var(--med-light)}.medieval-shell .side{background:linear-gradient(#08090b55,#08090b66),var(--med-texture);border-right:3px double #926239;padding:10px 15px 0;position:sticky}.medieval-shell .med-brand{display:block;text-align:center;flex:none}.med-logo{display:block;width:100%;max-width:220px;margin:auto;height:150px;object-fit:contain}.medieval-shell .side nav{margin:8px 0 0;gap:0;flex:none}.medieval-shell .nav-i{border-radius:0;padding:9px 12px;min-height:54px;font:19px/1.2 Georgia,serif;color:#f3e9d7;border-bottom:1px solid #81613b55;gap:13px;white-space:normal}.medieval-shell .nav-i.on{border:1px solid #c28b48;background:linear-gradient(100deg,#563c20,#25190f);box-shadow:inset 0 0 12px #c9954930;color:#fff1db}.medieval-shell .nav-i:hover{background:#61421e55;color:#ffdc93}.medieval-shell .nav-sep{color:#c9a46a;margin-top:9px}.medieval-shell .side:after{content:'';display:block;min-height:155px;flex:1;background:url('../assets/medieval/backgrounds/sidebar.webp') center bottom/cover no-repeat;margin:10px -12px 0;pointer-events:none}.med-icon{width:35px;height:35px;object-fit:contain;flex:none;mix-blend-mode:screen}.medieval-shell .nav-i .med-icon{width:30px;height:30px}.medieval-shell .tabbar{background:#101012;border-top-color:#79502a}.medieval-shell .tabbar button.on{color:#f0bc62}
.med-dashboard{display:flex;flex-direction:column;gap:14px;min-width:0;width:100%}.med-frame{position:relative;border:1px solid #bd884c;border-radius:0;background:linear-gradient(115deg,#ffffff04,#0006),var(--med-texture);box-shadow:inset 0 0 0 2px #101012,inset 0 0 0 3px #6c492b77,0 2px 6px #0008;clip-path:polygon(10px 0,calc(100% - 10px) 0,100% 10px,100% calc(100% - 10px),calc(100% - 10px) 100%,10px 100%,0 calc(100% - 10px),0 10px)}.med-frame:before,.med-frame:after{content:'';position:absolute;width:13px;height:13px;border-color:#e2b677;pointer-events:none;z-index:1}.med-frame:before{top:3px;left:3px;border-top:1px solid;border-left:1px solid;transform:rotate(-0deg)}.med-frame:after{right:3px;bottom:3px;border-bottom:1px solid;border-right:1px solid}.med-banner{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:110px;padding:8px 14px;background:linear-gradient(90deg,#08090b 0%,#08090bb0 25%,transparent 55%,#08090b88 100%),url('../assets/medieval/backgrounds/castle.webp') center right 30%/auto 100% no-repeat,#11100f;border-bottom:1px solid #72502d}.med-welcome{display:flex;align-items:center;gap:18px;min-width:0}.med-avatar{width:94px;height:94px;object-fit:cover;border:1px solid #b98546}.med-welcome h1{font:clamp(21px,2.25vw,34px)/1.15 Georgia,serif;margin:0 0 8px;color:#f3e2cb;text-shadow:0 2px 3px #000}.med-welcome p{color:#d9b98b;font-size:clamp(14px,1.5vw,22px);margin:0}.med-goal{width:300px;max-width:45%;padding:13px 15px;flex:none;cursor:pointer;text-align:left;font-size:20px;color:#f0d09c}.med-progress{display:block;position:relative;height:22px;border:1px solid #b57b39;background:#1a120d;margin-top:9px;overflow:hidden}.med-progress i{display:block;height:100%;background:linear-gradient(#ffcf78,#a86e22);animation:med-progress-in .65s ease-out;transform-origin:left}.med-progress b{position:absolute;inset:0;text-align:center;font:14px/20px Georgia,serif;text-shadow:0 1px 3px #000;color:#fff7e7}@keyframes med-progress-in{from{transform:scaleX(0)}to{transform:scaleX(1)}}
.med-summary.hero{display:grid;grid-template-columns:1.42fr 1fr 1fr 1fr;align-items:center;min-height:142px;padding:15px 12px;gap:0;background:linear-gradient(115deg,#ffffff06,#0007),var(--med-texture);margin:0;text-align:left}.med-summary .med-net{min-width:0;text-align:center;padding:0 10px}.med-net>small{display:block;font:clamp(16px,1.5vw,23px) Georgia,serif;color:#f2dfc3}.med-summary .hero-amount{display:block;font:700 clamp(27px,3.55vw,56px)/1.13 Georgia,serif;color:#f0bc62;letter-spacing:-.035em;white-space:normal;overflow-wrap:anywhere;margin:7px 0;text-shadow:0 2px 2px #2d1806}.med-delta{display:block;font-size:13px;color:#d8c8ad}.med-stat{border:0;border-left:1px solid #8e6c45;background:none;display:flex;align-items:center;text-align:left;gap:11px;min-width:0;padding:12px 15px;cursor:pointer;min-height:82px}.med-stat .med-icon{width:40px;height:40px}.med-stat span{min-width:0}.med-stat small{display:block;font-size:clamp(12px,1.15vw,17px);color:#f1dfc8}.med-stat strong{display:block;font:700 clamp(17px,1.8vw,29px)/1.25 Georgia,serif;color:#f4e8d6;overflow-wrap:anywhere;margin-top:5px}.med-stat:hover{background:#d9a4580c}
.med-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.med-card.heritage-tile{display:flex;flex-direction:column;gap:0;min-width:0;min-height:0;padding:0;border-radius:0;text-align:left;cursor:pointer;overflow:hidden;color:#f3e9d7;background:var(--med-texture);border-color:#be8a50;transition:filter .2s,border-color .2s}.med-card:hover{filter:brightness(1.12);border-color:#ffe09c}.med-card-title{display:flex;align-items:center;gap:10px;padding:10px 13px;min-height:58px;border-bottom:1px solid #ad7c46;font:700 clamp(16px,1.7vw,27px)/1.15 Georgia,serif}.med-card-title .med-icon{width:33px;height:33px}.med-scene{display:block;position:relative;width:100%;aspect-ratio:1.72;background:radial-gradient(ellipse at 50% 62%,#422c1d66,transparent 75%),#100e0d;overflow:hidden}.med-scene img{display:block;width:100%;height:100%;object-fit:contain;image-rendering:auto;position:absolute;inset:0}.med-card-foot{display:flex;align-items:center;justify-content:space-between;gap:7px;border-top:1px solid #8b653e;padding:11px 15px;min-height:76px;width:100%}.med-card-foot>span:first-child{min-width:0}.med-card.heritage-tile strong{display:block;color:#fff0dd;font:700 clamp(20px,2vw,31px)/1.17 Georgia,serif;overflow-wrap:anywhere;white-space:normal}.med-card.heritage-tile small{display:block;color:#e2ceb1;font-size:13px;margin-top:5px}.med-arrow{display:grid;place-items:center;flex:none;width:31px;height:34px;border:1px solid #b7844b;border-radius:9px;color:#ffd58c;font:30px/1 Georgia,serif}.med-card:hover .med-arrow{transform:translateX(2px)}
.med-charts{display:grid;grid-template-columns:1fr 1.1fr;gap:14px}.med-chart{padding:9px 14px 12px;min-height:234px;min-width:0}.med-chart h2{display:flex;align-items:center;gap:9px;font:700 clamp(16px,1.5vw,22px)/1.3 Georgia,serif;margin:0 0 12px;color:#f3e9d7}.med-chart h2 .med-icon{width:31px;height:31px}.med-donut-layout{display:grid;grid-template-columns:minmax(130px, .9fr) minmax(0,1.2fr);gap:16px;align-items:center}.med-donut{aspect-ratio:1;max-width:188px;width:100%;border-radius:50%;display:grid;place-items:center;border:1px solid #dcad64;box-shadow:0 3px 8px #0009;margin:auto}.med-donut>div{display:grid;place-content:center;text-align:center;width:70%;height:70%;border-radius:50%;background:#111112;box-shadow:inset 0 0 12px #0009;border:1px solid #9d7138}.med-donut strong{font:700 clamp(13px,1.4vw,24px) Georgia,serif;overflow-wrap:anywhere;padding:0 6px}.med-donut small{font-size:12px;color:#e3d2b9}.med-legend>div{display:flex;align-items:center;gap:7px;min-height:37px;border-bottom:1px solid #8a653740;font-size:14px}.med-legend .med-icon{width:23px;height:23px}.med-legend span{flex:1;min-width:0}.med-legend b{font-size:14px}.med-legend>small{display:block;margin-top:5px;font-size:11px}.med-history{display:block;width:100%;max-height:180px;overflow:visible}.med-history text{font:13px Georgia,serif;fill:#e4d2b9}.med-chart-point{margin:0;text-align:right;font-size:13px;color:#e9ca90}.med-history circle[role=button]{cursor:pointer}.med-gallery{display:grid;grid-template-columns:145px repeat(6,minmax(0,1fr));gap:7px;min-height:160px;align-items:stretch;padding:10px 12px}.med-gallery button{background:none;border:0;color:#f1e0c9;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:0;gap:4px;font:16px Georgia,serif;padding:2px}.med-gallery button img{width:100%;height:112px;object-fit:contain;mix-blend-mode:screen}.med-gallery button:hover{filter:brightness(1.23);color:#ffe1a0}.med-gallery .med-add-property{border:1px dashed #d2a262;padding:10px;border-radius:0;text-align:center}.med-add-property b{font:36px Georgia,serif;color:#e7b15b}.med-extra-links{display:flex;flex-wrap:wrap;gap:8px}.medieval-shell .panel,.medieval-shell .card,.medieval-shell .loan-c,.medieval-shell .pocket,.medieval-shell .kpi,.medieval-shell .view:not([data-da-route=accueil]) .view-h{background:linear-gradient(130deg,#0000,#0005),var(--med-texture);border-color:#936739;border-radius:3px;box-shadow:inset 0 0 0 1px #a477362b}.medieval-shell .view:not([data-da-route=accueil]) .view-h:before{opacity:.13}.medieval-shell .btn,.sheet .btn{border-radius:3px}.medieval-shell .btn.primary,.sheet .btn.primary{background:linear-gradient(#e8bd72,#b57d37);border-color:#e6be7a;color:#21150b}.medieval-shell .view h1,.medieval-shell .view h2{font-family:Georgia,serif}.medieval-shell .heritage-home .hero::before{display:none}.medieval-shell .view[data-da-route=accueil]{max-width:none;padding:0 14px 20px;gap:0}.medieval-shell.heritage-home .top{height:42px;padding:0 12px;position:relative;background:#0c0b0b}.medieval-shell.heritage-home .top .heritage-brand{display:none}.medieval-shell.heritage-home .top .icon{height:38px;width:38px}.medieval-shell.heritage-home .main{padding-bottom:15px}.med-property-visual{display:flex;flex-direction:column;gap:12px;align-items:flex-start}.med-property-photo{display:block;max-width:100%;max-height:330px;object-fit:contain}.med-library{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:15px}.med-library button{display:flex;flex-direction:column;align-items:center;white-space:normal;min-width:0;padding:7px}.med-library img{width:100%;height:95px;object-fit:contain}.med-intro{position:fixed;inset:0;z-index:10000;background:#050403;display:flex;align-items:center;justify-content:center;overflow:hidden}.med-intro video{width:100%;height:100%;object-fit:contain;display:block}.med-intro-controls{position:absolute;bottom:max(22px,env(safe-area-inset-bottom));right:max(20px,env(safe-area-inset-right));display:flex;gap:8px}.med-intro-controls .btn{background:#15110be8;border:1px solid #c99549;color:#f3e9d7;min-height:44px}.med-intro-controls .primary{background:#b77c34;color:#130c06}
@media(min-width:1000px){.medieval-shell{grid-template-columns:clamp(210px,16.73vw,257px) minmax(0,1fr)}.medieval-shell.heritage-home .top{position:absolute;top:0;right:13px;z-index:22;background:transparent;border:0;height:32px;transform:translateY(0);display:flex;justify-content:flex-end}.medieval-shell.heritage-home .top-t{display:none}.medieval-shell.heritage-home .top .icon{height:30px;width:30px;background:#0b0b0bba}.medieval-shell.heritage-home .med-goal{margin-top:22px}.medieval-shell.heritage-home .top-add{display:none}.medieval-shell .main{min-width:0}.medieval-shell .side nav{max-height:none}.medieval-shell .side .nav-sep{margin-top:14px}.medieval-shell .side nav .nav-i:nth-of-type(n+11){min-height:34px;font-size:13px;padding-block:5px}.medieval-shell .side nav .nav-i:nth-of-type(n+11) .ico{width:15px;height:15px}.medieval-shell .side:after{position:sticky;bottom:0;min-height:140px;z-index:0}.medieval-shell .med-card{min-height:310px}.medieval-shell .med-scene{flex:1;aspect-ratio:auto;min-height:166px}.medieval-shell .med-card-foot{min-height:78px}}
@media(min-width:1000px) and (max-width:1270px){.medieval-shell .med-card{min-height:260px}.med-card-title{padding:8px;min-height:50px;gap:5px}.med-card-title .med-icon{width:25px;height:25px}.med-stat{padding:10px 7px;gap:5px}.med-stat .med-icon{width:28px;height:28px}.med-card-foot{padding:9px}.med-gallery{grid-template-columns:105px repeat(6,minmax(0,1fr))}.med-gallery button img{height:90px}.med-gallery button{font-size:13px}.med-chart{padding:9px}.med-donut-layout{gap:8px}.med-legend>div{font-size:12px}}
@media(max-width:999px){.medieval-shell.heritage-home .view{padding:10px max(10px,env(safe-area-inset-right)) 90px max(10px,env(safe-area-inset-left))}.medieval-shell.heritage-home .top{height:52px;position:sticky;top:env(safe-area-inset-top);}.medieval-shell.heritage-home .top .heritage-brand{display:flex}.medieval-shell.heritage-home .top .heritage-brand b{font-size:18px}.med-banner{flex-wrap:wrap;padding:10px;min-height:100px;background-position:center}.med-welcome{gap:10px}.med-avatar{width:64px;height:64px}.med-goal{max-width:none;width:100%;padding:9px 12px;font-size:17px}.med-progress{height:20px;margin-top:5px}.med-summary.hero{grid-template-columns:repeat(3,minmax(0,1fr));padding:12px 5px;gap:7px}.med-summary .med-net{grid-column:1/-1;border-bottom:1px solid #8e6c45;padding:5px 6px 12px}.med-summary .hero-amount{font-size:clamp(32px,9vw,50px)}.med-stat{padding:4px 5px;display:flex;flex-direction:column;align-items:center;text-align:center;gap:3px;min-height:95px}.med-stat:nth-child(2){border:0}.med-stat strong{font-size:clamp(15px,4.2vw,22px)}.med-stat small{font-size:12px}.med-stat .med-icon{width:28px;height:28px}.med-cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.med-card-title{min-height:42px;padding:7px;gap:5px;font-size:17px}.med-card-title .med-icon{width:25px;height:25px}.med-card-foot{padding:9px 7px;min-height:76px}.med-card.heritage-tile strong{font-size:clamp(18px,5vw,25px)}.med-card.heritage-tile small{font-size:11px}.med-arrow{width:24px;height:28px;font-size:25px}.med-charts{grid-template-columns:1fr}.med-chart{min-height:210px}.med-chart h2{font-size:19px}.med-gallery{grid-template-columns:repeat(7,125px);overflow-x:auto;min-height:142px}.med-gallery button img{height:90px}.med-donut-layout{gap:10px;grid-template-columns:minmax(120px,.9fr) minmax(0,1.2fr)}.med-legend>div{font-size:13px}.med-legend b{font-size:13px}.med-library{grid-template-columns:repeat(2,minmax(0,1fr))}.medieval-shell.heritage-home .main{padding-bottom:env(safe-area-inset-bottom,0px)}}
@media(max-width:360px){.med-card-title{font-size:15px}.med-card.heritage-tile strong{font-size:17px}.med-arrow{display:none}.med-legend>div{font-size:12px}.med-legend .med-icon{display:none}}@media(prefers-reduced-motion:reduce){.med-progress i{animation:none}.med-card{transition:none}}@media print{.med-intro,.med-scene,.med-gallery,.med-extra-links{display:none!important}.med-frame{background:#fff!important;color:#000!important;clip-path:none}.medieval-shell .view{color:#000}}
.med-tools{margin:6px 0 0;border-top:1px solid #72502d;color:#e0c394}.med-tools summary{padding:10px 12px;cursor:pointer;font-size:14px}.med-tools .nav-i{min-height:33px!important;font-size:13px!important;padding:5px 10px!important}.med-tools .ico{width:16px;height:16px}.medieval-shell .side:after{position:static;min-height:155px;flex:1;background-size:100% auto;background-position:center bottom}.med-detail-scene{width:100%;max-height:205px;overflow:hidden}.med-detail-scene .med-scene{height:195px;aspect-ratio:auto}.loan-c .med-property-photo{width:100%;height:115px;object-fit:contain;margin-bottom:12px}.medieval-shell .side{overflow-y:auto}.medieval-shell .med-logo{max-height:150px}

.med-card[data-go=immobilier] .med-scene{background:linear-gradient(#0b080855,#100d09aa),url('../assets/medieval/backgrounds/builder-wall.webp') repeat;}
.med-card[data-go=placements] .med-scene{background:linear-gradient(#100b0755,#100d09aa),url('../assets/medieval/backgrounds/forge-wall.webp') repeat;}
.med-card[data-go=entreprises] .med-scene{background:linear-gradient(#0a130a33,#100d0999),url('../assets/medieval/backgrounds/forest.webp') repeat;}
.med-card[data-go=emprunts] .med-scene{background:linear-gradient(#100b0755,#100d09aa),url('../assets/medieval/backgrounds/bank-wall.webp') repeat;}
@media(min-width:1271px){.med-net{background:url('../assets/medieval/backgrounds/laurel-left.webp') left center/33px auto no-repeat,url('../assets/medieval/backgrounds/laurel-right.webp') right center/33px auto no-repeat;padding-inline:35px!important}.medieval-shell.heritage-home .top-add{display:grid}}
.medieval-shell .med-summary .hero-amount{color:#f0bc62;font-weight:700;letter-spacing:-.035em;font-size:clamp(27px,3.55vw,56px)}
@media(max-width:999px){.medieval-shell .med-summary .hero-amount{font-size:clamp(32px,9vw,50px)}}
.medieval-shell .view[data-da-route=accueil] .med-dashboard{max-width:1660px;margin-inline:auto}

/* 8.2: preserve Nordic styling, simplify hierarchy */
.med-home82 .med-banner{min-height:160px;background-position:center;background-size:cover}.med-home82 .med-welcome h1{font-size:clamp(24px,4vw,42px);text-shadow:0 2px 8px #000}.med-home82 .med-net82{padding:clamp(12px,2vw,24px);min-width:0}.med-home82 .med-net{border:0;width:100%;text-align:center}.med-home82 .med-chart{min-width:0;margin-top:12px}.med-home82 .med-history{width:100%;height:auto;display:block}.med-home82 .med-summary{grid-template-columns:repeat(3,minmax(0,1fr))}.med-home82 .med-goal{width:100%;max-width:none}.med-property-add{margin:12px 0}.med-intro{animation:medFade82 .25s ease both}@keyframes medFade82{from{opacity:0}to{opacity:1}}@media(max-width:600px){.med-home82 .med-summary{grid-template-columns:1fr}.med-home82 .med-banner{min-height:130px;background-position:65% center}.med-home82 .med-net82{padding:12px}.med-home82 .med-stat{min-width:0}.medieval-shell .row-actions{flex-wrap:wrap}.medieval-shell .cal-grid{min-width:0}.medieval-shell .cal-day{min-width:0;padding:4px}.medieval-shell .cal-day small{font-size:10px}}

.med-budget-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.med-budget-tile{padding:20px;text-align:left;color:inherit;background:var(--med-panel);cursor:pointer}.med-budget-tile h2{display:flex;align-items:center;gap:8px}.med-budget-stats{display:grid;gap:8px}.med-budget-stats span{display:flex;justify-content:space-between;gap:12px}.bud-period .seg{overflow-x:auto;flex-wrap:nowrap}.bud-period .seg button{flex-shrink:0}.medieval-shell .cal-layout{grid-template-columns:minmax(0,1fr)}@media(max-width:600px){.med-budget-grid{grid-template-columns:1fr}.med-budget-tile{padding:14px}}

/* Restore original animated tiles; use the same workshop backdrop in both locations. */
.medieval-shell .med-scene-immobilier{background:linear-gradient(#0b080855,#100d09aa),url('../assets/medieval/backgrounds/builder-wall.webp') repeat;}
