/* Pick My Meal Today V6 — unified premium design refinement */
:root{
  --ds-space-1:4px;--ds-space-2:8px;--ds-space-3:12px;--ds-space-4:16px;--ds-space-5:24px;--ds-space-6:32px;--ds-space-7:48px;--ds-space-8:72px;
  --ds-radius-sm:10px;--ds-radius-md:16px;--ds-radius-lg:24px;--ds-radius-xl:32px;
  --ds-shadow-sm:0 4px 14px rgba(54,32,58,.055);--ds-shadow-md:0 12px 34px rgba(54,32,58,.085);--ds-shadow-lg:0 24px 64px rgba(54,32,58,.14);
  --ds-plum-950:#2b192f;--ds-plum-800:#4b294a;--ds-plum-650:#704064;--ds-coral:#ed765b;--ds-cream:#fffaf6;--ds-blush:#f8eff3;--ds-line:#eadfe5;
}
html{scroll-behavior:smooth}
body{line-height:1.55;background:linear-gradient(180deg,#fffaf7 0,#faf6f3 36rem,#f8f5f1 100%)}
main{overflow:clip}
:focus-visible{outline:3px solid rgba(237,118,91,.4);outline-offset:3px}

/* Consistent interactive language */
.button,.section-action,.cookbook-save-button,.recipe-like-button,.ingredient-substitute-button,.recipe-browser-all{
  min-height:44px;border-radius:999px;font-weight:820;letter-spacing:-.012em;transition:transform .18s ease,box-shadow .18s ease,background .18s ease,border-color .18s ease,color .18s ease;
}
.button{padding:11px 18px;box-shadow:var(--ds-shadow-sm)}
.button:hover,.section-action:hover,.cookbook-save-button:hover,.recipe-like-button:hover,.ingredient-substitute-button:hover{transform:translateY(-2px)}
.button.secondary{border:1px solid rgba(112,64,100,.13);background:rgba(255,255,255,.78);box-shadow:var(--ds-shadow-sm)}
.button.secondary:hover{background:#fff;border-color:rgba(112,64,100,.26)}

/* Header: calmer, sharper hierarchy */
.site-header{min-height:72px;padding-inline:clamp(14px,2.3vw,34px);background:rgba(255,250,247,.86);box-shadow:0 1px 0 rgba(81,49,78,.04)}
.site-header nav a{font-weight:720}.site-header nav a:hover{background:#f5ecf1}.brand-mark{filter:drop-shadow(0 7px 14px rgba(58,36,63,.13))}
.v5-search-link,.v5-menu-toggle,.language-switch{border-color:rgba(112,64,100,.13);background:rgba(255,255,255,.82)}

/* Layout rhythm */
.section{margin-block:clamp(48px,7vw,84px)}
.section-head{margin-bottom:clamp(18px,2.4vw,28px)}
.section-head h2,.section h2{max-width:18ch;text-wrap:balance}
.section-head p{max-width:66ch;color:var(--v5-muted)}
.eyebrow,.home-kicker{color:#a05272;font-weight:900}

/* Hero and search */
.home-hero{min-height:clamp(480px,62vh,650px);padding:clamp(36px,6vw,88px);box-shadow:var(--ds-shadow-lg)}
.home-hero-copy{max-width:790px}.home-hero h1{text-wrap:balance}.home-hero-intro{max-width:60ch;line-height:1.65}
.home-search-field{padding:8px 9px 8px 18px;border:1px solid rgba(255,255,255,.6);box-shadow:0 22px 55px rgba(24,10,28,.25)}
.recipe-counter{box-shadow:inset 0 1px 0 rgba(255,255,255,.15)}

/* Cards */
.grid{gap:clamp(15px,2vw,24px)}
.card{border-color:rgba(112,64,100,.105);box-shadow:var(--ds-shadow-sm);overflow:hidden}
.card:hover{box-shadow:var(--ds-shadow-md);transform:translateY(-4px)}
.card-body{padding:clamp(15px,2vw,20px)}
.card h3{font-weight:850}.meta{line-height:1.45}
.card-image,.recipe-card-image,.cuisine-card-image{background:linear-gradient(145deg,#f6edf2,#fff0e9)}
.popular-badge,.recipe-badge,.match-badge,.trend-rank{box-shadow:0 6px 18px rgba(54,32,58,.12)}

/* Section actions become quiet navigation, never competing with content */
.section-action{min-height:40px;padding:7px 8px 7px 14px;background:transparent;border-color:rgba(112,64,100,.14);box-shadow:none}
.section-action:hover{background:#fff;box-shadow:var(--ds-shadow-sm)}
.section-action-icon{width:25px;height:25px;background:#f3e7ef}

/* Recipe detail */
.recipe-layout{gap:clamp(22px,3vw,40px);margin-top:clamp(24px,4vw,48px)}
.recipe-media img{border-radius:var(--ds-radius-xl);box-shadow:var(--ds-shadow-lg)}
.recipe-content{padding:clamp(26px,4.2vw,48px);border-radius:var(--ds-radius-xl);box-shadow:var(--ds-shadow-md);background:rgba(255,255,255,.94)}
.recipe-content h1{text-wrap:balance;margin-bottom:12px}
.recipe-discovery-panel{padding:16px 18px!important;background:linear-gradient(135deg,#fff8f4,#fbf1f5)!important}
.recipe-like-wrap{gap:10px;margin-block:18px 24px}
.cookbook-save-button,.recipe-like-button{padding:10px 16px!important;box-shadow:none!important}
.ingredients{padding:10px 12px;background:#fffaf6;border-radius:20px}
.ingredient-row{min-height:48px;border-color:rgba(112,64,100,.09)!important}
.ingredient-substitute-button{min-height:34px!important;padding:6px 11px!important;background:#fff!important;border:1px solid rgba(112,64,100,.14)!important;box-shadow:none!important}
.source-box{padding:20px;border-radius:20px;box-shadow:0 12px 30px rgba(54,32,58,.13)}
.recipe-browser{gap:14px}.recipe-browser-side,.recipe-browser-all{border-radius:18px!important;box-shadow:var(--ds-shadow-sm)}

/* Discovery and forms */
.browse-controls,.filter-panel,.fridge-form,.smart-panel,.panel{box-shadow:var(--ds-shadow-sm);border-color:rgba(112,64,100,.11)}
.browse-hero,.explore-hero,.fridge-hero,.smart-hero{box-shadow:var(--ds-shadow-lg)!important}
input,select,textarea{min-height:44px}

/* Premium footer */
.site-footer-v6{width:min(1440px,calc(100% - 48px));margin:clamp(64px,9vw,110px) auto 24px;padding:0;border:0;border-radius:32px;overflow:hidden;background:linear-gradient(145deg,#301c35 0,#4c2949 58%,#6f3f68 100%);color:#f5eaf2;box-shadow:var(--ds-shadow-lg)}
.footer-inner-v6{display:grid;grid-template-columns:minmax(280px,1.35fr) repeat(3,minmax(150px,.62fr));gap:clamp(26px,4vw,58px);padding:clamp(30px,5vw,64px)}
.footer-brand-panel{max-width:480px}.footer-brand{display:inline-flex;align-items:center;gap:13px;color:#fff;text-decoration:none}.footer-brand-mark{width:52px;height:52px;flex:0 0 52px}.footer-brand span{display:flex;align-items:baseline;gap:.25em;font-size:1.15rem;line-height:1}.footer-brand strong{font-weight:900;letter-spacing:-.05em}.footer-brand em{font-style:normal;font-weight:850;color:#f7a083}.footer-brand-panel>p{margin:22px 0;color:#ddcede;max-width:46ch;line-height:1.75}.footer-trust-row{display:flex;flex-wrap:wrap;gap:8px}.footer-trust-row span{padding:7px 10px;border:1px solid rgba(255,255,255,.11);border-radius:999px;background:rgba(255,255,255,.065);font-size:.75rem;color:#f5eaf2}
.footer-column{display:flex;flex-direction:column;gap:10px;align-items:flex-start}.footer-column h2{margin:4px 0 9px;color:#f7a083;font-size:.72rem;text-transform:uppercase;letter-spacing:.14em;font-weight:900}.footer-column a{color:#eadde8;text-decoration:none;font-size:.9rem;line-height:1.4}.footer-column a:hover{color:#fff;transform:translateX(2px)}
.footer-bottom{grid-column:1/-1;display:grid;grid-template-columns:minmax(260px,1fr) auto;gap:14px 28px;align-items:center;padding-top:28px;border-top:1px solid rgba(255,255,255,.11);color:#cdbdcd;font-size:.78rem}.footer-bottom p{margin:0}.footer-bottom .footer-translation-note{grid-column:1/2;color:#bfaebe}.footer-bottom .footer-utility-links{grid-column:2;grid-row:1/3;display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px 16px;padding:0;border:0}.footer-bottom a{color:#d9cad7;text-decoration:none}.footer-bottom a:hover{color:#fff}

/* Mobile dock */
.v5-mobile-dock{box-shadow:0 -10px 30px rgba(54,32,58,.08)}

/* Admin consistency */
.admin-stat,.panel,.admin-toolbar{box-shadow:var(--ds-shadow-sm)}
.admin-table tbody tr{transition:background .16s ease}.admin-actions .button{min-height:36px;border-radius:999px}

@media(max-width:980px){
  .footer-inner-v6{grid-template-columns:1.4fr repeat(2,1fr)}
  .footer-legal-links{grid-column:2/4}
}
@media(max-width:860px){
  .site-footer-v6{width:calc(100% - 28px)}
  .footer-inner-v6{grid-template-columns:1fr 1fr;padding:34px 26px 32px}
  .footer-brand-panel{grid-column:1/-1}.footer-legal-links{grid-column:auto}
  .footer-bottom{grid-template-columns:1fr}.footer-bottom .footer-translation-note,.footer-bottom .footer-utility-links{grid-column:1;grid-row:auto;justify-content:flex-start}
}
@media(max-width:560px){
  body{font-size:15px}.section{margin-block:46px}
  .home-hero{padding:38px 23px;min-height:auto}.home-hero h1{font-size:clamp(2.7rem,15vw,4rem)}
  .recipe-content{padding:25px 18px}.recipe-content h1{font-size:clamp(2.25rem,12vw,3.15rem)}
  .recipe-like-wrap{display:grid;grid-template-columns:1fr 1fr}.cookbook-save-button,.recipe-like-form,.recipe-like-button{width:100%}
  .recipe-browser{grid-template-columns:1fr!important}.recipe-browser-all{order:-1}
  .site-footer-v6{margin-top:64px;border-radius:26px}.footer-inner-v6{grid-template-columns:1fr 1fr;gap:30px 22px;padding:31px 22px 28px}.footer-brand-panel{grid-column:1/-1}.footer-brand-mark{width:46px;height:46px;flex-basis:46px}.footer-brand span{font-size:1.03rem}.footer-column h2{font-size:.69rem}.footer-column a{font-size:.84rem}.footer-bottom{grid-column:1/-1;padding-top:24px}.footer-bottom .footer-utility-links{gap:10px 14px}
}
@media(max-width:370px){.footer-inner-v6{grid-template-columns:1fr}.footer-brand-panel,.footer-bottom{grid-column:1}.footer-brand span{font-size:.92rem}}
[dir="rtl"] .footer-column{align-items:flex-end}[dir="rtl"] .footer-column a:hover{transform:translateX(-2px)}

/* V7 structured substitution assistant */
.substitute-dialog{backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}
.substitute-dialog-card{max-width:680px;max-height:min(88vh,820px);overflow:auto;padding:clamp(1.25rem,4vw,2rem)}
.substitute-original{font-size:1.02rem;font-weight:700;color:var(--text);padding:.85rem 1rem;background:rgba(112,64,100,.07);border-radius:14px;margin:.75rem 0 1rem}
.substitute-results{display:grid;gap:.85rem}
.substitution-card{border:1px solid rgba(112,64,100,.13);border-radius:18px;padding:1rem;background:linear-gradient(145deg,#fff,#fffaf7);box-shadow:0 8px 25px rgba(63,27,55,.06)}
.substitution-card-head{display:flex;justify-content:space-between;align-items:center;gap:1rem}
.substitution-card-head>div{display:flex;align-items:center;gap:.65rem;font-size:1.08rem}
.substitution-rank{display:grid;place-items:center;width:29px;height:29px;border-radius:50%;background:var(--brand,#642b5b);color:#fff;font-weight:900;font-size:.8rem}
.substitution-score{font-weight:900;background:#fff0df;color:#7c3d22;border-radius:999px;padding:.35rem .6rem;white-space:nowrap}
.substitution-quality,.substitution-context{display:inline-flex;margin:.65rem .4rem .25rem 0;border-radius:999px;padding:.3rem .6rem;font-size:.76rem;font-weight:800}
.substitution-quality{background:rgba(112,64,100,.1);color:var(--brand,#642b5b)}
.substitution-context{background:#e9f8ef;color:#17633b}
.substitution-details{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.55rem;margin:.8rem 0 0}
.substitution-details div{background:#f7f1eb;border-radius:12px;padding:.65rem}
.substitution-details dt{font-size:.69rem;text-transform:uppercase;letter-spacing:.05em;font-weight:900;color:#8c6a7f;margin-bottom:.25rem}
.substitution-details dd{margin:0;font-size:.86rem;line-height:1.35}
.substitution-reason{margin:.75rem 0 0;color:#65525f;font-size:.88rem}
.substitution-empty{display:flex;gap:.9rem;align-items:flex-start;padding:1rem;border-radius:16px;background:#fff4df;border:1px solid #f1d5a1}
.substitution-empty-icon{font-size:1.35rem}.substitution-empty p{margin:.25rem 0 0;line-height:1.5}
.substitution-loading{display:flex;align-items:center;gap:.7rem;padding:1rem;background:#f7f1eb;border-radius:14px}
.substitution-loading span{width:18px;height:18px;border:2px solid rgba(112,64,100,.18);border-top-color:var(--brand,#642b5b);border-radius:50%;animation:pmm-spin .8s linear infinite}
@keyframes pmm-spin{to{transform:rotate(360deg)}}
@media(max-width:600px){.substitute-dialog{padding:.5rem;align-items:end}.substitute-dialog-card{width:100%;max-height:92vh;border-radius:24px 24px 10px 10px}.substitution-details{grid-template-columns:1fr}.substitution-card-head{align-items:flex-start}}
.substitution-source-link{display:inline-flex;margin-top:.65rem;text-decoration:none}.substitution-empty>div{min-width:0}
