/* ── Portal Auth Modal (pam-*) ──────────────────────────────────────────────── */
.pam-overlay {
    position: fixed; inset: 0; background: rgba(10,15,30,.7);
    backdrop-filter: blur(4px); z-index: 10000;
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.pam-overlay[hidden] { display: none; }

.pam-card {
    background: #fff; border-radius: 16px; width: 100%; max-width: 400px;
    box-shadow: 0 24px 64px rgba(0,0,0,.35); overflow: hidden;
}
.pam-header {
    background: #0f2433; padding: 22px 24px 18px;
    display: flex; align-items: center; justify-content: space-between;
}
.pam-title  { color: #fff; font-size: 17px; font-weight: 700; line-height: 1.2; }
.pam-subtitle { color: rgba(255,255,255,.45); font-size: 11px; margin-top: 3px; text-transform: uppercase; letter-spacing: .06em; }
.pam-close  { background: none; border: none; color: rgba(255,255,255,.5); font-size: 18px; cursor: pointer; padding: 4px; line-height: 1; border-radius: 4px; }
.pam-close:hover { color: #fff; }

.pam-tabs   { display: flex; border-bottom: 1px solid #e5e7eb; }
.auth-tab-btn {
    flex: 1; padding: 13px 0; font-size: 13px; font-weight: 600;
    border: none; border-bottom: 2px solid transparent;
    background: none; cursor: pointer; color: #9ca3af;
    transition: color .15s, border-color .15s;
}
.auth-tab-btn.active { color: #1f6f6b; border-bottom-color: #1f6f6b; }
.auth-tab-btn:hover:not(.active) { color: #374151; }

.pam-body   { padding: 24px; }

.auth-panel { display: none; }
.auth-panel.active { display: block; }

.pam-field  { margin-bottom: 16px; }
.pam-field label {
    display: block; font-size: 12px; font-weight: 600;
    color: #374151; margin-bottom: 6px;
}
.pam-field input {
    width: 100%; box-sizing: border-box;
    border: 1.5px solid #d1d5db; border-radius: 9px;
    padding: 11px 14px; font-size: 14px; font-family: inherit;
    color: #111827; background: #f9fafb;
    transition: border-color .15s, background .15s;
    outline: none;
}
.pam-field input:focus { border-color: #1f6f6b; background: #fff; }
.pam-field-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.pam-field-row label { margin-bottom: 0; }

.pam-hint { font-weight: 400; color: #9ca3af; }
.pam-desc { font-size: 13px; color: #4b5563; margin: 0 0 18px; line-height: 1.5; }

.pam-btn-primary {
    width: 100%; padding: 13px; background: #1f6f6b; color: #fff;
    border: none; border-radius: 9px; font-size: 14px; font-weight: 700;
    cursor: pointer; letter-spacing: .02em; margin-top: 4px;
    transition: background .15s, transform .1s;
}
.pam-btn-primary:hover { background: #175f5b; }
.pam-btn-primary:active { transform: scale(.98); }
.pam-btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.pam-link-btn { background: none; border: none; color: #1f6f6b; font-size: 12px; cursor: pointer; padding: 0; text-decoration: underline; }
.pam-link-btn:hover { color: #175f5b; }
.pam-center-row { text-align: center; margin-top: 14px; }

.pam-msg { margin-top: 14px; padding: 11px 14px; border-radius: 8px; font-size: 13px; line-height: 1.4; }
.pam-msg[hidden] { display: none; }
.pam-msg.ok  { background: #f0fdf4; color: #166534; border: 1px solid #86efac; }
.pam-msg.err { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }

/* ── Auth status bar (pab-*) ────────────────────────────────────────────────── */
.pab-bar {
    position: fixed; top: 12px; right: 16px; z-index: 9000;
    display: flex; align-items: center; gap: 8px;
}
.pab-pill {
    display: flex; align-items: center; gap: 8px;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 999px;
    padding: 6px 14px 6px 10px; font-size: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.pab-pill[hidden] { display: none; }
.pab-dot  { width: 8px; height: 8px; background: #22c55e; border-radius: 50%; flex-shrink: 0; }
.pab-email { color: #0f2433; font-weight: 600; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pab-signout { background: none; border: none; color: #9ca3af; font-size: 11px; cursor: pointer; padding: 0; margin-left: 4px; }
.pab-signout:hover { color: #374151; }
.pab-open-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 16px; background: #0f2433; color: #fff;
    border: none; border-radius: 999px; font-size: 12px; font-weight: 600;
    cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.18);
    transition: background .15s;
}
.pab-open-btn:hover { background: #1a3a52; }

/* ── Floating save button (sdf-*) ───────────────────────────────────────────── */
.sdf-fab {
    position: fixed; bottom: 28px; right: 28px; z-index: 9999;
    display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
    pointer-events: none;
}
.sdf-tooltip {
    background: #0f2433; color: #e2e8f0; font-size: 11px;
    padding: 5px 10px; border-radius: 6px; white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.sdf-tooltip[hidden] { display: none; }
.sdf-btn {
    pointer-events: auto; display: flex; align-items: center; gap: 8px;
    padding: 13px 22px; background: #1f6f6b; color: #fff;
    border: none; border-radius: 999px; cursor: pointer;
    font-size: 13px; font-weight: 700; letter-spacing: .02em;
    box-shadow: 0 4px 16px rgba(31,111,107,.45), 0 2px 4px rgba(0,0,0,.15);
    transition: background .15s, transform .1s;
}
.sdf-btn:hover { background: #175f5b; transform: translateY(-1px); }
.sdf-btn.saved { background: #166534; }
.sdf-msg {
    font-size: 11px; color: #166534; font-weight: 600;
    background: #f0fdf4; border: 1px solid #86efac;
    padding: 3px 10px; border-radius: 6px; pointer-events: none;
}
.sdf-msg[hidden] { display: none; }
