*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

        :root {
            --red: #dc2626;
            --red-hover: #b91c1c;
            --red-10: rgba(220,38,38,0.1);
            --red-20: rgba(220,38,38,0.2);
            --black-5: rgba(0,0,0,0.05);
            --black-10: rgba(0,0,0,0.10);
            --black-20: rgba(0,0,0,0.20);
            --black-30: rgba(0,0,0,0.30);
            --black-40: rgba(0,0,0,0.40);
            --ink: #1A1A1A;
            --bg: #FDFDFB;
            --sidebar-bg: #F7F7F5;
        }

        html, body {
            height: 100%;
            background: var(--bg);
            color: var(--ink);
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            font-weight: 300;
            -webkit-font-smoothing: antialiased;
        }

        /* ─── Layout ─── */
        .app-wrapper {
            display: flex;
            flex-direction: column;
            min-height: 100vh;
        }

        /* Top nav */
        .top-nav {
            height: 72px;
            border-bottom: 1px solid var(--black-5);
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 32px;
            background: rgba(253,253,251,0.8);
            backdrop-filter: blur(12px);
            position: sticky;
            top: 0;
            z-index: 50;
        }

        .nav-brand {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .nav-logo {
            width: 32px;
            height: 32px;
            background: var(--red);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .nav-logo svg { width: 16px; height: 16px; fill: white; }

        .nav-title {
            font-family: 'Playfair Display', serif;
            font-style: italic;
            font-size: 1.1rem;
            color: var(--ink);
            letter-spacing: -0.01em;
        }

        .nav-right {
            display: flex;
            align-items: center;
            gap: 16px;
        }

        .nav-link {
            display: flex;
            align-items: center;
            gap: 7px;
            padding: 8px 18px;
            border-radius: 99px;
            border: 1px solid var(--black-10);
            background: transparent;
            color: var(--black-40);
            font-family: 'Inter', sans-serif;
            font-size: 0.62rem;
            font-weight: 500;
            letter-spacing: 0.18em;
            text-transform: uppercase;
            text-decoration: none;
            transition: all 0.2s;
            white-space: nowrap;
        }
        .nav-link:hover {
            background: var(--red-10);
            border-color: var(--red-20);
            color: var(--red);
        }
        .nav-link svg { width: 13px; height: 13px; flex-shrink: 0; }

        @media (max-width: 640px) {
            .nav-link span { display: none; }
            .nav-link { padding: 8px; border-radius: 50%; }
            .nav-link svg { width: 16px; height: 16px; }
        }

        .lang-pill {
            display: flex;
            background: var(--black-5);
            border-radius: 99px;
            padding: 4px;
            border: 1px solid var(--black-5);
            gap: 2px;
        }

        .lang-pill button {
            background: none;
            border: none;
            padding: 6px 14px;
            border-radius: 99px;
            font-size: 0.65rem;
            font-weight: 500;
            letter-spacing: 0.15em;
            text-transform: uppercase;
            color: var(--black-40);
            cursor: pointer;
            transition: all 0.2s;
        }

        .lang-pill button.active {
            background: var(--red);
            color: white;
            box-shadow: 0 4px 12px var(--red-20);
        }

        /* Body layout */
        .app-body {
            display: flex;
            flex: 1;
            min-height: calc(100vh - 72px);
        }

        /* ─── Sidebar ─── */
        .sidebar {
            width: 420px;
            min-width: 360px;
            border-right: 1px solid var(--black-5);
            background: var(--sidebar-bg);
            display: flex;
            flex-direction: column;
            padding: 40px 28px 0;
            overflow: hidden;
            height: calc(100vh - 72px);
            position: sticky;
            top: 72px;
        }

        .sidebar-section-label {
            font-size: 0.55rem;
            font-weight: 500;
            letter-spacing: 0.25em;
            text-transform: uppercase;
            color: var(--black-30);
            margin-bottom: 20px;
        }

        .sidebar-title {
            font-family: 'Playfair Display', serif;
            font-style: italic;
            font-size: 1.3rem;
            color: var(--ink);
            margin-bottom: 28px;
        }

        /* Config fields */
        .config-block {
            display: flex;
            flex-direction: column;
            gap: 12px;
            margin-bottom: 28px;
        }

        .config-field {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .config-field label {
            font-size: 0.6rem;
            font-weight: 500;
            letter-spacing: 0.2em;
            text-transform: uppercase;
            color: var(--black-30);
        }

        .config-field input,
        .config-field select {
            background: white;
            border: 1px solid var(--black-10);
            border-radius: 12px;
            padding: 10px 14px;
            font-size: 0.85rem;
            font-family: 'Inter', sans-serif;
            color: var(--ink);
            outline: none;
            transition: border-color 0.2s, box-shadow 0.2s;
            width: 100%;
            appearance: none;
            -webkit-appearance: none;
        }

        .config-field input:focus,
        .config-field select:focus {
            border-color: var(--red);
            box-shadow: 0 0 0 3px var(--red-10);
        }

        /* Lunch checkbox */
        .lunch-row {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 28px;
        }

        .lunch-row input[type="checkbox"] {
            appearance: none;
            -webkit-appearance: none;
            width: 18px;
            height: 18px;
            border: 1px solid var(--black-20);
            border-radius: 6px;
            cursor: pointer;
            position: relative;
            transition: all 0.2s;
            flex-shrink: 0;
        }

        .lunch-row input[type="checkbox"]:checked {
            background: var(--red);
            border-color: var(--red);
        }

        .lunch-row input[type="checkbox"]:checked::after {
            content: '';
            position: absolute;
            top: 3px;
            left: 5px;
            width: 5px;
            height: 8px;
            border: 2px solid white;
            border-top: none;
            border-left: none;
            transform: rotate(40deg);
        }

        .lunch-row label {
            font-size: 0.78rem;
            color: var(--black-40);
            cursor: pointer;
        }

        /* Divider */
        .sidebar-divider {
            height: 1px;
            background: var(--black-5);
            margin: 20px 0;
        }

        .your-plan-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }

        .your-plan-label {
            font-size: 0.55rem;
            font-weight: 500;
            letter-spacing: 0.25em;
            text-transform: uppercase;
            color: var(--black-30);
        }

        .btn-clear {
            background: none;
            border: none;
            font-size: 0.6rem;
            letter-spacing: 0.15em;
            text-transform: uppercase;
            color: var(--black-30);
            cursor: pointer;
            padding: 4px 10px;
            border-radius: 99px;
            transition: all 0.2s;
        }

        .btn-clear:hover { background: var(--red-10); color: var(--red); }

        /* Empty plan state */
        .plan-empty {
            text-align: center;
            padding: 40px 20px;
        }

        .plan-empty-icon {
            width: 56px;
            height: 56px;
            border-radius: 50%;
            border: 1px solid var(--black-10);
            background: var(--black-5);
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 24px;
        }

        .plan-empty-icon svg { width: 22px; height: 22px; color: rgba(220,38,38,0.4); }

        .plan-empty h3 {
            font-family: 'Playfair Display', serif;
            font-style: italic;
            font-size: 1.05rem;
            color: var(--ink);
            margin-bottom: 12px;
        }

        .plan-empty p {
            font-size: 0.7rem;
            font-weight: 300;
            color: var(--black-30);
            line-height: 1.7;
        }

        /* Plan list (selected attractions) */
        #planList {
            display: flex;
            flex-direction: column;
            gap: 14px;
            flex: 1;
            overflow-y: auto;
            min-height: 0;
            padding-right: 4px;
            scrollbar-width: thin;
            scrollbar-color: var(--black-10) transparent;
        }
        #planList::-webkit-scrollbar { width: 4px; }
        #planList::-webkit-scrollbar-track { background: transparent; }
        #planList::-webkit-scrollbar-thumb { background: var(--black-10); border-radius: 99px; }

        .plan-stop {
            display: flex;
            align-items: center;
        }

        .stop-num {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            border: 1px solid var(--black-10);
            background: var(--black-5);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.6rem;
            font-family: monospace;
            color: var(--black-40);
            flex-shrink: 0;
            transition: all 0.2s;
        }

        .plan-stop:hover .stop-num {
            border-color: rgba(220,38,38,0.5);
            color: var(--red);
        }

        .stop-card {
            margin-left: 16px;
            flex: 1;
            background: white;
            border: 1px solid var(--black-10);
            border-radius: 16px;
            padding: 14px 16px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            transition: background 0.2s;
        }

        .plan-stop:hover .stop-card { background: rgba(0,0,0,0.01); }

        .stop-name {
            font-size: 0.82rem;
            font-weight: 500;
            color: var(--ink);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 150px;
        }

        .stop-meta {
            display: flex;
            gap: 10px;
            margin-top: 6px;
        }

        .stop-meta span {
            font-size: 0.55rem;
            font-weight: 500;
            letter-spacing: 0.15em;
            text-transform: uppercase;
        }

        .stop-meta .stop-line { color: var(--red); }
        .stop-meta .stop-time { color: var(--black-20); display: flex; align-items: center; gap: 4px; }

        .btn-remove {
            width: 30px;
            height: 30px;
            border: none;
            background: none;
            border-radius: 50%;
            color: var(--black-20);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            transition: all 0.2s;
        }

        .btn-remove:hover { background: var(--red-10); color: var(--red); }

        /* Bottom of sidebar */
        .sidebar-footer {
            padding: 20px 0 28px;
            border-top: 1px solid var(--black-5);
            margin-top: 8px;
            flex-shrink: 0;
            background: var(--sidebar-bg);
        }

        .btn-main {
            width: 100%;
            padding: 16px;
            border: none;
            border-radius: 99px;
            background: var(--red);
            color: white;
            font-family: 'Inter', sans-serif;
            font-size: 0.65rem;
            font-weight: 500;
            letter-spacing: 0.25em;
            text-transform: uppercase;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            transition: all 0.2s;
            box-shadow: 0 8px 24px var(--red-20);
        }

        .btn-main:hover { background: var(--red-hover); }
        .btn-main:disabled { background: var(--black-5); color: var(--black-20); box-shadow: none; cursor: not-allowed; }

        .btn-ticket {
            width: 100%;
            margin-top: 12px;
            padding: 14px;
            border: none;
            border-radius: 99px;
            background: #eab308;
            color: white;
            font-family: 'Inter', sans-serif;
            font-size: 0.65rem;
            font-weight: 500;
            letter-spacing: 0.25em;
            text-transform: uppercase;
            cursor: pointer;
            display: none;
            align-items: center;
            justify-content: center;
            text-decoration: none;
            transition: all 0.2s;
            box-shadow: 0 8px 24px rgba(234,179,8,0.2);
        }

        .btn-ticket:hover { background: #ca8a04; }

        /* ─── Main content ─── */
        .main-content {
            flex: 1;
            padding: 32px 56px 80px;
            overflow-y: auto;
            height: calc(100vh - 72px);
            background: var(--bg);
        }

        /* Attractions label */
        .section-heading {
            font-size: 0.6rem;
            font-weight: 500;
            letter-spacing: 0.25em;
            text-transform: uppercase;
            color: var(--black-30);
            margin-bottom: 20px;
        }

        /* Attraction grid */
        #attrContainer {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 24px;
        }

        /* ─── Attraction card ─── (planner.js renders .attr-item) */
        .attr-item {
            display: flex;
            flex-direction: column;
            height: 360px;
            background: white;
            border: 1px solid var(--black-5);
            border-radius: 24px;
            overflow: hidden;
            cursor: pointer;
            transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
            opacity: 0;
            transform: translateY(16px);
        }

        .attr-item.in-view {
            opacity: 1;
            transform: translateY(0);
            transition: opacity 0.4s ease calc(var(--delay, 0ms)), transform 0.4s ease calc(var(--delay, 0ms)), box-shadow 0.25s, border-color 0.25s;
        }

        .attr-item:hover {
            transform: translateY(-4px);
            box-shadow: 0 20px 50px rgba(0,0,0,0.07);
            border-color: var(--black-10);
        }

        .attr-item.selected {
            border-color: var(--red);
            box-shadow: 0 0 0 3px var(--red-10);
        }

        /* Image placeholder / real img */
        .attr-img-wrap {
            width: 100%;
            flex: 0 0 66.666%;
            background: linear-gradient(135deg, #f0f0ee 0%, #e8e8e4 100%);
            position: relative;
            overflow: hidden;
        }

        .attr-item .card-body {
            width:100%;
            flex: 1 1 auto;
            padding: 12px 14px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }

        .attr-item .card-body > *:last-child {
            margin-bottom: 0;
        }

        .attr-img-wrap img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .attr-line-tag {
            position: absolute;
            top: 14px;
            left: 14px;
            padding: 4px 10px;
            border-radius: 99px;
            font-size: 0.55rem;
            font-weight: 500;
            letter-spacing: 0.15em;
            text-transform: uppercase;
            color: white;
            backdrop-filter: blur(8px);
        }

        .attr-line-tag.red { background: rgba(220,38,38,0.85); }
        .attr-line-tag.blue { background: rgba(37,99,235,0.85); }
        .attr-line-tag.combined { background: rgba(0,0,0,0.5); }

        .attr-body {
            padding: 20px 20px 18px;
        }

        .attr-name {
            font-size: 1rem;
            font-weight: 500;
            color: var(--ink);
            margin-bottom: 6px;
            line-height: 1.3;
        }

        .attr-stop {
            font-size: 0.6rem;
            font-weight: 500;
            letter-spacing: 0.15em;
            text-transform: uppercase;
            color: var(--red);
            margin-bottom: 10px;
        }

        .attr-meta {
            display: flex;
            align-items: center;
            gap: 14px;
            margin-bottom: 14px;
        }

        .attr-meta span {
            font-size: 0.7rem;
            color: var(--black-30);
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .attr-footer {
            border-top: 1px solid var(--black-5);
            padding-top: 14px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .btn-add-card {
            padding: 8px 20px;
            border-radius: 99px;
            font-size: 0.65rem;
            font-weight: 500;
            letter-spacing: 0.15em;
            text-transform: uppercase;
            border: 1px solid var(--black-10);
            background: white;
            color: var(--black-40);
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-add-card:hover {
            background: var(--red);
            border-color: var(--red);
            color: white;
        }

        .btn-add-card.added {
            background: var(--red);
            border-color: var(--red);
            color: white;
        }

        /* ─── Output / Plan ─── */
        #output {
            margin-top: 60px;
        }

        .day-section {
            margin-bottom: 40px;
            opacity: 0;
            transform: translateY(12px);
        }

        .day-section.in-view {
            opacity: 1;
            transform: translateY(0);
            transition: opacity 0.5s ease, transform 0.5s ease;
        }

        .day-title {
            font-family: 'Playfair Display', serif;
            font-style: italic;
            font-size: 1.8rem;
            color: var(--ink);
            margin-bottom: 20px;
            padding-bottom: 12px;
            border-bottom: 1px solid var(--black-5);
        }

        /* ─── Step card ─── */
        .step {
            margin-bottom: 16px;
            background: white;
            border: 1px solid var(--black-5);
            border-radius: 20px;
            overflow: hidden;
            opacity: 0;
            transform: translateY(8px);
            transition: opacity 0.3s, transform 0.3s;
        }
        .step.in-view { opacity: 1; transform: translateY(0); }
        .step.TRANSFER { background: var(--sidebar-bg); border-style: dashed; }
        .step.LUNCH { background: #fff9f5; border-color: #fde8d8; }

        /* Header */
        .step-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 14px 20px 12px;
            border-bottom: 1px solid var(--black-5);
        }
        .step-header-left {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .step-bus-time {
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--ink);
        }
        .step-bus-time::before { content: '🚌 '; }
        .step-ride-dur {
            font-size: 0.72rem;
            color: #888;
            background: #f4f4f2;
            padding: 4px 10px;
            border-radius: 99px;
            white-space: nowrap;
        }
        .step-ride-dur::before { content: '⏳ '; }

        /* Body: route + QR side by side on desktop, stacked on mobile */
        .step-body {
            display: grid;
            grid-template-columns: 1fr auto;
            gap: 0;
            padding: 18px 20px;
        }

        /* Route column */
        .step-route {
            display: flex;
            flex-direction: column;
            gap: 0;
        }
        .step-stop { padding: 4px 0; }
        .step-stop-label {
            font-size: 0.6rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.12em;
            color: #999;
            margin-bottom: 3px;
        }
        .step-stop-time {
            color: var(--red);
            font-weight: 700;
        }
        .step-stop-name {
            font-size: 1.05rem;
            font-weight: 700;
            color: var(--ink);
            line-height: 1.2;
        }
        .step-atr-name {
            font-size: 0.85rem;
            color: #2980b9;
            font-weight: 600;
            margin-top: 4px;
        }
        .step-atr-name::before { content: '👉 '; }
        .step-connector {
            width: 2px;
            height: 20px;
            background: repeating-linear-gradient(
                to bottom,
                #cbd5e0 0px, #cbd5e0 4px,
                transparent 4px, transparent 8px
            );
            margin: 4px 0 4px 6px;
        }

        /* QR column */
        .step-qr {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding-left: 20px;
            border-left: 1px solid var(--black-5);
            margin-left: 20px;
        }
        .step-qr img {
            width: 80px;
            height: 80px;
            border-radius: 8px;
            border: 1px solid #eaeaea;
            padding: 3px;
            background: white;
        }
        .step-qr-label {
            font-size: 0.55rem;
            color: #aaa;
            font-weight: 600;
            margin-top: 5px;
            text-transform: uppercase;
            letter-spacing: 0.1em;
        }

        /* Footer */
        .step-footer {
            display: flex;
            align-items: center;
            gap: 0;
            padding: 12px 20px;
            border-top: 1px dashed #eee;
            background: #fafbfc;
        }
        .step-footer-item { flex: 1; }
        .step-footer-item--right { text-align: right; }
        .step-footer-icon { font-size: 1.3rem; flex-shrink: 0; }
        .step-footer-divider {
            width: 1px;
            height: 32px;
            background: #eee;
            margin: 0 16px;
            flex-shrink: 0;
        }
        .step-footer-label {
            font-size: 0.65rem;
            color: #888;
            text-transform: uppercase;
            font-weight: 600;
            margin-bottom: 3px;
        }
        .step-footer-label--orange { color: #e67e22; }
        .step-footer-value {
            font-size: 0.95rem;
            font-weight: 700;
            color: var(--ink);
        }

        /* ── Mobile step overrides ── */
        @media (max-width: 640px) {
            .step { border-radius: 16px; margin-bottom: 12px; }

            .step-header { padding: 12px 16px 10px; }
            .step-bus-time { font-size: 1.05rem; }

            /* Stack route and QR vertically */
            .step-body {
                grid-template-columns: 1fr;
                padding: 14px 16px;
                gap: 16px;
            }

            /* QR moves below route, horizontal layout */
            .step-qr {
                flex-direction: row;
                align-items: center;
                gap: 14px;
                padding-left: 0;
                border-left: none;
                margin-left: 0;
                border-top: 1px solid var(--black-5);
                padding-top: 14px;
            }
            .step-qr img { width: 64px; height: 64px; }
            .step-qr-label {
                font-size: 0.65rem;
                color: #555;
                text-align: left;
                max-width: 140px;
                line-height: 1.4;
            }
            .step-qr-label::before {
                content: 'Skanuj kod QR aby otworzyc lokalizacje w Mapach Google.';
                display: block;
                white-space: normal;
            }

            .step-stop-name { font-size: 0.95rem; }
            .step-footer { padding: 10px 16px; flex-wrap: wrap; gap: 8px; }
            .step-footer-item { flex: none; width: calc(50% - 4px); }
            .step-footer-item--right { text-align: right; }
            .step-footer-divider { display: none; }
            .step-footer-value { font-size: 0.85rem; }
        }

        /* legacy classes kept for compat */
        .step-time { display: none; }
        .step-content { display: none; }

        /* Ticket recommendation */
        .ticket-wrapper {
            margin-top: 32px;
        }

        .ticket {
            display: flex;
            background: white;
            border: 1px solid var(--black-5);
            border-radius: 20px;
            overflow: hidden;
            box-shadow: 0 8px 32px rgba(0,0,0,0.05);
        }

        .ticket-stub {
            background: var(--red);
            padding: 24px 20px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 8px;
            min-width: 90px;
        }

        .ticket-icon { font-size: 1.6rem; }
        .ticket-label { font-size: 0.55rem; font-weight: 500; letter-spacing: 0.15em; text-transform: uppercase; color: rgba(255,255,255,0.8); text-align: center; }

        .ticket-rip {
            width: 2px;
            background: repeating-linear-gradient(to bottom, var(--black-10) 0, var(--black-10) 6px, transparent 6px, transparent 12px);
        }

        .ticket-main {
            padding: 20px 24px;
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }

        .ticket-name { font-size: 1rem; font-weight: 500; color: var(--ink); }
        .ticket-note { font-size: 0.78rem; color: var(--black-40); margin-top: 6px; }

        /* PDF button */
        #downloadPdfBtn {
            margin-top: 20px;
            display: none;
            background: var(--ink);
            box-shadow: 0 8px 24px rgba(0,0,0,0.12);
        }

        #downloadPdfBtn:hover { background: #333; }

        /* ─── Modal ─── */
        .modal {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.4);
            backdrop-filter: blur(4px);
            z-index: 200;
            align-items: center;
            justify-content: center;
        }

        .modal.active { display: flex; }

        .modal-content {
            background: white;
            border-radius: 28px;
            padding: 36px;
            max-width: 480px;
            width: 90%;
            position: relative;
            box-shadow: 0 32px 80px rgba(0,0,0,0.15);
        }

        .close-modal {
            position: absolute;
            top: 16px;
            right: 16px;
            width: 36px;
            height: 36px;
            border: none;
            background: var(--black-5);
            border-radius: 50%;
            font-size: 1.2rem;
            cursor: pointer;
            color: var(--black-40);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }

        .close-modal:hover { background: var(--red-10); color: var(--red); }

        .modal-content h2 {
            font-family: 'Playfair Display', serif;
            font-size: 1.5rem;
            margin-bottom: 12px;
            padding-right: 40px;
        }

        .modal-desc {
            font-size: 0.85rem;
            color: var(--black-40);
            line-height: 1.6;
            margin-bottom: 20px;
        }

        .modal-info-box {
            background: var(--sidebar-bg);
            border: 1px solid var(--black-5);
            border-radius: 16px;
            padding: 16px 20px;
            margin-bottom: 20px;
            display: flex;
            gap: 24px;
        }

        .modal-info-box p { font-size: 0.8rem; color: var(--black-40); }
        .modal-info-box p strong { color: var(--ink); }

        .modal-actions { display: flex; gap: 10px; }

        #addBtn {
            flex: 1;
            padding: 14px;
            font-size: 0.65rem;
        }

        .btn-secondary {
            flex: 1;
            padding: 14px;
            border: 1px solid var(--black-10);
            border-radius: 99px;
            background: white;
            font-family: 'Inter', sans-serif;
            font-size: 0.65rem;
            font-weight: 500;
            letter-spacing: 0.15em;
            text-transform: uppercase;
            color: var(--black-40);
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-secondary:hover { background: var(--black-5); }

        .spin { animation: spinAnim 0.9s linear infinite; }
        @keyframes spinAnim { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

        /* ─── Responsive (tablet) ─── */
        @media (max-width: 1024px) and (min-width: 641px) {
            .app-body { flex-direction: column; }
            .sidebar { width: 100%; height: auto; position: static; border-right: none; border-bottom: 1px solid var(--black-5); overflow: visible; }
            .main-content { padding: 36px 24px 60px; height: auto; }
        }

        /* ─── Mobile ─── */
        @media (max-width: 640px) {

            /* Hide desktop sidebar entirely */
            .sidebar { display: none !important; }

            /* Main fills full screen with bottom padding for sticky bar */
            .app-body { flex-direction: column; }
            .main-content {
                padding: 24px 16px 120px;
                height: calc(100vh - 56px);
                overflow-y: auto;
            }

            /* Smaller nav */
            .top-nav { height: 56px; padding: 0 16px; }
            .nav-title { font-size: 0.9rem; }

            /* Attraction grid single column */
            #attrContainer { grid-template-columns: 1fr; gap: 16px; }

            /* ── FAB (Floating Action Button) ── */
            .mob-fab {
                display: flex !important;
                position: fixed;
                bottom: 28px;
                right: 20px;
                z-index: 100;
                flex-direction: column;
                align-items: flex-end;
                gap: 12px;
            }

            /* Sheet open button — small FAB */
            .mob-sheet-trigger {
                width: 52px; height: 52px;
                border: none;
                border-radius: 50%;
                background: white;
                box-shadow: 0 4px 20px rgba(0,0,0,0.12), 0 1px 4px rgba(0,0,0,0.08);
                display: flex;
                align-items: center;
                justify-content: center;
                cursor: pointer;
                position: relative;
                transition: transform 0.2s, box-shadow 0.2s;
            }
            .mob-sheet-trigger:active { transform: scale(0.93); }
            .mob-sheet-trigger svg { width: 22px; height: 22px; color: var(--ink); }

            .mob-sheet-dot {
                position: absolute;
                top: 8px; right: 8px;
                width: 9px; height: 9px;
                background: var(--red);
                border-radius: 50%;
                border: 2px solid white;
                display: none;
            }
            .mob-sheet-dot.visible { display: block; }

            /* Generate button — main FAB */
            .mob-btn-plan {
                height: 56px;
                padding: 0 22px;
                border: none;
                border-radius: 99px;
                background: var(--red);
                color: white;
                font-family: 'Inter', sans-serif;
                font-size: 0.65rem;
                font-weight: 600;
                letter-spacing: 0.2em;
                text-transform: uppercase;
                cursor: pointer;
                display: flex;
                align-items: center;
                gap: 10px;
                box-shadow: 0 6px 24px var(--red-20), 0 2px 8px rgba(220,38,38,0.2);
                transition: transform 0.2s, box-shadow 0.2s;
            }
            .mob-btn-plan:active { transform: scale(0.95); box-shadow: 0 2px 10px var(--red-20); }

            /* Count badge on FAB */
            .mob-count-badge {
                display: none;
                align-items: center;
                justify-content: center;
                min-width: 22px; height: 22px;
                padding: 0 5px;
                background: white;
                color: var(--red);
                border-radius: 99px;
                font-size: 0.7rem;
                font-weight: 700;
                flex-shrink: 0;
            }
            .mob-count-badge.visible { display: inline-flex; }

            /* ── Bottom sheet ── */
            .mobile-sheet-overlay {
                display: none;
                position: fixed;
                inset: 0;
                background: rgba(0,0,0,0.4);
                z-index: 200;
                backdrop-filter: blur(2px);
            }
            .mobile-sheet-overlay.open { display: block !important; }

            .mobile-sheet {
                position: fixed;
                bottom: 0; left: 0; right: 0;
                background: var(--bg);
                border-radius: 24px 24px 0 0;
                z-index: 201;
                transform: translateY(100%);
                transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
                max-height: 88vh;
                display: flex !important;
                flex-direction: column;
                overflow: hidden;
            }
            .mobile-sheet.open { transform: translateY(0) !important; }

            .sheet-handle-wrap {
                padding: 12px 0 4px;
                display: flex;
                justify-content: center;
                flex-shrink: 0;
                cursor: grab;
            }
            .sheet-handle {
                width: 40px; height: 4px;
                background: var(--black-10);
                border-radius: 99px;
            }

            .sheet-header {
                padding: 8px 20px 16px;
                display: flex;
                align-items: center;
                justify-content: space-between;
                flex-shrink: 0;
                border-bottom: 1px solid var(--black-5);
            }
            .sheet-header-title {
                font-family: 'Playfair Display', serif;
                font-style: italic;
                font-size: 1.15rem;
                color: var(--ink);
            }
            .sheet-close {
                width: 32px; height: 32px;
                border: none;
                background: var(--black-5);
                border-radius: 50%;
                display: flex; align-items: center; justify-content: center;
                cursor: pointer;
                color: var(--black-40);
                font-size: 1rem;
            }

            .sheet-body {
                flex: 1;
                overflow-y: auto;
                padding: 16px 20px;
                -webkit-overflow-scrolling: touch;
            }

            .sheet-footer {
                padding: 12px 20px 20px;
                border-top: 1px solid var(--black-5);
                flex-shrink: 0;
                background: var(--bg);
            }
        }

        /* Hide mobile-only elements on desktop (min-width overrides) */
        @media (min-width: 641px) {
            .mob-fab,
            .mobile-sheet-overlay,
            .mobile-sheet { display: none !important; }
        }

        /* ── Integration: adjust sticky offset to match main site navbar (70px) ── */
        .sidebar {
            top: 70px;
            height: calc(100vh - 70px);
        }
        .main-content {
            height: calc(100vh - 70px);
        }
        .app-body {
            min-height: calc(100vh - 70px);
        }
        /* app-wrapper no longer contains the navbar */
        .app-wrapper {
            min-height: calc(100vh - 70px);
        }

@media print {
    /* Hide everything except the print container */
    body > *:not(#print-plan-container) { display: none !important; }
    #print-plan-container { display: block !important; }

    #print-plan-container {
        font-family: Arial, sans-serif;
        font-size: 11px;
        color: #1A1A1A;
        background: #fff;
        padding: 0;
        margin: 0;
    }

    .print-header {
        margin-bottom: 20px;
        padding-bottom: 14px;
        border-bottom: 2px solid #dc2626;
    }

    .print-day-section {
        margin-bottom: 24px;
        page-break-inside: avoid;
    }

    .print-day-title {
        font-size: 16px;
        font-weight: 700;
        color: #1A1A1A;
        margin: 0 0 10px;
        padding-bottom: 8px;
        border-bottom: 1px solid #eee;
    }

    .print-step {
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        padding: 10px 14px;
        margin-bottom: 8px;
        page-break-inside: avoid;
        background: #fafafa;
    }
    .print-step.is-transfer { background: #fff9f0; border-color: #fed7aa; border-left: 4px solid #e67e22; }
    .print-step.is-lunch    { background: #fff5f0; border-color: #fdd5bb; }
    .print-step.is-walk     { border-left: 4px solid #27ae60; }

    .print-step-inner { /* strip any inline styles that may clash */ }

    /* QR code images — keep them; the browser loads them normally during print */
    .print-step img { max-width: 90px !important; height: auto; }

    .line-badge {
        display: inline-block;
        background: #dc2626;
        color: white;
        font-size: 8px;
        font-weight: 700;
        padding: 1px 6px;
        border-radius: 99px;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        vertical-align: middle;
        margin-left: 4px;
    }
}

