:root{font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;line-height:1.5;font-weight:400;color-scheme:light;color:#2d2d2d;background-color:#faf7f2;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--patient-page-bg: #FAF7F2;--patient-card-bg: #F0EAE0;--patient-card-radius: 18px;--patient-text-primary: #2D2D2D;--patient-text-secondary: #666666;--patient-sos-color: #D32F2F;--patient-action-color: #0D5C63;--patient-avatar-border: rgba(255,255,255,.3)}*{margin:0;padding:0;box-sizing:border-box}body{min-width:320px;min-height:100vh}.page{max-width:640px;margin:0 auto;padding:2rem 1rem}.loading-container{display:flex;align-items:center;justify-content:center;min-height:100vh}.spinner{width:40px;height:40px;border:4px solid #E8E0D4;border-top-color:var(--patient-action-color);border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.link-page{display:flex;align-items:center;justify-content:center;min-height:100vh;padding:1rem;background:#faf7f2}.link-content{text-align:center;max-width:400px;width:100%}.link-title{font-size:2rem;font-weight:700;margin-bottom:1.5rem;color:#2d2d2d}.link-subtitle{font-size:1.1rem;color:#666;margin-bottom:2rem;line-height:1.6}.google-signin-btn{display:inline-flex;align-items:center;gap:.75rem;padding:.75rem 1.5rem;border:1px solid #D5DDD5;border-radius:10px;background:#fff;color:#3c4043;font-size:1rem;font-weight:500;cursor:pointer;transition:box-shadow .2s,background .2s;min-height:48px}.google-signin-btn:hover{background:#f8f9fa;box-shadow:0 1px 3px #00000026}.google-signin-btn:focus-visible{outline:3px solid var(--patient-action-color);outline-offset:2px}.google-icon{width:20px;height:20px;flex-shrink:0}.code-hidden-input{position:absolute;opacity:0;pointer-events:none;width:0;height:0}.code-boxes{display:grid;grid-template-columns:repeat(6,1fr);gap:8px;max-width:360px;margin:0 auto 1.5rem;cursor:text}.code-box{min-height:48px;display:flex;align-items:center;justify-content:center;font-size:24px;font-weight:700;border-radius:8px;background:#fff;border:2px solid #D5DDD5;color:#2d2d2d;transition:border-color .15s;-webkit-user-select:none;user-select:none}.code-box--filled{border-color:var(--patient-action-color)}.code-box--active{border-color:#0a8c96;box-shadow:0 0 0 3px #0d5c6326}.code-error{color:#d32f2f;font-size:.9rem;margin-bottom:1rem;padding:.5rem 1rem;background:#fff5f5;border-radius:10px}.submit-btn{display:inline-flex;align-items:center;justify-content:center;min-width:180px;min-height:48px;padding:.75rem 2rem;border:none;border-radius:10px;background:var(--patient-action-color);color:#fff;font-size:1rem;font-weight:600;letter-spacing:.05em;cursor:pointer;transition:background .2s,opacity .2s;margin-bottom:1.5rem}.submit-btn:hover:not(:disabled){background:#0a4a50}.submit-btn:focus-visible{outline:3px solid var(--patient-action-color);outline-offset:2px}.submit-btn:disabled{opacity:.5;cursor:not-allowed}.spinner-small{width:20px;height:20px;border-width:2px;border-color:#ffffff4d;border-top-color:#fff}.code-hint{font-size:.85rem;color:#666;line-height:1.5}.dashboard-header{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.75rem;margin-bottom:2rem;padding-bottom:1.25rem;border-bottom:1px solid #E8E0D4}.dashboard-title{font-size:1.5rem;font-weight:700;color:var(--patient-action-color)}.dashboard-user{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}.dashboard-user-name{font-size:.9rem;color:#666}.signout-btn{min-height:48px;padding:.5rem 1rem;border:1px solid var(--patient-action-color);border-radius:10px;background:transparent;color:var(--patient-action-color);font-size:.85rem;cursor:pointer;transition:background .2s,color .2s,border-color .2s}.signout-btn:hover{background:#e8f4f5;color:var(--patient-action-color);border-color:var(--patient-action-color)}.signout-btn:focus-visible{outline:3px solid var(--patient-action-color);outline-offset:2px}.dashboard-section-title{font-size:1rem;font-weight:600;color:#666;text-transform:uppercase;letter-spacing:.06em;margin-bottom:1rem}.device-list{list-style:none;display:flex;flex-direction:column;gap:.75rem}.device-card{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem 1.25rem;background:#fff;border:1px solid #E8E0D4;border-radius:16px;box-shadow:0 1px 4px #00000014;transition:border-color .2s}.device-card:hover{border-color:var(--patient-action-color)}.device-card-info{display:flex;flex-direction:column;gap:.25rem}.device-label{font-size:1rem;font-weight:600;color:#2d2d2d}.device-id{font-size:.8rem;color:#767676;font-family:monospace}.device-card-actions{display:flex;align-items:center;gap:.75rem;flex-shrink:0}.device-config-btn{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:.5rem 1.25rem;border-radius:10px;background:var(--patient-action-color);color:#fff;font-size:.9rem;font-weight:600;text-decoration:none;white-space:nowrap;transition:background .2s;flex-shrink:0}.device-config-btn:hover{background:#0a4a50}.device-config-btn:focus-visible{outline:3px solid var(--patient-action-color);outline-offset:2px}.device-remove-btn{min-height:48px;padding:.5rem .75rem;border:none;border-radius:10px;background:transparent;color:#d32f2f;font-size:.85rem;font-weight:500;cursor:pointer;white-space:nowrap;transition:background .2s,color .2s}.device-remove-btn:hover{background:#fff5f5;color:#d32f2f}.device-remove-btn:focus-visible{outline:3px solid #D32F2F;outline-offset:2px}.dashboard-footer{margin-top:1.5rem;text-align:center}.add-device-link{color:var(--patient-action-color);font-size:.95rem;text-decoration:none;min-height:48px;display:inline-flex;align-items:center;padding:.5rem;border-radius:6px;transition:color .2s}.add-device-link:hover{color:#0a4a50;text-decoration:underline}.add-device-link:focus-visible{outline:3px solid var(--patient-action-color);outline-offset:2px}.config-error{margin-top:2rem;padding:1.5rem;background:#fff5f5;border:1px solid #FFCDD2;border-radius:12px;color:#d32f2f;text-align:center;line-height:1.6}.dashboard-empty{display:flex;flex-direction:column;align-items:center;text-align:center;padding:3rem 1rem;gap:1rem;background:#fff;border-radius:16px;box-shadow:0 1px 4px #00000014}.dashboard-empty-icon{font-size:3rem}.dashboard-empty-title{font-size:1.25rem;font-weight:600;color:#2d2d2d}.dashboard-empty-text{font-size:1rem;color:#666;max-width:320px;line-height:1.6}.dashboard-cta-btn{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:.75rem 2rem;border-radius:10px;background:var(--patient-action-color);color:#fff;font-size:1rem;font-weight:600;text-decoration:none;margin-top:.5rem;transition:background .2s}.dashboard-cta-btn:hover{background:#0a4a50}.dashboard-cta-btn:focus-visible{outline:3px solid var(--patient-action-color);outline-offset:2px}.confirm-overlay{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:#0009;z-index:1000;padding:1rem}.confirm-dialog{background:#fff;border:1px solid #E8E0D4;border-radius:16px;box-shadow:0 1px 4px #00000014;padding:1.5rem;max-width:400px;width:100%}.confirm-text{font-size:1rem;color:#2d2d2d;line-height:1.6;margin-bottom:1.5rem}.confirm-actions{display:flex;justify-content:flex-end;gap:.75rem}.confirm-cancel-btn{min-height:48px;padding:.5rem 1.25rem;border:1px solid #E8E0D4;border-radius:10px;background:transparent;color:#666;font-size:.9rem;cursor:pointer;transition:background .2s,color .2s}.confirm-cancel-btn:hover{background:#e8e0d4;color:#2d2d2d}.confirm-cancel-btn:disabled{opacity:.5;cursor:not-allowed}.confirm-remove-btn{min-height:48px;padding:.5rem 1.25rem;border:none;border-radius:10px;background:#d32f2f;color:#fff;font-size:.9rem;font-weight:600;cursor:pointer;transition:background .2s}.confirm-remove-btn:hover{background:#b71c1c}.confirm-remove-btn:disabled{opacity:.5;cursor:not-allowed}.confirm-remove-btn:focus-visible,.confirm-cancel-btn:focus-visible{outline:3px solid var(--patient-action-color);outline-offset:2px}.config-appbar{position:sticky;top:0;z-index:100;background:#faf7f2;margin:-2rem -1rem 1rem;padding:.5rem 1rem;border-bottom:1px solid #E8E0D4}.config-appbar-row{display:flex;align-items:center;gap:.5rem}.config-appbar-back{display:flex;align-items:center;justify-content:center;width:48px;height:48px;flex-shrink:0;background:transparent;border:none;border-radius:8px;color:var(--patient-action-color);font-size:1.2rem;cursor:pointer;transition:background .2s}.config-appbar-back:hover{background:#e8f4f5}.config-appbar-back:focus-visible{outline:3px solid var(--patient-action-color);outline-offset:2px}.config-appbar-title{font-size:1.05rem;font-weight:700;color:#2d2d2d;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}.config-appbar-subtitle{display:block;font-size:.75rem;color:#767676;margin-top:.15rem;padding-left:calc(48px + .5rem)}.activity-log{margin-bottom:1rem;padding:.5rem .75rem;background:#f5f5f0;border-radius:10px;border:1px solid #E8E0D4}.activity-log--compact{display:flex;align-items:center;gap:.25rem}.activity-log--compact .activity-log-entry{flex:1;min-width:0;border-bottom:none;padding:0}.activity-log-entry{display:flex;align-items:center;gap:.5rem;padding:.3rem 0;font-size:.8rem;color:#555}.activity-log-entry:not(:last-child){border-bottom:1px solid #EDE8E0}.activity-log-time{font-family:monospace;font-size:.75rem;color:#767676;flex-shrink:0}.activity-log-action{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activity-log-check{color:#388e3c;flex-shrink:0;font-size:.8rem}.activity-log-count{font-size:.7rem;font-weight:600;color:#767676;background:#e8e0d4;padding:.1rem .35rem;border-radius:6px;flex-shrink:0}.activity-log-toggle{background:none;border:none;color:var(--patient-action-color);font-size:.75rem;font-weight:500;cursor:pointer;padding:.2rem 0;flex-shrink:0;white-space:nowrap}.activity-log-toggle:hover{text-decoration:underline}.config-section{background:#fff;border:1px solid #E8E0D4;border-radius:16px;box-shadow:0 1px 4px #00000014;padding:1.25rem;margin-bottom:1rem}.config-section-heading{font-size:1rem;font-weight:700;color:#2d2d2d;margin-bottom:1rem;padding-bottom:.75rem;border-bottom:1px solid #E8E0D4}.config-row{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:1rem}.config-label{display:block;font-size:.9rem;font-weight:500;color:#666;margin-bottom:.4rem}.config-toggle-label{font-size:.95rem;color:#2d2d2d}.toggle-switch{position:relative;width:52px;height:28px;border-radius:14px;border:none;background:#d5ddd5;cursor:pointer;transition:background .2s;flex-shrink:0;padding:0}.toggle-switch--on{background:var(--patient-action-color)}.toggle-thumb{position:absolute;top:3px;left:3px;width:22px;height:22px;border-radius:50%;background:#fff;transition:transform .2s;pointer-events:none}.toggle-switch--on .toggle-thumb{transform:translate(24px)}.toggle-switch:focus-visible{outline:3px solid var(--patient-action-color);outline-offset:2px}.config-segmented{display:flex;gap:.25rem;margin-bottom:1rem}.segmented-btn{flex:1 1 0;min-height:48px;min-width:0;padding:.25rem .5rem;border:1px solid #D5DDD5;border-radius:10px;background:transparent;color:#666;font-size:.9rem;font-weight:600;cursor:pointer;transition:background .2s,color .2s,border-color .2s;display:flex;align-items:center;justify-content:center}.segmented-btn:hover{border-color:var(--patient-action-color);color:#2d2d2d}.segmented-btn--active{background:var(--patient-action-color);border-color:var(--patient-action-color);color:#fff}.segmented-btn:focus-visible{outline:3px solid var(--patient-action-color);outline-offset:2px}.config-field{margin-bottom:1rem}.config-input{display:block;width:100%;min-height:48px;padding:.6rem .875rem;border:1px solid #D5DDD5;border-radius:10px;background:#fff;color:#2d2d2d;font-size:1rem;transition:border-color .2s}.config-input::placeholder{color:#767676;font-style:italic}.config-input:focus{outline:none;border-color:var(--patient-action-color)}.config-input--error{border-color:#d32f2f}.config-input--warning{border-color:#e67e22}.config-warning-banner{font-size:.85rem;color:#e67e22;margin-bottom:.75rem;display:flex;align-items:center;gap:.4rem}.config-field-error{margin-top:.4rem;font-size:.85rem;color:#d32f2f}.config-autosave-bar{font-size:.85rem;font-weight:500;padding:.4rem .75rem;border-radius:8px;margin-bottom:.75rem;text-align:center}.config-autosave-bar--saved{background:#e8f5e9;color:#2e7d32}.config-autosave-bar--saving{background:#f5f5f5;color:#767676}.config-autosave-bar--error{background:#fff5f5;color:#d32f2f}.config-info-text{font-size:.85rem;color:#666;line-height:1.5;margin-top:.5rem}.config-waiting{display:flex;flex-direction:column;align-items:center;gap:1rem;margin-top:3rem;padding:2rem;text-align:center;background:#fff;border-radius:16px;box-shadow:0 1px 4px #00000014}.config-waiting-spinner{width:40px;height:40px;border:3px solid #E8E0D4;border-top-color:var(--patient-action-color);border-radius:50%;animation:spin 1s linear infinite}.config-waiting-title{font-size:1.05rem;font-weight:600;color:#2d2d2d;margin:0}.config-waiting-hint{font-size:.9rem;color:#666;line-height:1.6;max-width:340px;margin:0}.density-wrapper{position:relative}.preview-popover{position:absolute;bottom:100%;margin-bottom:8px;z-index:10;cursor:pointer;animation:preview-appear .25s ease}.preview-popover:hover .phone-frame{box-shadow:0 4px 12px #0000002e}@keyframes preview-appear{0%{opacity:0;transform:translate(-50%) translateY(-8px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.phone-frame{width:100px;aspect-ratio:9 / 19;border-radius:14px;border:2px solid var(--patient-text-primary);background:var(--patient-page-bg);padding:5px;display:flex;flex-direction:column;gap:2px;box-shadow:0 2px 8px #0000001a;overflow:hidden;font-family:system-ui,sans-serif}.phone-frame--large{width:300px}@media(min-width:768px){.phone-frame--large{width:400px}}.phone-header{display:flex;justify-content:space-between;align-items:center;padding:2px 4px}.phone-sos{background:var(--patient-sos-color);color:#fff;font-size:5px;font-weight:700;padding:1px 3px;border-radius:3px}.phone-time{font-size:5px;font-weight:600;color:var(--patient-text-primary)}.phone-lock{font-size:6px}.phone-cards{flex:1;display:flex;flex-direction:column;gap:2px}.phone-card{background:var(--patient-card-bg);border-radius:7px;display:flex;align-items:center;gap:4px;padding:3px 5px;flex:1}.phone-avatar{width:14px;height:14px;border-radius:50%;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:4px;font-weight:700;color:#fff;border:1px solid var(--patient-avatar-border)}.phone-name{font-size:6px;font-weight:700;color:var(--patient-text-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.phone-nav{display:flex;justify-content:center;align-items:center;gap:4px;padding:2px 0}.phone-nav-btn{font-size:5px;color:var(--patient-text-secondary);padding:1px 3px;border-radius:3px}.phone-nav-btn--active{background:var(--patient-action-color);color:#fff}.phone-nav-info{font-size:4px;color:var(--patient-text-secondary)}.phone-menu{text-align:center;font-size:5px;color:var(--patient-text-secondary);border:1px solid rgba(102,102,102,.3);border-radius:4px;padding:2px 0}.phone-frame--large .phone-sos{font-size:10px;padding:3px 8px}.phone-frame--large .phone-time{font-size:10px}.phone-frame--large .phone-lock{font-size:12px}.phone-frame--large .phone-avatar{width:32px;height:32px;font-size:9px}.phone-frame--large .phone-name{font-size:14px}.phone-frame--large .phone-card{gap:8px;padding:6px 10px;border-radius:14px}.phone-frame--large .phone-nav-btn{font-size:10px}.phone-frame--large .phone-nav-info{font-size:9px}.phone-frame--large .phone-menu{font-size:10px;padding:4px 0}.preview-overlay{position:fixed;inset:0;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:1000;padding:1rem}.preview-modal{position:relative;background:var(--patient-page-bg);border-radius:20px;padding:2rem 1.5rem 1.5rem;display:flex;flex-direction:column;align-items:center;gap:1rem;box-shadow:0 8px 32px #00000026}.preview-modal-close{position:absolute;top:10px;right:10px;width:32px;height:32px;border:none;border-radius:8px;background:#0000000f;color:var(--patient-text-secondary);font-size:16px;cursor:pointer;display:flex;align-items:center;justify-content:center}.preview-modal-close:hover{background:#0000001f}.preview-modal-label{font-size:1rem;font-weight:600;color:var(--patient-text-primary)}.save-toast{position:fixed;bottom:1.5rem;left:50%;transform:translate(-50%);padding:.6rem 1.5rem;border-radius:12px;font-size:.9rem;font-weight:600;z-index:200;box-shadow:0 4px 12px #00000026;animation:toast-in .25s ease;pointer-events:none}@keyframes toast-in{0%{opacity:0;transform:translate(-50%) translateY(8px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.save-toast--saving{background:#f5f5f0;color:#767676}.save-toast--saved{background:#e8f5e9;color:#2e7d32}.save-toast--error{background:#fff5f5;color:#d32f2f}.tm-container{max-width:480px;margin:0 auto;padding:16px;font-family:system-ui,sans-serif}.tm-loading{text-align:center;color:#666;margin-top:48px}.tm-header{margin-bottom:20px}.tm-title{font-size:20px;font-weight:700;margin:0 0 8px}.tm-meta{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.tm-session-id,.tm-timer{font-family:monospace;font-size:14px;color:#444}.tm-status-dot{font-size:13px}.tm-connected{color:#28a745}.tm-disconnected{color:#dc3545}.tm-summary{background:#d4edda;color:#155724;border-radius:8px;padding:16px;margin-bottom:16px;text-align:center}.tm-summary-title{font-weight:600;font-size:18px;margin-bottom:12px}.tm-summary-line{font-size:16px;margin-bottom:4px}.tm-summary-success{color:#28a745;font-weight:600}.tm-summary-failed{color:#dc3545;font-weight:600}.tm-summary-untested{color:#666}.tm-summary-voicemail{margin-top:8px;font-style:italic}.tm-task-list{margin-bottom:24px}.tm-task-card{border-radius:12px;padding:16px;margin-bottom:12px;transition:background .15s}.tm-task-pending{background:#f0f0f0}.tm-task-success{background:#d4edda}.tm-task-failed{background:#f8d7da}.tm-task-row{display:flex;align-items:center;gap:12px;min-height:56px;cursor:pointer;-webkit-user-select:none;user-select:none}.tm-task-row:focus{outline:2px solid #007bff;outline-offset:2px;border-radius:8px}.tm-task-icon{font-size:24px;flex-shrink:0}.tm-task-label-group{flex:1;display:flex;flex-direction:column}.tm-task-label{font-size:17px;font-weight:500}.tm-task-instruction{font-size:13px;color:#777;margin-top:4px;line-height:1.3;font-style:italic}.tm-task-result{font-size:15px;display:flex;align-items:center;gap:4px}.tm-task-time{font-family:monospace;font-size:13px;color:#555}.tm-task-notes-display{font-size:13px;color:#555;margin-top:6px;padding-left:36px;font-style:italic}.tm-undo-btn{background:none;border:none;color:#555;font-size:13px;cursor:pointer;padding:4px 0 0 36px;text-decoration:underline}.tm-action-panel{margin-top:12px;display:flex;flex-direction:column;gap:10px}.tm-notes-input{width:100%;padding:10px 12px;font-size:16px;border:1px solid #ccc;border-radius:8px;box-sizing:border-box}.tm-action-buttons{display:flex;gap:10px}.tm-btn{flex:1;min-height:48px;font-size:18px;font-weight:600;border:none;border-radius:10px;cursor:pointer;padding:10px}.tm-btn-success{background:#28a745;color:#fff}.tm-btn-failed{background:#dc3545;color:#fff}.tm-global-notes{margin-bottom:24px}.tm-global-notes-label{display:block;font-size:15px;font-weight:600;margin-bottom:8px;color:#333}.tm-global-notes-input{width:100%;min-height:90px;padding:10px 12px;font-size:15px;border:1px solid #ccc;border-radius:8px;box-sizing:border-box;resize:vertical}.tm-end-section{margin-bottom:32px}.tm-btn-end{width:100%;background:#6c757d;color:#fff}.tm-confirm-dialog{background:#fff3cd;border:1px solid #ffc107;border-radius:12px;padding:16px;text-align:center}.tm-confirm-dialog p{font-size:17px;margin:0 0 14px;font-weight:500}.tm-confirm-buttons{display:flex;gap:12px}.tm-btn-confirm{background:#28a745;color:#fff}.tm-btn-cancel{background:#6c757d;color:#fff}
