        *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; max-width: 100%; -webkit-tap-highlight-color: transparent; }
        html, body { overflow-x: hidden !important; width: 100%; max-width: 100vw; }
        :root { --bg-dark: #050b14; --gold: #d4af37; --glass-border: rgba(212, 175, 55, 0.25); --text-main: #e2e8f0; --text-muted: rgba(255, 255, 255, 0.6); --form-bg: #ffffff; --form-text: #1a253a; }
        body { font-family: 'Vazirmatn', sans-serif; background-color: var(--bg-dark); color: var(--text-main); min-height: 100vh; position: relative; }
        .ambient-glow { position: fixed; inset: 0; z-index: -1; background: radial-gradient(circle at 15% 30%, rgba(20, 50, 100, 0.4) 0%, transparent 50%), radial-gradient(circle at 85% 70%, rgba(120, 20, 40, 0.25) 0%, transparent 50%), radial-gradient(circle at 50% 50%, rgba(10, 20, 40, 0.9) 0%, #020408 100%); }
        .nav-wrapper { display: flex; justify-content: center; padding: 20px 10px; position: relative; z-index: 100; width: 100%; }
        .nav-pill { background: rgba(10, 20, 40, 0.7); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--glass-border); border-radius: 50px; padding: 10px 20px; display: flex; gap: 15px; box-shadow: 0 10px 40px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.1); max-width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
        .nav-pill::-webkit-scrollbar { display: none; }
        .nav-pill a { color: var(--text-main); text-decoration: none; font-size: 0.85rem; font-weight: 500; transition: all 0.3s ease; opacity: 0.85; white-space: nowrap; flex-shrink: 0; }
        .nav-pill a:hover { color: var(--gold); opacity: 1; text-shadow: 0 0 15px rgba(212, 175, 55, 0.6); }
        /* Auth corner buttons */
        .auth-corner { position: absolute; top: 20px; left: 16px; z-index: 200; display: flex; gap: 8px; flex-wrap: wrap; }
        .auth-btn { padding: 8px 16px; border-radius: 20px; font-family: 'Vazirmatn', sans-serif; font-weight: 700; font-size: 0.82rem; cursor: pointer; border: 1px solid var(--glass-border); background: rgba(10,20,40,0.75); backdrop-filter: blur(12px); color: var(--text-main); transition: all 0.3s; }
        .auth-btn:hover { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 20px rgba(212,175,55,0.25); }
        .auth-btn.primary { background: var(--gold); color: var(--bg-dark); border-color: var(--gold); }
        .auth-btn.primary:hover { filter: brightness(1.1); color: var(--bg-dark); }
        .auth-user-chip { display: none; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 20px; background: rgba(212,175,55,0.15); border: 1px solid var(--gold); color: var(--gold); font-size: 0.8rem; font-weight: 600; }
        .auth-user-chip.visible { display: flex; }
        .auth-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(6px); z-index: 9999; display: none; align-items: center; justify-content: center; padding: 16px; }
        .auth-modal-overlay.open { display: flex; }
        .auth-modal { background: #fff; color: #1a253a; border-radius: 18px; width: 100%; max-width: 400px; padding: 28px 24px; box-shadow: 0 25px 60px rgba(0,0,0,0.5); position: relative; }
        .auth-modal h3 { font-family: 'Lalezar', cursive; font-size: 1.5rem; margin-bottom: 6px; color: var(--bg-dark); text-align: center; }
        .auth-modal .sub { text-align: center; color: #666; font-size: 0.85rem; margin-bottom: 20px; }
        .auth-modal .close-x { position: absolute; top: 12px; left: 14px; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: #999; }
        .auth-modal label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 5px; color: #444; }
        .auth-modal input { width: 100%; padding: 11px 14px; border: 1px solid #ddd; border-radius: 8px; font-family: 'Vazirmatn', sans-serif; font-size: 0.9rem; margin-bottom: 14px; background: #f8f9fa; }
        .auth-modal input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,175,55,0.2); }
        .auth-modal .submit-btn { width: 100%; padding: 13px; background: var(--bg-dark); color: var(--gold); border: none; border-radius: 10px; font-family: 'Lalezar', cursive; font-size: 1.15rem; cursor: pointer; margin-top: 6px; }
        .auth-modal .submit-btn:hover { background: var(--gold); color: var(--bg-dark); }
        .auth-modal .switch-link { text-align: center; margin-top: 16px; font-size: 0.85rem; color: #666; }
        .auth-modal .switch-link a { color: var(--gold); font-weight: 700; cursor: pointer; text-decoration: none; }
        .auth-msg { text-align: center; font-size: 0.85rem; margin-bottom: 12px; min-height: 20px; }
        .auth-msg.err { color: #c0392b; }
        .auth-msg.ok { color: #27ae60; }
        .btn-save-db { padding: 14px 30px; background: #0d7377; color: #fff; border: none; border-radius: 12px; font-family: 'Lalezar', cursive; font-size: 1.15rem; cursor: pointer; transition: all 0.3s; display: flex; align-items: center; justify-content: center; gap: 8px; flex: 1 1 200px; max-width: 100%; }
        .btn-save-db:hover { background: #14a3a8; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(13,115,119,0.35); }
        .btn-save-db:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
        .form-summary-box {
            margin: 20px 0 10px;
            padding: 16px;
            background: #f8fafc;
            border: 2px solid var(--gold);
            border-radius: 12px;
        }
        .form-summary-box .summary-title {
            font-weight: 800;
            font-size: 1rem;
            color: var(--bg-dark);
            margin-bottom: 8px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            flex-wrap: wrap;
        }
        .form-summary-box .summary-hint {
            font-size: 0.78rem;
            color: #666;
            margin-bottom: 10px;
            line-height: 1.6;
        }
        .form-summary-box textarea.summary-output {
            width: 100%;
            min-height: 180px;
            padding: 14px;
            border: 1px solid #ccc;
            border-radius: 8px;
            font-family: 'Vazirmatn', sans-serif;
            font-size: 0.92rem;
            line-height: 1.85;
            direction: rtl;
            background: #fff;
            resize: vertical;
            box-sizing: border-box;
        }
        .form-summary-box textarea.summary-output:focus {
            outline: none;
            border-color: var(--gold);
            box-shadow: 0 0 0 3px rgba(212,175,55,0.2);
        }
        .btn-refresh-summary {
            padding: 6px 12px;
            font-size: 0.78rem;
            border-radius: 8px;
            border: 1px solid var(--bg-dark);
            background: #fff;
            cursor: pointer;
            font-family: 'Vazirmatn', sans-serif;
            font-weight: 700;
        }
        .btn-refresh-summary:hover { background: var(--bg-dark); color: var(--gold); }
        .print-settings-panel {
            margin: 14px 0 8px;
            padding: 14px 16px;
            background: #eef6f7;
            border: 1px solid #b8d4d6;
            border-radius: 12px;
        }
        .print-settings-panel summary {
            cursor: pointer;
            font-weight: 800;
            color: #0d7377;
            font-size: 0.92rem;
            list-style: none;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .print-settings-panel summary::-webkit-details-marker { display: none; }
        .print-settings-panel summary::before { content: '▸'; transition: transform .2s; }
        .print-settings-panel[open] summary::before { content: '▾'; }
        .print-settings-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
            gap: 12px;
            margin-top: 12px;
        }
        .print-settings-grid label {
            display: block;
            font-size: 0.78rem;
            font-weight: 600;
            color: #444;
            margin-bottom: 4px;
        }
        .print-settings-grid select,
        .print-settings-grid input[type="text"] {
            width: 100%;
            padding: 8px 10px;
            border: 1px solid #ccc;
            border-radius: 8px;
            font-family: 'Vazirmatn', sans-serif;
            font-size: 0.85rem;
            background: #fff;
            box-sizing: border-box;
        }
        .print-settings-checks {
            display: flex;
            flex-wrap: wrap;
            gap: 10px 16px;
            margin-top: 12px;
            font-size: 0.82rem;
        }
        .print-settings-checks label {
            display: flex;
            align-items: center;
            gap: 6px;
            cursor: pointer;
            color: #333;
        }
        .print-settings-checks input { accent-color: #0d7377; width: 16px; height: 16px; }
        .print-letterhead {
            display: none;
            text-align: center;
            border-bottom: 2px solid #000;
            padding-bottom: 10px;
            margin-bottom: 14px;
        }
        .print-letterhead .clinic-sub { font-size: 10pt; color: #333; margin-top: 4px; }
        .print-signature { display: none; }
        .print-report { display: none; }

        /* ---------- خطای اعتبارسنجی فیلد ---------- */
        .field-error {
            display: none;
            color: #c0392b;
            font-size: 0.8rem;
            margin-top: 4px;
            font-weight: 600;
        }
        .form-input.input-invalid {
            border-color: #c0392b !important;
            background: #fdf3f2 !important;
        }

        /* ---------- پیش‌نمایش چاپ ---------- */
        body.print-preview-open { overflow: hidden !important; }
        .print-preview-overlay {
            position: fixed;
            inset: 0;
            z-index: 9999;
            background: rgba(0, 0, 0, 0.72);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }
        .print-preview-box {
            background: #f1f3f6;
            border-radius: 16px;
            width: min(920px, 100%);
            height: min(92vh, 100%);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
        }
        .print-preview-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 14px 18px;
            background: #0d7377;
            color: #fff;
            font-family: 'Lalezar', cursive;
            font-size: 1.15rem;
        }
        .print-preview-close {
            background: transparent;
            border: none;
            color: #fff;
            font-size: 1.2rem;
            cursor: pointer;
            line-height: 1;
            padding: 4px 8px;
            border-radius: 8px;
        }
        .print-preview-close:hover { background: rgba(255, 255, 255, 0.18); }
        .print-preview-body {
            flex: 1;
            overflow: auto;
            padding: 16px;
            display: flex;
            justify-content: center;
            align-items: flex-start;
        }
        .print-preview-body iframe {
            width: 210mm;
            max-width: 100%;
            min-height: 297mm;
            border: none;
            display: block;
            flex: 0 0 auto;
            background: #fff;
            box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
        }
        .print-preview-foot {
            display: flex;
            gap: 10px;
            align-items: center;
            justify-content: flex-end;
            padding: 12px 18px;
            background: #fff;
            border-top: 1px solid #dfe3e8;
        }
        .print-preview-foot button {
            padding: 10px 26px;
            border-radius: 10px;
            border: none;
            cursor: pointer;
            font-family: 'Lalezar', cursive;
            font-size: 1rem;
        }
        .print-preview-msg {
            margin-inline-end: auto;
            font-size: 0.92rem;
            color: #555;
        }
        .print-preview-msg.ok { color: #0d7377; font-weight: bold; }
        .print-preview-msg.err { color: #c0392b; font-weight: bold; }
        .print-preview-pdf { background: #2f6fe4; color: #fff; }
        .print-preview-pdf:hover { background: #2559b8; }
        .print-preview-pdf:disabled { opacity: .6; cursor: default; }
        .print-preview-cancel { background: #e6e9ee; color: #333; }
        .print-preview-cancel:hover { background: #d7dbe2; }
        .print-preview-go { background: #0d7377; color: #fff; }
        .print-preview-go:hover { background: #0a5c5f; }
        .page-section { transition: opacity 0.5s ease, transform 0.5s ease; width: 100%; }
        .hidden-section { display: none !important; opacity: 0; transform: translateY(20px); }
        .hero-section { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 20px; position: relative; width: 100%; padding-left: 10px; padding-right: 10px; }
        .artistic-title { font-family: 'Lalezar', cursive; font-size: clamp(2.5rem, 8vw, 6.5rem); font-weight: normal; background: linear-gradient(180deg, #ffffff 0%, var(--gold) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 10px; filter: drop-shadow(0 0 30px rgba(212, 175, 55, 0.4)); line-height: 1.4; letter-spacing: 2px; word-break: keep-all; width: 100%; }
        .visual-container { position: relative; width: 100%; max-width: 1000px; height: clamp(200px, 40vw, 400px); display: flex; justify-content: center; align-items: center; margin: 10px 0 30px; }
        .ecg-svg { position: absolute; width: 100%; height: 100%; z-index: 1; filter: drop-shadow(0 0 8px var(--gold)) drop-shadow(0 0 20px rgba(212, 175, 55, 0.4)); }
        .ecg-path { stroke: var(--gold); stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 2500; stroke-dashoffset: 2500; animation: drawECG 3.5s linear infinite; }
        @keyframes drawECG { to { stroke-dashoffset: 0; } }
        .real-heart-img { position: relative; z-index: 2; width: clamp(180px, 35vw, 350px); height: auto; filter: drop-shadow(0 30px 50px rgba(0,0,0,0.9)) brightness(1.1); animation: pulseHeart 1.8s ease-in-out infinite; mix-blend-mode: screen; }
        @keyframes pulseHeart { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
        .services-row { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 20px 0 50px; z-index: 10; width: 100%; }
        .service-card { background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.01) 100%); border: 1px solid var(--glass-border); padding: 14px 20px; border-radius: 16px; color: var(--gold); font-weight: 700; font-size: 0.9rem; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 0 25px rgba(212, 175, 55, 0.08); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); cursor: pointer; text-align: center; flex: 1 1 180px; max-width: 100%; word-break: break-word; }
        .service-card:hover { background: rgba(212, 175, 55, 0.12); border-color: var(--gold); box-shadow: 0 0 40px rgba(212, 175, 55, 0.25); transform: translateY(-4px); color: #fff; }
        .service-card.admin-only { display: none; }
        body.is-admin .service-card.admin-only { display: flex; align-items: center; justify-content: center; }
        .service-card.locked {
            opacity: 0.45;
            cursor: not-allowed;
            filter: grayscale(0.4);
            pointer-events: none;
        }
        body.is-admin .service-card.locked {
            opacity: 1;
            cursor: pointer;
            filter: none;
            pointer-events: auto;
        }
        .service-card .lock-hint {
            display: block;
            font-size: 0.7rem;
            font-weight: 500;
            color: var(--text-muted);
            margin-top: 6px;
        }
        body.is-admin .service-card .lock-hint { display: none; }
        .ecg-upload-box {
            border: 2px dashed #d4af37;
            border-radius: 14px;
            padding: 20px 16px;
            background: #faf8f0;
            text-align: center;
            margin-bottom: 8px;
        }
        .ecg-upload-box .upload-title {
            font-weight: 800;
            color: #1a253a;
            margin-bottom: 8px;
            font-size: 1rem;
        }
        .ecg-upload-box .upload-hint {
            font-size: 0.8rem;
            color: #666;
            margin-bottom: 14px;
            line-height: 1.6;
        }
        .ecg-upload-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            justify-content: center;
            margin-bottom: 12px;
        }
        .ecg-upload-actions .btn-upload {
            padding: 11px 18px;
            border-radius: 10px;
            border: none;
            font-family: 'Vazirmatn', sans-serif;
            font-weight: 700;
            font-size: 0.88rem;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            transition: all 0.25s;
        }
        .btn-upload-file {
            background: #1a253a;
            color: #d4af37;
        }
        .btn-upload-file:hover { background: #d4af37; color: #1a253a; }
        .btn-upload-camera {
            background: #0d7377;
            color: #fff;
        }
        .btn-upload-camera:hover { filter: brightness(1.1); }
        .btn-upload-clear {
            background: #fff;
            color: #c0392b;
            border: 2px solid #c0392b !important;
        }
        .btn-upload-clear:hover { background: #c0392b; color: #fff; }
        .ecg-preview-wrap {
            display: none;
            margin-top: 14px;
            text-align: center;
        }
        .ecg-preview-wrap.visible { display: block; }
        .ecg-preview-wrap img {
            max-width: 100%;
            max-height: 320px;
            border-radius: 10px;
            border: 1px solid #ddd;
            box-shadow: 0 8px 24px rgba(0,0,0,0.12);
            object-fit: contain;
            background: #fff;
        }
        .ecg-preview-name {
            font-size: 0.78rem;
            color: #666;
            margin-top: 8px;
            word-break: break-all;
        }
        #ecgFileInput, #ecgCameraInput { display: none; }
        .ecg-auto-box {
            background: #f0f7f8;
            border: 1px solid #b8d4d6;
            border-radius: 12px;
            padding: 16px;
            margin-top: 14px;
            text-align: right;
        }
        .ecg-auto-box h4 {
            color: #0d7377;
            font-size: 0.95rem;
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .ecg-settings-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
            gap: 12px;
            margin-bottom: 12px;
        }
        .ecg-settings-grid .form-group label {
            font-size: 0.8rem;
            color: #444;
        }
        .ecg-settings-grid select,
        .ecg-settings-grid input {
            width: 100%;
            padding: 8px 10px;
            border: 1px solid #ccc;
            border-radius: 8px;
            font-family: 'Vazirmatn', sans-serif;
            font-size: 0.85rem;
            background: #fff;
        }
        .ecg-check-row {
            display: flex;
            flex-wrap: wrap;
            gap: 10px 16px;
            margin: 10px 0 14px;
            font-size: 0.82rem;
        }
        .ecg-check-row label {
            display: flex;
            align-items: center;
            gap: 6px;
            cursor: pointer;
            color: #333;
        }
        .ecg-check-row input { accent-color: #0d7377; width: 16px; height: 16px; }
        .btn-auto-detect {
            width: 100%;
            padding: 13px 18px;
            background: linear-gradient(135deg, #0d7377, #14919b);
            color: #fff;
            border: none;
            border-radius: 10px;
            font-family: 'Vazirmatn', sans-serif;
            font-weight: 800;
            font-size: 0.95rem;
            cursor: pointer;
            transition: all 0.25s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }
        .btn-auto-detect:hover { filter: brightness(1.08); transform: translateY(-1px); }
        .btn-auto-detect:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
        .btn-auto-detect.running {
            background: #64748b;
            animation: pulseAuto 1.2s infinite;
        }
        @keyframes pulseAuto {
            0%, 100% { box-shadow: 0 0 0 0 rgba(13,115,119,0.4); }
            50% { box-shadow: 0 0 0 10px rgba(13,115,119,0); }
        }
        .ecg-disclaimer {
            font-size: 0.72rem;
            color: #8a6d3b;
            background: #fff8e6;
            border: 1px solid #f0e0b0;
            border-radius: 8px;
            padding: 8px 10px;
            margin-top: 10px;
            line-height: 1.7;
        }
        .ecg-progress {
            display: none;
            margin-top: 12px;
            background: #e2e8f0;
            border-radius: 8px;
            overflow: hidden;
            height: 8px;
        }
        .ecg-progress.visible { display: block; }
        .ecg-progress-bar {
            height: 100%;
            width: 0%;
            background: linear-gradient(90deg, #0d7377, #d4af37);
            transition: width 0.3s ease;
        }
        .ecg-status-text {
            font-size: 0.8rem;
            color: #0d7377;
            margin-top: 8px;
            min-height: 20px;
            font-weight: 600;
        }
        .doctors-row { display: flex; justify-content: center; gap: 15px; margin: 30px 0 60px; flex-wrap: wrap; width: 100%; }
        .doctor-card { width: 150px; text-align: center; transition: transform 0.3s; }
        .doctor-card:hover { transform: translateY(-5px); }
        .doc-avatar { width: 130px; height: 130px; margin: 0 auto 15px; border-radius: 22px; overflow: hidden; border: 2px solid rgba(255,255,255,0.08); position: relative; background: linear-gradient(135deg, #1a253a, #0f172a); box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
        .doc-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform 0.4s; }
        .doctor-card:hover .doc-avatar img { transform: scale(1.1); }
        .doc-name { font-size: 0.9rem; font-weight: 700; color: #fff; margin-bottom: 6px; }
        .doc-spec { font-size: 0.72rem; color: var(--text-muted); line-height: 1.5; font-weight: 400; }
        .stats-bar { display: flex; justify-content: center; gap: 40px; margin-top: 40px; padding: 40px 10px; border-top: 1px solid rgba(255,255,255,0.06); width: 100%; max-width: 1100px; flex-wrap: wrap; }
        .stat-item { text-align: center; }
        .stat-number { font-size: clamp(2rem, 6vw, 3.8rem); font-weight: 900; color: var(--gold); line-height: 1; margin-bottom: 12px; text-shadow: 0 0 30px rgba(212, 175, 55, 0.35); font-variant-numeric: tabular-nums; }
        .stat-label { font-size: 0.95rem; color: var(--text-muted); font-weight: 500; }
        .form-page { max-width: 950px; margin: 30px auto; padding: 30px 20px; background: var(--form-bg); color: var(--form-text); border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); border: 1px solid var(--glass-border); width: 100%; overflow-x: hidden; }
        .form-header { text-align: center; margin-bottom: 30px; border-bottom: 2px solid var(--gold); padding-bottom: 20px; }
        .form-header h2 { font-family: 'Lalezar', cursive; font-size: clamp(1.4rem, 5vw, 2.2rem); color: var(--bg-dark); margin-bottom: 8px; word-break: break-word; line-height: 1.4; }
        .form-header p { color: #666; font-size: 0.85rem; word-break: break-word; }
        .form-section { margin-bottom: 25px; padding-bottom: 20px; border-bottom: 1px dashed #ccc; width: 100%; }
        .form-section:last-child { border-bottom: none; }
        .section-title { font-size: clamp(0.9rem, 3vw, 1.15rem); font-weight: 800; color: var(--bg-dark); margin-bottom: 15px; display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; word-break: break-word; line-height: 1.5; width: 100%; }
        .section-title span { background: var(--gold); color: #fff; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 0.85rem; flex-shrink: 0; margin-top: 2px; }
        .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 15px; width: 100%; }
        .form-group { display: flex; flex-direction: column; gap: 8px; min-width: 0; width: 100%; }
        .form-group label { font-size: 0.85rem; font-weight: 600; color: #444; word-break: break-word; }
        .form-input { padding: 12px 15px; border: 1px solid #ddd; border-radius: 8px; font-family: 'Vazirmatn', sans-serif; font-size: 0.9rem; transition: all 0.3s; background: #f8f9fa; width: 100% !important; max-width: 100% !important; box-sizing: border-box !important; }
        .form-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2); background: #fff; }
        .checkbox-group { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; width: 100%; }
        .checkbox-item { display: flex; align-items: flex-start; gap: 8px; font-size: 0.85rem; cursor: pointer; word-break: break-word; line-height: 1.5; width: auto; max-width: 100%; flex-wrap: wrap; }
        .checkbox-item input[type="checkbox"], .checkbox-item input[type="radio"] { accent-color: var(--gold); width: 18px; height: 18px; cursor: pointer; flex-shrink: 0; margin-top: 3px; }
        .inline-input { display: inline-block !important; padding: 6px 10px !important; font-size: 0.8rem !important; border-radius: 6px !important; border: 1px solid #ccc !important; background: #fff !important; width: auto !important; min-width: 40px !important; max-width: 100px !important; box-sizing: border-box !important; }
        .recommendation-box { background: #fef9e7; border-right: 4px solid var(--gold); padding: 12px 15px; margin-top: 10px; border-radius: 8px; font-size: 0.82rem; color: #5a4a00; line-height: 1.7; word-break: break-word; overflow-wrap: break-word; width: 100%; }
        .form-actions { display: flex; justify-content: center; gap: 15px; margin-top: 30px; padding-top: 25px; border-top: 2px solid var(--gold); flex-wrap: wrap; width: 100%; }
        .btn-print { padding: 14px 30px; background: var(--bg-dark); color: var(--gold); border: none; border-radius: 12px; font-family: 'Lalezar', cursive; font-size: 1.2rem; cursor: pointer; transition: all 0.3s; display: flex; align-items: center; justify-content: center; gap: 10px; flex: 1 1 200px; max-width: 100%; }
        .btn-print:hover { background: var(--gold); color: var(--bg-dark); transform: translateY(-2px); box-shadow: 0 10px 25px rgba(212, 175, 55, 0.3); }
        .btn-back { padding: 14px 25px; background: transparent; color: var(--bg-dark); border: 2px solid var(--bg-dark); border-radius: 12px; font-family: 'Vazirmatn', sans-serif; font-weight: 700; font-size: 0.95rem; cursor: pointer; transition: all 0.3s; flex: 1 1 200px; max-width: 100%; }
        .btn-back:hover { background: var(--bg-dark); color: #fff; }

        .voice-box { background: #f8f9fa; border: 2px dashed var(--gold); border-radius: 14px; padding: 18px 16px; margin-bottom: 25px; width: 100%; }
        .voice-box-title { font-weight: 800; font-size: 1rem; color: var(--bg-dark); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
        .voice-controls { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; align-items: center; }
        .btn-voice { padding: 11px 18px; background: var(--bg-dark); color: var(--gold); border: none; border-radius: 10px; font-family: 'Vazirmatn', sans-serif; font-weight: 700; font-size: 0.9rem; cursor: pointer; transition: all 0.3s; display: flex; align-items: center; gap: 8px; }
        .btn-voice:hover { background: var(--gold); color: var(--bg-dark); }
        .btn-voice.recording { background: #c0392b; color: #fff; animation: pulseRec 1.2s infinite; }
        @keyframes pulseRec { 0%, 100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.5); } 50% { box-shadow: 0 0 0 10px rgba(192, 57, 43, 0); } }


        .form-group-full {
            grid-column: 1 / -1;
            width: 100%;
        }
        .other-voice-btns {
            display: flex;
            flex-direction: row;
            flex-wrap: nowrap;
            gap: 8px;
            flex-shrink: 0;
            align-items: stretch;
        }
        .other-voice-btns .btn-other-voice,
        .other-voice-btns .btn-other-clear {
            flex: 0 0 auto;
        }
        .other-voice-row {
            display: flex;
            flex-direction: row;
            flex-wrap: nowrap;
            gap: 8px;
            align-items: stretch;
            width: 100%;
        }
        .other-voice-row .form-input {
            flex: 1 1 auto;
            min-width: 0;
        }

        .other-voice-row {
            display: flex;
            gap: 8px;
            align-items: stretch;
            flex-wrap: wrap;
        }
        .other-voice-row .form-input {
            flex: 1 1 180px;
            min-width: 140px;
        }
        .btn-other-voice, .btn-other-clear {
            padding: 10px 14px;
            border-radius: 10px;
            border: none;
            font-family: 'Vazirmatn', sans-serif;
            font-weight: 700;
            font-size: 0.85rem;
            cursor: pointer;
            white-space: nowrap;
            transition: all 0.2s;
        }
        .btn-other-voice {
            background: #1a253a;
            color: #d4af37;
        }
        .btn-other-voice:hover { background: #d4af37; color: #1a253a; }
        .btn-other-voice.recording {
            background: #c0392b;
            color: #fff;
            animation: pulseRec 1.2s infinite;
        }
        .btn-other-clear {
            background: #fff;
            color: #c0392b;
            border: 2px solid #c0392b !important;
        }
        .btn-other-clear:hover { background: #c0392b; color: #fff; }
        .other-voice-status {
            font-size: 0.78rem;
            color: #666;
            margin-top: 6px;
            min-height: 1.2em;
        }
        .other-voice-status.recording { color: #c0392b; font-weight: 700; }
        .other-voice-status.success { color: #0d7377; }

        .btn-apply { padding: 11px 18px; background: var(--gold); color: var(--bg-dark); border: none; border-radius: 10px; font-family: 'Vazirmatn', sans-serif; font-weight: 700; font-size: 0.9rem; cursor: pointer; transition: all 0.3s; }
        .btn-apply:hover { filter: brightness(1.1); transform: translateY(-1px); }
        .btn-apply:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
        .btn-clear { padding: 11px 18px; background: #fff; color: #c0392b; border: 2px solid #c0392b; border-radius: 10px; font-family: 'Vazirmatn', sans-serif; font-weight: 700; font-size: 0.9rem; cursor: pointer; transition: all 0.3s; }
        .btn-clear:hover { background: #c0392b; color: #fff; }
        .voice-status { font-size: 0.82rem; color: #666; min-height: 20px; }
        .voice-status.listening { color: #c0392b; font-weight: 600; }
        .voice-status.success { color: #27ae60; font-weight: 600; }
        .voice-status.error { color: #c0392b; }
        .voice-transcript { width: 100%; min-height: 90px; padding: 12px; border: 1px solid #ddd; border-radius: 8px; font-family: 'Vazirmatn', sans-serif; font-size: 0.9rem; resize: vertical; background: #fff; margin-top: 8px; direction: rtl; }
        .voice-transcript:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2); }
        .voice-hint { font-size: 0.75rem; color: #555; margin-top: 10px; line-height: 1.85; background: #fffef5; border: 1px solid #f0e6b8; border-radius: 8px; padding: 10px 12px; }
        .voice-hint strong { color: var(--bg-dark); }
        .voice-hint code { background: #f0f0f0; padding: 1px 5px; border-radius: 4px; font-family: 'Vazirmatn', sans-serif; font-size: 0.78rem; }
        .fa-label { color: #888; font-weight: 400; font-size: 0.8em; }

        @media (max-width: 768px) {
            .other-voice-row { flex-wrap: wrap !important; }
            .other-voice-btns { width: 100%; justify-content: flex-start; }

            .nav-pill { gap: 12px; padding: 10px 15px; }
            .nav-pill a { font-size: 0.8rem; }
            .services-row { gap: 10px; }
            .service-card { flex: 1 1 100%; padding: 12px 15px; font-size: 0.85rem; }
            .doctors-row { gap: 12px; }
            .doctor-card { width: 140px; }
            .doc-avatar { width: 115px; height: 115px; }
            .stats-bar { gap: 25px; padding: 30px 10px; }
            .form-page { margin: 15px 0; padding: 20px 12px; width: 100%; border-radius: 12px; }
            .form-grid { grid-template-columns: 1fr !important; gap: 12px; }
            .form-input { width: 100% !important; max-width: 100% !important; font-size: 0.85rem !important; padding: 10px 12px !important; }
            .checkbox-item { width: 100% !important; display: flex !important; flex-wrap: wrap !important; align-items: flex-start !important; font-size: 0.82rem !important; }
            .checkbox-item input[type="checkbox"], .checkbox-item input[type="radio"] { flex-shrink: 0; margin-top: 4px; }
            .inline-input { width: 100% !important; max-width: 100% !important; margin-top: 6px !important; margin-right: 26px !important; font-size: 0.8rem !important; padding: 8px 10px !important; }
            .form-actions { flex-direction: column; gap: 10px; }
            .btn-print, .btn-back { width: 100% !important; max-width: 100% !important; }
        }
        @media (max-width: 480px) {
            .artistic-title { font-size: 2.5rem; }
            .visual-container { height: 200px; }
            .real-heart-img { width: 160px; }
            .form-header h2 { font-size: 1.3rem; }
            .section-title { font-size: 0.88rem; }
            .checkbox-group { gap: 8px; }
            .checkbox-item { font-size: 0.8rem !important; }
            .inline-input { margin-right: 24px !important; font-size: 0.78rem !important; }
        }
        @media print {
            /* —— پایه —— */
            @page {
                size: A4;
                margin: 12mm;
            }
            *, *::before, *::after {
                box-shadow: none !important;
                text-shadow: none !important;
                animation: none !important;
                transition: none !important;
                filter: none !important;
                backdrop-filter: none !important;
                -webkit-backdrop-filter: none !important;
            }
            html, body {
                background: #fff !important;
                color: #000 !important;
                overflow: visible !important;
                width: 100% !important;
                max-width: none !important;
                margin: 0 !important;
                padding: 0 !important;
                font-size: 11pt !important;
                line-height: 1.45 !important;
                -webkit-print-color-adjust: exact !important;
                print-color-adjust: exact !important;
            }

            /* —— مخفی‌سازی UI —— */
            .ambient-glow,
            .nav-wrapper,
            .hero-section,
            .doctors-row,
            .stats-bar,
            .auth-corner,
            .auth-modal-overlay,
            .print-preview-overlay,
            .voice-box,
            .print-settings-panel,
            .btn-back,
            .btn-print,
            .btn-save-db,
            .btn-refresh-summary,
            .form-summary-box .summary-hint,
            .ecg-upload-actions,
            .btn-upload,
            #ecgFileInput,
            #ecgCameraInput,
            .ecg-auto-box .btn-auto-detect,
            .ecg-progress,
            .ecg-disclaimer,
            .ecg-status-text,
            .btn-other-voice,
            .btn-other-clear,
            .other-voice-status { display: none !important; }

            /* —— صفحه فرم —— */
            .page-section.hidden-section { display: none !important; }
            .form-page {
                box-shadow: none !important;
                border: none !important;
                margin: 0 !important;
                padding: 0 !important;
                max-width: 100% !important;
                width: 100% !important;
                color: #000 !important;
                background: #fff !important;
                border-radius: 0 !important;
            }
            .form-header {
                border-bottom: 2px solid #000 !important;
                margin-bottom: 10pt !important;
                padding-bottom: 6pt !important;
                text-align: center !important;
            }
            .form-header h2 {
                color: #000 !important;
                font-size: 14pt !important;
                margin: 0 0 4pt !important;
                -webkit-text-fill-color: #000 !important;
            }
            .form-header p { color: #333 !important; font-size: 9pt !important; }

            .form-section {
                border-bottom: 1px solid #bbb !important;
                page-break-inside: avoid;
                break-inside: avoid;
                margin-bottom: 8pt !important;
                padding-bottom: 6pt !important;
            }
            .section-title {
                color: #000 !important;
                font-size: 11pt !important;
                margin-bottom: 6pt !important;
            }
            .section-title span {
                background: #000 !important;
                color: #fff !important;
                -webkit-print-color-adjust: exact !important;
                print-color-adjust: exact !important;
            }

            .form-grid { gap: 6pt !important; }
            .form-group label { color: #111 !important; font-size: 9pt !important; }
            .form-input,
            .inline-input,
            textarea.form-input {
                border: 1px solid #666 !important;
                background: #fff !important;
                color: #000 !important;
                box-shadow: none !important;
                font-size: 10pt !important;
                padding: 4pt 6pt !important;
            }
            .checkbox-item {
                color: #000 !important;
                font-size: 9.5pt !important;
                page-break-inside: avoid;
            }
            .checkbox-item input {
                accent-color: #000 !important;
                -webkit-print-color-adjust: exact !important;
                print-color-adjust: exact !important;
            }
            .recommendation-box {
                background: #f5f5f5 !important;
                border-right: 3px solid #333 !important;
                color: #222 !important;
                font-size: 8.5pt !important;
                page-break-inside: avoid;
                -webkit-print-color-adjust: exact !important;
                print-color-adjust: exact !important;
            }
            .fa-label { color: #555 !important; }

            /* —— خلاصه چاپ —— */
            .form-summary-box {
                display: block !important;
                border: 1.5pt solid #000 !important;
                background: #fff !important;
                border-radius: 0 !important;
                padding: 8pt !important;
                margin: 10pt 0 0 !important;
                page-break-inside: avoid;
                break-inside: avoid;
            }
            .form-summary-box .summary-title {
                color: #000 !important;
                font-size: 11pt !important;
                margin-bottom: 6pt !important;
                border-bottom: 1px solid #000;
                padding-bottom: 4pt;
            }
            .form-summary-box textarea.summary-output {
                border: 1px solid #444 !important;
                background: #fff !important;
                color: #000 !important;
                min-height: 180pt !important;
                height: auto !important;
                font-size: 11pt !important;
                line-height: 1.65 !important;
                padding: 6pt !important;
                resize: none !important;
                overflow: visible !important;
            }

            /* —— ECG —— */
            .ecg-upload-box {
                border: 1px solid #666 !important;
                background: #fff !important;
                box-shadow: none !important;
            }
            .ecg-preview-wrap.visible { display: block !important; }
            .ecg-preview-wrap img {
                max-height: 220pt !important;
                border: 1px solid #333 !important;
                box-shadow: none !important;
            }
            .ecg-auto-box {
                border: 1px solid #999 !important;
                background: #fafafa !important;
                page-break-inside: avoid;
            }

            /* —— سربرگ —— */
            .print-letterhead {
                display: none;
                text-align: center !important;
                border-bottom: 2pt solid #000 !important;
                padding-bottom: 6pt !important;
                margin: 0 0 10pt !important;
            }
            body.print-show-letterhead .print-letterhead {
                display: block !important;
            }
            .print-letterhead .clinic-sub {
                font-size: 9pt !important;
                color: #333 !important;
                margin-top: 3pt !important;
            }
            .print-letterhead .lh-logo {
                display: block !important;
                height: 56pt !important;
                width: auto !important;
                margin: 0 auto 2pt !important;
            }
            .print-letterhead .lh-basmala {
                font-size: 11pt !important;
                color: #000 !important;
                margin-bottom: 2pt !important;
            }

            /* —— امضای پای برگه —— */
            .print-signature {
                display: none;
                direction: ltr !important;
                text-align: left !important;
                color: #000 !important;
                font-weight: bold !important;
                font-size: 11pt !important;
                margin-top: 18pt !important;
                page-break-inside: avoid;
            }
            body.print-show-signature .print-signature {
                display: block !important;
            }
            .print-signature .sig-name { margin-top: 3pt !important; }

            /* —— گزارش مقادیر پرشده (حالت خلاصه) —— */
            body.print-mode-report .print-report {
                display: block !important;
                color: #000 !important;
            }
            /* در این حالت خودِ فرم چاپ نمی‌شود */
            body.print-mode-report #formsHost .form-container,
            body.print-mode-report #formsHost form {
                display: none !important;
            }
            body.print-mode-report #formsHost .form-header {
                display: block !important;
            }
            .print-report .pr-section {
                margin: 0 0 10pt !important;
                page-break-inside: avoid;
            }
            .print-report .pr-section.pr-ltr {
                direction: ltr !important;
                text-align: left !important;
            }
            .print-report .pr-sec-title {
                font-weight: 900 !important;
                font-size: 11.5pt !important;
                border-bottom: 1px solid #000 !important;
                padding-bottom: 2pt !important;
                margin-bottom: 4pt !important;
            }
            .print-report .pr-line {
                font-size: 11pt !important;
                line-height: 1.75 !important;
                margin-bottom: 1pt !important;
            }
            .print-report .pr-label { font-weight: bold !important; }
            .print-report .pr-free {
                font-size: 11pt !important;
                line-height: 1.8 !important;
                white-space: pre-wrap !important;
            }
            .print-report .pr-img {
                display: block !important;
                max-width: 100% !important;
                max-height: 220pt !important;
                border: 1px solid #333 !important;
                margin: 6pt 0 !important;
            }
            .print-report .pr-empty {
                font-size: 11pt !important;
                color: #444 !important;
            }

            /* —— حالت‌های چاپ (از تنظیمات پیشرفته) —— */
            body.print-mode-summary .form-section,
            body.print-mode-summary .voice-box,
            body.print-summary-only .form-section,
            body.print-summary-only .voice-box,
            body.print-summary-only .form-header p {
                display: none !important;
            }
            body.print-mode-summary .form-summary-box,
            body.print-summary-only .form-summary-box,
            body.print-mode-full .form-summary-box {
                display: block !important;
            }
            body.print-mode-form .form-summary-box {
                display: none !important;
            }

            body.print-fs-sm .form-summary-box textarea.summary-output,
            body.print-fs-sm .form-section,
            body.print-fs-sm .form-input { font-size: 9.5pt !important; }
            body.print-fs-md .form-summary-box textarea.summary-output,
            body.print-fs-md .form-section,
            body.print-fs-md .form-input { font-size: 11pt !important; }
            body.print-fs-lg .form-summary-box textarea.summary-output,
            body.print-fs-lg .form-section,
            body.print-fs-lg .form-input { font-size: 13pt !important; }

            body.print-margin-narrow { padding: 4mm !important; }
            body.print-margin-normal { padding: 8mm !important; }
            body.print-margin-wide { padding: 14mm !important; }

            /* لینک‌ها بدون URL اضافه */
            a { color: #000 !important; text-decoration: none !important; }
            a[href]::after { content: none !important; }
        }

