:root {
            --bg: #f5f7fa;
            --surface: #ffffff;
            --surface-soft: #edf7f4;
            --ink: #17202a;
            --muted: #637083;
            --line: #d8e1e8;
            --primary: #0f766e;
            --primary-strong: #0b5f59;
            --accent: #f59e0b;
            --danger: #dc2626;
            --danger-strong: #b91c1c;
            --key: #1f2937;
            --key-soft: #eef2f5;
            --shadow: 0 16px 40px rgba(23, 32, 42, 0.12);
        }

        * {
            box-sizing: border-box;
            letter-spacing: 0;
        }

        [hidden] {
            display: none !important;
        }

        html {
            min-height: 100%;
        }

        body {
            min-height: 100vh;
            margin: 0;
            color: var(--ink);
            background:
                linear-gradient(180deg, #e7f5f1 0%, #f6f8fb 42%, #fbfcfd 100%);
            font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
        }

        button {
            min-height: 44px;
            border: 0;
            border-radius: 8px;
            font: inherit;
            font-weight: 800;
            cursor: pointer;
            touch-action: manipulation;
            transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease, color 140ms ease;
        }

        button:hover:not(:disabled) {
            transform: translateY(-1px);
        }

        button:active:not(:disabled) {
            transform: translateY(0);
        }

        button:focus-visible {
            outline: 3px solid rgba(245, 158, 11, 0.55);
            outline-offset: 3px;
        }

        button:disabled {
            cursor: not-allowed;
            transform: none;
        }

        .app-shell {
            width: min(1180px, 100%);
            margin: 0 auto;
            padding: 24px;
        }

        .app-header {
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: 16px;
            margin-bottom: 14px;
        }

        .sponsor-strip {
            margin: -4px 0 16px;
            overflow: hidden;
        }

        .sponsor-track {
            display: flex;
            gap: 12px;
        }

        .sponsor-track[data-autoscroll="true"] {
            width: max-content;
            animation: sponsorScroll 24s linear infinite;
        }

        .sponsor-track[data-autoscroll="true"] .sponsor-card {
            width: min(520px, calc(100vw - 48px));
        }

        .sponsor-card {
            position: relative;
            isolation: isolate;
            display: grid;
            width: 100%;
            min-height: 66px;
            grid-template-columns: auto minmax(0, 1fr);
            align-items: center;
            gap: 14px;
            overflow: hidden;
            padding: 7px 10px;
            border: 1px solid rgba(15, 118, 110, 0.22);
            border-radius: 8px;
            background: linear-gradient(135deg, #ffffff 0%, #ecfdf5 55%, #fff7ed 100%);
            color: var(--ink);
            text-decoration: none;
            box-shadow: 0 14px 34px rgba(23, 32, 42, 0.1);
        }

        .sponsor-card::after {
            position: absolute;
            inset: 0;
            z-index: -1;
            background: linear-gradient(115deg, transparent 0%, transparent 38%, rgba(245, 158, 11, 0.18) 48%, transparent 60%, transparent 100%);
            content: "";
            transform: translateX(-120%);
            animation: sponsorSweep 6s ease-in-out infinite;
        }

        .sponsor-card:hover {
            transform: translateY(-1px);
        }

        .sponsor-logo-link {
            display: grid;
            width: 184px;
            height: 52px;
            place-items: center;
            color: var(--primary-strong);
            text-decoration: none;
        }

        .sponsor-logo-link:focus-visible,
        .sponsor-link:focus-visible {
            outline: 3px solid rgba(245, 158, 11, 0.55);
            outline-offset: 3px;
        }

        .sponsor-logo {
            display: block;
            width: 90%;
            height: 90%;
            object-fit: contain;
            object-position: center;
            filter: drop-shadow(0 5px 8px rgba(15, 118, 110, 0.14));
            animation: sponsorLogoFloat 4.2s ease-in-out infinite;
        }

        .sponsor-actions {
            display: grid;
            min-width: 0;
            grid-template-columns: minmax(0, 1fr) auto;
            align-items: center;
            gap: 10px;
        }

        .sponsor-link {
            display: inline-flex;
            min-width: 0;
            min-height: 38px;
            align-items: center;
            justify-content: center;
            gap: 8px;
            overflow: hidden;
            padding: 8px 10px;
            border: 1px solid rgba(15, 118, 110, 0.18);
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.78);
            color: var(--ink);
            font-size: 13px;
            font-weight: 900;
            line-height: 1.15;
            text-decoration: none;
            white-space: nowrap;
            box-shadow: 0 8px 18px rgba(15, 118, 110, 0.08);
        }

        .sponsor-link-label {
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .sponsor-mention {
            background: linear-gradient(90deg, #d62976 0%, #fa7e1e 48%, #4f5bd5 100%);
            background-clip: text;
            color: #d62976;
            font-weight: 950;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .sponsor-link--instagram {
            justify-content: flex-start;
            min-height: auto;
            padding: 0;
            border-color: transparent;
            background: transparent;
            color: var(--primary-strong);
            box-shadow: none;
        }

        .sponsor-link--support {
            border-color: transparent;
            background: var(--primary);
            color: #ffffff;
            box-shadow: 0 10px 22px rgba(15, 118, 110, 0.18);
        }

        .sponsor-icon {
            flex: 0 0 auto;
            width: 21px;
            height: 21px;
        }

        .instagram-ring {
            fill: none;
            stroke: url(#instagramGradient);
            stroke-width: 2.2;
        }

        .instagram-lens {
            fill: none;
            stroke: url(#instagramGradient);
            stroke-width: 2.1;
        }

        .instagram-dot {
            fill: #f59e0b;
        }

        .gofundme-badge {
            fill: #02a95c;
        }

        .gofundme-spark {
            fill: #00b8d9;
        }

        .gofundme-letter {
            fill: #ffffff;
            font-family: Inter, ui-sans-serif, system-ui, sans-serif;
            font-size: 10px;
            font-weight: 900;
        }

        @keyframes sponsorSweep {
            0%,
            58% {
                transform: translateX(-120%);
            }

            100% {
                transform: translateX(120%);
            }
        }

        @keyframes sponsorScroll {
            from {
                transform: translateX(0);
            }

            to {
                transform: translateX(calc(-50% - 6px));
            }
        }

        @keyframes sponsorLogoFloat {
            0%,
            100% {
                transform: translateY(0);
            }

            50% {
                transform: translateY(-2px);
            }
        }

        .brand {
            display: flex;
            align-items: center;
            gap: 14px;
            min-width: 0;
        }

        .brand-mark {
            display: block;
            width: 56px;
            height: 56px;
            flex-shrink: 0;
            border-radius: 8px;
            object-fit: cover;
            box-shadow: var(--shadow);
        }

        .eyebrow,
        .section-label,
        .display-label,
        .total-label {
            margin: 0;
            color: var(--muted);
            font-size: 12px;
            font-weight: 900;
            text-transform: uppercase;
        }

        h1,
        h2 {
            margin: 0;
            color: var(--ink);
        }

        h1 {
            font-size: 32px;
            line-height: 1.05;
        }

        h2 {
            font-size: 20px;
            line-height: 1.2;
        }

        .container {
            display: grid;
            grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
            gap: 18px;
            width: 100%;
        }

        .input-panel,
        .pass-panel {
            background: rgba(255, 255, 255, 0.92);
            border: 1px solid rgba(216, 225, 232, 0.9);
            border-radius: 8px;
            box-shadow: var(--shadow);
        }

        .input-panel {
            padding: 18px;
        }

        .pass-panel {
            min-width: 0;
            overflow: hidden;
        }

        .panel-title-row,
        .pass-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 14px;
        }

        .discipline-selector {
            margin-top: 16px;
        }

        .discipline-tabs {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 8px;
            margin-top: 8px;
        }

        .discipline-tabs button {
            display: flex;
            min-width: 0;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 2px;
            padding: 10px 8px;
            border: 1px solid var(--line);
        }

        .tab-code {
            font-size: 18px;
            line-height: 1;
        }

        .tab-label,
        .key-sub {
            font-size: 11px;
            font-weight: 800;
            line-height: 1.1;
        }

        .display-card {
            margin-top: 14px;
            padding: 12px;
            border: 1px solid var(--line);
            border-radius: 8px;
            background: var(--surface-soft);
        }

        .display {
            display: flex;
            min-height: 86px;
            width: 100%;
            align-items: center;
            justify-content: flex-end;
            margin-top: 8px;
            padding: 12px 16px;
            overflow-x: auto;
            border: 1px solid rgba(23, 32, 42, 0.16);
            border-radius: 8px;
            background: #111827;
            color: #ffffff;
            font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
            font-size: 34px;
            font-weight: 900;
            line-height: 1;
            white-space: nowrap;
        }

        .keypad {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 8px;
            margin-top: 14px;
        }

        .keypad button {
            display: flex;
            width: 100%;
            min-width: 0;
            min-height: 64px;
            aspect-ratio: 1;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 3px;
            padding: 8px 6px;
        }

        .key-main {
            font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
            font-size: 24px;
            line-height: 1;
        }

        .btn-green {
            background: var(--primary);
            color: #ffffff;
            box-shadow: 0 8px 18px rgba(15, 118, 110, 0.22);
        }

        .btn-green:hover:not(:disabled) {
            background: var(--primary-strong);
        }

        .btn-disabled {
            background: #ffffff;
            color: var(--muted);
        }

        .btn-red {
            background: var(--danger);
            color: #ffffff;
            box-shadow: 0 8px 18px rgba(220, 38, 38, 0.18);
        }

        .btn-red:hover:not(:disabled) {
            background: var(--danger-strong);
        }

        .btn-screen {
            background: var(--ink);
            color: #ffffff;
        }

        .btn-grey {
            background: #ffffff;
            color: var(--ink);
            border: 1px solid var(--line);
        }

        .btn-keypad {
            background: var(--key);
            color: #ffffff;
        }

        .btn-keypad-blue {
            background: var(--primary);
            color: #ffffff;
        }

        .btn-keypad-gray {
            background: var(--key-soft);
            color: #8b98a7;
            border: 1px solid var(--line);
        }

        .keypad button.is-selected {
            box-shadow: inset 0 0 0 3px var(--accent), 0 8px 18px rgba(245, 158, 11, 0.18);
        }

        .action-bar {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
            margin-top: 14px;
        }

        .action-bar button {
            padding: 12px 14px;
        }

        #screenshot-btn {
            grid-column: 1 / -1;
        }

        .error {
            grid-column: 1 / -1;
            margin: 0 0 12px;
            padding: 12px 14px;
            border: 1px solid rgba(220, 38, 38, 0.24);
            border-radius: 8px;
            background: #fff1f2;
            color: var(--danger-strong);
            font-size: 14px;
            font-weight: 800;
        }

        .pass-header {
            padding: 18px;
            border-bottom: 1px solid var(--line);
            background: #ffffff;
        }

        .decipline {
            width: fit-content;
            margin-top: 8px;
            padding: 6px 10px;
            border-radius: 999px;
            background: var(--surface-soft);
            color: var(--primary-strong);
            font-size: 13px;
            font-weight: 900;
        }

        .total {
            display: grid;
            min-width: 112px;
            gap: 2px;
            margin: 0;
            padding: 10px 14px;
            border: 1px solid var(--line);
            border-radius: 8px;
            background: #fbfcfd;
            text-align: right;
        }

        #total-dd {
            color: var(--ink);
            font-size: 30px;
            font-weight: 900;
            line-height: 1;
        }

        .table-wrap {
            overflow-x: auto;
        }

        .skill-table {
            width: 100%;
            min-width: 620px;
            border-collapse: separate;
            border-spacing: 0;
            background: #ffffff;
        }

        .skill-table th,
        .skill-table td {
            padding: 13px 12px;
            border-bottom: 1px solid var(--line);
            text-align: left;
            vertical-align: middle;
        }

        .skill-table th {
            background: #f7faf9;
            color: var(--muted);
            font-size: 12px;
            font-weight: 900;
            text-transform: uppercase;
            white-space: nowrap;
        }

        .skill-table tr:last-child td {
            border-bottom: 0;
        }

        .skill-table th:first-child,
        .skill-table td:first-child {
            width: 44px;
            text-align: center;
        }

        .drag-handle {
            display: inline-grid;
            width: 32px;
            height: 32px;
            place-items: center;
            border-radius: 8px;
            color: var(--muted);
            cursor: grab;
            user-select: none;
        }

        .drag-handle:active {
            cursor: grabbing;
        }

        .skill-table tr:hover .drag-handle {
            background: var(--surface-soft);
            color: var(--primary-strong);
        }

        .btn-small {
            min-height: 36px;
            padding: 8px 10px;
            font-size: 13px;
        }

        .remove-icon {
            display: none;
        }

        .no-skills-row td {
            padding: 28px 16px;
            color: var(--muted);
            text-align: center;
            font-weight: 800;
        }

        footer {
            width: min(760px, 100%);
            margin: 20px auto 0;
            padding: 14px 0 4px;
            color: var(--muted);
            text-align: center;
            font-size: 12px;
        }

        footer p {
            margin: 4px 0;
        }

        footer small {
            font-size: 11px;
            line-height: 1.45;
        }


        @media (prefers-reduced-motion: reduce) {
            .sponsor-track[data-autoscroll="true"],
            .sponsor-card::after,
            .sponsor-logo {
                animation: none;
            }

            .sponsor-card:hover {
                transform: none;
            }
        }

        @media (max-width: 900px) {
            .container {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 720px) {
            .app-shell {
                padding: 14px;
            }

            .app-header {
                align-items: flex-start;
            }


            .sponsor-strip {
                margin: -2px 0 12px;
            }

            .sponsor-card {
                min-height: 66px;
                grid-template-columns: 90px minmax(0, 1fr);
                gap: 8px;
                padding: 6px 8px;
            }

            .sponsor-logo-link {
                width: 90px;
                height: 42px;
            }

            .sponsor-logo {
                filter: drop-shadow(0 4px 6px rgba(15, 118, 110, 0.12));
            }

            .sponsor-actions {
                grid-template-columns: 1fr;
                gap: 5px;
            }

            .sponsor-link {
                min-height: 28px;
                justify-content: flex-start;
                gap: 6px;
                padding: 5px 7px;
                font-size: 11px;
            }

            .sponsor-link--instagram {
                min-height: auto;
                padding: 0;
                border-color: transparent;
                background: transparent;
                white-space: nowrap;
                box-shadow: none;
            }

            .sponsor-icon {
                width: 18px;
                height: 18px;
            }

            h1 {
                font-size: 26px;
            }

            .input-panel {
                padding: 14px;
            }

            .display {
                min-height: 74px;
                font-size: 30px;
            }

            .keypad {
                gap: 6px;
            }

            .keypad button {
                min-height: 58px;
                aspect-ratio: auto;
            }

            .key-main {
                font-size: 22px;
            }

            .pass-header {
                align-items: stretch;
                flex-direction: column;
                padding: 14px;
            }

            .total {
                display: flex;
                align-items: baseline;
                justify-content: space-between;
                text-align: left;
            }

            .table-wrap {
                overflow: visible;
                padding: 0;
                border-top: 1px solid var(--line);
            }

            .skill-table,
            .skill-table tbody {
                display: block;
                width: 100%;
                min-width: 0;
            }

            .skill-table {
                background: #ffffff;
            }

            .skill-table thead {
                display: none;
            }

            .skill-table tr {
                display: grid;
                grid-template-columns: 20px minmax(0, 1fr) 34px 20px 36px 32px;
                align-items: center;
                gap: 4px;
                min-height: 56px;
                margin: 0;
                padding: 9px 8px;
                border-bottom: 1px solid var(--line);
                background: #ffffff;
            }

            .skill-table tr:last-child {
                border-bottom: 0;
            }

            .skill-table td {
                display: block;
                min-width: 0;
                width: auto;
                padding: 0;
                border: 0;
                color: var(--ink);
                font-size: 13px;
                font-weight: 800;
                line-height: 1.2;
                text-align: center;
            }

            .skill-table td::before,
            .skill-table td[data-label="Move"]::before,
            .no-skills-row td::before {
                content: "";
                display: none;
            }

            .skill-table td:first-child {
                width: auto;
            }

            .skill-table td[data-label="Move"] {
                display: flex;
                align-items: center;
                justify-content: center;
            }

            .skill-table td[data-label="Skill"] {
                overflow: hidden;
                color: var(--ink);
                font-size: 13px;
                text-align: left;
                text-overflow: ellipsis;
                white-space: nowrap;
            }

            .skill-table td[data-label="FIG"],
            .skill-table td[data-label="Position"],
            .skill-table td[data-label="DD"] {
                color: var(--muted);
                font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
            }

            .drag-handle {
                width: 20px;
                height: 24px;
                border-radius: 6px;
                font-size: 15px;
            }

            .skill-table td:last-child .btn-small {
                display: grid;
                width: 30px;
                min-height: 32px;
                place-items: center;
                padding: 0;
                border-radius: 8px;
                font-size: 18px;
                line-height: 1;
            }

            .remove-label {
                display: none;
            }

            .remove-icon {
                display: block;
            }

            .no-skills-row td {
                grid-column: 1 / -1;
                padding: 18px 12px;
                color: var(--muted);
                text-align: center;
            }
        }

        @media (max-width: 430px) {
            .app-shell {
                padding: 10px;
            }

            .brand {
                gap: 10px;
            }


            .discipline-tabs {
                gap: 6px;
            }

            .tab-label,
            .key-sub {
                font-size: 10px;
            }

            .action-bar {
                grid-template-columns: 1fr;
            }

            .sponsor-card {
                grid-template-columns: 82px minmax(0, 1fr);
                padding: 6px 8px;
            }

            .sponsor-logo-link {
                width: 82px;
                height: 40px;
            }

            .sponsor-link {
                font-size: 10.5px;
            }
        }

/* Subtle BLUE validation badge — must not replace TwinTumblerz chrome */
.blue-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  color: var(--muted);
  text-align: center;
  padding: 6px 12px 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.blue-banner .blue-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #1e3a8a;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
}
.blue-banner a { color: var(--primary-strong); }
.blue-banner code {
  font-size: 10px;
  background: rgba(15, 118, 110, 0.08);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ===== Phase 3: auth + saved passes (mobile-first) ===== */
/* Auth sits under TwinTumblerz sponsor strip — not in product header */
.auth-chrome {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  max-width: 100%;
  margin: 0 0 16px;
  padding: 8px 0 0;
}

.auth-signed-out,
.auth-signed-in {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.auth-signed-out[hidden],
.auth-signed-in[hidden],
.my-passes-panel[hidden],
.my-passes-card[hidden],
.profile-panel[hidden] {
  display: none !important;
}

.auth-who {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-auth {
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  border-radius: 8px;
  background: #eef2f5;
  color: var(--ink);
  font-weight: 800;
  font-size: 14px;
  border: 1px solid var(--line);
}

.btn-auth-chrome {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-auth-svg {
  width: 20px;
  height: 20px;
  display: block;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.btn-auth-label {
  white-space: nowrap;
}

.btn-auth.primary {
  background: #1e3a8a;
  color: #fff;
  border-color: #1e3a8a;
}

.save-pass-bar {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  display: grid;
  gap: 8px;
}

.save-pass-label,
.auth-field-label,
.share-label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.pass-title-input,
.auth-input,
.share-url {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 16px; /* avoid iOS zoom */
  background: #fff;
}

.save-pass-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.my-passes-panel {
  margin: 18px 24px 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  width: min(1180px - 48px, calc(100% - 48px));
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.passes-search-wrap {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.passes-search {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 16px; /* avoid iOS zoom */
  background: #fff;
  box-sizing: border-box;
}

.passes-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.passes-empty {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.passes-empty.err { color: var(--danger); }

/* Slim pass rows — dense list, mobile-friendly icon actions */
.pass-card,
.pass-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: #fff;
  display: grid;
  gap: 4px;
}

.pass-row-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
}

.pass-card-main {
  min-width: 0;
  flex: 1 1 auto;
}

.pass-card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pass-card-meta {
  margin: 2px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.2;
}

.pass-disc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #eef2f5;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.pass-dd,
.pass-skill-count {
  font-variant-numeric: tabular-nums;
}

.pass-card-share {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  background: #edf7f4;
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pass-card-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex: 0 0 auto;
}

/* Legacy text buttons kept for save-bar / share-copy fallbacks */
.btn-pass {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: #eef2f5;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  touch-action: manipulation;
}

.btn-pass.load {
  background: var(--primary);
  color: #fff;
}

.btn-pass.danger {
  background: #fef2f2;
  color: var(--danger);
}

/* Compact ~40px icon action buttons */
.btn-pass-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: #eef2f5;
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  flex: 0 0 auto;
}

.btn-pass-icon svg {
  display: block;
  pointer-events: none;
}

.btn-pass-icon.load {
  background: var(--primary);
  color: #fff;
}

.btn-pass-icon.danger {
  background: #fef2f2;
  color: var(--danger);
}

.btn-pass-icon-text {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

/* Thin one-line share reveal (hidden by default) */
.pass-card-share-row {
  display: block;
  padding-top: 2px;
}

.pass-card-share-row[hidden] {
  display: none !important;
}

.share-copy-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 4px;
  align-items: center;
}

.pass-card .share-url {
  min-height: 40px;
  height: 40px;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 8px;
}

.passes-msg,
.auth-status {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  background: #eef2f5;
  color: var(--ink);
}

.passes-msg.ok,
.auth-status.ok {
  background: #edf7f4;
  color: var(--primary);
}

.passes-msg.err,
.auth-status.err {
  background: #fef2f2;
  color: var(--danger);
}

/* Auth modal — full-width sheet on phones */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.auth-modal[hidden] { display: none !important; }

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 32, 42, 0.45);
}

.auth-modal-sheet {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: min(92vh, 640px);
  overflow: auto;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 32px rgba(23, 32, 42, 0.2);
  display: grid;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
}

.auth-modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.auth-modal-top h2 {
  margin: 0;
  font-size: 20px;
}

.auth-modal-hint {
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.auth-submit {
  width: 100%;
  margin-top: 8px;
}

.auth-toggle {
  width: 100%;
  background: transparent;
  border: 0;
  color: #1e3a8a;
  text-decoration: underline;
  min-height: 44px;
}

body.auth-modal-open {
  overflow: hidden;
}

@media (min-width: 720px) {
  .auth-modal {
    align-items: center;
  }
  .auth-modal-sheet {
    border-radius: 12px;
    margin: 24px;
  }
  .save-pass-actions {
    grid-template-columns: 1fr 1fr;
  }
  .pass-card-actions {
    gap: 4px;
  }
  .pass-card-title {
    font-size: 15px;
  }
  .my-passes-panel,
  .profile-panel {
    width: min(1180px, calc(100% - 48px));
  }
  .my-passes-card {
    width: min(1180px, calc(100% - 48px));
  }
}

@media (max-width: 420px) {
  .pass-row-body {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .pass-card-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 720px) {
  .auth-chrome {
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 6px;
    margin-bottom: 10px;
    padding-top: 2px;
  }
  .auth-signed-out,
  .auth-signed-in {
    width: auto;
    display: flex;
    flex-flow: row nowrap;
    gap: 6px;
  }
  .auth-chrome .btn-auth {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    flex: 0 0 40px;
  }
  .auth-chrome .btn-auth-label {
    display: none;
  }
  .auth-chrome .auth-who {
    display: inline-block;
    max-width: 96px;
    font-size: 12px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 0 1 auto;
  }
  .my-passes-panel,
  .profile-panel {
    margin: 12px 10px 0;
    width: auto;
    padding: 12px;
  }
  .my-passes-card {
    margin: 0 10px 10px;
    width: auto;
  }
}



/* Collapsed My passes card above calculator */
.my-passes-card {
  margin: 0 auto 12px;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  width: min(1180px - 48px, calc(100% - 48px));
  box-sizing: border-box;
  overflow: hidden;
}

.my-passes-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  text-align: left;
}

.my-passes-toggle-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.my-passes-toggle-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.my-passes-count {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  background: #eef2f5;
  border-radius: 999px;
  padding: 2px 8px;
  line-height: 1.4;
}

.my-passes-chevron {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.my-passes-card.is-open .my-passes-chevron {
  transform: rotate(180deg);
}

.my-passes-body {
  padding: 0 12px 12px;
  border-top: 1px solid var(--line);
}

.my-passes-body[hidden] {
  display: none !important;
}

.my-passes-card .passes-search-wrap {
  margin-top: 10px;
}

.my-passes-card .passes-list {
  margin-top: 8px;
  max-height: min(42vh, 360px);
  overflow-y: auto;
}

/* ===== Profile panel ===== */
.profile-panel .pass-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.profile-panel .pass-header h2 {
  margin: 0;
}
.profile-section {
  display: grid;
  gap: 8px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.profile-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.profile-section-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}
.profile-hint {
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}
.profile-select {
  appearance: auto;
  -webkit-appearance: menulist;
}
.profile-section .btn-green,
.profile-section .btn-auth,
.profile-section .btn-red {
  margin-top: 4px;
  min-height: 44px;
  width: 100%;
  font-weight: 800;
  font-size: 15px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}
.profile-section .btn-auth {
  border: 1px solid var(--line);
}
.profile-danger {
  background: #fff1f2;
  border: 1px solid rgba(220, 38, 38, 0.22);
  border-radius: 10px;
  padding: 14px 12px !important;
  margin-top: 8px;
}
.profile-danger .profile-section-title {
  color: var(--danger-strong);
}
#profile-email[readonly] {
  background: #f1f5f9;
  color: var(--muted);
}

/* In-page confirm (WKWebView / mobile — window.confirm is unreliable) */
.ui-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.ui-confirm-modal[hidden] { display: none !important; }
.ui-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}
.ui-confirm-dialog {
  position: relative;
  z-index: 1;
  width: min(360px, 100%);
  background: #fff;
  border-radius: 12px;
  padding: 18px 16px 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.22);
}
.ui-confirm-msg {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
}
.ui-confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.ui-confirm-actions .btn-green,
.ui-confirm-actions .btn-auth {
  min-height: 44px;
  padding: 0 16px;
}

/* Site legal footer links (Privacy | Support) — discreet */
.site-legal-links {
    margin: 0.35rem 0 0.5rem;
    font-size: 0.85rem;
    opacity: 0.85;
}
.site-legal-links a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.site-legal-links a:hover {
    opacity: 1;
}

.auth-forgot-link,
.auth-forgot-back {
  display: block;
  width: 100%;
  margin-top: 8px;
  text-align: center;
  background: transparent;
  color: var(--primary, #0f766e);
  border: 0;
  text-decoration: underline;
  font-weight: 700;
  min-height: 40px;
  cursor: pointer;
}
.auth-forgot-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line, #d8e1e8);
}
.auth-forgot-block .btn-auth,
.auth-forgot-block .btn-green {
  width: 100%;
  margin-top: 8px;
}
.auth-modal-sheet.auth-mode-forgot .auth-field-label[for="auth-password"],
.auth-modal-sheet.auth-mode-forgot #auth-password,
.auth-modal-sheet.auth-mode-forgot #auth-confirm-block,
.auth-modal-sheet.auth-mode-forgot #auth-submit,
.auth-modal-sheet.auth-mode-forgot #auth-toggle,
.auth-modal-sheet.auth-mode-forgot #auth-forgot-link {
  display: none !important;
}


/* ===== RAM-53: iOS App Store banner (third-party iOS browsers only; never in WKWebView) ===== */
.app-store-banner {
  position: fixed;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 900; /* below auth modal (1000) and confirm modal (10000) */
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(480px, calc(100% - 24px));
  padding: 10px 10px 10px 12px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: 14px;
  box-shadow: var(--shadow);
  font-family: inherit;
}
.app-store-banner-icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 10px;
}
.app-store-banner-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
  line-height: 1.25;
}
.app-store-banner-text strong {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}
.app-store-banner-text span {
  font-size: 12px;
  color: var(--muted);
}
.app-store-banner-get {
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}
.app-store-banner-get:active { background: var(--primary-strong); }
.app-store-banner-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
body.has-app-store-banner { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
