/* "Tài khoản" tab (phones-accounts.js) + the shopee68.com sign-in button. Uses the page tokens from phones.css. */
.sso-btn { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.sso-btn:hover { background: color-mix(in srgb, var(--accent) 24%, var(--card)); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.acc-offscreen { position: fixed; left: -9999px; top: 0; }
#accounts { width: min(1360px, 100%); }
.acc-link { max-width: 560px; }
.acc-link h3 { margin: 0; }
.acc-main { display: grid; gap: 12px; min-width: 0; }
.acc-main > * { min-width: 0; }

/* ---- filters ---- */
.acc-chip { --c: var(--muted); display: inline-flex; align-items: center; gap: 8px; flex: none; }
.acc-chip b { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.acc-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.acc-chip.ok { --c: var(--ok); } .acc-chip.bad { --c: var(--bad); } .acc-chip.warn { --c: var(--warn); } .acc-chip.info { --c: var(--progress); }
.acc-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: stretch; }
.acc-search { display: flex; gap: 8px; min-width: 0; }
.acc-search label { position: relative; flex: 1; display: block; min-width: 0; }
.acc-search label .icon { position: absolute; left: 12px; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.acc-search input { padding-left: 38px; }
.acc-mvd-filter select { width: auto; max-width: 100%; }
.acc-opt { position: relative; }
.acc-opt > summary { list-style: none; flex-wrap: nowrap; white-space: nowrap; min-width: 0; min-height: 42px; max-width: 280px; }
.acc-opt[open] > summary { margin: 0; border-color: var(--accent); }
.acc-opt > summary::-webkit-details-marker, .acc-opt > summary::before { display: none; content: none; }
#accOptText { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.acc-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 4; width: min(320px, calc(100vw - 24px)); display: grid; gap: 12px; padding: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}

/* ---- check job ---- */
.acc-job { display: grid; gap: 8px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--panel); border: 1px solid var(--line); }
.acc-bar { display: flex; height: 5px; border-radius: 99px; background: var(--track); overflow: hidden; --ok-part: 0%; --bad-part: 0%; }
.acc-bar i { width: 100%; transform-origin: 0 0; flex: none; }
.acc-bar i:first-child { width: var(--ok-part); background: var(--ok); }
.acc-bar i:last-child { width: var(--bad-part); background: var(--bad); }
.acc-job-row { display: flex; gap: 4px 14px; align-items: center; flex-wrap: wrap; font-size: 14px; font-variant-numeric: tabular-nums; }
.acc-job-row .ok { color: var(--ok); } .acc-job-row .bad { color: var(--bad); }
.acc-job-actions { margin-left: auto; display: flex; gap: 8px; }

/* ---- list: one row per account, related values stacked so nothing scrolls sideways ---- */
.acc-table { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); scroll-margin-top: 80px; }
.acc-head, .acc-row {
  display: grid; column-gap: 16px; align-items: center; padding: 0 14px;
  grid-template-columns: 20px minmax(0, 1.15fr) 108px minmax(0, 1.2fr) minmax(0, 1.25fr) minmax(0, 1.5fr) 148px;
}
.acc-head { padding-block: 9px; font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--panel); border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
.acc-all-text { display: none; }
.acc-list { list-style: none; margin: 0; padding: 0; }
.acc-list[aria-busy=true] .acc-row:not(.skeleton) { opacity: .5; }
.acc-row { position: relative; padding-block: 9px; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); transition: background-color .12s; }
.acc-row:last-child { border-bottom: 0; border-radius: 0 0 var(--radius) var(--radius); }
.acc-row:hover { background: color-mix(in srgb, var(--hover) 45%, transparent); }
.acc-row.picked { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.acc-row.checking { background: color-mix(in srgb, var(--progress) 12%, transparent); }
.acc-cell { min-width: 0; display: grid; gap: 1px; }
.acc-status { justify-items: start; }
.acc-pick { display: flex; align-items: center; align-self: stretch; cursor: pointer; }
.acc-pick input { width: 18px; height: 18px; min-height: 0; padding: 0; margin: 0; accent-color: var(--accent); cursor: pointer; }
.acc-line { display: flex; align-items: center; gap: 4px 8px; min-width: 0; min-height: 26px; max-width: 100%; }
.acc-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.acc-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.acc-empty { color: var(--disabled); font-size: 13.5px; }
.acc-more { flex: none; padding: 0 6px; border-radius: 6px; background: var(--track); color: var(--text); font-size: 12px; font-weight: 600; }
.acc-name { font-size: 14px; }
.acc-order .pill { min-width: 0; max-width: 100%; flex: 0 1 auto; display: block; overflow: hidden; text-overflow: ellipsis; }
.acc-receiver .acc-line:first-child > .acc-val { flex: none; }

/* a value copies itself; the icon only shows on hover/focus (always on touch) and turns into a tick */
.acc-val {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; min-height: 26px; padding: 1px 5px; margin-left: -5px;
  border: 0; border-radius: 6px; background: none; font-size: 14px; text-align: left; cursor: copy;
}
.acc-val.strong { font-weight: 700; }
.acc-val.acc-cookie { flex: none; }
.acc-val.sub { font-size: 13px; color: var(--muted); }
.mono.acc-val { font-family: ui-monospace, Consolas, monospace; font-size: 13.5px; }
.acc-val .icon { width: 14px; height: 14px; color: var(--muted); opacity: 0; }
.acc-val .icon:last-child, .acc-val.copied .icon:nth-last-child(2) { display: none; }
.acc-val.copied .icon:last-child { display: block; opacity: 1; color: var(--ok); }
.acc-val.copy-failed { color: var(--bad); }
.acc-val:hover { background: var(--hover); }
@media (hover: hover) { /* the hidden icon takes no room: it covers the end of the text while hovered */
  .acc-val { position: relative; }
  .acc-val .icon { position: absolute; right: 2px; padding: 2px; width: 18px; height: 18px; border-radius: 4px; background: var(--hover); }
  .acc-sheet .acc-val .icon { position: static; padding: 0; width: 14px; height: 14px; background: none; }
}
.acc-val:hover .icon, .acc-val:focus-visible .icon { opacity: 1; }
.acc-pass .acc-val { margin-left: 0; }
.acc-pass { margin-left: -5px; display: inline-flex; align-items: center; gap: 2px; min-width: 0; max-width: 100%; }
.acc-eye { display: inline-grid; place-items: center; flex: none; width: 28px; height: 26px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.acc-eye .icon { width: 16px; height: 16px; }
.acc-eye:hover { background: var(--hover); color: var(--text); }
.acc-eye[aria-pressed=true] { color: var(--accent); }

.acc-action { justify-items: end; }
.acc-detail { padding-inline: 6px; border-color: transparent; }
.acc-detail-text { display: none; }
.acc-state { font-size: 12.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-state.bad { color: var(--bad); } .acc-state.ok { color: var(--ok); }
.acc-none { display: grid; justify-items: center; gap: 6px; padding: 44px 16px; text-align: center; }
.acc-none .btn { margin-top: 8px; }
.acc-row.skeleton { display: flex; gap: 24px; min-height: 71px; }
.acc-row.skeleton i { height: 14px; flex: 1; border-radius: 6px; background: var(--track); animation: acc-pulse 1.2s ease-in-out infinite alternate; }
@keyframes acc-pulse { to { opacity: .4; } }

/* ---- pager, selection bar ---- */
.acc-pager { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.acc-pager label { margin-right: auto; }
.acc-pager select { width: auto; min-height: 34px; padding-block: 4px; }
.acc-pages { display: flex; align-items: center; gap: 6px; }
.acc-pages .btn { min-width: 36px; }
#accPageInfo { padding-inline: 6px; }
.acc-selbar {
  position: sticky; bottom: 14px; z-index: 3; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid color-mix(in srgb, var(--accent) 60%, var(--line)); box-shadow: var(--shadow); animation: rise .2s cubic-bezier(.16, 1, .3, 1);
}
.acc-selinfo { display: flex; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; margin-right: auto; }
.acc-selinfo b { font-size: 18px; font-variant-numeric: tabular-nums; }
.acc-export { display: flex; gap: 6px; }
.acc-export select { width: auto; min-height: 40px; padding-block: 6px; }
body:has(#accounts:not(.hidden) #accBar:not(.hidden)) .toast { bottom: 92px; }

/* ---- detail: drawer on desktop, bottom sheet on phones ---- */
.acc-sheet {
  inset: 0 0 0 auto; width: min(460px, 100%); height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; border-left: 1px solid var(--line);
  background: var(--panel); color: var(--text); box-shadow: var(--shadow); overscroll-behavior: contain;
}
.acc-sheet[open] { animation: acc-slide .22s cubic-bezier(.16, 1, .3, 1); }
.acc-sheet::backdrop { background: rgb(0 0 0 / 55%); }
@keyframes acc-slide { from { transform: translateX(32px); opacity: 0; } }
.acc-sheet-in { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
.acc-sheet-head { display: flex; gap: 12px; align-items: start; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.acc-sheet-head > div { flex: 1; min-width: 0; }
.acc-sheet-head h3 { font-size: 18px; overflow-wrap: anywhere; }
.acc-sheet-body { overflow: auto; padding: 4px 18px 18px; }
.acc-sheet-foot { padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.acc-group { padding-top: 16px; }
.acc-group h4 { margin: 0 0 4px; text-transform: none; letter-spacing: 0; font-size: 13px; }
.acc-group dl { margin: 0; }
.acc-field { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 10px; align-items: start; padding: 4px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 50%, transparent); }
.acc-field:last-child { border-bottom: 0; }
.acc-field dt { color: var(--muted); font-size: 13.5px; padding-top: 4px; }
.acc-field dd { margin: 0; min-width: 0; min-height: 28px; display: flex; align-items: center; }
.acc-plain { overflow-wrap: anywhere; font-size: 14px; }
.acc-val.wrap .acc-text { white-space: normal; overflow-wrap: anywhere; }
.acc-sheet .acc-val .icon { opacity: .75; }

@media (pointer: coarse) {
  .acc-val, .acc-line, .acc-eye { min-height: 34px; }
  .acc-eye { width: 38px; height: 34px; }
  .acc-val .icon { opacity: .6; }
}

/* ---- cards: phones and tablets ---- */
@media (max-width: 1080px) {
  .acc-table { border: 0; background: none; }
  .acc-head { display: flex; padding: 4px 14px; background: none; border: 0; }
  .acc-head > span { display: none; }
  .acc-all-text { display: inline; }
  .acc-head .acc-pick { gap: 12px; min-height: 32px; }
  .acc-list { display: grid; gap: 10px; }
  .acc-row, .acc-row:last-child {
    border: 1px solid var(--line); border-radius: var(--radius); background-color: var(--card); padding: 12px 14px; gap: 4px 14px; align-items: start;
    grid-template-columns: 18px minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "pick user status" "pick contact order" "pick receiver receiver" "pick action action";
  }
  .acc-row:hover { background-color: var(--card); }
  .acc-row.picked { border-color: var(--accent); background-color: color-mix(in srgb, var(--accent) 8%, var(--card)); }
  .acc-row.checking { border-color: var(--progress); }
  .acc-pick { grid-area: pick; align-items: start; padding-top: 5px; }
  .acc-head .acc-pick { align-items: center; padding: 0; }
  .acc-user { grid-area: user; } .acc-contact { grid-area: contact; } .acc-order { grid-area: order; } .acc-receiver { grid-area: receiver; }
  .acc-status { grid-area: status; justify-self: end; padding-top: 2px; }
  .acc-contact, .acc-order, .acc-receiver { padding-top: 6px; border-top: 1px solid color-mix(in srgb, var(--line) 50%, transparent); align-self: stretch; align-content: start; width: 100%; }
  .acc-receiver.none { display: none; }
  .acc-action { grid-area: action; justify-items: stretch; padding-top: 6px; }
  .acc-action .acc-line { gap: 8px; }
  .acc-action .btn { flex: 1; min-height: 40px; border-color: var(--line); }
  .acc-detail-text { display: inline; }
  .acc-state { white-space: normal; }
  .acc-row.skeleton { min-height: 150px; align-items: center; }
}
@media (max-width: 760px) {
  .acc-toolbar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .acc-search { grid-column: 1 / -1; }
  .acc-mvd-filter select { width: 100%; }
  .acc-opt > summary { width: 100%; max-width: none; font-size: 14px; padding-inline: 10px; }
  .acc-selbar { bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 8px); flex-wrap: wrap; padding: 10px 12px; gap: 8px; }
  .acc-selinfo { flex: 1 1 100%; }
  .acc-selinfo .btn { margin-left: auto; }
  .acc-export { flex: 1; min-width: 0; }
  .acc-export label { flex: 1; min-width: 0; }
  .acc-export select { width: 100%; }
  body.as-renter:has(#accounts:not(.hidden) #accBar:not(.hidden)) .toast { bottom: calc(var(--tabbar) + 124px + env(safe-area-inset-bottom)); }
  .acc-job-actions { margin-left: 0; width: 100%; }
  .acc-job-actions .btn { flex: 1; min-height: 38px; }
  .acc-sheet { inset: auto 0 0 0; width: 100%; height: auto; max-height: 90dvh; border: 0; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; }
  .acc-sheet[open] { animation-name: rise; }
  .acc-sheet-in { height: auto; max-height: 90dvh; }
  .acc-field { grid-template-columns: 104px minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .acc-row, .acc-row:last-child {
    grid-template-columns: 18px minmax(0, 1fr) auto;
    grid-template-areas: "pick user user" "pick contact contact" "pick order order" "pick receiver receiver" "pick action action";
  }
  .acc-status { position: absolute; top: 14px; right: 14px; padding: 0; }
  .acc-user .acc-line:first-child { padding-right: 118px; }
  .acc-pager label { margin-right: 0; margin-left: auto; }
  .acc-pages { width: 100%; justify-content: space-between; }
  .acc-pages .btn { min-width: 44px; min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .acc-row.skeleton i, .acc-selbar, .acc-sheet[open] { animation: none; }
}
