:root {
  --class-token-ledger-cream: #fffaf0;
  --class-token-ledger-cream-soft: #fffdf7;
  --class-token-ledger-ink: #302111;
  --class-token-ledger-muted: #725f46;
  --class-token-ledger-green: #248a30;
  --class-token-ledger-green-dark: #176824;
  --class-token-ledger-gold: #d8a845;
  --class-token-ledger-line: rgb(195 137 47 / 42%);
}

.student-token-page {
  min-width: 760px;
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  background: #8ee5ff url('/token-assets/page-background.png') center bottom / cover no-repeat fixed;
  color: var(--class-token-ledger-ink);
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
}
.student-token-page [hidden] { display: none !important; }
.student-token-layout {
  display: grid;
  width: min(1420px, calc(100% - 72px));
  height: calc(100vh - 26px);
  min-height: 720px;
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: stretch;
  gap: 22px;
  margin: 14px auto 12px;
}

.student-token-sidebar {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  box-sizing: border-box;
  padding: 28px 20px 18px;
  overflow: hidden auto;
  overscroll-behavior: contain;
  background: url('/token-assets/sidebar-frame.png') center / 100% 100% no-repeat;
  scrollbar-width: thin;
}
.student-token-brand {
  display: flex;
  min-height: 86px;
  align-items: center;
  gap: 8px;
  padding: 0 10px 10px;
}
.student-token-brand > img { width: 64px; height: 70px; object-fit: contain; }
.student-token-brand > span { display: grid; gap: 3px; }
.student-token-brand strong { display: grid; color: #186ed5; font-size: 21px; font-weight: 1000; line-height: .95; }
.student-token-brand strong em { color: #ee6b27; font-style: normal; }
.student-token-brand small { color: #4f3d29; font-size: 10px; font-weight: 900; white-space: nowrap; }
.student-token-fullscreen {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 10px;
  border: 0;
  border-radius: 999px;
  background: #675b49;
  color: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}
.student-token-nav { display: grid; gap: 6px; }
.student-token-nav a,
.student-token-nav > span {
  display: flex;
  min-height: 48px;
  box-sizing: border-box;
  align-items: center;
  gap: 11px;
  background: url('/token-assets/sidebar-button.png') center / 100% 100% no-repeat;
  padding: 0 21px;
  color: #49392a;
  font-size: 13px;
  font-weight: 1000;
  text-decoration: none;
}
.student-token-nav a.is-active {
  background-image: url('/token-assets/sidebar-button-active.png');
  color: #fff;
}
.student-token-nav a:hover,
.student-token-nav a:focus-visible,
.student-token-fullscreen:hover,
.student-token-fullscreen:focus-visible {
  filter: brightness(1.05);
  outline: 3px solid rgb(51 112 207 / 24%);
  outline-offset: -3px;
}
.student-token-nav i { width: 18px; color: #376ca5; text-align: center; }
.student-token-nav a.is-active i { color: #fff; }
.student-token-nav a > span:first-child,
.student-token-nav > span > span:first-child { width: 18px; flex: 0 0 auto; text-align: center; }
.student-token-nav > span.is-disabled { filter: grayscale(.65); opacity: .62; }
.student-token-nav > span.is-disabled small { margin-left: auto; font-size: 8px; }
.student-token-medal { width: 92px; height: 99px; margin: auto auto 4px; object-fit: contain; }

.student-token-main {
  min-width: 0;
  min-height: 0;
  overflow: hidden auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.economy-wallet-token-page { min-width: 0; padding: 0 0 12px; }
.economy-wallet-token-hero {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  min-height: 100%;
  overflow: hidden;
  border: 1px solid #d4b36e;
  border-radius: 27px;
  background: var(--class-token-ledger-cream);
  box-shadow: 0 16px 38px rgb(75 60 25 / 16%);
}
.economy-wallet-token-hero::before,
.economy-wallet-token-hero::after {
  position: absolute;
  z-index: 2;
  width: 82px;
  height: 82px;
  background: url('/token-assets/student-home/leaf-bullet.png') center / contain no-repeat;
  content: "";
  pointer-events: none;
}
.economy-wallet-token-hero::before { top: -27px; left: -24px; transform: rotate(2deg); }
.economy-wallet-token-hero::after { top: -28px; right: -24px; transform: scaleX(-1) rotate(4deg); }
.economy-wallet-token-head,
.economy-wallet-token-summary,
.economy-wallet-token-rank-stack,
.economy-wallet-token-alert { position: relative; z-index: 1; }
.economy-wallet-token-head {
  display: grid;
  min-height: 230px;
  grid-template-columns: minmax(0, 1fr) minmax(330px, .92fr);
  align-items: center;
  gap: 28px;
  box-sizing: border-box;
  padding: 34px 42px 28px;
  border-bottom: 1px solid var(--class-token-ledger-line);
}
.economy-wallet-token-head-copy { display: grid; align-content: center; justify-items: start; }
.economy-wallet-token-head .economy-kicker {
  color: #2f7c38;
  font-size: 14px;
  font-weight: 1000;
  letter-spacing: .07em;
}
.economy-wallet-token-head h1 {
  margin: 8px 0 9px;
  color: #281b12;
  font-family: Georgia, "Noto Serif KR", serif;
  font-size: clamp(44px, 4.5vw, 66px);
  font-weight: 900;
  letter-spacing: -.06em;
  line-height: 1;
}
.economy-wallet-token-head p { margin: 0; color: #513b29; font-size: 15px; font-weight: 900; }
.economy-wallet-token-head-actions {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto;
  align-items: center;
  gap: 16px;
}
.economy-wallet-token-head-actions > img {
  display: block;
  width: min(100%, 330px);
  max-height: 165px;
  justify-self: center;
  object-fit: contain;
  filter: drop-shadow(0 7px 7px rgb(91 59 15 / 16%));
}
.economy-wallet-token-history-button {
  display: inline-flex;
  min-width: 140px;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 1px solid #c89239;
  border-radius: 12px;
  background: #fff8e5;
  padding: 0 20px;
  color: #352511;
  box-shadow: 0 3px 0 rgb(166 108 25 / 16%), inset 0 1px 0 #fff;
  font-size: 14px;
  font-weight: 1000;
  text-decoration: none;
}
.economy-wallet-token-history-button:hover,
.economy-wallet-token-history-button:focus-visible { background: #fff3cf; outline: 3px solid rgb(31 126 55 / 35%); outline-offset: 3px; }
.economy-wallet-token-alert {
  display: grid;
  min-height: 44px;
  place-items: center;
  box-sizing: border-box;
  margin: 0;
  border-bottom: 1px solid var(--class-token-ledger-line);
  background: #fff4d9;
  padding: 10px 14px;
  color: #7a4b16;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}
.economy-wallet-token-alert[data-tone="good"] { color: #2b7136; }
.economy-wallet-token-alert[data-tone="warn"] { background: #fff0dd; color: #8a3f16; }

.economy-wallet-token-summary {
  display: grid;
  min-height: 205px;
  grid-template-columns: minmax(140px, 1fr) minmax(225px, 1.48fr) minmax(140px, .95fr) minmax(225px, 1.45fr);
  box-sizing: border-box;
  padding: 26px 8px;
  border-bottom: 1px solid var(--class-token-ledger-line);
}
.economy-wallet-token-summary > article {
  display: grid;
  min-width: 0;
  min-height: 145px;
  align-content: center;
  box-sizing: border-box;
  padding: 4px clamp(16px, 1.7vw, 26px);
  border-right: 1px solid var(--class-token-ledger-line);
}
.economy-wallet-token-summary > article:last-child { border-right: 0; }
.economy-wallet-token-summary h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  color: #19712b;
  font-size: clamp(15px, 1.4vw, 20px);
  font-weight: 1000;
  line-height: 1.25;
  white-space: nowrap;
}
.economy-wallet-token-summary h2 > img { width: 38px; height: 38px; object-fit: contain; }
.economy-wallet-token-summary h2 > i { display: inline-grid; width: 30px; place-items: center; color: #d79b19; font-size: 25px; }
.economy-wallet-token-balance-card,
.economy-wallet-token-total-card { justify-items: center; text-align: center; }
.economy-wallet-token-balance-card > strong {
  margin: -1px 0 2px;
  color: var(--class-token-ledger-green);
  font-size: clamp(42px, 4vw, 58px);
  font-weight: 1000;
  line-height: 1;
}
.economy-wallet-token-balance-card > span { color: #3b2d1d; font-size: 14px; font-weight: 900; }
.economy-wallet-token-balance-card > span b { font: inherit; }
.economy-wallet-token-goal { justify-items: stretch; gap: 10px; text-align: left; }
.economy-wallet-token-goal h2 { margin-bottom: 8px; }
.economy-wallet-token-goal p {
  display: grid;
  min-height: 58px;
  place-items: center;
  margin: 0;
  border-radius: 12px;
  background: #f0ede5;
  color: #746752;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}
.economy-wallet-token-goal:not(.is-empty) p { min-height: 0; background: transparent; color: #433522; }
.economy-wallet-token-goal > em { color: var(--class-token-ledger-muted); font-size: 12px; font-style: normal; font-weight: 800; line-height: 1.4; text-align: center; }
.economy-wallet-token-goal-progress { position: relative; display: block; height: 36px; overflow: hidden; border: 1px solid rgba(123, 104, 75, .12); border-radius: 12px; background: #e7e3da; }
.economy-wallet-token-goal-progress > span { position: absolute; inset: 0 auto 0 0; display: block; min-width: 0; background: #4c9f2c; }
.economy-wallet-token-goal-progress > strong { position: relative; z-index: 1; display: grid; place-items: center; height: 100%; color: #fff; font-size: 14px; font-weight: 1000; text-shadow: 0 1px 1px rgba(31, 78, 18, .45); }
.economy-wallet-token-total-card > strong { margin: 4px 0 10px; color: #2e2114; font-size: clamp(35px, 3.25vw, 50px); font-weight: 1000; line-height: 1; }
.economy-wallet-token-total-card > em { color: var(--class-token-ledger-muted); font-size: 10px; font-style: normal; font-weight: 800; text-align: center; }
.economy-wallet-token-weekly-card { gap: 10px; }
.economy-wallet-token-weekly-card h2 { color: #5e2ca8; }
.economy-wallet-token-weekly-card h2 > i { color: #7342ca; }
.economy-wallet-token-weekly-card > p { margin: 0; color: var(--class-token-ledger-muted); font-size: 11px; font-weight: 800; text-align: center; }
.student-wallet-legacy-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.economy-wallet-token-winner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.economy-wallet-token-winner > div { display: flex; min-width: 0; align-items: center; gap: 10px; }
.economy-wallet-token-winner > div > span { display: flex; min-width: 0; align-items: baseline; gap: 7px; }
.economy-wallet-token-winner strong { overflow: hidden; color: #342414; font-size: clamp(15px, 1.3vw, 19px); font-weight: 1000; text-overflow: ellipsis; white-space: nowrap; }
.economy-wallet-token-winner em { flex: 0 0 auto; color: #4e3b26; font-size: 11px; font-style: normal; font-weight: 850; white-space: nowrap; }

.economy-wallet-token-rank-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  box-sizing: border-box;
  padding: 28px 24px 30px;
}
.economy-wallet-token-rank-card { min-width: 0; padding: 0 clamp(20px, 2.4vw, 38px); }
.economy-wallet-token-rank-card + .economy-wallet-token-rank-card { border-left: 1px dashed rgb(182 127 45 / 38%); }
.economy-wallet-token-rank-card h2 {
  display: grid;
  min-height: 58px;
  place-items: center;
  margin: 0 0 13px;
  background: url('/token-assets/ribbon-green.png') center / 100% 100% no-repeat;
  color: #fffbe4;
  font-family: Georgia, "Noto Serif KR", serif;
  font-size: clamp(18px, 1.8vw, 24px);
  font-weight: 900;
  letter-spacing: .02em;
  text-shadow: 0 2px 2px rgb(35 75 10 / 68%);
}
.economy-wallet-token-rank-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.economy-wallet-token-rank-row {
  display: grid;
  min-height: 58px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  box-sizing: border-box;
  border: 1px solid #e4be78;
  border-radius: 13px;
  background: var(--class-token-ledger-cream-soft);
  padding: 7px 12px 7px 8px;
}
.economy-wallet-token-rank-main { display: flex; min-width: 0; align-items: center; gap: 9px; }
.economy-wallet-token-rank-badge { position: relative; display: grid; width: 43px; height: 43px; flex: 0 0 auto; place-items: center; color: #4b321a; font-size: 17px; font-weight: 1000; }
.economy-wallet-token-rank-badge > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.economy-wallet-token-rank-badge > b { position: relative; z-index: 1; }
.economy-wallet-token-rank-badge.is-silver > img { filter: grayscale(.85) brightness(1.14); }
.economy-wallet-token-rank-badge.is-bronze > img { filter: sepia(.78) saturate(.82) brightness(.9); }
.economy-wallet-token-rank-badge.is-basic > img { filter: grayscale(1) brightness(1.17); opacity: .72; }
.economy-wallet-token-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 2px solid #e0bd70;
  border-radius: 50%;
  background: #fff4c4;
  color: #a87b2c;
  font-size: 20px;
}
.economy-wallet-token-avatar img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.economy-wallet-token-avatar.has-image i { position: absolute; }
.economy-wallet-token-rank-name { display: flex; min-width: 0; align-items: baseline; gap: 6px; overflow: hidden; color: #332414; font-size: 16px; font-weight: 1000; text-overflow: ellipsis; white-space: nowrap; }
.economy-wallet-token-rank-name em { color: #6e5940; font-size: 10px; font-style: normal; font-weight: 850; }
.economy-wallet-token-rank-score { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; color: #322315; }
.economy-wallet-token-rank-score > strong { font-size: clamp(16px, 1.5vw, 21px); font-weight: 1000; }
.economy-wallet-token-rank-score > img { width: 20px; height: 20px; object-fit: contain; }
.economy-wallet-token-winner .economy-wallet-token-avatar { width: 40px; height: 40px; }
.economy-wallet-token-empty { display: grid; min-height: 72px; place-items: center; color: #7a6951; font-size: 12px; font-weight: 850; text-align: center; }

.economy-wallet-token-transaction-modal {
  position: fixed;
  inset: 0;
  z-index: 14000;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  box-sizing: border-box;
  place-items: center;
  margin: 0;
  border: 0;
  background: rgb(38 28 18 / 64%);
  padding: 20px;
}
.economy-wallet-token-transaction-modal[open] { display: grid; }
.economy-wallet-token-transaction-modal::backdrop { background: transparent; }
.economy-wallet-token-transaction-card {
  position: relative;
  width: min(720px, calc(100vw - 32px));
  max-height: min(780px, calc(100vh - 40px));
  box-sizing: border-box;
  overflow: hidden;
  border: 2px solid #b78639;
  border-radius: 22px;
  background: #fffaf0;
  padding: 28px 28px 22px;
  box-shadow: 0 24px 70px rgb(25 17 9 / 45%);
}
.economy-wallet-token-transaction-card > header { padding: 0 38px 18px 0; border-bottom: 1px solid #dfc28e; }
.economy-wallet-token-transaction-card > header span { color: #2e7c3b; font-size: 11px; font-weight: 1000; letter-spacing: .1em; }
.economy-wallet-token-transaction-card > header h2 { margin: 4px 0; color: #332316; font-size: 28px; }
.economy-wallet-token-transaction-card > header p { margin: 0; color: #7a664d; font-size: 12px; font-weight: 800; }
.economy-wallet-token-transaction-close {
  position: absolute;
  top: 22px;
  right: 22px;
  display: grid;
  width: 44px;
  min-height: 44px;
  place-items: center;
  border: 1px solid #cda664;
  border-radius: 50%;
  background: #fff5df;
  color: #60431f;
  cursor: pointer;
}
.economy-wallet-token-transaction-list { max-height: min(500px, calc(100vh - 260px)); overflow: hidden auto; }
.economy-wallet-token-transaction-row {
  display: grid;
  min-height: 66px;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid #ead9b8;
  padding: 8px 4px;
}
.economy-wallet-token-transaction-type { display: grid; min-height: 30px; place-items: center; border-radius: 999px; background: #f0eadc; color: #635138; font-size: 11px; font-weight: 1000; }
.economy-wallet-token-transaction-row > div { display: grid; gap: 3px; min-width: 0; }
.economy-wallet-token-transaction-row > div strong { overflow: hidden; color: #3d2c1c; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.economy-wallet-token-transaction-row > div em { color: #826f58; font-size: 11px; font-style: normal; }
.economy-wallet-token-transaction-row > b { font-size: 15px; white-space: nowrap; }
.economy-wallet-token-transaction-row > b.is-positive { color: #237634; }
.economy-wallet-token-transaction-row > b.is-negative { color: #b34235; }
.economy-wallet-token-transaction-empty { display: grid; min-height: 180px; place-items: center; color: #7a6951; font-weight: 850; }
.economy-wallet-token-transaction-error { min-height: 18px; margin: 9px 0 0; color: #a24632; font-size: 12px; font-weight: 800; }
.economy-wallet-token-transaction-actions { display: flex; min-height: 44px; align-items: center; justify-content: flex-end; gap: 10px; }
.economy-wallet-token-transaction-actions button { min-height: 40px; border: 1px solid #357a42; border-radius: 10px; background: #2f7d3c; padding: 0 18px; color: #fff; font: inherit; font-weight: 900; cursor: pointer; }
.economy-wallet-token-transaction-actions span { color: #74624c; font-size: 12px; font-weight: 800; }

.student-wallet-teacher-mode {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 13050;
  min-height: 44px;
  border: 1px solid rgb(148 163 184 / 35%);
  border-radius: 999px;
  background: rgb(15 23 42 / 92%);
  padding: 10px 14px;
  color: #f8fafc;
  box-shadow: 0 16px 36px rgb(15 23 42 / 35%);
  backdrop-filter: blur(12px);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.student-wallet-teacher-mode:hover,
.student-wallet-teacher-mode:focus-visible { border-color: #60a5fa; background: #183455; outline: 3px solid rgb(96 165 250 / 24%); }

@media (max-width: 1180px) {
  .student-token-layout { width: calc(100% - 24px); grid-template-columns: 214px minmax(0, 1fr); gap: 14px; }
  .student-token-sidebar { padding-inline: 15px; }
  .student-token-brand { padding-inline: 7px; }
  .student-token-brand > img { width: 52px; height: 58px; }
  .student-token-brand strong { font-size: 16px; }
  .student-token-nav a,
  .student-token-nav > span { padding-inline: 17px; font-size: 11px; }
  .economy-wallet-token-head { grid-template-columns: minmax(0, 1fr) minmax(260px, .9fr); padding-inline: 30px; }
  .economy-wallet-token-head-actions { grid-template-columns: minmax(160px, 1fr) auto; }
  .economy-wallet-token-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 8px; }
  .economy-wallet-token-summary > article { min-height: 165px; padding: 18px 30px; }
  .economy-wallet-token-summary > article:nth-child(2) { border-right: 0; }
  .economy-wallet-token-summary > article:nth-child(-n + 2) { border-bottom: 1px solid var(--class-token-ledger-line); }
}

@media (max-width: 900px) {
  .student-token-layout { grid-template-columns: 200px minmax(0, 1fr); gap: 10px; }
  .student-token-sidebar { padding-inline: 12px; }
  .student-token-nav { gap: 4px; }
  .student-token-nav a,
  .student-token-nav > span { min-height: 46px; padding-inline: 14px; }
  .economy-wallet-token-head { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 28px 22px 22px; }
  .economy-wallet-token-head-actions { grid-template-columns: minmax(0, 1fr) auto; }
  .economy-wallet-token-head-actions > img { width: min(100%, 260px); max-height: 130px; }
  .economy-wallet-token-rank-stack { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .economy-wallet-token-rank-card + .economy-wallet-token-rank-card { padding-top: 26px; border-top: 1px dashed rgb(182 127 45 / 38%); border-left: 0; }
  .economy-wallet-token-summary > article { padding-inline: 18px; }
  .economy-wallet-token-summary h2 { white-space: normal; }
}
