/* Accessories (page key "accessories": /equipment/accessories/), the counter. Ported from the site concept v3
   (parts/pages/accessories.css): a navy head with jump chips and the crew-list hook, a sticky side index beside the
   numbered groups (A01 to A16) laid out the way a crew orders, and a kit close that shows the live crew list.
   Task page: .rv only on the thumbnail tiles; no survey line. Prefix acc-.
   Port notes: [data-view="accessories"] becomes body.page-accessories; sticky offsets add the admin bar (--wp-bar);
   item names that have a page of their own link to it. */
.page-accessories [hidden] { display: none !important; }

/* ---------- Head: jump chips on navy, the crew-list hook ---------- */
.acc-head-aside { display: grid; gap: 22px; justify-items: start; padding-bottom: 4px; }
.acc-jump { gap: 10px; }
.acc-jump .chip-btn { background: rgba(255, 255, 255, 0.04); border-color: rgba(238, 242, 248, 0.24); color: var(--on-brand); touch-action: manipulation; }
.acc-jump .chip-btn:hover { background: rgba(255, 255, 255, 0.08); border-color: #FFFFFF; }
.acc-jump .chip-btn .n { background: rgba(245, 130, 32, 0.16); color: var(--accent-hi); font-variant-numeric: tabular-nums; }
.acc-hook { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-items: center; max-width: 30em; padding-top: 20px; border-top: 1px solid rgba(238, 242, 248, 0.14); font-size: 15.5px; line-height: 1.5; color: var(--on-brand); }
.acc-hook-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(245, 130, 32, 0.14); color: var(--accent); }
.acc-hook-ico svg { width: 20px; height: 20px; }

/* ---------- Layout: sticky side index beside the groups ---------- */
.acc-main { padding-top: clamp(48px, 5.5vw, 80px); }
.acc-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 0 clamp(32px, 4.5vw, 64px); align-items: start; }
.acc-side { position: sticky; top: calc(104px + var(--wp-bar)); }
.acc-index { position: static; }
.acc-index-label { margin-bottom: 12px; font: 500 12px/1 var(--font-sub); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.acc-index a { min-height: 44px; touch-action: manipulation; }
.acc-ix { font: 500 13px/1 var(--font-sub); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.acc-index a.is-on .acc-ix { color: var(--accent-ink); }
.acc-index small { font-variant-numeric: tabular-nums; }
.acc-note { margin-top: 26px; padding: 18px 18px 6px; border-radius: var(--radius-lg); background: var(--tint); font-size: 14.5px; line-height: 1.55; color: var(--muted); }
.acc-note b { font-weight: 600; color: var(--ink); }
.acc-note > p:last-child { padding-bottom: 12px; }
.acc-wa { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font: 500 14.5px/1 var(--font-sub); color: var(--brand); touch-action: manipulation; }
.acc-wa svg { width: 18px; height: 18px; color: #1E9E57; }
.acc-wa .arr { color: var(--accent-ink); }
.acc-empty-counter { padding: 22px 24px; border-radius: var(--radius-lg); border: 1px dashed var(--line); color: var(--muted); }

/* ---------- Groups ---------- */
.acc-group + .acc-group { margin-top: clamp(56px, 6vw, 88px); }
.acc-ghead { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.acc-ghead h2 { display: flex; align-items: baseline; gap: 14px; font-size: clamp(1.6rem, 2.3vw, 2.05rem); letter-spacing: -0.015em; line-height: 1.1; }
.acc-gno { font: 500 14px/1 var(--font-sub); letter-spacing: 0.06em; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.acc-ghead p { margin-top: 10px; max-width: 40em; font-size: 16px; line-height: 1.55; color: var(--muted); }
.acc-list { padding-top: 6px; }

/* ---------- Rows: number, tile, name + tagline, chips, actions ---------- */
.acc-row { position: relative; display: grid; grid-template-columns: 44px 84px minmax(0, 1.05fr) minmax(0, 1fr) 168px; grid-template-areas: "no tile info specs act"; column-gap: 20px; align-items: center; margin-inline: -16px; padding: 14px 16px; border-radius: var(--radius-lg); transition: background-color var(--t-fast) var(--ease), box-shadow var(--t-med) var(--ease); }
.acc-row + .acc-row::before { content: ""; position: absolute; left: 16px; right: 16px; top: 0; height: 1px; background: var(--line); transition: opacity var(--t-fast) var(--ease); }
.acc-no { grid-area: no; font: 500 14px/1 var(--font-sub); letter-spacing: 0.06em; color: var(--accent-ink); font-variant-numeric: tabular-nums; }

.acc-tile { grid-area: tile; position: relative; width: 84px; aspect-ratio: 1; border-radius: var(--radius); background: radial-gradient(75% 70% at 50% 55%, #FFFFFF 0%, var(--tint) 100%); border: 1px solid var(--line); overflow: hidden; }
.acc-tile img { position: absolute; inset: 0; margin: auto; width: 88%; height: 88%; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(11, 31, 58, 0.14)); transition: transform var(--t-med) var(--ease); }
/* No photo on file: the item number as a survey-target tile, never a stand-in picture */
.acc-tile.is-num { display: grid; place-items: center; background: var(--surface); }
.acc-rings { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: var(--line); stroke-width: 1.2; transition: transform var(--t-med) var(--ease); }
.acc-tile.is-num span { position: relative; font: 600 19px/1 var(--font-display); letter-spacing: -0.01em; color: var(--brand); font-variant-numeric: tabular-nums; }

.acc-info { grid-area: info; min-width: 0; }
.acc-info h3 { font-size: 18.5px; line-height: 1.25; letter-spacing: -0.005em; }
.acc-info h3 a { background-image: linear-gradient(var(--accent), var(--accent)); background-size: 0 2px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size 250ms var(--ease); }
.acc-info h3 a:hover { background-size: 100% 2px; }
/* A 24px+ target: inline padding grows the hit box without moving the line; the underline stays on the content box */
.acc-info h3 a { padding-block: 2px; background-origin: content-box; }
.acc-info > p { margin-top: 5px; font-size: 15px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.acc-more { display: flex; flex-wrap: wrap; gap: 0 18px; margin-top: 2px; }
.acc-more a { min-height: 44px; touch-action: manipulation; }
.acc-link { display: inline-flex; align-items: center; gap: 6px; font: 500 14px/1 var(--font-sub); color: var(--brand); }
.acc-link .arr { color: var(--accent-ink); }

.acc-specs { grid-area: specs; min-width: 0; }
.acc-specs .chips { margin-top: 0; }
.acc-pick { margin-bottom: 8px; font: 500 11.5px/1 var(--font-sub); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.acc-vars { display: flex; flex-wrap: wrap; gap: 6px; }
.acc-var.chip-btn { gap: 6px; min-height: 44px; padding: 8px 14px; font-size: 13.5px; line-height: 1.25; text-align: left; touch-action: manipulation; }
.acc-var svg { display: none; flex: none; width: 15px; height: 15px; color: var(--accent); }
.acc-var[aria-pressed="true"] { padding-left: 11px; }
.acc-var[aria-pressed="true"] svg { display: block; }

.acc-act { grid-area: act; display: grid; justify-items: start; }
.acc-add { display: inline-flex; align-items: center; gap: 8px; min-width: 156px; min-height: 44px; padding: 10px 18px 10px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font: 500 14.5px/1 var(--font-sub); color: var(--brand); white-space: nowrap; touch-action: manipulation; transition: transform var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.acc-add span { display: inline-flex; }
.acc-add svg { width: 18px; height: 18px; color: var(--accent-ink); }
.acc-add:hover { border-color: var(--muted); transform: translateY(-2px); box-shadow: 0 8px 18px rgba(11, 31, 58, 0.1); }
.acc-add:active { transform: translateY(0); box-shadow: none; }
.acc-add:focus-visible, .acc-var:focus-visible, .acc-jump .chip-btn:focus-visible { border-radius: 999px; }
.acc-add .i-on, .acc-add .t-on { display: none; }
.acc-add[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #FFFFFF; }
.acc-add[aria-pressed="true"] svg { color: var(--accent); }
.acc-add[aria-pressed="true"] .i-add, .acc-add[aria-pressed="true"] .t-add { display: none; }
.acc-add[aria-pressed="true"] .i-on, .acc-add[aria-pressed="true"] .t-on { display: inline-flex; }
.motion .acc-add[aria-pressed="true"] .i-on svg { animation: acc-pop var(--t-med) var(--ease); }
@keyframes acc-pop { from { opacity: 0; transform: scale(0.5); } to { opacity: 1; transform: none; } }
.acc-act .pcta { min-height: 44px; padding: 0 0 0 15px; touch-action: manipulation; }

/* Row states: hover tint and image scale (pointer only), a quiet wash when the item is on the list, a ring on arrival */
@media (hover: hover) {
  .acc-row:hover { background: var(--tint); }
  .acc-row:hover::before, .acc-row:hover + .acc-row::before { opacity: 0; }
  .acc-row:hover .chips li { background: var(--surface); }
  .acc-row:hover .acc-tile img, .acc-row:hover .acc-rings { transform: scale(1.06); }
}
.acc-row.is-listed { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.acc-row.is-listed::before, .acc-row.is-listed + .acc-row::before { opacity: 0; }
.acc-row.is-listed .chips li { background: var(--surface); }
@media (hover: hover) { .acc-row.is-listed:hover { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); } }
.acc-row.is-target { animation: acc-ring 1600ms var(--ease); }
@keyframes acc-ring { 0%, 45% { box-shadow: inset 0 0 0 2px var(--accent); } 100% { box-shadow: inset 0 0 0 2px rgba(245, 130, 32, 0); } }

/* ---------- Kit close: the live crew list ---------- */
.acc-kit-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr); gap: 40px clamp(40px, 6vw, 96px); align-items: center; }
.acc-kit h2 { margin-top: 16px; font-size: clamp(2rem, 3.4vw, 2.9rem); letter-spacing: -0.02em; }
.acc-kit-lede { margin-top: 18px; max-width: 32em; font-size: 17.5px; line-height: 1.6; color: var(--muted); }
.acc-kit .cta-actions { margin-top: 30px; }
.acc-kit-go:hover .arr { transform: translateX(4px); }

.acc-card { padding: 26px 26px 20px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-card); }
.acc-card:focus { outline: none; }
.acc-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.acc-card-head h3 { font-size: 21px; letter-spacing: -0.01em; }
.acc-card-n { font: 500 13px/1 var(--font-sub); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.acc-cl { max-height: 22.5rem; overflow-y: auto; overscroll-behavior: contain; }
.acc-cl li { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.acc-cl li:last-child { border-bottom: 0; }
.motion .acc-cl li.is-new { animation: acc-in var(--t-med) var(--ease); }
@keyframes acc-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.acc-cl-no { font: 500 13.5px/1 var(--font-sub); letter-spacing: 0.06em; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.acc-cl-name { font-size: 15.5px; line-height: 1.35; color: var(--ink); }
.acc-cl-name small { display: block; margin-top: 2px; font-size: 13.5px; color: var(--muted); }
.acc-rm { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--muted); touch-action: manipulation; transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.acc-rm svg { width: 16px; height: 16px; }
.acc-rm:hover { background: var(--tint); color: var(--ink); }
.acc-rm:focus-visible { border-radius: 50%; }
.acc-card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.acc-clear { min-height: 44px; padding: 0 4px; font-size: 14px; color: var(--muted); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; touch-action: manipulation; transition: color var(--t-fast) var(--ease), text-decoration-color var(--t-fast) var(--ease); }
.acc-clear:hover { color: var(--ink); text-decoration-color: var(--accent); }
.acc-empty { display: grid; justify-items: start; padding: 26px 0 6px; }
.acc-empty-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius); background: var(--tint); color: var(--brand); }
.acc-empty-ico svg { width: 22px; height: 22px; }
.acc-empty-t { margin-top: 16px; font: 600 18px/1.25 var(--font-display); color: var(--ink); }
.acc-empty-p { margin-top: 6px; max-width: 28em; font-size: 15px; line-height: 1.55; color: var(--muted); }
.acc-empty .pcta { margin-top: 8px; min-height: 44px; }

/* ---------- Responsive ---------- */
@media (max-width: 1260px) {
  /* The chips move under the name; number, tile and actions span both lines, top-aligned with the name */
  .acc-row { grid-template-columns: 40px 80px minmax(0, 1fr) 168px; grid-template-areas: "no tile info act" "no tile specs act"; column-gap: 18px; align-items: start; }
  .acc-no { padding-top: 5px; }
  .acc-tile { width: 80px; }
  .acc-specs { margin-top: 10px; }
}
@media (max-width: 900px) {
  /* The side index becomes a sticky chip row under the nav; the note follows it */
  .acc-layout { display: block; }
  .acc-side { display: contents; }
  .acc-index { position: sticky; top: calc(72px + var(--wp-bar)); z-index: 20; display: flex; align-items: center; gap: 8px; margin-inline: calc(-1 * var(--gutter)); padding: 10px var(--gutter); overflow-x: auto; scrollbar-width: none; background: rgba(255, 255, 255, 0.92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-block: 1px solid var(--line); }
  .acc-index::-webkit-scrollbar { display: none; }
  .acc-index-label { flex: none; margin: 0 4px 0 0; white-space: nowrap; }
  .acc-index a { display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font: 500 14px/1 var(--font-sub); color: var(--ink); white-space: nowrap; }
  .acc-index a:hover { border-color: var(--muted); }
  .acc-index a.is-on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
  .acc-index a.is-on .acc-ix { color: var(--accent-hi); }
  .acc-index a.is-on small { color: var(--on-brand-muted); }
  .acc-index a:focus-visible { border-radius: 999px; outline-offset: -3px; }
  .acc-note { margin: 18px 0 40px; display: flex; flex-wrap: wrap; align-items: center; column-gap: 16px; padding: 14px 16px 4px; }
  .acc-note > p:last-child { padding-bottom: 10px; }
  .acc-kit-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .acc-head-aside { gap: 18px; }
  .acc-row { grid-template-columns: 72px minmax(0, 1fr); grid-template-areas: "tile no" "tile info" "specs specs" "act act"; column-gap: 14px; align-items: start; margin-inline: -10px; padding: 16px 10px; }
  .acc-row + .acc-row::before { left: 10px; right: 10px; }
  .acc-tile { width: 72px; }
  .acc-no { align-self: end; padding-top: 0; font-size: 13px; }
  .acc-info { margin-top: 6px; }
  .acc-info h3 { font-size: 17.5px; }
  .acc-specs { margin-top: 14px; }
  .acc-act { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 14px; }
  .acc-act .pcta { padding-left: 4px; }
  .acc-card { padding: 22px 18px 16px; }
}
