/* Formulari de publicació. Pensat primer per al mòbil: botons grans, una columna, barra fixa a baix. */

.publica { max-width: 720px; padding-bottom: 120px; }
.publica h1 { margin: var(--s2) 0 var(--s1); font-size: clamp(24px, 5vw, 30px); letter-spacing: -.5px; }
.lead { margin: 0 0 var(--s4); color: var(--muted); }
.notice { margin: 0 0 var(--s4); padding: var(--s3) var(--s4); border-radius: var(--r-m); background: var(--soft); border: 1px solid var(--line); }

.steps { position: sticky; top: 64px; z-index: 10; display: flex; gap: var(--s2); margin: 0 calc(-1 * var(--s2)) var(--s4); padding: var(--s2); background: var(--bg); overflow-x: auto; scrollbar-width: none; }
.steps a { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 40px; padding: 0 var(--s3); border: 1px solid var(--border); border-radius: var(--r-full); color: var(--ink); font-size: 14px; text-decoration: none; }
.steps b { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--chip); font-size: 12px; }
.steps a[data-done] { border-color: var(--price-ink); }
.steps a[data-done] b { background: var(--price-bg); color: var(--price-ink); }
.steps a[data-missing] { border-color: var(--danger-ink); }

.step { margin-bottom: var(--s4); padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); scroll-margin-top: 130px; }
.step > h2, .step > summary h2 { margin: 0 0 var(--s3); font-size: 18px; }
.step > summary { cursor: pointer; list-style-position: outside; margin-left: var(--s4); }
.step > summary h2 { display: inline; }
.step:not([open]) > summary h2 { margin: 0; }
.step[open] > summary { margin-bottom: var(--s3); }
.step h2 small, .input small, .group-label small { font-weight: 400; font-size: 13px; color: var(--muted); }

.input { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s4); font-size: 13px; font-weight: 600; }
.input input, .input select, .input textarea { width: 100%; min-height: 48px; padding: 0 var(--s3); border: 1px solid var(--border); border-radius: var(--r-m); background: var(--bg); color: var(--ink); font: inherit; font-size: 16px; font-weight: 400; }
.input textarea { padding: var(--s3); resize: vertical; line-height: 1.5; }
.input input:focus, .input select:focus, .input textarea:focus { outline: 0; border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.input [aria-invalid='true'] { border-color: var(--danger-ink); }
.combo { position: relative; }
/* Sempre sota el camp, també al mòbil (al cercador, en canvi, les llistes s'obren com a full inferior). */
.combo .popover { position: absolute; left: 0; right: 0; top: 100%; bottom: auto; z-index: 30; min-width: 0; max-width: none; max-height: 280px; overflow-y: auto; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.row2.narrow { max-width: 320px; }
.hint { margin: calc(-1 * var(--s2)) 0 var(--s4); font-size: 13px; color: var(--muted); }
.hint:empty { display: none; }

.group { margin-bottom: var(--s4); }
.group-label { display: block; margin-bottom: var(--s2); font-size: 13px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s4); }
.group .chips { margin-bottom: 0; }
.chips button, .segments button { min-height: 44px; padding: 0 var(--s4); border: 1px solid var(--border); border-radius: var(--r-full); background: var(--surface); color: var(--ink); font-size: 14px; }
.chips button:hover, .segments button:hover, .tiles button:hover { border-color: var(--ink); }
.chips button[aria-pressed='true'], .segments button[aria-pressed='true'] { background: var(--selected-bg); border-color: var(--selected-bg); color: var(--selected-ink); font-weight: 600; }
.segments { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); margin-bottom: var(--s4); }
.segments button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 68px; padding: var(--s2); border-radius: var(--r-m); font-weight: 600; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: var(--s2); }
.tiles button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 84px; padding: var(--s2); border: 1px solid var(--line); border-radius: var(--r-m); background: var(--hue-bg, var(--chip)); color: var(--hue-ink, var(--ink)); font-size: 12.5px; font-weight: 600; line-height: 1.2; text-align: center; }
.tiles button[aria-pressed='true'] { outline: 3px solid var(--ink); outline-offset: 1px; }
.tiles[data-chosen] button:not([aria-pressed='true']) { opacity: .7; }
.tiles button[data-hue='purple'] { --hue-bg: var(--hue-purple-bg); --hue-ink: var(--hue-purple-ink); }
.tiles button[data-hue='red'] { --hue-bg: var(--hue-red-bg); --hue-ink: var(--hue-red-ink); }
.tiles button[data-hue='yellow'] { --hue-bg: var(--hue-yellow-bg); --hue-ink: var(--hue-yellow-ink); }
.tiles button[data-hue='orange'] { --hue-bg: var(--hue-orange-bg); --hue-ink: var(--hue-orange-ink); }
.tiles button[data-hue='green'] { --hue-bg: var(--hue-green-bg); --hue-ink: var(--hue-green-ink); }
.tiles button[data-hue='blue'] { --hue-bg: var(--hue-blue-bg); --hue-ink: var(--hue-blue-ink); }
.tiles button[data-hue='teal'] { --hue-bg: var(--hue-teal-bg); --hue-ink: var(--hue-teal-ink); }

.reuse { margin-bottom: var(--s4); }
.reuse > summary, .duplicate > summary { cursor: pointer; font-size: 14px; color: var(--muted); }
.reuse .chips { margin: var(--s3) 0 0; }
.errors { margin-bottom: var(--s4); padding: var(--s3) var(--s4); border-radius: var(--r-m); background: var(--danger-bg); color: var(--danger-ink); }
.errors p { margin: 0 0 var(--s2); font-weight: 600; }
.errors a { display: block; padding: 4px 0; color: inherit; }
/* L'avís de duplicat és discret: una línia que es desplega. */
.duplicate { margin-bottom: var(--s4); font-size: 14px; }
.duplicate p { margin: var(--s2) 0 0; color: var(--muted); }

.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; border-top: 1px solid var(--line); background: var(--bg); padding-bottom: env(safe-area-inset-bottom); }
.bar-inner { max-width: 720px; margin: 0 auto; padding: var(--s3) var(--s5); display: flex; align-items: center; gap: var(--s3); }
.bar-summary { flex: 1; min-width: 0; margin: 0; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .button { min-width: 132px; min-height: 48px; font-size: 16px; }
.bar .button[disabled] { opacity: .6; }

.done { padding: var(--s5); border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); }
.done h2 { margin: 0 0 var(--s2); font-size: 22px; }
.done p { margin: 0 0 var(--s4); color: var(--muted); }
.done .row { display: flex; flex-wrap: wrap; gap: var(--s2); }

@media (max-width: 560px) {
  .steps { top: 56px; }
  .step { padding: var(--s4) var(--s3); margin-left: calc(-1 * var(--s2)); margin-right: calc(-1 * var(--s2)); }
  .bar-inner { padding: var(--s3) var(--s4); }
  .tiles { grid-template-columns: repeat(3, 1fr); }
}

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.image-box { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); }
.image-box .hint { margin: 0; }
.image-box img { width: 96px; height: 96px; object-fit: cover; border-radius: var(--r-m); border: 1px solid var(--line); }
.image-box input:focus-visible + .hint, .image-box label:focus-within { outline: 3px solid var(--link); }
button.plain { padding: var(--s2) 0; border: 0; background: none; color: var(--link); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.point-box { margin-bottom: var(--s4); }
.point-box > summary { cursor: pointer; font-size: 14px; font-weight: 600; }
.point-box > summary small { font-weight: 400; color: var(--muted); }
.point-box .hint { margin: var(--s2) 0; }
.point-box .map.small { height: 280px; min-height: 0; cursor: crosshair; }

/* Les meves activitats */
.mine-group { margin-bottom: var(--s5); }
.mine-group h2 { margin: 0 0 var(--s2); font-size: 16px; }
.mine-group h2 small { font-weight: 400; color: var(--muted); }
.mine-group .hint { margin: 0 0 var(--s3); }
.mine { display: flex; gap: var(--s3); padding: var(--s3) 0; border-top: 1px solid var(--line); }
.mine .thumb { flex: 0 0 56px; height: 56px; }
.mine-body { flex: 1; min-width: 0; }
.mine-body strong { display: block; overflow-wrap: anywhere; }
.mine-body small { color: var(--muted); }
.mine-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-top: var(--s2); }
.mine-actions .button { min-height: 40px; padding: 0 var(--s3); font-size: 14px; }
.button.danger { border-color: var(--danger-ink); color: var(--danger-ink); }
.confirm { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s2); font-size: 14px; }
.mine-note { margin: var(--s1) 0 0; font-size: 13px; color: var(--danger-ink); }
.mine-note:empty { display: none; }

/* Una imatge que no s'ha pogut fer servir s'ha de veure: si no, es publica sense i ningú se n'adona. */
.hint.error { display: block; margin-top: var(--s2); padding: var(--s2) var(--s3); border-radius: var(--r-s); background: var(--danger-bg); color: var(--danger-ink); font-weight: 600; }

/* Més dates d'una mateixa activitat */
.more-dates-box { margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--line); }
.more-row { align-items: end; grid-template-columns: 1fr 1fr auto; }
.more-row .plain { min-height: var(--touch); margin-bottom: var(--s4); }
.more-dates-box .hint { margin: var(--s2) 0 0; }
