/* Courier's own pieces, on top of the shared Herald admin styles (admin.css). */

/* ----- channel chips and status pills ----- */
.chan { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; padding: 3px 9px; border-radius: 99px; white-space: nowrap; flex: none; }
.chan .icon { vertical-align: 0; }
.chan-email { background: #e3e8f0; color: var(--blue); }
.chan-newsletter { background: #e3e8f0; color: #2a4a6b; }
.chan-facebook { background: #e1e6f7; color: #2c4a9e; }
.chan-instagram { background: #f6ded5; color: #8f3a1f; }
.chan-text { background: #dcebe4; color: var(--green); }
.chan-screens { background: #ece9f2; color: #463d73; }
.chan-groups { background: #fbecc8; color: #7a5410; }

.pill { display: inline-flex; align-items: center; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 99px; white-space: nowrap; flex: none; background: #ece9f2; color: var(--muted); }
.pill.planned { background: #ece9f2; color: var(--muted); }
.pill.draft { background: #e3e8f0; color: var(--blue); }
.pill.review { background: #fbecc8; color: #7a5410; }
.pill.approved { background: #dcebe4; color: var(--green); }
.pill.skipped { background: transparent; color: var(--muted); text-decoration: line-through; border: 1px dashed var(--line); }

.nav-count { margin-left: auto; background: var(--gold); color: var(--navy); font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 99px; }
.me .role { color: #fcf3eb99; font-size: 12px; }

/* ----- lists of pieces ----- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 12px; }
.section-head h2 { margin: 0; }
.section-title { margin: 28px 0 12px; }
.days { display: flex; flex-direction: column; gap: 18px; }
.day-head { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 17px; }
.today-chip { font: 700 11px Roboto, sans-serif; text-transform: uppercase; letter-spacing: .04em; background: var(--orange); color: #fff; padding: 2px 8px; border-radius: 99px; }
.rows { overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; padding: 11px 16px; min-height: 54px; }
.row:first-child { border-top: 0; }
.row:hover { background: #fff; }
.row-time { width: 92px; flex: none; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-main b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.st-skipped { opacity: .55; }
.row.st-approved .row-main b::after { content: ''; }
.flag { display: inline-flex; color: #b07d16; flex: none; }

.filters { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; }
.chip-btn.on { background: var(--navy); border-color: var(--navy); color: var(--cream); }
.chip-btn .count { font-size: 11px; opacity: .7; }
.job-line { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #d0603d44; border-top-color: var(--orange); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ----- approvals ----- */
.review-list { display: grid; gap: 16px; }
.review-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.review-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.review-card h3 { font-size: 18px; }
.preview { white-space: pre-wrap; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; line-height: 1.5; max-height: 360px; overflow-y: auto; }
.review-notes { margin: 0; font-size: 14px; color: var(--muted); white-space: pre-wrap; }
.review-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }
.approve-all { justify-content: flex-end; margin-bottom: 12px; }

/* ----- events ----- */
.under-head { justify-content: space-between; margin-bottom: 12px; }
.under-head .small { max-width: 640px; }
.table-wrap { overflow-x: auto; }
table.events { width: 100%; border-collapse: collapse; min-width: 860px; }
table.events th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 500; padding: 10px 14px; }
table.events td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: top; }
table.events td.when { white-space: nowrap; width: 1%; }
table.events td.when small { display: block; color: var(--muted); }
table.events select { width: auto; max-width: 230px; }
.ev-name { font-weight: 500; text-decoration: none; color: var(--ink); }
.ev-name:hover { color: var(--orange); text-decoration: underline; }
.tag { background: #efe6da; color: var(--ink); }
.tag.flagged { background: #f6ded5; color: #8f3a1f; }
.plan-counts { display: flex; gap: 4px; flex-wrap: wrap; }
.event-grid { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
.event-info select { width: 100%; }
.side-text { white-space: pre-wrap; font-size: 14px; line-height: 1.5; }

/* ----- ministries ----- */
.ministry-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.ministry { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.ministry.off { opacity: .6; }
.ministry-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ministry p { margin: 0; }
.ministry .side-text { flex: 1; margin: 6px 0; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ministry-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ministry-foot .chans { display: flex; gap: 4px; }
.ministry-foot button { margin-left: auto; }

/* ----- settings ----- */
.settings { display: grid; gap: 18px; max-width: 860px; }
.settings h2 { margin-bottom: 6px; }
.settings .toolbar { margin-top: 4px; }
.weekly-list { display: grid; gap: 8px; margin: 6px 0 16px; }
.weekly-item { align-items: flex-start; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.weekly-item span { display: flex; flex-direction: column; }
code.codeblock { display: block; margin: 8px 0 14px; word-break: break-all; }

/* ----- banners ----- */
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 8px; margin: 0 0 12px; font-size: 14px; }
.banner p { margin: 0; flex: 1; }
.banner.warn { background: #fbecc8; color: #6b4a0e; }
.banner.back { background: #f6ded5; color: #7a3018; }
.banner.ok { background: #dcebe4; color: var(--green); }
.banner.info { background: #e3e8f0; color: #2a4a6b; }

/* ----- the editor dialog ----- */
.touch-modal { max-width: 1080px; }
.touch-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.touch-grid { display: grid; grid-template-columns: 1fr 300px; gap: 22px; align-items: start; }
.touch-side { background: #fbf6f0; border-radius: 10px; padding: 14px 16px; font-size: 14px; }
.touch-side h3 { font-size: 13px; font-family: Roboto, sans-serif; font-style: normal; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 0 4px; }
.touch-side h3:first-child { margin-top: 0; }
.touch-side p { margin: 2px 0; }
.side-name { font-weight: 700; }
.side-links { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.side-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.side-list li { display: flex; align-items: center; gap: 6px; }
.side-list li span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-meta { margin-top: 14px !important; }
.field-row { display: flex !important; justify-content: space-between; }
.counter { font-size: 12px; color: var(--muted); }
.counter.over { color: var(--red); font-weight: 700; }
.claude-box { border: 1px dashed #d6c9b7; border-radius: 10px; padding: 12px 14px; background: #fffdf9; }
.claude-box .field { margin-bottom: 10px; }
.inline-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.drafting { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }

@media (max-width: 900px) {
  .touch-grid, .event-grid { grid-template-columns: 1fr; }
  .row { flex-wrap: wrap; }
  .row-time { width: auto; }
  .row-main { flex-basis: 100%; order: 5; }
}

/* ----- email ----- */
.pill.sent { background: var(--navy); color: var(--cream); }
.email-box { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fff; margin-bottom: 14px; }
.email-box small { display: block; margin-top: 6px; }
.email-preview { width: 100%; height: 520px; border: 1px solid var(--line); border-radius: 8px; background: #fcf3eb; }
.email-box .inline-left input { flex: 1; min-width: 200px; }
.sub-head { font: 700 13px Roboto, sans-serif; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 8px; }
.field.narrow { max-width: 180px; }
.ses-status .banner { margin: 6px 0 0; }
.unsub-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.unsub-tools .card { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.unsub-tools textarea, .unsub-tools input[type=email] { width: 100%; }
@media (max-width: 760px) { .unsub-tools { grid-template-columns: 1fr; } }

/* ----- settings: footer links and series banners ----- */
.footer-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.banner-list { display: grid; gap: 10px; margin: 10px 0 6px; }
.banner-item { display: flex; align-items: center; gap: 14px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.banner-item img { width: 180px; height: 65px; object-fit: cover; border-radius: 6px; flex: none; }
.banner-item div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
@media (max-width: 760px) { .footer-links { grid-template-columns: 1fr; } .banner-item img { width: 110px; height: 40px; } }
