﻿@font-face {
    font-family: Pinar;
    src: url("fonts/Pinar-Regular.ttf") format("truetype");
    font-display: swap;
}

html,
body {
    margin: 0;
    background: #0B0B0E;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* محتوای صفحه‌ها؛ ظاهرش با پنل ابر یکی است. */
.panel-content {
    color-scheme: dark;
    font-size: 15px;
}

.panel-content h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
}

.panel-content h2 {
    margin: 0 0 14px;
    font-size: 18px;
    font-weight: 600;
}

.panel-content h3 {
    margin: 20px 0 10px;
    font-size: 16px;
    font-weight: 600;
}

.panel-content a {
    color: #6EA8FF;
}

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    margin-bottom: 24px;
}

.page-head p {
    margin: 4px 0 0;
    color: #9C9CA8;
}

.panel-content input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.panel-content select,
.panel-content textarea {
    min-height: 40px;
    box-sizing: border-box;
    padding: 8px 12px;
    border-radius: 8px;
    font: inherit;
    color: #F4F3F8;
    background: #0B0B0E;
    border: 1px solid #36363F;
    outline: none;
}

.panel-content textarea {
    resize: vertical;
}

.panel-content input:focus,
.panel-content select:focus,
.panel-content textarea:focus {
    border-color: #3B82F6;
}

.panel-content input[type="checkbox"],
.panel-content input[type="radio"] {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: #2F6FEB;
}

.panel-content button {
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    color: #FFFFFF;
    background: #2F6FEB;
}

.panel-content button:hover {
    background: #3B82F6;
}

.panel-content button:disabled {
    opacity: 0.5;
    cursor: default;
}

.panel-content button.ghost {
    color: #C9C9D3;
    background: none;
    border-color: #36363F;
}

.panel-content button.ghost:hover {
    color: #F4F3F8;
    border-color: #3B82F6;
}

.panel-content button.danger {
    color: #FF8A94;
    background: none;
    border-color: #5A2A33;
}

.panel-content button.danger:hover {
    color: #FFFFFF;
    background: #C0394B;
    border-color: #C0394B;
}

.panel-content button.small {
    min-height: 30px;
    padding: 0 10px;
    font-size: 13px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.card {
    box-sizing: border-box;
    padding: 20px 22px;
    margin-bottom: 16px;
    border: 1px solid #2A2A32;
    border-radius: 14px;
    background: #101014;
}

.alert {
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 10px;
    color: #FFB4BB;
    background: #C0394B26;
    border: 1px solid #5A2A33;
}

.empty {
    padding: 48px 20px;
    text-align: center;
    color: #9C9CA8;
    border: 1px dashed #2A2A32;
    border-radius: 14px;
}

/* جدول داخل قاب خودش اسکرول افقی می‌خورد تا صفحه بیرون نزند. */
.table-card {
    overflow-x: auto;
    border: 1px solid #2A2A32;
    border-radius: 14px;
    background: #101014;
}

.computers-table {
    width: 100%;
    border-collapse: collapse;
}

.computers-table th,
.computers-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #2A2A32;
    text-align: start;
    vertical-align: middle;
    white-space: nowrap;
}

.computers-table th {
    font-size: 13px;
    font-weight: 400;
    color: #9C9CA8;
    background: #14141A;
}

.computers-table tbody tr:last-child td {
    border-bottom: 0;
}

.computers-table tbody tr:hover {
    background: #15151B;
}

.computers-table .wrap {
    white-space: normal;
    min-width: 160px;
}

.computers-table del {
    color: #7E7E8A;
}

.muted {
    color: #9C9CA8;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 13px;
    color: #9C9CA8;
    background: #1A1A21;
}

.pill::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.pill.on {
    color: #6FCF97;
    background: #6FCF971F;
}

.pill.busy {
    color: #A9CBFF;
    background: #2F6FEB2E;
}

/* دکمه‌ای که منتظر جواب ابر است. */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-inline-end: 8px;
    vertical-align: -2px;
    border: 2px solid currentColor;
    border-inline-end-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .spinner {
        animation-duration: 2s;
    }
}

.pill.warn {
    color: #F2C94C;
    background: #F2C94C1F;
}

.pill.off::before {
    background: #5A5A66;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.stat {
    padding: 16px 18px;
    border: 1px solid #2A2A32;
    border-radius: 12px;
    background: #101014;
}

.stat span {
    display: block;
    font-size: 13px;
    color: #9C9CA8;
}

.stat strong {
    display: block;
    margin-top: 4px;
    font-size: 26px;
    font-weight: 600;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px 16px;
}

.form-grid label {
    display: grid;
    gap: 6px;
    align-content: start;
    font-size: 14px;
    color: #C9C9D3;
}

.form-grid .wide {
    grid-column: 1 / -1;
}

.check {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
    padding: 0;
    list-style: none;
}

.chips li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px 4px 12px;
    border-radius: 999px;
    border: 1px solid #2A2A32;
    background: #0B0B0E;
}

[dir="rtl"] .chips li {
    padding: 4px 12px 4px 6px;
}

.option-group {
    margin: 0 0 12px;
    padding: 14px 16px;
    border: 1px solid #2A2A32;
    border-radius: 12px;
}

.option-group .row {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 10px;
    margin-bottom: 10px;
}

.option-group label {
    display: grid;
    gap: 6px;
    font-size: 14px;
    color: #C9C9D3;
}

.thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
}

.details {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 10px 24px;
    margin: 0 0 18px;
}

.details dt {
    color: #9C9CA8;
}

.details dd {
    margin: 0;
}

.error {
    color: #FF7A85;
}

/* حسابداری */
.notice {
    padding: 12px 16px;
    margin: 0 0 16px;
    border-radius: 10px;
    color: #C9C9D3;
    background: #2F6FEB1A;
    border: 1px solid #2F3E5C;
}

.notice.success {
    color: #A7F3C6;
    background: #1F9D5526;
    border-color: #245C3D;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.toolbar input[type="search"] {
    flex: 1 1 240px;
}

.segmented {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    margin-bottom: 16px;
    border: 1px solid #2A2A32;
    border-radius: 10px;
    background: #0B0B0E;
}

.page-head .segmented {
    margin-bottom: 0;
}

.panel-content .segmented button {
    min-height: 32px;
    color: #C9C9D3;
    background: none;
}

.panel-content .segmented button:hover {
    color: #F4F3F8;
    background: #1A1A22;
}

.panel-content .segmented button.active {
    color: #FFFFFF;
    background: #2F6FEB;
}

.range-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px 14px;
    margin-bottom: 8px;
}

.range-picker label,
.range-picker .range-date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #9C9CA8;
}

/* انتخاب تاریخ با تقویم زبان پنل. */
.date-field {
    position: relative;
}

.date-button,
.panel-content .date-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 4px 12px;
    border: 1px solid #2A2A32;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    color: #F4F3F8;
    background: #14141A;
}

.date-button:hover,
.date-button.open {
    border-color: #2F6FEB;
}

.date-button svg,
.date-step svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.date-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
}

.date-popup {
    position: absolute;
    top: calc(100% + 6px);
    inset-inline-start: 0;
    z-index: 41;
    width: 272px;
    padding: 10px;
    border: 1px solid #2A2A32;
    border-radius: 12px;
    background: #101014;
    box-shadow: 0 12px 32px #00000080;
}

.date-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    color: #F4F3F8;
}

.date-step,
.panel-content .date-step {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    color: #C9C9D3;
    background: none;
}

.date-step:hover {
    color: #FFFFFF;
    background: #FFFFFF12;
}

/* در راست‌به‌چپ ماه قبل سمت راست است، پس پیکان‌ها برمی‌گردند. */
.date-step:dir(rtl) svg {
    transform: scaleX(-1);
}

.date-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.date-weekday {
    padding: 4px 0;
    font-size: 11px;
    text-align: center;
    color: #8A8A96;
}

.date-day,
.panel-content .date-day {
    height: 32px;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    color: #E6E6EC;
    background: none;
    font-variant-numeric: tabular-nums;
}

.date-day:hover {
    background: #2F6FEB2E;
}

.date-day.today {
    box-shadow: inset 0 0 0 1px #2F6FEB;
}

.date-day.selected,
.panel-content .date-day.selected {
    color: #FFFFFF;
    background: #2F6FEB;
}

.date-today,
.panel-content .date-today {
    width: 100%;
    min-height: 30px;
    margin-top: 8px;
    border: 1px solid #2A2A32;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    color: #C9C9D3;
    background: none;
}

.date-today:hover {
    color: #FFFFFF;
    border-color: #2F6FEB;
}

.form-actions {
    margin-top: 16px;
}

.computers-table tr.clickable {
    cursor: pointer;
}

.computers-table tr.selected {
    background: #151C27;
}

.computers-table tr.total td {
    font-weight: 600;
    background: #14141A;
}

.positive {
    color: #6EE7A0;
}

/* موجودی زیر صفر هر جا که نشان داده شود قرمز است، حتی اگر آن جا رنگ خودش را داشته باشد. */
/* پرداخت رایگان همه‌جا سبز است. */
.free,
.panel-content .free {
    color: #3DD68C !important;
}

.negative,
.panel-content .negative {
    color: #FF7A85 !important;
}

.stat .small-value {
    font-size: 16px;
}

.alert:last-child {
    margin: 16px 0 0;
}

/* صفحه ورود بیرون از Blazor است و فقط همین فایل را دارد. */
.login-page {
    min-height: 100vh;
    margin: 0;
    box-sizing: border-box;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    color: #F4F3F8;
    font-family: Pinar, "Segoe UI", Tahoma, sans-serif;
    background:
        radial-gradient(circle at 20% 15%, #2F6FEB33, transparent 45%),
        radial-gradient(circle at 85% 90%, #1E4FB826, transparent 40%),
        #0B0B0E;
    color-scheme: dark;
}

/* مثل صفحهٔ ورود ابر: فرم در ابتدای سطر و نقشه در بقیهٔ صفحه، با رنگ آبی سرور. */
.login-split {
    position: fixed;
    inset: 0;
    margin: 0;
    overflow: auto;
    display: grid;
    grid-template-columns: minmax(0, 36fr) minmax(0, 64fr);
    color: #F4F3F8;
    font-family: Pinar, "Segoe UI", Tahoma, sans-serif;
    background: #07080C;
    color-scheme: dark;
}

.login-side {
    position: relative;
    min-height: 100%;
    box-sizing: border-box;
    padding: 40px 48px;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #0E121B, #0A0D14);
    border-inline-end: 1px solid #1C2433;
}

.login-card {
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    display: grid;
    gap: 20px;
}

.login-logo {
    height: 46px;
    width: auto;
    justify-self: start;
    margin-bottom: 18px;
}

.login-head {
    margin-bottom: 8px;
}

.login-head h1 {
    margin: 0;
    font-size: 34px;
    font-weight: 600;
}

.login-head p {
    margin: 6px 0 0;
    color: #9C9CA8;
    font-size: 16px;
}

.login-card .alert {
    margin: 0;
}

.login-field {
    display: grid;
    gap: 8px;
    font-size: 15px;
    color: #C9C9D3;
}

.login-input {
    position: relative;
    display: block;
}

.login-card svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-input > svg {
    position: absolute;
    top: 50%;
    inset-inline-start: 14px;
    transform: translateY(-50%);
    color: #868C99;
    pointer-events: none;
}

.login-input input {
    width: 100%;
    height: 50px;
    box-sizing: border-box;
    padding: 0 14px;
    padding-inline-start: 44px;
    border-radius: 12px;
    font: inherit;
    font-size: 15px;
    color: #F4F3F8;
    background: #10141E;
    border: 1px solid #2C3444;
    outline: none;
}

.login-input input::placeholder {
    color: #6E7380;
}

.login-input input:focus {
    border-color: #3B82F6;
}

.login-input.password input {
    padding-inline-end: 46px;
}

.login-eye {
    position: absolute;
    top: 0;
    bottom: 0;
    inset-inline-end: 6px;
    width: 36px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    cursor: pointer;
    color: #8A8A96;
    background: none;
}

.login-eye:hover,
.login-eye.on {
    color: #F4F3F8;
}

.login-submit {
    height: 52px;
    margin-top: 8px;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    font: inherit;
    font-size: 17px;
    font-weight: 600;
    color: #FFFFFF;
    background: linear-gradient(90deg, #3B82F6, #2A6CCB);
    box-shadow: 0 10px 30px #2A6CCB55;
}

.login-submit:hover {
    background: linear-gradient(90deg, #4A92FF, #3B82F6);
}

.login-foot {
    margin: 4px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6E7380;
}

.login-foot i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #3DD68C;
    box-shadow: 0 0 8px #3DD68C;
}

.login-map {
    position: relative;
    min-height: 100%;
    overflow: hidden;
    background: radial-gradient(55% 55% at 50% 48%, #0F2350 0%, #0A1222 50%, #07080C 100%);
}

.login-map-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(#FFFFFF07 1px, transparent 1px),
        linear-gradient(90deg, #FFFFFF07 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(circle at 55% 50%, #000 30%, transparent 75%);
    mask-image: radial-gradient(circle at 55% 50%, #000 30%, transparent 75%);
}

.login-map svg {
    position: absolute;
    inset: 6%;
    width: 88%;
    height: 88%;
}

.map-edge {
    fill: #3B82F6;
    opacity: 0.35;
    filter: url(#login-edge);
}

.map-province {
    fill: #111B30;
    stroke: #3F68B0;
}

.map-link {
    fill: none;
    stroke: #6EA8FF;
    stroke-opacity: 0.55;
    animation: login-flow 1.4s linear infinite;
}

/* سیستم‌های گیمینگ: کاشی تیره با لبهٔ نئونی و چراغ روشن. */
.map-node {
    animation: login-node 3.2s ease-in-out infinite;
}

.map-node-glow {
    fill: #3B82F6;
    opacity: 0.18;
    filter: url(#login-glow-local);
}

.map-node-box {
    fill: #0D1526;
    stroke: url(#login-node-edge);
    stroke-width: 0.7;
}

.map-node-icon {
    fill: #CFE2FF;
}

.map-node-screen {
    fill: url(#login-node-edge);
    opacity: 0.55;
    animation: login-screen 2.4s ease-in-out infinite;
}

@keyframes login-screen {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.75; }
}

.map-node-on {
    fill: #3DD68C;
    stroke: #0D1526;
    stroke-width: 0.6;
    filter: url(#login-glow-local);
}

@keyframes login-node {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; }
}

.map-packet {
    fill: #FFFFFF;
    filter: url(#login-glow);
}

.map-ring {
    fill: none;
    stroke: #A9CBFF;
}

/* لوگوی مرکز به جای نقطهٔ شهر، فقط با سایهٔ نورانی. */
.map-badge image {
    filter: drop-shadow(0 0 1.2px #3B82F6A0);
}

.map-name {
    fill: #F4F3F8;
    font-weight: 600;
    text-anchor: middle;
    paint-order: stroke;
    stroke: #07070B;
}

@keyframes login-flow {
    to { stroke-dashoffset: -40; }
}

@media (max-width: 1000px) {
    .login-split {
        grid-template-columns: minmax(0, 1fr);
    }

    .login-map {
        display: none;
    }

    .login-side {
        padding: 16px;
        border: 0;
    }

    .login-logo {
        justify-self: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .map-link { animation: none; }
}

/* ساعت‌ها: هر سبک یک ظاهر و یک تم رنگی است. رنگ‌ها از متغیرهای تم می‌آیند
   و اندازه‌ها با container query همراه ویجت بزرگ و کوچک می‌شوند. */
.clock-frame,
.style-swatch {
    --clock-bg: transparent;
    --clock-fg: #F4F3F8;
    --clock-dim: #9C9CA8;
    --clock-accent: #A9CBFF;
    --clock-face: #0B0B0E;
    --clock-line: #2A2A32;
    --clock-off: #FFFFFF0D;
    --clock-card: #1A1A21;
}

.clock-theme-neon { --clock-bg: #050A06; --clock-fg: #B6FFB0; --clock-dim: #5FA86A; --clock-accent: #39FF6A; --clock-face: #07110A; --clock-line: #12351B; --clock-off: #39FF6A14; --clock-card: #0C1A10; }
.clock-theme-ice { --clock-bg: #07121A; --clock-fg: #E6F6FF; --clock-dim: #7FA9C2; --clock-accent: #5CC8FF; --clock-face: #0A1822; --clock-line: #173447; --clock-off: #5CC8FF14; --clock-card: #0F2230; }
.clock-theme-sunset { --clock-bg: linear-gradient(135deg, #2A0E2E, #3A1420); --clock-fg: #FFE9DC; --clock-dim: #D49A8C; --clock-accent: #FF7A59; --clock-face: #1E0B1C; --clock-line: #4A2236; --clock-off: #FF7A5914; --clock-card: #3A1630; }
.clock-theme-mono { --clock-bg: #000000; --clock-fg: #FFFFFF; --clock-dim: #888888; --clock-accent: #FFFFFF; --clock-face: #0A0A0A; --clock-line: #333333; --clock-off: #FFFFFF10; --clock-card: #161616; }
.clock-theme-amber { --clock-bg: #120B02; --clock-fg: #FFD08A; --clock-dim: #A88343; --clock-accent: #FFB000; --clock-face: #1A1104; --clock-line: #3D2A08; --clock-off: #FFB00014; --clock-card: #21160A; }
.clock-theme-paper { --clock-bg: #26231F; --clock-fg: #F3EFE6; --clock-dim: #B5AC9C; --clock-accent: #E0533F; --clock-face: #1F1D1A; --clock-line: #4A453D; --clock-off: #F3EFE610; --clock-card: #2E2A25; }
.clock-theme-red { --clock-bg: #0D0303; --clock-fg: #FFB3B3; --clock-dim: #A05050; --clock-accent: #FF2D2D; --clock-face: #140505; --clock-line: #3A0D0D; --clock-off: #FF2D2D14; --clock-card: #1E0707; }
.clock-theme-gold { --clock-bg: #0E0C08; --clock-fg: #F5E6C4; --clock-dim: #A8956A; --clock-accent: #D4AF37; --clock-face: #15120B; --clock-line: #3B321C; --clock-off: #D4AF3714; --clock-card: #1E1A10; }
.clock-theme-mint { --clock-bg: #06140F; --clock-fg: #E3FFF6; --clock-dim: #6FB5A0; --clock-accent: #3DDCB0; --clock-face: #0A1E17; --clock-line: #16413A; --clock-off: #3DDCB014; --clock-card: #0E2A21; }

/* تا منوی کلیک راست PCها باز است، ویجت بالای منوی کناری و نوار بالا می‌نشیند و blur را برمی‌دارد تا
   منوی fixed نسبت به صفحه جا بگیرد؛ محتوای ویجت بیرون نمی‌ریزد چون منو fixed است و بریده نمی‌شود. */
.widget:has(.ctx-menu) {
    z-index: 55 !important;
    backdrop-filter: none !important;
}

/* Above the side menu (30), so a dialog and its backdrop cover it too. */
.widget:has(.widget-dialog) {
    z-index: 40 !important;
    overflow: visible !important;
    backdrop-filter: none !important;
}

/* پنجره‌هایی که ویجت‌ها باز می‌کنند، مثل ساخت بازیکن و جزئیات حساب. */
.widget-dialog .new-user-done {
    margin: 0;
    font-size: 15px;
    color: #5FD69C;
}

.dialog-link {
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    border-radius: 8px;
    color: #F4F3F8;
    background: #2F6FEB;
}

.widget-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: #00000099;
}

.widget-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 61;
    width: min(440px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 20px;
    border: 1px solid #2A2A32;
    border-radius: 14px;
    transform: translate(-50%, -50%);
    background: #101014;
    box-shadow: 0 16px 48px #000000A0;
}

.widget-dialog h2 {
    margin: 0 0 14px;
    font-size: 18px;
}

.widget-dialog fieldset {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    border: 0;
}

.widget-dialog label {
    display: grid;
    gap: 4px;
    font-size: 13px;
    color: #9C9CA8;
}

.widget-dialog input,
.widget-dialog textarea {
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid #2A2A32;
    border-radius: 8px;
    font: inherit;
    font-size: 14px;
    color: #F4F3F8;
    background: #1A1A21;
}

.widget-dialog textarea {
    resize: vertical;
}

.widget-dialog textarea::placeholder {
    color: #6E6E7A;
}

.dialog-hint {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: #C9C9D3;
}

.widget-dialog .required-updates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    margin: 14px 0 0;
    padding: 0;
    border: 0;
}

.widget-dialog label.required-update {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #E6E6EC;
    cursor: pointer;
}

.widget-dialog .required-update input {
    min-height: 0;
    width: 16px;
    height: 16px;
    accent-color: #3B82F6;
}

.dialog-error {
    margin: 10px 0 0;
    color: #FF8A80;
}

.dialog-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

/* هر مورد یک خانه است: عنوان کوچک بالا، مقدار زیرش، هر دو راست‌چین. */
/* یک قاب دور کل زبانه، از ردیف‌ها تا دکمه‌های پایین. */
.account-info {
    /* flex پر می‌کند؛ min-height: 100% با قاب ۲ پیکسل بلندتر می‌شد و زبانه اسکرول می‌خورد. */
    flex: 1;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    border: 1px solid #2A2A32;
    border-radius: 10px;
}

.account-info fieldset {
    display: grid;
    /* دو مشخصه در هر ردیف تا زبانه اسکرول نخورد؛ ایمیل و تاریخ تولد تمام‌عرض‌اند. */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    margin: 0;
    padding: 0;
    border: 0;
}

.account-info-row {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 4px 12px;
    border-bottom: 1px solid #1E1E25;
    font-size: 14px;
}

.account-info-row:last-child {
    border-bottom: 0;
}

.account-info-row.wide {
    grid-column: 1 / -1;
}

/* یادداشت فضای خالی پایین قاب را پر می‌کند. */
.account-info fieldset {
    flex: 1;
    /* شش ردیف مشخصات به اندازهٔ خودشان، ردیف آخر یادداشت بقیهٔ ارتفاع را می‌گیرد. */
    grid-template-rows: repeat(7, auto) minmax(56px, 1fr);
}

.account-note {
    align-items: stretch;
    align-self: stretch;
    min-height: 56px;
    padding-block: 10px;
}

.account-note > span {
    padding-top: 6px;
}

.account-note p {
    margin: 0;
    overflow-y: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 14px;
}

.account-note textarea,
.panel-content .account-note textarea {
    width: 100%;
    height: 100%;
    min-height: 40px;
    box-sizing: border-box;
    resize: none;
}

.account-info-row > span {
    color: #9C9CA8;
}

.account-info-row strong {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    unicode-bidi: plaintext;
}

.account-info-row input,
.account-info-row select {
    min-height: 34px;
}

.account-info-row input[dir="ltr"] {
    text-align: right;
}

.phone-field {
    display: flex;
    gap: 8px;
}

.phone-field select {
    flex: none;
    width: 96px;
}

.phone-field input {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.national-field {
    display: flex;
    align-items: center;
    gap: 10px;
}

.national-field input {
    flex: 1;
    min-width: 0;
}

input.invalid,
.panel-content input.invalid {
    border-color: #E5383B;
}

.field-error {
    flex: none;
    font-size: 12px;
    color: #FF7A85;
}

/* دکمه‌ها هم‌اندازه، کنار هم در گوشهٔ پایین؛ پیام در سمت دیگر. */
.account-info-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: auto;
    padding: 10px 12px;
    border-top: 1px solid #1E1E25;
}

.account-info-actions p {
    margin: 0;
    margin-inline-end: auto;
}

.account-info-actions button,
.panel-content .account-info-actions button {
    width: 120px;
    height: 38px;
    padding: 0 12px;
}

.birth-picker {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
}

/* روز، ماه و سال اندازهٔ ثابت دارند تا روی هم نیفتند؛ سن بقیهٔ جا را می‌گیرد. */
.birth-picker {
    min-width: 0;
}

.birth-picker select,
.panel-content .birth-picker select {
    flex: none;
    min-width: 0;
    padding-inline: 8px;
}

.birth-picker select:nth-of-type(1) {
    width: 72px;
}

.birth-picker select:nth-of-type(2) {
    width: 120px;
}

.birth-picker select:nth-of-type(3) {
    width: 90px;
}

.birth-view {
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
}

.birth-view strong {
    flex: none;
}

/* سن در یک برچسب با زمینهٔ خودش. */
.birth-age {
    min-width: 0;
    overflow: hidden;
    padding: 2px 10px;
    border-radius: 999px;
    background: #2F6FEB2E;
    font-size: 13px;
    color: #E6E6EC;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.account-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.account-details > div {
    display: grid;
    gap: 2px;
    padding: 8px 12px;
    border-radius: 10px;
    text-align: right;
    background: #1A1A21;
}

.account-details dt {
    font-size: 12px;
    color: #9C9CA8;
}

.account-details dd {
    margin: 0;
    overflow: hidden;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.account-details dd[dir="ltr"] {
    unicode-bidi: plaintext;
    text-align: right;
}

/* نوار بالای پنجرهٔ جزئیات بازیکن. */
/* کل پنجره و هرچه در آن است ۲۰٪ کوچک‌تر نشان داده می‌شود. */
.account-dialog {
    zoom: 0.8;
    width: min(880px, calc(100vw - 32px));
    /* ارتفاع ثابت است تا با عوض شدن زبانه پنجره کوتاه و بلند نشود؛ محتوای زبانه خودش اسکرول می‌خورد. */
    height: min(800px, calc((100vh - 32px) / 0.8));
    max-height: calc((100vh - 32px) / 0.8);
    /* گوشهٔ پایین را بکشید تا پنجره بزرگ و کوچک شود، تا اندازهٔ صفحه. */
    resize: both;
    min-width: 560px;
    min-height: 420px;
    max-width: calc((100vw - 32px) / 0.8);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding-top: 0;
}

/* پیام‌های کوتاه بالای صفحه که بعد از چند ثانیه محو می‌شوند؛ روی پنجره‌ها هم دیده می‌شوند. */
.snackbar-stack {
    position: fixed;
    left: 50%;
    top: 16px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transform: translateX(-50%);
    pointer-events: none;
}

.snackbar {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: min(320px, calc(100vw - 32px));
    max-width: min(600px, calc(100vw - 32px));
    padding: 14px 20px;
    border: 2px solid #2A2A32;
    border-radius: 12px;
    background: #1A1A21;
    color: #E6E6EC;
    font-size: 16px;
    font-weight: 500;
    box-shadow: 0 10px 32px #000000B3;
    pointer-events: none;
    overflow-wrap: anywhere;
    animation: snackbar-in .2s ease-out, snackbar-out .3s ease-in 4s forwards;
}

.snackbar svg {
    flex: none;
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.snackbar.done {
    border-color: #3DD68C;
    background: #12261C;
    color: #5FD69C;
}

.snackbar.error {
    border-color: #FF7A85;
    background: #2A1517;
    color: #FF8A80;
}

@keyframes snackbar-in {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes snackbar-out {
    to { opacity: 0; visibility: hidden; }
}

/* دکمه‌های بالا و زبانه‌های کنار به اندازهٔ قبل می‌مانند. */
.account-dialog .dialog-menus,
.account-dialog .account-tabs {
    zoom: 1.25;
}

/* حاشیه‌های منفی هم بزرگ می‌شوند، پس به اندازهٔ زوم کم می‌شوند تا نوار از پنجره بیرون نزند. */
.account-dialog .dialog-menus {
    margin: -12.8px -16px 12.8px;
    padding: 4.8px 16px;
}

.account-dialog .dialog-actions {
    margin-top: auto;
    padding-top: 16px;
}

/* دکمهٔ بستن همیشه سمت چپ است و نام و وضعیت سمت راست. */
.dialog-bar {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 10px;
    margin: 0 -20px 16px;
    padding: 4px 20px 4px 8px;
    border-bottom: 1px solid #2A2A32;
    background: #101014;
    direction: ltr;
}

.dialog-bar h2 {
    text-align: right;
}

.dialog-bar h2 {
    flex: 1;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    font-size: 14px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.dialog-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 12px;
    color: #9C9CA8;
    background: #1A1A21;
}

.dialog-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #5A5A66;
}

.dialog-status.online {
    color: #5FD69C;
}

.dialog-status.online .dot {
    background: #2F9E6A;
}

/* .panel-content button رنگ می‌دهد؛ دکمهٔ بستن فقط آیکون است. */
.dialog-close,
.panel-content .dialog-close,
.panel-content .dialog-close:hover {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    color: #9C9CA8;
    background: none;
}

.dialog-close:hover,
.panel-content .dialog-close:hover {
    color: #F4F3F8;
}

.dialog-close svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

/* دو منوی کشویی نوار بالای جزئیات بازیکن. */
.dialog-menus {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-start;
    gap: 4px;
    margin: -16px -20px 16px;
    padding: 6px 20px;
    border-bottom: 1px solid #2A2A32;
    direction: ltr;
}

.dialog-menu {
    position: relative;
}

.dialog-menu-button,
.panel-content .dialog-menu-button,
.panel-content .dialog-menu-button:hover {
    display: inline-flex;
    align-items: center;
    flex-direction: row-reverse;
    gap: 8px;
    min-height: 65px;
    padding: 0 14px;
    border: 1px solid #2A2A32;
    border-radius: 9px;
    cursor: pointer;
    font: inherit;
    font-size: 15px;
    color: #C9C9D3;
    background: none;
}

.dialog-menu-button.open,
.panel-content .dialog-menu-button.open {
    border-color: #2F6FEB;
    color: #F4F3F8;
}

.dialog-menu-list {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 3;
    min-width: 240px;
    margin: 0;
    padding: 6px;
    list-style: none;
    border: 1px solid #2A2A32;
    border-radius: 10px;
    background: #101014;
    box-shadow: 0 12px 32px #00000080;
}

.dialog-menu-list .line {
    height: 1px;
    margin: 4px 6px;
    background: #2A2A32;
}

.dialog-menu-list button,
.panel-content .dialog-menu-list button {
    width: 100%;
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 4px 10px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-size: 15px;
    text-align: right;
    color: #F4F3F8;
    background: none;
}

.dialog-menu-list button:hover,
.panel-content .dialog-menu-list button:hover {
    background: #2F6FEB2E;
}

.dialog-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
}

.dialog-status.locked {
    color: #FF8A80;
}

.dialog-status.locked .dot {
    background: #E0533F;
}

.account-action {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid #2A2A32;
    border-radius: 12px;
}

.account-action h3 {
    margin: 0 0 10px;
    font-size: 15px;
}

.account-action fieldset {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.account-action select {
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid #2A2A32;
    border-radius: 8px;
    font: inherit;
    font-size: 14px;
    color: #F4F3F8;
    background: #1A1A21;
}

.dialog-done {
    margin: 10px 0 0;
    color: #5FD69C;
}

.dialog-menu-icon {
    width: 25px;
    height: 25px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* دکمه‌های آیکون‌دار ردیف کارهای جزئیات بازیکن. */
.dialog-tool,
.panel-content .dialog-tool,
.panel-content .dialog-tool:hover {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 76px;
    min-height: 52px;
    padding: 6px 8px;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    color: #C9C9D3;
    background: none;
}

.dialog-tool:hover,
.panel-content .dialog-tool:hover,
.dialog-tool.open,
.panel-content .dialog-tool.open {
    border-color: #2A2A32;
    color: #F4F3F8;
    background: #FFFFFF0D;
}

/* فروشگاه روی پنجرهٔ جزئیات باز می‌شود. */
.shop-backdrop {
    z-index: 62;
}

.shop-dialog {
    z-index: 63;
    width: min(960px, calc(100vw - 32px));
    height: min(620px, calc(100vh - 32px));
    display: flex;
    flex-direction: column;
    padding-top: 0;
}

.shop-body {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 16px;
}

.shop-products {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shop-search {
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid #2A2A32;
    border-radius: 8px;
    font: inherit;
    color: #F4F3F8;
    background: #1A1A21;
}

.shop-grid {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
    align-content: start;
    gap: 8px;
}

.shop-tile,
.panel-content .shop-tile,
.panel-content .shop-tile:hover {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    min-height: 0;
    padding: 6px 6px 8px;
    overflow: hidden;
    border: 1px solid #2A2A32;
    border-radius: 10px;
    cursor: pointer;
    font: inherit;
    text-align: start;
    color: #F4F3F8;
    background: #1A1A21;
}

.shop-tile:hover,
.panel-content .shop-tile:hover {
    border-color: #2F6FEB;
}

.shop-tile strong {
    padding: 0 4px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shop-tile .shop-tile-price {
    padding: 0 4px;
    font-size: 12px;
    color: #5FD69C;
}

.shop-tile-image {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 7px;
    object-fit: cover;
    background: #101014;
}

.shop-tile .shop-tile-letter {
    display: grid;
    place-items: center;
    font-size: 28px;
    font-weight: 600;
    color: #4A4A55;
}

/* انتخاب گزینه‌های یک محصول، جای فهرست محصول‌ها. */
.shop-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    overflow-y: auto;
}

.shop-options h3 {
    margin: 0;
    font-size: 15px;
}

.shop-option-group {
    display: grid;
    gap: 6px;
}

.shop-option-name {
    font-size: 13px;
    color: #9C9CA8;
}

.shop-option-values {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.shop-categories {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    flex: none;
}

.shop-categories button,
.panel-content .shop-categories button,
.shop-option-values button,
.panel-content .shop-option-values button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #2A2A32;
    border-radius: 8px;
    background: #1A1A21;
    color: #E6E6EC;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.shop-categories button {
    white-space: nowrap;
}

.shop-categories button.active,
.panel-content .shop-categories button.active,
.shop-option-values button.active,
.panel-content .shop-option-values button.active {
    border-color: #3B82F6;
    background: #2F6FEB2E;
}

.shop-option-values small {
    color: #5FD69C;
}

.shop-line-name small {
    display: block;
    font-size: 11px;
    color: #9C9CA8;
}

.shop-cart .add-money-pos {
    margin-top: 0;
}

.shop-cart {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border: 1px solid #2A2A32;
    border-radius: 12px;
}

.shop-cart h3 {
    margin: 0;
    font-size: 15px;
}

.shop-cart ul {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: grid;
    align-content: start;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.shop-cart li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 8px;
    align-items: center;
}

.shop-line-name {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.shop-line-price {
    grid-column: 1 / -1;
    font-size: 12px;
    color: #9C9CA8;
}

.shop-qty {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.shop-qty button,
.panel-content .shop-qty button {
    width: 26px;
    min-height: 26px;
    padding: 0;
    border: 1px solid #2A2A32;
    border-radius: 6px;
    color: #F4F3F8;
    background: none;
}

.shop-total {
    display: flex;
    justify-content: space-between;
    margin: 0;
}

.shop-order {
    width: 100%;
}

.dialog-menu-list button.danger,
.panel-content .dialog-menu-list button.danger {
    color: #FF4D4F;
    background: #FF4D4F1A;
}

.dialog-menu-list button.danger:hover,
.panel-content .dialog-menu-list button.danger:hover {
    color: #FFFFFF;
    background: #E5383B;
}

/* زبانه‌های پنجرهٔ بازیکن: آیکون‌های بزرگ مربعی در یک سمت. */
.account-tabs-layout {
    flex: 1;
    display: flex;
    gap: 16px;
    min-height: 0;
}

.account-tabs {
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.account-tab,
.panel-content .account-tab {
    width: 72px;
    height: 68px;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px;
    border: 1px solid #2A2A32;
    border-radius: 12px;
    font: inherit;
    font-size: 12px;
    line-height: 1.2;
    text-align: center;
    color: #C9C9D3;
    background: #15151B;
    cursor: pointer;
}

.account-tab:hover,
.panel-content .account-tab:hover {
    color: #F4F3F8;
    background: #2F6FEB2E;
}

.account-tab.active,
.panel-content .account-tab.active {
    color: #FFFFFF;
    border-color: #3B82F6;
    background: #2F6FEB59;
}

.account-tab .dialog-menu-icon,
.account-option .dialog-menu-icon {
    width: 28px;
    height: 28px;
}

.account-tab-body {
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.account-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
}

.account-option,
.panel-content .account-option {
    min-height: 96px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid #2A2A32;
    border-radius: 12px;
    font: inherit;
    font-size: 13px;
    text-align: center;
    color: #F4F3F8;
    background: #1A1A21;
    cursor: pointer;
}

.account-option:hover,
.panel-content .account-option:hover {
    background: #2F6FEB2E;
}

.account-option.danger,
.panel-content .account-option.danger {
    color: #FF4D4F;
    background: #FF4D4F1A;
}

.account-option.danger:hover,
.panel-content .account-option.danger:hover {
    color: #FFFFFF;
    background: #E5383B;
}

/* گزارش شخصی بازیکن در پنجرهٔ او. */
.account-log-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.account-log-bar .account-recent-tabs {
    margin: 0;
}

.account-log-search,
.panel-content .account-log-search {
    flex: 1;
    min-width: 0;
    max-width: 260px;
    margin-inline-start: auto;
    padding: 5px 10px;
    font-size: 13px;
}

/* گزارش تا پایین زبانه را پر می‌کند و خودش اسکرول می‌خورد. */
.account-log {
    flex: 1;
    min-height: 0;
    box-sizing: border-box;
    overflow: auto;
    border: 1px solid #2A2A32;
    border-radius: 10px;
}

.account-log table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.account-log th,
.account-log td {
    padding: 7px 10px;
    text-align: right;
    white-space: nowrap;
    border-bottom: 1px solid #1E1E25;
}

.account-log th {
    position: sticky;
    top: 0;
    font-weight: 600;
    color: #9C9CA8;
    background: #15151B;
}

.account-log td[dir="ltr"] {
    unicode-bidi: plaintext;
}

/* خلاصهٔ حساب: عکس بزرگ و جدول ۳ در ۲ کنارش، بعد اشتراک، تراکنش‌ها و جمع‌ها. */
.account-profile {
    display: flex;
    align-items: stretch;
    gap: 16px;
}

.account-avatar {
    flex: none;
    align-self: stretch;
    box-sizing: border-box;
    width: 134px;
    height: auto;
    min-height: 134px;
    overflow: hidden;
    object-fit: cover;
    display: grid;
    place-items: center;
    border-radius: 16px;
    font-size: 52px;
    line-height: 1;
    font-weight: 700;
    color: #FFFFFF;
    background: none;
}

.account-profile-grid {
    flex: 1;
    min-width: 0;
}

.account-profile-grid > div {
    align-content: center;
    gap: 2px;
    padding: 5px 12px;
}

.account-profile-grid dd {
    line-height: 1.3;
}

.account-status-tile dd {
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.account-ban,
.panel-content .account-ban {
    flex: none;
    min-height: 26px;
    padding: 0 10px;
    border: 1px solid #36363F;
    border-radius: 7px;
    font: inherit;
    font-size: 12px;
    color: #F4F3F8;
    background: #22222A;
    cursor: pointer;
}

.account-ban.danger,
.panel-content .account-ban.danger {
    color: #FF4D4F;
    border-color: #FF4D4F66;
    background: #FF4D4F1A;
}

.account-ban.danger:hover,
.panel-content .account-ban.danger:hover {
    color: #FFFFFF;
    background: #E5383B;
}

.account-recent .account-subscription li {
    grid-template-columns: minmax(0, 1fr) auto;
}

.account-recent h3 {
    margin: 0 0 6px;
    font-size: 13px;
    color: #9C9CA8;
}

.catalog-suggest {
    display: grid;
    gap: 4px;
    padding: 8px;
    border: 1px solid #2A2A32;
    border-radius: 10px;
    background: #15151B;
}

.catalog-suggest-title {
    font-size: 12px;
    color: #9C9CA8;
}

.catalog-suggest button,
.panel-content .catalog-suggest button {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    padding: 6px 10px;
    border: 1px solid #2A2A32;
    border-radius: 8px;
    background: #1A1A21;
    color: #9C9CA8;
    font-size: 12px;
    text-align: start;
    cursor: pointer;
}

.catalog-suggest button:hover,
.panel-content .catalog-suggest button:hover {
    border-color: #3B82F6;
}

.catalog-suggest strong {
    font-size: 14px;
    color: #F4F3F8;
}

.catalog-picked {
    margin: 0;
    font-size: 12px;
    color: #3DD68C;
}

/* پنجرهٔ افزودن پول اسکرول نمی‌خورد؛ هر روش یک ردیف کوتاه است. */
.widget-dialog .add-money-part {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 4px 4px 4px 10px;
    border: 1px solid #2A2A32;
    border-radius: 10px;
    color: #9C9CA8;
}

.widget-dialog .add-money-part.active {
    border-color: #3B82F6;
    background: #2F6FEB1F;
    color: #F4F3F8;
}

/* مبلغی که روی کارت‌خوان پرداخت شده: سبز و قفل. */
.widget-dialog .add-money-part.paid {
    border-color: #3DD68C;
    background: #3DD68C1F;
    color: #3DD68C;
}

.widget-dialog .add-money-part.paid input {
    color: #3DD68C;
    opacity: 1;
}

.add-money-part input {
    min-width: 0;
    text-align: left;
}

.add-money-pos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

/* دکمهٔ کارت‌خوان بی‌رنگ است؛ میانبر یک برچسب کوچک کم‌رنگ کنار نام. */
.add-money-pos button,
.panel-content .add-money-pos button {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid #36363F;
    background: #1A1A21;
    color: #E6E6EC;
}

.add-money-pos button:hover:not(:disabled),
.panel-content .add-money-pos button:hover:not(:disabled) {
    border-color: #4A4A55;
    background: #22222B;
}

.add-money-pos kbd {
    padding: 0 6px;
    border-radius: 4px;
    background: #0E0E12;
    color: #8A8A96;
    font-family: inherit;
    font-size: 11px;
    line-height: 18px;
}

.add-time-backdrop {
    z-index: 62;
}

/* پنجره با پیام خطا بلندتر می‌شود و اسکرول نمی‌خورد. */
.add-time-dialog,
.add-money-dialog {
    z-index: 63;
    width: min(420px, calc(100vw - 32px));
    max-height: none;
    overflow: visible;
}

.add-time-dialog [role="alert"] {
    overflow-wrap: anywhere;
}

.add-time-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.add-time-steps button,
.panel-content .add-time-steps button {
    min-height: 32px;
    padding: 0;
    border: 1px solid #2A2A32;
    border-radius: 8px;
    background: #1A1A21;
    color: #F4F3F8;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}

.add-time-steps button:hover,
.panel-content .add-time-steps button:hover {
    border-color: #2F6FEB;
}

.add-time-price {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 0;
    padding: 8px 12px;
    border-radius: 10px;
    background: #1A1A21;
    font-size: 13px;
    color: #9C9CA8;
}

.add-time-price strong {
    font-size: 17px;
    color: #F4F3F8;
}

.add-time-rate {
    margin: -4px 0 0;
    font-size: 12px;
    color: #9C9CA8;
}

.shop-method {
    display: grid;
    gap: 4px;
    margin: 8px 0;
    font-size: 13px;
    color: #9C9CA8;
}

.account-recent-tabs {
    display: flex;
    gap: 4px;
    margin: 0 0 6px;
}

.account-recent-tabs button,
.panel-content .account-recent-tabs button {
    padding: 3px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #9C9CA8;
    font-size: 13px;
    cursor: pointer;
}

.account-recent-tabs button.active,
.panel-content .account-recent-tabs button.active {
    background: #1A1A21;
    color: #E6E6EC;
}

/* فهرست زمان‌ها خودش اسکرول می‌خورد تا پنجره بلند نشود. */
/* بخش تراکنش‌ها جای خالی تا جمع‌ها را می‌گیرد؛ فهرست زمان‌ها تا همان‌جا بلند می‌شود و بعد خودش اسکرول می‌خورد. */
.account-recent {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.account-recent .account-times {
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.account-recent .account-times li {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
}

.account-time-method {
    font-size: 12px;
    color: #C9C9D3;
}

.account-time-move {
    display: inline-flex;
    gap: 4px;
}

.account-time-move button,
.panel-content .account-time-move button {
    width: 24px;
    height: 22px;
    padding: 0;
    border: 1px solid #2A2A32;
    border-radius: 6px;
    background: #1A1A21;
    color: #E6E6EC;
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
}

.account-time-delete,
.panel-content .account-time-delete {
    color: #FF6B6B;
}

.account-time-delete.armed,
.panel-content .account-time-delete.armed {
    width: auto;
    padding: 0 6px;
    color: #FFFFFF;
    border-color: #E5383B;
    background: #E5383B;
}

/* Settle debt is the way out for a player who owes. */
.account-dialog .dialog-tool.settle,
.panel-content .account-dialog .dialog-tool.settle {
    border-color: #6B3A3D;
    color: #FFB4AE;
}

.account-time-move button:disabled,
.panel-content .account-time-move button:disabled {
    opacity: 0.35;
    cursor: default;
}

.account-recent ul {
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1px solid #2A2A32;
    border-radius: 10px;
}

.account-recent li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(90px, auto);
    align-items: center;
    gap: 12px;
    padding: 5px 12px;
    font-size: 13px;
    border-bottom: 1px solid #1E1E25;
}

/* آخرین تراکنش‌ها: نوع، روش پرداخت، زمان و مبلغ. */
.account-recent .account-recent-log li {
    grid-template-columns: minmax(0, 1fr) auto auto minmax(90px, auto);
}

.account-recent .account-recent-log li.selected {
    background: #2F6FEB2E;
}

/* منوی کلیک راست روی یک تراکنش، کنار نشانگر ماوس. */
.row-menu-backdrop {
    z-index: 89;
}

.dialog-menu-list.row-menu {
    position: fixed;
    right: auto;
    z-index: 90;
}

.account-recent li:last-child {
    border-bottom: 0;
}

.account-recent-when {
    font-size: 12px;
    color: #9C9CA8;
    unicode-bidi: plaintext;
    text-align: right;
}

.account-recent strong {
    unicode-bidi: plaintext;
    text-align: left;
}

/* جمع‌ها به پایین پنجره می‌چسبند. */
.account-totals {
    display: grid;
    gap: 3px;
    margin: auto 0 0;
    padding: 8px 14px;
    border-radius: 12px;
    background: #15151B;
}

.account-totals > div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 14px;
}

.account-totals dt {
    color: #9C9CA8;
}

.account-totals dd {
    margin: 0;
    font-weight: 600;
}

.account-totals hr {
    width: 100%;
    margin: 4px 0;
    border: 0;
    border-top: 1px solid #2A2A32;
}

.account-totals .account-remaining {
    font-size: 17px;
}

.account-totals .account-remaining dt {
    color: #F4F3F8;
}

.account-totals .account-remaining dd {
    font-weight: 700;
    color: #8FB4FF;
}

.account-totals .account-paid dt {
    color: #F4F3F8;
}

/* ویجت‌های دکمه‌ای (بازیکن جدید، فروش حضوری، شارژ و زمان سریع) یک شکل دارند و کل ویجت را پر می‌کنند. */
.panel-content .widget-button {
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px dashed #2F6FEB80;
    border-radius: 10px;
    cursor: pointer;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    color: #F4F3F8;
    background: #2F6FEB1F;
}

.panel-content .widget-button:hover {
    background: #2F6FEB38;
}

.panel-content .widget-button svg {
    width: 22px;
    height: 22px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.panel-content .widget-button span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* لاگ کامل: هر نوع رنگ خودش را دارد و نام بازیکن پنجره‌اش را باز می‌کند. */
.log-table td {
    padding-block: 10px;
}

.log-table tbody tr:nth-child(even) {
    background: #0F0F13;
}

.log-table tbody tr:hover {
    background: #17171E;
}

.log-when {
    font-size: 13px;
    color: #9C9CA8;
    font-variant-numeric: tabular-nums;
}

.log-kind {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.log-kind::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.log-kind.money {
    color: #6EE7A8;
    background: #10B98122;
}

.log-kind.admin {
    color: #A9CBFF;
    background: #2F6FEB26;
}

.log-kind.player {
    color: #7CC4FF;
    background: #3B82F622;
}

.log-amount {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* زمان بالا و موجودی زیرش؛ قبل، مصرف و مانده. */
.log-state {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.log-state small {
    display: block;
    font-size: 11px;
}

.log-user,
.panel-content .log-user {
    min-height: 0;
    height: auto;
    padding: 0;
    border: 0;
    font: inherit;
    font-weight: 600;
    color: #A9CBFF;
    background: none;
    cursor: pointer;
}

.log-user:hover,
.panel-content .log-user:hover {
    color: #FFFFFF;
    background: none;
    text-decoration: underline;
}

/* ریز تسویهٔ کنسول: هر تعداد دسته جدا، و جمع. */
.settle-phases {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0 0 12px;
    padding: 10px 12px;
    list-style: none;
    border: 1px solid #2A2A32;
    border-radius: 10px;
    background: #0F0F14;
}

.settle-phases li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.settle-phases .settle-total {
    padding-top: 6px;
    border-top: 1px solid #2A2A32;
    font-weight: 600;
}

.settle-phases .settle-total strong {
    grid-column: 3;
}

/* زبانه‌های پنجرهٔ تسویهٔ کنسول و آمار دسته‌ها. */
.settle-tabs {
    margin-bottom: 12px;
}

.settle-brief {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 12px;
    padding: 8px 12px;
    border: 1px solid #2A2A32;
    border-radius: 10px;
    font-size: 13px;
    color: #9C9CA8;
    background: #0F0F14;
}

.settle-brief strong {
    font-size: 15px;
    color: #F4F3F8;
}

.settle-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.settle-stats div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid #2A2A32;
    border-radius: 10px;
    background: #0F0F14;
}

.settle-stats span {
    font-size: 12px;
    color: #8A8A96;
}

.settle-stats strong {
    font-size: 17px;
    color: #F4F3F8;
    font-variant-numeric: tabular-nums;
}

.settle-usage {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0 0 12px;
    padding: 12px;
    list-style: none;
    border: 1px solid #2A2A32;
    border-radius: 10px;
    background: #0F0F14;
}

.settle-usage li {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settle-usage-head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.settle-usage-bar {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #22222A;
}

.settle-usage-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2F6FEB, #60A5FA);
}

.settle-usage small {
    font-size: 12px;
}

.settle-orders {
    margin-bottom: 12px;
}

/* Scrollbars have no track background, only a thin thumb. */
* {
    scrollbar-width: thin;
    scrollbar-color: #3A3A46 transparent;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
    background: transparent;
}

::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #3A3A46;
}

::-webkit-scrollbar-thumb:hover {
    background: #4A4A58;
}

/* Pages that fill the content area scroll inside themselves, not as a whole. */
.panel-content:has(.waiting-page) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Amounts, times and coins (class num) line up on the left everywhere;
   beside a label in a row, the amount is pushed to the row's left end. */
.num {
    text-align: left;
    font-variant-numeric: tabular-nums;
}

:is(div, li, p) > .num:last-child:not(:first-child) {
    margin-right: auto;
}

/* ---- Player dialog ----
   Avatar header, a time-left block with Add time and quick buttons (the
   only blue), plain action buttons and underlined tabs.
   The dialog itself is zoomed to 0.8, so the parts below are zoomed back
   to 1.25 and use real sizes. */
.account-dialog .acct-head,
.account-dialog .acct-hero {
    zoom: 1.25;
}

.account-dialog .acct-head {
    align-items: center;
    gap: 10px;
    margin: 0 -16px 10px;
    padding: 8px 16px 6px;
    border-bottom: 0;
}

.acct-avatar {
    flex: none;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    object-fit: cover;
    font-size: 24px;
    color: #FFFFFF;
    background: #1A1A21;
}

.acct-who {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}

.account-dialog .acct-head h2 {
    flex: none;
    max-width: 100%;
    font-size: 14px;
    font-weight: 600;
    color: #F4F3F8;
}

.account-dialog .acct-head .dialog-status {
    max-width: 100%;
    padding: 0;
    font-size: 11.5px;
    background: none;
}

.account-dialog .acct-head .dialog-status > span:last-child {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.account-dialog .acct-head .dialog-close,
.panel-content .account-dialog .acct-head .dialog-close {
    flex: none;
    width: 28px;
    height: 28px;
}

.account-dialog .acct-head .dialog-close:hover,
.panel-content .account-dialog .acct-head .dialog-close:hover {
    background: #FFFFFF0D;
}

/* Time left is the main thing in the dialog, with Add time and its quick buttons under it. */
.acct-hero {
    margin: 0 0 12px;
    padding: 16px;
    border: 1px solid #262A34;
    border-radius: 14px;
    background: #1A1D25;
}

/* Time, balance in the middle, and coins. */
.acct-hero-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: end;
    gap: 12px 24px;
}

.acct-time {
    display: grid;
    justify-items: start;
    gap: 2px;
    min-width: 0;
}

.acct-time > span,
.acct-money dt {
    font-size: 12px;
    color: #8A90A0;
}

.acct-time strong {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    color: #F4F3F8;
}

/* The numbers here stand under their own labels, not pushed aside like a row's amount. */
.account-dialog .acct-hero .num.num {
    margin-right: 0;
}

.acct-time small {
    font-size: 12px;
    color: #6F7585;
}

.acct-money {
    display: contents;
}

.acct-money > div {
    display: grid;
    justify-items: start;
    gap: 2px;
}

.acct-money > div:first-child {
    justify-self: center;
    justify-items: center;
}

.acct-money > div:last-child {
    justify-self: end;
}

.acct-money dd {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    white-space: nowrap;
    color: #E8EAF0;
}

.acct-money dd.negative {
    color: #FF8A80;
}

.acct-quick {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

.acct-add-time,
.panel-content .acct-add-time,
.panel-content .acct-add-time:hover {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid #2F6FEB;
    border-radius: 9px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    color: #FFFFFF;
    background: #2F6FEB;
}

.acct-add-time:hover,
.panel-content .acct-add-time:hover {
    border-color: #3B7BF5;
    background: #3B7BF5;
}

.acct-add-time .dialog-menu-icon {
    width: 17px;
    height: 17px;
}

.acct-chip,
.panel-content .acct-chip,
.panel-content .acct-chip:hover {
    min-height: 30px;
    padding: 0 12px;
    border: 1px solid #2F4F99;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    color: #A9C2FF;
    background: #16223D;
}

.acct-chip:hover,
.panel-content .acct-chip:hover {
    border-color: #3F66C2;
    color: #FFFFFF;
    background: #1D2D52;
}

/* Action row: plain buttons with the icon beside the label. */
.account-dialog .dialog-menus {
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px;
    padding: 0;
    border-bottom: 0;
}

.account-dialog .dialog-tool,
.panel-content .account-dialog .dialog-tool,
.panel-content .account-dialog .dialog-tool:hover {
    flex-direction: row-reverse;
    gap: 7px;
    min-width: 0;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #2C2C35;
    border-radius: 9px;
    font-size: 13px;
    white-space: nowrap;
    color: #D4D4DC;
    background: #18181E;
}

.account-dialog .dialog-tool:hover,
.panel-content .account-dialog .dialog-tool:hover,
.account-dialog .dialog-tool.open,
.panel-content .account-dialog .dialog-tool.open {
    border-color: #3A3A45;
    color: #F4F3F8;
    background: #202028;
}

.account-dialog .dialog-tool .dialog-menu-icon {
    width: 17px;
    height: 17px;
    color: #9C9CA8;
}

.account-dialog .dialog-tool:hover .dialog-menu-icon,
.account-dialog .dialog-tool.open .dialog-menu-icon {
    color: inherit;
}

.account-dialog .dialog-tool.primary,
.panel-content .account-dialog .dialog-tool.primary,
.panel-content .account-dialog .dialog-tool.primary:hover {
    border-color: #2F6FEB;
    color: #FFFFFF;
    background: #2F6FEB;
}

.account-dialog .dialog-tool.primary:hover,
.panel-content .account-dialog .dialog-tool.primary:hover {
    border-color: #3B7BF5;
    background: #3B7BF5;
}

.account-dialog .dialog-tool.primary .dialog-menu-icon {
    color: inherit;
}

/* The More menu sits at the far end of the row. */
.account-dialog .dialog-menu {
    margin-right: auto;
}

.account-dialog .dialog-menu-list {
    top: calc(100% + 6px);
    right: auto;
    left: 0;
    min-width: 220px;
    border-color: #2C2C35;
    background: #15151B;
}

.account-dialog .dialog-menu-list button,
.panel-content .account-dialog .dialog-menu-list button {
    min-height: 36px;
    font-size: 14px;
    color: #E6E6EC;
}

.account-dialog .dialog-menu-list button:hover,
.panel-content .account-dialog .dialog-menu-list button:hover {
    background: #FFFFFF0F;
}

.account-dialog .dialog-menu-list .dialog-menu-icon {
    width: 18px;
    height: 18px;
    color: #9C9CA8;
}

.account-dialog .dialog-menu-list button.danger,
.panel-content .account-dialog .dialog-menu-list button.danger,
.account-dialog .dialog-menu-list button.danger .dialog-menu-icon {
    color: #FF6B6B;
    background: none;
}

.account-dialog .dialog-menu-list button.danger:hover,
.panel-content .account-dialog .dialog-menu-list button.danger:hover {
    color: #FF8A80;
    background: #FF4D4F1F;
}

/* Tabs: underlined labels above the content; a segmented control on a phone. */
.account-dialog .account-tabs-layout {
    flex-direction: column;
    gap: 12px;
}

.account-dialog .account-tabs {
    flex-direction: row;
    gap: 22px;
    border-bottom: 1px solid #22252E;
}

.account-dialog .account-tab,
.panel-content .account-dialog .account-tab {
    width: auto;
    height: 36px;
    flex-direction: row;
    gap: 6px;
    margin-bottom: -1px;
    padding: 0 2px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    font-size: 13px;
    white-space: nowrap;
    color: #8A90A0;
    background: none;
}

.account-dialog .account-tab:hover,
.panel-content .account-dialog .account-tab:hover {
    color: #F4F3F8;
    background: none;
}

.account-dialog .account-tab.active,
.panel-content .account-dialog .account-tab.active {
    color: #F4F3F8;
    border-bottom-color: #2F6FEB;
    background: none;
}

.account-dialog .account-tab .dialog-menu-icon {
    display: none;
}

/* Overview: recent activity beside a narrow summary column. */
.acct-overview {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    grid-template-rows: minmax(0, 1fr);
    gap: 14px;
}

/* The summary runs to the bottom, with the remaining balance at its foot. */
.acct-overview .account-totals {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 14px 16px;
    border: 1px solid #2A2A32;
}

.acct-overview .account-totals > div {
    font-size: 15px;
    white-space: nowrap;
}

.acct-overview .account-totals hr {
    margin-top: auto;
}

/* Phone: the dialog fills the screen and the actions become a bar at the bottom. */
@media (max-width: 720px) {
    .account-dialog {
        box-sizing: border-box;
        zoom: 1;
        top: 0;
        left: 0;
        width: 100%;
        height: 100dvh;
        min-width: 0;
        min-height: 0;
        max-width: none;
        max-height: none;
        padding: 0 14px;
        border: 0;
        border-radius: 0;
        transform: none;
        resize: none;
    }

    .account-dialog .dialog-menus,
    .account-dialog .account-tabs,
    .account-dialog .acct-head,
    .account-dialog .acct-hero {
        zoom: 1;
    }

    .account-dialog .acct-head {
        margin: 0 -14px 8px;
        padding: 8px 14px 6px;
    }

    .acct-hero {
        padding: 12px;
    }

    /* Time on its own row, balance and coins under it. */
    .acct-hero-top {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .acct-time {
        grid-column: 1 / -1;
    }

    .acct-money > div:first-child {
        justify-self: start;
        justify-items: start;
    }

    .acct-money dd {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .account-dialog .account-tab-body {
        overflow-x: hidden;
    }

    .acct-overview .account-totals > div {
        font-size: 14px;
    }

    .acct-time strong {
        font-size: 30px;
    }

    .acct-money dd {
        font-size: 15px;
    }

    .acct-quick {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .acct-add-time,
    .panel-content .acct-add-time,
    .panel-content .acct-add-time:hover {
        grid-column: 1 / -1;
        justify-content: center;
    }

    .account-dialog .account-tabs {
        gap: 2px;
        padding: 3px;
        border: 1px solid #2C2C35;
        border-radius: 10px;
        background: #18181E;
    }

    .account-dialog .account-tab,
    .panel-content .account-dialog .account-tab {
        flex: 1;
        justify-content: center;
        height: 30px;
        margin: 0;
        padding: 0 8px;
        border: 0;
        border-radius: 7px;
    }

    .account-dialog .account-tab.active,
    .panel-content .account-dialog .account-tab.active {
        background: #26262E;
    }

    .acct-overview {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) auto;
    }

    .account-dialog .dialog-menus {
        order: 10;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        margin: 10px -14px 0;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
        border-top: 1px solid #2A2A32;
        background: #101014;
        direction: inherit;
    }

    .account-dialog .dialog-tool,
    .panel-content .account-dialog .dialog-tool,
    .panel-content .account-dialog .dialog-tool:hover {
        width: 100%;
        flex-direction: row;
        justify-content: center;
        padding: 0 8px;
        font-size: 12px;
    }

    .account-dialog .dialog-tool > span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .account-dialog .dialog-menu {
        margin: 0;
    }

    .account-dialog .dialog-menu-list {
        top: auto;
        bottom: calc(100% + 6px);
    }
}
