/* «Портфель» (portfolio.js). Tokens only, except a destination's own accent
   (--pf-accent, from destinations.accent) - the same color it has in the catalogue. */

#portfolio-root { --pf-sold: var(--blue); --pf-free: var(--elevated); }

.pf-skeleton { display: grid; gap: 14px; }
.pf-skeleton i { display: block; height: 96px; border-radius: var(--r-lg); background: linear-gradient(90deg, var(--elevated), var(--surface), var(--elevated)); background-size: 200% 100%; animation: pf-shine 1.2s linear infinite; }
@keyframes pf-shine { to { background-position: -200% 0; } }
.pf-empty { padding: 28px; text-align: center; color: var(--subtle); }
.pf-dim { color: var(--subtle); }
.pf-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.pf-h h3 { margin: 0; font-family: var(--font-display); font-size: 15px; font-weight: 600; }

/* Scope line + way back to the dashboard */
.pf-scope { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -6px 0 12px; font-size: 13px; color: var(--subtle); }
.pf-dash-link { all: unset; cursor: pointer; color: var(--accent-ink); font-weight: 500; }
.pf-dash-link:hover { text-decoration: underline; }

/* KPI strip */
.pf-kpis { display: grid; grid-template-columns: 1.5fr repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.pf-kpis:has(> :nth-child(3):last-child) { grid-template-columns: 1.5fr 1fr 1fr; }
.pf-kpi { background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--sh-card); min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pf-kpi-l { font-size: 12px; color: var(--subtle); font-weight: 500; }
.pf-kpi-v { font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 1.05; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pf-kpi-v small { font-size: 18px; color: var(--subtle); font-weight: 600; }
.pf-kpi-sub { font-size: 12.5px; color: var(--subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-kpi-sub.link { color: var(--accent-ink); cursor: pointer; text-decoration: none; }
.pf-kpi-sub.link:hover { text-decoration: underline; }
.pf-kpi-sub b.pos, .pf-m.pos { color: var(--green); }
.pf-kpi-sub b.neg, .pf-m.neg { color: var(--red); }
.pf-kpi-fill { background: linear-gradient(135deg, var(--blue-weak), var(--surface) 70%); }
.pf-kpi-air .pf-kpi-v { color: var(--subtle); }

.pf-meter { height: 10px; border-radius: 99px; background: var(--pf-free); overflow: hidden; }
.pf-meter.sm { height: 6px; }
.pf-meter i { display: block; height: 100%; border-radius: inherit; background: var(--pf-sold); transform-origin: left; animation: pf-grow .7s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes pf-grow { from { transform: scaleX(0); } }

/* Season + attention */
.pf-mid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); gap: 12px; margin-bottom: 18px; }
.pf-mid .panel { margin: 0; padding: 16px 18px; }
.pf-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--subtle); }
.pf-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 6px; }
.pf-legend i.sold { background: var(--pf-sold); }
.pf-legend i.free { background: var(--blue-weak); }
.pf-months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; height: 168px; }
.pf-mo { all: unset; box-sizing: border-box; display: grid; grid-template-rows: 16px 1fr 18px 14px; justify-items: center; gap: 4px; cursor: pointer; border-radius: var(--r-sm); padding: 4px 0; transition: background .15s; }
.pf-mo:hover:not([disabled]) { background: var(--elevated); }
.pf-mo.on { background: var(--blue-weak); }
.pf-mo[disabled] { cursor: default; }
.pf-mo-n { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.pf-mo-bar { width: 100%; max-width: 34px; height: 100%; display: flex; align-items: flex-end; }
.pf-mo-seats { position: relative; width: 100%; border-radius: 6px; background: var(--blue-weak); display: flex; align-items: flex-end; overflow: hidden; animation: pf-rise .6s cubic-bezier(.2, .8, .2, 1) both; transform-origin: bottom; }
.pf-mo-seats i { display: block; width: 100%; background: var(--pf-sold); min-height: 0; }
.pf-mo.empty .pf-mo-bar::after { content: ""; width: 100%; height: 3px; border-radius: 3px; background: var(--divider); }
@keyframes pf-rise { from { transform: scaleY(0); } }
.pf-mo-l { font-size: 12px; color: var(--ink-2, var(--ink)); font-weight: 500; white-space: nowrap; }
.pf-mo-l em { font-style: normal; font-size: 10px; color: var(--subtle); margin-left: 2px; vertical-align: super; }
.pf-mo-d { font-size: 10.5px; color: var(--subtle); font-variant-numeric: tabular-nums; }

.pf-att-list { display: flex; flex-direction: column; gap: 6px; }
.pf-att { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-md); background: var(--elevated); cursor: pointer; font-size: 13.5px; transition: transform .12s, background .15s; }
.pf-att:hover { transform: translateX(2px); }
.pf-att.on { background: var(--accent-weak); }
.pf-att-i { font-size: 16px; width: 20px; text-align: center; }
.pf-att-t { flex: 1; }
.pf-att b { font-family: var(--font-display); font-size: 15px; font-variant-numeric: tabular-nums; }
.pf-att-ok { padding: 18px 0; color: var(--green); font-weight: 600; text-align: center; }

/* Toolbar */
.pf-toolbar > * { min-width: 0; max-width: 100%; }
.pf-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.pf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-chip { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-pill); border: 1px solid var(--stroke); background: var(--surface); font-size: 13px; font-weight: 500; transition: background .15s, color .15s; }
.pf-chip span { font-size: 11.5px; color: var(--subtle); font-variant-numeric: tabular-nums; }
.pf-chip:hover:not([disabled]) { background: var(--elevated); }
.pf-chip.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.pf-chip.on span { color: inherit; opacity: .7; }
.pf-chip[disabled] { opacity: .4; cursor: default; }
.pf-tools { display: flex; align-items: center; gap: 8px; }
.pf-search { height: 34px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--field-border); background: var(--surface); font: inherit; font-size: 13px; width: 180px; color: var(--ink); }
.pf-seg { display: inline-flex; background: var(--elevated); border-radius: var(--r-pill); padding: 3px; }
.pf-seg button { all: unset; cursor: pointer; padding: 5px 11px; border-radius: var(--r-pill); font-size: 12.5px; color: var(--subtle); font-weight: 500; white-space: nowrap; }
.pf-seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--sh-card); }

.pf-active { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.pf-active-month { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: var(--r-pill); background: var(--blue-weak); color: var(--blue); font-size: 13px; font-weight: 600; }
.pf-active-month button { all: unset; cursor: pointer; width: 20px; height: 20px; border-radius: 50%; text-align: center; line-height: 20px; }
.pf-active-month button:hover { background: var(--surface); }
.pf-reset { all: unset; cursor: pointer; color: var(--accent-ink); font-size: 13px; font-weight: 500; margin-left: 8px; }
.pf-reset:hover { text-decoration: underline; }

/* Destination card */
.pf-dest { background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--r-lg); box-shadow: var(--sh-card); margin-bottom: 14px; overflow: hidden; animation: pf-in .35s ease both; }
@keyframes pf-in { from { opacity: 0; transform: translateY(6px); } }
.pf-dest-h { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px 14px 22px; color: #fff; min-height: 64px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--pf-accent) 92%, #000) 0%, color-mix(in srgb, var(--pf-accent) 55%, transparent) 70%, transparent), var(--pf-cover, none) center / cover, var(--pf-accent); }
.pf-dest-h::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .28), rgba(0, 0, 0, .05)); pointer-events: none; }
.pf-dest-h > * { position: relative; }
.pf-dest-t { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.pf-dest-t h3 { margin: 0; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 21px; letter-spacing: -0.01em; text-shadow: 0 1px 8px rgba(0, 0, 0, .25); }
.pf-dest-t span { font-size: 12px; opacity: .85; }
.pf-dest-s { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pf-dest-s span { font-size: 12.5px; padding: 4px 10px; border-radius: var(--r-pill); background: rgba(0, 0, 0, .28); backdrop-filter: blur(6px); white-space: nowrap; }
.pf-dest-s b { font-weight: 700; }

/* Program rows */
.pf-row { position: relative; display: grid; grid-template-columns: minmax(200px, 2.2fr) 112px minmax(220px, 3fr) 150px 130px 14px; align-items: center; gap: 16px; padding: 12px 18px 12px 22px; border-top: 1px solid var(--divider); cursor: pointer; transition: background .12s; }
.pf-row.no-money { grid-template-columns: minmax(200px, 2.2fr) 112px minmax(220px, 3fr) 150px 14px; }
.pf-row:first-child { border-top: 0; }
.pf-row::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--pf-accent); opacity: 0; transition: opacity .15s; }
.pf-row:hover { background: var(--elevated); }
.pf-row:hover::before { opacity: 1; }
.pf-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pf-row.off .pf-name strong { color: var(--subtle); }
.pf-c { min-width: 0; }
.pf-name { display: flex; flex-direction: column; gap: 3px; }
.pf-name strong { font-weight: 600; font-size: 14.5px; line-height: 1.25; }
.pf-name-link { color: inherit; text-decoration: none; }
.pf-name-link:hover strong { color: var(--accent-ink); }
.pf-meta { font-size: 12px; color: var(--subtle); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.pf-flag { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: var(--r-pill); white-space: nowrap; }
.pf-flag.red { background: var(--red-weak); color: var(--red); }
.pf-flag.amber { background: var(--amber-weak); color: var(--amber); }
.pf-flag.muted { background: var(--elevated); color: var(--subtle); }
.pf-price b { font-family: var(--font-display); font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.pf-deps { display: flex; flex-wrap: nowrap; gap: 5px; overflow: hidden; }
.pf-dep { flex: none; }
.pf-dep { all: unset; box-sizing: border-box; cursor: pointer; position: relative; overflow: hidden; display: inline-flex; flex-direction: column; align-items: flex-start; gap: 0; padding: 3px 8px 4px; border-radius: 8px; min-width: 58px; border: 1px solid var(--stroke);
  background: linear-gradient(90deg, var(--blue-weak) var(--f), var(--surface) var(--f)); transition: transform .12s, box-shadow .12s; }
.pf-dep:hover { transform: translateY(-1px); box-shadow: 0 4px 12px -6px rgba(16, 20, 36, .35); }
.pf-dep span { font-size: 12px; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.pf-dep em { font-style: normal; font-size: 10.5px; color: var(--subtle); font-variant-numeric: tabular-nums; line-height: 1.2; }
.pf-dep.tone-full { background: linear-gradient(90deg, var(--green-weak) var(--f), var(--surface) var(--f)); border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.pf-dep.tone-full em { color: var(--green); }
.pf-dep.hot { border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.pf-dep.hot em { color: var(--red); }
.pf-more, .pf-nodeps { align-self: center; font-size: 12px; color: var(--subtle); padding: 0 4px; }

.pf-fill { display: flex; flex-direction: column; gap: 5px; }
.pf-fill span { font-size: 12px; color: var(--subtle); font-variant-numeric: tabular-nums; }
.pf-fill b { color: var(--ink); font-weight: 600; }
.pf-fill.tone-full .pf-meter i { background: var(--green); }
.pf-fill.tone-zero span b { color: var(--subtle); }

.pf-money { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.pf-money b { font-family: var(--font-display); font-weight: 600; font-size: 15px; white-space: nowrap; }
.pf-m { font-size: 11.5px; color: var(--subtle); }
.pf-go { color: var(--subtle); font-size: 20px; line-height: 1; transition: transform .15s, color .15s; }
.pf-row:hover .pf-go { transform: translateX(3px); color: var(--accent-ink); }

/* Archive */
.pf-arch { margin-top: 6px; }
.pf-arch-h { all: unset; cursor: pointer; font-size: 13px; color: var(--subtle); padding: 8px 4px; }
.pf-arch-h b { margin-left: 4px; color: var(--ink); }
.pf-arch-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0 12px; }
.pf-arch-item { all: unset; cursor: pointer; font-size: 13px; padding: 6px 12px; border-radius: var(--r-pill); background: var(--surface); border: 1px dashed var(--field-border); color: var(--ink); }
.pf-arch-item span { color: var(--subtle); margin-left: 6px; font-size: 12px; }
.pf-arch-item:hover { background: var(--elevated); }

@media (max-width: 1280px) {
  .pf-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pf-row { grid-template-columns: minmax(180px, 2fr) 100px minmax(180px, 2.4fr) 130px 120px 14px; gap: 12px; }
  .pf-row.no-money { grid-template-columns: minmax(180px, 2fr) 100px minmax(180px, 2.4fr) 130px 14px; }
}
@media (max-width: 1100px) {
  .pf-mid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .pf-meter i, .pf-mo-seats, .pf-dest, .pf-skeleton i { animation: none; }
}
