/* =====================================================================
   FILE: assets/css/rk-ios.css
   Rawrkee "iPhone app" style kit (29 Nov 2026, 11.29.26.6).
   The look of the 360° Studio sheet, as plain reusable classes.
   Reference with copy-paste markup: README-IOS-STYLE.md

   Use:  put class="rk-ios" on any wrapper. Everything inside can use the
         rk-ios-* classes. Light and dark follow html.dark like the rest
         of the site.
   Rules of the look:
     - Spacing groups things, not borders. The only containers are grey
       rows (--ios-fill) and rounded photos.
     - One big bold title + one plain line per screen.
     - Red only for the ONE thing the person must do on that screen.
       Everything else is grey (.rk-ios-btn) or ink (.is-ink).
     - Touch targets 44px or more. Muted text uses --ios-muted (passes 4.5:1).
   ===================================================================== */

.rk-ios {
    --ios-fill: #f2f2f7;          /* grey rows, buttons, tracks          */
    --ios-tile: #ebebf0;          /* empty photo tiles                   */
    --ios-sq: #ffffff;            /* icon square inside a grey row       */
    --ios-ink: #111111;           /* main text, ink buttons, bars        */
    --ios-ink-fg: #ffffff;        /* text on ink                         */
    --ios-muted: #5b6170;         /* secondary text (4.5:1 on white/grey) */
    --ios-track: #e5e7eb;         /* empty ring, hairlines               */
    --ios-seg-on: #ffffff;        /* selected segment                    */
    --ios-green: #34c759;         /* done ticks, live dot                */
    --ios-amber: #f59e0b;         /* paused / needs a look               */
    --ios-red: #e11d48;           /* the ONE action                      */
    --ios-red-hover: #be123c;
    --ios-r-sm: 10px;
    --ios-r: 12px;
    --ios-r-btn: 14px;
    --ios-r-row: 16px;
    --ios-r-hero: 20px;
    color: var(--ios-ink);
    font-feature-settings: "tnum" 0;
}

html.dark .rk-ios {
    --ios-fill: rgba(255, 255, 255, .08);
    --ios-tile: rgba(255, 255, 255, .1);
    --ios-sq: rgba(255, 255, 255, .1);
    --ios-ink: #f4f4f5;
    --ios-ink-fg: #0b0b0d;
    --ios-muted: #a1a1aa;
    --ios-track: rgba(255, 255, 255, .14);
    --ios-seg-on: #3a3a3c;
    --ios-green: #30d158;
}

.rk-ios *,
.rk-ios *::before,
.rk-ios *::after {
    box-sizing: border-box;
}

@keyframes rkIosKitSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- 1. Header: [left] [centered title] [right] ---------- */
.rk-ios-grabber {
    display: block;
    width: 36px;
    height: 5px;
    margin: 8px auto 6px;
    border-radius: 999px;
    background: var(--ios-track);
}

.rk-ios-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    column-gap: 8px;
    min-height: 48px;
}

.rk-ios-header > :first-child {
    justify-self: start;
}

.rk-ios-header > :last-child {
    justify-self: end;
    display: flex;
    gap: 8px;
}

.rk-ios-header-title {
    min-width: 0;
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Round 32px grey icon button (close, back, open, share) */
.rk-ios-iconbtn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--ios-fill);
    color: var(--ios-ink);
    cursor: pointer;
    text-decoration: none;
}

.rk-ios-iconbtn.is-muted {
    color: var(--ios-muted);
}

/* Invisible 44px tap area around the 32px circle */
.rk-ios-iconbtn::after {
    content: "";
    position: absolute;
    inset: -6px;
}

.rk-ios-iconbtn svg {
    width: 14px;
    height: 14px;
}

/* ---------- 2. Segmented control ---------- */
.rk-ios-seg {
    display: flex;
    gap: 2px;
    padding: 2px;
    border-radius: var(--ios-r-sm);
    background: var(--ios-fill);
}

.rk-ios-seg > button,
.rk-ios-seg > a {
    flex: 1 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ios-muted);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.rk-ios-seg > [aria-selected="true"],
.rk-ios-seg > [aria-pressed="true"],
.rk-ios-seg > [aria-current="page"],
.rk-ios-seg > .is-active {
    background: var(--ios-seg-on);
    color: var(--ios-ink);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}

/* ---------- 3. Type ---------- */
.rk-ios-h1 {
    margin: 0 0 4px;
    font-size: 28px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -.025em;
    color: var(--ios-ink);
}

.rk-ios-sub {
    margin: 0;
    font-size: 15px;
    line-height: 1.45;
    color: var(--ios-muted);
}

.rk-ios-section {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin: 24px 0 10px;
}

.rk-ios-section > h3,
.rk-ios-section > h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--ios-ink);
}

.rk-ios-section > span,
.rk-ios-section > a {
    font-size: 13px;
    color: var(--ios-muted);
    text-decoration: none;
}

.rk-ios-meta {
    font-size: 13px;
    color: var(--ios-muted);
}

/* ---------- 4. Hero photo + status chip ---------- */
.rk-ios-hero {
    position: relative;
    height: 196px;
    border-radius: var(--ios-r-hero);
    overflow: hidden;
    background: var(--ios-fill);
}

.rk-ios-hero.is-tall {
    height: 230px;
}

.rk-ios-hero > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 62%;
}

.rk-ios-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .9);
    color: #111111;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.rk-ios-hero > .rk-ios-chip {
    position: absolute;
    left: 12px;
    bottom: 12px;
}

.rk-ios-chip > i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ios-green, #34c759);
}

.rk-ios-chip.is-warn > i {
    background: var(--ios-amber);
}

.rk-ios-chip.is-off > i {
    background: #9ca3af;
}

/* Dark chip, for text over a photo's middle (e.g. "Drag to look around") */
.rk-ios-chip.is-dark {
    background: rgba(0, 0, 0, .55);
    color: #ffffff;
    font-weight: 600;
}

/* ---------- 5. Progress bar + the line under it ---------- */
.rk-ios-progress {
    height: 6px;
    border-radius: 999px;
    background: var(--ios-fill);
    overflow: hidden;
}

.rk-ios-progress > i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: var(--ios-ink);
    transition: width .4s ease;
}

.rk-ios-progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
    font-size: 13px;
    color: var(--ios-muted);
}

/* ---------- 6. Step checklist ---------- */
.rk-ios-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rk-ios-steps > li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    color: var(--ios-muted);
}

.rk-ios-steps > li > i {
    position: relative;
    flex: none;
    width: 24px;
    height: 24px;
    border: 2px solid var(--ios-track);
    border-radius: 50%;
}

.rk-ios-steps > li > em {
    margin-left: auto;
    font-style: normal;
    font-size: 13px;
    font-weight: 600;
    color: var(--ios-muted);
}

.rk-ios-steps > li.is-done,
.rk-ios-steps > li.is-now,
.rk-ios-steps > li.is-you {
    color: var(--ios-ink);
}

.rk-ios-steps > li.is-now,
.rk-ios-steps > li.is-you {
    font-weight: 700;
}

.rk-ios-steps > li.is-done > i {
    border: 0;
    background: var(--ios-green);
}

.rk-ios-steps > li.is-done > i::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 12px;
    height: 12px;
    background: #ffffff;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Working on it: spinner */
.rk-ios-steps > li.is-now > i {
    border-top-color: var(--ios-ink);
    animation: rkIosKitSpin .9s linear infinite;
}

/* Waiting on the person: ink ring with a dot */
.rk-ios-steps > li.is-you > i {
    border-color: var(--ios-ink);
}

.rk-ios-steps > li.is-you > i::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ios-ink);
}

@media (prefers-reduced-motion: reduce) {
    .rk-ios-steps > li.is-now > i {
        animation: none;
        border-color: var(--ios-ink);
    }

    .rk-ios-spinner {
        animation: none;
    }
}

/* Spinner on its own */
.rk-ios-spinner {
    display: inline-block;
    flex: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--ios-track);
    border-top-color: var(--ios-ink);
    border-radius: 50%;
    animation: rkIosKitSpin .9s linear infinite;
}

/* ---------- 7. Quiet note (icon + muted line, no box) ---------- */
.rk-ios-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: var(--ios-muted);
}

.rk-ios-note > svg {
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

/* ---------- 8. Grey row: [icon square] [title / subtitle] [chevron or action] ---------- */
.rk-ios-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: 0;
    border-radius: var(--ios-r-row);
    background: var(--ios-fill);
    color: var(--ios-ink);
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

a.rk-ios-row:hover,
button.rk-ios-row:hover {
    color: var(--ios-ink);
    filter: brightness(.98);
}

.rk-ios-row-ico {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--ios-sq);
    color: var(--ios-ink);
}

.rk-ios-row-ico svg {
    width: 18px;
    height: 18px;
}

.rk-ios-row-text {
    flex: 1;
    min-width: 0;
}

.rk-ios-row-text > b,
.rk-ios-row-text > strong {
    display: block;
    font-size: 15.5px;
    font-weight: 700;
}

.rk-ios-row-text > small,
.rk-ios-row-text > span {
    display: block;
    margin-top: 1px;
    font-size: 13px;
    color: var(--ios-muted);
}

.rk-ios-row-right {
    flex: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--ios-muted);
}

.rk-ios-chev {
    flex: none;
    width: 14px;
    height: 14px;
    background: var(--ios-muted);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: transform .2s ease;
}

/* A row that opens (details/summary) */
details.rk-ios-row-details {
    border-radius: var(--ios-r-row);
    background: var(--ios-fill);
}

details.rk-ios-row-details > summary {
    list-style: none;
    background: none;
}

details.rk-ios-row-details > summary::-webkit-details-marker {
    display: none;
}

details.rk-ios-row-details[open] .rk-ios-chev {
    transform: rotate(90deg);
}

.rk-ios-row-body {
    padding: 0 14px 14px;
}

/* ---------- 9. Plain list (rows split by a hairline, no box) ---------- */
.rk-ios-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.rk-ios-list > li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
}

.rk-ios-list > li + li {
    border-top: 1px solid var(--ios-track);
}

.rk-ios-list.is-loose > li + li {
    border-top: 0;
}

/* ---------- 10. Buttons ---------- */
.rk-ios-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: var(--ios-r);
    background: var(--ios-fill);
    color: var(--ios-ink);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.rk-ios-btn:hover {
    color: var(--ios-ink);
    filter: brightness(.97);
}

.rk-ios-btn.is-big {
    min-height: 52px;
    border-radius: var(--ios-r-btn);
    font-size: 16px;
}

.rk-ios-btn.is-block {
    display: flex;
    width: 100%;
}

/* The ONE action on a screen */
.rk-ios-btn.is-primary {
    background: var(--ios-red);
    color: #ffffff;
}

.rk-ios-btn.is-primary:hover {
    background: var(--ios-red-hover);
    color: #ffffff;
    filter: none;
}

/* Strong but not the money action (Next, Save draft) */
.rk-ios-btn.is-ink {
    background: var(--ios-ink);
    color: var(--ios-ink-fg);
}

.rk-ios-btn.is-ink:hover {
    color: var(--ios-ink-fg);
}

.rk-ios-btn:disabled,
.rk-ios-btn[aria-disabled="true"] {
    background: var(--ios-fill);
    color: var(--ios-muted);
    cursor: not-allowed;
    filter: none;
}

.rk-ios-btn svg {
    width: 18px;
    height: 18px;
}

/* Small pill button ("Add", "Change") */
.rk-ios-pill {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: var(--ios-fill);
    color: var(--ios-ink);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.rk-ios-pill.is-ink {
    background: var(--ios-ink);
    color: var(--ios-ink-fg);
}

.rk-ios-btn:focus-visible,
.rk-ios-pill:focus-visible,
.rk-ios-iconbtn:focus-visible,
.rk-ios-row:focus-visible,
.rk-ios-seg > :focus-visible,
.rk-ios-photo:focus-visible,
details.rk-ios-row-details > summary:focus-visible {
    outline: 2px solid var(--ios-ink);
    outline-offset: 2px;
}

.rk-ios-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--ios-muted);
    text-decoration: none;
}

.rk-ios-link:hover {
    color: var(--ios-ink);
}

/* ---------- 11. Bottom bar (main button pinned to the bottom) ---------- */
.rk-ios-bottombar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    padding: 12px 0 calc(14px + env(safe-area-inset-bottom, 0px));
    background: inherit;
    box-shadow: 0 -1px 0 var(--ios-track);
}

.rk-ios-bottombar > .rk-ios-btnrow {
    display: flex;
    gap: 10px;
}

.rk-ios-bottombar > .rk-ios-btnrow > .rk-ios-btn {
    flex: 1;
}

.rk-ios-bottombar > .rk-ios-btnrow > .rk-ios-btn:not(.is-primary):not(.is-ink) {
    flex: none;
}

.rk-ios-bottombar > p {
    margin: 8px 0 0;
    text-align: center;
    font-size: 12.5px;
    color: var(--ios-muted);
}

/* ---------- 12. Photos ---------- */
/* A row of small squares (5 by default; set --n for another count) */
.rk-ios-thumbs {
    display: grid;
    grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr));
    gap: 8px;
}

.rk-ios-thumbs > img {
    display: block;
}

.rk-ios-thumbs > img,
.rk-ios-thumbs > .rk-ios-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: var(--ios-r);
    background: var(--ios-tile);
}

.rk-ios-thumb {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ios-muted);
    overflow: hidden;
}

.rk-ios-thumb > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rk-ios-thumb.is-current {
    outline: 2.5px solid var(--ios-ink);
    outline-offset: 2px;
}

/* Photo grid: first photo full width (16:9), the rest 2 per row (4:3), name under each */
.rk-ios-photos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.rk-ios-photo {
    position: relative;
    display: block;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ios-ink);
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.rk-ios-photos > .rk-ios-photo:first-child {
    grid-column: 1 / -1;
}

.rk-ios-photo > img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 14px;
    background: var(--ios-fill);
}

.rk-ios-photos > .rk-ios-photo:first-child > img {
    aspect-ratio: 16 / 9;
}

.rk-ios-photo-name {
    display: block;
    padding: 6px 2px 0;
    font-size: 13.5px;
    font-weight: 600;
}

.rk-ios-photo > .rk-ios-tick,
.rk-ios-photo > .rk-ios-chip,
.rk-ios-thumb > .rk-ios-tick {
    position: absolute;
    top: 8px;
    right: 8px;
}

.rk-ios-photo > .rk-ios-chip {
    height: 24px;
    padding: 0 9px;
    font-size: 12px;
}

/* Green tick badge */
.rk-ios-tick {
    display: inline-flex;
    flex: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--ios-green);
}

.rk-ios-tick::after {
    content: "";
    width: 12px;
    height: 12px;
    margin: auto;
    background: #ffffff;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.rk-ios-tick.is-sm {
    width: 18px;
    height: 18px;
}

.rk-ios-tick.is-sm::after {
    width: 10px;
    height: 10px;
}

.rk-ios-ok {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--ios-muted);
}

/* ---------- 13. Price + feature list ---------- */
.rk-ios-price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}

.rk-ios-price > b {
    font-size: 44px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -.03em;
}

.rk-ios-price > s {
    font-size: 20px;
    font-weight: 600;
    color: var(--ios-muted);
}

.rk-ios-price > span {
    font-size: 14px;
    color: var(--ios-muted);
}

.rk-ios-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rk-ios-features > li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15.5px;
}

.rk-ios-features > li > span:first-child {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: var(--ios-r-sm);
    background: var(--ios-fill);
}

.rk-ios-features svg {
    width: 18px;
    height: 18px;
}

/* Small green "Save $5" tag */
.rk-ios-save {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: 999px;
    background: rgba(52, 199, 89, .16);
    color: #1f8a3b;
    font-size: 12px;
    font-weight: 700;
}

html.dark .rk-ios .rk-ios-save {
    color: #4ade80;
}

/* ---------- 14. Spacing helpers (vertical rhythm used on every screen) ---------- */
.rk-ios-stack {
    display: flex;
    flex-direction: column;
}

.rk-ios-gap-8 { gap: 8px; }
.rk-ios-gap-10 { gap: 10px; }
.rk-ios-gap-14 { gap: 14px; }
.rk-ios-mt-6 { margin-top: 6px; }
.rk-ios-mt-10 { margin-top: 10px; }
.rk-ios-mt-16 { margin-top: 16px; }
.rk-ios-mt-18 { margin-top: 18px; }
.rk-ios-mt-22 { margin-top: 22px; }
.rk-ios-mt-24 { margin-top: 24px; }
