/* Ridgeline — shared patterns: nav, photos, rails, tabs, chips, forms, sticky bars */

/* App bar */
.nav { position: sticky; top: 0; z-index: 4; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; padding: 12px 0 10px; background: var(--bg); margin: 0 calc(var(--pad) * -1); padding-left: var(--pad); padding-right: var(--pad); }
.nav--flat { background: transparent; position: relative; }
.nav__sp { width: 44px; }
.nav__t { min-width: 0; }
.nav__h { font-size: 24px; font-weight: 650; letter-spacing: -.035em; line-height: 1.1; }
.nav__t .eyebrow { margin-bottom: 2px; }
.nav__r { display: flex; gap: 8px; align-items: center; min-width: 44px; justify-content: flex-end; }
.nav:has(.nav__sp) { grid-template-columns: 0 1fr auto; gap: 0; }
.nav:has(.nav__sp) .nav__sp { width: 0; }

.sec { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: var(--s7) 0 var(--s3); }
.sec .h2 { font-size: 20px; }
.link { font-weight: 600; font-size: 14px; color: var(--accent-text); display: inline-flex; align-items: center; gap: 2px; min-height: 32px; }

/* Photos */
.photo { width: 100%; height: 100%; object-fit: cover; display: block; background: var(--bg-2); transition: opacity .3s; }
.ph { position: relative; overflow: hidden; border-radius: var(--r-l); background: var(--bg-2); }
.ph--16x9 { aspect-ratio: 16 / 9; } .ph--4x3 { aspect-ratio: 4 / 3; } .ph--1x1 { aspect-ratio: 1; } .ph--3x4 { aspect-ratio: 3 / 4; }
.avatar { display: inline-block; flex: none; border-radius: 50%; overflow: hidden; background: var(--bg-2); box-shadow: 0 0 0 2px var(--bg); }
.avatar--mono { display: inline-grid; place-items: center; font-weight: 650; background: var(--pine-soft); color: var(--pine-text); }
.hero-card { position: relative; overflow: hidden; border-radius: var(--r-xl); color: #fff; isolation: isolate; background: #111; display: block; }
.hero-card > .photo { position: absolute; inset: 0; z-index: -2; }
.hero-card::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(8,8,8,.12) 20%, rgba(8,8,8,.78) 100%); }
.hero-card__in { padding: var(--s5); display: flex; flex-direction: column; justify-content: flex-end; min-height: 240px; gap: 6px; }
.hero-card .eyebrow { color: rgba(255,255,255,.82); }
.hero-card .chip { background: rgba(255,255,255,.2); color: #fff; box-shadow: none; }

/* Rails */
.rail { scroll-padding: 0 var(--pad); display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 calc(var(--pad) * -1); padding: 2px var(--pad) 6px; }
.rail > * { flex: none; scroll-snap-align: start; }
.tile { width: 220px; display: grid; gap: 10px; text-align: left; }
.tile .ph { aspect-ratio: 4 / 3; }
.tile__t { font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
.tile__s { font-size: 13px; color: var(--ink-3); }

/* Sub tabs */
.subtabs { display: flex; gap: 4px; overflow-x: auto; margin: 0 calc(var(--pad) * -1); padding: 4px var(--pad) 10px; position: sticky; top: 66px; z-index: 3; background: var(--bg); }
.subtab { flex: none; min-height: 40px; padding: 0 16px; border-radius: 999px; font-weight: 600; font-size: 14.5px; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2); transition: background-color .15s, color .15s; }
.subtab[aria-current="page"] { background: var(--ink); color: var(--bg); box-shadow: none; }

/* Selectable chips / option cards */
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { min-height: 44px; padding: 0 16px; border-radius: 999px; font-weight: 520; font-size: 15px; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); display: inline-flex; align-items: center; gap: 8px; transition: all .15s var(--ease); }
.opt[aria-pressed="true"] { background: var(--ink); color: var(--bg); box-shadow: none; }
.choice { display: grid; gap: 4px; text-align: left; padding: 16px; border-radius: var(--r-l); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); width: 100%; transition: box-shadow .15s; position: relative; }
.choice[aria-pressed="true"], .choice[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--ink); }
.choice[aria-pressed="true"]::after, .choice[aria-checked="true"]::after { content: ""; position: absolute; right: 14px; top: 14px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 14px no-repeat; }
:root[data-theme="dark"] .choice[aria-pressed="true"]::after, :root[data-theme="dark"] .choice[aria-checked="true"]::after { background-color: var(--accent); }

/* Forms extras */
.input--center { text-align: center; }
.textarea { min-height: 96px; padding: 14px 16px; resize: none; line-height: 1.45; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 20px; padding-right: 44px; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 36px; background: transparent; }
input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 8px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); margin-top: -10px; box-shadow: 0 2px 6px rgba(0,0,0,.3); border: 3px solid var(--bg); }
input[type="range"]::-moz-range-track { height: 8px; border-radius: 8px; background: var(--bg-2); }
input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); border: 3px solid var(--bg); }
.stepper { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; gap: 8px; }
.stepper .iconbtn { width: 56px; height: 56px; }
.stepper__v { text-align: center; }
.big-input { width: 100%; text-align: center; background: transparent; border: 0; font-size: 64px; font-weight: 650; letter-spacing: -.05em; font-variant-numeric: tabular-nums; padding: 0; color: var(--ink); }
.big-input:focus { outline: none; }

/* Sticky action bar */
.sticky-cta { position: sticky; bottom: 0; margin: var(--s6) calc(var(--pad) * -1) 0; padding: 12px var(--pad) calc(14px + env(safe-area-inset-bottom)); background: var(--bg); box-shadow: 0 -1px 0 var(--line); display: grid; gap: 8px; z-index: 5; }

/* KV */
.kv { display: grid; gap: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; }
.kv > div + div { box-shadow: inset 0 1px 0 var(--line); }
.kv dt { color: var(--ink-3); font-size: 14px; }
.kv dd { margin: 0; font-weight: 600; text-align: right; }

.stack > *, .grid2 > *, .split > * { min-width: 0; }
.rail { max-width: calc(100% + var(--pad) * 2); }

.card--inv .kv dt { color: var(--inv-ink-2); } .card--inv .kv dd { color: var(--inv-ink); } .card--inv .kv > div + div { box-shadow: inset 0 1px 0 var(--inv-line); }

/* Misc */
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3.5px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.busy .busy__box { position: relative; display: grid; justify-items: center; gap: 14px; padding: 28px 34px; border-radius: 24px; background: var(--bg); box-shadow: var(--shadow-2); animation: pop .25s var(--ease) both; }
.dots { display: flex; gap: 6px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); transition: all .25s var(--ease); }
.dots i.on { width: 24px; border-radius: 6px; background: var(--ink); }
.spark { color: var(--accent); }
.pill-n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 650; }
.badge-dot { position: absolute; top: 10px; right: 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }
.relative { position: relative; }
.center { text-align: center; }
.ph-grad::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.6)); }
.card--tap { display: block; transition: transform .15s var(--ease); }
.card--tap:active { transform: scale(.985); }
.tabs-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 650; }
.tab .tabs-count { position: absolute; top: 4px; left: calc(50% + 6px); margin: 0; }

/* contrast + tap-target fixes */
.card--inv .unit { color: var(--inv-ink-2); }
.card--accent .eyebrow, .card--pine .eyebrow { color: var(--ink-2); }
.wel .fine a { display: inline-block; padding: 12px 4px; margin: -12px 0; }

/* selected choice keeps its tick clear of right-aligned content */
.choice[aria-pressed="true"], .choice[aria-checked="true"] { padding-right: 48px; }
.pkg__b .h3 { line-height: 1.25; }
