.jlpt-auth-slot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.jlpt-login-button {
  min-width: 84px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 17px;
  border: 1px solid #0866ff;
  border-radius: 7px;
  background: #0866ff;
  color: #fff !important;
  font: 700 16px/1 Poppins, sans-serif;
  text-decoration: none;
  box-shadow: 0 6px 15px rgba(8, 102, 255, 0.2);
  transition: transform .18s ease, background .18s ease;
}

.jlpt-login-button:hover {
  background: #075ce5;
  transform: translateY(-1px);
}

.jlpt-account-menu { position: relative; }

.jlpt-account-trigger {
  width: 43px;
  height: 43px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.jlpt-account-avatar {
  width: 43px;
  height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #4f7df2, #315bd7);
  color: #fff;
  font: 800 18px/1 Poppins, sans-serif;
  box-shadow: 0 0 0 3px rgba(79, 125, 242, .16);
  overflow: hidden;
}

.jlpt-account-avatar-image {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  object-fit: cover;
  object-position: center;
}

.jlpt-account-avatar.is-large {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  font-size: 20px;
}

.jlpt-account-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 5000;
  width: min(370px, calc(100vw - 24px));
  padding: 18px 16px 15px;
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 15px;
  background: #242526;
  color: #e4e6eb;
  box-shadow: 0 16px 44px rgba(0,0,0,.42);
  font-family: Poppins, sans-serif;
}

.jlpt-account-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 3px 12px;
}

.jlpt-account-header strong {
  overflow: hidden;
  color: #e4e6eb;
  font-size: 19px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jlpt-account-divider {
  height: 2px;
  margin: 0 4px 14px;
  background: #65676b;
  opacity: .72;
}

.jlpt-account-divider.is-soft {
  height: 1px;
  margin: 14px 4px 12px;
  opacity: .34;
}

.jlpt-profile-action {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 13px;
  border-radius: 10px;
  background: #3a3b3c;
  color: #e4e6eb !important;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}

.jlpt-profile-action:hover { background: #4e4f50; }

.jlpt-account-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #3a3b3c;
  color: #e4e6eb;
}

.jlpt-account-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.jlpt-profile-action .jlpt-account-icon {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  background: transparent;
}

.jlpt-account-info-row,
.jlpt-account-logout {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 3px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #e4e6eb;
  text-align: left;
}

.jlpt-account-info-row > span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.jlpt-account-info-row strong,
.jlpt-account-logout > span:last-child {
  font-size: 16px;
  font-weight: 700;
}

.jlpt-account-info-row small {
  overflow: hidden;
  color: #b0b3b8;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jlpt-account-logout {
  cursor: pointer;
  font: inherit;
}

.jlpt-account-logout:hover { background: #3a3b3c; }

/* Auth pages */
.jlpt-auth-page,
.jlpt-profile-page,
.jlpt-history-page {
  min-height: 100vh;
  margin: 0;
  background: #f3f6fb;
  color: #172033;
  font-family: Poppins, "Noto Sans JP", sans-serif;
}

.jlpt-auth-page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
  background:
    radial-gradient(circle at 20% 15%, rgba(99,102,241,.16), transparent 28%),
    radial-gradient(circle at 85% 75%, rgba(14,165,233,.13), transparent 30%);
}

.jlpt-auth-card {
  width: min(490px, 100%);
  padding: 30px;
  border: 1px solid #e1e7f0;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(37, 50, 80, .13);
}

.jlpt-auth-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 23px;
}

.jlpt-auth-brand a {
  color: #4f46e5;
  font-weight: 800;
  text-decoration: none;
}

.jlpt-auth-card h1 { margin: 0 0 7px; font-size: 28px; }
.jlpt-auth-card > p { margin: 0 0 23px; color: #68748a; }
.jlpt-auth-form { display: grid; gap: 15px; }
.jlpt-form-field { display: grid; gap: 7px; }
.jlpt-form-field label { font-size: 13px; font-weight: 700; }

.jlpt-form-field input,
.jlpt-form-field select {
  width: 100%;
  min-height: 46px;
  box-sizing: border-box;
  padding: 0 13px;
  border: 1px solid #d4dce8;
  border-radius: 10px;
  background: #fff;
  color: #172033;
  font: 500 14px/1 Poppins, sans-serif;
  outline: none;
}

.jlpt-form-field input:focus,
.jlpt-form-field select:focus {
  border-color: #4f7df2;
  box-shadow: 0 0 0 4px rgba(79,125,242,.12);
}

.jlpt-auth-submit {
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  background: #0866ff;
  color: #fff;
  font: 800 15px/1 Poppins, sans-serif;
  cursor: pointer;
}

.jlpt-auth-submit:disabled { opacity: .62; cursor: wait; }
.jlpt-auth-feedback { min-height: 20px; margin: 0; font-size: 13px; }
.jlpt-auth-feedback.is-error { color: #c62828; }
.jlpt-auth-footer { margin-top: 19px; color: #667085; text-align: center; font-size: 14px; }
.jlpt-auth-footer a { color: #315bd7; font-weight: 750; }

/* Profile/history */
.jlpt-simple-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 5vw;
  border-bottom: 1px solid #e1e7ef;
  background: #fff;
}

.jlpt-simple-header a {
  color: #1f3e78;
  font-weight: 800;
  text-decoration: none;
}

.jlpt-simple-main {
  width: min(1040px, calc(100% - 30px));
  margin: 34px auto 70px;
}

.jlpt-profile-hero,
.jlpt-history-card,
.jlpt-profile-progress {
  border: 1px solid #e1e7ef;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(35, 50, 80, .08);
}

.jlpt-profile-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 25px;
}

.jlpt-profile-hero .jlpt-account-avatar {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  font-size: 28px;
}

.jlpt-profile-hero h1 { margin: 0 0 5px; }
.jlpt-profile-hero p { margin: 2px 0; color: #667085; }
.jlpt-profile-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 20px; margin-top: 20px; }
.jlpt-profile-progress { padding: 22px; }
.jlpt-profile-progress h2 { margin-top: 0; }
.jlpt-profile-level-form { display: flex; gap: 9px; margin-top: 15px; }
.jlpt-profile-level-form select { min-height: 42px; flex: 1; border: 1px solid #d4dce8; border-radius: 9px; padding: 0 10px; }
.jlpt-profile-level-form > button { border: 0; border-radius: 9px; padding: 0 15px; background: #315bd7; color: #fff; font-weight: 700; }

.jlpt-history-card { padding: 20px; }
.jlpt-history-list { display: grid; gap: 11px; }
.jlpt-history-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 18px;
  padding: 15px;
  border: 1px solid #e7ecf3;
  border-radius: 13px;
  background: #f9fbfd;
}
.jlpt-history-item h3 { margin: 0; font-size: 15px; }
.jlpt-history-item p { margin: 3px 0 0; color: #68748a; font-size: 12px; }
.jlpt-history-score { align-self: center; color: #315bd7; font-size: 18px; font-weight: 850; }
.jlpt-empty-panel { padding: 28px 10px; color: #68748a; text-align: center; }

html.dark .jlpt-auth-page,
html.dark .jlpt-profile-page,
html.dark .jlpt-history-page,
body.dark.jlpt-auth-page,
body.dark.jlpt-profile-page,
body.dark.jlpt-history-page { background: #34383f; color: #f4f6f8; }
html.dark .jlpt-auth-card,
html.dark .jlpt-simple-header,
html.dark .jlpt-profile-hero,
html.dark .jlpt-history-card,
html.dark .jlpt-profile-progress { background: #3f444c; border-color: #5c6470; color: #f4f6f8; }
html.dark .jlpt-form-field input,
html.dark .jlpt-form-field select,
html.dark .jlpt-profile-level-form select { background: #484e57; border-color: #5c6470; color: #fff; }
html.dark .jlpt-history-item { background: #484e57; border-color: #5c6470; }
html.dark .jlpt-auth-card > p,
html.dark .jlpt-profile-hero p,
html.dark .jlpt-history-item p,
html.dark .jlpt-auth-footer { color: #c5cad1; }

@media (max-width: 720px) {
  .jlpt-account-dropdown { position: fixed; top: 70px; right: 10px; }
  .jlpt-profile-grid { grid-template-columns: 1fr; }
  .jlpt-auth-card { padding: 23px 18px; }
}
/* =========================================================
   2026 UI FIX — SHARED 3D ACCOUNT MENU / PROFILE / SCROLL
   ========================================================= */

:root {
  --jlpt-floating-background:
    linear-gradient(
      145deg,
      #ffffff 0%,
      #eef3f9 100%
    );

  --jlpt-floating-surface:
    linear-gradient(
      145deg,
      #ffffff 0%,
      #e8eef6 100%
    );

  --jlpt-floating-text: #182033;
  --jlpt-floating-muted: #667085;
  --jlpt-floating-divider: #d4dce8;
  --jlpt-floating-border:
    rgba(255, 255, 255, 0.94);
  --jlpt-floating-soft-border: #d8e1ec;

  --jlpt-floating-shadow:
    0 28px 64px
      rgba(39, 55, 86, 0.24),
    0 9px 20px
      rgba(39, 55, 86, 0.13),
    inset 1px 1px 0
      rgba(255, 255, 255, 0.96),
    inset -1px -1px 0
      rgba(108, 126, 158, 0.13);
}

html.dark,
body.dark {
  --jlpt-floating-background:
    linear-gradient(
      145deg,
      #4c525b 0%,
      #383d45 100%
    );

  --jlpt-floating-surface:
    linear-gradient(
      145deg,
      #555c66 0%,
      #424850 100%
    );

  --jlpt-floating-text: #f5f7fa;
  --jlpt-floating-muted: #cbd1d9;
  --jlpt-floating-divider: #69717c;
  --jlpt-floating-border:
    rgba(255, 255, 255, 0.12);
  --jlpt-floating-soft-border: #646d78;

  --jlpt-floating-shadow:
    0 28px 64px
      rgba(10, 13, 18, 0.35),
    0 9px 20px
      rgba(10, 13, 18, 0.24),
    inset 1px 1px 0
      rgba(255, 255, 255, 0.10),
    inset -1px -1px 0
      rgba(0, 0, 0, 0.20);
}

/*
 * Dropdown được đưa trực tiếp vào body bằng JavaScript.
 * position: fixed + z-index cao giúp nó không còn bị ảnh header
 * hoặc container có overflow che khuất.
 */
.jlpt-account-dropdown {
  position: fixed !important;
  z-index: 2147483001 !important;

  width: min(
    385px,
    calc(100vw - 24px)
  ) !important;

  padding: 18px !important;

  border:
    1px solid
    var(--jlpt-floating-border) !important;

  border-radius: 22px !important;

  background:
    var(
      --jlpt-floating-background
    ) !important;

  color:
    var(
      --jlpt-floating-text
    ) !important;

  box-shadow:
    var(
      --jlpt-floating-shadow
    ) !important;

  opacity: 0;

  transform:
    perspective(900px)
    rotateX(-7deg)
    translateY(-9px)
    scale(0.975);

  transform-origin:
    top right;

  transition:
    opacity 0.14s ease,
    transform 0.18s ease !important;

  isolation: isolate;
}

.jlpt-account-dropdown[hidden] {
  display: none !important;
}

.jlpt-account-dropdown.is-visible {
  opacity: 1;

  transform:
    perspective(900px)
    rotateX(0)
    translateY(0)
    scale(1);
}

.jlpt-account-dropdown::before {
  position: absolute;
  inset: 1px 13px auto;
  z-index: -1;

  height: 1px;

  border-radius: 999px;

  background:
    rgba(255, 255, 255, 0.78);

  content: "";
}

.jlpt-account-trigger {
  position: relative;

  display: inline-grid;
  place-items: center;

  border:
    1px solid
    rgba(79, 125, 242, 0.22) !important;

  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.92),
      rgba(226, 234, 248, 0.92)
    ) !important;

  box-shadow:
    0 9px 18px
      rgba(49, 91, 215, 0.17),
    inset 1px 1px 0
      rgba(255, 255, 255, 0.95),
    inset -1px -1px 0
      rgba(84, 102, 138, 0.11) !important;

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease !important;
}

.jlpt-account-trigger:hover,
.jlpt-account-menu.is-open
  .jlpt-account-trigger {
  transform: translateY(-2px);

  box-shadow:
    0 13px 24px
      rgba(49, 91, 215, 0.22),
    inset 1px 1px 0
      rgba(255, 255, 255, 0.95),
    inset -1px -1px 0
      rgba(84, 102, 138, 0.11) !important;
}

html.dark .jlpt-account-trigger,
body.dark .jlpt-account-trigger {
  border-color:
    rgba(138, 180, 255, 0.28) !important;

  background:
    linear-gradient(
      145deg,
      #545b66,
      #3f454d
    ) !important;

  box-shadow:
    0 10px 20px
      rgba(0, 0, 0, 0.22),
    inset 1px 1px 0
      rgba(255, 255, 255, 0.10),
    inset -1px -1px 0
      rgba(0, 0, 0, 0.18) !important;
}

.jlpt-account-header {
  padding: 3px 4px 13px !important;
}

.jlpt-account-header strong,
.jlpt-account-info-row,
.jlpt-account-logout {
  color:
    var(
      --jlpt-floating-text
    ) !important;
}

.jlpt-account-name {
  min-width: 0;

  display: grid;
  gap: 3px;
}

.jlpt-account-name strong {
  overflow: hidden;

  font-size: 18px !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jlpt-account-name small {
  color:
    var(
      --jlpt-floating-muted
    );

  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.jlpt-account-divider {
  background:
    var(
      --jlpt-floating-divider
    ) !important;

  box-shadow:
    0 1px 0
      rgba(255, 255, 255, 0.56);
}

.jlpt-profile-action {
  position: relative;

  min-height: 58px !important;

  padding: 9px 12px !important;

  border:
    1px solid
    var(
      --jlpt-floating-soft-border
    ) !important;

  border-radius: 16px !important;

  background:
    var(
      --jlpt-floating-surface
    ) !important;

  color:
    var(
      --jlpt-floating-text
    ) !important;

  box-shadow:
    0 10px 20px
      rgba(47, 64, 96, 0.11),
    inset 1px 1px 0
      rgba(255, 255, 255, 0.88),
    inset -1px -1px 0
      rgba(86, 103, 135, 0.10);

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease !important;
}

.jlpt-profile-action:hover {
  background:
    var(
      --jlpt-floating-surface
    ) !important;

  transform:
    translateY(-2px);

  box-shadow:
    0 14px 26px
      rgba(47, 64, 96, 0.17),
    inset 1px 1px 0
      rgba(255, 255, 255, 0.88),
    inset -1px -1px 0
      rgba(86, 103, 135, 0.10);
}

html.dark .jlpt-profile-action,
body.dark .jlpt-profile-action {
  box-shadow:
    0 11px 22px
      rgba(0, 0, 0, 0.20),
    inset 1px 1px 0
      rgba(255, 255, 255, 0.09),
    inset -1px -1px 0
      rgba(0, 0, 0, 0.18);
}

.jlpt-profile-action
  .jlpt-account-icon {
  width: 40px !important;
  height: 40px !important;
  flex: 0 0 40px !important;

  border-radius: 13px !important;

  background:
    linear-gradient(
      145deg,
      #6f96f5,
      #315bd7
    ) !important;

  color: #ffffff !important;

  box-shadow:
    0 9px 17px
      rgba(49, 91, 215, 0.25),
    inset 1px 1px 0
      rgba(255, 255, 255, 0.28);
}

.jlpt-profile-action
  .is-profile-icon svg {
  width: 23px;
  height: 23px;
}

.jlpt-profile-chevron {
  width: 19px;
  height: 19px;

  margin-left: auto;

  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;

  opacity: 0.58;
}

.jlpt-account-info-row,
.jlpt-account-logout {
  min-height: 61px !important;

  padding: 8px 5px !important;

  transition:
    background 0.16s ease,
    transform 0.16s ease;
}

.jlpt-account-info-row:hover,
.jlpt-account-logout:hover {
  background:
    rgba(106, 124, 156, 0.10) !important;

  transform:
    translateX(2px);
}

html.dark
  .jlpt-account-info-row:hover,
body.dark
  .jlpt-account-info-row:hover,
html.dark
  .jlpt-account-logout:hover,
body.dark
  .jlpt-account-logout:hover {
  background:
    rgba(255, 255, 255, 0.07) !important;
}

.jlpt-account-icon {
  border:
    1px solid
    var(
      --jlpt-floating-soft-border
    );

  background:
    var(
      --jlpt-floating-surface
    ) !important;

  color:
    var(
      --jlpt-floating-text
    ) !important;

  box-shadow:
    inset 1px 1px 0
      rgba(255, 255, 255, 0.75),
    0 7px 14px
      rgba(46, 63, 93, 0.09);
}

html.dark .jlpt-account-icon,
body.dark .jlpt-account-icon {
  box-shadow:
    inset 1px 1px 0
      rgba(255, 255, 255, 0.08),
    0 7px 14px
      rgba(0, 0, 0, 0.18);
}

.jlpt-account-info-row small {
  color:
    var(
      --jlpt-floating-muted
    ) !important;
}

/* Header phải cho floating dropdown hiển thị tự do. */
.topbar,
.level-page-header,
.level-new-header,
.n1-page-header,
.n1-test-header,
.jlpt-simple-header {
  overflow: visible !important;
}

.topbar,
.level-page-header,
.level-new-header,
.n1-page-header,
.n1-test-header {
  position: relative;
  z-index: 1300;
}

/* Header actions được tự tạo trên page N1–N5. */
.jlpt-shared-header-actions,
.level-page-header
  .level-header-actions {
  min-width: max-content;

  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;

  margin-left: auto;
}

.jlpt-shared-header-actions
  .level-header-icon,
.jlpt-simple-header
  .level-header-icon {
  width: 44px;
  height: 44px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0;

  border: 1px solid #d8e1ee;
  border-radius: 14px;

  background:
    linear-gradient(
      145deg,
      #ffffff,
      #e8eef7
    );

  color: #33435e;

  box-shadow:
    0 8px 17px
      rgba(49, 65, 95, 0.12),
    inset 1px 1px 0
      rgba(255, 255, 255, 0.92);

  cursor: pointer;
}

.jlpt-shared-header-actions
  .level-header-icon svg,
.jlpt-simple-header
  .level-header-icon svg {
  width: 22px;
  height: 22px;

  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html.dark
  .jlpt-shared-header-actions
  .level-header-icon,
body.dark
  .jlpt-shared-header-actions
  .level-header-icon,
html.dark
  .jlpt-simple-header
  .level-header-icon,
body.dark
  .jlpt-simple-header
  .level-header-icon {
  border-color: #626b77;

  background:
    linear-gradient(
      145deg,
      #555c66,
      #40464e
    );

  color: #f4f6f8;

  box-shadow:
    0 9px 18px
      rgba(0, 0, 0, 0.20),
    inset 1px 1px 0
      rgba(255, 255, 255, 0.08);
}

/* =========================================================
   PROFILE HEADER
   ========================================================= */

.jlpt-simple-header {
  position: sticky;
  top: 0;
  z-index: 1400;

  min-height: 82px !important;

  display: grid !important;
  grid-template-columns:
    minmax(170px, 1fr)
    auto
    minmax(170px, 1fr) !important;

  align-items: center;

  padding:
    12px
    clamp(16px, 4vw, 58px) !important;

  border-bottom:
    1px solid #dce4ef !important;

  background:
    rgba(255, 255, 255, 0.94) !important;

  box-shadow:
    0 10px 28px
      rgba(40, 57, 88, 0.08);

  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

html.dark .jlpt-simple-header,
body.dark .jlpt-simple-header {
  border-color: #5f6874 !important;

  background:
    rgba(63, 68, 76, 0.95) !important;

  box-shadow:
    0 11px 28px
      rgba(0, 0, 0, 0.22);
}

.jlpt-simple-header-title {
  grid-column: 2;

  margin: 0;

  color: #1d2940;

  font-size:
    clamp(18px, 2.2vw, 24px);

  font-weight: 850;
  text-align: center;
  white-space: nowrap;
}

html.dark
  .jlpt-simple-header-title,
body.dark
  .jlpt-simple-header-title {
  color: #f4f6f8;
}

.jlpt-header-back {
  grid-column: 1;
  justify-self: start;

  min-height: 46px;

  display: inline-flex;
  align-items: center;
  gap: 9px;

  padding: 0 15px;

  border: 1px solid #d8e1ee;
  border-radius: 14px;

  background:
    linear-gradient(
      145deg,
      #ffffff,
      #e8eef7
    );

  color: #31507f;

  box-shadow:
    0 8px 17px
      rgba(49, 65, 95, 0.11),
    inset 1px 1px 0
      rgba(255, 255, 255, 0.92);

  font-family: inherit;
  font-size: 13px;
  font-weight: 800;

  cursor: pointer;

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.jlpt-header-back:hover {
  transform: translateX(-3px);

  box-shadow:
    0 12px 22px
      rgba(49, 65, 95, 0.16),
    inset 1px 1px 0
      rgba(255, 255, 255, 0.92);
}

.jlpt-header-back svg {
  width: 20px;
  height: 20px;

  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html.dark .jlpt-header-back,
body.dark .jlpt-header-back {
  border-color: #626b77;

  background:
    linear-gradient(
      145deg,
      #555c66,
      #40464e
    );

  color: #eef4ff;

  box-shadow:
    0 9px 18px
      rgba(0, 0, 0, 0.20),
    inset 1px 1px 0
      rgba(255, 255, 255, 0.08);
}

.jlpt-header-actions {
  grid-column: 3;
  justify-self: end;

  display: flex;
  align-items: center;
  gap: 10px;
}

/* =========================================================
   PROFILE LEVEL 3D SELECT
   ========================================================= */

.jlpt-profile-level-form {
  align-items: stretch;
}

.jlpt-level-select {
  position: relative;
  flex: 1;
  min-width: 0;
}

.jlpt-level-select-trigger {
  width: 100%;
  min-height: 46px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding: 0 14px;

  border: 1px solid #d5deea;
  border-radius: 13px;

  background:
    linear-gradient(
      145deg,
      #ffffff,
      #e9eff7
    );

  color: #1e2b43;

  box-shadow:
    0 9px 18px
      rgba(47, 64, 96, 0.11),
    inset 1px 1px 0
      rgba(255, 255, 255, 0.95),
    inset -1px -1px 0
      rgba(95, 112, 143, 0.10);

  font: 800 14px/1 Poppins, sans-serif;

  cursor: pointer;

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.jlpt-level-select.is-open
  .jlpt-level-select-trigger,
.jlpt-level-select-trigger:hover {
  border-color: #8fb0f3;

  transform: translateY(-2px);

  box-shadow:
    0 14px 25px
      rgba(49, 91, 215, 0.18),
    inset 1px 1px 0
      rgba(255, 255, 255, 0.95),
    inset -1px -1px 0
      rgba(95, 112, 143, 0.10);
}

.jlpt-level-select-trigger svg {
  width: 18px;
  height: 18px;

  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;

  transition: transform 0.18s ease;
}

.jlpt-level-select.is-open
  .jlpt-level-select-trigger svg {
  transform: rotate(180deg);
}

.jlpt-level-select-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 2200;

  width: 100%;
  padding: 8px;

  border:
    1px solid
    var(--jlpt-floating-border);

  border-radius: 16px;

  background:
    var(--jlpt-floating-background);

  box-shadow:
    var(--jlpt-floating-shadow);

  opacity: 0;

  transform:
    perspective(800px)
    rotateX(-8deg)
    translateY(-7px)
    scale(0.98);

  transform-origin: top center;

  transition:
    opacity 0.14s ease,
    transform 0.18s ease;
}

.jlpt-level-select-menu[hidden] {
  display: none !important;
}

.jlpt-level-select-menu.is-visible {
  opacity: 1;

  transform:
    perspective(800px)
    rotateX(0)
    translateY(0)
    scale(1);
}

.jlpt-level-option {
  width: 100%;
  min-height: 42px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 12px;

  border: 0;
  border-radius: 11px;

  background: transparent;

  color:
    var(--jlpt-floating-text);

  font: 800 13px/1 Poppins, sans-serif;
  text-align: left;

  cursor: pointer;
}

.jlpt-level-option:hover,
.jlpt-level-option.is-selected {
  background:
    var(--jlpt-floating-surface);

  box-shadow:
    inset 1px 1px 0
      rgba(255, 255, 255, 0.65),
    0 6px 13px
      rgba(45, 61, 91, 0.08);
}

.jlpt-level-option.is-selected::after {
  color: #4775e7;
  content: "✓";
}

html.dark
  .jlpt-level-select-trigger,
body.dark
  .jlpt-level-select-trigger {
  border-color: #626b77;

  background:
    linear-gradient(
      145deg,
      #565d67,
      #41474f
    );

  color: #ffffff;

  box-shadow:
    0 10px 20px
      rgba(0, 0, 0, 0.21),
    inset 1px 1px 0
      rgba(255, 255, 255, 0.09),
    inset -1px -1px 0
      rgba(0, 0, 0, 0.16);
}

/* =========================================================
   SIDEBAR: HIDE SCROLLBAR, KEEP WHEEL/TOUCH SCROLL
   ========================================================= */

.home-page .sidebar,
.home-page .sidebar-menu {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.home-page .sidebar::-webkit-scrollbar,
.home-page .sidebar-menu::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.home-page .sidebar-menu {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 760px) {
  .jlpt-account-dropdown,
  .jlpt-notification-dropdown {
    width: min(
      360px,
      calc(100vw - 20px)
    ) !important;
  }

  .jlpt-simple-header {
    grid-template-columns:
      auto
      minmax(0, 1fr)
      auto !important;

    min-height: 76px !important;

    padding: 10px 12px !important;
  }

  .jlpt-simple-header-title {
    overflow: hidden;

    font-size: 17px;
    text-overflow: ellipsis;
  }

  .jlpt-header-back {
    width: 44px;
    min-height: 44px;

    justify-content: center;

    padding: 0;
  }

  .jlpt-header-back span {
    display: none;
  }

  .jlpt-header-actions {
    gap: 7px;
  }

  .jlpt-simple-header
    .level-header-icon,
  .jlpt-simple-header
    .jlpt-account-trigger,
  .jlpt-simple-header
    .jlpt-account-avatar {
    width: 40px;
    height: 40px;
  }

  .jlpt-profile-level-form {
    display: grid;
    grid-template-columns: 1fr auto;
  }
}


/* Small shared header icon details */
.jlpt-account-dropdown {
  right: auto !important;
  bottom: auto !important;
}

.level-theme-sun {
  display: none;
}

html.dark .level-theme-moon,
body.dark .level-theme-moon {
  display: none;
}

html.dark .level-theme-sun,
body.dark .level-theme-sun {
  display: block;
}

.level-notification-button,
.n1-notification-button,
.n1-header-icon-button[data-notification-toggle] {
  position: relative;
}

.level-notification-dot,
.n1-notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;

  width: 7px;
  height: 7px;

  border: 2px solid #ffffff;
  border-radius: 50%;

  background: #ef4444;
}

html.dark .level-notification-dot,
body.dark .level-notification-dot,
html.dark .n1-notification-dot,
body.dark .n1-notification-dot {
  border-color: #4b525c;
}


/* =========================================================
   FIX: NOTIFICATION DOT IS HIDDEN UNTIL UNREAD EXISTS
   ========================================================= */

[data-notification-toggle]
  .level-notification-dot,
[data-notification-toggle]
  .n1-notification-dot,
[data-notification-toggle]
  .notification-dot {
  display: none !important;
}

[data-notification-toggle].has-unread
  .level-notification-dot,
[data-notification-toggle].has-unread
  .n1-notification-dot,
[data-notification-toggle].has-unread
  .notification-dot {
  display: block !important;

  background: #ef4444 !important;

  box-shadow:
    0 0 0 2px
      rgba(239, 68, 68, 0.13),
    0 3px 8px
      rgba(239, 68, 68, 0.38);
}

/* =========================================================
   FIX: PROFILE LEVEL OPTIONS
   Light = white/black, Dark = black/white
   ========================================================= */

.jlpt-profile-level-form
  .jlpt-level-select-trigger {
  border: 1px solid #d5deea;

  background:
    linear-gradient(
      145deg,
      #ffffff,
      #edf2f8
    );

  color: #172033;

  box-shadow:
    0 10px 22px
      rgba(47, 64, 96, 0.12),
    inset 1px 1px 0
      rgba(255, 255, 255, 0.96),
    inset -1px -1px 0
      rgba(95, 112, 143, 0.10);
}

.jlpt-profile-level-form
  .jlpt-level-select-menu {
  border-color: #d7e0eb;

  background:
    linear-gradient(
      145deg,
      #ffffff,
      #f1f5fa
    );
}

.jlpt-profile-level-form
  .jlpt-level-option {
  border: 1px solid
    rgba(216, 225, 237, 0.75);

  background: #ffffff;

  color: #172033;

  box-shadow:
    inset 1px 1px 0
      rgba(255, 255, 255, 0.95),
    0 5px 12px
      rgba(45, 61, 91, 0.06);
}

.jlpt-profile-level-form
  .jlpt-level-option:hover {
  border-color: #c8d4e4;
  background: #f5f7fb;
}

.jlpt-profile-level-form
  .jlpt-level-option.is-selected {
  border-color: #bfcde1;
  background: #ffffff;

  box-shadow:
    inset 0 0 0 2px
      rgba(71, 117, 231, 0.14),
    0 7px 16px
      rgba(45, 61, 91, 0.09);
}

html.dark
  .jlpt-profile-level-form
  .jlpt-level-select-trigger,
body.dark
  .jlpt-profile-level-form
  .jlpt-level-select-trigger {
  border-color: #626b77;

  background:
    linear-gradient(
      145deg,
      #292e35,
      #171a1f
    );

  color: #ffffff;

  box-shadow:
    0 11px 24px
      rgba(0, 0, 0, 0.26),
    inset 1px 1px 0
      rgba(255, 255, 255, 0.07);
}

html.dark
  .jlpt-profile-level-form
  .jlpt-level-select-menu,
body.dark
  .jlpt-profile-level-form
  .jlpt-level-select-menu {
  border-color: #555e69;

  background:
    linear-gradient(
      145deg,
      #24282e,
      #15181c
    );
}

html.dark
  .jlpt-profile-level-form
  .jlpt-level-option,
body.dark
  .jlpt-profile-level-form
  .jlpt-level-option {
  border-color: #3d444e;
  background: #171a1f;
  color: #ffffff;

  box-shadow:
    inset 1px 1px 0
      rgba(255, 255, 255, 0.04),
    0 6px 14px
      rgba(0, 0, 0, 0.20);
}

html.dark
  .jlpt-profile-level-form
  .jlpt-level-option:hover,
body.dark
  .jlpt-profile-level-form
  .jlpt-level-option:hover {
  border-color: #626c79;
  background: #262b32;
}

html.dark
  .jlpt-profile-level-form
  .jlpt-level-option.is-selected,
body.dark
  .jlpt-profile-level-form
  .jlpt-level-option.is-selected {
  border-color: #677488;
  background: #171a1f;
}

/* =========================================================
   SHARED 3D BACK BUTTON FOR ALL PAGES
   ========================================================= */

.jlpt-header-back,
.level-header-back,
.n1-header-back {
  width: auto !important;
  min-width: 0 !important;
  min-height: 46px !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 9px !important;

  padding: 0 15px !important;

  border: 1px solid #d8e1ee !important;
  border-radius: 14px !important;

  background:
    linear-gradient(
      145deg,
      #ffffff,
      #e8eef7
    ) !important;

  color: #31507f !important;

  box-shadow:
    0 8px 17px
      rgba(49, 65, 95, 0.11),
    inset 1px 1px 0
      rgba(255, 255, 255, 0.92),
    inset -1px -1px 0
      rgba(87, 104, 135, 0.08) !important;

  font-family:
    Poppins,
    "Noto Sans JP",
    sans-serif !important;

  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  text-decoration: none !important;

  cursor: pointer;

  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease !important;
}

.jlpt-header-back:hover,
.level-header-back:hover,
.n1-header-back:hover {
  border-color: #b8c8dc !important;

  transform:
    translateX(-3px)
    translateY(-1px) !important;

  box-shadow:
    0 13px 25px
      rgba(49, 65, 95, 0.16),
    inset 1px 1px 0
      rgba(255, 255, 255, 0.94) !important;
}

.jlpt-header-back svg,
.level-header-back svg,
.n1-header-back svg {
  width: 20px !important;
  height: 20px !important;

  flex: 0 0 20px;

  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2.2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

html.dark .jlpt-header-back,
body.dark .jlpt-header-back,
html.dark .level-header-back,
body.dark .level-header-back,
html.dark .n1-header-back,
body.dark .n1-header-back {
  border-color: #626b77 !important;

  background:
    linear-gradient(
      145deg,
      #555c66,
      #40464e
    ) !important;

  color: #eef4ff !important;

  box-shadow:
    0 9px 18px
      rgba(0, 0, 0, 0.20),
    inset 1px 1px 0
      rgba(255, 255, 255, 0.08) !important;
}

@media (max-width: 620px) {
  .jlpt-header-back,
  .level-header-back,
  .n1-header-back {
    width: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
  }

  .jlpt-header-back span,
  .level-header-back span,
  .n1-header-back span {
    display: none !important;
  }
}


/* =========================================================
   FIX 2026-07 — PROFILE LEVEL DROPDOWN DARK CONTRAST
   ========================================================= */

html.dark .jlpt-profile-level-form .jlpt-level-select-trigger,
body.dark .jlpt-profile-level-form .jlpt-level-select-trigger {
  border-color: #747e8b !important;
  background: linear-gradient(145deg, #59616c, #484f58) !important;
  color: #ffffff !important;
  box-shadow:
    0 11px 24px rgba(0, 0, 0, 0.22),
    inset 1px 1px 0 rgba(255, 255, 255, 0.09) !important;
}

html.dark .jlpt-profile-level-form .jlpt-level-select-menu,
body.dark .jlpt-profile-level-form .jlpt-level-select-menu {
  border-color: #7a8491 !important;
  background: linear-gradient(145deg, #626b77, #505862) !important;
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.30),
    inset 1px 1px 0 rgba(255, 255, 255, 0.10) !important;
}

html.dark .jlpt-profile-level-form .jlpt-level-option,
body.dark .jlpt-profile-level-form .jlpt-level-option {
  border-color: #7a8490 !important;
  background: linear-gradient(145deg, #697380, #59626e) !important;
  color: #ffffff !important;
  box-shadow:
    0 7px 15px rgba(0, 0, 0, 0.16),
    inset 1px 1px 0 rgba(255, 255, 255, 0.11) !important;
}

html.dark .jlpt-profile-level-form .jlpt-level-option:hover,
body.dark .jlpt-profile-level-form .jlpt-level-option:hover {
  border-color: #8e99a7 !important;
  background: linear-gradient(145deg, #76818e, #626d79) !important;
}

html.dark .jlpt-profile-level-form .jlpt-level-option.is-selected,
body.dark .jlpt-profile-level-form .jlpt-level-option.is-selected {
  border-color: #8ab4ff !important;
  background: linear-gradient(145deg, #526b91, #435a7b) !important;
  box-shadow:
    inset 0 0 0 2px rgba(138, 180, 255, 0.18),
    0 8px 18px rgba(0, 0, 0, 0.18) !important;
}

/* Khoảng cách cho lối tắt quản trị; icon kế thừa màu xanh chung. */
.jlpt-admin-action {
  margin-top: 10px;
}
