/* ============================================================
   เตือน — เว็บสมาชิก /account (v1.3.0)
   โทนเดียวกับแอป: เงียบ สุภาพ พื้น #f7f8fa การ์ดขาว เขียว LINE
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }
/* v1.3.1: hidden ต้องชนะทุก display ที่ประกาศทีหลัง (ไม่งั้น modal/แถวที่ซ่อนไว้โผล่เอง) */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: 'Anuphan', -apple-system, sans-serif;
  background: #f7f8fa;
  color: #1a1f2e;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }

/* ---------- boot ---------- */
.boot {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #9aa1ab; font-size: 14px;
}

/* ---------- layout ---------- */
#shell { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; }
#topbar { display: none; }
#backdrop { position: fixed; inset: 0; background: rgba(20,24,40,.35); z-index: 40; }

#side {
  background: #fbfcfd; border-right: 1px solid #eef0f3;
  padding: 20px 12px; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.slogo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 18px; padding: 2px 10px 18px; }
.slmk {
  width: 30px; height: 30px; border-radius: 9px; background: #fff; border: 1px solid #eceef1;
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px;
  box-shadow: 0 1px 4px rgba(20,24,40,.08);
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button, .nav .navlink {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  font-size: 14px; color: #4a4f57; font-weight: 600; text-align: left; width: 100%;
}
.nav button:hover, .nav .navlink:hover { background: #f1f3f5; }
.nav button.on { background: #e7f7ee; color: #0a7a45; font-weight: 800; }
.nav .ic { width: 20px; text-align: center; }
.sgrow { flex: 1; }
.schip { display: flex; align-items: center; gap: 10px; padding: 12px 10px 2px; border-top: 1px solid #eef0f3; }
.sc-name { font-size: 12.5px; font-weight: 800; line-height: 1.3; word-break: break-word; }
.sc-out { font-size: 11px; color: #9aa1ab; padding: 0; }
.sc-out:hover { color: #ef4444; }

/* avatar วงแหวน aurora เดียวกับแอป */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: inline-flex;
  align-items: center; justify-content: center; font-size: 16px; color: #fff; font-weight: 800;
  background: linear-gradient(135deg, #f5a524, #e07b12);
  border: 2px solid transparent;
  background-clip: padding-box;
  position: relative;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar.ring { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #12C7B4; }
.avatar.sm { width: 32px; height: 32px; font-size: 14px; }

#main { padding: 30px 34px 60px; max-width: 880px; }
.view { animation: fadein .18s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.mh1 { font-size: 20px; font-weight: 800; margin-bottom: 2px; }
.mhs { font-size: 13.5px; color: #6b7280; margin-bottom: 20px; }

/* ---------- cards ---------- */
.grid2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; margin-bottom: 14px; }
.card {
  background: #fff; border: 1px solid #eceef1; border-radius: 16px;
  padding: 18px 20px; box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.cardh { font-size: 11.5px; font-weight: 800; color: #9aa1ab; letter-spacing: .08em; margin-bottom: 10px; text-transform: uppercase; }
.mt14 { margin-top: 14px; } .mb14 { margin-bottom: 14px; } .mt10 { margin-top: 10px; }

.plrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.plname { font-size: 18px; font-weight: 800; }
.pltag { background: #e7f7ee; color: #0a7a45; font-size: 10.5px; font-weight: 800; border-radius: 999px; padding: 3px 12px; }
.usage { font-size: 13px; color: #6b7280; margin-bottom: 6px; }
.usage b { color: #1a1f2e; }
.bar { height: 8px; background: #eef0f3; border-radius: 99px; overflow: hidden; margin-bottom: 12px; }
.bar i { display: block; height: 100%; width: 0; background: #06c755; border-radius: 99px; transition: width .5s ease; }
.bar i.warn { background: #f5a524; }
.expiry { font-size: 12px; color: #9aa1ab; margin: -6px 0 12px; }

.upbtn {
  display: inline-block; background: #06c755; color: #fff; border-radius: 11px;
  padding: 9px 22px; font-size: 13.5px; font-weight: 800;
  box-shadow: 0 6px 14px -7px rgba(6,199,85,.5);
}
.upbtn:hover { background: #05b34c; }
.ghostbtn {
  display: inline-block; background: #fff; border: 1.5px solid #e5e7eb; color: #1a1f2e;
  border-radius: 11px; padding: 8px 18px; font-size: 13px; font-weight: 700; margin-left: 8px;
}
.ghostbtn:hover { background: #f7f8fa; }

.stats { display: flex; gap: 8px; margin-bottom: 8px; }
.stat { flex: 1; text-align: center; padding: 6px 0 2px; }
.stat b { display: block; font-size: 24px; font-weight: 800; line-height: 1.2; }
.stat span { font-size: 11.5px; color: #9aa1ab; }
.c-red { color: #ef4444; } .c-green { color: #0a7a45; } .c-blue { color: #3b82f6; }
.c-green2 { color: #0a7a45; }
.applink { display: block; text-align: center; font-size: 12.5px; color: #0a7a45; font-weight: 700; padding-top: 4px; }

.rowk { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; padding: 9px 0; border-bottom: 1px solid #f5f6f8; color: #6b7280; }
.rowk b { color: #1a1f2e; font-weight: 700; text-align: right; }
.rowk:last-child, .rowk.noline { border-bottom: none; }
.klink { color: #0a7a45; font-weight: 700; }
.klink:hover { text-decoration: underline; }

.emp { font-size: 12.5px; color: #b6bcc6; text-align: center; padding: 14px 0; }
.emp.big { font-size: 14px; padding: 30px 0; }
.emp.big small { color: #c9ced6; font-size: 12px; }

.qa { display: flex; gap: 10px; }
.qbtn {
  flex: 1; background: #fff; border: 1px solid #eceef1; border-radius: 13px; padding: 13px 6px;
  text-align: center; font-size: 12px; font-weight: 700; color: #1a1f2e;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.qbtn:hover { border-color: #d8dce1; }
.qbtn .qi { display: block; font-size: 19px; margin-bottom: 4px; }

/* ---------- plans ---------- */
.ptoggle { display: inline-flex; background: #eef0f3; border-radius: 999px; padding: 3px; margin-bottom: 18px; }
.ptoggle button { padding: 7px 18px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: #6b7280; }
.ptoggle button.on { background: #fff; color: #1a1f2e; box-shadow: 0 1px 4px rgba(0,0,0,.1); }

.plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.pcard { background: #fff; border: 1.5px solid #eceef1; border-radius: 16px; padding: 18px 15px 15px; position: relative; }
.pcard.cur { border-color: #c7ccd3; background: #fbfcfd; }
.pcard.hot { border-color: #06c755; box-shadow: 0 10px 26px -14px rgba(6,199,85,.35); }
.pbadge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  font-size: 9.5px; font-weight: 800; border-radius: 999px; padding: 2px 10px; white-space: nowrap;
}
.pbadge.hot { background: #1a1f2e; color: #ffd338; }
.pbadge.cur { background: #eef0f3; color: #6b7280; }
.pn { font-size: 14.5px; font-weight: 800; }
.pp { font-size: 22px; font-weight: 800; margin-top: 4px; }
.pp small { font-size: 11px; color: #9aa1ab; font-weight: 600; }
.pdel { font-size: 12px; color: #b6bcc6; text-decoration: line-through; margin-right: 4px; }
.pfree { font-size: 11px; color: #0a7a45; font-weight: 800; min-height: 18px; }
.pq { font-size: 12.5px; color: #6b7280; margin: 7px 0 12px; }
.pq b { color: #1a1f2e; }
.pbtn { display: block; width: 100%; text-align: center; border-radius: 10px; padding: 9px; font-size: 12.5px; font-weight: 800; background: #06c755; color: #fff; }
.pbtn:hover { background: #05b34c; }
.pbtn.gray { background: #eef0f3; color: #9aa1ab; cursor: default; }
.pbtn.gray:hover { background: #eef0f3; }
.pnote { font-size: 11px; color: #9aa1ab; margin-top: 9px; text-align: center; }

/* ---------- billing table ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { font-size: 10.5px; color: #9aa1ab; font-weight: 700; text-align: left; padding: 8px 10px; border-bottom: 1.5px solid #eef0f3; text-transform: uppercase; letter-spacing: .05em; }
td { padding: 11px 10px; border-bottom: 1px solid #f5f6f8; }
td b { font-weight: 700; }
tr:last-child td { border-bottom: none; }
.rcpt { color: #0a7a45; font-weight: 700; font-size: 12px; }
.rcpt:hover { text-decoration: underline; }

/* ---------- danger ---------- */
.danger { border-color: #fbdcdc; background: #fffafa; }
.danger .cardh { color: #c0392b; }
.dbtn { border: 1.5px solid #fbdcdc; color: #c0392b; border-radius: 10px; padding: 7px 16px; font-size: 12.5px; font-weight: 700; background: #fff; }
.dbtn:hover { background: #fdf1f1; }
.dbtn.solid { background: #e74c3c; color: #fff; border-color: #e74c3c; }
.dbtn.solid:disabled { background: #f2b7b0; border-color: #f2b7b0; cursor: not-allowed; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(20,24,40,.45); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 20px; }
.mbox { background: #fff; border-radius: 18px; padding: 24px; width: 100%; max-width: 400px; box-shadow: 0 30px 70px -20px rgba(20,24,40,.4); }
.mtitle { font-size: 16px; font-weight: 800; color: #c0392b; margin-bottom: 8px; }
.mtext { font-size: 13px; color: #4a4f57; margin-bottom: 14px; }
.mbox input { width: 100%; border: 1.5px solid #e5e7eb; border-radius: 11px; padding: 10px 13px; font-family: inherit; font-size: 14px; margin-bottom: 14px; outline: none; }
.mbox input:focus { border-color: #c0392b; }
.mrow { display: flex; justify-content: flex-end; gap: 8px; }
.mrow .ghostbtn { margin-left: 0; }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: #1a1f2e; color: #fff; font-size: 13px; font-weight: 600;
  border-radius: 12px; padding: 11px 20px; z-index: 70; max-width: 90vw; text-align: center;
  box-shadow: 0 10px 30px -10px rgba(20,24,40,.5);
}

/* ============================================================
   มือถือ ≤ 860px — sidebar กลายเป็น drawer
   ============================================================ */
@media (max-width: 860px) {
  #shell { display: block; }
  #topbar {
    display: flex; align-items: center; gap: 10px; background: #fff;
    border-bottom: 1px solid #eef0f3; padding: 12px 16px;
    position: sticky; top: 0; z-index: 30;
  }
  .tb-txt { flex: 1; min-width: 0; }
  .tb-name { font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tb-sub { font-size: 10.5px; color: #9aa1ab; }
  #tb-menu { font-size: 20px; color: #6b7280; padding: 4px 8px; }

  #side {
    position: fixed; top: 0; left: 0; bottom: 0; width: 250px; z-index: 50;
    transform: translateX(-105%); transition: transform .22s ease;
    box-shadow: 20px 0 60px -30px rgba(20,24,40,.4); height: 100dvh;
  }
  #side.open { transform: translateX(0); }

  #main { padding: 18px 16px 70px; }
  .grid2 { grid-template-columns: 1fr; }
  .plans { grid-template-columns: 1fr 1fr; gap: 14px 10px; }
  .rowk b { max-width: 60%; }
}
@media (max-width: 420px) {
  .plans { grid-template-columns: 1fr; }
  .qa { flex-wrap: wrap; }
  .qbtn { min-width: 44%; }
}
