/* ============================================================
   CLIENTS — meal plan library, editor, and the A4 print layout.
   ============================================================ */
.plan-card{ display:flex; align-items:center; gap:14px; padding:16px 10px 16px 16px; background:var(--surface); border-radius:var(--r-xl); transition:transform .18s var(--ease-out); }
.plan-card:active{ transform:scale(.985); }
.plan-card .grow{ display:grid; gap:2px; min-width:0; }
.plan-client{ font-weight:650; font-size:17px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; }
.plan-title{ color:var(--ink-2); font-size:15px; line-height:1.35; }
.plan-av{ width:52px; height:52px; border-radius:18px; display:grid; place-items:center; flex:none; font-family:var(--f-display); font-weight:600; font-size:19px; color:#0E1525; letter-spacing:.01em; }
.plan-av.big{ width:64px; height:64px; border-radius:22px; font-size:24px; }
.plan-av.t0{ background:#E3E8F3; } .plan-av.t1{ background:#FBE4DC; } .plan-av.t2{ background:#E1EFE7; } .plan-av.t3{ background:#F6EEDA; } .plan-av.t4{ background:#E8E3F1; }

.plan-head{ display:grid; gap:4px; margin:8px 0 0; }
.plan-head .plan-av{ margin-bottom:8px; }
.plan-hname{ font-family:var(--f-display); font-weight:560; font-size:34px; letter-spacing:-.02em; line-height:1.05; }
.plan-htitle{ font-family:var(--f-display); font-style:italic; font-size:19px; color:var(--ink-2); }
.plan-fill{ margin-top:14px; display:grid; gap:8px; }
.plan-fill-t{ display:flex; justify-content:space-between; align-items:center; font-size:14px; font-weight:600; color:var(--ink-2); }
.plan-edit{ font-size:14px; }
.plan-fill-b{ height:6px; border-radius:3px; background:var(--surface-3); overflow:hidden; }
.plan-fill-b i{ display:block; height:100%; background:var(--navy); border-radius:3px; transition:width .6s var(--ease-out); }
.plan-sync{ display:block; }

.plan-screen{ padding-bottom:110px; }
.plan-blocks{ margin-top:22px; display:grid; gap:16px; }
.plan-week{ background:var(--surface-2); border-radius:var(--r-xl); padding:6px 12px 14px; }
:root[data-theme="dark"] .plan-week{ background:var(--surface); }
.plan-week-h{ display:flex; align-items:center; justify-content:space-between; padding:6px 4px 6px 8px; }
.plan-week-t{ font-size:24px; font-weight:560; text-align:left; letter-spacing:-.015em; }
.plan-week-b{ display:grid; gap:12px; }
.plan-more{ width:38px; height:38px; }

.plan-table{ background:var(--surface); border-radius:var(--r-lg); padding:8px 8px 12px; }
.plan-table-h{ display:flex; align-items:center; justify-content:space-between; padding:2px 4px 4px 10px; min-height:40px; }
.plan-table-t{ font-weight:650; color:var(--ink-2); font-size:14.5px; }
.plan-days{ display:grid; gap:8px; }
.plan-day{ background:var(--bg); border-radius:var(--r-md); padding:10px 10px 8px; display:grid; gap:4px; }
:root[data-theme="dark"] .plan-day{ background:var(--surface-2); }
.plan-day-l{ text-align:left; font-family:var(--f-display); font-weight:580; font-size:18px; padding:2px 4px 6px; }
.plan-slot{ display:grid; grid-template-columns:92px 1fr; gap:10px; align-items:start; text-align:left; padding:10px; border-radius:var(--r-sm); background:var(--surface); transition:transform .12s; }
.plan-slot:active{ transform:scale(.985); }
.plan-slot-l{ font-size:12.5px; font-weight:650; color:var(--ink-3); padding-top:2px; }
.plan-slot-t{ font-size:15px; line-height:1.4; white-space:pre-line; }
.plan-slot.empty .plan-slot-t{ color:var(--ink-3); font-style:italic; }
.plan-note{ margin:10px 6px 0; font-size:14px; color:var(--ink-2); }

.plan-card2{ background:var(--surface); border-radius:var(--r-lg); padding:14px 14px 16px 18px; cursor:pointer; }
.plan-card2-h{ display:flex; align-items:center; justify-content:space-between; min-height:36px; }
.plan-card2-h b{ font-family:var(--f-display); font-weight:580; font-size:18px; }
.plan-card2-b{ font-size:15px; line-height:1.55; white-space:pre-line; color:var(--ink-2); margin-top:4px; }
.plan-card2-b.empty{ color:var(--ink-3); font-style:italic; }
.plan-card2-l{ margin:6px 0 0; padding-left:20px; display:grid; gap:4px; font-size:15px; }
.plan-break{ display:flex; align-items:center; justify-content:space-between; gap:10px; padding:6px 6px 6px 16px; border-radius:var(--r-md); box-shadow:inset 0 0 0 2px var(--surface-3); color:var(--ink-3); font-size:13.5px; font-weight:600; }
.plan-add{ margin-top:0; }
.plan-sign{ margin:30px 0 0; text-align:center; display:grid; gap:4px; }
.plan-sign b{ font-family:var(--f-display); font-size:20px; letter-spacing:.02em; }
.plan-sign i{ color:var(--dot); font-style:normal; }
.plan-sign span{ font-size:12.5px; color:var(--ink-3); }

.plan-bar{ position:sticky; bottom:0; z-index:5; margin:26px -20px 0; padding:12px 20px calc(14px + var(--safe-b)); background:linear-gradient(transparent, var(--bg) 28%); }
.plan-bar-in{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.plan-bar-in .btn{ box-shadow:var(--shadow-float); }
.plan-foot{ display:grid; gap:10px; }
.pchips{ display:flex; flex-wrap:wrap; gap:8px; }
.pchips .fchip{ background:var(--surface-2); }
.pchips .fchip.on{ background:var(--navy); }
.cfrow{ display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.cfrow .input{ flex:1; }

/* ---------- PDF: "Cover Report" A4 sheets ----------
   Every page is its own fixed A4 sheet (padding lives inside the sheet, so Chrome's
   page margin is 0 and the navy cover/closing pages run edge to edge). */
.plan-print{ display:none; }
.plan-print.measuring{ display:block; position:fixed; left:-10000px; top:0; visibility:hidden; pointer-events:none; }
.plan-print{ color:#161A22; font-family:"Figtree","Inter",Arial,sans-serif; font-size:12.6px; line-height:1.5; }
.plan-print *{ box-sizing:border-box; }
.plan-print a{ color:inherit; text-decoration:none; }
.plan-print h2,.plan-print h3,.plan-print h4,.plan-print p{ margin:0; }
.pp-sheet{ position:relative; width:210mm; height:297mm; overflow:hidden; background:#fff; }
.pp-sheet.nv{ background:#0E1525; color:#fff; }
.nv .o1{ position:absolute; right:-180px; top:120px; width:560px; height:560px; border-radius:50%; border:1.5px solid rgba(255,255,255,.1); }
.nv .o2{ position:absolute; right:-110px; top:190px; width:420px; height:420px; border-radius:50%; border:1.5px solid rgba(255,255,255,.07); }
.nv .o3{ position:absolute; right:-30px; top:270px; width:260px; height:260px; border-radius:50%; background:radial-gradient(circle,rgba(234,78,39,.4),rgba(234,78,39,0) 70%); }
.nv .tp{ position:absolute; left:64px; right:64px; top:54px; display:flex; justify-content:space-between; align-items:center; }
.nv .mk{ font:800 28px "Fraunces",Georgia,serif; }
.nv .mk i,.pp-fb b i,.pp-rh b i{ color:#EA4E27; font-style:normal; }
.nv .rl{ font-size:9.5px; letter-spacing:.26em; text-transform:uppercase; color:#9AA6C0; }
.nv small{ font-size:11px; letter-spacing:.28em; text-transform:uppercase; color:#9AA6C0; }
.nv .rule{ width:64px; height:4px; background:#EA4E27; margin-bottom:22px; }
/* cover */
.cv .mid{ position:absolute; left:64px; right:64px; top:340px; }
.cv h2{ font:600 60px/1.04 "Fraunces",Georgia,serif; margin:16px 0 18px; letter-spacing:-.015em; overflow-wrap:anywhere; }
.cv .sub{ font:italic 500 24px "Fraunces",Georgia,serif; color:#FF8A6B; }
.cv .bt{ position:absolute; left:64px; right:64px; bottom:54px; display:grid; grid-template-columns:repeat(3,1fr); gap:20px; border-top:1px solid #2A3757; padding-top:22px; }
.cv .bt small{ display:block; font-size:8.5px; margin-bottom:3px; }
.cv .bt b{ font:600 15px "Fraunces",Georgia,serif; }
/* inside pages */
.pp-rh{ display:flex; justify-content:space-between; align-items:baseline; padding:36px 56px 10px; font-size:10px; letter-spacing:.06em; color:#5B6270; }
.pp-rh b{ font:700 14px "Fraunces",Georgia,serif; color:#0E1525; letter-spacing:0; }
.pp-ln{ margin:0 56px; height:3px; background:#0E1525; }
.pp-bd{ padding:28px 56px 0; }
.pp-wk{ display:flex; justify-content:space-between; align-items:flex-end; margin-bottom:14px; gap:16px; }
.pp-wh{ font:600 32px/1 "Fraunces",Georgia,serif; color:#0E1525; }
.pp-wsub{ color:#5B6270; margin-top:5px; }
.pp-prog{ display:flex; gap:6px; align-items:center; font-size:9.5px; letter-spacing:.14em; text-transform:uppercase; color:#6B717D; white-space:nowrap; }
.pp-prog i{ width:26px; height:5px; border-radius:3px; background:#D5D9E1; }
.pp-prog i.on{ background:#EA4E27; }
.pp-blk{ margin-bottom:16px; }
.pp-ttl{ font:600 16px "Fraunces",Georgia,serif; color:#0E1525; margin-bottom:6px; }
.pp-table{ border-collapse:collapse; width:100%; table-layout:fixed; }
.pp-table th,.pp-table td{ vertical-align:top; text-align:left; white-space:pre-line; }
.pp-table th{ background:#0E1525; color:#fff; padding:9px 11px; font-size:11px; font-weight:600; }
.pp-table td{ padding:11px; border-bottom:1px solid #DDE1E8; }
.pp-table td.pp-rl{ font-weight:700; color:#0E1525; }
.pp-table th:first-child,.pp-table td:first-child{ width:98px; }
/* bordered cards: tips, text, lists, notes — one style everywhere */
.pp-two{ display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:16px; }
.pp-two .pp-bc{ margin-bottom:0; }
.pp-bc{ border:1.5px solid #C4CBDA; border-radius:12px; padding:13px 16px 13px 54px; position:relative; margin-bottom:16px; break-inside:avoid; }
.pp-bc svg{ position:absolute; left:16px; top:14px; width:26px; height:26px; stroke:#0E1525; fill:none; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.pp-bc svg .o{ stroke:#EA4E27; }
.pp-bc h4{ font:600 15px "Fraunces",Georgia,serif; color:#0E1525; margin-bottom:2px; }
.pp-bc p{ white-space:pre-line; }
.pp-bc ul{ margin:0; padding-left:16px; }
.pp-bc.cols ul{ columns:2; column-gap:26px; }
.pp-bc li{ break-inside:avoid; }
.pp-fb{ position:absolute; left:56px; right:56px; bottom:34px; display:flex; justify-content:space-between; font-size:9.5px; color:#6B717D; border-top:1px solid #D5D9E1; padding-top:10px; }
/* closing page */
.cl .mid{ position:absolute; left:64px; right:64px; top:250px; }
.cl .q{ font:italic 500 40px/1.18 "Fraunces",Georgia,serif; letter-spacing:-.01em; margin:6px 0 20px; }
.cl .q2{ font-size:16px; color:#C9D0E0; max-width:470px; }
.cl .links{ position:absolute; left:64px; right:64px; top:626px; display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.cl .lk{ border:1.5px solid #2F3C5E; border-radius:12px; padding:13px 18px; display:block; }
.cl .lk small{ display:block; font-size:8.5px; margin-bottom:2px; }
.cl .lk b{ font:600 15px "Fraunces",Georgia,serif; color:#fff; overflow-wrap:anywhere; }
.cl .nt{ position:absolute; left:64px; right:64px; bottom:104px; border:1.5px solid #2F3C5E; border-radius:12px; padding:14px 18px 14px 56px; }
.cl .nt svg{ position:absolute; left:18px; top:15px; width:26px; height:26px; stroke:#fff; fill:none; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.cl .nt h4{ font:600 15px "Fraunces",Georgia,serif; margin-bottom:2px; }
.cl .nt p{ font-size:11.5px; color:#C9D0E0; }
.cl .fb{ position:absolute; left:64px; right:64px; bottom:50px; display:flex; justify-content:space-between; align-items:center; font-size:10px; color:#9AA6C0; }
.cl .fb b{ font:800 18px "Fraunces",Georgia,serif; color:#fff; }
.cl .fb b i{ color:#EA4E27; font-style:normal; }

/* ---------- PDF preview ---------- */
.pv{ position:fixed; inset:0; z-index:75; background:#0B111E; color:#fff; display:flex; flex-direction:column; }
.pv-top{ display:flex; align-items:center; gap:12px; padding:calc(10px + var(--safe-t)) 14px 10px; background:rgba(11,17,30,.94); border-bottom:1px solid rgba(255,255,255,.08); flex:none; }
.pv-x{ width:44px; height:44px; border-radius:50%; display:grid; place-items:center; background:rgba(255,255,255,.1); color:#fff; flex:none; }
.pv-x .i{ width:22px; height:22px; }
.pv-t{ flex:1; min-width:0; display:grid; line-height:1.25; }
.pv-t b{ font-family:var(--f-display); font-size:17px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pv-t span{ font-size:12.5px; color:#9AA6C0; }
.pv-save{ display:inline-flex; align-items:center; gap:8px; height:44px; padding:0 18px; border-radius:99px; background:#EA4E27; color:#fff; font-weight:650; font-size:15px; flex:none; }
.pv-save .i{ width:20px; height:20px; }
.pv-save:disabled{ opacity:.45; }
.pv-body{ flex:1; overflow-y:auto; -webkit-overflow-scrolling:touch; padding:18px 14px calc(28px + var(--safe-b)); }
.pv-pg{ position:relative; width:min(100%,680px); margin:0 auto 16px; background:#fff; box-shadow:0 14px 40px rgba(0,0,0,.45); }
.pv-pg img{ display:block; width:100%; height:auto; }
.pv-l{ position:absolute; display:block; }
.pv-wait{ min-height:60vh; display:grid; place-content:center; justify-items:center; gap:14px; color:#9AA6C0; text-align:center; padding:0 24px; }
.pv-spin{ width:30px; height:30px; border-radius:50%; border:3px solid rgba(255,255,255,.15); border-top-color:#EA4E27; animation:pvspin .8s linear infinite; }
@keyframes pvspin{ to{ transform:rotate(360deg); } }
