/* ===================================================================
   Platfòm Sivik Ayisyen — style.css
   Mobile-first · Dark default + Light theme · i18n-agnostic
   =================================================================== */

/* ----- Theme variables ----- */
:root,
[data-theme="dark"] {
  --bg:         #111418;
  --surface:    #1a1f26;
  --surface-2:  #242b33;
  --fg:         #e8ecef;
  --muted:      #9aa4ad;
  --accent:     #c9a227;
  --accent-2:   #a5372a;
  --success:    #4a8;
  --info:       #5b8def;
  --border:     #2f3843;
  --shadow:     0 4px 16px rgba(0,0,0,0.4);
  --radius:     8px;
  --radius-lg:  12px;
}

[data-theme="light"] {
  --bg:         #f7f2e6;
  --surface:    #ffffff;
  --surface-2:  #eee7d4;
  --fg:         #1a1410;
  --muted:      #6b5f52;
  --accent:     #8a6a14;
  --accent-2:   #a5372a;
  --success:    #2f7d4f;
  --info:       #2e5ba8;
  --border:     #dfd4bb;
  --shadow:     0 2px 10px rgba(60,40,10,0.12);
}

/* ----- Base / Reset ----- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

/* ----- Layout ----- */
header.site-header {
  background: linear-gradient(90deg, var(--accent-2), #6b1a12);
  border-bottom: 2px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
[data-theme="light"] header.site-header {
  background: linear-gradient(90deg, var(--accent-2), #7a2018);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.8rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.brand {
  display: flex; flex-direction: column;
  text-decoration: none; color: #fff;
}
.brand strong {
  font-size: 1.15rem;
  letter-spacing: 0.06em;
}
.brand .sub {
  font-size: 0.72rem;
  color: #ffe6b8;
  margin-top: 1px;
}
nav.primary {
  display: flex; gap: 0.2rem; flex-wrap: wrap;
  align-items: center;
}
nav.primary a {
  color: #fff;
  text-decoration: none;
  padding: 0.45rem 0.7rem;
  border-radius: 6px;
  font-size: 0.92rem;
  transition: background 0.15s;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}
nav.primary a:hover,
nav.primary a.active {
  background: rgba(255,255,255,0.15);
}

.prefs {
  display: flex; gap: 0.3rem; align-items: center;
}
.prefs button,
.prefs a {
  background: rgba(0,0,0,0.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.prefs button.active,
.prefs a.active {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.5);
}
.prefs form { display: inline; }

/* Mobile: hamburger toggle */
.nav-toggle {
  display: none;
  background: rgba(0,0,0,0.25);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  font-size: 1.1rem;
  cursor: pointer;
  min-width: 44px;
  min-height: 40px;
}

main {
  max-width: 1180px;
  margin: 1.5rem auto;
  padding: 0 1rem;
}
footer {
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  font-size: 0.85rem;
}

/* ----- Typography ----- */
h1, h2, h3 { color: var(--fg); line-height: 1.25; }
h1 { color: var(--accent); font-weight: 600; margin: 0 0 0.8rem; font-size: 1.7rem; }
h2 {
  color: var(--fg);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3rem;
  margin-top: 2rem;
  font-size: 1.3rem;
}
h3 { font-size: 1.1rem; margin: 0.8rem 0 0.4rem; }
.lead { color: var(--muted); font-size: 1.02rem; }
code {
  background: var(--surface-2);
  color: var(--accent);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.88em;
  word-break: break-all;
}

/* ----- Hero ----- */
.hero h1 { font-size: 1.9rem; }
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.7rem;
  margin: 1.3rem 0;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.1rem;
  border-radius: var(--radius);
  text-align: center;
}
.stat .value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}
.stat .label {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ----- Tables ----- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.92rem;
}
th, td {
  text-align: left;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  background: var(--surface-2);
  color: var(--accent);
  font-weight: 600;
  position: sticky;
  top: 0;
}
tr:hover td { background: rgba(201, 162, 39, 0.06); }
.summary { max-width: 540px; }
.meta { color: var(--muted); font-size: 0.85rem; }

/* ----- Coverage table + progress ----- */
.coverage { margin-top: 1rem; }
.coverage td.filled { color: var(--accent); font-weight: 600; }
.coverage .total-row td {
  background: var(--surface-2);
  font-weight: 700;
  border-top: 2px solid var(--accent);
}
.progress {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  height: 22px;
  min-width: 110px;
  overflow: hidden;
}
.progress-fill {
  position: absolute; top: 0; left: 0; bottom: 0;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width 0.4s;
}
.progress span {
  position: relative;
  display: block;
  text-align: center;
  font-size: 0.75rem;
  line-height: 22px;
  color: #fff;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.55);
}

/* ----- Card grid ----- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.7rem;
  margin: 1rem 0 2rem;
}
.card {
  display: block;
  text-decoration: none;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  transition: transform 0.12s, border-color 0.12s, background 0.12s;
  min-height: 96px;
}
.card:hover, .card:active {
  transform: translateY(-1px);
  background: var(--surface-2);
  border-left-color: var(--accent-2);
}
.card.diaspora { border-left-color: #3a7bd5; }
.card-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.72rem; color: var(--muted); margin-bottom: 0.4rem;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.card-head .code { color: var(--accent); font-weight: 700; }
.card-name { font-size: 1rem; font-weight: 600; }
.card-alt { font-size: 0.82rem; color: var(--muted); margin-top: 0.15rem; }
.card-foot {
  margin-top: 0.5rem; padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.76rem; color: var(--muted);
}

/* ----- Breadcrumb ----- */
.crumbs {
  display: flex; gap: 0.35rem; align-items: center;
  font-size: 0.88rem; color: var(--muted);
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}
.crumbs a { color: var(--accent); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .current { color: var(--fg); font-weight: 500; }
.crumbs span { opacity: 0.5; }

/* ----- Node detail header ----- */
.node-head { margin-bottom: 1.2rem; }
.node-head h1 { margin-bottom: 0.5rem; }
.node-meta { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.pill {
  display: inline-block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
}
a.pill:hover { background: var(--accent); color: #1a1410; }
.name-alt { color: var(--muted); font-style: italic; margin-top: 0.5rem; }

/* ----- Metrics strip ----- */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.55rem;
  margin: 1.2rem 0;
}
.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.9rem;
  border-radius: var(--radius);
  text-align: center;
}
.metric .value {
  display: block; font-size: 1.5rem; font-weight: 700; color: var(--accent);
}
.metric .label {
  display: block; font-size: 0.75rem; color: var(--muted);
  margin-top: 0.2rem; text-transform: uppercase; letter-spacing: 0.04em;
}

/* ----- Forms ----- */
.form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.form label {
  display: flex; flex-direction: column; gap: 0.25rem;
  font-size: 0.85rem; color: var(--muted);
}
.form label.full { grid-column: 1 / -1; }
.form input, .form select, .form textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.65rem 0.75rem;
  color: var(--fg);
  font: inherit;
  min-height: 44px;   /* mobile tap target */
}
.form textarea { min-height: 80px; }
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none; border-color: var(--accent);
}

button, .form button, .btn-row button, .toolbar button, .inline button {
  background: var(--accent);
  color: #1a1410;
  border: none;
  padding: 0.6rem 1.1rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font: inherit;
  min-height: 44px;
}
button:hover { filter: brightness(1.08); }
button.secondary, .form button.secondary, .btn-row button.secondary {
  background: var(--surface-2);
  color: var(--fg);
  border: 1px solid var(--border);
}
button.danger {
  background: var(--accent-2);
  color: #fff;
}
.btn-row { grid-column: 1 / -1; display: flex; gap: 0.5rem; justify-content: flex-end; flex-wrap: wrap; }

.inline { display: inline-flex; gap: 0.3rem; align-items: center; flex-wrap: wrap; }
.inline select, .inline input {
  padding: 0.4rem 0.6rem;
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 4px;
  min-height: 38px;
  font-size: 0.9rem;
}
.inline button {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  min-height: 38px;
}

.filled { color: var(--accent); font-weight: 600; }
.vacant { color: var(--muted); font-style: italic; }

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

/* ----- Toolbar + filter pills ----- */
.toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin: 1rem 0; flex-wrap: wrap; gap: 0.5rem;
}
.filters { display: flex; gap: 0.3rem; flex-wrap: wrap; align-items: center; }
.filters .pill { cursor: pointer; }
.filters .pill.active { background: var(--accent); color: #1a1410; border-color: var(--accent); }

/* ----- Row-inline actions (details/summary) ----- */
.row-actions { display: inline-block; }
.row-actions summary {
  cursor: pointer;
  color: var(--accent);
  list-style: none;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  display: inline-block;
  min-height: 36px;
  font-size: 0.88rem;
}
.row-actions summary::-webkit-details-marker { display: none; }
.row-actions[open] summary { background: var(--surface-2); }
.row-actions form + form { margin-top: 0.3rem; }
.secondary-btn {
  cursor: pointer;
  background: var(--surface-2);
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 0.55rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  display: inline-block;
  min-height: 40px;
}

/* ----- Inbox (mesaj) ----- */
.inbox { display: flex; flex-direction: column; gap: 0.7rem; }
.msg {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
}
.msg.status-new { border-left-color: var(--accent-2); }
.msg.status-triaged { border-left-color: var(--accent); }
.msg.status-replied { border-left-color: var(--success); }
.msg.status-archived { border-left-color: var(--border); opacity: 0.75; }
.msg header {
  display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap;
  margin-bottom: 0.4rem;
  font-size: 0.82rem; color: var(--muted);
}
.msg h3 { margin: 0.3rem 0; font-size: 1rem; }
.msg .body {
  margin: 0.4rem 0;
  color: var(--fg);
  white-space: pre-wrap;
  font-size: 0.93rem;
}
.msg footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 0.6rem; padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem; color: var(--muted);
  flex-wrap: wrap; gap: 0.4rem;
}
.channel-tag {
  padding: 0.12rem 0.45rem; border-radius: 4px;
  font-weight: 600; text-transform: uppercase;
  font-size: 0.68rem; letter-spacing: 0.06em;
}
.ch-whatsapp { background: #25d366; color: #0e2b1a; }
.ch-sms      { background: #5b8def; color: #0a1a3a; }
.ch-email    { background: #c97; color: #1a1410; }
.ch-web      { background: var(--accent); color: #1a1410; }
.from .ident { color: var(--muted); margin-left: 0.4rem; font-size: 0.78rem; }
.scope { color: var(--accent); font-size: 0.78rem; }
.status-pill {
  padding: 0.08rem 0.5rem; border-radius: 999px; font-size: 0.68rem;
  text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--surface-2); color: var(--muted);
}
.status-pill.st-new { background: rgba(165, 55, 42, 0.25); color: var(--accent-2); }
.status-pill.st-triaged { background: rgba(201, 162, 39, 0.25); color: var(--accent); }
.status-pill.st-replied { background: rgba(74, 160, 120, 0.25); color: var(--success); }

/* ----- Publications ----- */
.pubs { display: flex; flex-direction: column; gap: 0.7rem; }
.pub {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
}
.pub.status-draft { border-left-color: var(--muted); opacity: 0.88; }
.pub.status-published { border-left-color: var(--accent); }
.pub header {
  display: flex; gap: 0.45rem; flex-wrap: wrap; align-items: center;
  font-size: 0.78rem; margin-bottom: 0.4rem;
}
.pub h3 { margin: 0.3rem 0 0.4rem; }
.pub .body { white-space: pre-wrap; margin: 0.4rem 0; font-size: 0.93rem; }
.pub footer {
  display: flex; justify-content: space-between; gap: 0.5rem; align-items: center;
  margin-top: 0.5rem; padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem; color: var(--muted);
  flex-wrap: wrap;
}
.kind-pill, .lang-pill {
  padding: 0.1rem 0.5rem; border-radius: 4px;
  background: var(--surface-2); color: var(--accent);
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em;
}
.lang-pill { background: var(--accent-2); color: #fff; }
.time { font-variant-numeric: tabular-nums; }

/* ----- Search bar ----- */
.search-bar {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
  max-width: 720px;
}
.search-bar input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 1rem;
  color: var(--fg);
  font: inherit;
  min-height: 44px;
}
.search-bar input:focus { outline: none; border-color: var(--accent); }
.search-bar button {
  padding: 0 1.2rem;
  border-radius: 8px;
  min-height: 44px;
}

/* ----- Nanm (soul) cards ----- */
.nanm-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin: 0.8rem 0;
}
.nanm-card.ai {
  border-left-color: var(--accent-2);
  background: linear-gradient(180deg, var(--surface), rgba(165, 55, 42, 0.08));
}
.nanm-card h3 { color: var(--accent); margin: 0 0 0.5rem; }
.nanm-text {
  white-space: pre-wrap;
  word-wrap: break-word;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--fg);
  max-height: 520px;
  overflow-y: auto;
  margin: 0;
}
.document-body { max-height: none; }

/* AI panel */
.ai-panel {
  background: linear-gradient(180deg, var(--surface), rgba(165, 55, 42, 0.08));
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-2);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin: 1rem 0 2rem;
}
.ai-header {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.ai-header h2 {
  border-bottom: none;
  margin: 0;
  color: var(--accent);
}
.ai-status {
  font-size: 0.78rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-weight: 600;
}
.ai-status.ok { background: rgba(74, 160, 120, 0.2); color: var(--success); }
.ai-status.off { background: rgba(165, 55, 42, 0.2); color: var(--accent-2); }
.ai-status code { background: transparent; color: inherit; padding: 0; }

.ai-btn {
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  color: #fff;
  font-size: 1rem;
}

/* =====================================================================
   SALON D'EXPOSITION — public billboard / saloon-style showcase
   ===================================================================== */

.salon-hero {
  margin: -1.5rem -1rem 1.5rem;
  padding: 3rem 1.5rem 2.5rem;
  background:
    radial-gradient(circle at 85% 20%, rgba(201, 162, 39, 0.14), transparent 55%),
    radial-gradient(circle at 15% 90%, rgba(165, 55, 42, 0.18), transparent 55%),
    linear-gradient(160deg, var(--surface), var(--bg));
  border-bottom: 2px solid var(--accent);
  position: relative;
  overflow: hidden;
}
.salon-hero::before,
.salon-hero::after {
  content: "";
  position: absolute;
  width: 280px; height: 280px;
  border-radius: 50%;
  opacity: 0.05;
  pointer-events: none;
}
.salon-hero::before {
  background: var(--accent); top: -120px; right: -80px;
}
.salon-hero::after {
  background: var(--accent-2); bottom: -140px; left: -80px;
}
.salon-hero-inner {
  max-width: 900px; margin: 0 auto; text-align: center;
  position: relative; z-index: 1;
}
.salon-eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.25em;
  margin-bottom: 0.6rem;
  font-weight: 700;
}
.salon-title {
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1.05;
  margin: 0 0 0.6rem;
  color: var(--fg);
  letter-spacing: -0.02em;
}
.salon-tagline {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto 0.5rem;
  line-height: 1.5;
}
.salon-mission {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
  display: inline-block;
}

/* Filter chips */
.salon-filters {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  justify-content: center;
  margin: 0 0 2rem;
}
.filter-chip {
  display: inline-flex; align-items: center; gap: 0.45rem;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  transition: all 0.15s;
  min-height: 40px;
}
.filter-chip:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}
.filter-chip.active {
  background: var(--accent);
  color: #1a1410;
  border-color: var(--accent);
  font-weight: 600;
}
.chip-count {
  background: rgba(0,0,0,0.18);
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}
.filter-chip.active .chip-count { background: rgba(0,0,0,0.3); }

/* Featured (hero) exhibits */
.salon-featured {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}
.exhibit-hero {
  display: flex; gap: 1rem; align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--fg);
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.exhibit-hero::before {
  content: "★";
  position: absolute;
  top: 0.8rem; right: 1rem;
  color: var(--accent);
  font-size: 1.1rem;
}
.exhibit-hero:hover {
  transform: translateY(-2px);
  border-left-color: var(--accent-2);
}
.exhibit-hero-icon {
  font-size: 2.6rem;
  line-height: 1;
  flex-shrink: 0;
}
.exhibit-hero-body { flex: 1; min-width: 0; }
.exhibit-hero-body h2 {
  margin: 0.3rem 0 0.5rem;
  font-size: 1.35rem;
  line-height: 1.25;
  border-bottom: none;
  padding-bottom: 0;
}
.exhibit-hero-body p { margin: 0.3rem 0; color: var(--muted); line-height: 1.5; }

/* Grid of secondary exhibits */
.salon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.exhibit-card {
  display: flex; flex-direction: column; gap: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.2rem 1.1rem;
  text-decoration: none;
  color: var(--fg);
  transition: all 0.2s;
  min-height: 190px;
}
.exhibit-card:hover {
  transform: translateY(-2px);
  border-top-color: var(--accent-2);
  background: var(--surface-2);
}
.exhibit-card-icon { font-size: 2rem; line-height: 1; }
.exhibit-card h3 {
  margin: 0.2rem 0 0.3rem;
  font-size: 1.05rem;
  line-height: 1.25;
}
.exhibit-card p { margin: 0; color: var(--muted); font-size: 0.9rem; }

/* Kind tag */
.exhibit-kind-tag {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

/* Kind-colored accents (subtle per-type theming) */
.exhibit-kind-evenman  { border-top-color: #d97706; }  /* event — amber */
.exhibit-kind-lakou    { border-top-color: var(--accent-2); }  /* sacred site — oxblood */
.exhibit-kind-rechèch  { border-top-color: #3a7bd5; }  /* research — blue */
.exhibit-kind-anons    { border-top-color: var(--accent); }  /* announcement — gold */
.exhibit-kind-pwodwi   { border-top-color: #2f7d4f; }  /* product — green */
.exhibit-kind-medya    { border-top-color: #9c4dcc; }  /* media — purple */
.exhibit-kind-evenman.exhibit-hero { border-left-color: #d97706; }
.exhibit-kind-lakou.exhibit-hero   { border-left-color: var(--accent-2); }
.exhibit-kind-rechèch.exhibit-hero { border-left-color: #3a7bd5; }
.exhibit-kind-anons.exhibit-hero   { border-left-color: var(--accent); }
.exhibit-kind-pwodwi.exhibit-hero  { border-left-color: #2f7d4f; }
.exhibit-kind-medya.exhibit-hero   { border-left-color: #9c4dcc; }

.exhibit-date {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.88rem !important;
}
.exhibit-cta {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.88rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

/* Detail page */
.exhibit-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 1rem 0;
}
.exhibit-detail-head {
  display: flex; gap: 1.5rem; align-items: flex-start;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.2rem;
}
.exhibit-detail-icon { font-size: 4rem; line-height: 1; flex-shrink: 0; }
.exhibit-detail-head h1 { margin: 0.3rem 0 0.5rem; color: var(--fg); }
.exhibit-detail.exhibit-kind-lakou   { border-top-color: var(--accent-2); }
.exhibit-detail.exhibit-kind-rechèch { border-top-color: #3a7bd5; }
.exhibit-detail.exhibit-kind-evenman { border-top-color: #d97706; }
.exhibit-detail.exhibit-kind-pwodwi  { border-top-color: #2f7d4f; }
.exhibit-detail.exhibit-kind-medya   { border-top-color: #9c4dcc; }

.exhibit-cta-block {
  text-align: center;
  padding: 1.5rem 0 0.5rem;
  border-top: 1px solid var(--border);
  margin-top: 1.5rem;
}
.exhibit-cta-button {
  display: inline-block;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  color: #fff;
  padding: 0.8rem 2rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: var(--shadow);
  transition: transform 0.15s;
}
.exhibit-cta-button:hover { transform: translateY(-1px); }

.salon-admin-link {
  margin: 2rem 0 1rem;
  text-align: center;
}

/* Territory-jump widget on /salon */
.salon-territory-jump {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin: 1rem 0;
}
.salon-territory-jump .search-bar {
  max-width: 100%;
  margin: 0;
}

/* Tenant attribution inside exhibit cards on /salon/teritwa/... */
.exhibit-tenant,
.exhibit-tenant-card {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0.5rem 0 0;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.exhibit-tenant strong,
.exhibit-tenant-card strong { color: var(--accent); }

/* ---- Login ---- */
.login-wrap {
  max-width: 440px;
  margin: 2rem auto;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.login-wrap h1 { text-align: center; }
.login-wrap .lead { text-align: center; font-size: 0.95rem; }

/* Quota meters on /ai-usage */
.quota-stack {
  display: flex; flex-direction: column; gap: 0.6rem;
  margin: 0.8rem 0;
}
.quota-row {
  display: grid;
  grid-template-columns: 180px 1fr 160px;
  gap: 0.8rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
}
.quota-label {
  font-weight: 600;
  color: var(--fg);
}
.quota-bar {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  height: 18px;
  overflow: hidden;
  position: relative;
}
.quota-fill {
  height: 100%;
  transition: width 0.4s;
  border-radius: 999px;
}
.quota-text {
  text-align: right;
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 767px) {
  .quota-row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
    padding: 0.8rem;
  }
  .quota-text { text-align: left; }
}

/* Logged-in leader badge in nav */
.prefs-leader {
  background: rgba(255,255,255,0.15);
  color: #fff;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.25);
}

/* Mobile adjustments */
@media (max-width: 767px) {
  .salon-hero { padding: 2rem 1rem 1.8rem; margin: -1rem -0.7rem 1.2rem; }
  .salon-title { font-size: 1.7rem; }
  .salon-tagline { font-size: 0.98rem; }
  .salon-featured { grid-template-columns: 1fr; }
  .exhibit-hero { flex-direction: column; padding: 1.2rem; }
  .exhibit-hero-icon { font-size: 2.2rem; }
  .salon-grid { grid-template-columns: 1fr 1fr; gap: 0.7rem; }
  .exhibit-card { padding: 0.9rem 0.85rem; min-height: 160px; }
  .exhibit-detail { padding: 1.2rem; }
  .exhibit-detail-head { flex-direction: column; gap: 0.6rem; }
  .exhibit-detail-icon { font-size: 3rem; }
}

/* =====================================================================
   MOBILE (< 768px) — mobile-first but we adjust a few desktop patterns
   ===================================================================== */
@media (max-width: 767px) {
  body { font-size: 15px; }
  .header-inner { padding: 0.6rem 0.8rem; gap: 0.4rem; }
  .brand strong { font-size: 1rem; }
  .brand .sub { font-size: 0.66rem; }

  nav.primary {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    margin-top: 0.5rem;
  }
  nav.primary.open {
    display: flex;
  }
  nav.primary a {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: 6px;
  }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }

  main { padding: 0 0.7rem; margin: 1rem auto; }

  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.15rem; margin-top: 1.4rem; }
  .hero h1 { font-size: 1.6rem; }
  .lead { font-size: 0.98rem; }

  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat .value { font-size: 1.55rem; }

  .grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .card { min-height: 88px; padding: 0.7rem 0.8rem; }
  .card-name { font-size: 0.95rem; }

  .metrics { grid-template-columns: repeat(2, 1fr); }

  /* Tables: wrap for horizontal scroll on mobile */
  table { font-size: 0.85rem; }
  th, td { padding: 0.45rem 0.55rem; }
  /* If a table is inside .table-wrap it scrolls horizontally. */

  .form { padding: 0.8rem; }
  .form input, .form select, .form textarea { font-size: 16px; } /* prevents iOS zoom */

  .coverage table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  .prefs { flex-wrap: nowrap; order: 3; }
  .prefs button, .prefs a { padding: 0.3rem 0.5rem; font-size: 0.78rem; }

  .msg, .pub { padding: 0.7rem 0.85rem; }

  .search-bar { flex-direction: row; }

  footer { padding: 1.5rem 0.8rem; margin-top: 2rem; font-size: 0.78rem; }
}

/* ----- Tablet (768–1023px) ----- */
@media (min-width: 768px) and (max-width: 1023px) {
  .stats { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
}

/* ----- Small desktop up (>= 1024px) ----- */
@media (min-width: 1024px) {
  body { font-size: 16px; }
  h1 { font-size: 1.85rem; }
  .hero h1 { font-size: 2.1rem; }
}

/* ----- Accessibility: focus rings ----- */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
