/* AnyConN — สไตล์ระบบบัญชีผู้ใช้ (ใช้ร่วมกันทั้งเว็บและแอป) ต้นฉบับอยู่ที่ shared/ สร้างสำเนาด้วย `node sync-shared.js`
   ใช้ตัวแปรสีของธีมดำ-เหลืองที่ทั้งสองหน้าประกาศไว้แล้ว */
.ac-i { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ปุ่ม */
.ac-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; min-height: 40px;
  font: 600 14px/1.2 var(--font); border: 1px solid transparent; border-radius: var(--r-sm); cursor: pointer; background: none; color: var(--ink);
}
.ac-btn:active { transform: translateY(1px); }
.ac-btn:disabled { opacity: .55; cursor: default; }
.ac-primary { color: var(--accent-ink); background: var(--accent); }
.ac-primary:hover:not(:disabled) { opacity: .92; }
.ac-quiet { color: var(--accent-text); border-color: var(--line-strong); }
.ac-quiet:hover:not(:disabled) { background: var(--accent-soft); }
.ac-danger { color: #2a0a0d; background: var(--danger); }
.ac-sm { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.ac-link { padding: 0; min-height: 0; border: 0; background: none; color: var(--accent-text); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ac-btn.ac-link { padding: 6px 4px; font-size: 13px; }
.ac-icon-btn { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; color: var(--muted); background: none; border: 1px solid transparent; border-radius: var(--r-sm); cursor: pointer; }
.ac-icon-btn:hover { color: var(--accent-text); background: var(--accent-soft); }

/* แถบบัญชี */
.ac-bar { width: 100%; max-width: 420px; }
.ac-bar:empty { display: none; }
.ac-barrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; background: var(--sheet-2); border: 1px solid var(--line); border-radius: var(--r-md); }
.ac-who { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--accent-text); }
.ac-who-t { display: flex; flex-direction: column; min-width: 0; color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.ac-who-t small { font-size: 12.5px; font-weight: 400; color: var(--muted); }
.ac-barbtns { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ac-unlock { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; padding: 10px 12px; background: var(--wait-soft); border: 1px solid var(--wait); border-radius: var(--r-md); }
.ac-unlock input { flex: 1 1 140px; width: auto; height: 38px; }
.ac-ulock { color: var(--wait); display: grid; }
.ac-unlock .ac-err { flex-basis: 100%; margin: 0; }

/* ตัวเลือกในฟอร์ม */
.ac-opts { margin: -4px 0 16px; display: grid; gap: 10px; }
.ac-opts:empty { display: none; }
.ac-opts input[type="text"] { height: 42px; }
.ac-check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--ink-2); }
.ac-check input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--accent); }
.ac-hint, .ac-known { margin: 0; font-size: 13px; color: var(--muted); }
.ac-known { display: flex; align-items: center; gap: 8px; color: var(--accent-text); }

/* รายการ */
.ac-lists { width: 100%; max-width: 420px; }
.ac-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.ac-tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: -1px; font: 600 14px/1.2 var(--font); color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; }
.ac-tab:hover { color: var(--ink); }
.ac-tab[aria-selected="true"] { color: var(--accent-text); border-bottom-color: var(--accent); }
.ac-count { min-width: 22px; padding: 1px 7px; font: 600 12px/18px var(--font-num); text-align: center; color: var(--ink-2); background: var(--sheet-2); border: 1px solid var(--line); border-radius: 99px; }
.ac-panel { padding-top: 12px; }
.ac-listhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.ac-small { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.ac-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; max-height: min(46vh, 420px); overflow: auto; }
.ac-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r-md); }
.ac-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ac-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-weight: 600; overflow-wrap: anywhere; }
.ac-sub { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.ac-note-t { font-style: italic; }
.ac-pwtag { display: inline-grid; color: var(--live); }
.ac-rowbtns { display: flex; align-items: center; gap: 2px; flex: none; }
.ac-badge { padding: 1px 8px; font-size: 12px; font-weight: 600; border-radius: 99px; }
.ac-ok { color: var(--live); background: var(--live-soft); }
.ac-warn { color: var(--wait); background: var(--wait-soft); }
.ac-bad { color: var(--danger); background: var(--danger-soft); }
.ac-empty { margin: 8px 0 0; padding: 18px 12px; text-align: center; font-size: 13.5px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--r-md); }
.ac-more { margin-top: 10px; width: 100%; }

/* กล่องโต้ตอบ */
.ac-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .66); }
.ac-dialog { width: min(100%, 420px); max-height: 92vh; overflow: auto; padding: 24px; background: var(--sheet); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--r-lg); font-family: var(--font); }
.ac-dialog h2 { margin: 0 0 16px; font-size: 20px; font-weight: 650; }
.ac-form { display: block; }
.ac-field { display: block; margin-bottom: 14px; }
.ac-field > span { display: block; margin-bottom: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.ac-field small { display: block; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.ac-field input, .ac-dialog input[type="text"], .ac-dialog input[type="password"] {
  display: block; width: 100%; height: 44px; padding: 0 12px; font: inherit; color: var(--ink); background: var(--sheet-2); border: 1px solid var(--field-line); border-radius: var(--r-sm);
}
.ac-field input[readonly] { color: var(--muted); border-style: dashed; }
.ac-field input.ac-id { font: 400 20px/1 var(--font-num); letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.ac-field input:focus-visible, .ac-opts input:focus-visible, .ac-unlock input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ac-text { margin: 0 0 14px; color: var(--ink-2); }
.ac-note { margin: 0 0 14px; padding: 10px 12px; font-size: 13px; color: var(--ink-2); background: var(--sheet-2); border-left: 3px solid var(--accent); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.ac-err { min-height: 0; margin: 0 0 10px; font-size: 13.5px; color: var(--danger); }
.ac-err:empty { display: none; }
.ac-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.ac-actions .ac-primary, .ac-actions .ac-danger { flex: 1 1 auto; }
.ac-switch { margin: 16px 0 0; font-size: 13.5px; color: var(--muted); }

@media (prefers-reduced-motion: no-preference) {
  .ac-dialog { animation: ac-in .14s ease-out; }
  @keyframes ac-in { from { opacity: 0; transform: translateY(6px); } }
}
@media (max-width: 460px) {
  .ac-row { flex-direction: column; align-items: stretch; }
  .ac-rowbtns { justify-content: flex-end; }
}
