/* ---------- Secure credentials store + browser tasks (16b-browser.js) ---------- */

/* Round "+" on the right of the sub-page bar, on the store list only. */
.sheet-bar.sub .sheet-add { grid-column: 3; grid-row: 1; justify-self: end; cursor: pointer; }

/* Store list: one card of domains, like iOS Passwords. */
.cred-page .group { border-radius: 28px; }
.cred-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cred-empty { color: var(--text-3); cursor: default; }
.cred-empty::after { display: none; }
.cred-empty:hover { background: none; }

/* Detail: username, dots, last used. The password itself is never fetched. */
.cred-detail .frow .muted { max-width: 62%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cred-detail .cred-dots { letter-spacing: 0.14em; }

/* Add login details: a website field, then one card with username and password split by a dashed line. */
.cred-card { display: flex; flex-direction: column; }
.cred-input {
  width: 100%;
  height: 60px;
  padding: 0 20px;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 1.0625rem;
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
}
.cred-input::placeholder { color: var(--text-3); }
.cred-dash { display: block; height: 0; margin: 0 20px; border-top: 1.5px dashed #cbcbd1; }
.cred-error { margin-top: -10px; }
.cred-actions { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.cred-submit {
  height: 58px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #45a0ff 0%, var(--imessage-blue) 52%, #0074ec 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 6px 18px rgba(10, 132, 255, 0.22);
  color: #fff;
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.cred-submit:disabled { opacity: 0.38; box-shadow: none; cursor: default; }
.cred-cancel {
  height: 48px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

/* ---------- Approval card (chat, and a pending step on the Browser tab) ---------- */

.approval-msg { margin: 12px 0 16px; width: min(360px, 92%); }
.thread > .approval-msg.out { margin-left: max(0px, calc((100% - var(--col)) / 2)); margin-right: auto; }
.thread > .approval-msg.in { margin-left: auto; margin-right: max(0px, calc((100% - var(--col)) / 2)); }
.stamp + .approval-msg { margin-top: 2px; }
.bubble + .approval-msg { margin-top: 6px; }

.apv {
  border-radius: 24px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 4px 18px rgba(16, 17, 19, 0.06);
  padding: 16px 16px 14px;
}
.apv-top { display: flex; align-items: center; gap: 12px; }
.apv-icon {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--pill);
  color: var(--text-2);
}
.apv.live .apv-icon { background: #e7f1ff; color: var(--imessage-blue); }
.apv-icon svg { width: 22px; height: 22px; stroke-width: 1.9; }
.apv-head { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.apv-head strong { font-size: 0.9375rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apv-head small { font-size: 0.8125rem; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apv-amount { flex: none; font-size: 1.0625rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.apv-summary { margin-top: 12px; font-size: 0.9375rem; line-height: 1.45; color: var(--text); overflow-wrap: anywhere; white-space: pre-wrap; }
.apv-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.apv-btn {
  height: 44px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}
.apv-no { background: var(--pill); color: var(--text); }
.apv-yes { background: var(--imessage-blue); color: #fff; }
.apv-btn:disabled { opacity: 0.5; cursor: default; }
.apv-state {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
}
.apv-state.ok { color: var(--ok); }
.apv-state svg { width: 16px; height: 16px; stroke-width: 2.4; }

/* ---------- Browser card in chat (a browser task, live) ---------- */

/* Full width of the chat column, like Muse's browser card: grey card, blue globe tile, status line,
   the page preview and one pill button. */
.browser-msg {
  margin: 12px 0 16px;
  -webkit-tap-highlight-color: transparent;
}
.thread > .browser-msg { width: 100%; max-width: var(--col); margin-left: auto; margin-right: auto; }
.stamp + .browser-msg { margin-top: 2px; }
.bubble + .browser-msg { margin-top: 10px; }
.browser-msg + .bubble { margin-top: 0; }

.bcard {
  border-radius: 22px;
  background: var(--bubble);
  padding: 16px;
}
.bcard-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bcard-icon {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(10, 132, 255, 0.12);
  color: var(--imessage-blue);
}
.bcard-icon svg { width: 22px; height: 22px; stroke-width: 1.8; }
.bcard-head { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.bcard-head strong { font-size: 1.0625rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; color: var(--text); }
.bcard-status {
  display: block;
  font-size: 0.9375rem;
  line-height: 1.35;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* While it works, the status line shimmers softly. */
.browser-msg.active:not(.waiting) .bcard-status {
  background: linear-gradient(90deg, var(--text-2) 0%, var(--text-2) 40%, #c4c4ca 50%, var(--text-2) 60%, var(--text-2) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: bcard-shimmer 2.2s linear infinite;
}
@keyframes bcard-shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }

.bcard-shot {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  margin-top: 14px;
  padding: 0;
  border: 1px solid rgba(16, 17, 19, 0.08);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
}
.bcard-shot:disabled { cursor: default; }
.bcard-shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.bcard-shot img[hidden] { display: none; }
.bcard-shot[hidden] { display: none; }
/* No preview yet: a quiet placeholder that breathes. */
.bcard-shot.empty {
  background: linear-gradient(100deg, #e9e9ed 20%, #f6f6f8 40%, #e9e9ed 60%) 0 0 / 250% 100%;
  animation: bcard-shimmer 1.8s linear infinite;
}

.bcard-open {
  display: block;
  width: 100%;
  height: 48px;
  margin-top: 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(16, 17, 19, 0.07);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
}
.bcard-open:active { background: rgba(16, 17, 19, 0.12); }
.bcard-open[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .browser-msg.active:not(.waiting) .bcard-status { animation: none; background: none; color: var(--text-2); }
  .bcard-shot.empty { animation: none; }
}

/* ---------- Christian's profile → Browser tab ---------- */

.bt-row { align-items: center; }
.bt-row .chip { flex: none; }
.bt-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 16px 0 4px;
  padding: 4px 8px 4px 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
}
.bt-back svg { width: 18px; height: 18px; stroke-width: 2.2; }
.bt-head { display: flex; align-items: flex-start; gap: 12px; margin-top: 8px; }
.bt-head h3 { flex: 1; min-width: 0; font-size: 1.25rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.015em; overflow-wrap: anywhere; padding-top: 4px; }
.bt-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 10px 0 0 48px; font-size: 0.8125rem; color: var(--text-2); }
.bt-pending { margin-top: 18px; }
.bt-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.bt-primary {
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: var(--imessage-blue);
  color: #fff;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}
.bt-note { margin-top: 12px; font-size: 0.875rem; line-height: 1.45; color: var(--text-2); }
.bt-actions .bt-note { margin-top: 0; text-align: center; }
.bt-label { margin: 22px 2px 4px; font-size: 0.8125rem; font-weight: 600; color: var(--text-2); }
.bt-text { margin: 0 2px; font-size: 0.9375rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.bt-cancel {
  width: 100%;
  height: 44px;
  margin-top: 24px;
  border: 0;
  border-radius: 999px;
  background: var(--pill);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--error);
  cursor: pointer;
}
