/* Tòquio 2026 — washi & sumi. Tokens primer, components després. */
:root {
  --bg: #f6f1e7;
  --bg-2: #efe7d8;
  --surface: #fffdf8;
  --surface-2: #f8f3ea;
  --ink: #1d1a17;
  --ink-2: #4a443c;
  --ink-3: #7a7266;
  --line: rgba(29, 26, 23, 0.1);
  --line-2: rgba(29, 26, 23, 0.18);
  --shu: #d6402b;          /* vermelló torii */
  --shu-ink: #ffffff;
  --shu-soft: rgba(214, 64, 43, 0.1);
  --ai: #1f3b6e;           /* indi */
  --matcha: #4f7a3a;
  --gold: #b48a2c;
  --ok: #2f7d4f;
  --warn: #b7791f;
  --bad: #c0392b;
  --shadow-1: 0 1px 2px rgba(40, 30, 20, 0.06), 0 2px 8px rgba(40, 30, 20, 0.05);
  --shadow-2: 0 2px 6px rgba(40, 30, 20, 0.07), 0 12px 32px rgba(40, 30, 20, 0.1);
  --radius: 18px;
  --radius-s: 12px;
  --gutter: 16px;
  --nav-h: 68px;
  --font-display: 'Shippori Mincho B1', 'Hiragino Mincho ProN', Georgia, serif;
  --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --img-outline: rgba(0, 0, 0, 0.1);
  --paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.28 0 0 0 0 0.2 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115; --bg-2: #151821; --surface: #181b24; --surface-2: #1e222d;
    --ink: #f1ece2; --ink-2: #c9c2b6; --ink-3: #8d8678;
    --line: rgba(241, 236, 226, 0.09); --line-2: rgba(241, 236, 226, 0.16);
    --shu: #ff5a43; --shu-soft: rgba(255, 90, 67, 0.14); --ai: #8fb0ff; --matcha: #8fc06f; --gold: #e2b85a;
    --ok: #5ccf8a; --warn: #f0b44c; --bad: #ff6b5b;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow-2: 0 8px 30px rgba(0, 0, 0, 0.45);
    --img-outline: rgba(255, 255, 255, 0.1);
    --paper-grain: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1115; --bg-2: #151821; --surface: #181b24; --surface-2: #1e222d;
  --ink: #f1ece2; --ink-2: #c9c2b6; --ink-3: #8d8678;
  --line: rgba(241, 236, 226, 0.09); --line-2: rgba(241, 236, 226, 0.16);
  --shu: #ff5a43; --shu-soft: rgba(255, 90, 67, 0.14); --ai: #8fb0ff; --matcha: #8fc06f; --gold: #e2b85a;
  --ok: #5ccf8a; --warn: #f0b44c; --bad: #ff6b5b;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow-2: 0 8px 30px rgba(0, 0, 0, 0.45);
  --img-outline: rgba(255, 255, 255, 0.1);
  --paper-grain: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); background-image: var(--paper-grain); color: var(--ink);
  font: 15px/1.55 var(--font-body); min-height: 100dvh; overflow-x: hidden;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  transition: background-color 250ms ease;
}
a { color: inherit; }
img, video { display: block; max-width: 100%; }
img { outline: 1px solid var(--img-outline); outline-offset: -1px; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
p { margin: 0; text-wrap: pretty; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--shu); outline-offset: 2px; border-radius: 6px; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ───── App bar ───── */
.appbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) var(--gutter) 10px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand-seal {
  width: 36px; height: 36px; border-radius: 10px; background: var(--shu); color: #fff; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 18px; font-weight: 800; box-shadow: inset 0 0 0 2px rgba(255,255,255,.25);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-text strong { font-family: var(--font-display); font-size: 18px; }
.brand-text small { color: var(--ink-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-actions { margin-left: auto; display: flex; gap: 6px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; transition-property: transform, background-color, border-color; transition-duration: 150ms;
}
.icon-btn:hover { border-color: var(--line-2); }
.icon-btn:active { transform: scale(0.94); }

/* ───── Bottom nav (mòbil) / sidebar (escriptori) ───── */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 40; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5); border-top: 1px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none;
  color: var(--ink-3); font-size: 11px; font-weight: 600; letter-spacing: 0.01em; transition: color 150ms ease;
}
.tab .icon { width: 23px; height: 23px; }
.tab[aria-current="page"] { color: var(--shu); }
.tab-add { position: relative; }
.tab-add .add-orb {
  width: 50px; height: 50px; margin-top: -22px; border-radius: 16px; background: var(--shu); color: #fff; display: grid; place-items: center;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--shu) 45%, transparent); transition: transform 150ms ease;
}
.tab-add:active .add-orb { transform: scale(0.94); }
.tab-add .add-orb .icon { width: 26px; height: 26px; stroke-width: 2.2; }

main { max-width: 1120px; margin: 0 auto; padding: 18px var(--gutter) 32px; }
.view { animation: enter 260ms ease-out both; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }
@media (prefers-reduced-motion: reduce) { .view { animation: none; } * { transition-duration: 0ms !important; } }

/* ───── Tipografia de secció ───── */
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.eyebrow::before { content: ""; width: 14px; height: 2px; background: var(--shu); border-radius: 2px; }
.section { margin-top: 30px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 22px; margin-top: 4px; }
.link-more { font-size: 13px; font-weight: 700; color: var(--shu); text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; padding: 8px 0; }
.page-title { font-size: clamp(28px, 7vw, 40px); margin: 6px 0 6px; }
.page-sub { color: var(--ink-2); max-width: 60ch; }

/* ───── Hero ───── */
.hero {
  position: relative; overflow: hidden; border-radius: 24px; padding: 22px 20px 20px; color: #fff; isolation: isolate;
  background: radial-gradient(120% 90% at 100% 0%, #e2553f 0%, #b7301f 45%, #6d1a12 100%);
  box-shadow: var(--shadow-2);
}
[data-theme="dark"] .hero, :root:not([data-theme="light"]) .hero { --x: 0; }
.hero::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 236, 200, 0.4), rgba(255, 236, 200, 0) 70%); z-index: -1;
}
.hero-kanji { position: absolute; right: 16px; bottom: -18px; font-family: var(--font-display); font-size: 120px; font-weight: 800; line-height: 1; opacity: 0.13; z-index: -1; letter-spacing: -0.04em; }
.hero .eyebrow { color: rgba(255,255,255,.75); }
.hero .eyebrow::before { background: #fff; }
.hero h1 { font-size: clamp(30px, 8vw, 46px); margin-top: 8px; }
.hero p { color: rgba(255,255,255,.88); margin-top: 6px; max-width: 46ch; }
.hero-stats { display: flex; gap: 22px; margin-top: 18px; flex-wrap: wrap; }
.hero-stat strong { display: block; font-family: var(--font-display); font-size: 30px; line-height: 1; }
.hero-stat span { font-size: 12px; color: rgba(255,255,255,.75); }
.hero-cta { margin-top: 18px; display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--surface); text-decoration: none; font-weight: 700; font-size: 14px; cursor: pointer;
  transition-property: transform, background-color, border-color, box-shadow, opacity; transition-duration: 150ms; transition-timing-function: ease-out;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn-primary { background: var(--shu); border-color: transparent; color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--shu) 35%, transparent); }
.btn-ghost-light { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.28); color: #fff; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }

/* ───── Targetes base ───── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.grid-3 { grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* ───── Bitllet d'avió ───── */
.ticket { overflow: hidden; }
.ticket-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 10px; }
.ticket-head h3 { font-size: 17px; }
.ticket-date { color: var(--ink-3); font-size: 13px; }
.leg { padding: 12px 16px 14px; border-top: 1px dashed var(--line-2); position: relative; }
.leg-route { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.leg-iata { font-family: var(--font-display); font-size: 30px; font-weight: 800; line-height: 1; letter-spacing: 0.02em; }
.leg-time { font-size: 15px; font-weight: 700; margin-top: 4px; }
.leg-place { font-size: 12px; color: var(--ink-3); }
.leg-end { text-align: right; }
.leg-mid { display: flex; flex-direction: column; align-items: center; color: var(--ink-3); font-size: 11.5px; gap: 2px; min-width: 76px; }
.leg-mid .plane-line { width: 100%; height: 1px; background: repeating-linear-gradient(90deg, var(--line-2) 0 4px, transparent 4px 8px); position: relative; margin: 6px 0; }
.leg-mid .plane-line .icon { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 16px; height: 16px; background: var(--surface); color: var(--shu); padding: 0 2px; box-sizing: content-box; }
.leg-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap;
}
.chip .icon { width: 14px; height: 14px; }
.chip-ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.chip-warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); border-color: color-mix(in srgb, var(--warn) 28%, transparent); }
.chip-bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.chip-gate { background: var(--ink); color: var(--bg); border-color: transparent; }
.layover { margin: 0 16px; padding: 8px 12px; border-radius: 10px; background: var(--shu-soft); color: var(--ink-2); font-size: 12.5px; display: flex; gap: 8px; align-items: center; }
.layover .icon { color: var(--shu); width: 16px; height: 16px; }
.ticket-notch { position: relative; }
.monitor-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; color: var(--ink-3); font-size: 12.5px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; margin-right: 6px; box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: pulse 2s infinite; }
.live-dot.off { background: var(--ink-3); animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.spin .icon { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fare-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.fare-table td { padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.fare-table td:first-child { color: var(--ink-3); width: 42%; }

/* ───── Hotels ───── */
.hotel { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.hotel-top { display: flex; gap: 12px; align-items: flex-start; }
.hotel-dates { flex: none; width: 58px; text-align: center; border-radius: 12px; background: var(--shu-soft); color: var(--shu); padding: 8px 0; }
.hotel-dates strong { display: block; font-family: var(--font-display); font-size: 22px; line-height: 1; }
.hotel-dates span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.hotel h3 { font-size: 18px; }
.hotel-city { color: var(--ink-3); font-size: 13px; }
.hotel-addr { font-size: 13px; color: var(--ink-2); }
.stations { display: flex; flex-direction: column; gap: 8px; }
.station { display: flex; align-items: center; gap: 10px; font-size: 14px; flex-wrap: wrap; }
.station-name { font-weight: 700; }
.station-walk { color: var(--ink-3); font-size: 12.5px; margin-left: auto; }
.line-badge { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 800; border: 3px solid currentColor; background: var(--surface); padding: 0 3px; }
.line-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.line-chip i { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--c); background: var(--surface); display: inline-grid; place-items: center; font-style: normal; font-size: 9px; font-weight: 800; color: var(--c); }

/* ───── Com arribar-hi ───── */
.howto { display: flex; flex-direction: column; gap: 0; }
.howto-step { display: grid; grid-template-columns: 36px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.howto-step:first-child { border-top: 0; }
.howto-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.howto-ico .icon { width: 18px; height: 18px; }
.howto-step strong { display: block; font-size: 14px; }
.howto-step p { font-size: 14px; color: var(--ink-2); }

/* ───── Dies (hanko) ───── */
.day-card { display: grid; grid-template-columns: 62px 1fr auto; gap: 14px; align-items: center; padding: 14px; text-decoration: none; transition-property: transform, box-shadow, border-color; transition-duration: 160ms; }
.day-card:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); }
.day-card:active { transform: scale(0.99); }
.hanko {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; text-align: center; color: var(--c, var(--shu));
  border: 2.5px solid currentColor; position: relative; transform: rotate(-6deg); font-family: var(--font-display); line-height: 1;
}
.hanko::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; border: 1px solid currentColor; opacity: 0.45; }
.hanko strong { font-size: 22px; display: block; }
.hanko span { font-size: 9.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-family: var(--font-body); }
.day-card h3 { font-size: 16.5px; }
.day-card p { font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.day-card .count { font-size: 12px; font-weight: 700; color: var(--ink-3); }
.day-card.is-today { border-color: var(--shu); box-shadow: 0 0 0 3px var(--shu-soft); }
.travel-day { display: grid; grid-template-columns: 62px 1fr; gap: 14px; align-items: center; padding: 12px 14px; border-radius: var(--radius); border: 1px dashed var(--line-2); color: var(--ink-2); font-size: 14px; }
.travel-day .hanko { width: 46px; height: 46px; margin: 0 auto; }
.travel-day .hanko strong { font-size: 17px; }

/* ───── Timeline del dia ───── */
.day-hero { padding: 18px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 12px; position: relative; overflow: hidden; }
.day-hero::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--c, var(--shu)); }
.timeline { position: relative; display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.timeline::before { content: ""; position: absolute; left: 17px; top: 18px; bottom: 18px; width: 2px; background: repeating-linear-gradient(var(--line-2) 0 6px, transparent 6px 11px); }
.tl-item { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; }
.tl-num { width: 36px; height: 36px; border-radius: 50%; background: var(--c, var(--shu)); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; position: relative; z-index: 1; box-shadow: 0 0 0 4px var(--bg); }
.near-link { font-size: 12px; color: var(--ink-3); margin: -4px 0 0 48px; display: flex; align-items: center; gap: 6px; }
.near-link .icon { width: 14px; height: 14px; }

/* ───── Fitxes de lloc ───── */
.place { display: flex; flex-direction: column; overflow: hidden; text-decoration: none; transition-property: transform, box-shadow, border-color; transition-duration: 160ms; cursor: pointer; text-align: left; padding: 0; width: 100%; }
.place:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); }
.place:active { transform: scale(0.99); }
.place-media { aspect-ratio: 16 / 9; position: relative; background: var(--bg-2); overflow: hidden; }
.place-media img { width: 100%; height: 100%; object-fit: cover; outline: none; transition: transform 400ms ease; }
.place:hover .place-media img { transform: scale(1.03); }
.place-media .play { position: absolute; left: 12px; bottom: 12px; height: 30px; padding: 0 10px 0 8px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; backdrop-filter: blur(6px); }
.place-media .play .icon { width: 15px; height: 15px; fill: currentColor; stroke: none; }
.place-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.place-kicker { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.cat-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.place h3 { font-size: 17px; }
.place p { font-size: 14px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.place-foot { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.badge-new { background: var(--ai); color: #fff; border-color: transparent; }
.place.compact { flex-direction: row; align-items: stretch; }
.place.compact .place-media { aspect-ratio: auto; width: 96px; min-height: 96px; flex: none; }
.place.compact .place-media img { position: absolute; inset: 0; }
.place.compact .place-body { padding: 12px 14px; }
.place.compact h3 { font-size: 15.5px; }
.place.compact p { -webkit-line-clamp: 2; font-size: 13px; }

/* ───── Categories ───── */
.cats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 720px) { .cats { grid-template-columns: repeat(5, 1fr); } }
.cat-tile { padding: 14px; text-decoration: none; display: flex; flex-direction: column; gap: 10px; min-height: 112px; transition-property: transform, box-shadow; transition-duration: 160ms; position: relative; overflow: hidden; }
.cat-tile:hover { box-shadow: var(--shadow-2); }
.cat-tile:active { transform: scale(0.98); }
.cat-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); }
.cat-ico .icon { width: 22px; height: 22px; }
.cat-tile strong { font-size: 15.5px; }
.cat-tile small { color: var(--ink-3); font-size: 12px; line-height: 1.35; }
.cat-tile .cat-count { position: absolute; top: 14px; right: 14px; font-size: 12px; font-weight: 800; color: var(--ink-3); }

/* ───── Filtres / cerca ───── */
.toolbar { display: flex; gap: 8px; overflow-x: auto; padding: 4px var(--gutter) 10px; margin: 12px calc(var(--gutter) * -1) 4px; scrollbar-width: none; scroll-snap-type: x proximity; }
.toolbar::-webkit-scrollbar { display: none; }
.filter { flex: none; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 13px; font-weight: 700; cursor: pointer; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; scroll-snap-align: start; text-decoration: none; transition-property: background-color, color, border-color; transition-duration: 150ms; }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.search { position: relative; display: block; margin-top: 14px; }
.search input { width: 100%; height: 48px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); padding: 0 14px 0 44px; font: inherit; color: var(--ink); }
.search input::placeholder { color: var(--ink-3); }
.search .icon { position: absolute; left: 14px; top: 14px; color: var(--ink-3); }

/* ───── Detall (full / sheet) ───── */
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(15, 12, 10, 0.45); backdrop-filter: blur(3px); opacity: 0; transition: opacity 200ms ease; }
.sheet-backdrop.open { opacity: 1; }
.sheet {
  position: fixed; z-index: 61; left: 0; right: 0; bottom: 0; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 24px 24px 0 0; box-shadow: var(--shadow-2); transform: translateY(100%);
  transition: transform 280ms cubic-bezier(.2,.8,.2,1); padding-bottom: env(safe-area-inset-bottom);
}
.sheet.open { transform: none; }
@media (min-width: 820px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: min(720px, 92vw); max-height: 88vh; border-radius: 24px; transform: translate(-50%, -46%) scale(.98); opacity: 0; transition-property: transform, opacity; }
  .sheet.open { transform: translate(-50%, -50%); opacity: 1; }
}
.sheet-grip { width: 42px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 10px auto 0; }
.sheet-close { position: absolute; top: 22px; right: 26px; z-index: 3; background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: blur(8px); }
.sheet-media { margin: 12px 16px 0; border-radius: 16px; overflow: hidden; background: #000; }
.sheet-media video { width: 100%; max-height: 62dvh; background: #000; }
.sheet-media img { width: 100%; max-height: 62dvh; object-fit: contain; outline: none; }
.sheet-body { padding: 16px 18px 26px; display: flex; flex-direction: column; gap: 16px; }
.sheet-body h2 { font-size: 25px; }
.lead { font-size: 16px; color: var(--ink-2); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fact { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; }
.fact small { display: block; color: var(--ink-3); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.block-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); margin-bottom: 6px; }
.prose { color: var(--ink-2); font-size: 15px; white-space: pre-line; }
.tips { margin: 0; padding-left: 18px; color: var(--ink-2); }
.tips li { margin: 4px 0; }
.media-strip { display: flex; gap: 8px; overflow-x: auto; }
.media-strip button { flex: none; width: 74px; height: 110px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; background: var(--bg-2); }
.media-strip button[aria-pressed="true"] { border-color: var(--shu); }
.media-strip img { width: 100%; height: 100%; object-fit: cover; }
.admin-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.admin-row select { height: 36px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); padding: 0 8px; font: inherit; font-size: 13px; }

/* ───── Mapa ───── */
.map-wrap { position: relative; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-1); background: var(--bg-2); }
.map { height: calc(100dvh - 250px); min-height: 380px; }
.map.mini { height: 260px; min-height: 0; }
.leaflet-container { font: inherit; background: var(--bg-2); }
.map-dark .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.88) saturate(0.6); }
.pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: var(--c); border: 2.5px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.3); display: grid; place-items: center; }
.pin b { transform: rotate(45deg); color: #fff; font-size: 12px; font-weight: 800; }
.pin-hotel { background: #1d1a17; border-color: #ff5a43; }
.leaflet-popup-content-wrapper { border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); }
.leaflet-popup-tip { background: var(--surface); }
.leaflet-popup-content { margin: 12px 14px; font-size: 13.5px; }
.popup-title { font-weight: 800; font-size: 14.5px; margin-bottom: 2px; }
.popup-actions { display: flex; gap: 10px; margin-top: 8px; }
.popup-actions a, .popup-actions button { color: var(--shu); font-weight: 700; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; font-size: 13px; }
.map-legend { position: absolute; z-index: 500; left: 10px; right: 10px; top: 10px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.map-legend .filter { box-shadow: var(--shadow-1); }

/* ───── Afegir ───── */
.composer { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.field label { display: block; font-size: 13px; font-weight: 800; margin-bottom: 6px; }
.field textarea, .field input[type="url"], .field input[type="password"] {
  width: 100%; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); font: inherit; padding: 12px 14px;
}
.field textarea { min-height: 120px; resize: vertical; }
.drop { border: 1.5px dashed var(--line-2); border-radius: 14px; padding: 16px; display: flex; align-items: center; gap: 12px; cursor: pointer; color: var(--ink-2); font-size: 14px; background: var(--surface-2); }
.drop.drag { border-color: var(--shu); background: var(--shu-soft); }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb { position: relative; width: 72px; height: 72px; border-radius: 12px; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.thumb button .icon { width: 14px; height: 14px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); gap: 4px; }
.segmented button { height: 44px; border-radius: 10px; border: 0; background: transparent; font-weight: 700; font-size: 13.5px; cursor: pointer; color: var(--ink-3); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; transition-property: background-color, color, box-shadow; transition-duration: 150ms; }
.segmented button small { font-size: 11px; font-weight: 600; opacity: .8; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.joblog { font-size: 13.5px; display: flex; flex-direction: column; gap: 6px; }
.joblog li { display: flex; gap: 8px; align-items: flex-start; color: var(--ink-2); }
.joblog li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ai); margin-top: 7px; flex: none; }
.joblog li.err::before { background: var(--bad); }
.joblog { list-style: none; padding: 0; margin: 0; }
.engine-pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 999px; background: color-mix(in srgb, var(--ai) 12%, transparent); color: var(--ai); font-size: 12px; font-weight: 800; border: 0; cursor: pointer; }

/* ───── Install banner / toast ───── */
.install {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom)); z-index: 50; padding: 12px 12px 12px 14px;
  display: flex; align-items: center; gap: 12px; border-radius: 18px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-2);
  animation: enter 300ms ease-out both; max-width: 520px; margin: 0 auto;
}
.install img { width: 42px; height: 42px; border-radius: 10px; outline: none; }
.install p { font-size: 13.5px; line-height: 1.35; flex: 1; }
.install p strong { display: block; font-size: 14.5px; }
.install .btn { background: var(--shu); color: #fff; border: 0; }
.install .x { background: none; border: 0; color: inherit; opacity: .6; width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer; }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); translate: -50% 0; z-index: 70; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-2); animation: enter 200ms ease-out both; max-width: calc(100vw - 32px); }

.empty { padding: 28px; text-align: center; color: var(--ink-3); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.skeleton { height: 120px; border-radius: var(--radius); background: linear-gradient(90deg, var(--bg-2), var(--surface-2), var(--bg-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ───── Escriptori: barra lateral ───── */
@media (min-width: 1000px) {
  body { padding-bottom: 0; padding-left: 92px; }
  .tabbar { inset: 0 auto 0 0; width: 92px; height: auto; grid-template-columns: 1fr; grid-auto-rows: 78px; align-content: center; border-top: 0; border-right: 1px solid var(--line); padding: 0; }
  .tab-add { order: 99; }
  .tab-add .add-orb { margin-top: 0; }
  .install, .toast { bottom: 20px; }
  main { padding-top: 28px; }
  .map { height: calc(100dvh - 210px); }
}
