:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --text: #172033;
    --muted: #6b7588;
    --line: #e7ebf2;
    --primary: #0f8b8d;
    --primary-dark: #0b6f71;
    --accent: #d69b2d;
    --danger: #d94b4b;
    --warning: #a96f00;
    --success: #17845b;
    --shadow: 0 16px 42px rgba(25, 36, 58, .08);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    color: var(--text);
    background: var(--bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    letter-spacing: 0;
}

body {
    min-width: 320px;
}

a {
    color: var(--primary);
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
.primary {
    border: 0;
    cursor: pointer;
}

.primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(15, 139, 141, .2);
}

.primary:hover {
    background: var(--primary-dark);
}

.primary.ghost {
    background: #e8f6f5;
    color: var(--primary-dark);
    box-shadow: none;
}

.mini {
    min-height: 36px;
    padding: 0 12px;
}

.auth-body {
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 20% -10%, rgba(214, 155, 45, .22), transparent 32%),
        linear-gradient(180deg, #111827 0, #182235 210px, #f5f1e8 211px, #f7f8fb 100%);
}

.auth-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 440px;
    gap: 28px;
    align-items: center;
    min-height: 100vh;
    padding: 32px;
}

.auth-mobile-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 520px;
    margin: 0 auto;
    padding: 24px 14px;
}

.auth-app {
    width: 100%;
    max-width: 520px;
    min-height: 100vh;
    margin: 0 auto;
    overflow: hidden;
    background: linear-gradient(180deg, #111827 0, #182235 260px, #f5f1e8 261px, #f7f8fb 100%);
}

.auth-market-hero {
    position: relative;
    overflow: hidden;
    min-height: 286px;
    padding: 24px 22px 34px;
    color: #fff;
    background:
        radial-gradient(circle at 88% 10%, rgba(248, 222, 138, .22), transparent 28%),
        linear-gradient(145deg, #2a2117 0%, #111827 48%, #0f3340 100%);
}

.auth-market-hero::after {
    content: "";
    position: absolute;
    right: -42px;
    bottom: -58px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 30px solid rgba(248, 222, 138, .11);
}

.auth-market-hero .auth-brand {
    position: relative;
    z-index: 1;
}

.auth-market-hero .auth-brand span {
    color: rgba(255, 255, 255, .68);
}

.auth-hero-copy {
    position: relative;
    z-index: 1;
    margin-top: 34px;
}

.auth-hero-copy span {
    color: #f8de8a;
    font-size: 12px;
    font-weight: 900;
}

.auth-hero-copy h1 {
    margin: 8px 0 0;
    font-size: 32px;
    line-height: 1.14;
}

.auth-ticker {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 24px;
}

.auth-ticker div {
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 8px;
    background: rgba(255, 255, 255, .08);
    backdrop-filter: blur(8px);
}

.auth-ticker span {
    display: block;
    color: rgba(255, 255, 255, .6);
    font-size: 12px;
}

.auth-ticker strong {
    display: block;
    margin-top: 4px;
    color: #f8de8a;
    font-size: 16px;
}

.auth-visual {
    min-height: 560px;
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(10, 30, 48, .84), rgba(15, 139, 141, .72)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='700' viewBox='0 0 900 700'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.18'%3E%3Cpath d='M0 500c120-60 220-80 340-30s230 40 360-30 170-80 240-40'/%3E%3Cpath d='M0 380c140-40 230-20 320-65s180-95 320-42 190 52 260 0'/%3E%3Cpath d='M80 610h740M130 560h660M180 510h560'/%3E%3C/g%3E%3Cg fill='%23d69b2d' fill-opacity='.9'%3E%3Ccircle cx='230' cy='260' r='8'/%3E%3Ccircle cx='440' cy='205' r='8'/%3E%3Ccircle cx='650' cy='250' r='8'/%3E%3C/g%3E%3C/svg%3E") center/cover;
    box-shadow: var(--shadow);
    position: relative;
}

.quote-card {
    position: absolute;
    left: 36px;
    bottom: 36px;
    max-width: 440px;
    color: #fff;
}

.quote-card span,
.eyebrow {
    display: inline-flex;
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
}

.quote-card strong {
    display: block;
    margin-top: 10px;
    font-size: 44px;
    line-height: 1.12;
}

.quote-card p {
    color: rgba(255, 255, 255, .82);
    line-height: 1.8;
}

.auth-panel {
    width: 100%;
    padding: 34px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .9);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.auth-mobile-panel {
    position: relative;
    z-index: 2;
    width: calc(100% - 28px);
    margin: -28px auto 0;
    border: 1px solid rgba(216, 194, 145, .36);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 18px 45px rgba(10, 17, 28, .18);
}

.auth-panel.solo,
.install-wrap .auth-panel {
    max-width: 520px;
    margin: auto;
}

.install-wrap {
    display: flex;
}

.auth-brand,
.brand {
    display: flex;
    gap: 12px;
    align-items: center;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), #1aa6a8);
    color: #fff;
    font-weight: 900;
}

.auth-brand span,
.brand span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.auth-mobile-panel .auth-brand {
    display: none;
}

.auth-mobile-panel .form-grid {
    grid-template-columns: 1fr;
}

.auth-mobile-panel .primary {
    margin-top: 2px;
}

.auth-panel h1 {
    margin: 28px 0 10px;
    font-size: 30px;
}

.auth-desc {
    margin: 0 0 24px;
    color: var(--muted);
    line-height: 1.7;
}

.auth-foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    color: var(--muted);
    font-size: 13px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

label {
    display: grid;
    gap: 8px;
    color: #344055;
    font-size: 14px;
    font-weight: 700;
}

.full {
    grid-column: 1 / -1;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 12px;
    background: #fff;
    color: var(--text);
    outline: none;
}

textarea {
    padding: 12px;
    min-height: 180px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(15, 139, 141, .58);
    box-shadow: 0 0 0 4px rgba(15, 139, 141, .1);
}

.app-shell {
    display: grid;
    grid-template-columns: 252px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px 18px;
    border-right: 1px solid var(--line);
    background: #fff;
}

.business-shell .sidebar {
    background: #101827;
    color: #fff;
    border-right: 0;
}

.business-shell .brand span {
    color: rgba(255, 255, 255, .58);
}

.nav {
    display: grid;
    gap: 8px;
    margin-top: 28px;
}

.nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 8px;
    color: #42506a;
    font-weight: 700;
}

.business-shell .nav a {
    color: rgba(255, 255, 255, .72);
}

.nav a.active,
.nav a:hover {
    background: #eaf7f6;
    color: var(--primary-dark);
}

.business-shell .nav a.active,
.business-shell .nav a:hover {
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.nav-ico {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: currentColor;
    opacity: .72;
    mask: linear-gradient(#000 0 0);
}

.main {
    min-width: 0;
    padding: 22px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.topbar .muted {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.user-body {
    background:
        radial-gradient(circle at 20% -10%, rgba(214, 155, 45, .22), transparent 32%),
        linear-gradient(180deg, #111827 0, #182235 180px, #f5f1e8 181px, #f7f8fb 100%);
}

.user-app {
    max-width: 520px;
    min-height: 100vh;
    margin: 0 auto;
    padding-bottom: 92px;
    color: #1e2636;
}

.user-app-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 18px 16px 12px;
    color: #fff;
}

.user-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gold-seal,
.mine-medal {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    background: #fff4d8 url("images/gold-bars-thumb.png") center/92% auto no-repeat;
    color: transparent;
    font-size: 0;
    font-weight: 900;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 10px 22px rgba(0,0,0,.22);
}

.user-brand strong {
    display: block;
    font-size: 16px;
}

.user-brand span,
.user-head-actions {
    color: rgba(255,255,255,.68);
    font-size: 12px;
}

.user-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-head-actions a {
    color: #f8de8a;
}

.user-main {
    padding: 0 14px 18px;
}

.gold-market-hero,
.mine-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 22px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255,255,255,.12), transparent 34%),
        linear-gradient(145deg, #2a2117, #111827 55%, #0f8b8d);
    color: #fff;
    box-shadow: 0 18px 45px rgba(10, 17, 28, .22);
}

.gold-market-hero::after,
.mine-hero::after {
    content: "";
    position: absolute;
    right: -34px;
    top: -42px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 26px solid rgba(248, 222, 138, .12);
}

.gold-market-hero span,
.mine-hero span {
    color: #f8de8a;
    font-size: 12px;
    font-weight: 900;
}

.gold-market-hero h1 {
    margin: 8px 0 6px;
    font-size: 28px;
    line-height: 1.16;
}

.gold-market-hero p,
.mine-hero p {
    margin: 0;
    color: rgba(255,255,255,.72);
}

.hero-quote {
    align-self: flex-end;
    text-align: right;
    position: relative;
    z-index: 1;
}

.hero-quote small {
    display: block;
    color: rgba(255,255,255,.68);
}

.hero-quote strong {
    display: block;
    margin-top: 4px;
    color: #f8de8a;
    font-size: 26px;
}

.user-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 20px 2px 12px;
}

.user-section-head.tight {
    margin: 0 0 14px;
}

.user-section-head h2 {
    margin: 0;
    font-size: 19px;
}

.user-section-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.user-section-head a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: #fff8e7;
    color: #8f5c0d;
    font-weight: 800;
}

.metal-list,
.alert-record-list {
    display: grid;
    gap: 10px;
}

.alert-ad-banner {
    position: relative;
    overflow: hidden;
    min-height: 132px;
    margin: 0 0 16px;
    border: 1px solid rgba(216, 194, 145, .34);
    border-radius: 8px;
    background: #111827;
    box-shadow: 0 14px 34px rgba(10, 17, 28, .14);
}

.alert-ad-banner img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 7;
    object-fit: cover;
}

.alert-ad-default {
    min-height: 132px;
    padding: 22px;
    background:
        linear-gradient(90deg, rgba(17, 24, 39, .88), rgba(17, 24, 39, .42)),
        url("images/gold-bars.png") center/cover;
    color: #fff;
}

.alert-ad-default span {
    display: block;
    color: #f8de8a;
    font-size: 12px;
    font-weight: 900;
}

.alert-ad-default strong {
    display: block;
    margin-top: 8px;
    font-size: 24px;
    line-height: 1.18;
}

.alert-ad-default p {
    margin: 8px 0 0;
    color: rgba(255,255,255,.76);
    font-size: 13px;
}

.alert-divider {
    height: 1px;
    margin: 0 2px 16px;
    background: #d8dde7;
}

.metal-price-card,
.alert-record-card,
.alert-compose-card,
.mine-card,
.empty-card {
    border: 1px solid rgba(216, 194, 145, .36);
    border-radius: 8px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 12px 34px rgba(27, 34, 48, .08);
}

.metal-price-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
}

.metal-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid rgba(214, 155, 45, .22);
    background: #fff5d8 url("images/gold-bars-thumb.png") center/90% auto no-repeat;
    color: transparent;
    font-size: 0;
    font-weight: 900;
}

.metal-info strong {
    display: block;
    font-size: 16px;
}

.metal-info span,
.metal-price span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.metal-price {
    text-align: right;
}

.metal-price strong {
    display: block;
    color: #a66a0d;
    font-size: 21px;
}

.alert-compose-card,
.mine-card {
    padding: 16px;
    margin-bottom: 14px;
}

.add-alert-bottom {
    width: 100%;
    margin-top: 14px;
}

.user-form-stack {
    display: grid;
    gap: 12px;
}

.two-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.alert-record-card {
    padding: 14px;
}

.alert-record-main,
.alert-rule,
.record-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.alert-record-main strong {
    display: block;
}

.alert-record-main span:not(.status),
.alert-rule small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.alert-switch-form {
    display: inline-flex;
}

.alert-switch {
    position: relative;
    width: 42px;
    height: 24px;
    min-height: 24px;
    padding: 0;
    border-radius: 999px;
    background: #d7dde7;
    box-shadow: none;
}

.alert-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .16);
    transition: transform .18s ease;
}

.alert-switch.on {
    background: #e54848;
}

.alert-switch.on::after {
    background: #fff;
}

.alert-switch.on::after {
    transform: translateX(18px);
}

.alert-rule {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin: 14px 0;
    padding: 12px;
    border-radius: 8px;
    background: #fbf7ee;
}

.alert-rule span {
    color: #8f5c0d;
    font-weight: 800;
}

.alert-rule strong {
    color: #111827;
    font-size: 22px;
}

.record-actions {
    justify-content: flex-start;
    margin-left: auto;
}

.record-actions form {
    display: inline-flex;
}

.record-actions button {
    min-height: auto;
    padding: 0;
    background: none;
    color: var(--primary);
    box-shadow: none;
}

.empty-card {
    padding: 22px;
    color: var(--muted);
    text-align: center;
}

.mine-hero {
    align-items: center;
    margin-bottom: 16px;
}

.mine-hero strong {
    display: block;
    margin: 6px 0;
    font-size: 30px;
}

.mine-medal {
    width: 72px;
    height: 72px;
    font-size: 20px;
    position: relative;
    z-index: 1;
}

.mine-price-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.mine-price-card {
    display: grid;
    gap: 4px;
    padding: 10px 8px;
    border-radius: 8px;
    background: #fbf7ee;
    text-align: center;
}

.mine-price-card span,
.mine-price-card small {
    color: var(--muted);
    font-size: 12px;
}

.mine-price-card strong {
    color: #9b650d;
    font-size: 15px;
}

.email-list {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.email-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background: #fbf7ee;
}

.email-item strong {
    display: block;
    font-size: 14px;
    word-break: break-all;
}

.email-item span {
    display: block;
    margin-top: 4px;
    color: #9b650d;
    font-size: 12px;
    font-weight: 800;
}

.email-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.email-actions form {
    display: inline-flex;
}

.email-actions button {
    min-height: auto;
    padding: 0;
    background: none;
    color: var(--primary);
    box-shadow: none;
}

.email-actions .danger-text {
    color: var(--danger);
}

.email-add-form {
    padding-top: 12px;
    border-top: 1px solid rgba(216, 194, 145, .36);
}

.check-row {
    display: flex;
    grid-template-columns: none;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-weight: 700;
}

.check-row input {
    width: 18px;
    min-height: 18px;
}

.announcement-dialog {
    width: min(390px, calc(100vw - 28px));
}

.announcement-card {
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(216, 194, 145, .45);
}

.announcement-head {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 36px;
    align-items: center;
    gap: 12px;
    padding: 18px;
    background:
        linear-gradient(135deg, rgba(248, 222, 138, .22), transparent 42%),
        #fff;
}

.announcement-badge {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #fff4d8 url("images/gold-bars-thumb.png") center/92% auto no-repeat;
    color: transparent;
    font-size: 0;
    box-shadow: 0 10px 24px rgba(145, 95, 12, .18);
}

.announcement-head h2 {
    margin: 0;
    font-size: 22px;
}

.announcement-head p {
    margin: 4px 0 0;
    color: var(--muted);
}

.announcement-content {
    margin: 0 18px;
    padding: 16px;
    border-radius: 8px;
    background: #fbf7ee;
    color: #2c3444;
    line-height: 1.8;
}

.announcement-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 18px;
}

.announcement-check {
    color: var(--muted);
    font-size: 14px;
}

.announcement-foot .primary {
    min-width: 110px;
    background: #0f8b8d;
}

.service-float {
    position: fixed;
    right: max(14px, calc((100vw - 520px) / 2 + 14px));
    bottom: 94px;
    z-index: 32;
    width: 54px;
    height: 54px;
    min-height: 54px;
    border-radius: 50%;
    background: linear-gradient(145deg, #f8de8a, #b87a18);
    color: #332009;
    box-shadow: 0 14px 34px rgba(96, 64, 10, .26);
}

.service-float svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.service-qr {
    display: block;
    width: min(260px, 72vw);
    margin: 0 auto;
    border-radius: 8px;
}

.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: min(520px, 100%);
    transform: translateX(-50%);
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(216, 194, 145, .36);
    background: rgba(255,255,255,.94);
    box-shadow: 0 -10px 28px rgba(24, 31, 44, .08);
    backdrop-filter: blur(12px);
}

.bottom-nav a {
    display: grid;
    place-items: center;
    gap: 4px;
    min-height: 54px;
    border-radius: 8px;
    color: #7a8190;
    font-size: 12px;
    font-weight: 800;
}

.bottom-nav a.active {
    background: #fff3d0;
    color: #8f5c0d;
}

.tab-svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mobile-hero,
.business-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 26px;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(15, 139, 141, .92), rgba(16, 24, 39, .88)),
        linear-gradient(90deg, transparent, rgba(255, 255, 255, .08));
    color: #fff;
    box-shadow: var(--shadow);
}

.admin-hero {
    background: linear-gradient(135deg, #111827, #0f8b8d);
}

.mobile-hero h1,
.business-hero h1 {
    margin: 8px 0;
    font-size: 28px;
    line-height: 1.24;
}

.mobile-hero p,
.business-hero p {
    margin: 0;
    color: rgba(255, 255, 255, .78);
}

.summary-grid,
.market-grid,
.price-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.market-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    margin: 0;
}

.price-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    margin-top: 0;
}

.price-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.stat-card,
.market-card,
.price-card,
.panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 8px 26px rgba(25, 36, 58, .05);
}

.stat-card,
.market-card,
.price-card {
    padding: 18px;
}

.stat-card span,
.market-card span,
.price-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
}

.market-card {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.market-card strong,
.price-card strong {
    color: var(--primary-dark);
    font-size: 24px;
}

.market-card small,
.price-card small,
td small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
}

.price-card {
    display: grid;
    gap: 8px;
}

.panel {
    padding: 20px;
    margin-bottom: 18px;
}

.soft-panel {
    background: #fbfcff;
}

.narrow {
    max-width: 760px;
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.panel h2,
.panel-head h2 {
    margin: 0;
    font-size: 20px;
}

.panel-head p {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.toolbar-form,
.redeem-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.redeem-form {
    grid-template-columns: minmax(0, 1fr) auto;
    margin-top: 18px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

th,
td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

td {
    color: #28344a;
}

td code {
    display: inline-block;
    padding: 5px 8px;
    border-radius: 6px;
    background: #f0f4f8;
    color: #22304a;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.actions form,
.inline-form {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.actions button,
.danger-text {
    min-height: auto;
    padding: 0;
    background: none;
    color: var(--muted);
    box-shadow: none;
}

.danger-text {
    color: var(--danger);
}

.inline-form {
    min-width: 380px;
}

.mailer-test-form {
    display: grid;
    grid-template-columns: minmax(170px, 1fr) auto;
    gap: 8px;
    align-items: center;
    min-width: 300px;
}

.mailer-test-form input {
    min-height: 36px;
}

.template-vars {
    margin: 0 0 16px;
    padding: 12px;
    border-radius: 8px;
    background: #f7f9fc;
    color: var(--muted);
    line-height: 1.8;
}

.template-vars code {
    display: inline-block;
    margin: 0 3px;
    padding: 2px 6px;
    border-radius: 6px;
    background: #edf2f7;
    color: #344055;
}

.mail-template-form textarea {
    min-height: 120px;
    line-height: 1.6;
}

.settings-block {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcff;
}

.settings-block h3 {
    margin: 0 0 14px;
    font-size: 18px;
}

.qr-preview {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.qr-preview img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.ad-preview {
    display: grid;
    gap: 10px;
}

.ad-preview img {
    display: block;
    width: min(420px, 100%);
    aspect-ratio: 16 / 7;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.muted-line {
    margin: 0;
    color: var(--muted);
}

.modal-dialog {
    width: min(920px, calc(100vw - 28px));
    max-height: calc(100vh - 48px);
    border: 0;
    border-radius: 8px;
    padding: 0;
    background: transparent;
    color: var(--text);
}

.modal-dialog.wide-modal {
    width: min(1080px, calc(100vw - 28px));
}

.modal-dialog::backdrop {
    background: rgba(15, 23, 42, .46);
    backdrop-filter: blur(3px);
}

.modal-card {
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 24px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 26px 80px rgba(15, 23, 42, .28);
}

.modal-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.modal-head h2 {
    margin: 0;
    font-size: 22px;
}

.modal-head p {
    margin: 6px 0 0;
    color: var(--muted);
}

.modal-close {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #f2f5f8;
    color: #475569;
    font-size: 24px;
    line-height: 1;
    border: 0;
    cursor: pointer;
}

.user-admin-form {
    display: grid;
    grid-template-columns: minmax(160px, 1.1fr) 180px 112px 92px auto;
    gap: 8px;
    align-items: center;
    min-width: 720px;
}

.user-admin-form input,
.user-admin-form select {
    min-height: 38px;
}

.small-input {
    max-width: 90px;
}

.table-save {
    margin-top: 16px;
}

.status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #edf1f6;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.status.on,
.status.unused,
.status.success {
    background: #e7f7f1;
    color: var(--success);
}

.status.off,
.status.disabled,
.status.failed {
    background: #fdecec;
    color: var(--danger);
}

.status.used {
    background: #f5f0e5;
    color: var(--warning);
}

.flash {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #e8f7ef;
    color: var(--success);
    font-weight: 700;
    transition: opacity .35s ease, transform .35s ease, margin .35s ease, padding .35s ease, max-height .35s ease;
    max-height: 180px;
}

.flash.hide {
    opacity: 0;
    transform: translateY(-6px);
    max-height: 0;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
}

.flash.danger {
    background: #fdecec;
    color: var(--danger);
}

.flash.warning {
    background: #fff5df;
    color: var(--warning);
}

.empty {
    padding: 34px 12px;
    color: var(--muted);
    text-align: center;
}

.big-line {
    margin: 10px 0 0;
    color: var(--primary-dark);
    font-size: 24px;
    font-weight: 900;
}

.code-box {
    width: 100%;
    min-height: 220px;
    font-family: Consolas, monospace;
}

.switch {
    display: inline-flex;
}

.switch input {
    display: none;
}

.switch span {
    width: 46px;
    height: 26px;
    border-radius: 999px;
    background: #cfd6e3;
    position: relative;
}

.switch span::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: .18s ease;
}

.switch input:checked + span {
    background: var(--primary);
}

.switch input:checked + span::after {
    transform: translateX(20px);
}

@media (max-width: 980px) {
    .auth-wrap {
        grid-template-columns: 1fr;
        padding: 18px;
    }

    .auth-visual {
        display: none;
    }

    .app-shell {
        display: block;
    }

    .sidebar {
        position: static;
        height: auto;
        padding: 14px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .nav {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        margin-top: 14px;
        padding-bottom: 2px;
    }

    .nav a {
        flex: 0 0 auto;
        min-height: 40px;
        white-space: nowrap;
    }

    .main {
        padding: 14px;
    }

    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .toolbar-form {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .auth-panel {
        padding: 24px;
    }

    .auth-foot,
    .topbar,
    .panel-head,
    .mobile-hero,
    .business-hero {
        flex-direction: column;
        align-items: stretch;
    }

    .mobile-hero h1,
    .business-hero h1 {
        font-size: 24px;
    }

    .form-grid,
    .toolbar-form,
    .redeem-form {
        grid-template-columns: 1fr;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .panel {
        padding: 16px;
    }

    .market-card {
        align-items: center;
    }

    .inline-form {
        display: grid;
        min-width: 260px;
    }

    .user-admin-form {
        min-width: 620px;
        grid-template-columns: 160px 170px 100px 86px auto;
    }

    .user-main {
        padding-left: 12px;
        padding-right: 12px;
    }

    .gold-market-hero,
    .mine-hero {
        padding: 18px;
    }

    .gold-market-hero h1 {
        font-size: 25px;
    }

    .mine-price-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .two-fields {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 380px) {
    .mine-price-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero-quote strong {
        font-size: 22px;
    }

    .record-actions {
        width: 100%;
        margin-left: 0;
    }
}
