/* JOHN IKPON WORLDWIDE design system.
   Brand colours: Blue, White, Red. Black is NOT a brand colour - body text
   uses a deep navy for readability. Mobile-first: base styles target phones,
   media queries enhance for tablets and desktops. */
:root {
  --ji-blue: #1446a0;
  --ji-blue-bright: #1f5fd1;
  --ji-blue-light: #e8f0fc;
  --ji-red: #c8102e;
  --ji-red-dark: #a30d25;
  --ji-red-light: #fdecee;
  --ji-white: #ffffff;
  --ji-text: #13284d;        /* deep navy, not black */
  --ji-text-muted: #4a5d7e;
  --ji-border: #d5deec;
  --ji-surface: #f6f8fc;
  --ji-success: #13795b;
  --ji-warning: #8a5a00;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 12px;
  --radius-small: 8px;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --shadow: 0 2px 10px rgba(20, 70, 160, 0.08);
  --focus: 0 0 0 3px #ffffff, 0 0 0 6px var(--ji-blue-bright);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ji-text);
  background: var(--ji-white);
}
img { max-width: 100%; height: auto; }
a { color: var(--ji-blue); }
a:hover { color: var(--ji-red); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
h1, h2, h3 { line-height: 1.25; color: var(--ji-blue); }
h1 { font-size: 1.75rem; margin: var(--space-4) 0 var(--space-3); }
h2 { font-size: 1.3rem; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--space-3); }
.muted { color: var(--ji-text-muted); font-size: 0.9rem; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ji-blue); color: var(--ji-white); padding: var(--space-2) var(--space-3); z-index: 100;
}
.skip-link:focus { left: var(--space-2); top: var(--space-2); }

/* Header */
.site-header { border-bottom: 3px solid var(--ji-red); background: var(--ji-white); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); min-height: 64px; flex-wrap: wrap; padding-top: var(--space-2); padding-bottom: var(--space-2); }
.brand { display: flex; align-items: center; gap: var(--space-2); text-decoration: none; flex-shrink: 0; }
.brand img, .hero-logo { border-radius: 50%; } /* circular logo - mask the square JPG edge */
.brand-text { white-space: nowrap; font-weight: 800; font-size: 1.1rem; letter-spacing: 0.02em; line-height: 1.1; }
.brand-text small { display: block; font-size: 0.65rem; letter-spacing: 0.3em; color: var(--ji-blue); font-weight: 700; }
.brand-blue { color: var(--ji-blue); }
.brand-red { color: var(--ji-red); }

.nav-desktop { display: none; }
.nav-mobile > summary {
  list-style: none; cursor: pointer; padding: var(--space-2) var(--space-3);
  border: 2px solid var(--ji-blue); border-radius: var(--radius-small); color: var(--ji-blue); font-weight: 700;
  min-height: 44px; display: flex; align-items: center;
}
.nav-mobile > summary::-webkit-details-marker { display: none; }
.site-header { position: relative; }
.nav-mobile[open] > nav {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 50;
  background: var(--ji-white); border-bottom: 3px solid var(--ji-blue); padding: var(--space-3); box-shadow: var(--shadow);
}
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-mobile .nav-list a:not(.btn) { display: block; padding: var(--space-2) 0; min-height: 44px; font-weight: 600; text-decoration: none; }
.nav-account { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.nav-list a[aria-current="page"] { color: var(--ji-red); }

@media (min-width: 1200px) {
  .nav-mobile { display: none; }
  /* Wraps instead of overflowing: label lengths vary a lot between languages. */
  .nav-desktop { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2) var(--space-3); flex: 1 1 0; min-width: 0; }
  .nav-desktop .nav-list { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-1) 0.85rem; }
  .nav-desktop .nav-list a { white-space: nowrap; }
  .nav-desktop .nav-list a:not(.btn) { text-decoration: none; font-weight: 600; font-size: 0.95rem; }
  .nav-desktop .nav-account { margin-top: 0; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-small); border: 2px solid transparent;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; text-align: center;
}
.btn-blue { background: var(--ji-blue); color: var(--ji-white); }
.btn-blue:hover { background: var(--ji-blue-bright); color: var(--ji-white); }
.btn-red { background: var(--ji-red); color: var(--ji-white); }
.btn-red:hover { background: var(--ji-red-dark); color: var(--ji-white); }
.btn-outline { background: var(--ji-white); color: var(--ji-blue); border-color: var(--ji-blue); }
.btn-outline:hover { background: var(--ji-blue-light); color: var(--ji-blue); }
.btn-large { min-height: 52px; font-size: 1.05rem; width: 100%; }
.btn-small { min-height: 36px; padding: var(--space-1) var(--space-3); font-size: 0.9rem; }
.btn-row { display: flex; flex-direction: column; gap: var(--space-2); }

/* Cards */
.card { background: var(--ji-white); border: 1px solid var(--ji-border); border-radius: var(--radius); padding: var(--space-4); box-shadow: var(--shadow); }

/* Home */
.hero { text-align: center; padding: var(--space-4) 0 var(--space-3); }
.hero-logo { width: 120px; height: 120px; }
.hero h1 { font-size: 1.9rem; }
.lead { font-size: 1.1rem; color: var(--ji-text-muted); max-width: 46rem; margin: 0 auto; }
.paths { display: grid; gap: var(--space-3); margin: var(--space-4) 0; }
.path-card { border-top: 6px solid var(--ji-blue); }
.path-hire { border-top-color: var(--ji-red); }
.path-hire h2 { color: var(--ji-red); }
.more { margin: var(--space-5) 0; }
.tile-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.tile {
  display: flex; align-items: center; justify-content: center; text-align: center; min-height: 72px;
  padding: var(--space-3); background: var(--ji-blue-light); border-radius: var(--radius);
  font-weight: 700; text-decoration: none; overflow-wrap: anywhere; hyphens: auto;
}
.tile:hover { background: var(--ji-red-light); }

@media (max-width: 359px) {
  .brand img { width: 40px; height: 40px; }
  .brand-text { font-size: 0.95rem; }
  .nav-mobile > summary { padding: var(--space-2); }
}

@media (min-width: 700px) {
  h1 { font-size: 2.2rem; }
  .hero h1 { font-size: 2.5rem; }
  .hero-logo { width: 160px; height: 160px; }
  .paths { grid-template-columns: 1fr 1fr; }
  .btn-large { width: auto; }
  .btn-row { flex-direction: row; flex-wrap: wrap; }
  .tile-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Generic pages */
.page { padding: var(--space-4) 0 var(--space-5); }
.notice { background: var(--ji-blue-light); border-left: 5px solid var(--ji-blue); padding: var(--space-3); border-radius: var(--radius-small); }
.error-page h1 { color: var(--ji-red); }

/* Forms */
label { font-weight: 600; }
input, select, textarea {
  font: inherit; color: var(--ji-text); background: var(--ji-white);
  border: 2px solid var(--ji-border); border-radius: var(--radius-small); padding: var(--space-2); min-height: 44px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--ji-blue); }

/* Footer */
.site-footer { margin-top: var(--space-5); background: var(--ji-blue); color: var(--ji-white); padding: var(--space-4) 0; border-top: 4px solid var(--ji-red); }
.site-footer a { color: var(--ji-white); }
.site-footer a:hover { color: var(--ji-red-light); }
.lang-form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.lang-form label { color: var(--ji-white); }
.footer-links { list-style: none; padding: 0; margin: 0 0 var(--space-3); display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.copyright { font-size: 0.85rem; margin: 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Account forms */
.auth-page { display: flex; justify-content: center; padding: var(--space-4) 0 var(--space-5); }
.auth-card { width: 100%; max-width: 480px; }
.auth-card h1 { margin-top: 0; font-size: 1.6rem; }
.auth-card form { display: flex; flex-direction: column; gap: var(--space-3); }
.field { display: flex; flex-direction: column; gap: var(--space-1); margin: 0; }
fieldset.field { border: 0; padding: 0; }
fieldset.field legend { font-weight: 600; margin-bottom: var(--space-1); }
.field input[type="text"], .field input[type="email"], .field input[type="password"] { width: 100%; }
.field-hint { margin: 0; font-size: 0.875rem; color: var(--ji-text-muted); }
.field-error { margin: 0; font-size: 0.9rem; font-weight: 600; color: var(--ji-red-dark); }
.field-invalid input { border-color: var(--ji-red); }
.choice { display: flex; align-items: flex-start; gap: var(--space-2); font-weight: 400; padding: var(--space-1) 0; cursor: pointer; }
.choice input { min-height: auto; width: 22px; height: 22px; margin-top: 2px; flex-shrink: 0; accent-color: var(--ji-blue); }
.auth-links { margin: var(--space-3) 0 0; line-height: 2; }
.alert { padding: var(--space-3); border-radius: var(--radius-small); border-left: 5px solid; margin: 0 0 var(--space-3); }
.alert-error { background: var(--ji-red-light); border-color: var(--ji-red); color: var(--ji-red-dark); font-weight: 600; }
.alert-info { background: var(--ji-blue-light); border-color: var(--ji-blue); }
.alert-success { background: #e7f6ef; border-color: var(--ji-success); color: var(--ji-success); font-weight: 600; }
.inline-form { display: inline; margin: 0; }
.account-page .card { margin-bottom: var(--space-3); }
.account-page form { display: flex; flex-direction: column; gap: var(--space-3); max-width: 420px; }
.details { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-1) var(--space-3); margin: 0; }
.details dt { font-weight: 600; }
.details dd { margin: 0; overflow-wrap: anywhere; }

/* Owner / Admin dashboards */
.staff-page h2 { margin-top: var(--space-4); }
.staff-header h1 { margin-top: var(--space-2); }
.breadcrumb { margin: var(--space-3) 0 0; font-size: 0.95rem; }
.stat-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.stat { background: var(--ji-blue-light); border-radius: var(--radius); padding: var(--space-3); display: flex; flex-direction: column; }
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--ji-blue); line-height: 1.1; }
.stat-label { font-size: 0.9rem; color: var(--ji-text-muted); }
.section-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-3); }
.section-card { display: flex; flex-direction: column; gap: var(--space-1); text-decoration: none; height: 100%; border-left: 5px solid var(--ji-red); }
.section-card:hover { border-color: var(--ji-blue); }
.section-title { font-weight: 800; font-size: 1.1rem; color: var(--ji-blue); }
.section-desc { color: var(--ji-text-muted); }
.staff-page .card { margin-bottom: var(--space-3); }
.staff-form { display: flex; flex-direction: column; gap: var(--space-3); align-items: flex-start; }
.staff-form .field { width: 100%; max-width: 420px; }
.staff-form > .table-wrap { width: 100%; max-width: 100%; }
.staff-form-row .field { max-width: 420px; }
.perm-grid { display: grid; grid-template-columns: 1fr; gap: 0 var(--space-3); border: 0; padding: 0; max-width: none !important; }
.filter-bar { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: flex-end; margin: 0 0 var(--space-3); }
.filter-bar .field { min-width: 0; flex: 1 1 180px; }
.filter-bar input[type="search"] { flex: 1 1 220px; min-width: 0; }
.filter-bar .field input[type="search"] { flex: none; } /* inside a labelled field the search box keeps its normal height */
.row-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--ji-border); }
.row-item { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; padding: var(--space-3) 0; border-bottom: 1px solid var(--ji-border); overflow-wrap: anywhere; }
.row-item > div { min-width: 0; flex: 1 1 220px; }
.badge { display: inline-block; font-size: 0.78rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--ji-blue-light); color: var(--ji-blue); vertical-align: middle; }
.badge-active { background: #e7f6ef; color: var(--ji-success); }
.badge-suspended, .badge-deleted { background: var(--ji-red-light); color: var(--ji-red-dark); }
.badge-pending { background: #fff4dc; color: var(--ji-warning); }
.badge-off { background: var(--ji-surface); color: var(--ji-text-muted); }
.btn-danger { color: var(--ji-red-dark); border-color: var(--ji-red); }
.btn-danger:hover { background: var(--ji-red-light); color: var(--ji-red-dark); }
.admin-card form + form { margin-top: var(--space-3); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); margin: var(--space-3) 0; }
.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--ji-border); border-radius: var(--radius-small); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.data-table th, .data-table td { text-align: left; padding: var(--space-2); border-bottom: 1px solid var(--ji-border); vertical-align: top; }
.data-table th { background: var(--ji-blue-light); color: var(--ji-blue); white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (min-width: 700px) {
  .stat-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .section-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .perm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) { .section-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Jobs and Worker dashboard */
.lead-left { font-size: 1.05rem; color: var(--ji-text-muted); }
.pre-line { white-space: pre-line; overflow-wrap: anywhere; }
.sub-nav { margin: 0 0 var(--space-4); overflow-x: auto; border-bottom: 2px solid var(--ji-border); }
.sub-nav ul { list-style: none; display: flex; gap: var(--space-1); margin: 0; padding: 0; }
.sub-nav a { display: block; white-space: nowrap; padding: var(--space-2) var(--space-3); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; min-height: 44px; }
.sub-nav a[aria-current="page"] { color: var(--ji-red); border-bottom-color: var(--ji-red); }
.search-form { display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: var(--space-3); }
.search-form input[type="search"], .location-grid select, .location-grid input, .profile-form textarea, .profile-form input[type="text"] { width: 100%; }
.location-fields { border: 0; padding: 0; margin: 0; }
.location-fields legend { font-weight: 600; margin-bottom: var(--space-1); }
.location-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-2) var(--space-3); }
.job-list { display: grid; gap: var(--space-3); }
.job-card h3 { margin: 0 0 var(--space-1); font-size: 1.15rem; }
.job-card h3 a { text-decoration: none; }
.job-card p { margin: 0 0 var(--space-1); }
.job-meta { color: var(--ji-text-muted); font-size: 0.95rem; }
.job-place { font-weight: 600; }
.job-pay { color: var(--ji-red-dark); font-weight: 700; }
.job-page .card { margin-bottom: var(--space-3); }
.job-page h1 { margin-top: 0; }
.job-actions { display: flex; flex-direction: column; gap: var(--space-3); align-items: flex-start; }
.job-actions .staff-form, .job-actions textarea { width: 100%; }
.profile-form { display: flex; flex-direction: column; gap: var(--space-3); }
.occupation-group { border: 1px solid var(--ji-border); border-radius: var(--radius-small); padding: var(--space-2) var(--space-3); margin-bottom: var(--space-2); }
.occupation-group summary { cursor: pointer; font-weight: 700; color: var(--ji-blue); min-height: 32px; }
.row-item.unread { background: var(--ji-blue-light); padding-left: var(--space-2); padding-right: var(--space-2); }
.badge-app-hired, .badge-app-shortlisted { background: #e7f6ef; color: var(--ji-success); }
.badge-app-rejected, .badge-app-withdrawn { background: var(--ji-surface); color: var(--ji-text-muted); }
textarea { font: inherit; color: var(--ji-text); border: 2px solid var(--ji-border); border-radius: var(--radius-small); padding: var(--space-2); }
@media (min-width: 700px) {
  .location-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .job-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .location-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .search-form > .location-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.badge-req-accepted, .badge-req-completed { background: #e7f6ef; color: var(--ji-success); }
.badge-req-declined, .badge-req-cancelled { background: var(--ji-surface); color: var(--ji-text-muted); }

/* Header language selector (one platform, any language) */
.lang-switch { display: flex; align-items: center; gap: var(--space-1); margin-left: auto; }
.lang-switch select { min-height: 40px; padding: 0 var(--space-2); font-weight: 600; color: var(--ji-blue); border-color: var(--ji-blue-light); max-width: 9.5rem; }
.lang-icon { font-size: 1.1rem; }
[dir="rtl"] .lang-switch { margin-left: 0; margin-right: auto; }
@media (min-width: 1200px) { .lang-switch { order: 3; margin-left: 0; } }

/* Employer dashboard */
.btn-row-inline { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.application-list { display: grid; gap: var(--space-3); }
.application-card h3 { margin: 0 0 var(--space-1); }
.application-card .details { margin: var(--space-2) 0 var(--space-3); }
.badge-job-published { background: #e7f6ef; color: var(--ji-success); }
.badge-job-paused, .badge-job-draft, .badge-job-pending_review { background: #fff4dc; color: var(--ji-warning); }
.badge-job-closed, .badge-job-rejected, .badge-job-hidden { background: var(--ji-surface); color: var(--ji-text-muted); }
@media (min-width: 1000px) { .sub-nav { overflow-x: visible; } .sub-nav ul { flex-wrap: wrap; } }

/* Location management */
.place-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.rename-form { display: flex; gap: var(--space-1); align-items: center; }
.rename-form input { min-height: 36px; padding: 0 var(--space-2); width: 12rem; max-width: 100%; }
.breadcrumb [aria-current="page"] { font-weight: 700; }

/* ---------- Post a job (Phase 8) ---------- */
.steps { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2); padding: 0; margin: 0 0 var(--space-3); counter-reset: step; }
.step { counter-increment: step; font-size: 0.9rem; padding: var(--space-1) var(--space-2); border: 1px solid var(--ji-border); border-radius: 999px; color: var(--ji-text-muted); background: var(--ji-white); }
.step::before { content: counter(step) ". "; }
.step-done { border-color: var(--ji-blue); color: var(--ji-blue); }
.step-current { background: var(--ji-blue); border-color: var(--ji-blue); color: var(--ji-white); font-weight: 600; }
.step a { color: inherit; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); gap: 0 var(--space-3); }
.moderation-item { margin-bottom: var(--space-3); }
.moderation-item details { margin: var(--space-2) 0; }
.report-job { margin-top: var(--space-3); }
.report-job > summary { cursor: pointer; color: var(--ji-red-dark); font-weight: 600; }
.safety-note { margin-top: var(--space-3); }
/* Narrow screens: label above value so long answers never break mid-word. */
@media (max-width: 600px) {
  .details { grid-template-columns: 1fr; gap: 0; }
  .details dd { margin-bottom: var(--space-2); }
}

/* ---------- Search (Phase 9) ---------- */
.more-filters > summary { cursor: pointer; font-weight: 600; color: var(--ji-blue); padding: var(--space-1) 0; }
.more-filters[open] > summary { margin-bottom: var(--space-2); }
.search-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2) var(--space-3); }
.search-actions .field { margin: 0; min-width: min(100%, 14rem); }
.save-search { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.save-search input { flex: 1 1 12rem; min-width: 0; }

/* ---------- Recommendations (Phase 11): never styled like paid placements ---------- */
.badge-recommended { background: var(--ji-blue); color: var(--ji-white); }
.recommendation-card { border-color: var(--ji-blue); }
.recommend-why { font-size: 0.92rem; color: var(--ji-text-muted); }
.recommended-block { margin: var(--space-3) 0 var(--space-4); padding: var(--space-3); border-radius: var(--radius); background: var(--ji-blue-light); }
.recommended-block h2 { margin-top: 0; }

/* ---------- Verification (Phase 12) ---------- */
a.badge { text-decoration: none; }
.badge-verif-approved { background: #e7f6ef; color: var(--ji-success); }
.badge-verif-pending { background: #fff4dc; color: var(--ji-warning); }
.badge-verif-rejected, .badge-verif-revoked, .badge-verif-expired { background: var(--ji-surface); color: var(--ji-text-muted); }
input[type="file"] { max-width: 100%; }

/* ---------- Advertisements (Phase 13) ---------- */
.ad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); gap: var(--space-3); }
.ad-tile { display: flex; flex-direction: column; gap: var(--space-2); text-decoration: none; color: var(--ji-text); }
.ad-tile img, .ad-previews img, .public-ad-image, .ad-mod img { width: 100%; height: auto; border-radius: var(--radius-small); border: 1px solid var(--ji-border); background: var(--ji-white); }
.ad-previews { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: var(--space-3); align-items: start; margin: var(--space-3) 0; }
.ad-previews figure { margin: 0; }
.ad-previews figcaption { text-align: center; color: var(--ji-text-muted); font-size: 0.9rem; margin-top: var(--space-1); }
.public-ad { max-width: 36rem; margin-inline: auto; text-align: center; }
.ad-mod { display: grid; grid-template-columns: minmax(0, 14rem) 1fr; gap: var(--space-3); }
@media (max-width: 600px) { .ad-mod { grid-template-columns: 1fr; } }
.badge-ad-approved { background: #e7f6ef; color: var(--ji-success); }
.badge-ad-draft, .badge-ad-pending_review { background: #fff4dc; color: var(--ji-warning); }
.badge-ad-rejected, .badge-ad-archived { background: var(--ji-surface); color: var(--ji-text-muted); }

/* ---------- Promotion (Phase 14): sponsored looks different from recommended ---------- */
.sponsored-block { margin: var(--space-3) 0 var(--space-4); padding: var(--space-3); border-radius: var(--radius); border: 2px dashed var(--ji-red); background: var(--ji-red-light); }
.sponsored-block h2 { margin-top: 0; color: var(--ji-red-dark); }
.sponsored-card img { width: 100%; height: auto; border-radius: var(--radius-small); }
.badge-sponsored { background: var(--ji-red); color: var(--ji-white); }
.badge-promo-active { background: #e7f6ef; color: var(--ji-success); }
.badge-promo-pending_payment { background: #fff4dc; color: var(--ji-warning); }
.badge-promo-expired, .badge-promo-cancelled, .badge-campaign-cancelled { background: var(--ji-surface); color: var(--ji-text-muted); }
.badge-campaign-draft, .badge-campaign-scheduled { background: #fff4dc; color: var(--ji-warning); }
.product-card, .campaign-card { margin-bottom: var(--space-3); }

/* Payments */
.badge-pay-successful, .badge-pay-active { background: #e7f6ef; color: var(--ji-success); }
.badge-pay-pending, .badge-pay-partially_refunded, .badge-pay-past_due { background: #fff4dc; color: var(--ji-warning); }
.badge-pay-failed { background: #fdecec; color: var(--ji-red); }
.badge-pay-refunded, .badge-pay-cancelled, .badge-pay-expired { background: var(--ji-surface); color: var(--ji-text-muted); }
.receipt-card { max-width: 40rem; }
.receipt-brand { color: var(--ji-blue); font-weight: 700; letter-spacing: 0.04em; margin: 0; }
.receipt-list { display: grid; grid-template-columns: minmax(8rem, auto) 1fr; gap: var(--space-2) var(--space-3); margin: var(--space-3) 0; }
.receipt-list dt { color: var(--ji-text-muted); }
.receipt-list dd { margin: 0; overflow-wrap: anywhere; }
@media print {
  .site-header, .site-footer, .no-print, .skip-link { display: none !important; }
  .receipt-card { box-shadow: none; border: 1px solid #ccc; }
}
.nowrap { white-space: nowrap; }

/* Finance */
.finance-filter { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); align-items: flex-end; }
.finance-filter .field { margin: 0; min-width: min(100%, 11rem); }
.finance-totals { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: var(--space-3); }
.finance-totals .card { margin: 0; }
.finance-currency { font-weight: 700; color: var(--ji-red); margin: 0; letter-spacing: 0.05em; }
.finance-bar { width: 100%; min-width: 6rem; height: 0.6rem; }

/* Messages */
.thread { list-style: none; padding: 0; margin: var(--space-3) 0; display: flex; flex-direction: column; gap: var(--space-2); }
.msg { max-width: min(85%, 40rem); padding: var(--space-2) var(--space-3); border-radius: var(--radius); background: var(--ji-surface); }
.msg-mine { align-self: flex-end; background: var(--ji-blue-light); }
.msg-theirs { align-self: flex-start; }
.msg-meta { margin: 0; font-size: 0.85rem; color: var(--ji-text-muted); }
.msg-body { margin: var(--space-1) 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-report { margin-top: var(--space-1); font-size: 0.9rem; }
.msg-report summary { cursor: pointer; color: var(--ji-text-muted); }
.message-form textarea { width: 100%; }
.message-snippet { color: var(--ji-text-muted); overflow-wrap: anywhere; }
.row-item.unread strong { color: var(--ji-red); }
.badge-unread { background: var(--ji-red); color: #fff; }
.reported-message { margin: var(--space-2) 0; padding: var(--space-2) var(--space-3); border-left: 4px solid var(--ji-red); background: var(--ji-surface); }

/* Worker Register */
.register-filter { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); align-items: flex-end; }
.register-filter .field { margin: 0; min-width: min(100%, 10rem); }
.wrap-anywhere { overflow-wrap: anywhere; }
.badge-verified { background: #e7f6ef; color: var(--ji-success); }

/* Languages */
.language-list { list-style: none; padding: 0; columns: 16rem auto; column-gap: var(--space-4); }
.language-list li { break-inside: avoid; padding: var(--space-1) 0; }
.language-list a[aria-current] { font-weight: 700; color: var(--ji-red); }
.language-editor .field label { font-weight: 400; overflow-wrap: anywhere; }
.language-editor textarea { width: 100%; }
.lang-partial { margin-top: var(--space-3); }

/* Installable app */
.site-footer .install-app { background: #fff; color: var(--ji-blue); border-color: #fff; }
.offline-page { text-align: center; padding-top: var(--space-5); }

/* Official documents: letter and signatory block */
.letter { max-width: 46rem; }
.letter-head { display: flex; align-items: center; gap: var(--space-3); border-bottom: 3px solid var(--ji-red); padding-bottom: var(--space-3); margin-bottom: var(--space-4); }
.letter-head .receipt-brand { font-size: 1.3rem; }
.letter-date { text-align: right; }
.letter-body p { margin: 0 0 var(--space-3); overflow-wrap: anywhere; }
.letter-sign { margin-top: var(--space-5); }
.doc-signatory { margin: var(--space-4) 0 0; }
@media print { .letter { box-shadow: none; border: 0; } }
.doc-settings { list-style: none; margin: 0; padding: 0; width: 100%; border: 1px solid var(--ji-border); border-radius: var(--radius-small); }
.doc-settings li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); padding: var(--space-3); }
.doc-settings li + li { border-top: 1px solid var(--ji-border); }
.doc-settings-name { flex: 1 1 12rem; }
.doc-settings-role { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.doc-settings-role select { width: auto; max-width: 100%; }
.check-inline { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 600; }
.check-inline input { width: auto; margin: 0; }
.founder-photo { display: block; width: 100%; max-width: 15rem; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--radius-small); border: 3px solid var(--ji-blue); margin-bottom: var(--space-3); }
.founder-photo-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: flex-end; }
.founder-photo-actions > form.staff-form { flex: 1 1 16rem; min-width: 0; }
.founder-photo-actions input[type="file"] { max-width: 100%; }

/* Employment & work contracts */
.alert-warning { background: #fff4dc; border-color: var(--ji-warning); color: #6b4a00; }
.contract-filter select { width: auto; min-width: 0; max-width: 100%; }
.contract-steps { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2); padding: 0; margin: 0 0 var(--space-3); counter-reset: step; }
.contract-steps li { counter-increment: step; padding: 4px 12px; border-radius: 999px; background: var(--ji-surface); color: var(--ji-text-muted); font-size: 0.9rem; }
.contract-steps li::before { content: counter(step) ". "; }
.contract-steps li.done { background: #e7f6ef; color: var(--ji-success); }
.contract-steps li.current { background: var(--ji-blue); color: #fff; font-weight: 700; }
.contract-in_review, .contract-sent, .contract-worker_signed { background: #fff4dc; color: var(--ji-warning); }
.contract-approved, .contract-completed { background: #e7f6ef; color: var(--ji-success); }
.contract-declined, .contract-cancelled { background: var(--ji-red-light); color: var(--ji-red-dark); }
.contract-actions > * { margin: 0 var(--space-2) var(--space-2) 0; }
.contract-actions .staff-form { margin-top: var(--space-2); }
.contract-text h2 { color: var(--ji-blue); font-size: 1.25rem; }
.contract-text h3 { font-size: 1.02rem; margin: var(--space-4) 0 var(--space-2); }
.contract-text p { margin: 0 0 var(--space-2); overflow-wrap: anywhere; white-space: pre-line; }
.contract-signatures { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: var(--space-3); margin-top: var(--space-4); }
.contract-signatures li { border-top: 2px solid var(--ji-blue); padding-top: var(--space-2); }
.fingerprint { font-size: 0.82rem; overflow-wrap: anywhere; }
.contract-form fieldset { min-width: 0; }
.contract-form legend { font-weight: 700; color: var(--ji-blue); padding: 0 var(--space-1); }
.authority-list { list-style: none; padding: 0; margin: 0; }
.authority-item { border-top: 1px solid var(--ji-border, #dde3ee); padding: var(--space-3) 0; min-width: 0; }
.authority-item .badge { margin-right: 4px; }
.perm-grid { list-style: none; padding: 0; margin: 0 0 var(--space-2); display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: var(--space-1) var(--space-3); }
.perm-grid .check-inline { font-weight: 400; }
.authority-item fieldset { border: 0; padding: 0; margin: var(--space-2) 0 0; min-width: 0; }
.contract-form fieldset.card { display: block; width: 100%; box-sizing: border-box; align-self: stretch; }

/* Legal & Contract Management */
.tag-list { list-style: none; padding: 0; margin: 0 0 var(--space-3); display: flex; flex-wrap: wrap; gap: var(--space-2); }
.tag-list li { background: var(--ji-surface); border-radius: var(--radius-small); padding: 4px 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; overflow-wrap: anywhere; }
.legal-line { border-left: 4px solid var(--ji-blue); padding-left: var(--space-2); margin: var(--space-2) 0; }
.legal-notes { list-style: none; padding: 0; margin: 0 0 var(--space-3); }
.legal-notes li { border-top: 1px solid var(--ji-border); padding: var(--space-2) 0; }
.legal-notes li p { margin: 0 0 4px; overflow-wrap: anywhere; white-space: pre-line; }
.legal-panel h3 { margin-top: var(--space-4); }
.lawyer-active, .stage-completed, .stage-legally_reviewed, .stage-signed { background: #e7f6ef; color: var(--ji-success); }
.lawyer-pending, .stage-legal_review, .stage-in_review, .stage-ready_for_signature { background: #fff4dc; color: var(--ji-warning); }
.lawyer-suspended, .lawyer-revoked, .stage-changes_required, .stage-declined, .stage-cancelled { background: var(--ji-red-light); color: var(--ji-red-dark); }
.country-limit { margin-top: var(--space-2); }
.country-limit input { max-width: 20rem; }

/* Security & Technical teams */
.sev-high, .sev-critical { background: var(--ji-red-light); color: var(--ji-red-dark); }
.sev-medium { background: #fff4dc; color: var(--ji-warning); }
.sev-low { background: var(--ji-blue-light); color: var(--ji-blue); }
.sev-ok { background: #e7f6ef; color: var(--ji-success); }
.big { font-size: 1.6rem; color: var(--ji-blue); }
.team-links { flex-wrap: wrap; }
.team-add { border-top: 1px solid var(--ji-border); margin-top: var(--space-3); padding-top: var(--space-3); }
.maintenance-card { max-width: 36rem; margin: var(--space-5) auto; text-align: center; border-top: 5px solid var(--ji-blue); }

/* Marketing Department */
.activity-table tr.by-marketing td { background: var(--ji-blue-light); }
.marketing-cards .card { min-width: 0; }

/* Departments connected to the Owner Dashboard */
.dept-grid { list-style: none; padding: 0; margin: 0 0 var(--space-3); display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }
.dept-tile a { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3); border: 1px solid var(--ji-border, #d8deea); border-top: 4px solid var(--ji-blue); border-radius: 10px; background: var(--ji-white, #fff); color: inherit; text-decoration: none; min-width: 0; }
.dept-tile.dept-alert a { border-top-color: var(--ji-red); }
.dept-bad { color: var(--ji-red-dark); font-weight: 700; }
.dept-ok { color: var(--ji-success); font-weight: 600; }
.dept-card { border-top: 4px solid var(--ji-blue); scroll-margin-top: var(--space-4); }
.dept-card h3 { margin-top: var(--space-4); }
.row-item.dept-alert { border-left: 4px solid var(--ji-red); padding-left: var(--space-2); }
.dept-recent { padding-left: 1.1rem; overflow-wrap: anywhere; }
.dept-jump { margin-bottom: var(--space-3); }
.dept-card .badge { margin-left: var(--space-1, 4px); }

/* Department performance: green = good / very good, yellow = average, red = very bad */
.rating { display: inline-block; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.03em; padding: 2px 10px; border-radius: 999px; vertical-align: middle; width: fit-content; }
.rating-very_good { background: #13703d; color: #fff; }
.rating-good { background: #d9f2e3; color: #0f5e33; border: 1px solid #13703d; }
.rating-average { background: #ffd23f; color: #3d2f00; }
.rating-very_bad { background: var(--ji-red); color: #fff; }
.dept-tile.tile-very_good a, .dept-tile.tile-good a, .dept-card.tile-very_good, .dept-card.tile-good { border-top-color: #13703d; }
.dept-tile.tile-average a, .dept-card.tile-average { border-top-color: #e0b100; background: #fffbea; }
.dept-tile.tile-very_bad a, .dept-card.tile-very_bad { border-top-color: var(--ji-red); background: var(--ji-red-light); }
.dept-card.tile-average, .dept-card.tile-very_bad { background: var(--ji-white); }
.solution-list { list-style: none; padding: 0; margin: 0 0 var(--space-3); display: grid; gap: var(--space-2); }
.solution { border: 1px solid var(--ji-border); border-left: 5px solid #e0b100; border-radius: var(--radius-small); padding: var(--space-3); background: var(--ji-white); overflow-wrap: anywhere; }
.solution-serious { border-left-color: var(--ji-red); }
.solution p { margin: 0 0 var(--space-2); }
.solution .badge { margin-left: var(--space-1); }
.solution-fix { color: var(--ji-blue); }
.solution-group h3 { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }

/* Authority structure: what each person can and cannot do */
.authority-panel { border-top: 4px solid var(--ji-blue); margin-top: var(--space-4); }
.authority-cols { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.authority-cols ul { padding-left: 1.2rem; margin: 0; overflow-wrap: anywhere; }
.authority-cols li { margin-bottom: var(--space-1); }
.authority-can { color: #13703d; }
.authority-cannot { color: var(--ji-red-dark); }
.authority-structure { border-top: 4px solid var(--ji-red); }
.authority-ladder { padding-left: 1.4rem; margin: 0; display: grid; gap: var(--space-2); overflow-wrap: anywhere; }
.dept-managers { margin: 0 0 var(--space-2); }
.report-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.report-card { overflow-wrap: anywhere; }
.report-card h3 { margin: var(--space-1) 0; }
.report-unread { border-left: 5px solid var(--ji-red); }
.report-body, .legal-message p:last-child { white-space: pre-wrap; }
.report-reply { background: var(--ji-blue-light); padding: var(--space-2); border-radius: var(--radius-small); }
.legal-messages { list-style: none; padding: 0; margin: 0 0 var(--space-3); display: grid; gap: var(--space-2); }
.legal-message { padding: var(--space-2) var(--space-3); border-radius: var(--radius-small); max-width: 46rem; overflow-wrap: anywhere; }
.legal-message p { margin: 0; }
.legal-message.from-owner { background: var(--ji-blue-light); border-left: 4px solid var(--ji-blue); }
.legal-message.from-lawyer { background: var(--ji-surface); border-left: 4px solid var(--ji-red); margin-left: auto; }

/* Finance Department: money in (green) and money out (red), per currency */
.money-cards { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); margin-bottom: var(--space-3); }
.money-card { border-top: 4px solid var(--ji-blue); min-width: 0; }
.money-card p { margin: 0 0 var(--space-1); overflow-wrap: anywhere; }
.money-in { color: #13703d; }
.money-out { color: var(--ji-red-dark); }
.money-net { color: var(--ji-blue); }
.money-badge-in { background: #e7f6ef; color: #13703d; }
.money-badge-out { background: var(--ji-red-light); color: var(--ji-red-dark); }
.ledger-in { border-left: 4px solid #13703d; padding-left: var(--space-2); }
.ledger-out { border-left: 4px solid var(--ji-red); padding-left: var(--space-2); }
.money-summary { border-top: 4px solid #13703d; }
.money-lines { padding-left: 1.2rem; overflow-wrap: anywhere; }
.payout-badge-awaiting_approval { background: #fff4dc; color: var(--ji-warning); }
.payout-badge-approved { background: var(--ji-blue-light); color: var(--ji-blue); }
.payout-badge-paid { background: #e7f6ef; color: #13703d; }
.payout-badge-cancelled { background: var(--ji-surface); color: var(--ji-text-muted); }
.payout-paid-form { flex: 1 1 100%; display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); align-items: end; }
.form-row { display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }

/* Help assistant */
.help-chat { display: grid; gap: var(--space-2); }
.help-bubble { max-width: 46rem; padding: var(--space-2) var(--space-3); border-radius: var(--radius); overflow-wrap: anywhere; }
.help-bubble p { margin: 0 0 var(--space-1); }
.help-bubble.from-assistant { background: var(--ji-blue-light); border-left: 4px solid var(--ji-blue); }
.help-bubble.from-person { background: var(--ji-surface); border-left: 4px solid var(--ji-red); margin-left: auto; }
.help-text { white-space: pre-wrap; }
.help-who { font-size: 0.8rem; }
.help-send { margin-top: var(--space-2); }
.help-suggestions ul { list-style: none; padding: 0; }
.help-suggestions .btn { white-space: normal; text-align: left; }
.support-open, .support-in_progress { background: #fff4dc; color: var(--ji-warning); }
.support-waiting_user { background: var(--ji-blue-light); color: var(--ji-blue); }
.support-resolved { background: #e7f6ef; color: #13703d; }
.support-closed { background: var(--ji-surface); color: var(--ji-text-muted); }
.safety-open { background: var(--ji-red-light); color: var(--ji-red-dark); }
.safety-reviewing { background: #fff4dc; color: var(--ji-warning); }
.safety-reported { background: var(--ji-blue-light); color: var(--ji-blue); }
.safety-closed { background: var(--ji-surface); color: var(--ji-text-muted); }
.safety-evidence { padding-left: 1.4rem; overflow-wrap: anywhere; }
.safety-evidence li { margin-bottom: var(--space-3); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.75rem; overflow-wrap: anywhere; }

/* Worldwide promotion */
.worldwide-card { border-top: 4px solid var(--ji-red); }
.social-queued { background: #fff4dc; color: var(--ji-warning); }
.social-published { background: #e7f6ef; color: #13703d; }
.social-failed { background: var(--ji-red-light); color: var(--ji-red-dark); }
.social-removed { background: var(--ji-surface); color: var(--ji-text-muted); }

/* Owner's direct line */
.direct-line-summary { border-top: 4px solid var(--ji-blue); }
.direct-line-link { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.attacks-high { border-top: 4px solid var(--ji-red); }
.escalate-form { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; margin-top: .5rem; }
.escalate-form input[name=body] { flex: 1 1 260px; min-width: 0; }
.comms-private { border-left: 3px solid var(--ji-blue); padding-left: .6rem; }
.comms-ladder { padding-left: 1.2rem; display: grid; gap: .4rem; }
.comms-honesty { border-left: 3px solid var(--ji-red); padding-left: .6rem; }
.comms-statement-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.comms-files { padding-left: 1.2rem; overflow-wrap: anywhere; }
.comms-about { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; margin: .35rem 0; }
#next .inline-form { margin-top: .75rem; }
.comms-declare { display: block; margin: .75rem 0; }
.comms-similar { border-left: 4px solid var(--ji-red); }
.comms-waiting { border-top: 4px solid var(--ji-red); }
.comms-counts { padding-left: 1.2rem; }
.comms-link { margin: .5rem 0; }
.comms-about, .comms-declare { display: flex; gap: .5rem; align-items: flex-start; flex-wrap: nowrap; }
.comms-about input, .comms-declare input { width: auto; flex: none; margin-top: .3rem; }
.contact-grid { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.contact-card { display: flex; flex-direction: column; margin: 0; }
.contact-card > p:last-child { margin-top: auto; }
.contact-owner { border-top: 4px solid var(--ji-red); }
.contact-role { font-weight: 600; color: var(--ji-blue); margin-top: -.25rem; }
.article-layout { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .article-layout { grid-template-columns: minmax(0, 1fr) 300px; } }
.article-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.article-card { margin: 0; }
.article-card h2 { font-size: 1.15rem; margin: .5rem 0 .25rem; }
.article-cover-thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius, 8px); display: block; }
.article-cover { width: 100%; max-height: 460px; object-fit: cover; border-radius: var(--radius, 8px); margin: 1rem 0; }
.article-body { font-size: 1.05rem; line-height: 1.7; overflow-wrap: anywhere; }
.article-body h2 { margin-top: 1.5rem; }
.article-share { border-top: 1px solid var(--ji-border, #d7deea); padding-top: .75rem; margin-top: 1.5rem; }
.article-aside .sponsored, .article-aside > * { max-width: 100%; }
.pager { display: flex; gap: .5rem; justify-content: space-between; margin-top: 1rem; }
.area-chosen { list-style: none; padding: 0; margin: .5rem 0; display: grid; gap: .4rem; }
.area-chosen li { display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--ji-blue-light); border-radius: 8px; padding: .4rem .75rem; }
.price-total th, .price-total td { border-top: 2px solid var(--ji-blue); }
.input-short { width: 7rem; display: inline-block; }
.price-check-form { margin-top: .5rem; }
.kit-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: .25rem 1rem; overflow-wrap: anywhere; }
@media (min-width: 700px) { .kit-list { grid-template-columns: 200px minmax(0, 1fr); } }
.kit-list dt { font-weight: 600; color: var(--ji-blue); }
.kit-list dd { margin: 0 0 .5rem; }
.company-account h2 { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.flyer-strip { margin: 1.5rem 0; }
.flyer-grid { list-style: none; padding: 0; margin: .5rem 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.flyer-strip-compact .flyer-grid { grid-template-columns: minmax(0, 1fr); }
.flyer-grid-large { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.flyer-card { margin: 0; padding: .75rem; }
.flyer-card h2 { font-size: 1.1rem; }
.flyer-hidden { opacity: .55; }
.flyer-thumb { width: 100%; height: auto; max-height: 420px; object-fit: contain; display: block; border-radius: 8px; background: var(--ji-blue-light); }
.flyer-full { width: 100%; max-width: 900px; height: auto; display: block; margin: 1rem 0; border-radius: 8px; box-shadow: 0 2px 12px rgba(20, 70, 160, .15); }
.flyer-preview { max-width: 240px; height: auto; vertical-align: middle; border-radius: 6px; }
.flyer-text { white-space: pre-wrap; }
.article-flyer-thumb { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; display: block; }
.article-flyer { width: 100%; max-width: 560px; height: auto; display: block; margin: 1rem 0; border-radius: 8px; box-shadow: 0 2px 12px rgba(20, 70, 160, .15); }
.article-flyer-links { font-size: .95rem; }

/* "Translate" next to what people wrote in another language. */
.tr-holder { display: block; margin: 0.15rem 0 0.4rem; }
.tr-btn { background: none; border: 0; padding: 0; color: #1446a0; font: inherit; font-size: 0.85rem; text-decoration: underline; cursor: pointer; }
.tr-btn:disabled { color: #5a6b8c; cursor: progress; }
.tr-out { border-inline-start: 3px solid #1446a0; padding-inline-start: 0.6rem; margin: 0.25rem 0; }
.tr-note { display: block; color: #5a6b8c; font-size: 0.8rem; margin-bottom: 0.15rem; }
span.tr-note { display: inline; margin-inline-start: 0.5rem; }

/* The Owner's customer chats. */
.chat-list .row-item.chat-waiting { border-inline-start: 4px solid #c8102e; }
.chat-last-customer { color: #1446a0; font-weight: 600; }
.owner-notes ul { padding-inline-start: 1.1rem; }

/* Master Machine. */
.master-list { list-style: none; padding: 0; }
.master-item { border-inline-start: 4px solid #1446a0; }
.master-item.master-sev-3 { border-inline-start-color: #c8102e; }
.master-item.master-sev-2 { border-inline-start-color: #e07b00; }
.master-badge-3 { background: #c8102e; color: #fff; }
.master-badge-2 { background: #fff1db; color: #7a4300; }
.master-badge-1 { background: #e8eef9; color: #1446a0; }
.master-diagnosis { border-top: 1px solid #d6deec; margin-top: 1rem; padding-top: 0.5rem; }
.tech-task h2 { font-size: 1.1rem; }

/* "Need help?" on every customer page, and the assistant's buttons. */
.need-help { position: fixed; inset-inline-end: 16px; bottom: 16px; z-index: 50; background: #c8102e; color: #fff; border-radius: 999px; padding: 0.55rem 1rem; font-weight: 700; text-decoration: none; box-shadow: 0 4px 14px rgba(20, 70, 160, 0.25); }
.need-help:hover, .need-help:focus { background: #a50d26; color: #fff; }
.help-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.4rem 0; }
.help-need-role { margin: 0.3rem 0; }
.stat-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; }
.stat-grid .card { display: flex; flex-direction: column; gap: 0.2rem; }
.stat-grid strong { font-size: 1.6rem; color: #1446a0; }
.site-footer { padding-bottom: 4rem; }

/* VOICE CHAT (Owner Dashboard) */
.vc-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
@media (min-width: 900px) { .vc-layout { grid-template-columns: 16rem minmax(0, 1fr); } }
.vc-history h2 { font-size: 1rem; }
.vc-history .row-list a[aria-current="page"] { font-weight: 700; }
.vc-messages { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .75rem; max-height: 60vh; overflow-y: auto; }
.vc-msg { padding: .6rem .8rem; border-radius: .6rem; max-width: 92%; }
.vc-from-owner { align-self: flex-end; background: var(--ji-blue-light); }
.vc-from-bot { align-self: flex-start; background: var(--ji-surface); border-left: 3px solid var(--ji-red); }
.vc-who { font-size: .8rem; font-weight: 700; margin: 0 0 .2rem; }
.vc-body { white-space: pre-line; margin: 0; overflow-wrap: anywhere; }
.vc-links { margin: .4rem 0 0; padding-left: 1.1rem; }
.vc-decide { margin-top: .5rem; }
.vc-decide form { display: inline; }
.vc-form textarea { width: 100%; }
.vc-mic[aria-pressed="true"] { animation: vc-pulse 1s ease-in-out infinite alternate; }
@keyframes vc-pulse { from { opacity: 1; } to { opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .vc-mic[aria-pressed="true"] { animation: none; outline: 3px solid var(--ji-red); } }
.vc-voice { display: inline-flex; align-items: center; gap: .3rem; }

/* CV builder */
.cv-section legend { font-weight: 700; color: var(--ji-blue); padding: 0 .3rem; }
.cv-entry { border-top: 1px solid var(--ji-border); padding-top: .75rem; margin-top: .75rem; position: relative; }
.cv-entry-number { font-weight: 700; color: var(--ji-red); margin: 0; }
.cv-document { max-width: 52rem; margin: 0 auto; }
.cv-head { border-bottom: 3px solid var(--ji-red); padding-bottom: .6rem; margin-bottom: 1rem; }
.cv-head h1 { margin: 0; }
.cv-headline { font-size: 1.15rem; font-weight: 600; color: var(--ji-blue); margin: .2rem 0; }
.cv-contact { color: var(--ji-text-muted); margin: 0; overflow-wrap: anywhere; }
.cv-document h2 { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ji-blue); border-bottom: 1px solid var(--ji-border); padding-bottom: .2rem; }
.cv-item { margin-bottom: .8rem; }
.cv-item p { margin: .1rem 0; }
.cv-skills { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; }
.cv-skills li { background: var(--ji-blue-light); border-radius: 1rem; padding: .15rem .7rem; }
@media print { .cv-document { box-shadow: none; border: 0; max-width: none; } .cv-skills li { border: 1px solid #ccc; } }
.cv-form .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 0 1rem; }

/* Job and candidate matching */
.match-list { display: grid; gap: 1rem; }
.match-item { display: grid; grid-template-columns: minmax(0, 1fr); gap: .5rem 1rem; }
@media (min-width: 760px) { .match-item { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.match-reasons { background: var(--ji-blue-light); border-radius: var(--radius-small); padding: .6rem .8rem; }
.match-reasons ul { list-style: none; padding: 0; margin: .3rem 0 0; }
.match-score { margin: 0; color: var(--ji-blue); }

/* Appointments */
.badge-appt-confirmed { background: #e3f4e8; color: #17603a; }
.badge-appt-proposed, .badge-appt-reschedule_requested { background: var(--ji-blue-light); color: var(--ji-blue); }
.badge-appt-cancelled { background: #eee; color: #555; }
.appt-row h2 { font-size: 1.1rem; margin: 0 0 .3rem; }

/* Comments */
.comment-list { list-style: none; padding: 0; display: grid; gap: .75rem; }
.comment-head { margin: 0 0 .3rem; }
.comment-actions { display: flex; gap: .75rem; align-items: center; margin: .3rem 0 0; font-size: .9rem; }
.vc-voice-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; margin-top: .5rem; }
.iv-link code { word-break: break-all; }
.vc-messages.iv-turns { max-height: none; overflow: visible; }
#vc-status { min-height: 1.4em; margin: 0 0 .5rem; font-weight: 600; color: var(--red, #c8102e); }

/* AI Global Promotional Feed (staff only) */
.promo-state { border-left: 8px solid #c9d1d9; }
.promo-state-active { border-left-color: #1a7f37; }
.promo-state-paused { border-left-color: #d9822b; }
.promo-state-stopped { border-left-color: #c8102e; }
.promo-state-label { font-size: 1.25rem; }
.promo-list { list-style: none; padding: 0; display: grid; gap: 1rem; }
.promo-item-grid { display: grid; grid-template-columns: 240px 1fr; gap: 1rem; align-items: start; }
.promo-item-grid img { width: 100%; height: auto; border-radius: 8px; }
.promo-writeup { white-space: pre-wrap; font-size: .85rem; background: #f4f6fa; border-radius: 8px; padding: .6rem .8rem; }
@media (max-width: 640px) { .promo-item-grid { grid-template-columns: 1fr; } }

/* Share a job (free) */
.job-share-grid { display: grid; grid-template-columns: 140px 1fr; gap: 1rem; align-items: start; }
.job-share-grid img { border-radius: 8px; background: #fff; }
@media (max-width: 520px) { .job-share-grid { grid-template-columns: 1fr; } }
.ad-post-text { margin: 1rem 0; }
.ad-post-text-body { white-space: pre-line; background: var(--ji-blue-light); padding: .75rem; border-radius: 8px; }
.job-card-promoted { border: 2px solid var(--ji-blue); }
.promoted-label { margin: 0 0 .25rem; }
.badge-promoted { background: var(--ji-blue); color: #fff; }
.boost-features { margin: .25rem 0 0 1.1rem; font-size: .95rem; }
.growth-bar-cell { width: 40%; }
.growth-bar { display: block; height: .7rem; min-width: 2px; background: var(--ji-blue); border-radius: 4px; }
.invite-code { font-size: 1.3rem; letter-spacing: .12em; }
.promo-levels { list-style: none; padding: 0; display: grid; gap: 1rem; }
.promo-level ol { margin: .5rem 0 .5rem 1.2rem; }
.promo-level-price { font-size: 1.05rem; }
.promo-level-mine { border: 2px solid var(--ji-blue); }
.promo-level-flyer { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 auto .75rem; border-radius: 8px; }
.brand-logo-preview { width: 120px; height: 120px; object-fit: contain; background: #fff; border-radius: 12px; border: 1px solid var(--ji-blue-light); }
.level-note { color: var(--ji-blue); }
.flyer-options .location-grid { margin-top: .5rem; }
.public-ad-links { text-align: center; }
.gallery-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.gallery-grid img { width: 100%; height: auto; border-radius: 8px; object-fit: cover; }
.featured-flyers { margin: 1.5rem 0; }
.plan-category { margin: .25rem 0 1rem; }
.badge-category { background: var(--ji-blue-light); color: var(--ji-blue); font-weight: 700; }
.plan-included ul { margin: .25rem 0 1rem 1.2rem; }
/* Job plans on phones: each plan as its own block, so the yearly price is always visible. */
@media (max-width: 600px) {
  #choose-plan .data-table thead { display: none; }
  #choose-plan .data-table tr { display: block; padding: .5rem 0; border-bottom: 1px solid var(--ji-border); }
  #choose-plan .data-table th, #choose-plan .data-table td { display: block; border: 0; padding: .25rem .75rem; }
}
#my-books progress { width: 100%; height: .6rem; margin: .35rem 0; }
/* Free CV templates */
.cv-template-modern .cv-head { border-bottom: 0; background: var(--ji-blue); color: #fff; padding: 1rem 1.2rem; border-radius: 8px; }
.cv-template-modern .cv-head h1, .cv-template-modern .cv-headline, .cv-template-modern .cv-contact { color: #fff; }
.cv-template-modern h2 { border-bottom: 2px solid var(--ji-red); }
.cv-template-compact { font-size: .92rem; line-height: 1.35; }
.cv-template-compact .cv-head { border-bottom-width: 1px; }
.cv-template-compact h2 { font-size: .95rem; margin: .8rem 0 .3rem; }
.cv-template-compact .cv-item { margin-bottom: .4rem; }
@media print { .cv-template-modern .cv-head { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
/* Home page: actions, search, latest jobs, how it works, trust; dashboard panels */
.home-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-3); margin: var(--space-3) 0; }
.home-action { display: flex; flex-direction: column; gap: .5rem; text-decoration: none; color: inherit; }
.home-action .btn { width: 100%; text-align: center; }
.home-search, .home-latest, .home-video, .home-how, .home-trust { margin: var(--space-5, 2rem) 0; }
.home-search-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 var(--space-3); }
.home-search .location-fields { border: 0; padding: 0; margin: 0 0 var(--space-3); }
.home-search .location-fields legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.job-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-3); }
.home-categories .tile { display: flex; justify-content: space-between; align-items: center; gap: .5rem; text-align: left; }
.home-categories .badge { background: var(--ji-blue); color: #fff; flex: none; }
.home-video video { width: 100%; max-width: 860px; border-radius: 10px; background: #0b1f45; display: block; }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-3); }
.how-grid h3 { color: var(--ji-blue); margin-top: 0; }
.how-grid ol { margin: 0; padding-left: 1.2rem; line-height: 1.55; }
.trust-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-2); }
.trust-list a { display: block; padding: .7rem .9rem; border: 1px solid #d6deec; border-left: 4px solid var(--ji-blue); border-radius: 8px; text-decoration: none; }
.dash-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-3); padding-top: 0; }
.dash-panel h2 { font-size: 1.1rem; margin-top: 0; color: var(--ji-blue); }
.dash-wide { grid-column: 1 / -1; }
.dash-list { list-style: none; padding: 0; margin: 0 0 .6rem; }
.dash-list li { padding: .4rem 0; border-bottom: 1px solid #eef1f6; }
.dash-list li.unread { font-weight: 600; }
.dash-search { display: flex; gap: .5rem; }
.dash-search input { flex: 1; min-width: 0; }
.contact-important { border-left: 4px solid var(--ji-red); margin-top: 1rem; }
.dept-assistant { margin: 1rem 0; border-left: 4px solid var(--ji-blue); }

/* Eye button inside password boxes (show / hide the password). */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 3rem; }
.pw-eye { position: absolute; right: .25rem; top: 50%; transform: translateY(-50%); min-width: 2.5rem; min-height: 2.5rem; border: 0; background: transparent; cursor: pointer; font-size: 1.2rem; line-height: 1; padding: 0; opacity: .6; }
.pw-eye[aria-pressed="true"] { opacity: 1; }
.pw-eye:focus-visible { outline: 3px solid #1446a0; border-radius: 6px; }

/* CHAT bar (CHAT page and Owner Dashboard home): one rounded bar like a chat app. */
.vc-bar { display: flex; align-items: flex-end; gap: .35rem; background: var(--ji-surface, #f4f6fb); border: 1px solid #c9d3e6; border-radius: 1.75rem; padding: .4rem .45rem .4rem 1.1rem; margin: .5rem 0; }
.vc-bar:focus-within { border-color: #1446a0; box-shadow: 0 0 0 3px rgba(20, 70, 160, .2); }
.vc-bar textarea { flex: 1; min-width: 0; border: 0; background: transparent; resize: none; font: inherit; font-size: 1.05rem; line-height: 1.4; padding: .55rem 0; max-height: 200px; outline: none; box-shadow: none; }
.vc-form .vc-bar textarea { width: auto; }
.vc-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 0; background: transparent; color: #0b1f45; cursor: pointer; padding: 0; text-decoration: none; }
.vc-icon:hover { background: rgba(20, 70, 160, .1); }
.vc-icon:focus-visible { outline: 3px solid #1446a0; outline-offset: 2px; }
.vc-icon[hidden] { display: none; }
.vc-bar .vc-send { background: #0b1f45; color: #fff; }
.vc-bar .vc-talk { background: #1a73e8; color: #fff; }
.vc-bar .vc-talk:hover, .vc-bar .vc-send:hover { filter: brightness(1.1); }
.vc-js .vc-bar:not(.vc-has-text) .vc-send { display: none; }
.vc-talk[aria-pressed="true"] { background: #c8102e; }
.vc-under { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .5rem 1.25rem; }
.vc-home { margin: 0 0 1.25rem; }
.vc-keys { margin: 0 0 1rem; padding-left: 1.2rem; }
