:root {
  --bg: #f4f7fc;
  --card: #ffffff;
  --ink: #28313d;          /* tekst - tamna škriljac-siva iz loga */
  --heading: #1d2530;      /* naslovi - tamnije */
  --muted: #6b7682;
  --accent: #0061c9;       /* plava iz loga */
  --accent-strong: #004a9e;/* tamnija plava (hover) */
  --accent-soft: #e8f1fd;  /* svijetli plavi ton (oznake, naglasci) */
  --accent-ink: #ffffff;
  --error: #c0392b;
  --line: #e3e8f0;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(20,45,85,0.04), 0 8px 24px rgba(20,45,85,0.05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(180deg, #eef3fb 0%, var(--bg) 240px);
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* --- zaglavlje / brand --- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(20,45,85,0.03);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.brand-logo { display: block; width: 40px; height: 40px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand { font-weight: 800; font-size: 19px; letter-spacing: 0.2px; color: var(--heading); }
.brand-accent { color: var(--accent); }
.subtitle { font-size: 12px; color: var(--muted); margin-top: 1px; }

.container { max-width: 1300px; margin: 32px auto; padding: 0 18px; }

/* --- kartice --- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 20px; }

.login-card { max-width: 380px; margin: 7vh auto 0; text-align: center; }
.login-logo { display: block; width: 230px; max-width: 80%; height: auto; margin: 4px auto 10px; }
.login-product { margin: 0 0 18px; font-size: 17px; font-weight: 800; color: var(--heading); }
.login-card form { text-align: left; }

/* --- tipografija --- */

h1 { margin-top: 0; font-size: 23px; font-weight: 800; color: var(--heading); letter-spacing: 0.2px; }
h2 { font-size: 16px; margin: 26px 0 6px; color: var(--heading); font-weight: 700; }
h3 { font-weight: 700; }

label { display: block; margin: 14px 0 4px; font-size: 14px; font-weight: 600; }
input, textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* --- gumbi --- */

button {
  margin-top: 18px;
  width: 100%;
  padding: 11px 16px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .05s;
}
button:hover { background: var(--accent-strong); }
button:active { transform: translateY(1px); }

.error { color: var(--error); font-size: 14px; margin: 0; }
.muted { color: var(--muted); }

.topbar-right a.logout {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}
.topbar-right a.logout:hover { color: var(--accent-strong); }

.foot {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 28px 0;
}

/* --- zaglavlje kartice --- */

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.card-head h1 { margin: 0; }
.card-head form { margin: 0; }
.card-head button {
  margin-top: 0;
  width: auto;
  padding: 9px 16px;
  font-size: 14px;
}

a.back { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; }
a.back:hover { color: var(--accent-strong); }

.flash {
  margin: 16px 0 0;
  padding: 11px 14px;
  background: var(--accent-soft);
  border: 1px solid #cfe0fb;
  border-radius: var(--radius-sm);
  font-size: 14px;
}

/* --- tablice --- */

table.grid {
  width: 100%;
  border-collapse: collapse;
  margin-top: 18px;
  font-size: 14px;
}
table.grid th, table.grid td {
  text-align: left;
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
}
table.grid th { color: var(--muted); font-weight: 600; }
table.grid tbody tr:hover { background: #f7faff; }
table.grid td.num, table.grid th.num { text-align: right; }
table.grid a { color: var(--accent); text-decoration: none; font-weight: 600; }
table.grid a:hover { color: var(--accent-strong); text-decoration: underline; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--muted); }

dl.profile {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 8px 16px;
  margin: 16px 0 0;
  font-size: 14px;
}
dl.profile dt { color: var(--muted); font-weight: 600; }
dl.profile dd { margin: 0; white-space: pre-wrap; }

p.pravila {
  margin: 6px 0 0;
  padding: 11px 14px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-sm);
  font-size: 14px;
  white-space: pre-wrap;
}

ul.brands { list-style: none; padding: 0; margin: 6px 0 0; }
ul.brands li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

/* Klijentski profil: brendovi kao responzivne pločice, podijeljeni na okvire i leće. */
h4 {
  margin: 16px 0 8px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.brand-chip-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: #f8f9fa;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
}
.brand-chip-display .excl { margin-left: 0; flex: none; }
.excl {
  margin-left: 8px;
  padding: 2px 9px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  vertical-align: middle;
}
.inactive {
  margin-left: 8px;
  padding: 2px 9px;
  background: #f1f3f6;
  color: var(--muted);
  border-radius: 999px;
  font-size: 11px;
  vertical-align: middle;
}

/* --- generiranje teksta --- */

.generate-form { margin-top: 16px; }
.generate-form textarea { resize: vertical; }
.form-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.form-row button { width: auto; margin-top: 0; }
button.ghost {
  background: #eef1f5;
  color: var(--muted);
  cursor: not-allowed;
}
button.ghost:hover { background: #eef1f5; }

.ai-note { color: var(--muted); font-size: 12px; margin: 10px 0 0; }

/* --- povezani računi (Meta priprema) - diskretan status + placeholder „Poveži” --- */
/* Status povezanosti uz svaku mrežu u „Objavi na” (lanac + sitni tekst). */
.net-content { display: flex; flex-direction: column; gap: 8px; }
.net-header { display: flex; align-items: center; gap: 6px; }
.net-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.net-status svg { width: 13px; height: 13px; flex: none; }
.net-off { color: #c0392b; }   /* puknuti lanac - crveno */
.net-on { color: #1f9d55; }    /* spojeni lanac - zeleno */

/* --- Korak 1: izbor mreža (kvačice „Objavi na”) --- */
.net-choice {
  margin: 4px 0 2px;
  padding: 12px 14px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fcfdff;
}
.net-choice legend {
  padding: 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.net-opts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.net-opt {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 8px 14px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  /* Prijelaz SAMO na bojama. Geometrija (2px obrub, padding) se NIKAD ne mijenja → bez titranja. */
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
/* Kvačica fiksne veličine bez paddinga: globalna `input` pravila (padding/širina/fokus-ring)
   inače cure na nativni checkbox i pri kliku mu mijenjaju geometriju → čip poskakuje. */
.net-opt input {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  padding: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.net-opt input:focus { box-shadow: none; }
.net-opt input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.net-opt:hover { background-color: #f3f4f6; }
/* označena mreža: plava ispuna iz loga + tvrda sjena (brutalist; mijenja se samo boja) */
.net-opt:has(input:checked) {
  background-color: var(--accent);
  color: #fff;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.18);
}
.net-opt:has(input:checked) .net-status { color: #fff; }

/* Ikone društvenih mreža (zamjena za točkicu) - u boji mreže preko currentColor. */
.net-ic { flex: none; width: 18px; height: 18px; vertical-align: middle; }
.net-ic--instagram { color: #d6336c; }
.net-ic--facebook  { color: #1877f2; }
.net-ic--linkedin  { color: #0a66c2; }
/* na ekranu rezultata naslov nije flex - ikoni treba mali razmak do naziva */
.post-head h2 .net-ic { margin-right: 8px; }

/* --- Korak 2: čip-oznake (označi pa generiraj) --- */
/* Neo-brutalistički čip: debeo obrub, jasna boja kad je odabran. Geometrija (2px obrub,
   padding) je ista u svim stanjima - mijenja se samo boja/sjena → bez titranja. */
.chip-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 8px 14px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: background-color .12s ease, color .12s ease, box-shadow .12s ease;
}
/* stvarni checkbox je skriven (ali dostupan tipkovnici/čitaču); cijeli pill je toggle */
.chip-check input {
  position: absolute;
  width: 1px; height: 1px;
  margin: 0; padding: 0;
  opacity: 0;
  pointer-events: none;
}
.chip-check:hover { background-color: #f3f4f6; }
/* odabrano: tamna ispuna, bijeli tekst + tvrda sjena (brutalist) */
.chip-check:has(input:checked) {
  background-color: var(--ink);
  color: #fff;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.18);
}
.chip-check:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip-label { line-height: 1; }
.chip-star { color: #e0a800; font-size: 12px; line-height: 1; }
.chip-tag { font-weight: 800; }
/* akcija odabrana → narančasta */
.chip-akcija:has(input:checked) {
  background-color: #e8a33d;
  color: #fff;
}

/* --- raspored dashboarda po skici: 3 kartice, 2 kolone na desktopu --- */
.dash-intro { margin: 4px 0 0; font-size: 14px; }

/* Naslov optike + pametni prečac do profila glasa. */
.dash-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.dash-title-row h1 { margin: 0; }
.btn-profile-jump {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 6px 12px;
  box-shadow: 2px 2px 0 var(--ink);
  background: #fff;
  white-space: nowrap;
  transition: all 0.1s;
}
.btn-profile-jump:hover {
  box-shadow: 1px 1px 0 var(--ink);
  transform: translate(1px, 1px);
  background: #f6d743;
}

/* Kartica 1: lijevo unos (mreže, tema, gumb), desno čip-grupe brendova. */
.work-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
.work-left { display: flex; flex-direction: column; }
.work-left h1 { margin-bottom: 0; }
.work-left .usage { margin-top: 12px; }
.work-left .net-choice { margin: 16px 0 0; }
.work-left textarea { resize: vertical; min-height: 104px; }
.work-right { display: flex; flex-direction: column; gap: 18px; }
.work-right .chip-group { margin-top: 0; }
@media (min-width: 760px) {
  .work-grid { grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
}

/* Kartica 2: „Sezonsko” + „Posebno” jedno uz drugo na desktopu. */
.struka-bottom { display: grid; grid-template-columns: 1fr; gap: 16px 24px; }
@media (min-width: 760px) {
  .struka-bottom { grid-template-columns: 1fr 1fr; }
}

/* legenda ispod Asortimana */
.excl-legend { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.excl-legend .chip-star { font-size: 11px; color: #e8a33d; }

/* ekskluzivni brend: narančasto (kao na skici), ★ marker; običan toggle */
/* ekskluzivni odabran → jarko žuta (kao na skici), ne tamna ispuna */
.chip-excl .chip-star { color: #e0a800; }
.chip-excl:has(input:checked) {
  background-color: #f6d743;
  color: var(--ink);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.18);
}
.chip-excl:has(input:checked) .chip-star { color: var(--ink); }

/* --- theme-builder: 6 kategorija-kartica + ladice (neo-brutalizam) --- */
.tb-title {
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--heading);
}
.tb-title::before {
  content: "-";
  margin-right: 8px;
  color: var(--ink);
}
.tb-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.tb-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: auto;
  margin: 0;
  padding: 22px 12px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 3px 3px 0 var(--ink);
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .1s ease, box-shadow .1s ease, transform .1s ease;
}
.tb-card .tb-ic { width: 30px; height: 30px; }
.tb-card:hover { background: #fbfbf6; }
.tb-card.active {
  background: #f6d743;            /* jarko žuta - aktivna kategorija */
  box-shadow: 1px 1px 0 var(--ink);
  transform: translate(2px, 2px); /* tvrdi klik-efekt */
}

.chip-drawer-container { margin-top: 18px; }
.chip-drawer {
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 3px 3px 0 var(--ink);
  background: #f7f8fa;
  padding: 16px 18px;
}
.chip-drawer[hidden] { display: none; }
.drawer-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--heading);
}
.drawer-head .tb-ic { width: 20px; height: 20px; flex: none; }
.chip-drawer .excl-legend { margin-top: 12px; }

/* F8: priložena slika - uredan file-input uklopljen u stil. */
.upload-label { margin-top: 14px; }
.upload-input {
  width: 100%;
  padding: 9px 11px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: #fcfdff;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}
.upload-input:hover { border-color: #bfd8f7; background: var(--accent-soft); }
.upload-input::file-selector-button {
  margin-right: 10px;
  padding: 7px 13px;
  border: 0;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.upload-input::file-selector-button:hover { background: #d8e8fc; }
.upload-hint { margin: 6px 0 0; font-size: 12px; color: var(--muted); }

/* „Generiraj” - primarna akcija, neo-brutalistički dominantna. */
.generate-row { margin-top: 18px; gap: 12px; }
.btn-generate {
  min-width: 190px;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 800;
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 4px 4px 0 var(--ink);
  transition: box-shadow .1s ease, transform .1s ease, background-color .15s;
}
.btn-generate:hover { box-shadow: 2px 2px 0 var(--ink); transform: translate(2px, 2px); }
.btn-generate:active { box-shadow: 1px 1px 0 var(--ink); transform: translate(3px, 3px); }

/* Sekundarni „Predloži plan tema” - bijela neo-brutalistička tipka. */
.btn-plan {
  width: auto;
  margin-top: 0;
  padding: 14px 22px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 4px 4px 0 var(--ink);
  transition: box-shadow .1s ease, transform .1s ease, background-color .15s;
}
.btn-plan:hover { background: #f6d743; box-shadow: 2px 2px 0 var(--ink); transform: translate(2px, 2px); }
.btn-plan:active { box-shadow: 1px 1px 0 var(--ink); transform: translate(3px, 3px); }

/* --- Planer Korak 2: split (tema | kalendar) + kartice nacrta --- */
.form-split-view { display: flex; flex-direction: column; gap: 24px; }
.split-left { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.split-left textarea { resize: vertical; }
.split-right { flex: 1; min-width: 0; }
@media (min-width: 760px) {
  .form-split-view { flex-direction: row; align-items: flex-start; }
  /* desno kompaktan mini-kalendar - ne pojede formu */
  .form-split-view .split-right { flex: 0 0 220px; }
}
/* dan s planiranom objavom - crveno */
.cal-planned { background: #ff4d4d; color: #fff; border-radius: 4px; }
/* danas + planirano: dijagonalno pola crno / pola crveno */
.cal-today-planned { background: linear-gradient(135deg, var(--ink) 50%, #ff4d4d 50%) !important; color: #fff !important; }

/* Mini kalendar (u glavnoj formi) - kompaktna verzija velikog grida. */
.cal-mini .cal-month-title { font-size: 14px; margin-bottom: 8px; }
.cal-mini .cal-grid { gap: 2px; }
.cal-mini .cal-dow { font-size: 10px; padding-bottom: 2px; }
.cal-mini .cal-cell { padding: 4px; font-size: 11px; gap: 0; min-height: 24px; aspect-ratio: 1 / 1; }
.cal-mini .cal-legend { font-size: 11px; margin-top: 6px; }

.plan-title { margin: 0 0 4px; }
.timeline-plan-container { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.card .timeline-plan-container { margin-top: 14px; margin-bottom: 0; }

/* žuta traka-podsjetnik (Inbox → Outbox) */
.plan-notice-banner {
  display: block;
  background: #f6d743;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  margin-bottom: 16px;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.1s, box-shadow 0.1s, background-color 0.12s;
}
.plan-notice-banner:hover { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--ink); background: #f4cd17; }

/* inline promjena datuma u Outboxu */
.plan-date-edit { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.plan-date-edit input[type="date"] { width: auto; }
.plan-card {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 4px 4px 0 var(--ink);
  padding: 16px 18px;
}
.plan-card--done { background: #f6fbf4; }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 15px; }
.plan-opis { margin: 6px 0 0; }
.plan-badge {
  flex: none;
  padding: 3px 9px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: #eef0f3;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.plan-badge--done { background: #1f9d55; color: #fff; }

.action-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.action-bar form { margin: 0; }
.btn-mini {
  width: auto;
  margin: 0;
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 6px;
  box-shadow: 2px 2px 0 var(--ink);
  transition: box-shadow .1s ease, transform .1s ease, background-color .12s;
}
.btn-mini:hover { background: #f3f4f6; box-shadow: 1px 1px 0 var(--ink); transform: translate(1px, 1px); }
.btn-mini-danger { color: #ff4d4d; }
.btn-mini-danger:hover { background: #ffe5e5; }
.btn-generate-small {
  width: auto;
  margin: 0;
  margin-left: auto;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 800;
  border: 2px solid var(--ink);
  border-radius: 6px;
  box-shadow: 2px 2px 0 var(--ink);
  transition: box-shadow .1s ease, transform .1s ease;
}
.btn-generate-small:hover { box-shadow: 1px 1px 0 var(--ink); transform: translate(1px, 1px); }
.plan-edit { margin-top: 12px; padding-top: 12px; border-top: 2px dashed var(--line); }
.plan-edit label { margin-top: 8px; }
.plan-edit button { width: auto; }

/* Neo-brutalistička kartica (radna površina + theme-builder). Globalni .card ostaje mekan. */
.card-brutal {
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

/* Tema/detalji - tvrdi obrub u skladu s ostatkom. */
#tema {
  border: 2px solid var(--ink);
  border-radius: 8px;
}

/* „Prikaži moj profil glasa” - summary kao jasan obrubljen gumb. */
.profile-drawer > summary {
  list-style: none;
  cursor: pointer;
  display: inline-block;
  padding: 10px 16px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 3px 3px 0 var(--ink);
  background: #fff;
  font-weight: 800;
  font-size: 14px;
  color: var(--ink);
}
.profile-drawer > summary:hover { background: #f6d743; }
.profile-drawer[open] > summary { margin-bottom: 16px; box-shadow: 1px 1px 0 var(--ink); transform: translate(2px, 2px); }
.profile-drawer > summary::-webkit-details-marker { display: none; }

/* UX fix: nakon otvaranja „+N” skupine, gumb nestane (ne narušava layout). */
details.chip-more[open] summary { display: none; }

/* --- rezultati: tri mreže --- */

.post {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  background: #fcfdff;
}
.post--instagram { border-left-color: #d6336c; }
.post--facebook  { border-left-color: #1877f2; }
.post--linkedin  { border-left-color: #0a66c2; }

.post-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.post-head h2 { margin: 0; }
.post-head button.copy {
  margin-top: 0;
  width: auto;
  padding: 8px 16px;
  font-size: 13px;
}
textarea.post-text {
  width: 100%;
  margin-top: 10px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.55;
  background: #fff;
  resize: vertical;
}

/* --- ponuđene teme (čipovi) --- */

.chip-group { margin-top: 18px; }
/* Naslovi grupa - čitljiviji (tamniji + tanka crta), da oko lakše skače po grupama. */
.chip-group h3 {
  margin: 0 0 9px;
  font-size: 12px;
  color: var(--heading);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
form.chip-form { margin: 0; display: inline-flex; }
button.chip {
  margin: 0;
  width: auto;
  padding: 8px 15px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
button.chip:hover { background: var(--accent-soft); border-color: #bfd8f7; color: var(--accent-strong); }
button.chip.chip-excl {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
button.chip.chip-excl:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }

details.chip-more summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  background: #eef0f3;
  border: 2px solid var(--line);
  border-radius: 8px;
  display: inline-block;
}
details.chip-more summary:hover { background: #e3e6ea; color: var(--ink); }
details.chip-more summary::-webkit-details-marker { display: none; }
details.chip-more[open] { width: 100%; }
details.chip-more[open] summary { margin-bottom: 8px; }

/* --- povijest: brisanje --- */

form.inline-del { margin: 0; display: inline; }
button.danger {
  margin: 0;
  width: auto;
  padding: 7px 13px;
  font-size: 13px;
  background: #fff;
  color: var(--error);
  border: 1px solid #f0c9c4;
}
button.danger:hover { background: #fdf0ee; }

/* --- kalendar očnih datuma --- */

/* --- widget povoda: lijevo nadolazeći (kartice), desno mjesečni kalendar --- */
.dash-povodi-widget { display: flex; flex-direction: column; gap: 24px; }
@media (min-width: 760px) {
  .dash-povodi-widget { flex-direction: row; align-items: flex-start; }
  .povodi-left, .povodi-right { flex: 1; min-width: 0; }
}
.povodi-left h2 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--heading);
}
.povodi-left h2::before { content: "-"; margin-right: 8px; }

/* kartice nadolazećih povoda */
.cal-list { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.povod-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: background-color .12s ease, box-shadow .12s ease;
}
.povod-card input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.povod-card:has(input:checked) { background: #fdf6d8; box-shadow: 3px 3px 0 var(--ink); }
.povod-head { display: flex; align-items: center; gap: 8px; }
.povod-ic { flex: none; width: 18px; height: 18px; }
.povod-naziv { font-weight: 700; font-size: 14px; }
.povod-badge {
  margin-left: auto;
  padding: 3px 9px;
  border-radius: 6px;
  background: #eef0f3;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.povod-card:has(input:checked) .povod-badge { background: #f6d743; color: var(--ink); }
/* „TRENUTNO” (događaj iz tekućeg mjeseca) - uvijek žuto istaknut */
.povod-badge--now { background: #f6d743; color: var(--ink); }
.povod-btn {
  display: block;
  text-align: center;
  padding: 10px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}
.povod-card:has(input:checked) .povod-btn::after { content: " ✓"; }

/* mjesečni kalendar (desno) */
.cal-month-title {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  font-size: 16px;
  font-weight: 800;
  color: var(--heading);
  margin-bottom: 10px;
}
.cal-nav { text-decoration: none; color: var(--muted); padding: 0 12px; font-weight: 800; transition: color 0.1s; }
.cal-nav:hover { color: var(--ink); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding-bottom: 3px;
}
/* glavni (veliki) kalendar - ~15% kompaktniji (mini ima vlastite, manje vrijednosti) */
.cal-cell {
  aspect-ratio: 1 / 1;
  min-height: 38px;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
}
.cal-empty { visibility: hidden; }
.cal-today { background: var(--ink); color: #fff; border-radius: 4px; }
.cal-povod { background: #f6d743; color: var(--ink); border-radius: 4px; }
.cal-legend { display: flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 12px; }
.cal-key { display: inline-block; width: 14px; height: 14px; border-radius: 4px; }

/* Veliki kalendar (widget): UVIJEK rezerviraj 6 tjedana (zaglavlje + 6 fiksnih redova) da
   prijelaz 5↔6 tjedana NE mijenja visinu widgeta/stranice (nema „skakanja” pri navigaciji).
   Mini kalendar u formi (.cal-mini) ostaje netaknut. */
.povodi-right .cal-grid { grid-template-rows: auto repeat(6, 40px); }
.povodi-right .cal-cell { aspect-ratio: auto; min-height: 0; height: auto; padding: 0; }

/* --- mjesečni limit / potrošnja --- */

p.usage {
  margin: 14px 0 0;
  padding: 9px 13px;
  background: var(--accent-soft);
  border: 1px solid #cfe0fb;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--ink);
}
p.usage.usage-full {
  background: #fdf0ee;
  border-color: #f0c9c4;
  color: var(--error);
}

/* --- baza znanja po brendu i proizvodu (admin) --- */

.kb-brand {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fcfdff;
}
.kb-brand-head { display: flex; align-items: center; gap: 8px; }
.kb-brand-naziv { font-weight: 700; font-size: 15px; }
.kb-form { margin: 12px 0 0; }
.kb-form textarea, .kb-product textarea, .kb-product input[type="text"] {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
  resize: vertical;
}
.kb-form button, .kb-products button {
  margin-top: 8px;
  width: auto;
  padding: 8px 15px;
  font-size: 13px;
}
.kb-products { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.kb-products > label, .kb-form > label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.kb-product {
  margin-top: 10px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kb-product input[type="text"] { font-weight: 600; }
.kb-product-add { border-style: dashed; }
.kb-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-weight: 600;
  font-size: 13px;
}
.kb-check input { width: auto; }
.kb-products form.inline-del { margin: 4px 0 0; }

/* --- admin: editabilan profil + brendovi (UI = izvor istine) --- */
.admin-form { margin-top: 8px; }
.admin-form > label { margin-top: 12px; }
.admin-form .form-row { flex-wrap: wrap; align-items: flex-end; }
.admin-form .two-col > div, .kb-form .two-col > div { flex: 1; min-width: 160px; }
select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
}
select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.kb-brand .inline-del { margin: 8px 0 0; }

/* --- vizualna povratna informacija pri generiranju --- */

.spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 8px;
  border: 2px solid currentColor;      /* prilagodi se boji teksta gumba (bijela/plava) */
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

button.btn-loading { cursor: progress; }

/* dok traje generiranje, ostali gumbi za generiranje su prigušeni i neaktivni */
body.is-generating form[action="/generate"] button[type="submit"] { cursor: progress; }
body.is-generating form[action="/generate"] button[type="submit"]:disabled:not(.btn-loading) {
  opacity: 0.5;
}

/* --- mobilni prikaz --- */

@media (max-width: 640px) {
  .topbar { padding: 10px 16px; }
  .brand { font-size: 17px; }
  .subtitle { font-size: 11px; }
  .brand-logo { width: 34px; height: 34px; }

  .container { margin: 18px auto; padding: 0 12px; }
  .card { padding: 18px 16px; border-radius: 12px; }
  .card + .card { margin-top: 14px; }

  h1 { font-size: 20px; }
  h2 { font-size: 15px; }

  /* zaglavlja kartica se slažu okomito */
  .card-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .card-head button { width: 100%; }

  /* profil: jedan stupac (oznaka iznad vrijednosti) */
  dl.profile { grid-template-columns: 1fr; gap: 2px 0; }
  dl.profile dt { margin-top: 10px; }
  dl.profile dd { margin-bottom: 2px; }

  /* glavni gumbi puni preko širine, lakši za prst */
  .form-row { gap: 8px; }
  .form-row button { width: 100%; }

  /* rezultati: gumb Kopiraj ide ispod naslova, dovoljno velik */
  .post-head { flex-wrap: wrap; }
  .post-head button.copy { width: 100%; padding: 11px 16px; }

  /* kalendar ćelije malo manje na mobitelu */
  .cal-cell { font-size: 13px; }
  .cal-grid { gap: 4px; }

  /* čipovi malo veći za dodir */
  button.chip, details.chip-more summary { padding: 9px 16px; font-size: 13px; }

  /* kvačice mreža i čip-oznake: malo veće za prst, prelamaju se same (flex-wrap) */
  .net-opt { padding: 10px 15px; }
  .chip-check { padding: 10px 15px; font-size: 13px; }

  /* theme-builder: kartice u 2 stupca na mobitelu */
  .tb-cards { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .tb-card { padding: 16px 8px; font-size: 14px; }

  /* tablice: kompaktnije */
  table.grid { font-size: 13px; }
  table.grid th, table.grid td { padding: 9px 6px; }

  .login-card { margin: 4vh auto 0; }
}

/* Klijentska administracija: tablica se pomice unutar kartice na uskom zaslonu. */
.table-scroll { max-width:100%; overflow-x:auto; }
.admin-form .two-col > div { min-width:0; }

.login-intro { max-width: 40rem; margin: 1.5rem auto 2rem; text-align: center; }
.login-industries { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.login-industries li { font-size: .9rem; }
.login-industries span { display: block; font-size: 1.35rem; margin-bottom: .25rem; }
.publish-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem 1.25rem; }
.publish-actions form { margin: .5rem 0; }
.publish-actions small { display: block; margin-top: .25rem; }
.account-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; padding: .75rem 0; border-bottom: 1px solid #dbe2ee; }
.publish-check { display: flex; align-items: baseline; gap: .4rem; }
.publish-check input[type="checkbox"] { width: auto; flex: none; }
.publish-network { padding: .5rem 0 1rem; }
.table-scroll { overflow-x: auto; }
.publication-preview { display: block; max-width: 100%; max-height: 65vh; }
.publication-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.legal-page { max-width: 48rem; margin-inline: auto; }
.legal-page h2 { margin-top: 1.75rem; }
@media (max-width: 520px) {
  .login-industries { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
