        :root {
            --primary: #f97316;
            --primary-hover: #ea580c;
            --primary-light: #fff7ed;
            --primary-border: #fed7aa;
            --text-main: #0f172a;
            --text-muted: #64748b;
            --text-placeholder: #b4bdca;
            --bg-light: #f8fafc;
            --border-light: #e2e8f0;
            --success: #10b981;
            --error: #ef4444;
        }

        *, *::before, *::after {
            box-sizing: border-box;
        }

        input::placeholder,
        textarea::placeholder {
            color: var(--text-placeholder);
            opacity: 1;
        }

        /* viewer 내부 임베드용 body 오버라이드 제거 */
        .real-invite-wrapper {
            font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
            color: var(--text-main);
            padding: 10px 14px 20px;
            box-sizing: border-box;
        }

        .container {
            width: 100%;
            max-width: 480px;
        }

        .logo-wrap {
            text-align: center;
            margin-bottom: 24px;
        }

        .logo {
            font-family: 'Outfit', sans-serif;
            font-size: 24px;
            font-weight: 800;
            color: var(--primary);
            letter-spacing: -0.02em;
            display: inline-block;
        }

        /* 쉘 카드 */
        .invite-shell {
            background: #ffffff;
            border-radius: 20px;
            box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.08), 0 8px 12px -6px rgba(15, 23, 42, 0.04);
            border: 1px solid var(--border-light);
            overflow: hidden;
            position: relative;
        }

        /* 모바일: 박스 없이 화면 꽉 채우기 */
        @media (max-width: 600px) {
            body {
                padding: 0;
                background: #ffffff;
                align-items: stretch;
            }

            .container {
                max-width: 100%;
                display: flex;
                flex-direction: column;
                min-height: 100vh;
            }

            .logo-wrap {
                margin-bottom: 0;
                padding: calc(20px + env(safe-area-inset-top)) 0 12px;
            }

            .invite-shell {
                flex: 1;
                border: none;
                border-radius: 0;
                box-shadow: none;
            }

            /* 알레르기 배지: 모바일에서 한 줄에 3개 */
            .invite-allergy-list {
                grid-template-columns: repeat(3, 1fr);
            }
        }

        /* 탑바 */
        .invite-topbar {
            height: 56px;
            display: flex;
            align-items: center;
            padding: 0 20px;
            border-bottom: 1px solid #f1f5f9;
            background: #ffffff;
        }

        .back-btn {
            background: none;
            border: none;
            color: var(--text-muted);
            font-size: 14px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 6px;
            cursor: pointer;
            padding: 8px 4px;
            transition: color 0.15s;
        }

        .back-btn:hover {
            color: var(--primary);
        }

        .back-btn svg {
            width: 18px;
            height: 18px;
        }

        /* 진행률 바 */
        .invite-progress {
            height: 4px;
            background: #f1f5f9;
            width: 100%;
            position: relative;
        }

        .invite-progress-bar {
            height: 100%;
            background: var(--primary);
            width: 0%;
            transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        }

        /* 헤더 */
        .invite-header {
            padding: 28px 24px 20px;
            background: #ffffff;
        }

        .invite-step-chip {
            display: inline-block;
            font-size: 11px;
            font-weight: 700;
            color: var(--primary);
            background: var(--primary-light);
            border: 1px solid var(--primary-border);
            border-radius: 6px;
            padding: 3px 10px;
            margin-bottom: 12px;
            letter-spacing: -0.01em;
            text-transform: uppercase;
        }

        .invite-title {
            font-size: 20px;
            font-weight: 800;
            color: var(--text-main);
            line-height: 1.45;
            margin: 0;
        }

        /* 스텝 컨테이너 */
        .invite-step {
            display: none;
            padding: 0 24px 28px;
        }

        .invite-step.is-active {
            display: block;
            animation: fadeIn 0.25s ease-out;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(8px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* 공통 요약 스타일 */
        .invite-summary {
            background: var(--bg-light);
            border: 1px solid var(--border-light);
            border-radius: 12px;
            padding: 16px;
            display: flex;
            flex-direction: column;
            gap: 12px;
            margin-bottom: 24px;
        }

        .invite-summary-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 14px;
        }

        .invite-summary-label {
            color: var(--text-muted);
            font-weight: 500;
        }

        .invite-summary-value {
            color: var(--text-main);
            font-weight: 700;
            text-align: right;
        }

        /* 공통 버튼 */
        .button {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 48px;
            background: var(--primary);
            color: #ffffff;
            border: none;
            border-radius: 10px;
            font-size: 15px;
            font-weight: 700;
            cursor: pointer;
            transition: background 0.15s, transform 0.1s;
        }

        .button:hover {
            background: var(--primary-hover);
        }

        .button:active {
            transform: scale(0.98);
        }

        .button:disabled {
            background: #cbd5e1;
            cursor: not-allowed;
            transform: none;
        }

        /* 로그인 / 회원가입 스타일 */
        .invite-auth-zone {
            display: flex;
            flex-direction: column;
        }

        .auth-tabs {
            display: flex;
            border-bottom: 2px solid var(--border-light);
            margin-bottom: 20px;
        }

        .auth-tab-btn {
            flex: 1;
            padding: 12px;
            text-align: center;
            font-size: 14px;
            font-weight: 700;
            color: var(--text-muted);
            background: none;
            border: none;
            cursor: pointer;
            border-bottom: 2px solid transparent;
            margin-bottom: -2px;
            transition: color 0.15s, border-color 0.15s;
        }

        .auth-tab-btn.is-active {
            color: var(--primary);
            border-bottom-color: var(--primary);
        }

        .auth-panel {
            display: none;
        }

        .auth-panel.is-active {
            display: block;
        }

        .input-box {
            position: relative;
            margin-bottom: 14px;
        }

        .input-box input {
            width: 100%;
            height: 46px;
            padding: 0 14px;
            border: 1.5px solid var(--border-light);
            border-radius: 10px;
            font-size: 14px;
            color: var(--text-main);
            outline: none;
            transition: border-color 0.15s, box-shadow 0.15s;
        }

        .input-box input:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
        }

        .input-box.date-picker svg {
            position: absolute;
            right: 14px;
            top: 14px;
            color: var(--text-muted);
            width: 18px;
            height: 18px;
            pointer-events: none;
        }

        .auth-help {
            font-size: 12px;
            color: var(--text-muted);
            text-align: center;
            margin-top: 12px;
        }

        /* 핀번호 슬롯 및 키패드 */
        .invite-pin-zone {
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .invite-pin-phase {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 16px;
        }

        .invite-pin-phase-item {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 13px;
            font-weight: 600;
            color: var(--text-muted);
        }

        .invite-pin-phase-item.is-active {
            color: var(--primary);
        }

        .invite-pin-phase-item.is-done {
            color: var(--success);
        }

        .invite-pin-phase-dot {
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: #e2e8f0;
            color: var(--text-muted);
            font-size: 10px;
            font-weight: 800;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .invite-pin-phase-item.is-active .invite-pin-phase-dot {
            background: var(--primary);
            color: #ffffff;
        }

        .invite-pin-phase-item.is-done .invite-pin-phase-dot {
            background: var(--success);
            color: #ffffff;
        }

        .invite-pin-phase-line {
            width: 24px;
            height: 2px;
            background: #e2e8f0;
        }

        .invite-pin-phase-line.is-done {
            background: var(--success);
        }

        .invite-pin-copy {
            font-size: 14px;
            color: var(--text-muted);
            margin: 0 0 20px 0;
            text-align: center;
            font-weight: 500;
        }

        .invite-pin-slots {
            display: flex;
            gap: 10px;
            margin-bottom: 24px;
        }

        .invite-pin-slot {
            width: 14px;
            height: 14px;
            border-radius: 50%;
            border: 2px solid #cbd5e1;
            transition: background 0.15s, border-color 0.15s;
        }

        .invite-pin-slot.is-filled {
            background: var(--primary);
            border-color: var(--primary);
        }

        .invite-pin-error {
            font-size: 13px;
            font-weight: 600;
            color: var(--error);
            margin: 0 0 16px 0;
            text-align: center;
        }

        /* 가상 키패드 */
        .invite-keypad {
            display: flex;
            flex-direction: column;
            gap: 8px;
            width: 100%;
            max-width: 320px;
        }

        .invite-keypad-row {
            display: flex;
            gap: 8px;
        }

        .invite-key {
            flex: 1;
            height: 48px;
            background: var(--bg-light);
            border: 1px solid var(--border-light);
            border-radius: 10px;
            font-size: 18px;
            font-weight: 700;
            color: var(--text-main);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.1s, border-color 0.1s;
        }

        .invite-key:hover:not(:disabled) {
            background: #e2e8f0;
            border-color: #cbd5e1;
        }

        .invite-key:active:not(:disabled) {
            transform: scale(0.96);
        }

        .invite-key:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }

        .invite-key.invite-key-reset {
            font-size: 12px;
            color: var(--text-muted);
            font-weight: 600;
        }

        .invite-key.invite-key-action {
            color: var(--text-muted);
        }

        /* 학생 등록 양식 */
        .invite-student-notice {
            background: var(--primary-light);
            border: 1px solid var(--primary-border);
            border-radius: 12px;
            padding: 14px 16px;
            font-size: 14px;
            color: var(--primary-hover);
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .invite-student-panel {
            border: 1px solid var(--border-light);
            border-radius: 14px;
            padding: 20px;
            margin-bottom: 16px;
            background: #ffffff;
        }

        .invite-student-panel-head {
            margin-bottom: 16px;
        }

        .invite-student-panel-title {
            font-size: 15px;
            font-weight: 800;
            color: var(--text-main);
            display: block;
            margin-bottom: 4px;
        }

        .invite-student-panel-meta {
            font-size: 11px;
            color: var(--text-muted);
            display: block;
        }

        .invite-student-field {
            margin-bottom: 14px;
        }

        .invite-student-field:last-child {
            margin-bottom: 0;
        }

        .invite-student-label {
            display: block;
            font-size: 12px;
            font-weight: 700;
            color: var(--text-main);
            margin-bottom: 6px;
        }

        /* 관계/알레르기 칩 */
        .invite-relation-list {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 10px;
        }

        .invite-allergy-list {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 8px;
            margin-bottom: 10px;
        }

        .invite-relation-chip, .invite-allergy-chip {
            padding: 6px 14px;
            font-size: 13px;
            font-weight: 600;
            color: var(--text-muted);
            background: var(--bg-light);
            border: 1.5px solid var(--border-light);
            border-radius: 20px;
            cursor: pointer;
            transition: all 0.15s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
            white-space: nowrap;
        }

        .invite-relation-chip:hover, .invite-allergy-chip:hover {
            border-color: #cbd5e1;
            color: var(--text-main);
        }

        .invite-relation-chip.is-selected {
            background: var(--primary-light);
            border-color: var(--primary);
            color: var(--primary);
        }

        .invite-allergy-chip.is-selected {
            background: #fef2f2;
            border-color: #fca5a5;
            color: #ef4444;
        }

        /* 추가 정보 토글 */
        .invite-extra-toggle {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            width: 100%;
            padding: 12px;
            background: var(--bg-light);
            border: 1px dashed var(--border-light);
            border-radius: 12px;
            font-size: 13px;
            font-weight: 600;
            color: var(--text-muted);
            cursor: pointer;
            margin-bottom: 16px;
            transition: background 0.15s;
        }

        .invite-extra-toggle:hover {
            background: #f1f5f9;
            color: var(--text-main);
        }

        .invite-extra-toggle-badge {
            background: #ef4444;
            color: #ffffff;
            font-size: 10px;
            font-weight: 800;
            padding: 1px 6px;
            border-radius: 10px;
        }

        .invite-student-textarea {
            width: 100%;
            padding: 10px 12px;
            border: 1.5px solid var(--border-light);
            border-radius: 10px;
            font-size: 13px;
            color: var(--text-main);
            outline: none;
            resize: none;
            font-family: inherit;
            transition: border-color 0.15s;
        }

        .invite-student-textarea:focus {
            border-color: var(--primary);
        }

        /* 학생 핀번호 영역 */
        .invite-student-pin-toggle {
            display: flex;
            justify-content: space-between;
            align-items: center;
            width: 100%;
            background: none;
            border: none;
            padding: 0;
            cursor: pointer;
            text-align: left;
        }

        .invite-student-pin-text strong {
            font-size: 14px;
            font-weight: 700;
            color: var(--text-main);
            display: block;
        }

        .invite-student-pin-text span {
            font-size: 11px;
            color: var(--text-muted);
            display: block;
            margin-top: 2px;
        }

        .invite-student-pin-switch {
            color: var(--text-muted);
            transition: color 0.15s;
        }

        .invite-student-pin-switch.is-active {
            color: var(--primary);
        }

        .invite-student-pin-switch svg {
            width: 36px;
            height: 24px;
        }

        .invite-student-pin-panel {
            margin-top: 16px;
            border-top: 1px solid var(--border-light);
            padding-top: 16px;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .invite-student-pin-phase {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 12px;
        }

        .invite-student-pin-phase-item {
            font-size: 12px;
            font-weight: 600;
            color: var(--text-muted);
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .invite-student-pin-phase-item.is-active {
            color: var(--primary);
        }

        .invite-student-pin-phase-item.is-done {
            color: var(--success);
        }

        .invite-student-pin-phase-dot {
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: #e2e8f0;
            color: var(--text-muted);
            font-size: 9px;
            font-weight: 800;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .invite-student-pin-phase-item.is-active .invite-student-pin-phase-dot {
            background: var(--primary);
            color: #ffffff;
        }

        .invite-student-pin-phase-item.is-done .invite-student-pin-phase-dot {
            background: var(--success);
            color: #ffffff;
        }

        .invite-student-pin-phase-line {
            width: 16px;
            height: 1px;
            background: #e2e8f0;
        }

        .invite-student-pin-phase-line.is-done {
            background: var(--success);
        }

        .invite-student-pin-slots {
            display: flex;
            gap: 8px;
            margin-bottom: 16px;
        }

        .invite-student-pin-slot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            border: 2px solid #cbd5e1;
            transition: background 0.15s, border-color 0.15s;
        }

        .invite-student-pin-slot.is-filled {
            background: var(--primary);
            border-color: var(--primary);
        }

        .invite-student-pin-error {
            font-size: 12px;
            font-weight: 600;
            color: var(--error);
            margin: 0 0 10px 0;
            text-align: center;
        }

        .invite-student-error {
            font-size: 12px;
            font-weight: 500;
            color: var(--error);
            margin-top: 0px;
            margin-bottom: 8px;
            display: none;
        }

        .invite-student-field.has-error .input-box {
            margin-bottom: 4px;
        }

        .invite-student-field.has-error input {
            border-color: var(--error) !important;
        }

        .invite-student-field.has-error input:focus {
            box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
            border-color: var(--error) !important;
        }

        .invite-student-pin-done-box {
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: var(--bg-light);
            border: 1px solid var(--border-light);
            border-radius: 8px;
            padding: 8px 12px;
            margin-top: 12px;
            font-size: 13px;
        }

        .invite-student-pin-done-label {
            font-weight: 600;
            color: var(--text-main);
        }

        .invite-student-pin-reset-btn {
            background: none;
            border: none;
            color: var(--primary);
            font-weight: 700;
            cursor: pointer;
            font-size: 12px;
        }

        /* 로딩 디스플레이 */
        .loading-wrap {
            position: fixed;
            left: 0; top: 0; right: 0; bottom: 0;
            z-index: 9999;
            background: rgba(15, 23, 42, 0.4);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .loading-box {
            background: #ffffff;
            padding: 24px;
            border-radius: 16px;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 12px;
        }

        .spinner {
            width: 32px;
            height: 32px;
            border: 3.5px solid var(--primary-light);
            border-top-color: var(--primary);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }
