/* TaleemPK 23.62.4 — navy, sapphire and teal; scoped to requested surfaces. */
body.auth-premium { background: radial-gradient(ellipse at 95% 12%, #147a8b 0, transparent 40%), linear-gradient(145deg,#0a1733,#162f61 60%,#125c70); background-attachment: fixed; }
.auth-premium .topbar { background: #0c1c38; border-color: #ffffff18; }
.auth-premium .topbar .brand, .auth-premium .topbar a { color: #f2f7ff; }
.auth-premium .shell-auth { max-width: 520px; margin: 28px auto 48px; padding: 28px; border-radius: 28px; background: var(--surface); box-shadow: 0 22px 60px #030e282e; }
.auth-premium .shell-auth h1 { font-size: clamp(28px,7vw,38px); line-height: 1.2; letter-spacing: -.8px; }
.auth-premium .shell-auth .mark { color: inherit; background: none; box-shadow: inset 0 -7px 0 #34c5b23b; }
.auth-premium .shell-auth .card { padding: 20px 0; border: 0; box-shadow: none; background: transparent; }
.auth-premium .auth-sub { line-height: 1.6; margin: 12px 0 22px; }
.auth-premium .shell-auth input:not([type=checkbox]):not([type=radio]),
.auth-premium .shell-auth select, .profile-edit input:not([type=checkbox]):not([type=radio]),
.profile-edit select, .profile-edit textarea { min-height: 50px; border-radius: 13px; background: var(--paper); border: 1px solid var(--line); color: var(--ink); padding: 13px 14px; font-size: 16px; box-shadow: none; }
.auth-premium .shell-auth input:focus, .profile-edit input:focus, .profile-edit textarea:focus, .profile-edit select:focus { outline: 3px solid #3158d426; border-color: #3158d4; }
.auth-premium .shell-auth .btn-block, .profile-edit .btn-block { min-height: 52px; border: 0; border-radius: 14px; background: linear-gradient(110deg,#244cc1,#176e8b); color: #fff; font-weight: 700; box-shadow: 0 6px 16px #244cc121; }
.auth-premium .auth-alt { padding-top: 18px; border-top: 1px solid var(--line); line-height: 1.6; }
.auth-premium .vfy-code { max-width: 100%; font-size: clamp(20px,6vw,28px); letter-spacing: .2em; text-align: center; }
.auth-premium .vfy { max-width: 100%; }
.profile-edit .profile-intro { padding: 24px; border-radius: 22px; background: linear-gradient(125deg,#112248,#155b72); color: #fff; margin-bottom: 20px; }
.profile-edit .profile-intro h1 { color: #fff; margin: 0 0 8px; font-size: 30px; }
.profile-edit .profile-intro p { margin: 0; color: #d8e6fa; line-height: 1.5; }
.profile-edit .profile-form { padding: 22px; border-radius: 22px; }
.profile-edit .profile-section { border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin: 26px 0; min-width: 0; }
.profile-edit .profile-section legend { color: var(--ink); font-weight: 700; padding: 0 8px; font-size: 18px; }
.profile-edit .profile-section .field:last-child { margin-bottom: 0; }
.profile-edit label { line-height: 1.4; font-weight: 600; }
.profile-edit .hint { line-height: 1.5; }
.profile-edit .photoedit-cover { border-radius: 16px; background-color: #162f61; }
.profile-edit input[type=file] { width: 100%; max-width: 100%; font-size: 13px; padding: 10px; }
body.chat-open .chat-head { background: var(--surface); box-shadow: 0 3px 12px #1223450a; }
body.chat-open .chatwrap { background: radial-gradient(ellipse at top left,#248e9c08,transparent 55%),var(--paper); }
body.chat-open .msg-mine .msg-bubble:not(.is-jumbo) { background: linear-gradient(125deg,#193f78,#155e76); color: #fff; }
body.chat-open .msg-mine .msg-bubble:not(.is-jumbo) .msg-time { color: #d7e6f5; }
body.chat-open .msg-theirs .msg-bubble:not(.is-jumbo) { background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
body.chat-open #send-form.card { background: var(--surface); border: 1px solid var(--line); box-shadow: 0 -3px 14px #12234508; }
body.chat-open #send-form textarea { background: var(--surface); color: var(--ink); }
body.chat-open .chat-privacy { background: #e0f4ee; color: #175a50; }
@media(max-width:599px) {
  .auth-premium .shell-auth { width: calc(100% - 28px); margin: 22px auto 32px; padding: 24px 18px; }
  .profile-edit .profile-form { padding: 14px; }
  .profile-edit .profile-section { padding: 14px; }
  .profile-edit .photoedit-controls { flex-wrap: wrap; }
}
@media(prefers-reduced-motion:reduce) { .auth-premium *, .profile-edit * { scroll-behavior: auto!important; transition: none!important; animation: none!important; } }
/* Existing theme rules use explicit html selectors; keep these surfaces coherent in both modes. */
html body.auth-premium { height: auto; min-height: 100dvh; background: radial-gradient(ellipse at 95% 12%,#147a8b 0,transparent 40%),linear-gradient(145deg,#0a1733,#162f61 60%,#125c70)!important; background-attachment: fixed!important; }
html body.auth-premium .topbar { background: #0c1c38!important; color: #f2f7ff; }
html body.auth-premium .shell-auth .btn-block,
html body.profile-edit .btn-block { background: linear-gradient(110deg,#244cc1,#176e8b)!important; color: #fff!important; border-color: transparent!important; }
.auth-premium .choice input:checked + label { background: #d9f3ef; color: #14564e; border-color: #358f84; }

/* ==========================================================================
   TaleemPK 23.62.8 — chat polish: WhatsApp-style notice, calmer colours,
   locked-message bubbles and the inline audio-file player.
   Loaded last on purpose so it wins over the older chat rules.
   ========================================================================== */
body.chat-open {
  --tp-chat-bg: #e8efee;
  --tp-mine-a: #12928f;
  --tp-mine-b: #0b6f78;
  --tp-them: #ffffff;
  --tp-them-ink: #111b21;
  --tp-notice-bg: #fff3c4;
  --tp-notice-ink: #6b5a17;
  --tp-day-bg: rgba(255,255,255,.92);
  --tp-day-ink: #54656f;
  --tp-tick: #8fe3ff;
}
html[data-theme="dark"] body.chat-open {
  --tp-chat-bg: #0b141a;
  --tp-them: #1f2c34;
  --tp-them-ink: #e9edef;
  --tp-notice-bg: #3a3520;
  --tp-notice-ink: #e8d48a;
  --tp-day-bg: #1f2c34;
  --tp-day-ink: #b4c0c7;
}
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] body.chat-open {
    --tp-chat-bg: #0b141a;
    --tp-them: #1f2c34;
    --tp-them-ink: #e9edef;
    --tp-notice-bg: #3a3520;
    --tp-notice-ink: #e8d48a;
    --tp-day-bg: #1f2c34;
    --tp-day-ink: #b4c0c7;
  }
}

body.chat-open .chatwrap { background: var(--tp-chat-bg); }

/* the lock line: a small centred yellow note, like WhatsApp */
body.chat-open .chat-secure-note,
body.chat-open .chat-secure-note.is-enc {
  width: auto; max-width: min(92%, 470px);
  margin: 10px auto 2px;
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--tp-notice-bg);
  color: var(--tp-notice-ink);
  font-size: 12px; line-height: 1.45;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
body.chat-open .chat-secure-note span { white-space: normal; overflow: visible; text-overflow: clip; }
body.chat-open .chat-secure-note svg { opacity: .9; }
body.chat-open .chat-secure-note:hover { filter: brightness(.98); background: var(--tp-notice-bg); color: var(--tp-notice-ink); }

/* day dividers */
body.chat-open .msg-day {
  background: var(--tp-day-bg); color: var(--tp-day-ink);
  border: 0; border-radius: 10px; padding: 4px 12px;
  font-size: 11.5px; font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}

/* bubbles */
body.chat-open .msg-mine .msg-bubble:not(.is-jumbo) {
  background: linear-gradient(135deg, var(--tp-mine-a), var(--tp-mine-b));
  color: #fff; border: 0;
  border-radius: 16px 4px 16px 16px;
  box-shadow: 0 1px 3px rgba(6,71,76,.22);
}
body.chat-open .msg-theirs .msg-bubble:not(.is-jumbo) {
  background: var(--tp-them); color: var(--tp-them-ink);
  border: 0; border-radius: 4px 16px 16px 16px;
  box-shadow: 0 1px 3px rgba(8,20,47,.10);
}
body.chat-open .msg-mine .msg-time { color: rgba(255,255,255,.78); }
body.chat-open .msg-mine .receipt.is-pending,
body.chat-open .msg-mine .receipt.is-sent,
body.chat-open .msg-mine .receipt.is-delivered { color: rgba(255,255,255,.72); }
body.chat-open .msg-mine .receipt.is-seen { color: var(--tp-tick); }

/* composer */
body.chat-open #send-form.card { background: transparent; border: 0; box-shadow: none; }
body.chat-open #send-form textarea {
  background: var(--tp-them); color: var(--tp-them-ink);
  border: 0; border-radius: 24px; box-shadow: 0 1px 3px rgba(0,0,0,.10);
}

/* a message that could not be opened yet: quiet, italic, obviously tappable */
body.chat-open .msg.enc-failed { cursor: pointer; }
body.chat-open .msg.enc-failed .msg-text {
  font-style: italic; font-size: 13.5px; opacity: .78;
}
body.chat-open .msg.enc-pending .msg-text { opacity: .55; }

/* ---- audio file player ---------------------------------------------------- */
.msg-audiofile {
  display: flex; align-items: center; gap: 11px;
  min-width: min(250px, 72vw); max-width: 300px; padding: 2px 0;
}
.msg-audiofile .af-play {
  flex: 0 0 auto; width: 44px; height: 44px; border: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #12928f; color: #fff; cursor: pointer; padding: 0;
  transition: transform .12s ease, filter .12s ease;
}
.msg-audiofile .af-play:active { transform: scale(.94); }
.msg-audiofile.is-mine .af-play { background: #fff; color: #0b6f78; }
.msg-audiofile .af-play svg { width: 22px; height: 22px; fill: currentColor; }
.msg-audiofile.is-playing .af-play { filter: brightness(1.06); }
.msg-audiofile.is-loading .af-play { opacity: .6; animation: af-pulse 1s ease-in-out infinite; }
@keyframes af-pulse { 50% { opacity: .35; } }
.msg-audiofile .af-body { flex: 1 1 auto; min-width: 0; }
.msg-audiofile .af-name {
  font-size: 13.5px; font-weight: 700; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.msg-audiofile .af-bar {
  position: relative; height: 4px; margin: 10px 0 9px; border-radius: 3px;
  background: rgba(18,146,143,.25); cursor: pointer;
}
.msg-audiofile .af-bar::before { content: ""; position: absolute; inset: -9px 0; }  /* bigger touch target */
.msg-audiofile.is-mine .af-bar { background: rgba(255,255,255,.3); }
.msg-audiofile .af-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  border-radius: 3px; background: #12928f;
}
.msg-audiofile.is-mine .af-fill { background: #fff; }
.msg-audiofile .af-knob {
  position: absolute; top: 50%; left: 0; width: 12px; height: 12px;
  margin: -6px 0 0 -6px; border-radius: 50%; background: #12928f;
}
.msg-audiofile.is-mine .af-knob { background: #fff; }
.msg-audiofile .af-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 11.5px; opacity: .85;
}
.msg-audiofile .af-speed {
  border: 0; border-radius: 10px; padding: 2px 8px; cursor: pointer;
  font: inherit; font-weight: 800; color: inherit;
  background: rgba(127,140,165,.2);
}
.msg-audiofile.is-mine .af-speed { background: rgba(255,255,255,.2); }

/* ---- QR link panel (unlock this browser from the phone) ------------------- */
.chat-link { text-align: center; margin-top: 4px; }
.chat-link-qr {
  width: min(220px, 62vw); aspect-ratio: 1 / 1; margin: 10px auto 12px;
  padding: 6px; border-radius: 14px; background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.14);
}
.chat-link-qr:empty { background: rgba(127,140,165,.15); box-shadow: none; }
.chat-link-qr svg { display: block; width: 100%; height: 100%; }
.chat-link-steps {
  text-align: left; margin: 0 auto 10px; padding-left: 1.3em; max-width: 300px;
  font-size: 13.5px; line-height: 1.55;
}
.chat-link-status { font-size: 13px; opacity: .8; min-height: 1.4em; margin-bottom: 8px; }
.chat-link-alt {
  border: 0; background: none; color: inherit; opacity: .75; cursor: pointer;
  font: inherit; font-size: 12.5px; text-decoration: underline; padding: 6px;
}

/* Unified chat composer: icons and text share one surface. */
body.chat-open #send-form.card { padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px)); margin-top: 0 !important; background: var(--paper); border-radius: 0; }
body.chat-open .chat-composer { margin-top: 0; gap: 8px; align-items: flex-end; }
body.chat-open .chat-composer .chatbar { display:flex; flex:1 1 auto; min-width:0; gap:2px; padding:4px; border:1px solid var(--line); border-radius:26px; background:var(--surface); box-shadow:0 2px 6px rgba(15,35,50,.04); }
body.chat-open #send-form .chatbar textarea.chatbar-text { flex:1 1 auto; min-width:0; width:0; min-height:42px; max-height:148px; padding:10px 4px; border:0; border-radius:0; box-shadow:none; background:transparent; color:var(--ink); font-size:16px; line-height:22px; resize:none; }
body.chat-open #send-form .chatbar textarea.chatbar-text:focus { outline:0; border:0; box-shadow:none; }
body.chat-open .chat-composer .chatbar:focus-within { border-color:#238d92; box-shadow:0 0 0 2px rgba(35,141,146,.10); }
body.chat-open .chat-composer .chatbar-ic { flex:0 0 40px; width:40px; height:42px; margin:0; border:0; border-radius:50%; color:var(--muted); background:transparent; }
body.chat-open .chat-composer .chat-action { flex:0 0 50px; width:50px; height:50px; margin:0; border-radius:50%; }
body.chat-open .chat-composer .chat-action.is-mic, body.chat-open .chat-composer .chat-action.is-send { background:#0c8088; color:#fff; border:0; box-shadow:0 2px 6px rgba(12,128,136,.16); }
body.chat-open .chat-composer .chat-action[hidden] { display:none !important; }
body.chat-open .msg-day { box-shadow:none; border:1px solid var(--line); }
body.chat-open .msg.enc-failed .msg-text { font-style:normal; line-height:1.45; }
body.chat-open .msg-typing .typing-word { font-size:12px; color:var(--muted); white-space:normal; }
@media(max-width:380px) { body.chat-open #send-form.card { padding-left:6px; padding-right:6px; } body.chat-open .chat-composer .chatbar-ic { flex-basis:34px; width:34px; } }

body.chat-open .msg-bubble .chat-file { border:0; border-radius:12px; padding:10px 12px; box-shadow:none; }

/* 23.62.21: compact conversation header and accessible option sheets. */
body.chat-open .chat-head { gap: 8px; padding: 14px 12px; border-bottom: 1px solid var(--line); box-shadow: 0 2px 8px #132c3b06; }
body.chat-open .chat-head > .row { flex: 1 1 auto; min-width: 0; gap: 8px; }
body.chat-open .chat-who { display: flex; align-items: center; flex: 1 1 auto; min-width: 0; gap: 10px; }
body.chat-open .chat-who > div { flex: 1 1 auto; min-width: 0; }
body.chat-open #chat-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; line-height: 1.35; }
body.chat-open #chat-title a { color: inherit; text-decoration: none; }
body.chat-open #presence { font-size: 12px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.chat-open .chat-head .chat-secure-note,
body.chat-open .chat-head .chat-secure-note.is-enc { display: flex; align-items: center; gap: 4px; width: auto; max-width: 100%; margin: 2px 0 0; padding: 0; min-height: 18px; background: transparent; border: 0; border-radius: 0; box-shadow: none; color: var(--muted); font-size: 11px; line-height: 1.4; text-align: left; }
body.chat-open .chat-head .chat-secure-note.is-enc { color: #208263; }
body.chat-open .chat-head .chat-secure-note span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.chat-open .chat-head .chat-secure-note:hover { background: transparent; filter: none; text-decoration: underline; }
body.chat-open .chat-head .chat-secure-note:focus-visible { outline: 2px solid #208263; outline-offset: 3px; border-radius: 3px; }
body.chat-open .chat-head > .chat-head-acts { flex: 0 0 auto; gap: 0; }
body.chat-open .chat-head-acts .iconbtn { width: 34px; height: 40px; padding: 7px; }
body.chat-open .msg-callnote { align-self: center; width: fit-content; max-width: calc(100% - 24px); margin: 9px auto; }
body.chat-open .msg-callnote .msg-bubble { width: auto; max-width: 100%; padding: 8px 16px !important; font-size: 12px; line-height: 1.4; box-shadow: none; border: 0; }
body.chat-open .msg-menu.is-sheet { max-height: 80vh; max-height: 80dvh; overflow-y: auto; overscroll-behavior: contain; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
@media (max-width: 380px) { body.chat-open .chat-head { padding: 12px 8px; } body.chat-open .chat-head-acts .iconbtn { width: 30px; padding: 6px; } body.chat-open .chat-who { gap: 7px; } body.chat-open .chat-who .av { width: 38px; height: 38px; } }
html[data-theme="dark"] body.chat-open .chat-head .chat-secure-note.is-enc { color: #67cfa5; }

body.chat-open .chatlog .msg-day { position: relative; top: auto; z-index: auto; margin: 14px auto 10px; border-radius: 9px; font-size: 11px; letter-spacing: .03em; }
