/* LinkedIn / X drafts: view, edit stage, picker */
.pd-root { --pd-accent: #0a66c2; --pd-ink: #0f172a; --pd-ink2: #475569; --pd-mute: #94a3b8; --pd-line: #e2e8f0; --pd-bg: #f8fafc; --pd-brand: #ea580c; font-family: Inter, system-ui, sans-serif; color: var(--pd-ink); padding: 4px 2px 60px; }
.pd-root .ic, .pd-modal .ic { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; vertical-align: -3px; }

/* ── View title ── */
.pd-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 2px 0 18px; }
.pd-title h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.pd-chip { padding: 4px 11px; border-radius: 999px; background: #eef2f7; color: var(--pd-ink2); font-size: 12.5px; font-weight: 600; }

/* ── Edit bar ── */
.pd-bar { position: sticky; top: calc(var(--topbar-height, 72px) + 8px); z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 12px 16px; margin: 0 0 18px; background: #fff; border: 1px solid var(--pd-line); border-radius: 12px; box-shadow: 0 4px 16px rgba(15, 23, 42, .08); }
.pd-bar-main { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-width: 0; }
.pd-name { width: 280px; max-width: 100%; height: 36px; padding: 0 10px; border: 1px solid transparent; border-radius: 8px; font: 700 16px Inter, system-ui, sans-serif; color: var(--pd-ink); background: transparent; }
.pd-name:hover { background: var(--pd-bg); } .pd-name:focus { outline: none; border-color: var(--pd-brand); background: #fff; }
.pd-range { display: flex; align-items: center; gap: 8px; }
.pd-dash { color: var(--pd-mute); font-size: 12.5px; }
.pd-preset, .pd-from, .pd-to { height: 34px; border: 1px solid var(--pd-line); border-radius: 8px; padding: 0 8px; font: 500 13px Inter, system-ui, sans-serif; color: var(--pd-ink); background: #fff; }
.pd-bar-actions { display: flex; align-items: center; gap: 8px; }
.pd-state { font-size: 12.5px; color: var(--pd-mute); margin-right: 6px; }
.pd-state[data-state="dirty"] { color: #b45309; font-weight: 600; }
.pd-btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border: 1px solid var(--pd-line); border-radius: 8px; background: #fff; color: var(--pd-ink2); font: 600 13px Inter, system-ui, sans-serif; cursor: pointer; }
.pd-btn:hover { background: var(--pd-bg); border-color: #cbd5e1; }
.pd-btn.primary { background: var(--pd-brand); border-color: var(--pd-brand); color: #fff; }
.pd-btn.primary:hover { background: #c2410c; }
.pd-btn:disabled { opacity: .55; cursor: default; }

/* ── Blocks ── */
.pd-blocks { display: flex; flex-direction: column; gap: 18px; }
.pd-block { position: relative; }
.pd-bchrome { display: none; align-items: center; gap: 8px; margin: 0 0 6px; color: var(--pd-mute); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.pd-edit .pd-bchrome { display: flex; }
.pd-grip { display: inline-flex; padding: 3px; border-radius: 6px; cursor: grab; color: var(--pd-ink2); } .pd-grip:hover { background: #eef2f7; }
.pd-blabel { flex: 1; }
.pd-bdel { display: inline-flex; padding: 4px; border: none; background: transparent; color: var(--pd-mute); border-radius: 6px; cursor: pointer; } .pd-bdel:hover { background: #fef2f2; color: #dc2626; }
.pd-ghost { opacity: .4; }
.pd-edit .pd-block { padding: 10px 12px 14px; border: 1px dashed #cbd5e1; border-radius: 12px; background: #fcfdff; }

/* ── Metric cards ── */
.pd-mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.pd-mcard { position: relative; padding: 16px 16px 14px; background: #fff; border: 1px solid var(--pd-line); border-top: 3px solid var(--pd-accent); border-radius: 12px; box-shadow: 0 1px 3px rgba(15, 23, 42, .05); }
.pd-view .pd-mcard.pd-empty { display: none; }
.pd-ml { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--pd-ink2); }
.pd-mv { margin: 8px 0 6px; font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; color: var(--pd-ink); }
.pd-mp { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--pd-ink2); min-height: 20px; }
.pd-vs { color: var(--pd-mute); }
.pd-badge { margin-left: auto; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.pd-badge:empty { display: none; }
.pd-badge.up { background: #dcfce7; color: #15803d; } .pd-badge.down { background: #fee2e2; color: #b91c1c; } .pd-badge.flat { background: #f1f5f9; color: var(--pd-ink2); }
.pd-md { margin-top: 8px; font-size: 11.5px; color: var(--pd-mute); }
.pd-view .pd-md:empty, .pd-view .pd-mp .pd-vs:has(+ .pd-mpv:empty), .pd-view .pd-mpv:empty { display: none; }
.pd-edit .pd-f { border-radius: 6px; outline: 1px dashed transparent; transition: outline-color .12s, background .12s; cursor: text; min-height: 1em; }
.pd-edit .pd-f:hover { outline-color: #cbd5e1; } .pd-edit .pd-f:focus { outline: 2px solid var(--pd-brand); background: #fff7ed; }
.pd-edit .pd-f:empty::before { content: attr(data-ph); color: #cbd5e1; font-weight: 500; text-transform: none; letter-spacing: 0; }
.pd-mgrip, .pd-mdel { display: none; position: absolute; top: 6px; padding: 3px; border: none; background: transparent; color: var(--pd-mute); border-radius: 6px; cursor: pointer; }
.pd-mgrip { left: 6px; cursor: grab; } .pd-mdel { right: 6px; }
.pd-mdel:hover { background: #fef2f2; color: #dc2626; } .pd-mgrip:hover { background: #eef2f7; }
.pd-edit .pd-mgrip, .pd-edit .pd-mdel { display: inline-flex; }
.pd-edit .pd-ml { margin: 4px 22px 0; }
.pd-addm { display: none; margin-top: 12px; height: 34px; padding: 0 14px; border: 1px dashed #cbd5e1; border-radius: 8px; background: #fff; color: var(--pd-ink2); font: 600 13px Inter, system-ui, sans-serif; cursor: pointer; }
.pd-edit .pd-addm { display: inline-flex; align-items: center; gap: 6px; } .pd-addm:hover { border-color: var(--pd-brand); color: var(--pd-brand); }

/* ── Notes (the takeaway card, inside a block) ── */
.pd-note .yt-takeaway-card { margin: 0; }
body:not(.pv-edit) .pd-images.pd-nolabel .yt-takeaway-card-header { display: none; }
.pd-images .yt-takeaway-card-label { font-size: 15px; font-weight: 700; color: #0f172a; text-transform: none; letter-spacing: 0; }
.pd-images .yt-takeaway-card-label:empty::before { content: 'Add a title (optional)'; color: #cbd5e1; font-weight: 500; }
.pd-images .yt-takeaway-card { border-left-width: 0 !important; box-shadow: none; background: transparent; }
.pd-images .yt-takeaway-card-header { border-bottom: none; padding-left: 0; }
body:not(.pv-edit) .pd-images .yt-takeaway-card { border: none; }
.pd-images .yt-takeaway-body { padding-left: 0; padding-right: 0; }

/* ── Add row, empty states ── */
.pd-add { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 18px; padding: 12px 14px; border: 1px dashed #cbd5e1; border-radius: 12px; }
.pd-add > span { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--pd-mute); margin-right: 4px; }
.pd-empty-state { text-align: center; padding: 64px 20px; color: var(--pd-ink2); }
.pd-empty-state.small { padding: 28px 12px; }
.pd-empty-state h3 { margin: 12px 0 6px; font-size: 18px; color: var(--pd-ink); }
.pd-empty-state p { margin: 0; font-size: 14px; }
.pd-empty-ic { display: inline-flex; padding: 14px; border-radius: 14px; background: #eef2f7; color: var(--pd-ink2); }
.pd-empty-ic .ic { width: 26px; height: 26px; }

/* ── Picker / dialogs ── */
.pd-modal { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; background: rgba(15, 23, 42, .45); }
.pd-modal[hidden] { display: none; }
.pd-modal-card { width: 460px; max-width: 100%; max-height: 82vh; display: flex; flex-direction: column; background: #fff; border-radius: 14px; box-shadow: 0 24px 60px rgba(15, 23, 42, .35); font-family: Inter, system-ui, sans-serif; color: #0f172a; }
.pd-modal-card.wide { width: 780px; }
.pd-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #e2e8f0; }
.pd-modal-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.pd-x { display: inline-flex; padding: 6px; border: none; background: transparent; border-radius: 8px; color: #64748b; cursor: pointer; } .pd-x:hover { background: #f1f5f9; }
.pd-modal-body { padding: 16px 20px; overflow: auto; }
.pd-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid #e2e8f0; }
.pd-modal .pd-btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; color: #475569; font: 600 13px Inter, system-ui, sans-serif; cursor: pointer; }
.pd-modal .pd-btn:hover { background: #f8fafc; } .pd-modal .pd-btn.primary { background: #ea580c; border-color: #ea580c; color: #fff; } .pd-modal .pd-btn.primary:hover { background: #c2410c; }
.pd-lbl { display: block; margin: 0 0 14px; font-size: 12.5px; font-weight: 600; color: #475569; }
.pd-in { display: block; width: 100%; box-sizing: border-box; margin-top: 6px; height: 38px; padding: 0 10px; border: 1px solid #e2e8f0; border-radius: 8px; font: 14px Inter, system-ui, sans-serif; color: #0f172a; background: #fff; }
.pd-in:focus { outline: none; border-color: #ea580c; box-shadow: 0 0 0 3px rgba(234, 88, 12, .15); }
.pd-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pd-notice { margin: 0 0 12px; padding: 10px 12px; background: #fff7ed; border-radius: 8px; font-size: 13px; color: #9a3412; }
.pd-list { border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; }
.pd-row { display: grid; grid-template-columns: minmax(180px, 1.4fr) 1.2fr 90px 132px; gap: 12px; align-items: center; padding: 11px 14px; border-top: 1px solid #f1f5f9; font-size: 13px; cursor: pointer; }
.pd-row:first-child { border-top: none; }
.pd-row.head { cursor: default; background: #f8fafc; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #94a3b8; }
.pd-row:not(.head):hover, .pd-row:not(.head):focus { background: #fff7ed; outline: none; }
.pd-rname { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pd-rtitle { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-star { padding: 2px 8px; border-radius: 999px; background: #ffedd5; color: #c2410c; font-size: 11px; font-weight: 700; }
.pd-rrange, .pd-rago { color: #64748b; }
.pd-ract { display: flex; justify-content: flex-end; gap: 2px; }
.pd-ib { display: inline-flex; padding: 6px; border: none; background: transparent; border-radius: 7px; color: #64748b; cursor: pointer; } .pd-ib:hover { background: #fff; color: #0f172a; box-shadow: 0 0 0 1px #e2e8f0; } .pd-ib.danger:hover { color: #dc2626; background: #fef2f2; box-shadow: none; }
@media (max-width: 700px) { .pd-row { grid-template-columns: 1fr auto; } .pd-rrange, .pd-rago { display: none; } .pd-name { width: 100%; } }

/* ── Live pages (Instagram, YouTube, Podcast): slim bar on top, range controls come from the page's own picker ── */
.pd-live { padding: 0 0 12px; }
.pd-live .pd-title { margin: 0 0 12px; }
.pd-live .pd-bar { margin: 0 0 14px; }
.pd-hint { font-size: 12.5px; color: var(--pd-mute); max-width: 420px; }
/* In View the draft decides the date range, so the pickers are hidden */
body.pd-lock-instagram #instagramPeriodPickerWrapper,
body.pd-lock-youtube #youtubePeriodPickerWrapper,
body.pd-lock-captivate #capPeriodRow { display: none !important; }

/* ── "Start from" choices (replaces a native dropdown whose list ran off the dialog) ── */
.pd-choices { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; max-height: 200px; overflow: auto; padding: 2px; }
.pd-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 10px 12px; text-align: left; border: 1.5px solid #e2e8f0; border-radius: 10px; background: #fff; cursor: pointer; font-family: Inter, system-ui, sans-serif; }
.pd-choice b { font-size: 13.5px; font-weight: 600; color: #0f172a; overflow-wrap: anywhere; }
.pd-choice span { font-size: 12px; font-weight: 500; color: #64748b; }
.pd-choice:hover { border-color: #cbd5e1; background: #f8fafc; }
.pd-choice.on { border-color: #ea580c; background: #fff7ed; box-shadow: 0 0 0 3px rgba(234, 88, 12, .12); }
.pd-choice.on b { color: #9a3412; }
