/* ── TOAST ── */
.ctx-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.65rem 1.5rem;
    border-radius: 30px;
    font-size: 0.85rem;
    opacity: 0;
    transition: all 0.25s ease;
    z-index: 999;
    white-space: nowrap;
}

.ctx-toast-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.ctx-toast-error {
    border-color: var(--red);
    color: var(--red);
}

.ctx-toast-success {
    border-color: var(--green);
    color: var(--green);
}

/* ── CONFIRM DIALOG ── */
.ctx-confirm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 300;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.ctx-confirm-overlay.open {
    display: flex;
}

.ctx-confirm-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 2rem;
    max-width: 420px;
    width: 100%;
}

.ctx-confirm-msg {
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--text);
    margin-bottom: 1.5rem;
    white-space: pre-line;
}

.ctx-confirm-btns {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.ctx-confirm-yes {
    padding: 0.6rem 1.5rem;
    background: var(--red);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity var(--transition);
}

.ctx-confirm-yes:hover {
    opacity: 0.85;
}

.ctx-confirm-no {
    padding: 0.6rem 1.5rem;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition);
}

.ctx-confirm-no:hover {
    border-color: var(--text-muted);
    color: var(--text);
}

/* ── PIECE 1 — INVITE MODAL ── */
.invite-item {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
}

.invite-item:last-child {
    border-bottom: none;
}

.invite-name {
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.invite-role {
    font-size: 0.78rem;
    color: var(--accent);
}

/* ── PIECE 2 — CHECK-IN BANNER ── */
.checkin-banner {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.checkin-banner-warning {
    background: rgba(201, 169, 110, 0.08);
    border: 1px solid rgba(201, 169, 110, 0.3);
    color: var(--accent);
}

.checkin-banner-urgent {
    background: rgba(224, 85, 85, 0.08);
    border: 1px solid rgba(224, 85, 85, 0.3);
    color: var(--red);
}

.checkin-banner-msg {
    flex: 1;
    line-height: 1.5;
}

.checkin-banner-btn {
    padding: 0.5rem 1.25rem;
    background: var(--accent);
    color: #1a1200;
    border: none;
    border-radius: 20px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity var(--transition);
    flex-shrink: 0;
}

.checkin-banner-btn:hover {
    opacity: 0.85;
}

/* ── PIECE 3 — NOTIFICATION BELL ── */
.notif-bell-wrap {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.notif-bell-icon {
    font-size: 1.1rem;
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: var(--red);
    color: #fff;
    font-size: 0.6rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.notif-panel {
    display: none;
    position: absolute;
    top: 2.5rem;
    right: 0;
    width: 320px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    z-index: 100;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.notif-panel.open {
    display: block;
}

.notif-panel-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.notif-list {
    max-height: 320px;
    overflow-y: auto;
}

.notif-item {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-unseen {
    background: var(--accent-dim);
}

.notif-msg {
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--text);
    margin-bottom: 0.3rem;
}

.notif-time {
    font-size: 0.7rem;
    color: var(--text-dim);
}

.notif-empty {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* ── PIECE 4 — CIRCLE MANAGEMENT ── */
.circle-member-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.circle-member-card:last-child {
    border-bottom: none;
}

.circle-member-name {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.circle-member-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.circle-member-status {
    font-size: 0.72rem;
}

.status-accepted {
    color: var(--green);
}

.status-pending {
    color: var(--accent);
}

.circle-remove-btn {
    padding: 0.4rem 0.85rem;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 6px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}

.circle-remove-btn:hover {
    border-color: var(--red);
    color: var(--red);
}

.circle-add-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.circle-add-form .input-group {
    margin-bottom: 0;
}

.circle-add-form .btn-primary {
    grid-column: 1/-1;
}

/* ── PIECE 5 & 6 — VISIBILITY CONTROLS ── */
.theme-vis-row {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.theme-vis-row:last-child {
    border-bottom: none;
}

.theme-vis-name {
    font-size: 0.88rem;
    margin-bottom: 0.5rem;
}

.theme-vis-select {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition);
}

.theme-vis-select:focus {
    border-color: var(--accent);
}

.theme-specific-access {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--surface2);
    border-radius: 8px;
}

.specific-label {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.specific-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text);
    padding: 0.3rem 0;
    cursor: pointer;
}

.specific-check input {
    accent-color: var(--accent);
}

.specific-role {
    color: var(--text-dim);
    font-size: 0.72rem;
}

.specific-empty {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ── PIECE 6 — RECORDING VIS MODAL ── */
.rec-vis-modal .modal-box {
    max-width: 480px;
}

.rec-vis-question {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

/* ── PIECE 7 — SEAL BADGE ── */
.sealed-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    background: rgba(224, 85, 85, 0.1);
    border: 1px solid rgba(224, 85, 85, 0.3);
    border-radius: 10px;
    font-size: 0.68rem;
    color: var(--red);
    margin-top: 0.4rem;
}

.archive-card.is-sealed {
    border-color: rgba(224, 85, 85, 0.2);
}

.archive-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.card-action-btn {
    padding: 0.3rem 0.75rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all var(--transition);
}

.card-action-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.card-action-btn.seal:hover {
    border-color: var(--red);
    color: var(--red);
}

/* ── PIECE 8 — RULES ── */
.rule-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
}

.rule-card.rule-triggered {
    border-color: var(--green);
    opacity: 0.7;
}

.rule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.rule-type {
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    color: var(--accent);
}

.rule-status {
    font-size: 0.72rem;
}

.rule-status.pending {
    color: var(--text-muted);
}

.rule-status.triggered {
    color: var(--green);
}

.rule-target {
    font-size: 0.82rem;
    margin-bottom: 0.2rem;
}

.rule-condition {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.rule-grants {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

.rule-delete-btn {
    padding: 0.3rem 0.75rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all var(--transition);
}

.rule-delete-btn:hover {
    border-color: var(--red);
    color: var(--red);
}

.rule-create-form {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

/* ── PIECE 9 — CHECK-IN SETUP ── */
.checkin-setup-card,
.checkin-active-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.checkin-setup-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.checkin-setup-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.checkin-stat-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.checkin-stat {
    background: var(--surface3);
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.checkin-stat-label {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.checkin-stat-val {
    font-size: 0.92rem;
    color: var(--text);
}

/* ── SETTINGS VIEW ── */
.settings-tabs {
    display: flex;
    gap: 0;
    background: var(--surface2);
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.settings-tab {
    flex: 1;
    padding: 0.55rem 0.75rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all var(--transition);
    white-space: nowrap;
    text-align: center;
}

.settings-tab.active {
    background: var(--surface3);
    color: var(--text);
}

.settings-section {
    display: none;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  color: var(--text-dim);
  font-size: 0.75rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

#google-login-btn {
  display: flex;
  justify-content: center;
}
.drive-recording-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.85rem;
  margin-bottom: 0.75rem;
  background: rgba(255,255,255,0.03);
}

.drive-recording-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.drive-recording-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.drive-recording-meta {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.drive-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
}

.drive-badge.synced {
  background: rgba(34,197,94,0.15);
  color: #86efac;
}

.drive-badge.not-synced {
  background: rgba(234,179,8,0.15);
  color: #fde68a;
}

.drive-badge.failed {
  background: rgba(239,68,68,0.15);
  color: #fca5a5;
}

.drive-recording-error {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #fca5a5;
}
.storage-card {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.storage-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.storage-subtitle {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.drive-connect-panel {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
}

.drive-connect-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.drive-connect-status {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.drive-actions {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  flex-shrink: 0;
}

.drive-actions .btn-primary,
.drive-actions .btn-secondary {
  white-space: nowrap;
}

.drive-sync-result {
  min-height: 1rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.drive-recordings-section {
  margin-top: 0.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.drive-recordings-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.drive-recordings-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.drive-recordings-subtitle {
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.btn-secondary {
  padding: 0.65rem 1.25rem;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 720px) {
  .drive-connect-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .drive-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .drive-actions .btn-primary,
  .drive-actions .btn-secondary {
    width: 100%;
  }
}
.drive-sync-float {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  z-index: 1200;
  box-shadow: 0 12px 35px rgba(0,0,0,0.45);
}

.drive-sync-float-title {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.drive-sync-float-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.drive-sync-float-bar {
  height: 5px;
  background: var(--surface3);
  border-radius: 999px;
  overflow: hidden;
}

.drive-sync-float-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.25s ease;
}