/* =========================================================
   NewsPublisher UI — main.css
   Shared design system for all panels/pages
   Bootstrap 5 polish • Accessible • Dark-mode via .theme-dark
   Fonts: Noto Sans (UI), Noto Serif Bengali (headings), Montserrat (labels)

   Palette, type and geometry sampled from
   anandabazar.com/west-bengal/kolkata — a flat, print-like
   two-red system on warm newsprint beige. The source page uses
   no drop shadows at all, so elevation here is carried by
   hairline rules rather than blur.
   ========================================================= */

/* ---- Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&family=Noto+Serif+Bengali:wght@400;600;700&family=Montserrat:wght@500;600;700&display=swap');

/* ---- Tokens ---- */
:root{
  /* Brand (sampled from Anandabazar) */
  --primary-color:   #EE303B;   /* Signature masthead red */
  --secondary-color: #A30202;   /* Deep red — labels, strong links */
  --accent-color:    #EE303B;   /* Same red: it is a single-accent brand */

  /* Editorial link blue (used for inline copy links on the source) */
  --link-color:      #3366CC;
  --link-hover:      #4990C9;

  /* Light variants / helpers */
  --primary-light:   #FFE8E9;   /* Pink tint — premium/section chips */
  --danger-light:    #FFD2D5;   /* Pink hairline */

  /* Neutrals — warm newsprint, not cool grey */
  --bg-body:     #EFEBEA;
  --surface:     #ffffff;
  --surface-2:   #F7F7F7;
  --surface-3:   #EFEBEA;
  --ink:         #000000;
  --text-color:  #1a1a1a;
  --muted-color: #5B5B5B;
  --muted-2:     #999999;

  /* Lines */
  --line-soft:   #F5F5F5;
  --line-medium: #D7D7D7;
  --line-strong: #D7D7D7;
  --line-brand:  #FFD2D5;   /* The pink rule that frames brand blocks */

  /* States */
  --info-color:    #3366CC;
  --success-color: #1a7f4b;
  --warning-color: #d98500;
  --danger-color:  #EE303B;

  /* Effects — deliberately flat, mirroring the source */
  --shadow-1: none;
  --shadow-2: 0 2px 8px rgba(0,0,0,.08);
  --shadow-3: 0 8px 28px rgba(0,0,0,.12);
  --radius-0: 0px;
  --radius-1: 4px;
  --radius-pill: 200px;
  --transition: all .18s ease;
  --ring: 0 0 0 .18rem rgba(238,48,59,.28);

  /* Type */
  --font-sans:  'Noto Sans', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --font-head:  'Noto Serif Bengali', Georgia, 'Times New Roman', serif;
  --font-label: 'Montserrat', 'Roboto Condensed', Arial, sans-serif;
  --fs-11: .6875rem;
  --fs-12: .75rem;
  --fs-13: .8125rem;
  --fs-14: .875rem;
  --fs-16: 1rem;
  --fs-18: 1.125rem;
  --fs-20: 1.25rem;
  --fs-22: 1.375rem;
  --fs-32: 2rem;
  --fs-48: 3rem;

  /* Table density */
  --row-pad-y: 10px;
  --row-pad-x: 12px;

  /* Pagination tones */
  --page-bg: #fff;
  --page-hover: #FFE8E9;
  --page-disabled: #F5F5F5;

  /* Badge pastel tints */
  --t-success: rgba(26,127,75,.12);
  --t-danger:  rgba(238,48,59,.12);
  --t-info:    rgba(51,102,204,.12);
  --t-warn:    rgba(217,133,0,.14);
  --t-primary: rgba(238,48,59,.12);
}

/* =========================================================
   Base & Utilities
   ========================================================= */
html, body{
  background: var(--bg-body);
  color: var(--text-color);
  font-family: var(--font-sans);
  font-size: var(--fs-14);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection{ background: rgba(238,48,59,.18); }

a{
  color: var(--secondary-color);
  text-decoration: none;
  transition: var(--transition);
}
a:hover{ color: var(--primary-color); }

/* Inline links inside running copy keep the editorial blue */
.prose a, .article-body a{ color: var(--link-color); }
.prose a:hover, .article-body a:hover{ color: var(--link-hover); }

h1,h2,h3,h4,h5{
  color: var(--ink);
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.4;
  margin-bottom: .5rem;
}
h1{ font-size: var(--fs-32); }
h2{ font-size: var(--fs-22); }
h3{ font-size: var(--fs-20); }
h4{ font-size: var(--fs-18); }
h5{ font-size: var(--fs-16); }

/* The big red section title, as on the source section pages */
.section-hero{
  font-family: var(--font-head);
  font-size: var(--fs-48);
  font-weight: 700;
  line-height: 1.25;
  color: var(--primary-color);
  text-align: center;
  margin: 16px 0 12px;
}
.section-kicker{
  font-family: var(--font-head);
  font-size: var(--fs-32);
  font-weight: 700;
  color: var(--ink);
  text-align: center;
}

/* Small all-caps label (Montserrat, like PREMIUM / MOST POPULAR) */
.label-eyebrow{
  font-family: var(--font-label);
  font-size: var(--fs-12);
  font-weight: 600;
  line-height: 2.16;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--secondary-color);
}

.container, .container-fluid{ padding-left: 14px; padding-right: 14px; }
.container{ max-width: 1200px; }
.text-muted{ color: var(--muted-color)!important; }
.divider{ height:1px; background: var(--line-soft); width:100%; }
.rounded-1{ border-radius: var(--radius-1)!important; }
.shadow-1{ box-shadow: var(--shadow-1)!important; }
:focus-visible{ outline: none; box-shadow: var(--ring); }

/* Spacing helpers */
.gap-2{ gap:.5rem; }
.gap-3{ gap:.75rem; }

/* Density toggles for tables (optional) */
.is-compact{ --row-pad-y: 8px; --row-pad-x: 10px; }
.is-comfy{ --row-pad-y: 12px; --row-pad-x: 14px; }

/* =========================================================
   Surfaces / Panels / Cards
   ========================================================= */
.card, .modal-content, .dropdown-menu, .offcanvas, .toast,
.panel, .list-group, .accordion-item, .popover {
  background: var(--surface);
  color: var(--text-color);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-1);
  box-shadow: var(--shadow-1);
}
/* Cards must NOT clip: an overflow context traps dropdowns, popovers and
   tooltips that open near a card's edge. Opt into clipping with .card-clip,
   and give genuinely wide tables their own horizontal scroller. */
.card { overflow: visible; }
.card-clip { overflow: hidden; }
.table-scroll { overflow-x: auto; }
.card-header, .modal-header, .popover-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line-strong);
  color: var(--ink);
  font-family: var(--font-head);
  font-weight: 700;
}
.card-footer, .modal-footer {
  background: var(--surface-2);
  border-top: 1px solid var(--line-strong);
}
.panel{ padding: 14px; }
.panel-head{
  display:flex; align-items:center; justify-content:space-between;
  gap: 10px; margin-bottom: 10px;
}
.panel-title{
  font-family: var(--font-head);
  font-weight:700;
  color: var(--ink);
  margin:0;
}
.panel-sub{ color: var(--muted-color); font-size: var(--fs-13); }

/* Brand-framed block — the pink-hairline treatment from the source */
.panel-brand, .card-brand{
  background: var(--primary-light);
  border-color: var(--line-brand);
}

/* Section heading with the red rule under it */
.section-rule{
  display:flex; align-items:baseline; justify-content:space-between;
  gap:10px;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 6px;
  margin-bottom: 12px;
}
.section-rule > .title{
  font-family: var(--font-head);
  font-weight: 700;
  font-size: var(--fs-22);
  color: var(--ink);
  margin: 0;
}
.section-rule > .more{
  font-family: var(--font-head);
  font-weight: 700;
  font-size: var(--fs-14);
  color: var(--primary-color);
}

/* =========================================================
   Buttons
   ========================================================= */
.btn{
  --bs-btn-font-weight: 600;
  font-family: var(--font-sans);
  font-size: var(--fs-14);
  line-height: 1.2;
  padding: 7px 12px;
  border-radius: var(--radius-1);
  transition: var(--transition);
  box-shadow: none;
}
.btn:focus{ box-shadow: var(--ring); }
/* Bootstrap 5.3 drives every button state from --bs-btn-* variables.
   Setting only `background` leaves hover/active/disabled on Bootstrap's own
   defaults — a disabled .btn-primary would fall back to its blue. Each variant
   below maps the full set onto our tokens so all states stay on-brand. */
.btn-primary{
  --bs-btn-color:#fff;
  --bs-btn-bg: var(--primary-color);
  --bs-btn-border-color: var(--primary-color);
  --bs-btn-hover-color:#fff;
  --bs-btn-hover-bg: var(--secondary-color);
  --bs-btn-hover-border-color: var(--secondary-color);
  --bs-btn-active-color:#fff;
  --bs-btn-active-bg: var(--secondary-color);
  --bs-btn-active-border-color: var(--secondary-color);
  --bs-btn-disabled-color:#fff;
  --bs-btn-disabled-bg: var(--primary-color);
  --bs-btn-disabled-border-color: var(--primary-color);
  --bs-btn-disabled-opacity:.55;

  background: var(--primary-color);
  border-color: var(--primary-color);
  color:#fff;
}
.btn-primary:hover{ background: var(--secondary-color); border-color: var(--secondary-color); }

.btn-secondary{
  --bs-btn-color:#fff;
  --bs-btn-bg: var(--secondary-color);
  --bs-btn-border-color: var(--secondary-color);
  --bs-btn-hover-color:#fff;
  --bs-btn-hover-bg: var(--primary-color);
  --bs-btn-hover-border-color: var(--primary-color);
  --bs-btn-active-color:#fff;
  --bs-btn-active-bg: var(--primary-color);
  --bs-btn-active-border-color: var(--primary-color);
  --bs-btn-disabled-color:#fff;
  --bs-btn-disabled-bg: var(--secondary-color);
  --bs-btn-disabled-border-color: var(--secondary-color);
  --bs-btn-disabled-opacity:.55;

  background: var(--secondary-color);
  border-color: var(--secondary-color);
  color:#fff;
}
.btn-secondary:hover{ filter: brightness(1.1); }

.btn-light{
  --bs-btn-color: var(--ink);
  --bs-btn-bg: var(--surface-2);
  --bs-btn-border-color: var(--line-strong);
  --bs-btn-hover-color: var(--ink);
  --bs-btn-hover-bg: var(--primary-light);
  --bs-btn-hover-border-color: var(--line-brand);
  --bs-btn-active-color: var(--ink);
  --bs-btn-active-bg: var(--primary-light);
  --bs-btn-active-border-color: var(--line-brand);
  --bs-btn-disabled-color: var(--muted-2);
  --bs-btn-disabled-bg: var(--surface-2);
  --bs-btn-disabled-border-color: var(--line-strong);
  --bs-btn-disabled-opacity:.65;

  background: var(--surface-2);
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-light:hover{ background: var(--primary-light); border-color: var(--line-brand); }

.btn-outline-primary{
  --bs-btn-color: var(--primary-color);
  --bs-btn-border-color: var(--primary-color);
  --bs-btn-hover-color:#fff;
  --bs-btn-hover-bg: var(--primary-color);
  --bs-btn-hover-border-color: var(--primary-color);
  --bs-btn-active-color:#fff;
  --bs-btn-active-bg: var(--primary-color);
  --bs-btn-active-border-color: var(--primary-color);
  --bs-btn-disabled-color: var(--primary-color);
  --bs-btn-disabled-bg: transparent;
  --bs-btn-disabled-border-color: var(--primary-color);
  --bs-btn-disabled-opacity:.55;

  color: var(--primary-color);
  border-color: var(--primary-color);
}
.btn-outline-primary:hover{
  background: var(--primary-color);
  color:#fff;
  border-color: var(--primary-color);
}

.btn-outline-danger{
  --bs-btn-color: var(--secondary-color);
  --bs-btn-border-color: var(--primary-color);
  --bs-btn-hover-color:#fff;
  --bs-btn-hover-bg: var(--primary-color);
  --bs-btn-hover-border-color: var(--primary-color);
  --bs-btn-active-color:#fff;
  --bs-btn-active-bg: var(--primary-color);
  --bs-btn-active-border-color: var(--primary-color);
  --bs-btn-disabled-color: var(--secondary-color);
  --bs-btn-disabled-bg: transparent;
  --bs-btn-disabled-border-color: var(--primary-color);
  --bs-btn-disabled-opacity:.55;

  color: var(--secondary-color);
  border-color: var(--primary-color);
}
.btn-outline-danger:hover{
  background: var(--primary-color);
  color:#fff;
  border-color: var(--primary-color);
}

/* A busy button should read as busy, not as broken. */
.btn:disabled, .btn.disabled{ cursor: not-allowed; }

.btn-sm{ padding: 5px 9px; font-size: var(--fs-13); border-radius: var(--radius-1); }
.btn-lg{ padding: 9px 16px; font-size: var(--fs-16); border-radius: var(--radius-1); }
.btn i, .btn .fa{ margin-right: 6px; }

/* Pill CTA — the "read all of this section" button */
.btn-pill{ border-radius: var(--radius-pill); padding-left: 18px; padding-right: 18px; }

/* Icon-only */
.icon-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width:34px; height:34px;
  border:1px solid var(--line-strong);
  border-radius: var(--radius-1);
  background: var(--surface);
  color: var(--ink);
  transition: var(--transition);
}
.icon-btn:hover{
  background: var(--primary-light);
  border-color: var(--line-brand);
  color: var(--primary-color);
}

/* =========================================================
   Forms (checkbox/radio/switch)
   ========================================================= */
.form-control, .form-select, .input-group-text, .form-control-plaintext{
  background:#fff; color: var(--text-color);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-1);
  box-shadow: none; transition: var(--transition);
  font-size: var(--fs-14); padding: 9px 10px;
}
.form-control:focus, .form-select:focus{
  border-color: var(--primary-color);
  box-shadow: var(--ring);
}
.form-control::placeholder{ color: var(--muted-2); }

/* Base controls */
.form-check-input{
  width:1.1rem; height:1.1rem;
  border:1px solid var(--line-medium);
  background-color:#fff;
  accent-color: var(--primary-color);
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  position: relative;
  border-radius: var(--radius-1);
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
  background-clip: padding-box;
}
.form-check-input:focus{
  box-shadow: var(--ring);
  border-color: var(--primary-color);
}
.form-check-input:disabled{ opacity:.6; cursor:not-allowed; }

/* Checkbox */
.form-check:not(.form-switch) .form-check-input[type="checkbox"]{
  background-image: none !important;
}
.form-check:not(.form-switch) .form-check-input[type="checkbox"]::after{
  content:"";
  position:absolute; inset:0;
  background-color:#fff;
  opacity:0; transition: opacity .12s ease;
  -webkit-mask: url("data:image/svg+xml,%3Csvg width='16' height='12' viewBox='0 0 16 12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1.5 6.5L5.5 10.5L14.5 1.5' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px 12px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg width='16' height='12' viewBox='0 0 16 12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1.5 6.5L5.5 10.5L14.5 1.5' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px 12px no-repeat;
}
.form-check:not(.form-switch) .form-check-input[type="checkbox"]:checked{
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}
.form-check:not(.form-switch) .form-check-input[type="checkbox"]:checked::after{ opacity:1; }

/* Radio */
.form-check-input[type="radio"]{
  border-radius: 50%;
  background-image: none;
}
.form-check-input[type="radio"]::after{
  content:"";
  position:absolute; top:50%; left:50%;
  width:.54rem; height:.54rem; border-radius:50%;
  transform: translate(-50%, -50%);
  background: var(--primary-color);
  opacity:0; transition: opacity .15s ease;
}
.form-check-input[type="radio"]:checked{
  border-color: var(--primary-color);
  background-color: #fff;
}
.form-check-input[type="radio"]:checked::after{ opacity:1; }

/* Switch */
.form-switch .form-check-input{
  width: 2.3rem; height: 1.3rem;
  border-radius: var(--radius-pill);
  background-color: #e6e0df;
  border-color: var(--line-medium);
  background-image: none !important;
  position: relative;
}
.form-switch .form-check-input::before{
  content: "";
  position: absolute; top: 50%; left: 2px;
  width: 1rem; height: 1rem; border-radius: 50%;
  transform: translateY(-50%);
  background: #ffffff; box-shadow: 0 1px 2px rgba(0,0,0,.25);
  transition: left .2s ease;
}
.form-switch .form-check-input:checked{
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}
.form-switch .form-check-input:checked::before{
  left: calc(100% - 1rem - 2px);
}

/* =========================================================
   Tables
   ========================================================= */
.table,
.table-striped,
.table-hover,
.table-bordered{
  width: 100%;
  background: var(--surface);
  color: var(--text-color);
  border: none;
  border-radius: var(--radius-0);
  box-shadow: none;
  font-size: var(--fs-13);
  border-collapse: separate;
  border-spacing: 0;
}
.table caption{
  caption-side: top;
  color: var(--muted-color);
  padding: 8px 0;
}
.table > :not(caption) > * > *{
  background: transparent;
  border: none;
  padding: var(--row-pad-y) var(--row-pad-x);
  box-shadow: inset 0 -1px 0 var(--line-strong);
}
.table thead th{
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--font-label);
  font-weight: 600;
  font-size: var(--fs-11);
  text-transform: uppercase;
  letter-spacing: .04em;
  position: sticky; top: 0; z-index: 1;
  box-shadow: inset 0 -2px 0 var(--primary-color);
}
.table tbody th{ color: var(--text-color); font-weight: 600; }
.table tbody td a{ color: var(--secondary-color); }
.table tbody td a:hover{ color: var(--primary-color); }

/* Hover/active rows */
.table-hover tbody tr:hover > *{
  background: var(--primary-light);
  box-shadow:
    inset 0 -1px 0 var(--line-brand),
    inset 0 1px 0 var(--line-brand);
}

/* Selected row utility */
.table tbody tr.is-selected > *{
  background: var(--t-primary);
  box-shadow:
    inset 0 -1px 0 var(--line-brand),
    inset 0 1px 0 var(--line-brand);
}

/* Compact mode */
.table.table-sm > :not(caption) > * > *{
  padding: 8px 10px;
}

/* =========================================================
   Pagination
   ========================================================= */
.pagination{
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.page-link{
  padding: 6px 12px;
  font-size: var(--fs-14);
  line-height: 1.2;
  border: 1px solid var(--line-strong);
  background: var(--page-bg);
  color: var(--text-color);
  border-radius: var(--radius-1);
  transition: var(--transition);
}
.page-link:hover{
  background: var(--page-hover);
  border-color: var(--line-brand);
  color: var(--primary-color);
}
.page-link:focus{
  box-shadow: var(--ring);
  border-color: var(--primary-color);
}
.page-item.active .page-link{
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}
.page-item.disabled .page-link{
  color: var(--muted-2);
  background: var(--page-disabled);
}

/* =========================================================
   Nav / Tabs / Pills
   ========================================================= */
.nav-tabs{
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
}
.nav-tabs .nav-link{
  border: none; border-bottom: 2px solid transparent;
  color: var(--ink); background: transparent !important;
  font-family: var(--font-head);
  font-size: var(--fs-16);
  padding: 10px 10px; transition: var(--transition);
  border-radius: 0;
}
.nav-tabs .nav-link:hover{
  color: var(--primary-color);
  background: var(--surface-2) !important;
}
.nav-tabs .nav-link.active{
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  background: transparent !important;
  font-weight: 700;
}

.nav-pills .nav-link{
  background: #fff;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-family: var(--font-head);
  border-radius: var(--radius-1);
  margin-right: 6px;
  padding: 6px 12px;
}
.nav-pills .nav-link.active{
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

/* Masthead nav strip — serif, 18px, dot separators, as on the source */
.nav-masthead{
  display:flex; flex-wrap:wrap; align-items:center; justify-content:center;
  gap: 0;
  font-family: var(--font-head);
  font-size: var(--fs-18);
  border-top: 1px solid var(--line-medium);
  border-bottom: 1px solid var(--line-medium);
  padding: 6px 0;
}
.nav-masthead a{
  color: var(--ink);
  padding: 2px 12px;
  position: relative;
}
.nav-masthead a + a::before{
  content:"";
  position:absolute; left:0; top:50%;
  width:1px; height:14px;
  transform: translateY(-50%);
  background: var(--line-medium);
}
.nav-masthead a:hover{ color: var(--primary-color); }
.nav-masthead a.active{ color: var(--primary-color); font-weight: 700; }

/* =========================================================
   Dropdowns / Popovers / Tooltips
   ========================================================= */
.dropdown-menu{
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-2);
  border-radius: var(--radius-1);
  padding: 6px;
  background: var(--surface);
}
.dropdown-item{
  border-radius: var(--radius-1);
  color: var(--text-color);
}
.dropdown-item:hover{
  background: var(--primary-light);
  color: var(--primary-color);
}

.popover{
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-2);
}
.popover-header{
  font-weight: 700;
  font-family: var(--font-head);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-strong);
}
.popover-body{ color: var(--text-color); }

.tooltip .tooltip-inner{
  background: #000000;
  color: #fff;
  border-radius: var(--radius-1);
  padding: 6px 8px;
}
.tooltip .tooltip-arrow::before{
  border-top-color: #000000 !important;
}

/* =========================================================
   List group / Accordion / Breadcrumb / Progress
   ========================================================= */
.list-group{
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-1);
  overflow: hidden;
  background: var(--surface);
}
.list-group-item{
  background: transparent;
  color: var(--text-color);
  border-color: var(--line-soft);
}
.list-group-item:hover{ background: var(--surface-2); }
.list-group-item.active{
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

/* Numbered headline list — the "most read" rail */
.list-ranked{ counter-reset: rank; }
.list-ranked .list-group-item{
  display:flex; gap:10px; align-items:flex-start;
  font-family: var(--font-head);
  font-size: var(--fs-16);
}
.list-ranked .list-group-item::before{
  counter-increment: rank;
  content: counter(rank);
  font-family: var(--font-label);
  font-weight: 700;
  font-size: var(--fs-20);
  line-height: 1;
  color: var(--primary-color);
  min-width: 22px;
}

/* Accordion */
.accordion-item{
  border: 1px solid var(--line-strong);
  background: var(--surface);
}
.accordion-button{
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-head);
  transition: background .15s ease, color .15s ease;
}
.accordion-button:hover{ background: var(--surface-2); }
.accordion-button:not(.collapsed){
  background: var(--primary-light);
  color: var(--primary-color);
  box-shadow: inset 0 -1px 0 var(--line-brand);
}
/* Chevron */
.accordion-button::after{
  flex-shrink: 0;
  width: 1rem; height: 1rem; margin-left: auto;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.75 7.5L10 11.75L14.25 7.5' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
          mask: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.75 7.5L10 11.75L14.25 7.5' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
  background-image: none !important;
}
.accordion-button:not(.collapsed)::after{ transform: rotate(180deg); }

/* Breadcrumb */
.breadcrumb{
  background: transparent;
  border: none;
  padding: 8px 0;
  border-radius: 0;
  box-shadow: none;
  font-size: var(--fs-13);
  justify-content: center;
}
.breadcrumb .breadcrumb-item{ color: var(--muted-color); }
.breadcrumb .breadcrumb-item > a{ color: var(--muted-color); }
.breadcrumb .breadcrumb-item > a:hover{ color: var(--primary-color); }
.breadcrumb .breadcrumb-item.active{ color: var(--ink); }
.breadcrumb .breadcrumb-item + .breadcrumb-item::before{
  content: "/";
  color: var(--muted-2);
}

.progress{
  background: var(--line-soft);
  border-radius: var(--radius-1);
  height: 6px;
}
.progress-bar{ background: var(--primary-color); }

/* =========================================================
   Badges
   ========================================================= */
.badge{
  font-family: var(--font-label);
  font-size: var(--fs-11);
  font-weight: 600;
  padding: 3px 6px;
  border-radius: var(--radius-1);
  line-height: 1.2;
  letter-spacing: .02em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid transparent;
  box-shadow: none;
}
.badge i, .badge .fa{ font-size: var(--fs-11); }

/* Solid */
.badge-success { background-color: var(--success-color) !important; color:#fff !important; }
.badge-danger  { background-color: var(--danger-color)  !important; color:#fff !important; }
.badge-info    { background-color: var(--info-color)    !important; color:#fff !important; }
.badge-warning { background-color: var(--warning-color) !important; color:#fff !important; }
.badge-primary { background-color: var(--primary-color) !important; color:#fff !important; }

/* Deep-red label, as used for MOST POPULAR on the source */
.badge-label{
  background: var(--secondary-color) !important;
  color:#fff !important;
  border-radius: var(--radius-0);
  padding: 1px 5px;
}

/* Soft (pastel) */
.badge-soft-success{
  background: var(--t-success);
  color: #14663c;
  border-color: rgba(26,127,75,.22);
}
.badge-soft-danger{
  background: var(--t-danger);
  color: var(--secondary-color);
  border-color: var(--line-brand);
}
.badge-soft-info{
  background: var(--t-info);
  color: #2851a3;
  border-color: rgba(51,102,204,.22);
}
.badge-soft-warning{
  background: var(--t-warn);
  color: #8a5400;
  border-color: rgba(217,133,0,.26);
}
/* The PREMIUM chip: pink tint, pink hairline, red type */
.badge-soft-primary{
  background: var(--primary-light);
  color: var(--primary-color);
  border-color: var(--line-brand);
}

/* Outline */
.badge-outline-success{ background: transparent; color: var(--success-color); border-color: var(--success-color); }
.badge-outline-danger { background: transparent; color: var(--danger-color);  border-color: var(--danger-color); }
.badge-outline-info   { background: transparent; color: var(--info-color);    border-color: var(--info-color); }
.badge-outline-warning{ background: transparent; color: var(--warning-color); border-color: var(--warning-color); }
.badge-outline-primary{
  background: transparent;
  color: var(--primary-color);
  border-color: var(--primary-color);
}

/* v4 compatibility */
.badge.bg-warning, .badge.text-bg-warning{
  color:#fff!important;
}

/* =========================================================
   Navbar
   ========================================================= */
.navbar{
  border-bottom: 1px solid var(--line-medium);
  background: var(--surface) !important;
  min-height: 64px;
}
.navbar .navbar-brand{
  font-family: var(--font-head);
  font-weight: 700;
  font-size: var(--fs-22);
  color: var(--ink) !important;
}
.navbar .nav-link{
  color: var(--ink) !important;
  font-family: var(--font-head);
  font-size: var(--fs-16);
}
.navbar .nav-link:hover,
.navbar .nav-link.active{
  color: var(--primary-color) !important;
}

/* =========================================================
   Empty state
   ========================================================= */
.empty{
  border:1px dashed var(--line-medium);
  border-radius: var(--radius-1);
  padding: 24px;
  text-align:center;
  color: var(--muted-color);
  background: var(--surface);
}

/* =========================================================
   Dark Theme
   Warm, ink-on-newsprint inverted — kept warm rather than blue
   so the red still reads as the same brand red.
   ========================================================= */
.theme-dark{
  --bg-body:#121010;
  --surface:#1c1918;
  --surface-2:#232020;
  --surface-3:#2a2626;
  --ink:#f5f0ef;
  --text-color:#e8e2e1;
  --muted-color:#a89f9e;
  --muted-2:#8a8180;

  --primary-color:#FF5A63;   /* lifted for contrast on dark */
  --secondary-color:#FF8A90;
  --accent-color:#FF5A63;
  --danger-color:#FF5A63;
  --primary-light:#3a1f21;
  --line-brand:#5c2e31;

  --line-strong:#3a3434;
  --line-medium:#3a3434;
  --line-soft:#2a2626;

  --page-bg:#1c1918;
  --page-hover:#3a1f21;
  --page-disabled:#171414;

  --ring: 0 0 0 .18rem rgba(255,90,99,.30);
}

/* Surfaces */
.theme-dark .card,
.theme-dark .panel,
.theme-dark .breadcrumb,
.theme-dark .dropdown-menu,
.theme-dark .modal-content,
.theme-dark .offcanvas,
.theme-dark .toast,
.theme-dark .list-group,
.theme-dark .accordion-item,
.theme-dark .popover{
  background: var(--surface) !important;
  color: var(--text-color) !important;
  border-color: var(--line-strong) !important;
  box-shadow: var(--shadow-1);
}
.theme-dark .breadcrumb{ background: transparent !important; border: none !important; }
.theme-dark .card-header,
.theme-dark .modal-header,
.theme-dark .popover-header{
  background: var(--surface);
  border-bottom-color: var(--line-strong);
  color: var(--ink);
}
.theme-dark .card-footer,
.theme-dark .modal-footer{
  background: var(--surface-2);
  border-top-color: var(--line-strong);
}
.theme-dark .panel-brand,
.theme-dark .card-brand{
  background: var(--primary-light);
  border-color: var(--line-brand);
}

/* Forms — dark */
.theme-dark .form-control,
.theme-dark .form-select,
.theme-dark .input-group-text{
  background: var(--surface-2);
  color: var(--text-color);
  border: 1px solid var(--line-strong);
}
.theme-dark .form-control::placeholder{ color: var(--muted-2); }
.theme-dark .form-control:focus,
.theme-dark .form-select:focus{
  border-color: var(--primary-color);
  box-shadow: var(--ring);
}

/* Check/radio/switch */
.theme-dark .form-check-input{
  background: var(--surface-2);
  border-color: var(--line-strong);
}
.theme-dark .form-check:not(.form-switch)
.form-check-input[type="checkbox"]:checked{
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}
.theme-dark .form-check-input[type="radio"]::after{
  background: var(--primary-color);
}
.theme-dark .form-switch .form-check-input{
  background: var(--surface-3);
}
.theme-dark .form-switch .form-check-input:checked{
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

/* Tables (dark) */
.theme-dark .table,
.theme-dark .table-striped,
.theme-dark .table-hover,
.theme-dark .table-bordered{
  background: var(--surface);
  color: var(--text-color);
  border: none;
}
.theme-dark .table > :not(caption) > * > *{
  background: transparent !important;
  border: none !important;
  padding: var(--row-pad-y) var(--row-pad-x);
  box-shadow: inset 0 -1px 0 var(--line-strong) !important;
}
.theme-dark .table thead th{
  background: var(--surface-2) !important;
  color: var(--ink) !important;
  box-shadow: inset 0 -2px 0 var(--primary-color) !important;
}
.theme-dark .table tbody td,
.theme-dark .table tbody th{
  color: var(--text-color) !important;
}
.theme-dark .table tbody td a{ color: var(--secondary-color); }
.theme-dark .table-hover tbody tr:hover > *{
  background: var(--primary-light) !important;
  box-shadow:
    inset 0 -1px 0 var(--line-brand),
    inset 0 1px 0 var(--line-brand) !important;
}

/* Pagination (dark) */
.theme-dark .page-link{
  background: var(--page-bg);
  color: var(--text-color);
  border-color: var(--line-strong);
}
.theme-dark .page-link:hover{
  background: var(--page-hover);
  border-color: var(--line-brand);
  color: var(--primary-color);
}
.theme-dark .page-item.active .page-link{
  background: var(--primary-color);
  border-color: var(--primary-color);
  color:#fff;
}
.theme-dark .page-item.disabled .page-link{
  color: var(--muted-2);
  background: var(--page-disabled);
}

/* Tabs & Pills (dark) */
.theme-dark .nav-tabs{
  border-bottom-color: var(--line-strong);
  background: transparent;
}
.theme-dark .nav-tabs .nav-link{
  color: var(--text-color);
  background: transparent !important;
  border-bottom-color: transparent;
}
.theme-dark .nav-tabs .nav-link:hover{
  background: var(--surface-2) !important;
  color: var(--primary-color);
}
.theme-dark .nav-tabs .nav-link.active{
  color: var(--primary-color);
  background: transparent !important;
  border-bottom-color: var(--primary-color) !important;
}
.theme-dark .nav-pills .nav-link{
  background: var(--surface-2);
  border-color: var(--line-strong);
  color: var(--text-color);
}
.theme-dark .nav-pills .nav-link.active{
  background: var(--primary-color);
  border-color: var(--primary-color);
  color:#fff;
}
.theme-dark .nav-masthead{
  border-color: var(--line-strong);
}
.theme-dark .nav-masthead a{ color: var(--text-color); }
.theme-dark .nav-masthead a:hover,
.theme-dark .nav-masthead a.active{ color: var(--primary-color); }
.theme-dark .nav-masthead a + a::before{ background: var(--line-strong); }

/* Dropdowns / Popovers / Tooltips (dark) */
.theme-dark .dropdown-menu{
  background: var(--surface);
}
.theme-dark .dropdown-item{
  color: var(--text-color);
}
.theme-dark .dropdown-item:hover{
  background: var(--primary-light);
  color: var(--primary-color);
}
.theme-dark .popover{ background: var(--surface); }
.theme-dark .popover-body{ color: var(--text-color); }
.theme-dark .tooltip .tooltip-inner{ background:#000; }
.theme-dark .tooltip .tooltip-arrow::before{
  border-top-color:#000 !important;
}

/* List group / Accordion (dark) */
.theme-dark .list-group{
  border-color: var(--line-strong);
}
.theme-dark .list-group-item{
  background: transparent;
  color: var(--text-color);
  border-color: var(--line-soft);
}
.theme-dark .list-group-item:hover{ background: var(--surface-2); }
.theme-dark .list-group-item.active{
  background: var(--primary-color);
  border-color: var(--primary-color);
  color:#fff;
}
.theme-dark .list-ranked .list-group-item::before{ color: var(--primary-color); }
.theme-dark .accordion-item{ background: var(--surface); }
.theme-dark .accordion-button{
  background: var(--surface);
  color: var(--text-color);
}
.theme-dark .accordion-button:hover{ background: var(--surface-2); }
.theme-dark .accordion-button:not(.collapsed){
  background: var(--primary-light);
  color: var(--primary-color);
  box-shadow: inset 0 -1px 0 var(--line-brand);
}

/* Navbar (dark) */
.theme-dark .navbar{
  background: var(--surface) !important;
  border-bottom: 1px solid var(--line-strong);
}
.theme-dark .navbar .navbar-brand,
.theme-dark .navbar .nav-link{
  color: var(--text-color) !important;
}
.theme-dark .navbar .nav-link:hover,
.theme-dark .navbar .nav-link.active{
  color: var(--primary-color) !important;
}

/* Breadcrumb (dark) */
.theme-dark .breadcrumb .breadcrumb-item{ color: var(--muted-color); }
.theme-dark .breadcrumb .breadcrumb-item > a{ color: var(--muted-color); }
.theme-dark .breadcrumb .breadcrumb-item > a:hover{
  color: var(--primary-color);
}
.theme-dark .breadcrumb .breadcrumb-item.active{
  color: var(--ink);
}
.theme-dark .breadcrumb .breadcrumb-item + .breadcrumb-item::before{
  color: var(--muted-2);
}

/* Headings & hero (dark) */
.theme-dark h1,.theme-dark h2,.theme-dark h3,
.theme-dark h4,.theme-dark h5{ color: var(--ink); }
.theme-dark .section-hero{ color: var(--primary-color); }
.theme-dark .section-kicker{ color: var(--ink); }
.theme-dark .section-rule{ border-bottom-color: var(--primary-color); }
.theme-dark .section-rule > .title{ color: var(--ink); }

/* Alerts (dark) */
.theme-dark .alert{
  background: var(--surface);
  color: var(--text-color);
  border-color: var(--line-strong);
}
.theme-dark .alert-info{
  color:#9dbcf5;
  background:#16233a;
}
.theme-dark .alert-success{
  color:#6ddba0;
  background:#0f2a1c;
}
.theme-dark .alert-warning{
  color:#f0b95e;
  background:#2e2008;
}
.theme-dark .alert-danger{
  color:#ff9aa0;
  background:#3a1416;
}

/* Empty state (dark) */
.theme-dark .empty{
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--muted-color);
}

/* =========================================================
   Responsive polish
   ========================================================= */
@media (max-width: 992px){
  .card:hover{ transform: none; }
  .section-hero{ font-size: var(--fs-32); }
  .section-kicker{ font-size: var(--fs-22); }
  .nav-masthead{ font-size: var(--fs-16); justify-content:flex-start; overflow-x:auto; flex-wrap:nowrap; }
}
@media (max-width: 576px){
  .section-hero{ font-size: var(--fs-22); }
  h1{ font-size: var(--fs-22); }
  h2{ font-size: var(--fs-20); }
}
@media (prefers-reduced-motion: reduce){
  * { transition: none !important; }
}

/* =========================================================
   Extra components (tweaked for NewsPublisher)
   ========================================================= */

/* Dropdowns inside table */
.table-wrap .dropdown{ position:relative; }
.dropdown [data-bs-toggle="dropdown"]{ border-radius: var(--radius-1); }
.dropdown-menu{
  border-radius: var(--radius-1);
  border:1px solid var(--line-strong);
  box-shadow: var(--shadow-2);
  min-width:220px;
  z-index:1085;
}
.dropdown-item{ display:flex; align-items:center; gap:.6rem; }
.dropdown-item i{ width:16px; text-align:center; }
.dropdown-item.text-danger{ color: var(--danger-color) !important; }

/* Empty & loader */
#empty{ color: var(--muted-color); }
.placeholder{
  background:linear-gradient(90deg, #00000010, #00000005, #00000010);
  border-radius: var(--radius-1);
}

/* Modals */
.modal-content{
  border-radius: var(--radius-1);
  border:1px solid var(--line-strong);
  background: var(--surface);
}
.modal-header{ border-bottom:1px solid var(--line-strong); }
.modal-footer{ border-top:1px solid var(--line-strong); }
.modal-title{
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--ink);
}
.modal-title i{ opacity:.9; color: var(--primary-color); }

/* ===== Featured Media modal ===== */
.media-head{
  display:flex; align-items:flex-start; justify-content:space-between;
  gap:12px; margin-bottom:8px;
}
.media-head .meta .title{
  font-weight:700;
  color: var(--ink);
  font-family: var(--font-head);
  line-height:1.3;
}
.media-head .meta .sub{
  color: var(--muted-color);
  font-size: var(--fs-13);
}

/* Section labels inside modal */
.modal .section-label{
  font-family: var(--font-label);
  font-size: var(--fs-12);
  font-weight:600;
  text-transform: uppercase;
  letter-spacing:.02em;
  color: var(--secondary-color);
  margin-top:6px;
}

/* Media list */
.media-list{ margin-top:8px; }
.media-item{
  display:grid; grid-template-columns:28px 1fr auto; align-items:center; gap:10px;
  border:1px solid var(--line-strong);
  border-radius: var(--radius-1);
  background: var(--surface-2);
  padding:10px 12px;
  margin-bottom:8px;
}
.media-item .handle{ cursor:grab; opacity:.7; }
.media-item.dragging{ opacity:.5; }
.media-item .url{
  font-size: var(--fs-13);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  max-width:52vw;
}
.media-item .kind{ font-size: var(--fs-12); color: var(--muted-color); }
.media-item .btn-icon{
  border:none; background:transparent;
  padding:.25rem .4rem;
  color: var(--muted-color);
}
.media-item .btn-icon:hover{ color: var(--primary-color); }
.media-item .icon{
  width:28px; height:28px; border-radius: var(--radius-1);
  display:flex; align-items:center; justify-content:center;
  border:1px solid var(--line-strong);
  background:#fff;
}

/* Dropdown visibility safety nets */
.table-wrap .dropdown-menu{ z-index: 2050; }

/* Shared small wrapper */
.sm-wrap{
  max-width:1100px;
  margin:16px auto 40px;
}
.sm.card{
  border:1px solid var(--line-strong);
  border-radius: var(--radius-1);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  overflow:hidden;
}
.sm .card-header{
  background: var(--surface);
  border-bottom:1px solid var(--line-strong);
  padding:16px 18px;
}
.sm-head{ display:flex; align-items:center; gap:10px; }
.sm-head i{ color: var(--primary-color); }
.sm-head strong{
  color: var(--ink);
  font-family: var(--font-head);
  font-weight:700;
}
.sm-head .hint{
  color: var(--muted-color);
  font-size: var(--fs-13);
}
.section-title{
  font-weight:700;
  color: var(--ink);
  font-family: var(--font-head);
  margin:12px 2px 14px;
}
.divider-soft{
  height:1px;
  background: var(--line-soft);
  margin:10px 0 16px;
}

/* Dimmer + spinner */
/* Alpine holds markup back until it has parsed the component. */
[x-cloak]{ display:none !important; }

/* =========================================================
   SweetAlert2
   The library ships its own light-only palette, and its title is an <h2> —
   so the global heading rule above was colouring it var(--ink), which in dark
   mode is near-white on SweetAlert's white popup. Everything below pins the
   component to our tokens so both themes stay readable.
   ========================================================= */

.swal2-container{ font-family: var(--font-sans); }

.swal2-popup{
  background: var(--surface) !important;
  color: var(--text-color) !important;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-1) !important;
  font-family: var(--font-sans);
  box-shadow: var(--shadow-2);
}

.swal2-title{
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--ink) !important;
  font-size: var(--fs-20);
}

.swal2-html-container,
.swal2-content{
  color: var(--text-color) !important;
  font-size: var(--fs-14);
}

.swal2-close{ color: var(--muted-color); }
.swal2-close:hover{ color: var(--primary-color); }

/* Buttons — match the dashboard rather than SweetAlert's pill defaults.
   An inline confirmButtonColor still wins, which is intended. */
.swal2-styled{
  border-radius: var(--radius-1) !important;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--fs-14);
  padding: 7px 14px !important;
  box-shadow: none !important;
}
.swal2-styled.swal2-confirm{
  background: var(--primary-color);
  color: #fff;
}
.swal2-styled.swal2-cancel{
  background: var(--surface-2) !important;
  color: var(--ink) !important;
  border: 1px solid var(--line-strong) !important;
}
.swal2-styled.swal2-cancel:hover{
  background: var(--primary-light) !important;
  border-color: var(--line-brand) !important;
}
.swal2-styled:focus{ box-shadow: var(--ring) !important; }

/* Toast */
.swal2-toast{
  background: var(--surface) !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: var(--radius-1) !important;
  box-shadow: var(--shadow-2) !important;
}
.swal2-toast .swal2-title{
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--fs-13);
  color: var(--ink) !important;
  margin: 0;
}
.swal2-toast .swal2-timer-progress-bar{ background: var(--primary-color) !important; }

/* Status icons, tinted from our own palette */
.swal2-icon.swal2-success{ border-color: var(--success-color) !important; color: var(--success-color) !important; }
.swal2-icon.swal2-success .swal2-success-ring{ border-color: var(--success-color) !important; }
.swal2-icon.swal2-success [class^='swal2-success-line']{ background-color: var(--success-color) !important; }
.swal2-icon.swal2-error{ border-color: var(--danger-color) !important; color: var(--danger-color) !important; }
.swal2-icon.swal2-error [class^='swal2-x-mark-line']{ background-color: var(--danger-color) !important; }
.swal2-icon.swal2-warning{ border-color: var(--warning-color) !important; color: var(--warning-color) !important; }
.swal2-icon.swal2-info,
.swal2-icon.swal2-question{ border-color: var(--info-color) !important; color: var(--info-color) !important; }

/* Inputs, for the rare prompt */
.swal2-input, .swal2-textarea, .swal2-select{
  background: var(--surface) !important;
  color: var(--text-color) !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: var(--radius-1) !important;
  font-size: var(--fs-14);
}
.swal2-input:focus, .swal2-textarea:focus{
  border-color: var(--primary-color) !important;
  box-shadow: var(--ring) !important;
}

.swal2-container.swal2-backdrop-show{ background: rgba(0,0,0,.45); }
html.theme-dark .swal2-container.swal2-backdrop-show{ background: rgba(0,0,0,.6); }

/* =========================================================
   Loaders
   Markup lives in resources/views/partials/loader.blade.php, which renders
   either shape:

     @include('partials.loader')                    full-page boot veil
     @include('partials.loader', ['id' => 'muDim']) overlay for one panel

   Both are styled here rather than in a layout, so every module gets them
   from the design system instead of restating the rules.
   ========================================================= */

/* ---- Panel overlay: covers one card while it refreshes ---- */
.dim{
  position:absolute; inset:0;
  display:none; align-items:center; justify-content:center;
  background:rgba(0,0,0,.06); z-index:2;
  border-radius:inherit;
}
.dim.show{ display:flex; }
.spin{
  width:18px; height:18px;
  border:3px solid #0001;
  border-top-color: var(--primary-color);
  border-radius:50%;
  animation:rot 1s linear infinite;
}
@keyframes rot{ to{ transform:rotate(360deg); } }

html.theme-dark .dim{ background:rgba(0,0,0,.35); }

/* ---- Full-page boot veil: held up until we know who is signed in ---- */
.np-boot{
  position:fixed; inset:0; z-index:2000;
  display:grid; place-items:center;
  background:var(--bg-body);
  transition:opacity .25s ease;
}
.np-boot.is-done{ opacity:0; pointer-events:none; }
.np-boot-mark{
  font-family:var(--font-head); font-weight:700;
  font-size:var(--fs-22); color:var(--ink);
  text-align:center;
}
.np-boot-mark span{ color:var(--primary-color); }
.np-boot-rule{
  width:120px; height:3px; margin:12px auto 0;
  background:var(--line-medium);
  position:relative; overflow:hidden;
}
.np-boot-rule::after{
  content:""; position:absolute; inset:0; width:40%;
  background:var(--primary-color);
  animation:npSweep 1s ease-in-out infinite;
}
@keyframes npSweep{
  0%{ transform:translateX(-100%); } 100%{ transform:translateX(250%); }
}

@media (prefers-reduced-motion: reduce){
  .np-boot-rule::after{ animation:none; }
  .spin{ animation-duration:2s; }
}

.err{
  font-size: var(--fs-12);
  color: var(--danger-color);
  display:none;
  margin-top:6px;
}
.err:not(:empty){ display:block; }

/* Dropzone (file upload) */
.dropzone{
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  text-align:center;
  border:2px dashed var(--line-medium);
  border-radius: var(--radius-1);
  background: var(--surface-2);
  padding:20px;
  transition:border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.dropzone:hover{
  border-color: var(--primary-color);
  background: var(--primary-light);
}
.dropzone.drag{
  border-color: var(--primary-color);
  background: var(--primary-light);
  box-shadow:0 0 0 3px rgba(238,48,59,.18);
}
.dropzone .hint{ color: var(--muted-color); font-size: var(--fs-13); }
.drop-icon{
  width:52px; height:52px; border-radius:999px;
  border:1px dashed var(--line-medium);
  display:flex; align-items:center; justify-content:center;
  margin-bottom:10px; opacity:.9;
}

/* File rows */
.file-list{ margin-top:10px; }
.file-row{
  display:grid; grid-template-columns:1fr auto auto auto;
  align-items:center; gap:12px;
  border:1px solid var(--line-strong);
  border-radius: var(--radius-1);
  background: var(--surface-2);
  padding:10px 14px;
  margin-bottom:10px;
  transition: all .2s ease;
}
.file-row:hover{
  background: var(--primary-light);
  border-color: var(--line-brand);
}
.file-row .name{
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  font-weight:500; color: var(--ink);
}
.file-row .size{
  color: var(--muted-color);
  font-size: var(--fs-12);
  min-width:70px;
  text-align:right;
}

/* Action buttons */
.btn-action{
  background:transparent;
  padding:6px 10px; border-radius: var(--radius-1);
  transition: all .2s ease;
  cursor:pointer; font-size: var(--fs-13);
  display:flex; align-items:center; gap:4px;
  border:1px solid transparent;
}
.btn-preview{
  color: var(--info-color);
  border-color: rgba(51,102,204,.28);
}
.btn-preview:hover{
  background: var(--info-color);
  color:#fff;
}
.btn-delete{
  color: var(--danger-color);
  border-color: var(--danger-light);
}
.btn-delete:hover{
  background: var(--danger-color);
  color:#fff;
}

.btn-group{ display:flex; gap:8px; align-items:center; }

.btn-loading{ pointer-events:none; opacity:.85; }
.btn-loading .btn-label{ visibility:hidden; }
.btn-loading .btn-spinner{ display:inline-block !important; }
.btn-spinner{
  display:none;
  width:1rem; height:1rem;
  border:.2rem solid #0001;
  border-top-color:#fff;
  border-radius:50%;
  vertical-align:-.125em;
  animation:rot 1s linear infinite;
}

/* Preview modal */
.preview-container{ max-height:70vh; overflow:auto; }
.preview-image{ max-width:100%; max-height:60vh; border-radius: var(--radius-1); }
.preview-pdf{
  width:100%; height:500px;
  border:1px solid var(--line-strong);
  border-radius: var(--radius-1);
}
.preview-text{
  text-align:left;
  background: var(--surface-2);
  padding:1rem;
  border-radius: var(--radius-1);
  max-height:60vh;
  overflow:auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Extras — dark */
.theme-dark .media-item,
.theme-dark .dropzone,
.theme-dark .file-row,
.theme-dark .preview-text,
html.theme-dark .media-item,
html.theme-dark .dropzone,
html.theme-dark .file-row,
html.theme-dark .preview-text{
  background: var(--surface-2);
  border-color: var(--line-strong);
}
.theme-dark .file-row:hover,
html.theme-dark .file-row:hover{
  background: var(--primary-light);
  border-color: var(--line-brand);
}
.theme-dark .dropzone:hover,
.theme-dark .dropzone.drag,
html.theme-dark .dropzone:hover,
html.theme-dark .dropzone.drag{
  background: var(--primary-light);
  border-color: var(--primary-color);
}
.theme-dark .media-item .icon,
html.theme-dark .media-item .icon{
  background: var(--surface);
  border-color: var(--line-strong);
}
.theme-dark .sm.card,
html.theme-dark .sm.card{
  background: var(--surface);
  border-color: var(--line-strong);
}
.theme-dark .sm .card-header,
html.theme-dark .sm .card-header{
  background: var(--surface);
  border-bottom-color: var(--line-strong);
}
.theme-dark .dim,
html.theme-dark .dim{ background: rgba(0,0,0,.35); }
