@charset "UTF-8";

:root {
  --ink: #17231f;
  --muted: #425149;
  --paper: #f2efe5;
  --card: #fffdf7;
  --line: #d9d8cb;
  --forest: #13352e;
  --forest-2: #1c4b40;
  --orange: #e9652d;
  --orange-soft: #fff0e5;
  --lime: #bad66f;
  --gain-blue: #1769aa;
  --danger: #bb3f32;
  --shadow: 0 18px 48px rgba(28, 46, 39, .12);
  --radius: 18px;
  --font-ui: Bahnschrift, "Segoe UI", Tahoma, sans-serif;
  --font-display: Bahnschrift, "Segoe UI Semibold", Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html { width: 100%; background: var(--paper); overflow-x: hidden; }
body { width: 100%; margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--ink); font-family: var(--font-ui); font-synthesis: none; background: var(--paper); overflow-x: hidden; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
body.modal-open { overflow: hidden; }
.noise { position: fixed; inset: 0; pointer-events: none; opacity: .22; z-index: 99; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E"); }
.build-version-watermark { position: fixed; right: max(6px, env(safe-area-inset-right)); bottom: max(4px, env(safe-area-inset-bottom)); z-index: 20; pointer-events: none; color: rgba(38,57,48,.42); font-size: 8px; font-weight: 700; letter-spacing: .04em; line-height: 1; }

.login-view { position: relative; isolation: isolate; min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(340px, 1.1fr) minmax(360px, .9fr); background: #75cce4 url("/assets/ui/login-bg.jpg") center bottom / cover no-repeat; overflow: hidden; }
.login-view::before { content: ""; position: absolute; z-index: 0; inset: 0; background: linear-gradient(90deg, rgba(8,38,33,.1) 0%, rgba(8,38,33,.18) 48%, rgba(8,31,27,.72) 100%); }
.login-art { --radar-size: min(38vw, 390px); position: relative; z-index: 1; min-height: 620px; }
.login-art::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, rgba(13,53,43,.24), transparent 48%); }
.radar { position: absolute; width: var(--radar-size); aspect-ratio: 1; border: 1px solid rgba(214,239,150,.48); border-radius: 50%; left: 44%; top: 47%; translate: -50% -50%; background: rgba(8,38,33,.2); box-shadow: 0 20px 60px rgba(8,32,27,.18); backdrop-filter: blur(1px); }
.radar i { position: absolute; inset: 16%; border: 1px solid rgba(186,214,111,.25); border-radius: inherit; }
.radar i:nth-child(2) { inset: 32%; }.radar i:nth-child(3) { inset: 48%; }
.radar::before, .radar::after { content: ""; position: absolute; background: rgba(186,214,111,.25); }
.radar::before { width: 1px; height: 100%; left: 50%; }.radar::after { height: 1px; width: 100%; top: 50%; }
.radar b { position: absolute; inset: 50% 50% 0 50%; transform-origin: top left; background: conic-gradient(from 266deg, transparent, rgba(186,214,111,.4)); animation: sweep 5s linear infinite; }
.radar-logo { position: absolute; z-index: 3; width: 70px; height: 70px; left: 50%; top: 50%; translate: -50% -50%; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 10px 18px rgba(0,0,0,.45)); }
.material-orbit { position: absolute; z-index: 2; width: var(--radar-size); aspect-ratio: 1; left: 44%; top: 47%; translate: -50% -50%; }
.material-orbit img { position: absolute; width: 42px; height: 42px; object-fit: contain; translate: -50% -50%; image-rendering: pixelated; filter: drop-shadow(0 6px 9px rgba(0,0,0,.42)); animation: float 4s ease-in-out infinite; }
.material-orbit img:nth-child(1) { left: 50%; top: 5%; }
.material-orbit img:nth-child(2) { left: 84%; top: 23%; animation-delay: -.65s; }
.material-orbit img:nth-child(3) { left: 94%; top: 56%; animation-delay: -1.3s; }
.material-orbit img:nth-child(4) { left: 75%; top: 87%; animation-delay: -1.95s; }
.material-orbit img:nth-child(5) { left: 27%; top: 88%; animation-delay: -2.6s; }
.material-orbit img:nth-child(6) { left: 5%; top: 51%; animation-delay: -3.25s; }
.login-card { position: relative; z-index: 2; width: min(410px, calc(100% - 34px)); align-self: center; justify-self: center; padding: 27px; overflow: hidden; border: 1px solid rgba(216,239,207,.22); border-radius: 22px; color: #fff; background: radial-gradient(circle at 100% 0, rgba(186,214,111,.11), transparent 34%), linear-gradient(145deg, rgba(9,46,39,.92), rgba(7,31,27,.88)); box-shadow: 0 30px 80px rgba(4,25,21,.38), inset 0 1px 0 rgba(255,255,255,.08); backdrop-filter: blur(16px) saturate(1.15); animation: login-card-in .55s cubic-bezier(.2,.8,.2,1) both; }
.login-card::before { content: ""; position: absolute; inset: 0 20% auto; height: 2px; background: linear-gradient(90deg, transparent, var(--lime), transparent); opacity: .9; }
.auth-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 23px; }
.auth-logo { width: 47px; height: 47px; flex: 0 0 47px; display: grid; place-items: center; padding: 5px; border: 1px solid rgba(186,214,111,.32); border-radius: 14px 7px 14px 7px; background: linear-gradient(145deg, rgba(186,214,111,.22), rgba(233,101,45,.2)); box-shadow: 0 9px 24px rgba(0,0,0,.2); transform: rotate(-3deg); }
.auth-logo img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 4px 5px rgba(0,0,0,.3)); }
.auth-kicker { display: block; margin-bottom: 4px; color: var(--lime); font-size: 11px; font-weight: 900; letter-spacing: .16em; }
.auth-heading h2 { margin: 0; color: #fff; font-family: var(--font-display); font-size: 27px; font-weight: 800; line-height: 1.15; letter-spacing: -.025em; }
.eyebrow { display: block; letter-spacing: .18em; font-size: 11px; font-weight: 800; color: var(--orange); }
.login-card h1 { margin: 20px 0 22px; font-family: var(--font-display); font-weight: 750; font-size: clamp(44px, 5vw, 72px); line-height: 1.02; letter-spacing: -.045em; }
.login-card h1 em { color: var(--lime); font-style: normal; }
.login-card > p { max-width: 520px; color: #bdd0c8; line-height: 1.65; }
.auth-form { display: grid; gap: 15px; max-width: 390px; margin-top: 0; }
.auth-form label { position: relative; color: #d4e1dc; text-align: left; font-size: 13px; font-weight: 850; letter-spacing: .025em; }
.auth-form input { height: 50px; margin-top: 8px; padding: 0 14px 0 45px; border-color: rgba(218,235,228,.2); border-radius: 12px; color: #fff; background-color: rgba(255,255,255,.075); background-position: 15px center; background-repeat: no-repeat; background-size: 18px 18px; box-shadow: inset 0 1px 0 rgba(255,255,255,.035); font-size: 15px; font-weight: 650; letter-spacing: 0; transition: border-color .2s, background-color .2s, box-shadow .2s; }
.auth-email input { background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6.5h16v11H4z' stroke='%23bad66f' stroke-width='1.7'/%3E%3Cpath d='m5 7.5 7 5 7-5' stroke='%23bad66f' stroke-width='1.7'/%3E%3C/svg%3E"); }
.auth-password input { background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='5' y='10' width='14' height='10' rx='2' stroke='%23bad66f' stroke-width='1.7'/%3E%3Cpath d='M8 10V7a4 4 0 0 1 8 0v3' stroke='%23bad66f' stroke-width='1.7'/%3E%3C/svg%3E"); }
.auth-form input::placeholder { color: #8ba39a; opacity: 1; font-size: 14px; font-weight: 600; }
.auth-form input:hover { border-color: rgba(218,235,228,.34); background-color: rgba(255,255,255,.1); }
.auth-form input:focus { border-color: var(--lime); background-color: rgba(255,255,255,.11); box-shadow: 0 0 0 3px rgba(186,214,111,.12), 0 9px 24px rgba(0,0,0,.12); }
.auth-form .button { width: 100%; min-height: 50px; margin-top: 2px; border-radius: 12px; font-size: 16px; letter-spacing: .01em; background: linear-gradient(135deg, #e9652d, #f17c43); box-shadow: 0 12px 26px rgba(233,101,45,.3), inset 0 1px 0 rgba(255,255,255,.2); }
.auth-form .button:hover { box-shadow: 0 15px 30px rgba(233,101,45,.38), inset 0 1px 0 rgba(255,255,255,.22); }
.auth-form .button:active { transform: translateY(1px); box-shadow: 0 7px 16px rgba(233,101,45,.25); }
.auth-form .button:disabled { cursor: wait; opacity: .72; transform: none; }
.forgot-password { display: block; margin: 10px 0 0 auto; padding: 4px 1px; border: 0; color: #c9dc8f; background: transparent; font-size: 12px; font-weight: 800; }.forgot-password:hover { color: #e0f4a4; text-decoration: underline; text-underline-offset: 3px; }
.auth-secondary { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 17px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.1); color: #b3c5be; font-size: 14px; }
.auth-switch { margin: 0; padding: 4px 2px; border: 0; color: var(--lime); background: none; font-size: 14px; font-weight: 850; }
.auth-switch:hover { color: #d5ef90; text-decoration: underline; text-underline-offset: 3px; }
.login-hint { position: relative; margin: 13px 0 0; padding-left: 17px; color: #a3b8b0 !important; font-size: 12px; line-height: 1.5 !important; text-align: center; }
.login-hint::before { content: ""; position: absolute; width: 6px; height: 6px; top: .42em; margin-left: -14px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(186,214,111,.09); }

.app-shell { min-height: 100vh; min-height: 100dvh; display: block; background: url("/assets/ui/login-bg.jpg") center bottom / cover fixed no-repeat; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px; color: #e6eee9; background: var(--forest); display: flex; flex-direction: column; z-index: 10; }
.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; padding: 4px; background: var(--orange); transform: rotate(-4deg); border-radius: 10px 4px 10px 4px; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; border-radius: 6px; }
.brand b { display: block; letter-spacing: .08em; }.brand small { color: #86a096; font-size: 9px; letter-spacing: .18em; }
.sidebar nav { margin-top: 54px; display: grid; gap: 8px; }
.nav-item { border: 0; border-radius: 11px; padding: 13px 14px; text-align: left; color: #acc1b9; background: transparent; transition: .2s; }
.nav-item span { display: inline-block; width: 25px; color: var(--lime); }.nav-item:hover, .nav-item.active { background: rgba(255,255,255,.09); color: #fff; }.nav-item.danger span { color: #ff8d76; }
.side-foot { margin-top: auto; }.server-pulse { display: flex; align-items: center; gap: 10px; padding: 14px; border-top: 1px solid rgba(255,255,255,.1); color: #829b91; font-size: 11px; }.server-pulse i { width: 9px; height: 9px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 5px rgba(186,214,111,.12); }.server-pulse b { color: #dce9e3; }.text-button { border: 0; background: none; color: #9db2aa; padding: 10px 14px; }

main { width: 70%; max-width: 1440px; min-width: 0; min-height: 100vh; min-height: 100dvh; margin: 0 auto; padding: 34px clamp(16px,2vw,30px) 70px; background: radial-gradient(circle at 95% 4%,rgba(233,101,45,.1),transparent 25%),var(--paper); box-shadow: 0 0 55px rgba(19,53,46,.08); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; }.topbar-brand,.topbar-actions { display: flex; align-items: center; gap: 12px; }.topbar h2 { margin: 5px 0 0; font-family: var(--font-display); letter-spacing: -.035em; font-size: 32px; font-weight: 750; }.user-menu-wrap { position: relative; min-width: 0; }.user-chip { min-height: 52px; display: flex; align-items: center; gap: 11px; color: var(--ink); background: rgba(255,255,255,.52); border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px 6px 6px; text-align: left; }.user-chip:hover,.user-chip[aria-expanded="true"] { border-color: #b9bdae; background: rgba(255,255,255,.78); }.user-chip img { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; object-fit: cover; background: #d9dfd5; }.user-chip b,.user-chip small { display: block; }.user-chip b { max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.user-chip small { color: var(--muted); font-size: 10px; }.menu-chevron { color: var(--muted); font-size: 16px; font-style: normal; transition: transform .2s; }.user-chip[aria-expanded="true"] .menu-chevron { transform: rotate(180deg); }.user-menu { position: absolute; z-index: 35; top: calc(100% + 8px); right: 0; width: 275px; padding: 7px; border: 1px solid var(--line); border-radius: 13px; background: var(--card); box-shadow: 0 18px 48px rgba(20,42,34,.2); }.user-menu button { width: 100%; min-height: 54px; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 9px; padding: 8px 10px; color: var(--ink); background: transparent; text-align: left; }.user-menu button:hover { background: #efede4; }.user-menu button > span { width: 29px; height: 29px; flex: 0 0 29px; display: grid; place-items: center; border-radius: 8px; color: var(--forest); background: #e8ecdf; font-size: 11px; }.user-menu b,.user-menu small { display: block; }.user-menu b { font-size: 12px; }.user-menu small { margin-top: 2px; color: var(--muted); font-size: 9px; }.user-menu .menu-danger { color: var(--danger); }.user-menu .menu-danger > span { color: var(--danger); background: #f7dfd8; }
.summary-grid { margin: 28px 0 38px; display: grid; grid-template-columns: repeat(3, minmax(170px, .75fr)) minmax(300px, 1.5fr); gap: 12px; }
.pricing-card { position: relative; min-height: 138px; display: grid; grid-template-columns: 78px minmax(0,1fr) minmax(185px,.52fr); align-items: center; gap: 20px; margin: 28px 0 38px; padding: 22px 26px; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: radial-gradient(circle at 92% 20%, rgba(186,214,111,.22), transparent 28%), linear-gradient(135deg, #fffdf7, #f2f0e6); box-shadow: 0 10px 30px rgba(31,52,44,.07); }.pricing-card::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: linear-gradient(var(--orange), var(--lime)); }.pricing-mark { width: 70px; height: 70px; display: grid; place-items: center; border-radius: 18px 8px 18px 8px; background: #fff0e5; transform: rotate(-3deg); }.pricing-mark img { width: 44px; height: 44px; image-rendering: pixelated; filter: drop-shadow(0 7px 8px rgba(0,0,0,.2)); }.pricing-copy { min-width: 0; }.pricing-copy h3 { margin: 0 0 12px; font-size: 28px; line-height: 1.15; }.pricing-copy h3 small { color: var(--muted); font-size: 12px; font-weight: 750; }.pricing-table { max-width: 590px; overflow: hidden; border: 1px solid #d8d6ca; border-radius: 9px; color: var(--ink); background: rgba(255,255,255,.76); }.pricing-table > div:first-child,.pricing-table > div > div { display: grid; grid-template-columns: 1.4fr .8fr .8fr; }.pricing-table > div:first-child { padding: 8px 11px; color: var(--muted); background: #e9e7de; font-size: 11px; font-weight: 850; }.pricing-table > div:last-child > div { padding: 9px 11px; border-top: 1px solid #dedbd0; font-size: 13px; font-weight: 650; }.pricing-table strong { color: var(--orange); }
.contact-card { min-width: 0; padding: 14px 0 14px 20px; border-left: 1px solid rgba(61,84,67,.15); }.contact-kicker { display: block; color: var(--orange); font-size: 9px; font-weight: 900; letter-spacing: .13em; }.contact-card strong { display: block; margin: 4px 0 11px; color: var(--ink); font-size: 17px; }.contact-links { display: flex; flex-wrap: wrap; gap: 8px; }.contact-link { min-height: 35px; display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: rgba(255,255,255,.68); font-size: 11px; font-weight: 850; text-decoration: none; transition: transform .18s, box-shadow .18s, border-color .18s; }.contact-link:hover { transform: translateY(-2px); border-color: #c5c8bb; box-shadow: 0 7px 16px rgba(31,52,44,.1); }.contact-link img { width: 21px; height: 21px; flex: 0 0 21px; object-fit: contain; }.contact-facebook { color: #2d63b8; }.contact-zalo { color: #087fda; }
.summary-card { min-height: 108px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,253,247,.9); box-shadow: 0 7px 22px rgba(31,52,44,.045); display: flex; align-items: flex-start; gap: 13px; }
.summary-card > div { min-width: 0; flex: 1; }.summary-card span { display: block; color: var(--muted); font-size: 12px; }.summary-card strong { display: inline-block; margin-top: 8px; font-family: var(--font-display); font-weight: 750; font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }.summary-card small { color: var(--muted); margin-left: 5px; }.summary-icon { flex: 0 0 32px; width: 32px; height: 32px; display: grid !important; place-items: center; border-radius: 9px; color: var(--forest) !important; background: #e8ecdf; font-size: 15px !important; font-weight: 900; }.summary-running .summary-icon { color: #56752d !important; background: #e8f0d0; }
.summary-gift { background: #fff0e5; }.summary-gift img { width: 27px; height: 27px; image-rendering: pixelated; }
.material-summary > div > div { display: grid; grid-template-columns: repeat(3, minmax(70px, 1fr)); gap: 7px 10px; margin-top: 10px; }.mini-material { display: flex !important; align-items: center; gap: 5px; min-width: 0; color: var(--ink) !important; font-size: 12px !important; font-weight: 750; font-variant-numeric: tabular-nums; }.mini-material img { width: 25px; height: 25px; flex: 0 0 25px; image-rendering: pixelated; }
.section-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 17px; }.section-head h3 { margin: 0; font-size: 22px; }.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }.section-actions { display: flex; align-items: center; gap: 8px; }.grid-layout-button { min-height: 34px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 9px; padding: 0 9px; color: var(--ink); background: transparent; font-size: 12px; font-weight: 850; }.grid-layout-button:hover { background: #ebe9df; }.grid-layout-button i { width: 13px; height: 13px; display: grid; grid-template-columns: repeat(3,3px); grid-auto-rows: 3px; gap: 2px; }.grid-layout-button i::before { content: ""; width: 3px; height: 3px; border-radius: 1px; background: var(--forest); box-shadow: 5px 0 var(--forest),10px 0 var(--forest),0 5px var(--forest),5px 5px var(--forest),10px 5px var(--forest),0 10px var(--forest),5px 10px var(--forest),10px 10px var(--forest); }.grid-layout-button span { min-width: 11px; font-variant-numeric: tabular-nums; }
.section-head h3 small { color: var(--muted); font-size: 12px; font-weight: 700; }
.button { min-height: 42px; border-radius: 10px; border: 1px solid transparent; padding: 0 17px; font-weight: 800; transition: transform .18s, box-shadow .18s, background .18s; }.button:hover { transform: translateY(-1px); }.button-primary { color: #fff; background: var(--orange); box-shadow: 0 8px 18px rgba(233,101,45,.22); }.button-ghost { background: transparent; border-color: var(--line); color: var(--ink); }.button-subtle { background: #ece9de; color: var(--ink); }
.button-admin { color: #fff; background: var(--forest); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 15px; }
@media (min-width: 761px) { .slot-grid[data-columns="3"] { grid-template-columns: repeat(3,minmax(0,1fr)); }.slot-grid[data-columns="4"] { grid-template-columns: repeat(4,minmax(0,1fr)); }.slot-grid[data-columns="5"] { grid-template-columns: repeat(5,minmax(0,1fr)); }.slot-grid[data-columns="6"] { grid-template-columns: repeat(6,minmax(0,1fr)); } }
.empty-slots { grid-column: 1 / -1; min-height: 150px; display: grid; place-content: center; gap: 7px; padding: 28px; border: 1px dashed #c7c9bc; border-radius: 15px; color: var(--muted); background: rgba(255,253,247,.65); text-align: center; }.empty-slots b { color: var(--ink); font-size: 18px; }.empty-slots span { max-width: 460px; font-size: 13px; line-height: 1.55; }
.slot-card { position: relative; min-width: 0; padding: 19px; border: 1px solid var(--line); border-radius: 15px; background: var(--card); box-shadow: 0 7px 20px rgba(34,49,43,.045); overflow: hidden; }
.slot-card::before { content: ""; position: absolute; height: 4px; inset: 0 100% auto 0; background: var(--orange); transition: .25s; }.slot-card.running::before { right: 0; background: var(--lime); }.slot-card:hover { border-color: #bfc2b4; box-shadow: var(--shadow); }
.slot-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }.slot-number { min-width: 0; display: flex; align-items: center; gap: 8px; }.slot-number b { font-family: var(--font-display); font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }.slot-expiry { max-width: 145px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 5px 7px; border: 1px solid #e2e6d5; border-radius: 999px; color: #56752d; background: #f0f5df; font-size: 9px; font-weight: 800; }.slot-expiry.expired { color: var(--danger); border-color: #efd2ca; background: #f9e8e3; }.slot-state { flex: 0 0 auto; margin-left: auto; display: inline-flex; gap: 6px; align-items: center; border-radius: 999px; background: #eee9df; color: #796e61; font-size: 10px; font-weight: 800; padding: 6px 8px; }.slot-state i { width: 6px; height: 6px; border-radius: 50%; background: #a49788; }.running .slot-state { color: #2f5d3f; background: #e8f0d0; }.running .slot-state i { background: #7a9e34; box-shadow: 0 0 0 3px rgba(122,158,52,.15); }
.slot-account-row { min-width: 0; display: grid; grid-template-columns: minmax(75px,1fr) auto; align-items: center; gap: 10px; margin: 16px 0 14px; }.slot-account { min-width: 0; }.slot-account strong,.slot-account small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.slot-account small { color: var(--muted); margin-top: 3px; }.slot-coins { display: flex !important; align-items: center; gap: 4px; color: #8a6518 !important; font-weight: 800; font-variant-numeric: tabular-nums; }.slot-coins img { width: 16px; height: 16px; flex: 0 0 16px; image-rendering: pixelated; }.slot-coins span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }.slot-runtime { min-width: 128px; padding: 7px 9px; border: 1px solid #e5e2d7; border-radius: 10px; background: #f4f2ea; }.slot-location { display: flex; justify-content: space-between; gap: 10px; }.slot-location span,.slot-uptime span { color: var(--muted); font-size: 9px; }.slot-location b { margin-left: 2px; color: var(--ink); font-size: 11px; }.slot-uptime { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 5px; padding-top: 5px; border-top: 1px solid #dedbd0; }.slot-uptime b { color: var(--forest); font-size: 11px; font-variant-numeric: tabular-nums; }
.slot-stats { display: grid; grid-template-columns: minmax(62px,.7fr) minmax(170px,2fr); align-items: center; gap: 10px; padding: 12px 0; border-block: 1px solid #e7e4d9; }.slot-stats span { display: block; color: var(--muted); font-size: 10px; }.slot-stats b { display: block; margin-top: 4px; font-size: 16px; }.gift-overview { min-width: 0; display: grid; grid-template-columns: 29px minmax(0,1fr) minmax(0,1fr); align-items: center; gap: 8px; padding: 8px 9px; border: 1px solid #f0ded0; border-radius: 10px; background: linear-gradient(135deg, #fff4ea, #f5f1e7); }.gift-overview > img { width: 25px; height: 25px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 3px 3px rgba(0,0,0,.16)); }.gift-overview > div { min-width: 0; }.gift-overview > div + div { padding-left: 8px; border-left: 1px solid #e6d9cd; }.gift-overview span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.gift-overview b { margin-top: 2px; }
.material-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; padding: 14px 0 2px; }.material-chip { min-width: 0; display: flex; align-items: center; gap: 6px; padding: 7px; border-radius: 9px; background: #f2f1e9; text-align: left; }.material-chip img { width: 29px; height: 29px; flex: 0 0 29px; image-rendering: pixelated; }.material-chip span { min-width: 0; }.material-chip b,.material-chip small { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 11px; font-variant-numeric: tabular-nums; }.material-chip b { color: var(--ink); }.material-chip small { margin-top: 1px; color: #3f835e; }
.slot-actions { display: flex; gap: 8px; margin-top: 15px; }.slot-actions button { flex: 1; min-height: 37px; border: 0; border-radius: 8px; font-weight: 800; }.configure { background: #e9e7de; color: var(--ink); }.run { background: var(--forest); color: #fff; }.stop { background: #f7dfd8; color: var(--danger); }

.backdrop { position: fixed; inset: 0; z-index: 39; background: rgba(12,28,23,.42); backdrop-filter: blur(3px); }.detail-panel { position: fixed; z-index: 40; top: 0; right: 0; width: min(600px, 100%); height: 100vh; padding: 26px; background: var(--card); box-shadow: -20px 0 55px rgba(10,30,24,.24); translate: 105% 0; transition: translate .3s cubic-bezier(.2,.8,.2,1); overflow-y: auto; }.detail-panel.open { translate: 0 0; }.detail-panel > header { display: flex; justify-content: space-between; align-items: start; }.detail-panel h3 { font-family: var(--font-display); font-weight: 750; font-size: 31px; letter-spacing: -.035em; margin: 5px 0 0; }.icon-button { border: 1px solid var(--line); background: transparent; width: 38px; height: 38px; border-radius: 10px; font-size: 22px; }.detail-tabs { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; margin: 22px 0 18px; padding: 4px; border-radius: 10px; background: #ebe9df; }.tab { border: 0; border-radius: 7px; padding: 9px; background: transparent; color: var(--muted); font-weight: 750; }.tab.active { color: var(--forest); background: var(--card); box-shadow: 0 2px 9px rgba(0,0,0,.07); }.tab-pane { display: none; }.tab-pane.active { display: block; }.form-section-title { margin: 20px 0 10px; padding-bottom: 7px; border-bottom: 1px solid #e5e3da; color: var(--ink); font-size: 13px; font-weight: 800; }.form-section-title:first-child { margin-top: 0; }.form-section-title.material-title { margin-top: 18px; }.account-fields { display: grid; gap: 8px; }.account-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }.account-row label:first-child::before { content: attr(data-index); display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 6px; border-radius: 6px; background: var(--forest); color: #fff; font-size: 10px; }
.inventory-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 13px; }.inventory-head h4 { margin: 0; font-size: 18px; }.inventory-head p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }.inventory-head > b { padding: 6px 9px; border-radius: 999px; color: #56752d; background: #e8f0d0; font-size: 10px; }.inventory-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }.inventory-item { min-width: 0; min-height: 72px; display: flex; align-items: center; gap: 9px; padding: 9px; border: 1px solid var(--line); border-radius: 11px; background: #f4f2ea; }.inventory-item > div { min-width: 0; }.inventory-item b,.inventory-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.inventory-item b { font-size: 10px; }.inventory-item small { margin-top: 3px; color: var(--muted); font-size: 8px; }.game-equip-icon { width: 32px; height: 32px; flex: 0 0 32px; background-repeat: no-repeat; background-size: 32px auto; image-rendering: pixelated; }.game-material-icon { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; }.game-material-icon img { max-width: 34px; max-height: 34px; image-rendering: pixelated; }.inventory-empty { grid-column: 1/-1; margin: 0; padding: 36px 15px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; font-size: 12px; }
.material-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; }.material-title span { flex: 0 0 auto; padding: 4px 7px; border-radius: 999px; color: #56752d; background: #e8f0d0; font-size: 10px; font-variant-numeric: tabular-nums; }.material-title span.limit { color: #fff; background: var(--orange); }
label { display: block; color: var(--muted); font-size: 11px; font-weight: 700; } input, select { width: 100%; height: 43px; margin-top: 6px; border: 1px solid var(--line); border-radius: 9px; background: #fffefb; padding: 0 11px; color: var(--ink); outline: none; }.account-row label:first-child input { margin-top: 6px; } input:focus,select:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(233,101,45,.1); }.server-setting { max-width: 260px; }.switch-row { display: flex; gap: 20px; margin: 17px 0; }.switch { display: flex; align-items: center; gap: 9px; color: var(--ink); font-size: 12px; }.switch input { display: none; }.switch i { position: relative; width: 40px; height: 23px; border-radius: 999px; background: #d1d0c7; }.switch i::after { content: ""; position: absolute; width: 17px; height: 17px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s; }.switch input:checked + i { background: var(--forest-2); }.switch input:checked + i::after { translate: 17px 0; }.pane-note { color: var(--muted); font-size: 12px; line-height: 1.5; }.material-editor { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }.material-input { display: flex; gap: 8px; align-items: center; padding: 11px; border: 1px solid var(--line); border-radius: 12px; }.material-input img { width: 37px; height: 37px; image-rendering: pixelated; }.material-input label { flex: 1; }.material-input input { height: 33px; margin-top: 3px; }.slot-log { min-height: 430px; max-height: 62vh; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; scrollbar-gutter: stable; margin: 0; border-radius: 12px; padding: 16px; color: #bce4c3; background: #10251f; font: 12px/1.6 Consolas, monospace; white-space: pre-wrap; }.form-actions { position: sticky; bottom: -26px; display: flex; justify-content: flex-end; gap: 9px; margin: 25px -26px -26px; padding: 17px 26px; background: rgba(255,253,247,.95); border-top: 1px solid var(--line); backdrop-filter: blur(8px); }
.runtime-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 22px; padding-top: 18px; border-top: 1px solid #e5e3da; }.runtime-actions .button { width: 100%; }.runtime-actions .button:disabled { cursor: not-allowed; opacity: .42; }.form-actions .button:disabled { cursor: not-allowed; opacity: .45; }
.access-notice { margin: 0 0 14px; padding: 11px 13px; border-radius: 9px; color: #8d3028; background: #f8ded8; font-size: 12px; font-weight: 750; }
.slot-card.expired { opacity: .72; }.slot-card.expired::before { display: none; }
.admin-panel { position: fixed; z-index: 42; inset: 4vh 4vw; padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: 0 28px 80px rgba(8,25,20,.3); translate: 0 110%; transition: translate .3s cubic-bezier(.2,.8,.2,1); overflow: auto; }.admin-panel.open { translate: 0 0; }.admin-panel > header { display: flex; justify-content: space-between; align-items: flex-start; }.admin-panel h3 { margin: 5px 0 0; font-family: var(--font-display); font-size: 30px; letter-spacing: -.03em; }.admin-intro { margin: 10px 0 22px; color: var(--muted); font-size: 13px; }.admin-users { display: grid; gap: 14px; }.admin-user { border: 1px solid var(--line); border-radius: 14px; background: var(--card); overflow: hidden; }.admin-user-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 17px; border-bottom: 1px solid var(--line); }.admin-user-head b,.admin-user-head small { display: block; }.admin-user-head small { margin-top: 3px; color: var(--muted); }.role-badge { border-radius: 999px; padding: 5px 8px; color: #fff; background: var(--forest); font-size: 10px; font-weight: 800; }.admin-slot-list { display: grid; }.admin-slot-row { display: grid; grid-template-columns: 76px minmax(150px,1fr) minmax(180px,1fr) 90px 80px 70px; align-items: end; gap: 9px; padding: 11px 15px; border-bottom: 1px solid #ebe8de; }.admin-slot-row:last-child { border-bottom: 0; }.admin-slot-id b,.admin-slot-id small { display: block; }.admin-slot-id small { margin-top: 3px; color: var(--muted); font-size: 10px; }.admin-slot-account { min-width: 0; align-self: center; }.admin-slot-account b,.admin-slot-account small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.admin-slot-account small { color: var(--muted); font-size: 10px; }.admin-slot-row input[type="datetime-local"] { height: 37px; margin: 0; }.admin-check { align-self: center; display: flex; align-items: center; gap: 6px; color: var(--ink); font-size: 11px; }.admin-check input { width: 17px; height: 17px; margin: 0; }.admin-small-button { min-height: 36px; border: 0; border-radius: 8px; font-weight: 800; }.admin-save { color: #fff; background: var(--forest); }.admin-delete { color: var(--danger); background: #f7dfd8; }.admin-add { display: grid; grid-template-columns: minmax(190px,260px) 120px; align-items: end; gap: 9px; padding: 13px 15px; background: #f4f1e8; }.admin-add label { color: var(--muted); font-size: 11px; font-weight: 750; }.admin-add input { height: 38px; margin-top: 6px; }.admin-add button { min-height: 38px; }
#adminBackdrop { z-index: 41; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 24px; translate: -50% 25px; opacity: 0; padding: 12px 17px; border-radius: 9px; color: #fff; background: var(--forest); box-shadow: var(--shadow); transition: .25s; pointer-events: none; }.toast.show { opacity: 1; translate: -50% 0; }.toast.error { background: var(--danger); }
.offline-bar { position: fixed; z-index: 101; left: 50%; bottom: 22px; translate: -50% 0; display: flex; align-items: center; gap: 14px; min-width: min(440px, calc(100% - 28px)); padding: 11px 12px 11px 17px; border-radius: 11px; color: #fff; background: var(--danger); box-shadow: var(--shadow); }
.offline-bar span { flex: 1; }.offline-bar button { min-height: 34px; border: 0; border-radius: 7px; padding: 0 12px; color: var(--danger); background: #fff; font-weight: 800; }
.password-backdrop { position: fixed; z-index: 110; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(8,28,23,.58); backdrop-filter: blur(5px); }.password-modal { width: min(430px,100%); overflow: hidden; border: 1px solid rgba(255,255,255,.25); border-radius: 17px; background: var(--card); box-shadow: 0 30px 85px rgba(5,25,19,.36); }.password-modal > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 19px 20px; color: #fff; background: var(--forest); }.password-modal h3 { margin: 5px 0 0; font-size: 23px; }.password-modal .icon-button { color: #fff; border-color: rgba(255,255,255,.2); }.password-modal form { display: grid; gap: 13px; padding: 20px; }.password-modal label { font-size: 11px; }.password-modal input { height: 46px; font-size: 14px; }.password-modal footer { display: grid; grid-template-columns: 1fr 1.4fr; gap: 9px; margin-top: 5px; }.password-modal footer .button { width: 100%; padding-inline: 10px; }
.forgot-backdrop { position: fixed; z-index: 111; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(8,28,23,.62); backdrop-filter: blur(5px); }.forgot-modal { width: min(470px,100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; border: 1px solid rgba(255,255,255,.25); border-radius: 17px; background: var(--card); box-shadow: 0 30px 85px rgba(5,25,19,.38); }.forgot-modal > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 19px 20px; color: #fff; background: var(--forest); }.forgot-modal h3 { margin: 5px 0 0; font-size: 23px; }.forgot-modal .icon-button { color: #fff; border-color: rgba(255,255,255,.2); }.forgot-modal form { display: grid; gap: 12px; padding: 20px; }.forgot-modal label { font-size: 11px; }.forgot-modal input { height: 45px; font-size: 14px; }.reset-email-row { display: grid; grid-template-columns: minmax(0,1fr) 105px; align-items: end; gap: 8px; }.reset-email-row .button { height: 45px; margin-top: 6px; padding-inline: 9px; font-size: 11px; }.reset-note { margin: -3px 0 2px; color: var(--muted); font-size: 10px; line-height: 1.45; }.forgot-modal footer { display: grid; grid-template-columns: 1fr 1.45fr; gap: 9px; margin-top: 5px; }.forgot-modal footer .button { width: 100%; padding-inline: 9px; }

@keyframes sweep { to { rotate: 360deg; } } @keyframes float { 50% { transform: translateY(-8px) rotate(4deg); } } @keyframes reveal { from { opacity: 0; translate: 0 10px; } } @keyframes login-card-in { from { opacity: 0; translate: 22px 0; scale: .98; } }
@media (max-width: 1050px) { .summary-grid { grid-template-columns: repeat(3, 1fr); }.material-summary { grid-column: 1/-1; } }
@media (max-width: 900px) { .admin-panel { inset: 10px; padding: 18px 13px; }.admin-slot-row { grid-template-columns: 62px 1fr 1fr; }.admin-slot-row .admin-check,.admin-slot-row .admin-save,.admin-slot-row .admin-delete { align-self: center; }.admin-add { grid-template-columns: 1fr 110px; } }
@media (max-width: 760px) { .login-view { grid-template-columns: 1fr; }.login-art { position: absolute; inset: 0; min-height: 100%; opacity: .72; }.login-card { position: relative; padding: 34px 25px; align-self: end; background: linear-gradient(transparent, rgba(8,30,24,.94) 22%); }.login-card h1 { font-size: 46px; }.app-shell { display: block; }.topbar { align-items: flex-start; }.topbar h2 { font-size: 25px; }.topbar-actions { gap: 7px; }.user-chip { padding-right: 6px; }.user-chip span { display: none; } main { width: auto; margin: 0; padding: 24px 15px 55px; }.summary-grid { grid-template-columns: repeat(2, 1fr); margin: 22px 0 32px; }.summary-card { min-height: 94px; padding: 14px; }.summary-card:nth-child(3),.material-summary { grid-column: 1/-1; }.summary-card strong { font-size: 28px; }.material-summary > div > div { grid-template-columns: repeat(3, 1fr); }.slot-grid { grid-template-columns: 1fr; }.detail-panel { padding: 20px 16px; }.form-actions { margin-inline: -16px; padding-inline: 16px; }.material-editor { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .pricing-card { grid-template-columns: 54px minmax(0,1fr); gap: 13px; margin: 22px 0 32px; padding: 17px 16px; }.pricing-mark { width: 52px; height: 52px; border-radius: 13px 6px 13px 6px; }.pricing-mark img { width: 34px; height: 34px; }.pricing-copy h3 { font-size: 22px; }.pricing-copy pre { font-size: 12px; }.pricing-table > div:first-child { font-size: 9px; }.pricing-table > div:last-child > div { font-size: 12px; }.contact-card { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; margin-top: 2px; padding: 12px 0 0; border-top: 1px solid rgba(61,84,67,.15); border-left: 0; }.contact-card strong { margin: 2px 0 0; font-size: 14px; }.contact-kicker { display: none; }.contact-links { margin-left: auto; } }
@media (max-width: 430px) { .account-row,.two-columns { grid-template-columns: 1fr; }.material-editor { grid-template-columns: 1fr 1fr; }.section-head p { display: none; }.slot-card { padding: 16px; }.material-chip img { width: 25px; height: 25px; flex-basis: 25px; }.material-chip b,.material-chip small { font-size: 10px; }.summary-icon { display: none !important; } }
@media (max-width: 760px) { .login-art { --radar-size: min(78vw, 340px); }.radar-logo { width: 58px; height: 58px; }.material-orbit img { width: 34px; height: 34px; } }
@media (max-width: 760px) { .inventory-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }.slot-actions { gap: 6px; }.slot-actions button { padding-inline: 5px; font-size: 11px; } }
@media (max-width: 390px) { .inventory-grid { grid-template-columns: 1fr; } }

@media (min-width: 761px) {
  .backdrop { background: rgba(12,28,23,.08); backdrop-filter: none; }
  .detail-panel { top: 76px; right: 22px; width: min(470px,calc(100% - 44px)); height: auto; max-height: calc(100vh - 98px); max-height: calc(100dvh - 98px); padding: 20px; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 65px rgba(10,30,24,.2); translate: calc(100% + 35px) 0; }
  .detail-panel h3 { font-size: 25px; }
  .detail-tabs { margin: 16px 0 14px; }
  .inventory-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .inventory-item { min-height: 64px; }
  .slot-log { min-height: 330px; max-height: 56vh; }
  .form-actions { bottom: -20px; margin: 20px -20px -20px; padding: 13px 20px; }
}

@media (max-width: 760px) {
  .backdrop { background: rgba(12,28,23,.18); backdrop-filter: none; }
  .detail-panel { top: auto; right: 0; bottom: 0; width: 100%; height: min(86vh,760px); height: min(86dvh,760px); padding: 18px 16px; border: 1px solid var(--line); border-radius: 20px 20px 0 0; translate: 0 105%; }
  .detail-panel h3 { font-size: 24px; }
  .detail-tabs { margin: 15px 0 13px; }
  .form-actions { bottom: -18px; margin: 18px -16px -18px; padding: 12px 16px; }
}

.slot-log { font-family: var(--font-ui) !important; }

/* Keep card typography on a compact, high-contrast scale. */
.slot-card { padding: 18px; background: linear-gradient(145deg, #fffefb, #faf9f2); }
.slot-card-head { align-items: center; }
.slot-number b { color: var(--ink); font-size: 25px; letter-spacing: -.02em; }
.slot-expiry { color: #48652c; background: #edf4d9; font-size: 10px; font-weight: 850; }
.slot-state { color: #47564f; background: #e9eee7; font-size: 10px; font-weight: 850; }
.slot-account-row { margin: 17px 0 15px; }
.slot-account strong { color: var(--ink); font-size: 15px; font-weight: 850; letter-spacing: .01em; }
.slot-account-title { min-width: 0; display: flex; align-items: center; gap: 6px; }.slot-account-title > img { width: 21px; height: 21px; flex: 0 0 21px; object-fit: contain; }.slot-account-title strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-account small { color: #53635b; font-size: 11px; font-weight: 650; }
.slot-coins { color: #765713 !important; font-size: 12px !important; font-weight: 850 !important; }
.slot-runtime { border-color: #d8ddd3; background: #f0f3ed; }
.slot-location span,.slot-uptime span { color: #596860; font-size: 10px; font-weight: 650; }
.slot-location b,.slot-uptime b { font-size: 11px; font-weight: 850; }
.slot-stats { gap: 11px; padding: 13px 0; }
.slot-stats span { color: #596860; font-size: 10px; font-weight: 700; }
.slot-stats b { color: var(--ink); margin-top: 5px; font-size: 17px; font-weight: 850; }
.gift-overview { gap: 9px; padding: 9px 10px; border-color: #e3ddd1; background: linear-gradient(135deg, #fff4e8, #f4f0e7); }
.gift-overview span { color: #596860; font-size: 10px; font-weight: 700; }
.gift-overview b { color: var(--ink); font-size: 16px; font-weight: 850; }
.material-strip { gap: 8px; padding: 14px 0 3px; }
.material-chip { gap: 7px; padding: 8px; border: 1px solid #e4e6dc; background: #f0f2eb; }
.material-chip b { color: var(--ink); font-size: 12px; font-weight: 850; }
.material-chip small { color: var(--gain-blue); font-size: 10px; font-weight: 750; }
.slot-actions { gap: 8px; margin-top: 16px; }
.slot-actions button { min-height: 40px; color: var(--ink); font-size: 12px; font-weight: 850; letter-spacing: -.01em; }
.slot-actions .configure { background: #e8e9e2; }
.slot-actions .inventory-slot { color: #fff; background: var(--forest-2); }
.slot-actions .logs-slot { background: #e8e9e2; }
@media (max-width: 760px) { .login-view { background-position: center bottom; }.login-view::before { background: linear-gradient(180deg, rgba(8,38,33,.04) 0%, rgba(8,38,33,.12) 44%, rgba(8,31,27,.7) 100%); }.login-art { --radar-size: min(66vw, 280px); opacity: .82; }.radar,.material-orbit { left: 50%; top: 28%; }.login-card { width: min(410px, calc(100% - 28px)); margin: 0 auto 16px; padding: 24px 22px; border-radius: 20px; background: radial-gradient(circle at 100% 0, rgba(186,214,111,.11), transparent 34%), linear-gradient(145deg, rgba(9,46,39,.94), rgba(7,31,27,.91)); backdrop-filter: blur(14px) saturate(1.1); } }

/* Responsive hardening for phones, tablets and short landscape screens. */
@media (min-width: 761px) and (max-width: 1199px) {
  main { width: calc(100% - 48px); }
  .summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .material-summary { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .admin-panel {
    inset: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    max-width: none;
  }
  .admin-slot-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
  .admin-slot-id, .admin-slot-account, .admin-slot-row > label:not(.admin-check) { grid-column: 1 / -1; }
  .admin-slot-account b, .admin-slot-account small { white-space: normal; overflow-wrap: anywhere; }
  .admin-slot-row input[type="datetime-local"] { width: 100%; }
  .admin-check { min-height: 38px; }
}

@media (max-width: 760px) {
  .login-view { min-height: 100svh; overflow-x: hidden; overflow-y: auto; }
  .login-card { margin-bottom: max(12px, env(safe-area-inset-bottom)); }
  main {
    width: 100%;
    padding: max(20px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) calc(55px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }
  .topbar { flex-wrap: wrap; gap: 14px; }
  .topbar-brand { min-width: 0; }
  .topbar-brand > div { min-width: 0; }
  .topbar h2 { overflow-wrap: anywhere; }
  .topbar-actions { max-width: 100%; margin-left: auto; }
  .button, .icon-button, .slot-actions button, .admin-small-button { min-height: 44px; }
  .summary-grid { gap: 10px; }
  .summary-card { min-width: 0; }
  .material-summary > div > div { gap: 7px 5px; }
  .mini-material { white-space: nowrap; }
  .detail-panel {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    padding: max(18px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }
  .detail-panel > header { gap: 12px; }
  .detail-panel h3 { font-size: 27px; }
  .form-actions {
    bottom: -18px;
    margin: 24px -14px -18px;
    padding: 14px max(14px, env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }
  .slot-log { min-height: 300px; max-height: calc(100dvh - 210px); }
  .toast { max-width: calc(100% - 24px); bottom: calc(16px + env(safe-area-inset-bottom)); text-align: center; }
  .offline-bar { bottom: calc(12px + env(safe-area-inset-bottom)); }
}

@media (max-width: 520px) {
  .auth-heading { margin-bottom: 19px; }
  .auth-logo { width: 43px; height: 43px; flex-basis: 43px; }
  .auth-heading h2 { font-size: 25px; }
  .auth-form { gap: 13px; }
  .auth-form input, .auth-form .button { min-height: 48px; height: 48px; }
  .topbar-actions { width: 100%; margin-left: 0; }
  .topbar-actions .user-chip { flex: 1; min-width: 48px; }
  .topbar-actions .user-menu-wrap { flex: 1; min-width: 48px; }
  .user-menu { width: min(285px, calc(100vw - 28px)); right: auto; left: 0; }
  .topbar-actions .button { padding-inline: 12px; }
  .section-head { align-items: center; flex-wrap: wrap; gap: 12px; }
  .section-actions { margin-left: auto; }
  .section-head > div { min-width: 0; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-card:nth-child(3), .material-summary { grid-column: 1 / -1; }
  .summary-card strong { font-size: clamp(24px, 8vw, 30px); }
  .slot-card-head { gap: 10px; }
  .slot-number { min-width: 0; }
  .slot-stats { gap: 5px; }
  .slot-stats > div { min-width: 0; }
  .material-chip { gap: 4px; padding: 6px 4px; }
  .material-chip b, .material-chip small { overflow: visible; text-overflow: clip; white-space: nowrap; font-size: clamp(9px, 2.8vw, 11px); }
  .form-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .form-actions .button { width: 100%; padding-inline: 10px; }
  .admin-panel { padding-inline: 10px; border-radius: 13px; }
  .admin-panel > header { gap: 10px; }
  .admin-panel h3 { font-size: 24px; overflow-wrap: anywhere; }
  .admin-user-head { align-items: flex-start; padding: 13px; }
  .admin-user-head > div { min-width: 0; }
  .admin-user-head b { overflow-wrap: anywhere; }
  .admin-slot-row { padding: 13px; }
  .admin-add { grid-template-columns: 1fr; padding: 13px; }
  .admin-add input, .admin-add button { width: 100%; min-height: 44px; }
}

@media (max-width: 360px) {
  .brand-mark { width: 39px; height: 39px; flex: 0 0 39px; }
  .topbar h2 { font-size: 22px; }
  .topbar-actions { display: grid; grid-template-columns: 1fr auto auto; }
  .topbar-actions { grid-template-columns: 1fr auto; }
  .topbar-actions .button { font-size: 12px; padding-inline: 9px; }
  .summary-card { padding: 12px 10px; }
  .summary-card span { font-size: 11px; }
  .material-summary > div > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .material-chip img { width: 23px; height: 23px; flex-basis: 23px; }
  .slot-card { padding: 14px 12px; }
  .runtime-actions { grid-template-columns: 1fr; }
  .switch-row { flex-direction: column; gap: 12px; }
}

@media (orientation: landscape) and (max-height: 560px) and (max-width: 900px) {
  .login-view { grid-template-columns: minmax(180px, .75fr) minmax(300px, 1.25fr); align-items: start; overflow-y: auto; }
  .login-art { position: sticky; inset: auto; top: 0; min-height: 100vh; min-height: 100dvh; opacity: .72; }
  .login-art { --radar-size: min(38vw, 210px); }
  .radar, .material-orbit { left: 50%; top: 50%; }
  .radar-logo { width: 48px; height: 48px; }
  .material-orbit img { width: 28px; height: 28px; }
  .login-card { align-self: start; justify-self: center; margin: 12px auto; padding: 18px 20px; }
  .auth-heading { margin-bottom: 12px; }
  .auth-logo { width: 38px; height: 38px; flex-basis: 38px; }
  .auth-heading h2 { font-size: 20px; }
  .auth-secondary { margin-top: 10px; padding-top: 9px; }
  .auth-form { gap: 8px; }
  .auth-form input { height: 44px; }
  .login-hint { margin-block: 10px 0; }
}

@media (orientation: landscape) and (max-height: 400px) and (max-width: 700px) {
  .login-view { grid-template-columns: 120px minmax(280px, 1fr); }
  .login-art { --radar-size: 112px; }
  .material-orbit img { width: 21px; height: 21px; }
  .radar-logo { width: 38px; height: 38px; }
}
@media (max-width: 760px) {
  .backdrop { background: rgba(12,28,23,.18); backdrop-filter: none; }
  .detail-panel { top: auto; right: 0; bottom: 0; width: 100%; height: min(86vh,760px); height: min(86dvh,760px); max-height: 86vh; max-height: 86dvh; padding: 18px max(14px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left)); border: 1px solid var(--line); border-radius: 20px 20px 0 0; translate: 0 105%; }
  .detail-panel h3 { font-size: 24px; }
  .form-actions { bottom: -18px; margin: 18px -14px -18px; padding: 12px max(14px,env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left)); }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation: none !important; transition: none !important; } }

/* Compact account panel. */
.detail-panel { font-size: 11px; }
.detail-panel > header .eyebrow { font-size: 8px; }
.detail-panel h3 { margin-top: 3px; font-size: 22px; }
.detail-tabs { grid-template-columns: repeat(2,1fr); margin: 12px 0; }
.detail-tabs .tab { min-height: 34px; padding: 6px; font-size: 11px; }
.form-section-title { margin: 12px 0 7px; padding-bottom: 5px; font-size: 11px; }
.account-fields { gap: 6px; }
.detail-panel label { font-size: 10px; }
.detail-panel input,.detail-panel select { height: 36px; margin-top: 4px; padding-inline: 9px; font-size: 11px; }
.config-inline-row { display: grid; grid-template-columns: minmax(130px,1fr) auto; align-items: end; gap: 9px; margin-top: 10px; }
.config-inline-row .server-setting { max-width: none; }
.config-inline-row .switch { min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: #f1f2ec; font-size: 10px; white-space: nowrap; }
.config-inline-row .switch i { width: 34px; height: 20px; }
.config-inline-row .switch i::after { width: 14px; height: 14px; }
.config-inline-row .switch input:checked + i::after { translate: 14px 0; }
.material-title { margin-top: 12px !important; }
.material-editor { gap: 6px; }
.material-input { gap: 6px; padding: 7px; border-radius: 9px; }
.material-input img { width: 28px; height: 28px; }
.material-input input { height: 29px; margin-top: 2px; }
.compact-log-title { margin-top: 13px; }
.compact-slot-log { min-height: 120px; max-height: 180px; padding: 10px; border-radius: 9px; font-size: 10px; line-height: 1.45; }
.config-action-grid { position: sticky; bottom: -20px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; margin: 12px -20px -20px; padding: 11px 20px; border-top: 1px solid var(--line); background: rgba(255,253,247,.96); backdrop-filter: blur(8px); }
.config-action-grid .button { width: 100%; min-height: 35px; padding: 0 5px; border-radius: 8px; font-size: 10px; }
.inventory-head { margin-bottom: 9px; }
.inventory-head h4 { font-size: 15px; }
.inventory-head p { font-size: 9px; }
.inventory-item { min-height: 57px; padding: 7px; }
.inventory-item b { font-size: 9px; }

@media (max-width: 760px) {
  .detail-panel { padding-top: 14px; }
  .config-action-grid { bottom: calc(-18px - env(safe-area-inset-bottom)); grid-template-columns: repeat(2,minmax(0,1fr)); margin: 12px -14px calc(-18px - env(safe-area-inset-bottom)); padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
  .config-action-grid .button { min-height: 38px; }
}

.slot-account-title,.slot-coins { display: grid !important; grid-template-columns: 21px minmax(0,1fr); align-items: center; gap: 6px; }
.section-head,.section-head *,.slot-grid,.slot-grid * { font-family: Bahnschrift,"Segoe UI",Tahoma,sans-serif; }
.material-chip { gap: 4px; padding: 6px 5px; }
.material-chip img { width: 24px; height: 24px; flex-basis: 24px; }
.material-chip > span { flex: 1; min-width: 0; }
.material-chip b,.material-chip small { overflow: visible; text-overflow: clip; white-space: nowrap; font-size: 10px; letter-spacing: -.04em; }
.slot-card,.slot-card * { text-overflow: clip; }
.slot-account-title strong,.slot-account strong,.slot-account small { overflow: visible; white-space: normal; overflow-wrap: anywhere; }
.slot-coins span { overflow: visible; white-space: normal; overflow-wrap: anywhere; }
.slot-expiry { max-width: none; overflow: visible; white-space: normal; text-align: center; }
.gift-overview span { overflow: visible; white-space: normal; line-height: 1.2; }
.slot-location span,.slot-uptime span { white-space: nowrap; }
.slot-account-title > img { width: 21px; height: 21px; justify-self: center; object-fit: contain; }
.slot-coins img { width: 18px; height: 18px; justify-self: center; object-fit: contain; image-rendering: pixelated; }

.inventory-grid { grid-template-columns: repeat(auto-fill,minmax(43px,1fr)); gap: 4px; align-items: start; }
.inventory-game-slot { position: relative; width: 100%; min-width: 0; min-height: 0; aspect-ratio: 1; display: grid; place-items: center; padding: 3px; border: 1px solid #d6d5ca; border-radius: 6px; background: linear-gradient(145deg,#fffef8,#eae9df); box-shadow: inset 0 0 0 1px rgba(255,255,255,.55); }
.inventory-game-slot:hover { border-color: #aeb5a7; background: #fffdf5; }
.inventory-game-slot .game-equip-icon { width: 22px; height: 22px; background-size: 22px auto; }
.inventory-game-slot .game-material-icon { width: 29px; height: 29px; }
.inventory-game-slot .game-material-icon img { max-width: 27px; max-height: 27px; }
.inventory-amount,.inventory-level { position: absolute; z-index: 1; right: 3px; bottom: 2px; max-width: calc(100% - 6px); overflow: hidden; color: #fff !important; font-family: var(--font-ui); font-size: 9px !important; font-weight: 900 !important; line-height: 1; letter-spacing: -.04em; text-overflow: ellipsis; white-space: nowrap; text-shadow: -1px -1px 0 #27342e,1px -1px 0 #27342e,-1px 1px 0 #27342e,1px 1px 0 #27342e; }
.inventory-amount,.inventory-level { right: 2px; bottom: 2px; padding: 1px 3px; border-radius: 3px; color: var(--ink) !important; background: rgba(255,255,255,.9); font-family: var(--font-ui) !important; font-size: 10px !important; font-weight: 850 !important; line-height: 1.15; letter-spacing: 0; text-shadow: none; }
.inventory-level { color: #397650 !important; }
.slot-identity { min-width: 0; display: flex; align-items: center; gap: 8px; }.slot-identity > div { min-width: 0; display: grid; justify-items: start; gap: 4px; }.slot-number-badge { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border: 2px solid #bcc8b7; border-radius: 50%; color: var(--ink); background: #f8f8f1; font-family: var(--font-display); font-size: 17px; font-weight: 850; }.slot-tagname { max-width: 150px; color: var(--ink); font-size: 12px; font-weight: 850; line-height: 1.15; overflow-wrap: anywhere; }.slot-identity .slot-expiry { margin: 0; padding: 3px 6px; font-size: 8px; }.slot-state.server-state { gap: 6px; color: #274e42; background: #e7efe8; }.slot-state.server-state img { width: 18px; height: 18px; flex: 0 0 18px; object-fit: contain; }.slot-state.server-state span { white-space: nowrap; }.slot-account-coins { min-height: 22px; display: flex; align-items: center; }.slot-account-coins:empty { min-height: 0; }
.slot-number-badge.trial-number-badge { width: auto; min-width: 48px; padding: 0 8px; flex-basis: auto; border-radius: 999px; color: #83521f; border-color: #dfbd82; background: #fff0d5; font-size: 10px; text-transform: uppercase; }
@media (max-width: 390px) { .inventory-grid { grid-template-columns: repeat(auto-fill,minmax(40px,1fr)); gap: 4px; } }

/* Keep every account card aligned while allowing long account names to wrap. */
.slot-card {
  display: flex;
  flex-direction: column;
}
.slot-card-head {
  min-height: 48px;
}
.slot-account-row {
  min-height: 66px;
  margin: 13px 0 15px;
}
.slot-account-coins {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 5px;
}
.slot-account-coins .slot-expiry {
  margin: 0;
  text-align: left;
}
.slot-stats {
  min-height: 88px;
}
.material-strip {
  min-height: 118px;
  align-content: start;
}
.slot-actions {
  margin-top: auto;
  padding-top: 16px;
}

.slot-stats {
  grid-template-columns: minmax(62px, .7fr) minmax(90px, 1fr);
}
.gift-overview {
  grid-template-columns: 29px auto;
  justify-content: start;
}
.gift-overview b {
  margin-top: 0;
}

/* Compact, consistent metric card shared by matches and gifts. */
.slot-card {
  padding: 14px 15px;
}
.slot-card-head {
  min-height: 42px;
}
.slot-account-row {
  min-height: 58px;
  margin: 10px 0 11px;
}
.slot-state.server-state {
  min-width: 88px;
  justify-content: center;
  padding: 7px 10px;
  border: 1px solid #d9e4d8;
  color: #315647;
  background: #eef4ed;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}
.slot-stats {
  min-height: 52px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  padding: 7px 8px;
  border: 1px solid #e5e1d6;
  border-radius: 10px;
  background: #f6f4ec;
}
.slot-stats > .match-stat,
.slot-stats > .gift-overview {
  min-width: 0;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 2px;
  padding: 2px 9px;
}
.slot-stats > .gift-overview {
  grid-template-columns: 25px auto;
  align-items: center;
  gap: 7px;
  border: 0;
  border-left: 1px solid #e3ded2;
  border-radius: 0;
  background: transparent;
}
.slot-stats > .match-stat span {
  color: #68736b;
  font-size: 9px;
  font-weight: 750;
}
.slot-stats > .match-stat b,
.slot-stats > .gift-overview b {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.1;
}
.slot-stats > .gift-overview > img {
  width: 25px;
  height: 25px;
}
.material-strip {
  min-height: 96px;
  gap: 6px;
  padding: 10px 0 1px;
}
.slot-actions {
  padding-top: 10px;
}
.slot-card.running::before {
  display: none;
}

.slot-identity {
  flex: 1;
  overflow: hidden;
}
.slot-identity > div {
  flex: 1;
  max-width: 150px;
  overflow: hidden;
}
.slot-tagname {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
}
.slot-identity .slot-coins {
  display: grid !important;
  grid-template-columns: 15px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  max-width: 100%;
  margin-top: 3px;
  color: #765713 !important;
  font-size: 10px !important;
  line-height: 1.15;
}
.slot-identity .slot-coins img {
  width: 15px;
  height: 15px;
}
.slot-identity .slot-coins span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.slot-expiry-wrap {
  min-width: 0;
}
.slot-expiry-wrap:empty {
  min-height: 1px;
}
.slot-expiry-wrap .slot-expiry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  margin: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.account-row label:first-child::before {
  content: none;
  display: none;
}

.slot-card {
  overflow: visible;
}
.slot-expiry-corner {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  margin: 0;
  translate: 0 -50%;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 3px 8px rgba(35, 53, 43, .1);
}
.slot-corner-flags {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
  translate: 0 -50%;
}
.slot-corner-flags .slot-expiry-corner {
  position: static;
  translate: none;
}
.invalid-account-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 4px 7px;
  border: 1px solid #e9b9ae;
  border-radius: 999px;
  color: #a33d31;
  background: #fae6e0;
  box-shadow: 0 3px 8px rgba(83,38,31,.08);
  font-size: 9px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}
.maintenance-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 4px 8px;
  border: 1px solid #e0b661;
  border-radius: 999px;
  color: #815712;
  background: #fff1c9;
  box-shadow: 0 3px 8px rgba(83,61,25,.08);
  font-size: 9px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}
.slot-state.stopped-state {
  border: 1px solid #e8b7ad;
  color: #a6382d;
  background: #f9e2dc;
}
.slot-state.stopped-state i {
  background: #c84a3d;
  box-shadow: 0 0 0 3px rgba(200,74,61,.12);
}
.slot-card .slot-state {
  position: absolute;
  z-index: 3;
  top: 9px;
  right: 12px;
  margin: 0;
  translate: none;
  box-shadow: 0 3px 8px rgba(35,53,43,.09);
}
.slot-state.maintenance-state {
  border: 1px solid #e0b661;
  color: #815712;
  background: #fff1c9;
}
.slot-state.maintenance-state i {
  background: #d08a1f;
  box-shadow: 0 0 0 3px rgba(208,138,31,.14);
}
.slot-coins > span {
  display: flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
}
.slot-coins em {
  color: var(--gain-blue);
  font-size: 9px;
  font-style: normal;
  font-weight: 850;
}
@media (max-width: 480px) {
  .slot-card .slot-state { top: 7px; right: 9px; }
  .slot-coins > span { gap: 3px; }
  .slot-coins em { font-size: 8px; }
}
.slot-account-row {
  display: block;
  min-height: 0;
  margin: 9px 0 10px;
}
.slot-runtime {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
}
.slot-runtime-line {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.slot-runtime-line span {
  color: #68736b;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}
.slot-runtime-line b {
  color: var(--ink);
  font-size: 10px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}
.slot-runtime-line span:last-child {
  justify-self: end;
}

.automatic-self-shoot-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -3px 0 10px;
  padding: 8px 10px;
  border: 1px solid #d7c8ad;
  border-radius: 9px;
  color: #4f4a3f;
  background: linear-gradient(135deg, #fff8e9, #f3ebd8);
  cursor: pointer;
}
.automatic-self-shoot-control > span {
  min-width: 0;
}
.automatic-self-shoot-control b,
.automatic-self-shoot-control small {
  display: block;
}
.automatic-self-shoot-control b {
  color: #624a24;
  font-size: 10px;
  font-weight: 900;
}
.automatic-self-shoot-control small {
  margin-top: 2px;
  color: #88765a;
  font-size: 8px;
  font-weight: 700;
}
.automatic-self-shoot-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.automatic-self-shoot-control > i {
  position: relative;
  width: 36px;
  height: 20px;
  flex: 0 0 36px;
  border-radius: 999px;
  background: #c9c5b9;
  transition: background .18s ease;
}
.automatic-self-shoot-control > i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(53, 42, 24, .25);
  transition: transform .18s ease;
}
.automatic-self-shoot-control input:checked + i {
  background: #a96827;
}
.automatic-self-shoot-control input:checked + i::after {
  transform: translateX(16px);
}
.automatic-self-shoot-control input:focus-visible + i {
  outline: 2px solid #9f6a31;
  outline-offset: 2px;
}
.automatic-self-shoot-control:has(input:disabled) {
  cursor: wait;
  opacity: .65;
}

@media (max-width: 390px) {
  .slot-runtime-line { gap: 6px; }
  .slot-runtime-line span { font-size: 8px; }
  .slot-runtime-line b { font-size: 9px; }
}

.slot-actions {
  gap: 6px;
  padding-top: 8px;
}
.slot-actions button {
  min-height: 32px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 10px;
  line-height: 1;
}
.slot-actions .configure,
.slot-actions .inventory-slot {
  color: #fff;
  background: var(--orange);
}
.slot-actions .configure:hover,
.slot-actions .inventory-slot:hover {
  background: #d95624;
}

@media (min-width: 761px) {
  .detail-panel {
    width: min(400px, calc(100% - 28px));
    padding: 14px;
  }
  .detail-panel h3 { font-size: 20px; }
  .detail-panel > header { gap: 8px; }
  .detail-tabs { margin: 10px 0; padding: 3px; }
  .detail-tabs .tab { min-height: 29px; padding: 5px; font-size: 10px; }
  .form-section-title { margin: 8px 0 5px; padding-bottom: 4px; font-size: 10px; }
  .account-fields { gap: 5px; }
  .detail-panel input, .detail-panel select { height: 32px; margin-top: 3px; padding-inline: 8px; font-size: 10px; }
  .config-inline-row { gap: 6px; margin-top: 7px; }
  .compact-slot-log { min-height: 90px; max-height: 140px; padding: 8px; font-size: 9px; line-height: 1.35; }
  .config-action-grid { gap: 5px; margin-top: 8px; padding: 8px 14px; }
  .config-action-grid .button { min-height: 31px; font-size: 9px; }
}

@media (max-width: 760px) {
  .detail-panel { height: min(80vh, 640px); height: min(80dvh, 640px); padding: 14px 12px; }
  .detail-panel h3 { font-size: 20px; }
  .detail-tabs { margin: 10px 0; }
  .compact-slot-log { min-height: 90px; max-height: 135px; }
}

.detail-panel h3.detail-slot-number {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  margin-top: 4px;
  border: 2px solid #bcc8b7;
  border-radius: 50%;
  color: var(--ink);
  background: #f8f8f1;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.detail-panel {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.detail-panel::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.slot-state.server-state {
  min-width: 70px;
  gap: 4px;
  padding: 4px 7px;
  font-size: 9px;
}
.slot-state.server-state img {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
}
.slot-state {
  min-width: 70px;
  min-height: 24px;
  justify-content: center;
  gap: 4px;
  padding: 4px 7px;
  font-size: 9px;
  line-height: 1;
}

/* Responsive safeguards for tablets, phones, and narrow landscape screens. */
img, svg, video, canvas { max-width: 100%; }

@media (min-width: 761px) and (max-width: 1199px) {
  main { width: 92%; }
  .topbar { flex-wrap: wrap; }
  .slot-grid[data-columns] {
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  }
  .pricing-card {
    grid-template-columns: 62px minmax(0, 1fr);
  }
  .pricing-mark { width: 58px; height: 58px; }
  .contact-card {
    grid-column: 1 / -1;
    padding: 12px 0 0;
    border-top: 1px solid rgba(61,84,67,.15);
    border-left: 0;
  }
}

@media (min-width: 1200px) and (max-width: 1599px) {
  .slot-grid[data-columns="5"],
  .slot-grid[data-columns="6"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1600px) and (max-width: 1999px) {
  .slot-grid[data-columns="6"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  body { background-attachment: scroll; }
  main {
    width: 100%;
    min-height: 100dvh;
    padding: max(18px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) calc(42px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }
  .topbar { align-items: center; gap: 10px; }
  .topbar-brand { flex: 1; min-width: 0; }
  .topbar h2 { font-size: clamp(20px, 6vw, 25px); }
  .topbar-actions { width: auto; max-width: 100%; margin-left: auto; }
  .topbar-actions .button { min-height: 38px; padding-inline: 10px; font-size: 10px; }
  .user-chip { min-height: 42px; }
  .user-chip img { width: 30px; height: 30px; flex-basis: 30px; }
  .section-head { gap: 10px; }
  .section-head h3 { font-size: 19px; }
  .grid-layout-button { min-height: 32px; padding-inline: 8px; }
  .slot-grid { gap: 14px; }
  .slot-card { width: 100%; max-width: 520px; margin-inline: auto; }
  .slot-expiry-corner { left: 12px; }
  .pricing-card { width: 100%; }
  .pricing-table { width: 100%; overflow-x: auto; }
  .pricing-table > div:first-child,
  .pricing-table > div > div { min-width: 270px; }
  .contact-card { flex-wrap: wrap; }
  .contact-links { width: 100%; margin-left: 0; }
  .contact-link { flex: 1; justify-content: center; }
  .detail-panel {
    width: 100%;
    max-width: none;
    max-height: 88dvh;
    padding-inline: max(12px, env(safe-area-inset-left));
  }
  .account-row { grid-template-columns: 1fr; }
  .config-inline-row { grid-template-columns: minmax(0, 1fr) auto; }
  .config-action-grid { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .password-backdrop, .forgot-backdrop { padding: 10px; }
  .password-modal, .forgot-modal { max-height: calc(100dvh - 20px); overflow-y: auto; }
}

@media (max-width: 480px) {
  .login-card { width: 100%; padding: 24px 18px calc(22px + env(safe-area-inset-bottom)); }
  .auth-heading h2 { font-size: 23px; }
  .topbar-actions { width: 100%; margin-left: 0; }
  .topbar-actions .user-menu-wrap { flex: 1; }
  .topbar-actions .user-chip { width: 100%; }
  .summary-grid { gap: 8px; margin: 17px 0 24px; }
  .summary-card { min-height: 78px; padding: 11px; }
  .summary-card span { font-size: 10px; }
  .summary-card strong { font-size: 24px; }
  .pricing-card { grid-template-columns: 42px minmax(0, 1fr); padding: 14px 12px; }
  .pricing-mark { width: 40px; height: 40px; }
  .pricing-mark img { width: 27px; height: 27px; }
  .pricing-copy h3 { font-size: 18px; }
  .slot-card { padding: 13px 12px; }
  .slot-number-badge { width: 34px; height: 34px; flex-basis: 34px; font-size: 14px; }
  .slot-identity > div { max-width: min(150px, 46vw); }
  .slot-tagname { font-size: 11px; }
  .slot-runtime { padding-inline: 7px; }
  .slot-runtime-line { gap: 5px; }
  .slot-stats { padding-inline: 5px; }
  .slot-stats > .match-stat, .slot-stats > .gift-overview { padding-inline: 7px; }
  .material-strip { gap: 5px; }
  .material-chip { padding: 5px 4px; }
  .material-chip img { width: 22px; height: 22px; flex-basis: 22px; }
  .material-chip b, .material-chip small { font-size: 9px; }
  .reset-email-row { grid-template-columns: 1fr; }
  .reset-email-row .button { width: 100%; margin-top: 0; }
  .password-modal footer, .forgot-modal footer { grid-template-columns: 1fr; }
}

@media (max-width: 340px) {
  main { padding-inline: 8px; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary-card:nth-child(3), .material-summary { grid-column: auto; }
  .material-summary > div > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-head { align-items: flex-start; }
  .grid-layout-button span { display: none; }
  .slot-runtime-line { gap: 3px; }
  .slot-runtime-line span { font-size: 7px; }
  .slot-runtime-line b { font-size: 8px; }
  .config-inline-row { grid-template-columns: 1fr; align-items: stretch; }
  .config-inline-row .switch { justify-content: space-between; }
  .material-editor { grid-template-columns: 1fr; }
  .config-action-grid { grid-template-columns: 1fr 1fr; }
}

@media (orientation: landscape) and (max-height: 520px) and (max-width: 900px) {
  main { padding-top: 12px; }
  .detail-panel { height: 96dvh; max-height: 96dvh; }
  .compact-slot-log { min-height: 70px; max-height: 100px; }
}

@media (max-width: 760px) {
  body.detail-open { overflow: hidden; }
  .backdrop { overscroll-behavior: none; }
  .detail-panel {
    top: auto;
    right: 8px;
    bottom: 0;
    width: calc(100% - 16px);
    height: min(86dvh, 680px);
    max-height: calc(100dvh - 8px);
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
    border: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
    translate: 0 calc(100% + 16px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .detail-panel.open { translate: 0 0; }
  .detail-panel > header {
    position: sticky;
    z-index: 4;
    top: -12px;
    margin: -1px 0 0;
    padding: 1px 0 7px;
    background: var(--card);
  }
  .detail-panel .icon-button {
    width: 34px;
    height: 34px;
    min-height: 34px;
  }
  .detail-tabs {
    margin: 7px 0 9px;
    padding: 3px;
  }
  .detail-tabs .tab {
    min-height: 31px;
    padding: 5px;
    font-size: 10px;
  }
  .detail-panel form,
  .detail-panel .tab-pane { min-width: 0; }
  .detail-panel input,
  .detail-panel select { min-width: 0; }
  .compact-slot-log {
    width: 100%;
    min-height: 100px;
    max-height: 150px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
  }
  .config-action-grid {
    z-index: 5;
    bottom: calc(-12px - env(safe-area-inset-bottom));
    margin: 10px -12px calc(-12px - env(safe-area-inset-bottom));
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    background: var(--card);
    backdrop-filter: none;
  }
  .config-action-grid .button {
    min-height: 34px;
    font-size: 9px;
  }
  .inventory-grid { width: 100%; }
}

@media (max-width: 380px) {
  .detail-panel {
    right: 4px;
    width: calc(100% - 8px);
    height: min(90dvh, 680px);
    padding-inline: 10px;
  }
  .config-action-grid {
    margin-inline: -10px;
    padding-inline: 10px;
  }
}

@media (orientation: landscape) and (max-height: 520px) and (max-width: 900px) {
  .detail-panel {
    right: 6px;
    bottom: 4px;
    width: min(430px, calc(100% - 12px));
    height: calc(100dvh - 8px);
    max-height: calc(100dvh - 8px);
    border-radius: 16px;
  }
}

.admin-icon { display: none; }

@media (max-width: 760px) {
  .topbar {
    flex-wrap: nowrap;
    align-items: center;
  }
  .topbar-brand {
    flex: 0 0 auto;
  }
  .topbar-brand > div {
    display: none;
  }
  .brand-mark {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
  }
  .topbar-actions {
    width: auto;
    max-width: none;
    display: flex;
    flex: 0 0 auto;
    gap: 7px;
    margin-left: auto;
  }
  .topbar-actions .button-admin {
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 11px;
  }
  .admin-icon {
    display: block;
    font-size: 17px;
    line-height: 1;
  }
  .admin-label {
    display: none;
  }
  .topbar-actions .user-menu-wrap {
    flex: 0 0 auto;
  }
  .topbar-actions .user-chip {
    width: 40px;
    height: 40px;
    min-height: 40px;
    gap: 0;
    padding: 4px;
    border-radius: 11px;
  }
  .topbar-actions .user-chip img {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
  }
  .topbar-actions .user-chip > span,
  .topbar-actions .menu-chevron {
    display: none;
  }
  .user-menu {
    right: 0;
    left: auto;
    width: min(275px, calc(100vw - 24px));
  }
}

.detail-panel > header {
  align-items: center;
}
.detail-heading {
  flex: 0 0 auto;
}
.detail-panel > header .detail-tabs {
  flex: 1;
  min-width: 0;
  max-width: 230px;
  margin: 0 auto;
}
.detail-panel .account-row label:first-child input,
.detail-panel .account-row label:last-child input {
  margin-top: 3px;
}
.config-action-grid .button,
.config-action-grid .run,
.config-action-grid .stop,
.config-action-grid .button-primary,
.config-action-grid .button-subtle {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #eceae2;
  box-shadow: none;
}
.config-action-grid .button:hover {
  color: var(--ink);
  background: #dfddd4;
  box-shadow: none;
  transform: none;
}
.pricing-card::after {
  display: none;
}
.contact-links {
  width: 100%;
  max-width: 220px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.contact-link {
  width: 100%;
  min-width: 0;
  justify-content: center;
  padding-inline: 8px;
}
.toast {
  z-index: 160;
}
.detail-panel > header {
  margin-bottom: 8px;
}
@media (max-width: 760px) {
  .detail-panel > header {
    margin: -1px 0 8px;
  }
}

/* Forgot-password dialog follows the same compact visual language as login. */
.forgot-backdrop {
  padding: 12px;
  background: rgba(8, 28, 23, .42);
  backdrop-filter: none;
}
.forgot-modal {
  width: min(360px, 100%);
  max-height: calc(100dvh - 24px);
  border: 0;
  border-radius: 16px;
  color: #fff;
  background: rgba(25, 67, 56, .97);
  box-shadow: none;
}
.forgot-modal > header {
  align-items: center;
  padding: 17px 18px 8px;
  background: transparent;
}
.forgot-modal > header .eyebrow { color: var(--lime); }
.forgot-modal h3 { margin-top: 3px; font-size: 21px; }
.forgot-modal .icon-button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: rgba(255,255,255,.09);
}
.forgot-modal form { gap: 8px; padding: 10px 18px 18px; }
.forgot-modal label { color: #e1ece7; font-size: 11px; }
.forgot-modal input {
  height: 42px;
  margin-top: 5px;
  border: 1px solid rgba(225,239,232,.24);
  border-radius: 9px;
  color: #fff;
  background: rgba(255,255,255,.09);
  box-shadow: none;
  font-size: 13px;
}
.forgot-modal input::placeholder { color: #a9beb6; }
.forgot-modal input:focus { border-color: var(--lime); box-shadow: none; }
.reset-email-row { grid-template-columns: minmax(0,1fr) 82px; gap: 7px; }
.reset-email-row .button {
  width: auto;
  height: 42px;
  min-height: 42px;
  margin-top: 5px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: rgba(255,255,255,.13);
  box-shadow: none;
}
.reset-note { margin: 0 0 2px; color: #aec1ba; font-size: 9px; }
.forgot-modal footer {
  grid-template-columns: .8fr 1.35fr;
  gap: 7px;
  margin-top: 3px;
}
.forgot-modal footer .button {
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  box-shadow: none;
  font-size: 12px;
}
.forgot-modal footer .button-subtle { color: #fff; background: rgba(255,255,255,.1); }
.forgot-modal footer .button-primary { background: var(--orange); }

@media (max-width: 380px) {
  .forgot-backdrop { padding: 8px; }
  .forgot-modal { width: min(340px, 100%); border-radius: 14px; }
  .forgot-modal > header { padding: 14px 14px 6px; }
  .forgot-modal h3 { font-size: 19px; }
  .forgot-modal form { padding: 8px 14px 14px; }
  .reset-email-row { grid-template-columns: minmax(0,1fr) 76px; }
}

/* Compact, flat login panel that scales cleanly without decorative shadows. */
.login-view::before { display: none; }
.login-card {
  width: min(360px, calc(100% - 28px));
  padding: 22px;
  border: 0;
  border-radius: 16px;
  background: rgba(25, 67, 56, .94);
  box-shadow: none;
  backdrop-filter: none;
}
.login-card::before { display: none; }
.auth-heading { gap: 10px; margin-bottom: 18px; }
.auth-logo {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  padding: 4px;
  border: 0;
  border-radius: 10px;
  background: #346f5d;
  box-shadow: none;
  transform: none;
}
.auth-logo img { filter: none; }
.auth-heading h2 { font-size: 24px; }
.auth-form { gap: 12px; }
.auth-form input {
  height: 46px;
  margin-top: 6px;
  border: 1px solid rgba(225,239,232,.24);
  border-radius: 10px;
  background-color: rgba(255,255,255,.09);
  box-shadow: none;
}
.auth-form input:focus {
  border-color: var(--lime);
  box-shadow: none;
}
.auth-form .button {
  min-height: 46px;
  border-radius: 10px;
  box-shadow: none;
}
.auth-form .button:hover,
.auth-form .button:active { box-shadow: none; }
.auth-secondary { margin-top: 13px; padding-top: 12px; }

@media (max-width: 760px) {
  .login-view { grid-template-columns: 1fr; }
  .login-card {
    width: min(360px, calc(100% - 24px));
    margin: 0 auto max(12px, env(safe-area-inset-bottom));
    padding: 20px 18px;
    border-radius: 14px;
    background: rgba(25, 67, 56, .96);
  }
  .auth-heading h2 { font-size: 22px; }
  .auth-form input, .auth-form .button { height: 44px; min-height: 44px; }
}
@media (max-width: 380px) {
  .login-card { width: calc(100% - 16px); padding: 18px 15px; }
  .auth-heading h2 { font-size: 20px; }
  .auth-kicker { font-size: 10px; }
  .auth-form label { font-size: 12px; }
  .auth-form input { font-size: 14px; }
}

.slot-stats {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.slot-metric-chip {
  min-width: 0;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  padding: 6px 8px;
  border: 1px solid #e3e1d7;
  border-radius: 9px;
  background: #f2f1e9;
}
.slot-metric-chip img {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  object-fit: contain;
  image-rendering: pixelated;
}
.slot-metric-chip b {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 480px) {
  .slot-stats { gap: 5px; }
  .slot-metric-chip { min-height: 38px; gap: 5px; padding: 5px; }
  .slot-metric-chip img { width: 22px; height: 22px; flex-basis: 22px; }
  .slot-metric-chip b { font-size: 12px; }
}

@media (max-width: 760px) {
  .detail-panel > header {
    gap: 7px;
  }
  .detail-heading .eyebrow {
    display: none;
  }
  .detail-panel h3.detail-slot-number {
    width: 34px;
    height: 34px;
    margin: 0;
    font-size: 14px;
  }
  .detail-panel > header .detail-tabs {
    max-width: none;
    margin: 0;
  }
  .detail-panel > header .detail-tabs .tab {
    min-height: 32px;
  }
}

/* Final authentication palette override. */
.login-card,
.forgot-modal {
  color: #2e3027;
  background: rgba(246, 232, 184, .97);
}
.auth-logo { background: #e2c66e; }
.auth-kicker,
.forgot-modal > header .eyebrow { color: #9b5a20; }
.auth-heading h2,
.forgot-modal h3 { color: #2e3027; }
.auth-form label,
.forgot-modal label { color: #4b4b3c; }
.auth-form input,
.forgot-modal input {
  border-color: rgba(70,74,57,.24);
  color: #292c25;
  background-color: rgba(255,255,255,.52);
}
.auth-form input::placeholder,
.forgot-modal input::placeholder { color: #77725f; }
.auth-form input:focus,
.forgot-modal input:focus { border-color: #b87935; }
.forgot-modal .icon-button,
.reset-email-row .button,
.forgot-modal footer .button-subtle {
  color: #39392e;
  background: rgba(255,255,255,.44);
}
.reset-note { color: #686756; }

@media (max-width: 760px) {
  .login-card { background: rgba(246, 232, 184, .98); }
}

/* Readable typography for the warm authentication palette. */
.auth-heading h2,
.forgot-modal h3 { color: #3b372b; }
.auth-kicker,
.forgot-modal > header .eyebrow { color: #9a5425; }
.auth-form label,
.forgot-modal label { color: #514c3c; }
.auth-form input,
.forgot-modal input { color: #34342b; }
.auth-form input::placeholder,
.forgot-modal input::placeholder { color: #716c58; }
.forgot-password {
  color: #8d4b22;
}
.forgot-password:hover {
  color: #663516;
}
.auth-secondary {
  border-top-color: rgba(69,64,48,.17);
  color: #615d4c;
}
.auth-switch {
  color: #945020;
}
.auth-switch:hover {
  color: #673713;
}
.login-hint {
  color: #696552 !important;
}
.login-hint::before {
  background: #b96b2e;
  box-shadow: none;
}

/* Game-inspired product wordmark for the main header. */
.topbar-brand { gap: 11px; }
.topbar-brand > .product-wordmark { display: grid; gap: 5px; }
.topbar-brand .eyebrow {
  padding-left: 3px;
  color: #a95328;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .24em;
  line-height: 1;
}
.topbar h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 4px 11px 4px 9px;
  border: 1px solid rgba(190, 91, 43, .62);
  border-radius: 9px 4px 9px 4px;
  background: rgba(255, 253, 247, .48);
  line-height: 1;
}
.topbar h2 .wordmark-up {
  padding-right: 8px;
  border-right: 1px solid rgba(190, 91, 43, .34);
  color: #c45c2b;
  font-size: clamp(20px, 1.8vw, 24px);
  font-weight: 850;
  letter-spacing: .025em;
}
.topbar h2 .wordmark-material {
  color: #183d34;
  font-size: clamp(20px, 1.8vw, 24px);
  font-weight: 850;
  letter-spacing: .025em;
  white-space: nowrap;
}
.topbar h2 .wordmark-subdomain,
.topbar h2 .wordmark-domain {
  overflow: hidden;
  font-family: var(--font-display);
  font-weight: 850;
  line-height: 1.05;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.topbar h2#siteDomainWordmark { gap: 0; }
.topbar h2 .wordmark-subdomain {
  max-width: 22vw;
  color: #c45c2b;
  font-size: clamp(17px, 1.55vw, 22px);
  letter-spacing: .07em;
}
.topbar h2 .wordmark-domain {
  max-width: min(38vw, 420px);
  color: #183d34;
  font-size: clamp(17px, 1.65vw, 23px);
  letter-spacing: .035em;
}
@media (max-width: 760px) {
  .topbar-brand { gap: 7px; }
  .topbar-brand > .product-wordmark { display: grid; gap: 0; }
  .topbar-brand .eyebrow { display: none; }
  .topbar h2 {
    min-height: 29px;
    gap: 5px;
    padding: 3px 7px 3px 6px;
    border-radius: 7px 3px 7px 3px;
  }
  .topbar h2 .wordmark-up {
    padding-right: 5px;
    font-size: 11px;
  }
  .topbar h2 .wordmark-material {
    font-size: 11px;
    letter-spacing: .01em;
  }
  .topbar h2 .wordmark-subdomain {
    max-width: 22vw;
    font-size: 10px;
    letter-spacing: .04em;
  }
  .topbar h2 .wordmark-domain {
    max-width: 37vw;
    font-size: 10px;
    letter-spacing: .02em;
  }
}
@media (max-width: 360px) {
  .topbar h2 { padding-inline: 5px; }
  .topbar h2 .wordmark-up,
  .topbar h2 .wordmark-material { font-size: 10px; }
}

.config-action-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 520px) {
  .config-action-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Unified account controls in the main header. */
.topbar-actions { gap: 8px; }
.topbar-actions .button-admin {
  height: 48px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px 0 8px;
  border: 1px solid #d3d0c3;
  border-radius: 12px;
  color: #183d34;
  background: rgba(255,253,247,.68);
  box-shadow: none;
}
.topbar-actions .button-admin:hover {
  border-color: #bdbdaf;
  background: rgba(255,253,247,.94);
  box-shadow: none;
  transform: none;
}
.admin-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: #183d34;
  font-size: 14px;
  line-height: 1;
}
.admin-label { font-size: 13px; font-weight: 850; }
.topbar-actions .user-chip {
  height: 48px;
  min-height: 48px;
  gap: 9px;
  padding: 4px 9px 4px 4px;
  border: 1px solid #d3d0c3;
  border-radius: 12px;
  background: rgba(255,253,247,.68);
  box-shadow: none;
}
.topbar-actions .user-chip:hover,
.topbar-actions .user-chip[aria-expanded="true"] {
  border-color: #bdbdaf;
  background: rgba(255,253,247,.94);
}
.topbar-actions .user-chip img {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
  border-radius: 10px;
}
.topbar-actions .user-chip b {
  max-width: 220px;
  color: #29342f;
  font-size: 13px;
}
.topbar-actions .user-chip small {
  margin-top: 2px;
  color: #6b746f;
  font-size: 9px;
}
.topbar-actions .menu-chevron {
  margin-left: 2px;
  color: #66716b;
  font-size: 13px;
}

@media (max-width: 760px) {
  .topbar-actions .button-admin {
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 4px;
    border-radius: 10px;
  }
  .topbar-actions .button-admin .admin-icon {
    width: 30px;
    height: 30px;
    border-radius: 7px;
  }
  .topbar-actions .button-admin .admin-label { display: none; }
  .topbar-actions .user-chip {
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 4px;
    border-radius: 10px;
  }
  .topbar-actions .user-chip img {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    border-radius: 7px;
  }
}

/* Denser pricing panel with the table as the visual focus. */
.pricing-card {
  min-height: 0;
  grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin: 20px 0 26px;
  padding: 14px 18px;
  border-radius: 14px;
}
.pricing-mark {
  width: 52px;
  height: 52px;
  border-radius: 13px 6px 13px 6px;
}
.pricing-mark img { width: 34px; height: 34px; }
.pricing-copy h3 {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.1;
}
.pricing-table > div:first-child {
  padding: 7px 10px;
  color: #55432d;
  background: #ead9ad;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .01em;
}
.pricing-table > div:last-child > div {
  padding: 7px 9px;
  font-size: 12px;
}
.contact-card { padding: 8px 0 8px 16px; }
.contact-card strong {
  margin: 0 0 8px;
  font-size: 14px;
}
.contact-links { gap: 7px; }
.contact-link {
  min-height: 32px;
  padding-inline: 9px;
  font-size: 10px;
}
.contact-link img { width: 18px; height: 18px; flex-basis: 18px; }

@media (max-width: 760px) {
  .pricing-card {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    margin: 16px 0 22px;
    padding: 12px;
  }
  .pricing-mark { width: 40px; height: 40px; }
  .pricing-mark img { width: 27px; height: 27px; }
  .pricing-copy h3 { font-size: 14px; }
  .pricing-table > div:first-child {
    padding: 7px 8px;
    font-size: 10px;
  }
  .contact-card {
    grid-column: 1 / -1;
    padding: 10px 0 0;
  }
}

/* Compact account menu with supplied action icons. */
.user-menu {
  width: 220px;
  padding: 6px;
  border-radius: 12px;
}
.user-menu button {
  min-height: 43px;
  gap: 9px;
  padding: 6px 8px;
}
.user-menu button > span {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  border-radius: 8px;
}
.user-menu button > span img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  opacity: .78;
}
.user-menu button b {
  font-size: 12px;
  line-height: 1;
}
.user-menu .menu-danger > span img { opacity: .68; }

@media (max-width: 760px) {
  .user-menu {
    width: min(220px, calc(100vw - 24px));
  }
}

/* Balanced password dialog matching the warm authentication forms. */
.password-backdrop {
  padding: 12px;
  background: rgba(8,28,23,.42);
  backdrop-filter: none;
}
.password-modal {
  width: min(360px, 100%);
  border: 0;
  border-radius: 16px;
  color: #2e3027;
  background: rgba(246,232,184,.98);
  box-shadow: none;
}
.password-modal > header {
  align-items: center;
  padding: 17px 18px 8px;
  color: #2e3027;
  background: transparent;
}
.password-modal > header .eyebrow {
  color: #9a5425;
  font-size: 9px;
}
.password-modal h3 {
  margin-top: 3px;
  color: #3b372b;
  font-size: 21px;
}
.password-modal .icon-button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  border: 0;
  border-radius: 9px;
  color: #39392e;
  background: rgba(255,255,255,.44);
}
.password-modal form {
  gap: 8px;
  padding: 10px 18px 18px;
}
.password-modal label {
  color: #514c3c;
  font-size: 11px;
}
.password-modal input {
  height: 42px;
  margin-top: 5px;
  border: 1px solid rgba(70,74,57,.24);
  border-radius: 9px;
  color: #34342b;
  background: rgba(255,255,255,.52);
  box-shadow: none;
  font-size: 13px;
}
.password-modal input::placeholder { color: #716c58; }
.password-modal input:focus {
  border-color: #b87935;
  box-shadow: none;
}
.password-modal footer {
  grid-template-columns: .8fr 1.35fr;
  gap: 7px;
  margin-top: 3px;
}
.password-modal footer .button {
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  box-shadow: none;
  font-size: 12px;
}
.password-modal footer .button-subtle {
  color: #39392e;
  background: rgba(255,255,255,.44);
}
.password-modal footer .button-primary { background: var(--orange); }

@media (max-width: 380px) {
  .password-backdrop { padding: 8px; }
  .password-modal { width: min(340px, 100%); border-radius: 14px; }
  .password-modal > header { padding: 14px 14px 6px; }
  .password-modal h3 { font-size: 19px; }
  .password-modal form { padding: 8px 14px 14px; }
  .password-modal footer { grid-template-columns: .8fr 1.35fr; }
}

.user-notice {
  margin: 9px 0 0;
  padding: 7px 9px;
  border-left: 3px solid #c89235;
  border-radius: 5px;
  color: #514429;
  background: rgba(255, 246, 218, .88);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.user-notice strong { font-weight: 900; }
.user-notice em { font-style: italic; }
.user-notice u { text-underline-offset: 2px; }
.user-notice a { color: #176aa3; font-weight: 850; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }

.gem-tool-card {
  position: relative;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(145deg, #fffefb, #faf9f2);
  box-shadow: 0 7px 20px rgba(34,49,43,.045);
}
.gem-tool-card:hover { border-color: #bfc2b4; box-shadow: var(--shadow); }
.gem-tool-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.gem-tool-title { min-width: 0; display: flex; align-items: center; gap: 10px; }
.gem-tool-title > img { width: 32px; height: 32px; flex: 0 0 32px; object-fit: contain; image-rendering: pixelated; }
.gem-tool-title > div { min-width: 0; }
.gem-tool-title span { display: block; color: #8b612d; font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.gem-tool-title h3 { margin: 3px 0 1px; overflow: hidden; color: var(--ink); font-size: 14px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.gem-tool-title p { margin: 0; overflow: hidden; color: #596860; font-size: 9px; font-weight: 650; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.gem-head-actions { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.gem-head-actions b { max-width: 105px; overflow: hidden; padding: 5px 7px; border-radius: 999px; color: #796e61; background: #eee9df; font-size: 8px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.gem-head-actions b.ready { color: #315f47; background: #e1efdf; }
.gem-card-login { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 14px; padding: 10px; border: 1px solid #e4e1d7; border-radius: 10px; background: #f2f1e9; }
.gem-card-login input,.gem-card-login select { min-width: 0; height: 34px; margin: 0; border-radius: 8px; padding-inline: 9px; font-size: 9px; }
.gem-card-login button { min-height: 34px; border: 0; border-radius: 8px; color: #fff; background: var(--orange); font-size: 9px; font-weight: 850; }
.gem-card-account { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; padding: 9px 10px; border: 1px solid #e4e1d7; border-radius: 10px; background: #f2f1e9; }
.gem-card-account[role="button"] { cursor: pointer; }.gem-card-account[role="button"]:hover { border-color: #bdc7b9; background: #edf1e8; }.gem-card-account[role="button"]:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.gem-card-account > div { min-width: 0; }.gem-card-account b,.gem-card-account span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.gem-card-account b { color: var(--ink); font-size: 12px; }.gem-card-account span { margin-top: 2px; color: #765713; font-size: 9px; font-weight: 750; }.gem-card-account small { flex: 0 0 auto; color: #53635b; font-size: 8px; font-weight: 800; }
.gem-type-summary { display: none; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 5px; margin-top: 13px; padding-top: 12px; border-top: 1px solid #e7e4d9; }
.gem-type-summary span { min-width: 0; min-height: 30px; grid-column: span 2; display: flex; align-items: center; justify-content: center; padding: 5px 3px; border: 1px solid #e4e6dc; border-radius: 8px; background: #f0f2eb; }
.gem-type-summary span:nth-child(4) { grid-column: 2 / span 2; }
.gem-type-summary span:nth-child(5) { grid-column: 4 / span 2; }
.gem-type-summary img { width: 16px; height: 16px; flex: 0 0 16px; object-fit: contain; image-rendering: pixelated; }
.gem-card-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 10px; }.gem-card-actions button { flex: 1; min-height: 32px; border: 0; border-radius: 7px; padding: 0 9px; color: #fff; background: var(--orange); font-size: 10px; font-weight: 850; line-height: 1; }.gem-card-actions button:hover { background: #d95624; }
.gem-modal-backdrop { position: fixed; z-index: 115; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(12,28,23,.36); }
.gem-tool-modal { width: min(820px,100%); max-height: calc(100dvh - 36px); overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--card); box-shadow: 0 28px 75px rgba(8,25,20,.28); }
.gem-mobile-account { display: none; }
.gem-tool-modal > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 17px; border-bottom: 1px solid var(--line); background: #f0eee5; }.gem-tool-modal > header span { color: #8b612d; font-size: 7px; font-weight: 900; letter-spacing: .12em; }.gem-tool-modal > header h3 { margin: 2px 0 0; color: var(--ink); font-size: 18px; }.gem-tool-modal > header .icon-button { width: 32px; height: 32px; font-size: 19px; }
.gem-tool-body { max-height: calc(100dvh - 105px); overflow-y: auto; padding: 15px 17px 17px; }
.gem-workspace { display: grid; gap: 10px; }
.gem-account-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: #f1efe6; }
.gem-account-bar b, .gem-account-bar span { display: block; }
.gem-account-bar b { font-size: 11px; }.gem-account-bar span { margin-top: 2px; color: var(--muted); font-size: 8px; }
.gem-account-bar > div:last-child { display: flex; gap: 6px; }
.gem-account-bar button { min-height: 30px; border: 1px solid var(--line); border-radius: 7px; padding: 0 9px; color: var(--ink); background: #fff; font-size: 8px; font-weight: 800; }
.utility-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #e8e7dd; }
.utility-tabs button { min-height: 32px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 9px; font-weight: 850; }.utility-tabs button.active { color: #fff; background: var(--forest); box-shadow: 0 3px 8px rgba(19,53,46,.16); }
.utility-pane[hidden] { display: none !important; }
.gem-selection-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }.gem-selection-head > div:first-child b,.gem-selection-head > div:first-child span { display: block; }.gem-selection-head > div:first-child b { color: var(--ink); font-size: 12px; }.gem-selection-head > div:first-child span { margin-top: 2px; color: var(--muted); font-size: 8px; }
#gemSelectedInfo { min-height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
#gemSelectedInfo b { font-size: 10px; } #gemSelectedInfo span { color: var(--muted); font-size: 9px; }
.gem-inventory { display: grid; grid-template-columns: repeat(10,minmax(0,1fr)); gap: 5px; }
.gem-inventory > p { grid-column: 1/-1; margin: 0; padding: 18px; color: var(--muted); text-align: center; font-size: 9px; }
.gem-item { min-width: 0; min-height: 67px; display: grid; place-items: center; gap: 2px; padding: 5px 3px; border: 1px solid #dedbd0; border-radius: 8px; color: var(--ink); background: #f5f2e9; }
.gem-item img { width: 16px; height: 16px; display: block; object-fit: contain; image-rendering: pixelated; }
.gem-item span { overflow: hidden; color: var(--muted); font-size: 7px; white-space: nowrap; }.gem-item b { font-size: 10px; font-variant-numeric: tabular-nums; }
.gem-item.empty { opacity: .46; filter: grayscale(.35); }
.gem-item.selected { border-color: #d76b32; background: #fff1e5; box-shadow: inset 0 0 0 1px #d76b32; }
.gem-actions-backdrop,.gem-actions-dialog { display: contents; }
.gem-actions-head { display: none; }
.gem-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 9px; }
.gem-actions section { display: grid; grid-template-columns: minmax(0,1fr) 125px auto 100px; align-items: end; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #f4f2ea; }.gem-actions section > div b,.gem-actions section > div span { display: block; }.gem-actions section > div b { color: var(--ink); font-size: 11px; }.gem-actions section > div span { margin-top: 2px; color: var(--muted); font-size: 7px; }.gem-actions label { color: var(--muted); font-size: 8px; font-weight: 800; }.gem-actions input[type="number"] { height: 32px; margin-top: 3px; font-size: 10px; }.gem-actions .gem-all-check { height: 32px; display: flex; align-items: center; gap: 5px; color: var(--ink); white-space: nowrap; }.gem-actions .gem-all-check input { width: 15px; height: 15px; margin: 0; }.gem-actions button { min-height: 32px; border: 0; border-radius: 7px; color: #fff; background: var(--forest); font-size: 8px; font-weight: 850; }.gem-actions section + section button { background: #b85431; }.gem-actions button:disabled, .gem-account-bar button:disabled { opacity: .42; cursor: default; }
.gem-log-wrap { margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.equipment-fix-wrap { margin-top: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #f4f2ea; }
.equipment-fix-wrap > header,.equipment-fix-wrap > footer { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.equipment-fix-wrap > header b,.equipment-fix-wrap > header span { display: block; }.equipment-fix-wrap > header b { color: var(--ink); font-size: 11px; }.equipment-fix-wrap > header span { margin-top: 2px; color: var(--muted); font-size: 7px; }.equipment-fix-wrap > header strong { flex: 0 0 auto; color: #56752d; font-size: 9px; }
.equipment-fix-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(43px,1fr)); gap: 4px; max-height: 190px; overflow: auto; margin-top: 8px; padding: 1px; }
.equipment-fix-grid > p { grid-column: 1/-1; margin: 0; padding: 14px; color: var(--muted); text-align: center; font-size: 8px; }
.equipment-fix-item { position: relative; width: 100%; min-width: 0; min-height: 0; aspect-ratio: 1; display: grid; place-items: center; padding: 3px; border: 1px solid #d6d5ca; border-radius: 6px; color: var(--ink); background: linear-gradient(145deg,#fffef8,#eae9df); box-shadow: inset 0 0 0 1px rgba(255,255,255,.55); }.equipment-fix-item .game-equip-icon { width: 22px; height: 22px; background-size: 22px auto; }.equipment-fix-item > .inventory-level { top: auto; right: 2px; bottom: 2px; }.equipment-fix-item.quick { border-color: #d9b27b; background: #fff8eb; }.equipment-fix-item.selected { border-color: #d76b32; box-shadow: inset 0 0 0 1px #d76b32; background: #fff1e5; }.equipment-fix-item.equipped { opacity: .48; cursor: not-allowed; }
.equipment-fix-wrap > footer { margin-top: 8px; }.equipment-fix-wrap > footer > span { color: var(--muted); font-size: 8px; }.equipment-fix-wrap > footer > div { display: flex; gap: 5px; }.equipment-fix-wrap > footer button { min-height: 28px; border: 1px solid var(--line); border-radius: 7px; padding: 0 8px; color: var(--ink); background: #fff; font-size: 8px; font-weight: 850; }.equipment-fix-wrap footer button:last-child { color: #fff; border-color: var(--forest); background: var(--forest); }.equipment-fix-wrap button:disabled { opacity: .42; cursor: default; }
.gem-log-wrap h4 { margin: 0; padding: 8px 10px; color: var(--muted); font-size: 8px; font-weight: 800; }
.gem-log-wrap pre { max-height: 150px; overflow: auto; margin: 0; padding: 9px 10px; border-top: 1px solid var(--line); color: #bce4c3; background: #10251f; font: 9px/1.45 Consolas, monospace; white-space: pre-wrap; }
.gem-confirm-backdrop { position: fixed; z-index: 125; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(12,28,23,.5); }.gem-confirm-dialog { width: min(340px,100%); padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--card); box-shadow: 0 25px 70px rgba(8,25,20,.32); text-align: center; }.gem-confirm-dialog > img { width: 28px; height: 28px; object-fit: contain; image-rendering: pixelated; }.gem-confirm-dialog h3 { margin: 5px 0 6px; color: var(--ink); font-size: 16px; }.gem-confirm-dialog p { min-height: 0; margin: 0; color: var(--ink); font-size: 12px; line-height: 1.45; }.gem-confirm-dialog p b { color: #111a16; }.gem-confirm-progress { margin-top: 13px; }.gem-confirm-progress i { height: 7px; display: block; overflow: hidden; border-radius: 999px; background: #e2e1d8; }.gem-confirm-progress i b { width: 0; height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg,#d86e3b,#ef9a50); transition: width .3s ease; }.gem-confirm-progress span { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; font-weight: 750; }.gem-confirm-dialog > #gemConfirmActions { display: grid; grid-template-columns: 1fr 1.3fr; gap: 8px; margin-top: 12px; }.gem-confirm-dialog > #gemConfirmActions.result { grid-template-columns: 1fr; }.gem-confirm-dialog button { min-height: 36px; border: 0; border-radius: 8px; color: var(--ink); background: #e9e7de; font-size: 10px; font-weight: 850; }.gem-confirm-dialog button + button { color: #fff; background: var(--orange); }.gem-confirm-dialog button:disabled { opacity: .5; }

@media (min-width: 761px) {
  .gem-tool-modal > header {
    gap: 7px;
    padding: 10px 12px;
  }
  .gem-tool-modal > header .gem-modal-title,
  .gem-tool-modal .gem-account-bar {
    display: none;
  }
  .gem-mobile-account {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .gem-mobile-account > div {
    min-width: 0;
    flex: 1;
  }
  .gem-mobile-account b,
  .gem-mobile-account span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .gem-mobile-account b {
    color: var(--ink);
    font-size: 12px;
  }
  .gem-mobile-account span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 8px;
  }
  .gem-mobile-account > button {
    min-height: 30px;
    flex: 0 0 auto;
    border: 1px solid #d9d8ce;
    border-radius: 7px;
    padding-inline: 9px;
    color: #355344;
    background: rgba(255,255,255,.82);
    font-size: 8px;
    font-weight: 850;
  }
  .gem-mobile-account > #gemMobileRefresh {
    width: 30px;
    padding: 0;
    font-size: 15px;
  }
  .gem-mobile-account > button:disabled {
    opacity: .45;
  }
  .gem-tool-modal > header .icon-button {
    width: 32px;
    height: 32px;
    min-height: 32px;
    flex: 0 0 32px;
  }
  .gem-tool-body {
    max-height: calc(100dvh - 89px);
    padding: 10px 12px 12px;
  }
  .gem-workspace {
    gap: 7px;
  }
  #gemSelectedInfo {
    min-height: 30px;
  }
  .gem-inventory {
    gap: 4px;
  }
  .gem-item {
    min-height: 52px;
    gap: 1px;
    padding: 4px 2px;
    border-radius: 7px;
  }
  .gem-item img {
    width: 12px;
    height: 12px;
  }
  .gem-item span {
    font-size: 6px;
  }
  .gem-item b {
    font-size: 8px;
  }
  .gem-actions {
    gap: 6px;
    margin-top: 6px;
  }
  .gem-actions section {
    grid-template-columns: minmax(0,1fr) 112px auto 88px;
    gap: 6px;
    padding: 7px;
    border-radius: 8px;
  }
  .gem-actions input[type="number"],
  .gem-actions .gem-all-check,
  .gem-actions button {
    height: 28px;
    min-height: 28px;
  }
  .gem-log-wrap {
    margin-top: 5px;
  }
  .gem-log-wrap h4 {
    padding: 6px 8px;
  }
  .gem-log-wrap pre {
    max-height: 105px;
    padding: 7px 8px;
    font-size: 8px;
  }
}

@media (max-width: 760px) {
  .gem-tool-card { width: 100%; max-width: 520px; margin-inline: auto; padding: 15px; }
  .gem-tool-title p { display: none; }
  .gem-modal-backdrop { align-items: end; padding: 0; background: rgba(12,28,23,.22); }
  .gem-tool-modal { width: 100%; height: 91dvh; max-height: 91dvh; display: flex; flex-direction: column; overflow: hidden; border-radius: 18px 18px 0 0; }
  .gem-tool-modal > header { flex: 0 0 auto; }
  .gem-tool-body { min-width: 0; min-height: 0; flex: 1 1 auto; max-height: none; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 13px; }
  .gem-workspace,.utility-pane,.gem-inventory { min-width: 0; max-width: 100%; }
  .gem-inventory { width: 100%; grid-template-columns: repeat(5,minmax(0,1fr)); }
  .gem-actions-backdrop { position: fixed; z-index: 120; inset: 0; display: none; place-items: end center; padding: 12px; background: rgba(12,28,23,.52); }
  .gem-actions-backdrop.open { display: grid; }
  .gem-actions-dialog { width: min(520px,100%); display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--card); box-shadow: 0 24px 65px rgba(8,25,20,.35); }
  .gem-actions-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #f0eee5; }
  .gem-actions-head span,.gem-actions-head b { display: block; }
  .gem-actions-head span { color: #8b612d; font-size: 7px; font-weight: 900; letter-spacing: .12em; }
  .gem-actions-head b { margin-top: 2px; color: var(--ink); font-size: 13px; }
  .gem-actions-head .icon-button { width: 31px; height: 31px; font-size: 18px; }
  .gem-actions { grid-template-columns: 1fr; max-height: calc(88dvh - 58px); overflow-y: auto; gap: 8px; margin: 0; padding: 11px; }
}
@media (max-width: 430px) {
  .gem-tool-card { padding: 13px 12px; }
  .gem-tool-head { align-items: center; }
  .gem-tool-title { gap: 7px; }
  .gem-tool-title > img { width: 28px; height: 28px; flex-basis: 28px; }
  .gem-tool-title span { font-size: 6px; }
  .gem-tool-title h3 { font-size: 13px; }
  .gem-head-actions b { max-width: 82px; font-size: 7px; }
  .gem-card-login { gap: 6px; padding: 8px; }
  .gem-card-login input,.gem-card-login select,.gem-card-login button { height: 32px; min-height: 32px; }
  .gem-type-summary { gap: 3px; }
  .gem-type-summary span { padding-inline: 2px; }
  .gem-type-summary img { width: 14px; height: 14px; flex-basis: 14px; }
  .gem-account-bar { align-items: stretch; flex-direction: column; }
  .gem-account-bar > div:last-child { display: grid; grid-template-columns: 1fr 1fr; }
  .gem-selection-head { align-items: stretch; flex-direction: column; }
  #gemSelectedInfo { width: 100%; }
  .gem-actions section { grid-template-columns: minmax(0,1fr) 105px auto; }.gem-actions section > div { grid-column: 1/-1; }.gem-actions section button { grid-column: 1/-1; }
  .gem-item { min-height: 61px; }.gem-item img { width: 14px; height: 14px; }.gem-item span { font-size: 6px; }
}

@media (max-width: 760px) {
  .contact-card { flex-wrap: wrap; }
  .user-notice {
    flex: 0 0 100%;
    width: 100%;
    margin-top: 2px;
  }
}

/* Weekly material rankings stay compact and share the page's account-card language. */
.material-leaderboard-card {
  width: min(100%, 560px);
  margin: 8px auto 18px;
  padding: 7px 9px;
  border: 1px solid #dbe2d2;
  border-radius: 10px;
  background: rgba(255,254,249,.76);
  box-shadow: 0 5px 14px rgba(50,75,42,.05);
}
.material-leaderboard-card.open { border-color: #c5d4b8; }
.material-leaderboard-toggle {
  width: 100%;
  min-height: 38px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto 18px;
  align-items: center;
  gap: 8px;
  padding: 3px 2px;
  border: 0;
  border-bottom: 1px solid #dfe6d8;
  border-radius: 0;
  color: #294f32;
  background: transparent;
  font-size: 11px;
  font-weight: 900;
  text-align: left;
}
.material-leaderboard-toggle > span { min-width: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; }
.material-leaderboard-toggle > span img { width: 17px; height: 17px; flex: 0 0 17px; object-fit: contain; image-rendering: pixelated; }
.material-leaderboard-toggle > span strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.material-leaderboard-toggle > small { color: #81917e; font-size: 8px; font-weight: 800; white-space: nowrap; }
.material-leaderboard-toggle > i { color: #638061; font-size: 14px; font-style: normal; line-height: 1; text-align: center; transition: transform .18s; }
.material-leaderboard-toggle.open > i { transform: rotate(180deg); }
.material-leaderboard { margin-top: 5px; }
.material-leaderboard-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.material-leaderboard-tabs button {
  min-height: 29px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid #e0e5da;
  border-radius: 7px;
  color: #778477;
  background: #f5f6f0;
  font-size: 8px;
  font-weight: 850;
}
.material-leaderboard-tabs button img { width: 14px; height: 14px; object-fit: contain; image-rendering: pixelated; }
.material-leaderboard-tabs button.active { border-color: #c9d7b8; color: #446634; background: #edf4df; }
.material-leaderboard-prize { margin: 5px 0 0; color: #788579; font-size: 7px; text-align: center; }
.material-leaderboard-prize b { color: #8a6218; }
.material-leaderboard-rows { display: grid; gap: 3px; margin-top: 5px; }
.material-leaderboard-row {
  min-height: 29px;
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0,1fr) auto minmax(82px,auto);
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  border: 1px solid #e7ebe1;
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  font-size: 8px;
}
.material-leaderboard-row > b { color: #657565; font-size: 8px; }
.material-leaderboard-row.rank-1 { border-color: #ecd9a0; background: linear-gradient(90deg,#fffdf5,#fff8de); }
.material-leaderboard-row.rank-1 > b { color: #b57a12; }
.material-leaderboard-row.rank-2 { border-color: #d5dfe2; background: linear-gradient(90deg,#fff,#f3f7f7); }
.material-leaderboard-row.rank-2 > b { color: #70818a; }
.material-leaderboard-row.rank-3 { border-color: #e5cfbd; background: linear-gradient(90deg,#fff,#fff5ed); }
.material-leaderboard-row.rank-3 > b { color: #996343; }
.material-leaderboard-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 850; }
.material-leaderboard-row > em { position: absolute; left: 50%; translate: -50% 0; color: #3f78ad; font-size: 7px; font-style: normal; font-weight: 850; white-space: nowrap; pointer-events: none; }
.material-leaderboard-row > strong { grid-column: 4; justify-self: end; color: #315647; font-size: 8px; white-space: nowrap; }
.material-leaderboard-empty { margin: 5px 0 0; padding: 8px; color: #7b887b; font-size: 8px; text-align: center; }
@media (max-width: 430px) {
  .material-leaderboard-card { margin-top: 6px; padding-inline: 7px; }
  .material-leaderboard-row { grid-template-columns: 22px minmax(0,1fr) auto minmax(74px,auto); padding-inline: 4px; }
  .material-leaderboard-row > em { font-size: 6px; }
}

@media (max-width: 760px) {
  #gridLayout {
    display: none;
  }
  .section-head {
    align-items: center;
    justify-content: center;
    margin: 16px 0 15px;
    text-align: center;
  }
  .section-head > div:first-child {
    width: 100%;
  }
  .section-head h3 {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 19px;
    line-height: 1.15;
    letter-spacing: -.02em;
  }
  .section-head h3 small {
    display: inline-flex;
    align-items: center;
    min-height: 19px;
    padding: 3px 9px;
    border: 1px solid #d4ddcf;
    border-radius: 999px;
    color: #45614f;
    background: #edf3e9;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
  }
  .section-actions {
    display: none;
  }
}

.detail-panel h3.detail-slot-number.trial-number-badge {
  width: auto;
  min-width: 50px;
  padding: 0 9px;
  border-radius: 999px;
  color: #83521f;
  border-color: #dfbd82;
  background: #fff0d5;
  font-size: 10px;
  text-transform: uppercase;
}

/* Compact artwork and a softer sage surface for material cells. */
.slot-card {
  border-color: var(--line);
  background: linear-gradient(145deg, #fffefb, #faf9f2);
  box-shadow: 0 7px 20px rgba(34, 49, 43, .045);
}
.slot-card:hover {
  border-color: #bfc2b4;
}
.material-chip {
  border: 1px solid #d7dfd0;
  background: linear-gradient(145deg, #f0f4e9, #e5ecdd);
}
.slot-state.server-state img {
  width: 11px;
  height: 11px;
  flex-basis: 11px;
}
.slot-identity .slot-coins {
  grid-template-columns: 12px minmax(0, 1fr);
}
.slot-identity .slot-coins img {
  width: 12px;
  height: 12px;
  flex-basis: 12px;
}
.slot-metric-chip img {
  width: 19px;
  height: 19px;
  flex-basis: 19px;
}
.slot-metric-chip b {
  font-size: 11px;
}
.material-chip img {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
  object-fit: contain;
}

@media (max-width: 480px) {
  .slot-metric-chip img {
    width: 17px;
    height: 17px;
    flex-basis: 17px;
  }
  .slot-metric-chip b {
    font-size: 10px;
  }
  .material-chip img {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
  }
}

/* The grid selector is authoritative on tablet/desktop instead of being auto-reduced. */
@media (min-width: 761px) {
  .slot-grid[data-columns="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .slot-grid[data-columns="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .slot-grid[data-columns="5"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .slot-grid[data-columns="6"] { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.slot-card:hover,
.gem-tool-card:hover {
  border-color: #a93624;
  box-shadow: 0 0 0 2px rgba(169, 54, 36, .38), 0 12px 28px rgba(105, 29, 20, .2);
}

/* One compact material editor instead of six separate cards. */
.material-editor {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid #d9d7cd;
  border-radius: 10px;
  background: #d9d7cd;
}
.material-input {
  min-width: 0;
  gap: 5px;
  padding: 5px 7px;
  border: 0;
  border-radius: 0;
  background: #fffef9;
}
.material-input img {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  object-fit: contain;
}
.material-input label {
  min-width: 0;
  font-size: 9px;
}
.material-input input {
  height: 25px;
  margin-top: 2px;
  border-radius: 6px;
  padding-inline: 7px;
  font-size: 10px;
}

@media (max-width: 480px) {
  .material-editor {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .material-input img {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
  }
}

@media (max-width: 340px) {
  .material-editor {
    grid-template-columns: 1fr;
  }
}

/* Segmented actions shared by the cards on the main screen. */
.slot-actions,
.gem-card-actions {
  gap: 0;
  padding-top: 0;
  overflow: hidden;
  border: 1px solid #ccd2c7;
  border-radius: 9px;
  background: rgba(255, 254, 249, .92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85);
}
.slot-card .material-strip {
  margin-bottom: 8px;
}
.slot-card .slot-actions > button,
.gem-tool-card .gem-card-actions > button {
  min-height: 28px;
  border: 0;
  border-radius: 0;
  color: #355344;
  background: transparent;
  font-size: 9px;
  font-weight: 850;
}
.slot-card .slot-actions > button + button,
.gem-tool-card .gem-card-actions > button + button {
  border-left: 1px solid #ccd2c7;
}
.slot-card .slot-actions > button:hover,
.gem-tool-card .gem-card-actions > button:hover {
  color: #213d30;
  background: #e8eee5;
}

/* Compact login controls inside the gem card. */
.gem-card-login {
  gap: 5px;
  margin-top: 10px;
  padding: 7px;
  border-radius: 9px;
}
.gem-card-login input,
.gem-card-login select,
.gem-card-login button {
  height: 30px;
  min-height: 30px;
  margin: 0;
  border-radius: 7px;
  padding-inline: 8px;
  font-size: 8px;
}
.gem-card-login button {
  font-weight: 850;
}

@media (min-width: 1100px) {
  .gem-tool-card {
    height: auto;
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) 190px;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
  }
  .gem-tool-head {
    grid-column: 1;
    grid-row: 1;
    display: block;
  }
  .gem-tool-title {
    gap: 8px;
  }
  .gem-tool-title > img {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }
  .gem-head-actions {
    align-items: flex-start;
    margin: 5px 0 0 38px;
  }
  .gem-card-login {
    grid-column: 2 / -1;
    grid-row: 1;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 125px 105px;
    margin-top: 0;
  }
  .gem-card-account {
    grid-column: 2;
    grid-row: 1;
    min-height: 42px;
    margin-top: 0;
  }
  .gem-card-actions {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    margin-top: 0;
  }
  .gem-tool-card .gem-card-actions > button {
    min-height: 42px;
  }
}

@media (max-width: 430px) {
  .gem-card-login {
    gap: 4px;
    padding: 6px;
  }
  .gem-card-login input,
  .gem-card-login select,
  .gem-card-login button {
    height: 29px;
    min-height: 29px;
  }
}

.mobile-pricing-trigger,
.mobile-pricing-head {
  display: none;
}
.mobile-pricing-backdrop,
.mobile-pricing-dialog {
  display: contents;
}

.mobile-gem-trigger,
.mobile-gem-head {
  display: none;
}
.mobile-gem-backdrop,
.mobile-gem-dialog {
  display: contents;
}

@media (max-width: 760px) {
  .mobile-pricing-trigger {
    width: min(100%, 520px);
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 12px auto 8px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 13px;
    color: var(--ink);
    background: radial-gradient(circle at 100% 0, rgba(186,214,111,.2), transparent 38%), linear-gradient(135deg, #fffdf7, #f2f0e6);
    box-shadow: 0 8px 22px rgba(31,52,44,.065);
    text-align: left;
  }
  .mobile-pricing-trigger > img {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    object-fit: contain;
    image-rendering: pixelated;
  }
  .mobile-pricing-trigger > span {
    min-width: 0;
    flex: 1;
  }
  .mobile-pricing-trigger small,
  .mobile-pricing-trigger b {
    display: block;
  }
  .mobile-pricing-trigger small {
    color: #8b612d;
    font-size: 6px;
    font-weight: 900;
    letter-spacing: .11em;
  }
  .mobile-pricing-trigger b {
    margin-top: 2px;
    font-size: 13px;
  }
  .mobile-pricing-trigger > strong {
    flex: 0 0 auto;
    padding: 5px 8px;
    border-radius: 999px;
    color: #466052;
    background: rgba(255,255,255,.72);
    font-size: 8px;
  }
  .mobile-pricing-backdrop {
    position: fixed;
    z-index: 114;
    inset: 0;
    display: none;
    align-items: end;
    padding: 12px 10px max(10px, env(safe-area-inset-bottom));
    background: rgba(12,28,23,.48);
    backdrop-filter: blur(3px);
  }
  .mobile-pricing-backdrop.open {
    display: grid;
  }
  .mobile-pricing-dialog {
    width: min(520px, 100%);
    max-height: 90dvh;
    display: block;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--card);
    box-shadow: 0 26px 70px rgba(8,25,20,.34);
  }
  .mobile-pricing-head {
    position: sticky;
    z-index: 2;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
    background: rgba(240,238,229,.96);
    backdrop-filter: blur(10px);
  }
  .mobile-pricing-head span,
  .mobile-pricing-head h3 {
    display: block;
  }
  .mobile-pricing-head span {
    color: #8b612d;
    font-size: 7px;
    font-weight: 900;
    letter-spacing: .11em;
  }
  .mobile-pricing-head h3 {
    margin: 3px 0 0;
    font-size: 17px;
  }
  .mobile-pricing-head .icon-button {
    width: 36px;
    height: 36px;
    min-height: 36px;
    flex: 0 0 36px;
  }
  .mobile-pricing-dialog > .pricing-card {
    width: 100%;
    margin: 0;
    padding: 14px 12px 16px;
    border: 0;
    border-radius: 0;
    background: radial-gradient(circle at 100% 0, rgba(186,214,111,.16), transparent 32%), #fffdf8;
    box-shadow: none;
  }
  .mobile-pricing-dialog .pricing-copy h3 {
    display: none;
  }
  .mobile-pricing-dialog .contact-card {
    padding-bottom: 2px;
  }

  .mobile-gem-trigger {
    width: min(100%, 520px);
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 auto 14px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 13px;
    color: var(--ink);
    background: radial-gradient(circle at 100% 0, rgba(186,214,111,.2), transparent 38%), linear-gradient(135deg, #fffdf7, #f2f0e6);
    box-shadow: 0 8px 22px rgba(31,52,44,.065);
    text-align: left;
  }
  .mobile-gem-trigger > img {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    object-fit: contain;
    image-rendering: pixelated;
  }
  .mobile-gem-trigger > span {
    min-width: 0;
    flex: 1;
  }
  .mobile-gem-trigger small,
  .mobile-gem-trigger b {
    display: block;
  }
  .mobile-gem-trigger small {
    color: #8b612d;
    font-size: 6px;
    font-weight: 900;
    letter-spacing: .11em;
  }
  .mobile-gem-trigger b {
    margin-top: 2px;
    font-size: 13px;
  }
  .mobile-gem-trigger > strong {
    flex: 0 0 auto;
    padding: 5px 8px;
    border-radius: 999px;
    color: #466052;
    background: rgba(255,255,255,.72);
    font-size: 8px;
  }
  .mobile-gem-backdrop {
    position: fixed;
    z-index: 114;
    inset: 0;
    display: none;
    align-items: end;
    padding: 12px 10px max(10px, env(safe-area-inset-bottom));
    background: rgba(12,28,23,.48);
    backdrop-filter: blur(3px);
  }
  .mobile-gem-backdrop.open {
    display: grid;
  }
  .mobile-gem-dialog {
    width: min(520px, 100%);
    max-height: 88dvh;
    display: block;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--card);
    box-shadow: 0 26px 70px rgba(8,25,20,.34);
  }
  .mobile-gem-head {
    position: sticky;
    z-index: 2;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(240,238,229,.96);
    backdrop-filter: blur(10px);
  }
  .mobile-gem-head span,
  .mobile-gem-head h3 {
    display: block;
  }
  .mobile-gem-head span {
    display: none;
  }
  .mobile-gem-head h3 {
    margin: 0;
    font-size: 16px;
  }
  .mobile-gem-head .icon-button {
    width: 32px;
    height: 32px;
    min-height: 32px;
    flex: 0 0 32px;
  }
  .mobile-gem-dialog > .gem-tool-card {
    width: 100%;
    height: auto;
    display: grid;
    grid-template-columns: minmax(0, .85fr) minmax(165px, 1.15fr);
    margin: 0;
    padding: 10px 12px 12px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .mobile-gem-dialog .gem-tool-head {
    display: none;
  }
  .mobile-gem-dialog .gem-tool-title {
    display: none;
  }
  .mobile-gem-dialog .gem-card-login,
  .mobile-gem-dialog .gem-card-account {
    order: 1;
  }
  .mobile-gem-dialog .gem-card-login {
    grid-column: 1 / -1;
    margin-top: 0;
  }
  .mobile-gem-dialog .gem-card-account {
    grid-column: 1;
    min-height: 44px;
    margin-top: 0;
    padding: 7px 9px;
    border-right: 0;
    border-radius: 9px 0 0 9px;
  }
  .mobile-gem-dialog .gem-card-actions {
    grid-column: 2;
    order: 2;
    gap: 5px;
    margin-top: 0;
    padding: 6px;
    overflow: visible;
    border: 1px solid #e4e1d7;
    border-left: 0;
    border-radius: 0 9px 9px 0;
    background: #f2f1e9;
    box-shadow: none;
  }
  .mobile-gem-dialog .gem-card-actions > button {
    min-height: 30px;
    padding-inline: 5px;
    border: 1px solid #d9d8ce;
    border-radius: 7px;
    background: rgba(255,255,255,.82);
    font-size: 8px;
  }
  .mobile-gem-dialog .gem-card-actions > button + button {
    border-left: 1px solid #d9d8ce;
  }
  .mobile-gem-dialog .gem-type-summary {
    display: none;
  }

  .gem-tool-modal > header {
    gap: 7px;
    padding: 10px 12px;
  }
  .gem-tool-modal > header .gem-modal-title {
    display: none;
  }
  .gem-mobile-account {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 5px;
  }
  .gem-mobile-account > div {
    min-width: 0;
    flex: 1;
  }
  .gem-mobile-account b,
  .gem-mobile-account span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .gem-mobile-account b {
    color: var(--ink);
    font-size: 11px;
  }
  .gem-mobile-account span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 7px;
  }
  .gem-mobile-account > button {
    min-height: 30px;
    flex: 0 0 auto;
    border: 1px solid #d9d8ce;
    border-radius: 7px;
    padding-inline: 7px;
    color: #355344;
    background: rgba(255,255,255,.82);
    font-size: 7px;
    font-weight: 850;
  }
  .gem-mobile-account > #gemMobileRefresh {
    width: 30px;
    padding: 0;
    font-size: 15px;
  }
  .gem-mobile-account > button:disabled {
    opacity: .45;
  }
  .gem-tool-modal > header .icon-button {
    width: 32px;
    height: 32px;
    min-height: 32px;
    flex: 0 0 32px;
  }
  .gem-tool-body {
    min-height: 0;
    flex: 1 1 auto;
    max-height: none;
    overflow-x: hidden;
    padding: 10px 12px 12px;
  }
  .gem-tool-modal .gem-account-bar {
    display: none;
  }
}

@media (max-width: 760px) {
  .equipment-fix-grid { grid-template-columns: repeat(auto-fill,minmax(40px,1fr)); max-height: 230px; }
  .equipment-fix-wrap { padding: 9px; }
  .equipment-fix-wrap > header span { max-width: 220px; }
  .equipment-fix-wrap > footer { align-items: stretch; flex-direction: column; }
  .equipment-fix-wrap > footer > div { display: grid; grid-template-columns: 1fr 1fr; }
  .equipment-fix-wrap > footer button { padding-inline: 4px; font-size: 7px; }
}

/* Selection is already shown on the active gem card. */
.gem-selection-head { display: none; }
#gemSelectedInfo { width: auto; min-height: 18px; padding: 0 2px; border: 0; border-radius: 0; background: transparent; }
#gemSelectedInfo span { color: var(--muted); font-size: 8px; }
#gemSelectedInfo b { color: var(--ink); font-size: 9px; }
.gem-inventory { gap: 3px; }
.gem-item { min-height: 46px; gap: 1px; padding: 3px 2px; border-radius: 6px; }
.gem-item img { width: 12px; height: 12px; }
.gem-item span { font-size: 6px; }
.gem-item b { font-size: 8px; }

@media (max-width: 760px) {
  .gem-selection-head { align-items: center; flex-direction: row; }
  #gemSelectedInfo { width: auto; }
  .gem-item { min-height: 46px; }
}

/* Match the compact collapsed leaderboard card used by the reference web UI. */
.material-leaderboard-card {
  width: min(100%, 520px);
  margin: 12px auto 18px;
  padding: 7px;
  border: 1px solid #d9e0ce;
  border-radius: 14px;
  background: linear-gradient(135deg, #fffef9 0%, #f0f5e8 100%);
  box-shadow: 0 8px 22px rgba(50,75,42,.08);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.material-leaderboard-card.open { border-color: #b8cd9d; box-shadow: 0 12px 28px rgba(50,75,42,.13); }
.material-leaderboard-toggle {
  min-height: 42px;
  grid-template-columns: minmax(0,1fr) auto 22px;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid #dce5ce;
  border-radius: 10px;
  color: #355d3d;
  background: rgba(255,255,255,.78);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
  font-size: 11px;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.material-leaderboard-toggle:hover { border-color: #b8cd9d; background: #fff; }
.material-leaderboard-toggle:active { transform: scale(.995); }
.material-leaderboard-toggle > span { gap: 7px; font-weight: 900; letter-spacing: .01em; }
.material-leaderboard-toggle > span > b {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #b77a18;
  background: #fff2cb;
  font-size: 18px;
  line-height: 1;
}
.material-leaderboard-toggle > span > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.material-leaderboard-toggle > small {
  padding: 3px 7px;
  border-radius: 999px;
  color: #617d61;
  background: #edf4e3;
  font-size: 8px;
  font-weight: 850;
}
.material-leaderboard-toggle > i {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #47734b;
  background: #e5efda;
  font-size: 15px;
  line-height: 1;
}
.material-leaderboard { margin-top: 8px; padding: 8px; border: 1px solid #dce5ce; border-radius: 10px; background: rgba(255,255,252,.84); }
.material-leaderboard-tabs { padding: 3px; border-radius: 8px; background: #edf3e7; }
.material-leaderboard-tabs button { min-height: 32px; border-radius: 6px; font-size: 9px; }
.material-leaderboard-prize { margin-top: 7px; }
@media (max-width: 760px) {
  .material-leaderboard-card { margin-top: 10px; padding: 6px; }
  .material-leaderboard-toggle { min-height: 40px; gap: 6px; padding: 6px 8px; font-size: 10px; }
  .material-leaderboard-toggle > span > b { width: 30px; height: 30px; flex-basis: 30px; font-size: 17px; }
  .material-leaderboard-toggle > small { padding: 3px 5px; font-size: 7px; }
}

/* Final AVT2X single-row leaderboard treatment. */
.material-leaderboard-card,
.material-leaderboard-card.open {
  width: min(100%, 520px);
  margin: 10px auto 18px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.material-leaderboard-toggle {
  min-height: 54px;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 9px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: radial-gradient(circle at 100% 0,rgba(186,214,111,.2),transparent 38%),linear-gradient(135deg,#fffdf7,#f2f0e6);
  box-shadow: 0 8px 22px rgba(31,52,44,.065);
  font-size: 13px;
}
.material-leaderboard-toggle:hover {
  border-color: var(--line);
  background: radial-gradient(circle at 100% 0,rgba(186,214,111,.26),transparent 38%),linear-gradient(135deg,#fffdf7,#f2f0e6);
}
.material-leaderboard-toggle > span { gap: 9px; }
.material-leaderboard-toggle > span > b {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
  background: #fff0d2;
  font-size: 20px;
}
.material-leaderboard-toggle > span > strong { color: var(--ink); font-size: 13px; font-weight: 900; }
.material-leaderboard-toggle > small {
  padding: 5px 8px;
  border-radius: 999px;
  color: #5f7560;
  background: rgba(255,255,255,.72);
  font-size: 9px;
  font-weight: 850;
}
.material-leaderboard-toggle > i { display: none; }
.material-leaderboard-card.open .material-leaderboard {
  margin-top: 7px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255,254,249,.9);
}
.material-leaderboard-tabs button { min-height: 35px; color: #4e6653; font-size: 10px; font-weight: 900; }
.material-leaderboard-tabs button.active { color: #216438; }
.material-leaderboard-row { min-height: 35px; color: #415d47; font-size: 10px; font-weight: 800; }
.material-leaderboard-row > b { color: #526d59; font-size: 9px; }
.material-leaderboard-row > span { font-weight: 900; }
.material-leaderboard-row > strong { color: #235e48; font-size: 10px; }
.material-leaderboard-row > em { color: #226caf; font-size: 8px; font-weight: 900; }

/* AVT2X account divider: no repeated section title. */
.account-status-divider {
  display: grid;
  grid-template-columns: minmax(20px,1fr) auto minmax(20px,1fr);
  align-items: center;
  gap: 10px;
  margin: 4px 0 17px;
  color: #1d568a;
  font-size: 10px;
  font-weight: 900;
}
.account-status-divider::before,
.account-status-divider::after { content: ""; height: 2px; border-radius: 999px; }
.account-status-divider::before { background: linear-gradient(90deg,#d9574b 0%,#d9e3d8 78%,#edf0e9 100%); }
.account-status-divider::after { background: linear-gradient(90deg,#edf0e9 0%,#d9e3d8 22%,#d9574b 100%); }
.account-status-divider small { color: inherit; font-size: inherit; font-weight: inherit; white-space: nowrap; }

@media (max-width: 760px) {
  .material-leaderboard-card,
  .material-leaderboard-card.open { margin: 10px auto 15px; }
  .material-leaderboard-toggle { min-height: 38px; font-size: 11px; }
  .material-leaderboard-tabs button { min-height: 33px; font-size: 9px; }
  .material-leaderboard-row { min-height: 33px; font-size: 9px; }
  .material-leaderboard-row > strong { font-size: 9px; }
}
