@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter+Display:wght@700&display=swap');

/* ──────────────────────────────────────────────────────────────────────────
   ПАЛИТРА ЗДЕСЬ БОЛЬШЕ НЕ ЖИВЁТ.

   Раньше этот файл объявлял собственный :root (indigo #4F46E5) и собственный
   body.theme-dark (слейт #0F172A + indigo #6366F1). Так как body.theme-dark
   специфичнее :root, в тёмной теме побеждали именно эти значения — акцент
   продукта до тёмной темы не доезжал ни на одной странице, где подключён
   legacy. Это была не проблема порядка <link>, а проблема специфичности,
   поэтому чинилось только удалением.

   Все переменные (--accent-color, --card-bg, --input-bg, --segment-*,
   --rank-*, --radius-* и остальные) теперь приходят из
   shared/design-system/tokens.css — секция «Мосты в legacy-имена».
   Значения светлой темы сохранены один в один.

   Новые переменные сюда не добавлять.
   ────────────────────────────────────────────────────────────────────────── */


/* --- Reset & Base --- */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* Hide Scrollbar */
html, body, .tab-content, .modal-content, .tabs, .drawer-body {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
html::-webkit-scrollbar, body::-webkit-scrollbar, .tab-content::-webkit-scrollbar, .modal-content::-webkit-scrollbar, .tabs::-webkit-scrollbar, .drawer-body::-webkit-scrollbar {
    display: none;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center; /* Center vertically */
    padding: 20px;
    transition: background 0.3s ease, color 0.3s ease;
    position: relative; /* For z-index context */
    overflow-y: auto; /* Ensure body can scroll */
}

/* --- Ambient Background --- */
.ambient-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
    display: block; /* Always enabled */
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px); /* blur-3xl */
    opacity: 0.6;
    animation: floatOrb 20s ease-in-out infinite alternate;
    width: 50vw;
    height: 50vw;
    max-width: 600px;
    max-height: 600px;
}

/* Orb 1: Top Left Accent */
.orb-1 {
    top: -10%;
    left: -10%;
    background: radial-gradient(circle, var(--ws-primary-soft) 0%, rgba(99, 102, 241, 0) 70%); /* Indigo */
}

/* Orb 2: Bottom Right Accent */
.orb-2 {
    bottom: -10%;
    right: -10%;
    background: radial-gradient(circle, var(--ws-verified-soft) 0%, rgba(59, 130, 246, 0) 70%); /* Blue */
    animation-delay: -10s;
}

@keyframes floatOrb {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, 20px) scale(1.05); }
    100% { transform: translate(-20px, 40px) scale(0.95); }
}

/* Стили кнопки переключения темы переехали в
   /shared/runtime/theme-toggle.css — компонент один, файл один, и его
   можно подключить на страницах, которые legacy не грузят (лендинг,
   авторизация). Дублировать сюда обратно не нужно. */

/* --- Help Button --- */
#helpButton {
    position: fixed;
    bottom: 24px; /* Fixed at bottom */
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--ws-line);
    background: var(--card-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 3000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

#helpButton:hover {
    transform: scale(1.05);
    background: var(--input-bg);
}

/* --- Layout --- */
.container { width: 100%; max-width: 420px; margin: auto; }

.dashboard-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 92vh;
    height: auto;
    padding-bottom: 60px;
    position: relative;
}

/* --- Main Card --- */
.glass-card {
    background: var(--card-bg);
    border: var(--card-border);
    border-radius: 24px; /* Radius 24px */
    box-shadow: var(--card-shadow);
    padding: 32px; /* Padding 32px */
    width: 100%;
    height: auto;
    min-height: fit-content;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: background 0.3s ease, border-color 0.3s ease;
    overflow: visible;
}

.container .glass-card {
    height: auto; /* Auto height for login */
    overflow: visible;
}

/* --- Typography --- */
h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    text-align: center;
    color: var(--text-primary);
}

h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 16px; color: var(--text-primary); }
h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
p { font-size: 16px; line-height: 1.6; color: var(--text-secondary); }

.subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 32px;
    line-height: 1.5;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-shrink: 0;
}
.dashboard-header h1 { text-align: left; margin-bottom: 0; }
.dashboard-header .subtitle { text-align: left; margin-bottom: 0; }

.header-right-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* --- Streak Widget --- */
.streak-widget {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--ws-accent-gold-soft); /* Orange-500/10 */
    border-radius: 12px;
    border: 1px solid var(--ws-accent-gold-soft);
    cursor: help;
    transition: transform 0.2s ease;
}

.streak-widget:hover {
    transform: scale(1.05);
}

.streak-icon {
    font-size: 18px;
    color: #FF6B6B; /* Soft Red/Orange */
    animation: pulseFire 2s infinite;
}

/* Badge "0 дня": Increased contrast */
.streak-value {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--ws-fg); /* Dark Grey */
    font-size: 14px;
}

body.theme-dark .streak-widget {
    background: var(--ws-accent-gold-soft); /* Slightly darker bg */
    border: 1px solid var(--ws-accent-gold-line);
}

body.theme-dark .streak-value {
    color: var(--ws-fg); /* White */
}

@keyframes pulseFire {
    0% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.1); filter: brightness(1.2); }
    100% { transform: scale(1); filter: brightness(1); }
}

/* --- Alert Banner (Error/Success) --- */
.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    line-height: 1.4;
    animation: fadeIn 0.3s ease;
}

.message.error {
    background-color: var(--ws-error-soft);
    border: 1px solid #FECACA;
    color: #991B1B;
}

body.theme-dark .message.error {
    background-color: var(--ws-error-soft);
    border: 1px solid var(--ws-error-soft);
    color: var(--ws-error);
}

.message.success {
    background-color: var(--ws-accent-emerald-soft);
    border: 1px solid var(--ws-accent-emerald-line);
    color: #065F46;
}

body.theme-dark .message.success {
    background-color: var(--ws-accent-emerald-soft);
    border: 1px solid var(--ws-accent-emerald-soft);
    color: var(--ws-accent-emerald);
}

/* --- Segmented Control (The Switcher) --- */
.segmented-control {
    background: var(--segment-bg);
    padding: 4px;
    border-radius: 12px; /* rounded-xl */
    display: inline-flex;
    position: relative;
    margin-right: 16px;
    min-width: 300px;
    height: 44px; /* Fixed 44px */
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Dark Mode Border Override */
body.theme-dark .segmented-control {
    border: 1px solid var(--ws-line);
}

/* Override for Login Page */
.container .segmented-control {
    min-width: auto;
    width: 100%;
    margin-right: 0;
    margin-bottom: 24px;
}

.segment-btn {
    flex: 1;
    padding: 0 16px;
    border: none;
    background: transparent;
    color: var(--segment-inactive-text);
    font-size: 14px;
    font-weight: 500; /* Medium */
    border-radius: 8px; /* rounded-lg */
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 100%;
}

.segment-btn.active {
    background: var(--segment-active-bg);
    color: var(--segment-active-text);
    font-weight: 600; /* SemiBold */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* More pronounced shadow */
}

body.theme-dark .segment-btn.active {
    background: var(--ws-line); /* White active bg in dark mode */
    color: var(--ws-fg); /* Dark text */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.segment-btn:hover:not(.active) {
    color: var(--text-primary);
}

/* --- Inputs --- */
.form-group { margin-bottom: 20px; position: relative; }

label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

input, textarea, select {
    width: 100%;
    height: var(--btn-height);
    padding: 0 16px;
    background: var(--input-bg);
    border: var(--input-border);
    border-radius: 12px;
    font-size: 15px;
    color: var(--input-text);
    font-family: inherit;
    transition: all 0.2s ease;
}

textarea { height: auto; min-height: 120px; padding: 16px; resize: vertical; }

input::placeholder, textarea::placeholder {
    color: var(--text-placeholder);
    opacity: 1;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--input-focus-border);
    box-shadow: var(--input-focus-ring);
    background: var(--input-bg);
}

/* Input Validation */
input.input-error, textarea.input-error, select.input-error {
    border-color: var(--ws-error) !important;
    box-shadow: 0 0 0 3px var(--ws-error-soft) !important;
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

/* Block Validation (for Palette, Checkboxes) */
.block-error {
    border: 1px solid var(--ws-error) !important;
    box-shadow: 0 0 0 3px var(--ws-error-soft) !important;
    border-radius: 12px;
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
    padding: 8px; /* Add padding to make it look like a container */
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

.error-text {
    color: var(--ws-error);
    font-size: 12px;
    margin-top: 6px;
    margin-left: 4px;
    display: block;
    font-weight: 500;
}

/* --- Custom Selects --- */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 40px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%234F46E5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

body.theme-dark select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236366F1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.filter-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* --- Custom Dropdown Component (Solidified) --- */
.custom-dropdown {
    position: relative;
    min-width: 160px;
    flex: 1;
}

.dropdown-trigger {
    background-color: var(--ws-surface); /* Solid White */
    border: 1px solid var(--ws-line); /* Border Gray-200 */
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

body.theme-dark .dropdown-trigger {
    background-color: var(--ws-surface-soft); /* Solid Dark Grey */
    border: 1px solid var(--ws-line); /* Border Gray-700 */
    color: var(--ws-fg-muted);
}

.dropdown-trigger:hover {
    border-color: var(--text-tertiary);
}

.dropdown-chevron {
    width: 16px;
    height: 16px;
    margin-left: 8px;
    transition: transform 0.2s;
    opacity: 0.6;
}

.custom-dropdown.active .dropdown-chevron {
    transform: rotate(180deg);
}

.dropdown-list {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background-color: var(--ws-surface); /* Solid White */
    border: 1px solid var(--ws-line);
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* Shadow-lg */
    z-index: 100;
    display: none;
    flex-direction: column;
    overflow: hidden;
    padding: 4px;
}

body.theme-dark .dropdown-list {
    background-color: var(--ws-surface); /* Solid Dark Grey */
    border: 1px solid var(--ws-line);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

.custom-dropdown.active .dropdown-list {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.dropdown-option {
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s, color 0.2s;
}

.dropdown-option.selected {
    color: var(--accent-color);
    font-weight: 600;
    background-color: rgba(99, 102, 241, 0.05);
}

.dropdown-option.hover {
    background-color: var(--segment-bg);
    color: var(--accent-color);
}

/* --- Buttons --- */
.btn {
    width: 100%;
    height: var(--btn-height);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
    margin-top: 8px;
}

.btn-primary {
    background: var(--accent-gradient);
    color: var(--accent-text);
    box-shadow: var(--accent-shadow);
}

.btn-primary:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.25);
}

.btn-primary:active {
    transform: translateY(0);
    filter: brightness(0.95);
}

.btn-secondary {
    background: var(--ws-surface); /* White background */
    color: var(--ws-fg-muted); /* Gray-500 */
    border: 1px solid var(--ws-line); /* Gray-200 */
}

body.theme-dark .btn-secondary {
    background: var(--ws-surface-soft);
    border: 1px solid var(--ws-line);
    color: var(--ws-fg);
}

.btn-secondary:hover {
    background: var(--ws-bg-soft); /* Gray-50 */
    border-color: var(--ws-line-strong); /* Gray-300 */
    color: var(--ws-fg-muted); /* Gray-700 */
}

body.theme-dark .btn-secondary:hover {
    background: var(--ws-line);
}

/* --- Tabs --- */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    padding-bottom: 4px;
    overflow-x: auto;
    flex-shrink: 0;
    position: sticky; /* Sticky positioning */
    top: 16px; /* Stick to top with some gap */
    z-index: 50; /* Ensure it's above content */
    background: transparent; /* Default transparent */
    border-radius: 100px; /* Rounded pill shape */
    padding: 8px; /* Internal padding */
    transition: all 0.3s ease; /* Smooth transition */
    width: fit-content; /* Fit content width */
    max-width: 100%; /* Prevent overflow */
    margin-left: auto; /* Center horizontally */
    margin-right: auto; /* Center horizontally */
}

/* Sticky State (Applied via JS) */
.tabs.sticky {
    background: rgba(var(--ws-glass-rgb), 0.8); /* Semi-transparent background */
    backdrop-filter: blur(12px); /* Blur effect */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); /* Shadow for lift */
    border: 1px solid rgba(var(--ws-tint-rgb), 0.2); /* Subtle border */
}

body.theme-dark .tabs.sticky {
    background: var(--ws-surface); /* Dark mode background */
    border: 1px solid var(--ws-surface-soft); /* Dark mode border */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); /* Dark mode shadow */
}

.tab-btn {
    background: transparent;
    border: none;
    font-size: 15px;
    font-weight: 600;
    color: var(--ws-fg-soft); /* Slate-400 */
    padding: 10px 20px;
    border-radius: 100px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px; /* Ensure minimum width to prevent resizing */
    justify-content: center; /* Center content */
}
.tab-btn:hover {
    color: #334155; /* Slate-700 for light mode hover */
    background: var(--segment-bg);
}
body.theme-dark .tab-btn:hover {
    color: var(--ws-fg); /* Slate-200 for dark mode hover */
}

/* Active Tab Styling */
.tab-btn.active {
    background: var(--ws-primary-soft); /* Updated: Delicate background */
    color: var(--accent-color); /* Accent Color */
    font-weight: 700; /* Bold */
    border: 1px solid transparent; /* Removed border */
    box-shadow: none;
}

.tab-btn.active svg {
    color: var(--accent-color); /* Icon Color */
}

body.theme-dark .tab-btn.active {
    background: var(--ws-primary-soft); /* Accent tint */
    color: var(--accent-color);
    border: 1px solid var(--ws-primary-soft);
}

/* --- Tab Content --- */
.tab-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px;
    display: flex;
    flex-direction: column;
}
.tab-pane { display: block; animation: fadeIn 0.3s ease; width: 100%; }
.tab-pane.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* --- Cards (Competitions) --- */
.competitions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: 24px;
    padding: 4px;
    padding-bottom: 80px;
    align-items: stretch;
}
.competition-card {
    background: var(--card-bg);
    border: var(--card-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 240px;
    height: 100%;
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: var(--card-shadow);
}
.competition-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }

.card-title {
    font-size: 16px; /* Updated to 16px */
    font-weight: 600; /* Updated to 600 */
    color: var(--text-primary); /* Enforce standard color */
    line-height: 1.3;
    padding-right: 0;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    text-overflow: ellipsis;
}

.card-meta { display: flex; gap: 12px; margin-bottom: auto; flex-wrap: wrap; }

.meta-badge {
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

/* Badges */
.badge-reward { background: var(--ws-accent-emerald-soft); color: var(--ws-accent-emerald); border: 1px solid var(--ws-accent-emerald-soft); }
body.theme-dark .badge-reward { background: var(--ws-accent-emerald-soft); color: var(--ws-accent-emerald); border: 1px solid var(--ws-accent-emerald-line); }

.badge-time { background: var(--ws-accent-gold-soft); color: var(--ws-accent-gold); border: 1px solid var(--ws-accent-gold-soft); }
body.theme-dark .badge-time { background: var(--ws-accent-gold-soft); color: var(--ws-accent-gold); border: 1px solid var(--ws-accent-gold-line); }

/* --- New Card Layout --- */
.card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-context {
    display: flex;
    align-items: center;
    gap: 8px;
}

.company-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.separator {
    color: var(--text-tertiary);
    font-size: 10px;
}

.type-badge {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 10px; /* Updated */
    font-weight: 700; /* Updated */
    text-transform: uppercase; /* Updated */
    letter-spacing: 0.5px; /* Updated */
}

body.theme-dark .type-badge {
    background: var(--ws-line);
    color: var(--text-secondary);
}

.favorite-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-tertiary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: -8px;
    margin-top: -8px;
}

.favorite-btn:hover {
    background: var(--segment-bg);
    color: var(--ws-error);
    transform: scale(1.05);
}

.favorite-btn.active {
    color: var(--ws-error);
}

.favorite-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    transition: fill 0.2s ease;
}

.favorite-btn.active svg {
    fill: currentColor;
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-bottom: 16px;
}

.card-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    width: 100%;
}

.card-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
    margin-right: 12px;
}

.action-btn-primary {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-color);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px var(--ws-primary-line);
    flex-shrink: 0;
}

.action-btn-primary:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px var(--ws-primary-line);
}

.competition-card:hover .action-btn-primary {
    background: var(--accent-hover);
}

/* --- Modals --- */
.modal {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
    padding: 20px;
}
.modal:not(.hidden) { opacity: 1; pointer-events: auto; }

.modal-content {
    background: var(--card-bg);
    border: var(--card-border);
    border-radius: var(--radius-xl);
    padding: 24px 32px 32px 32px; /* Updated Padding */
    width: 100%; max-width: 600px; max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--card-shadow);
    transform: scale(0.95); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}
.modal:not(.hidden) .modal-content { transform: scale(1); }

.drafts-modal-content {
    display: flex;
    flex-direction: column;
    max-height: min(82vh, 760px);
    overflow: hidden;
}

.draft-library-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    min-height: 0;
    flex: 1 1 auto;
}

.draft-library-section {
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.draft-library-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.draft-library-meta {
    flex-shrink: 0;
}

.drafts-list {
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.drafts-list::-webkit-scrollbar {
    display: none;
}

/* Состояние заявки на платную задачу прямо в карточке черновика: решение
   модератора приходит сюда, и возвращаются к задаче отсюда же. */
.drafts-list .draft-item__approval {
    align-self: flex-start;
    margin-top: 8px;
    padding: 3px 10px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--text-secondary);
}

.drafts-list .draft-item__approval[data-status="approved"] {
    border-color: var(--ws-accent-emerald-line);
    background: var(--ws-accent-emerald-soft);
    color: var(--ws-success);
}

.drafts-list .draft-item__approval[data-status="rejected"] {
    border-color: var(--ws-error-line);
    background: var(--ws-error-soft);
    color: var(--ws-error);
}

.drafts-modal-title {
    margin: 0 0 6px;
    /* Место под крестик: без него заголовок заезжал под кнопку закрытия,
       и на узком экране «пресеты» читались сквозь неё. */
    padding-right: 44px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

@media (max-width: 900px) {
    .draft-library-grid {
        grid-template-columns: 1fr;
    }
}

/* Телефон: окно черновиков.
   
   Две колонки становятся одной, и каждая со своей прокруткой — на экране
   оказывались две независимые полосы прокрутки в одном окне, и вторая секция
   («Пресеты») оставалась за краем. Здесь прокручивается окно целиком, а
   списки внутри перестают прокручиваться сами. Заодно уменьшены поля: 32 px
   с каждой стороны съедали пятую часть ширины телефона. */
@media (max-width: 720px) {
    .modal:has(.drafts-modal-content) {
        padding: 12px;
    }

    .drafts-modal-content {
        padding: 18px 16px 16px;
        max-height: min(88dvh, 760px);
        overflow-y: auto;
    }

    .drafts-modal-content .close-modal {
        top: 14px;
        right: 14px;
    }

    .drafts-modal-title {
        padding-right: 40px;
        font-size: 20px;
    }

    .drafts-modal-content .draft-library-grid {
        flex: 0 0 auto;
        gap: 22px;
    }

    .drafts-modal-content .drafts-list {
        overflow: visible;
        padding-right: 0;
    }
}

/* Dark Mode Modal Override */
body.theme-dark .modal-content {
    background: var(--ws-surface); /* Gray-900 Opaque */
    border-color: var(--ws-line); /* Gray-800 */
}

.close-modal {
    position: absolute; top: 24px; right: 24px;
    background: var(--segment-bg); border: none;
    width: 32px; height: 32px; border-radius: 50%;
    font-size: 20px; color: var(--text-secondary);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.close-modal:hover { background: var(--ws-line-strong); color: var(--text-primary); }

/* --- Verification State (In-Card) --- */
.verification-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 0;
    animation: fadeIn 0.3s ease;
}

.verification-icon {
    font-size: 64px;
    margin-bottom: 24px;
    color: var(--accent-color);
}

.verification-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.verification-text {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 320px;
    line-height: 1.6;
}

.verification-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    background: var(--ws-accent-gold-soft);
    color: #92400E;
    margin-bottom: 32px;
}

body.theme-dark .verification-badge {
    background: var(--ws-accent-gold-soft);
    color: var(--ws-accent-gold);
}

/* --- Utilities --- */
.hidden { display: none !important; }
.text-gradient { background: var(--accent-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* --- Specific Button Styles --- */
.btn-logout {
    padding: 8px 16px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    margin-top: 16px;
}
.btn-logout:hover { background: var(--segment-bg); color: var(--text-primary); }

.btn-back {
    background: none; border: none; font-size: 24px;
    cursor: pointer; margin-right: 16px; color: var(--text-primary);
    padding: 8px; border-radius: 50%; transition: background 0.2s;
}
.btn-back:hover { background: var(--segment-bg); }

.file-upload-area {
    border: 2px dashed var(--ws-line-strong); border-radius: var(--radius-md);
    padding: 32px 20px; background: var(--input-bg);
    transition: all 0.3s ease; cursor: pointer; text-align: center;
}
.file-upload-area:hover { border-color: var(--accent-color); background: var(--card-bg); }

.btn-view-submissions {
    margin-top: 16px;
    width: 100%;
    padding: 12px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    box-shadow: var(--accent-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-view-submissions:hover { transform: translateY(-2px); box-shadow: 0 8px 20px var(--ws-primary-line); }
.btn-view-submissions:disabled { background: var(--segment-bg); color: var(--text-tertiary); cursor: not-allowed; box-shadow: none; transform: none; }

/* --- Story Template --- */
#storyTemplate {
    position: fixed; left: -9999px; top: 0;
    width: 1080px; height: 1920px;
    background: #111; color: white;
    font-family: 'Inter', sans-serif;
    display: flex; flex-direction: column;
    overflow: hidden;
}
.story-bg {
    position: absolute; inset: 0;
    background: radial-gradient(circle at 100% 0%, var(--ws-primary) 0%, #0f172a 50%, #000000 100%);
    z-index: 0;
}
.story-pattern {
    position: absolute; inset: 0;
    background-image: radial-gradient(rgba(var(--ws-glass-rgb), 0.1) 1px, transparent 1px);
    background-size: 40px 40px; opacity: 0.3; z-index: 1;
}
.story-content {
    position: relative; z-index: 10; height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 80px; text-align: center;
}
/* Медальные и наградные литералы ниже (#FFD700 золото, #E0E0E0 серебро,
   #FFAB91 бронза, #FFD93D кубок) намеренно НЕ переведены на токены: это не
   роли интерфейса, а изображение медали. Золото обязано выглядеть золотом
   в обеих темах, иначе подиум перестаёт читаться. Единственное исключение
   из правила «цвет только из токенов». */
.story-badge {
    background: #FFD700; color: #000;
    padding: 20px 60px; border-radius: 100px;
    font-size: 40px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em;
    margin-bottom: 60px; box-shadow: 0 20px 60px rgba(255, 215, 0, 0.4);
}
.story-title {
    font-size: 110px; font-weight: 900; line-height: 1.1;
    background: linear-gradient(to right, var(--ws-surface), #ccc);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    margin-bottom: 40px; text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.story-card {
    background: rgba(var(--ws-glass-rgb), 0.1); backdrop-filter: blur(40px);
    border: 2px solid rgba(var(--ws-tint-rgb), 0.2); border-radius: 60px;
    padding: 80px; width: 100%; margin: 60px 0;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.3);
}
.story-reward-label { font-size: 40px; color: rgba(var(--ws-tint-rgb), 0.7); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 20px; }
.story-reward-value { font-size: 140px; font-weight: 800; color: var(--ws-accent-emerald); text-shadow: 0 0 40px rgba(74, 222, 128, 0.4); line-height: 1; }
.story-footer { margin-top: auto; font-size: 40px; opacity: 0.6; letter-spacing: 0.05em; }

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 640px) {
    body {
        padding: 16px;
    }

    .container {
        width: 100%;
        max-width: none;
        margin: 0;
    }

    .glass-card {
        padding: 24px;
    }

    h1 {
        font-size: 22px;
    }

    .verification-title {
        font-size: 20px;
    }

    .verification-text {
        max-width: 100%;
    }

    .btn-logout {
        padding: 12px;
        min-height: 44px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }

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

/* --- User Profile Widget --- */
.user-profile-widget {
    position: relative;
    display: inline-block;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ws-primary-soft); /* Indigo-100 */
    color: var(--ws-primary-active); /* Indigo-700 */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
}

body.theme-dark .user-avatar {
    background: var(--ws-primary-soft); /* Indigo-900 */
    color: var(--ws-primary); /* Indigo-200 */
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.profile-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    width: 180px;
    background: var(--card-bg);
    border: var(--card-border);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 100;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.2s ease;
}

.profile-dropdown.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-item {
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
    background: transparent;
    border: none;
    width: 100%;
}

.dropdown-item:hover {
    background: var(--segment-bg);
}

.dropdown-item.danger {
    color: var(--error);
}

.dropdown-item.danger:hover {
    background: var(--ws-error-soft);
}

body.theme-dark .dropdown-item.danger:hover {
    background: var(--ws-error-soft);
}

/* --- NEW PROFILE LAYOUT (Grid System) --- */

.profile-grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
    width: 100%;
    margin-bottom: 40px;
}

/* Hero Card */
.hero-card {
    grid-column: span 3;
    height: 220px;
    background: var(--ws-surface);
    border-radius: 24px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
    display: flex;
    overflow: hidden;
    position: relative;
    border: var(--card-border); /* Keep border for consistency? User said "Pure white with strong shadow" for light mode. */
}

body.theme-dark .hero-card {
    background: linear-gradient(135deg, var(--ws-surface) 0%, var(--ws-bg) 100%);
    box-shadow: none;
    border: 1px solid var(--ws-surface-soft);
}

.hero-left {
    width: auto; /* Updated: Auto width */
    min-width: 200px; /* Ensure some width */
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Updated: Align left */
    position: relative;
    padding: 24px;
    padding-right: 32px; /* Added padding right */
    gap: 16px;
}

.hero-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: white;
    font-size: 32px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--ws-primary-line);
}

.hero-identity-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.hero-name {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
    line-height: 1.2;
}

.hero-level-badge {
    background: linear-gradient(90deg, var(--ws-primary), #8b5cf6);
    color: white;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.5); /* Shine effect */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: transform 0.2s ease;
}

/* Dark Theme Badge Override */
body.theme-dark .hero-level-badge {
    background: var(--ws-primary-soft);
    color: var(--ws-primary);
    box-shadow: none;
    border: 1px solid var(--ws-primary-soft);
}

.hero-level-badge:hover {
    transform: scale(1.05);
}

.hero-divider {
    position: absolute;
    right: 0;
    top: 20%;
    bottom: 20%;
    width: 1px;
    background: currentColor;
    opacity: 0.1;
    color: var(--text-primary);
}

.hero-right {
    flex: 1; /* Updated: Take remaining space */
    padding: 24px 32px; /* Updated: Padding */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* --- NEW PROGRESS BAR LAYOUT --- */
.progress-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px; /* Updated: Gap 16px */
    width: 100%;
    margin-bottom: 8px; /* Space before details */
}

/* Left Element: Level Badge Circle (Not Button) */
.level-badge-circle {
    /* Removed width/height/border-radius/bg to make it just text */
    width: auto;
    height: auto;
    border-radius: 0;
    background: transparent;
    color: var(--ws-fg); /* Dark Text */
    font-size: 13px; /* Updated: Reduced font size */
    font-weight: 800; /* Updated: Bold weight */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1; /* Ensure vertical centering */
}

body.theme-dark .level-badge-circle {
    color: var(--ws-fg);
}

/* Center Element: Progress Track */
.progress-track {
    flex: 1; /* Updated: Flex 1 to stretch */
    height: 12px;
}

/* Цвет дорожки и заливки — /shared/runtime/progress.css (единая шкала
   прогресса на весь продукт). Здесь остаётся только геометрия. */

/* Right Element: Next Level Text */
.next-level-text {
    font-size: 13px; /* Updated: Reduced font size */
    font-weight: 800; /* Updated: Bold weight */
    color: #9CA3AF; /* Gray-400 */
    flex-shrink: 0;
    width: auto; /* Updated: Auto width */
    text-align: center;
    line-height: 1; /* Ensure vertical centering */
}

/* Progress Details (Below Bar) */
.progress-details {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Updated: Align left */
    gap: 6px;
    font-size: 13px;
    color: #737373; /* Updated: Neutral-500 */
    margin-top: 10px; /* Updated: Margin top 8-10px */
    margin-left: 24px; /* Updated: Align with track start (approx width of "19" + gap) */
}

body.theme-dark .progress-details {
    color: var(--ws-fg-muted); /* Gray-400 */
}

.xp-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
    opacity: 0.8;
}

.detail-separator {
    margin: 0 4px;
    opacity: 0.5;
}

/* --- END NEW PROGRESS BAR LAYOUT --- */

/* --- NEW BALANCE SECTION IN HERO --- */
.balance-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.balance-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.balance-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    color: var(--text-secondary);
}

.balance-amount {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

body.theme-dark .balance-amount {
    color: var(--ws-fg);
    text-shadow: 0 0 20px var(--ws-line);
}

.balance-actions {
    display: flex;
    gap: 12px;
}

.btn-balance-action {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--segment-bg);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-balance-action:hover {
    background: var(--input-bg);
    border-color: var(--ws-line-strong);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

body.theme-dark .btn-balance-action {
    background: var(--ws-surface-soft);
    color: var(--ws-fg);
}

body.theme-dark .btn-balance-action:hover {
    background: var(--ws-line);
}

/* --- END NEW BALANCE SECTION --- */

.progress-header {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.progress-bar-container {
    position: relative;
    width: 100%;
    height: 24px;
    border-radius: 12px;
    margin-bottom: 16px;
}

/* Цвет — /shared/runtime/progress.css. */
.progress-bar-fill {
    width: 0%;
}

.progress-label {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: rgba(var(--ws-tint-rgb), 0.9); /* Contrast requirement */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.progress-motivation {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.accent-text-gold {
    color: var(--ws-accent-gold);
    font-weight: 800;
}

body.theme-dark .accent-text-gold {
    color: var(--ws-accent-gold);
}

/* --- BALANCE CARD (Wallet Summary) --- */
.wallet-summary-card {
    grid-column: span 3;
    background: var(--card-bg);
    border: var(--card-border);
    border-radius: 24px;
    padding: 32px; /* Generous padding (p-8) */
    display: flex;
    flex-direction: row; /* Rigid Flexbox: Row */
    justify-content: space-between; /* Space between Left and Right */
    align-items: center; /* Vertical Center */
    position: relative;
    box-shadow: var(--card-shadow);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    min-height: 140px;
}

.wallet-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.wallet-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px; /* Tighter gap */
    flex: 1; /* Take available space */
    min-width: 0; /* Critical for truncate */
    margin-right: 24px; /* Space before button */
}

.wallet-label {
    font-size: 12px; /* Updated */
    text-transform: uppercase;
    letter-spacing: 1px; /* Updated */
    font-weight: 700; /* Updated */
    color: var(--text-secondary); /* text-gray-500 */
    margin-bottom: 2px; /* mb-1 */
}

body.theme-dark .wallet-label {
    color: var(--text-secondary); /* text-gray-400 equivalent in theme */
}

.wallet-amount {
    font-family: var(--font-display);
    font-size: 30px; /* Updated: Reduced size */
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Truncate */
    letter-spacing: -1px; /* Updated */
}

body.theme-dark .wallet-amount {
    color: var(--ws-fg);
}

.wallet-btn {
    position: static; /* No longer absolute */
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent; /* Updated */
    border: 1px solid var(--ws-line); /* Updated */
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    transition: background 0.2s;
    z-index: 2;
    flex-shrink: 0; /* Prevent shrinking */
}

.wallet-btn:hover {
    background: var(--segment-bg); /* Updated */
}

/* Stats Cards */
.stats-card {
    background: var(--card-bg);
    border: var(--card-border);
    border-radius: 24px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    min-height: 180px;
}

.stats-watermark {
    position: absolute;
    top: auto;
    left: auto;
    right: -15%;
    bottom: -15%;
    transform: none;
    width: 120px;
    height: 120px;
    opacity: 0.04;
    color: var(--text-primary);
    pointer-events: none;
    z-index: 0;
}

body.theme-dark .stats-watermark {
    opacity: 0.03;
}

.stats-number {
    font-size: 56px;
    font-weight: 800;
    color: var(--ws-fg); /* Max contrast Light */
    line-height: 1;
    z-index: 1;
    position: relative;
    margin-bottom: 8px; /* Updated */
}

body.theme-dark .stats-number {
    color: var(--ws-fg); /* Max contrast Dark */
}

.stats-label {
    font-size: 11px; /* Updated */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px; /* Updated */
    color: var(--text-secondary);
    margin-top: 0; /* Reset */
    z-index: 1;
    position: relative;
}

/* Navigation Grid */
.navigation-grid-container {
    grid-column: span 3;
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 1 row of 4 cards */
    gap: 24px;
}

.nav-card {
    height: 75px; /* Updated */
    background: var(--card-bg);
    border: var(--card-border);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px; /* Updated */
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--card-shadow);
}

.nav-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.nav-card i, .nav-card svg {
    width: 22px; /* Updated */
    height: 22px; /* Updated */
    stroke-width: 2px; /* Medium stroke */
    color: var(--accent-color);
}

.nav-card span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .navigation-grid-container {
        grid-template-columns: repeat(2, 1fr); /* 2 rows of 2 cards */
    }
}

@media (max-width: 768px) {
    .profile-grid-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .hero-card {
        grid-column: span 1;
        flex-direction: column;
        height: auto;
    }
    .hero-left {
        width: 100%;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        padding: 20px;
        justify-content: center; /* Revert for mobile */
        padding-right: 20px; /* Revert */
    }
    body.theme-dark .hero-left {
        border-bottom: 1px solid var(--ws-surface-soft);
    }
    .hero-divider { display: none; }
    .hero-right {
        width: 100%;
        padding: 24px;
    }
    .stats-card {
        grid-column: span 1;
        min-height: 140px;
    }
    .navigation-grid-container {
        grid-column: span 1;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
    .wallet-summary-card {
        grid-column: span 1;
        padding: 24px;
    }
    .wallet-amount {
        font-size: 28px;
    }
}

.company-name-text:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Рейтинг переехал в shared/widgets/leaderboard.css.
   Причина: экран «Рейтинг» есть в кабинете участника, а этот файл там не
   подключён — подиум и строки показывались вообще без оформления, голым
   текстом в столбик. Тянуть сюда весь legacy ради одного экрана нельзя: он
   задаёт body { display: flex } и десятки общих правил, рассчитанных на
   страницы входа. Поэтому рейтинг вынесен в собственный файл, который
   подключают обе страницы. */

/* Dark Mode Enforcements */
body.theme-dark .card-username,
body.theme-dark .row-name {
    color: var(--ws-fg);
}

/* --- ARCHIVE CARD STATES (Dark Theme) --- */

/* Base Archive Card */
body.theme-dark .archive-card {
    background: var(--card-bg);
    border: 1px solid var(--ws-surface-soft);
    border-radius: 24px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 240px;
    height: 100%;
    position: relative;
    transition: all 0.3s ease;
}

/* 1. WON_UNCLAIMED (Jackpot) */
body.theme-dark .archive-card.state-won-unclaimed {
    background: linear-gradient(135deg, var(--ws-surface) 0%, var(--ws-accent-gold-soft) 100%); /* to-amber-900/20 */
    border: 1px solid var(--ws-accent-gold-line); /* border-amber-500/50 */
    box-shadow: 0 0 25px -5px var(--ws-accent-gold-soft);
}

body.theme-dark .archive-card.state-won-unclaimed:hover {
    border-color: var(--ws-accent-gold);
    box-shadow: 0 0 30px -5px var(--ws-accent-gold-line);
    transform: translateY(-4px);
}

body.theme-dark .archive-card.state-won-unclaimed .archive-card-title {
    color: var(--ws-fg); /* Off-white for Dark Theme */
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

body.theme-dark .archive-card.state-won-unclaimed .status-badge {
    background: var(--ws-accent-gold-soft);
    color: var(--ws-accent-gold); /* text-amber-400 */
    border: 1px solid var(--ws-accent-gold-soft);
    height: 28px;
    padding: 0 12px;
    border-radius: 100px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

body.theme-dark .archive-card.state-won-unclaimed .action-btn {
    background: var(--ws-accent-gold); /* bg-amber-500 */
    color: var(--ws-bg);
    font-weight: 700;
    border-radius: 9999px;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    transition: transform 0.1s, background-color 0.2s;
    width: auto;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px var(--ws-accent-gold-soft); /* New Shadow */
}

body.theme-dark .archive-card.state-won-unclaimed .action-btn:hover {
    background: var(--ws-accent-gold); /* bg-amber-400 */
}

body.theme-dark .archive-card.state-won-unclaimed .action-btn:active {
    transform: scale(0.95);
}

/* 2. WON_CLAIMED (Settled) */
body.theme-dark .archive-card.state-won-claimed {
    background: var(--ws-accent-emerald-soft);
    border: 1px solid var(--ws-accent-emerald-line);
}

body.theme-dark .archive-card.state-won-claimed .archive-card-title {
    color: var(--ws-fg); /* Off-white for Dark Theme */
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

body.theme-dark .archive-card.state-won-claimed .status-badge {
    background: var(--ws-accent-emerald-soft);
    color: var(--ws-accent-emerald);
    border: 1px solid var(--ws-accent-emerald-line); /* Match card border */
    height: 28px;
    padding: 0 12px;
    border-radius: 100px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

body.theme-dark .archive-card.state-won-claimed .action-text {
    color: var(--ws-accent-emerald);
    font-weight: 600;
    font-size: 0.875rem;
}

/* 3. LOST (Ghost) */
body.theme-dark .archive-card.state-lost {
    background: var(--card-bg);
    border: 1px solid var(--ws-surface-soft);
    /* opacity: 0.6; REMOVED per request */
    transition: opacity 0.3s ease;
}

body.theme-dark .archive-card.state-lost:hover {
    /* opacity: 1; REMOVED */
}

body.theme-dark .archive-card.state-lost .archive-card-title {
    color: var(--ws-fg-muted); /* Muted Gray for Dark Theme */
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

body.theme-dark .archive-card.state-lost .status-badge {
    background: var(--ws-surface-soft); /* Light/Translucent Gray */
    color: var(--ws-fg-muted); /* Muted Gray Text */
    border: none;
    height: 28px;
    padding: 0 12px;
    border-radius: 100px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

body.theme-dark .archive-card.state-lost .company-name-text {
    color: var(--ws-fg-muted); /* Readable author name */
}

body.theme-dark .archive-card.state-lost .action-icon {
    color: var(--ws-line-strong);
}

/* --- ARCHIVE CARD STATES (Light Theme) --- */

/* Base Archive Card */
.archive-card {
    background: var(--card-bg);
    border: var(--card-border);
    border-radius: 24px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 240px;
    height: 100%;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow);
}

/* 1. WON_UNCLAIMED (Jackpot) */
.archive-card.state-won-unclaimed {
    background: linear-gradient(135deg, var(--ws-accent-gold-soft) 0%, var(--ws-accent-gold-soft) 100%);
    border: 1px solid var(--ws-accent-gold);
    box-shadow: 0 4px 20px var(--ws-accent-gold-soft);
}

.archive-card.state-won-unclaimed:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(245, 158, 11, 0.25);
}

.archive-card.state-won-unclaimed .archive-card-title {
    color: #1E293B; /* Deep Graphite for Light Theme */
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.archive-card.state-won-unclaimed .status-badge {
    background: var(--ws-accent-gold-line);
    color: var(--ws-accent-gold);
    border: 1px solid var(--ws-accent-gold);
    height: 28px;
    padding: 0 12px;
    border-radius: 100px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.archive-card.state-won-unclaimed .action-btn {
    background: var(--ws-accent-gold);
    color: white;
    font-weight: 700;
    border-radius: 9999px;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    transition: transform 0.1s, background-color 0.2s;
    width: auto;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(245, 166, 35, 0.25); /* New Shadow */
}

.archive-card.state-won-unclaimed .action-btn:hover {
    background: var(--ws-accent-gold);
}

.archive-card.state-won-unclaimed .action-btn:active {
    transform: scale(0.95);
}

/* 2. WON_CLAIMED (Settled) */
.archive-card.state-won-claimed {
    background: rgba(46, 204, 113, 0.04);
    border: 1px solid rgba(46, 204, 113, 0.2);
}

.archive-card.state-won-claimed .archive-card-title {
    color: #1E293B; /* Deep Graphite for Light Theme */
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.archive-card.state-won-claimed .status-badge {
    background: rgba(46, 204, 113, 0.15);
    color: var(--ws-accent-emerald);
    border: 1px solid rgba(46, 204, 113, 0.2); /* Match card border */
    height: 28px;
    padding: 0 12px;
    border-radius: 100px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.archive-card.state-won-claimed .action-text {
    color: #1A8038;
    font-weight: 600;
    font-size: 0.875rem;
}

/* 3. LOST (Ghost) */
.archive-card.state-lost {
    background: var(--card-bg);
    border: var(--card-border);
    opacity: 0.8;
}

.archive-card.state-lost:hover {
    opacity: 1;
}

.archive-card.state-lost .archive-card-title {
    color: var(--ws-fg-muted); /* Muted Gray for Light Theme */
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.archive-card.state-lost .status-badge {
    background: rgba(0, 0, 0, 0.05); /* Light/Translucent Gray */
    color: var(--ws-fg-muted); /* Muted Gray Text */
    border: none;
    height: 28px;
    padding: 0 12px;
    border-radius: 100px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.archive-card.state-lost .action-icon {
    color: var(--text-tertiary);
}

/* Archive Card Internals */
.archive-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.category-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.archive-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 0; /* Footer handles spacing */
}

.archive-card-title {
    /* Styles are now defined per state above */
    margin-bottom: auto;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.archive-card-bottom {
    height: 36px; /* Fixed height */
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    width: 100%;
}

.company-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.company-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4B5563; /* gray-600 */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: white;
}

.company-name-text {
    font-size: 14px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.5);
}

.company-name-text:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.action-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Theme Specifics for Internals */
body.theme-dark .category-badge {
    background: var(--ws-line);
    color: var(--ws-fg-soft);
}

body.theme-dark .company-name-text {
    color: var(--ws-fg-soft);
}

/* --- Mode Switch Button --- */
.mode-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    font-size: 14px;
}

#modeSwitchText {
    color: var(--text-secondary);
    margin-bottom: 0;
}

#modeSwitchBtn {
    background: none;
    border: none;
    color: var(--accent-color);
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    transition: color 0.2s;
}

#modeSwitchBtn:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* --- NEW MODAL STYLES (Competition Detail) --- */

/* 1. Header Section */
.modal-header-new {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.company-identity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.company-avatar-container {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid var(--ws-line); /* Light border for visibility */
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ws-bg-soft);
}

body.theme-dark .company-avatar-container {
    border: 1px solid var(--ws-line); /* Gray-700 - Visible border */
    background: var(--ws-surface-soft);
}

.company-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.company-fallback {
    font-size: 16px;
    font-weight: 600;
    color: var(--ws-fg-muted);
}

.company-info {
    display: flex;
    flex-direction: column;
}

#modalCompanyName {
    font-weight: 600;
    color: var(--ws-fg);
    font-size: 15px;
}

body.theme-dark #modalCompanyName {
    color: var(--ws-fg);
}

.header-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.icon-btn:hover {
    background: var(--segment-bg);
    color: var(--text-primary);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

/* 2. Hero Typography */
.modal-hero-title {
    font-size: 24px; /* 1.5rem */
    font-weight: 700;
    color: var(--ws-fg); /* Darkest Gray */
    margin-top: 16px;
    margin-bottom: 24px;
    line-height: 1.2;
}

body.theme-dark .modal-hero-title {
    color: var(--ws-fg);
}

/* 3. Key Metrics Grid ("Islands" Pattern) */
.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.metric-block {
    background: var(--ws-bg-soft); /* Light Gray Soft UI */
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* NO BORDER */
}

body.theme-dark .metric-block {
    background: var(--ws-surface-soft); /* Gray-800 - Distinct from Gray-900 BG */
}

.metric-label {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--ws-fg-muted);
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

body.theme-dark .metric-label {
    color: var(--ws-fg-muted); /* Gray-400 */
}

.metric-value {
    font-size: 15px;
    font-weight: 600;
    color: #1F2937;
    display: flex;
    align-items: center;
}

body.theme-dark .metric-value {
    color: var(--ws-fg); /* Gray-50 */
}

.metric-value.reward-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--ws-accent-emerald); /* Emerald-600 */
}

body.theme-dark .metric-value.reward-text {
    color: var(--ws-accent-emerald); /* Emerald-400 */
    text-shadow: 0 0 20px var(--ws-accent-emerald-soft); /* Slight glow */
}

/* 4. Content Body */
.modal-content-body {
    margin-bottom: 32px;
}

#modalDescription {
    font-size: 16px;
    line-height: 1.6;
    color: var(--ws-fg-muted);
    white-space: pre-wrap;
}

body.theme-dark #modalDescription {
    color: var(--ws-fg);
}

.tags-container {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* 5. Sticky Footer / Actions */
.modal-footer-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
}

.modal-footer-actions .btn-primary {
    height: 52px;
    font-size: 16px;
    font-weight: 700;
}

/* --- SUBMISSION SCREEN STYLES (Stage 2) --- */

/* Header */
.submission-header {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.submission-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    margin-left: 8px;
}

/* Detail Sections */
.detail-section {
    margin-bottom: 32px;
}

.section-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

/* Full Description Block - Refined */
.full-description-block {
    font-size: 16px;
    line-height: 1.6;
    color: var(--ws-fg-muted); /* Gray-700 */
    background: transparent; /* REMOVED background */
    padding: 0; /* REMOVED padding */
    border-radius: 0; /* REMOVED radius */
    white-space: pre-wrap;
    margin-bottom: 32px; /* Increased margin */
}

body.theme-dark .full-description-block {
    background: transparent;
    color: var(--ws-fg); /* Gray-300 for dark mode readability */
}

.brief-section {
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color, var(--ws-line));
}

.brief-section:first-child {
    padding-top: 0;
}

.brief-section-title {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 8px;
}

.brief-value-list {
    margin: 0;
    padding-left: 18px;
}

.brief-value-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.brief-value-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    border: 1px solid var(--border-color, var(--ws-line));
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.06);
}

.brief-value-row > strong {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.brief-value-row > span {
    min-width: 0;
    color: var(--text-primary);
    line-height: 1.45;
}

.brief-value-row .brief-value-list {
    margin: 0;
    padding-left: 16px;
}

.brief-range-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.brief-range-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.brief-range-row {
    border: 1px solid var(--border-color, var(--ws-line));
    border-radius: 12px;
    padding: 10px 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 64px;
    gap: 8px 12px;
    align-items: center;
}

.brief-range-labels {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.35;
}

.brief-range-row input[type="range"] {
    width: 100%;
    margin: 0;
    cursor: default;
}

.brief-range-row input[type="range"]:disabled {
    opacity: 1;
}

.brief-range-value {
    justify-self: end;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
}

.brief-palette-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(128px, 100%), 1fr));
    gap: 12px;
}

.brief-palette-item {
    border: 1px solid var(--border-color, var(--ws-line));
    border-radius: 12px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.brief-palette-item.exact {
    border-color: var(--ws-primary-line);
    background: var(--ws-primary-soft);
}

.brief-palette-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
}

.brief-palette-cell {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 0;
    border: 0;
    display: block;
}

.brief-palette-cell.empty {
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.brief-palette-label {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-secondary);
}

.brief-palette-primary {
    display: flex;
    align-items: center;
}

.brief-palette-primary code {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 7px;
    border: 1px solid rgba(99, 102, 241, 0.34);
    background: rgba(99, 102, 241, 0.12);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.brief-palette-codes {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.brief-palette-codes code {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(148, 163, 184, 0.12);
    font-size: 10px;
    line-height: 1.2;
    color: var(--text-secondary);
    white-space: nowrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.brief-criteria-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.brief-criteria-item {
    border: 1px solid var(--border-color, var(--ws-line));
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.brief-criteria-head {
    display: flex;
    align-items: baseline;
    gap: 6px;
    color: var(--text-primary);
}

.brief-criteria-index {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.brief-criteria-desc {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
}

.brief-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: -12px;
    margin-bottom: 8px;
}

.brief-copy-btn i {
    width: 16px;
    height: 16px;
}

.brief-copy-btn:disabled {
    cursor: progress;
    opacity: 0.72;
}

/* Materials Grid */
.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100px, 100%), 1fr));
    gap: 12px;
}

/* File Card - Refined */
.file-card {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: var(--segment-bg);
    cursor: pointer;
    transition: transform 0.2s;
    border: 1px solid var(--ws-line); /* Added border */
}

body.theme-dark .file-card {
    border-color: var(--ws-line);
}

.file-card:hover {
    transform: scale(1.02);
}

.file-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3); /* 30% opacity */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.file-card:hover .file-card-overlay {
    opacity: 1;
}

.file-card-icon {
    color: white;
    width: 24px;
    height: 24px;
}

.attachment-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.attachment-groups {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.attachment-group {
    border: 1px solid var(--border-color, var(--ws-line));
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.08);
    padding: 10px 12px;
}

body.theme-dark .attachment-group {
    background: var(--ws-surface-soft);
}

.attachment-group-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.attachment-list {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.attachment-link {
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px dashed transparent;
}

.attachment-link:hover {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.attachment-download-all {
    align-self: flex-start;
}

/* File Upload Area (Redesigned) */
.file-upload-area {
    border: 2px dashed var(--ws-line-strong); /* Gray-300 */
    border-radius: 12px;
    padding: 40px 20px;
    background: var(--ws-bg-soft); /* Gray-50 */
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

body.theme-dark .file-upload-area {
    border-color: var(--ws-line); /* Gray-700 */
    background: var(--ws-surface-soft);
}

.file-upload-area:hover {
    border-color: var(--accent-color);
    background: var(--ws-primary-soft); /* Tint of primary */
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.upload-icon {
    margin-bottom: 12px;
    color: var(--text-tertiary);
    opacity: 0.8;
}

.upload-icon svg {
    width: 32px;
    height: 32px;
}

.upload-text {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.upload-subtext {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Comment Field */
.comment-textarea {
    width: 100%;
    padding: 16px;
    background: var(--segment-bg);
    border: none; /* No border */
    border-radius: 12px;
    font-size: 15px;
    color: var(--text-primary);
    margin-top: 16px;
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
}

body.theme-dark .comment-textarea {
    background: var(--ws-surface-soft);
}

.comment-textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-color);
}

/* Submit Button */
.submit-btn {
    margin-top: 32px;
    height: 50px;
    font-size: 16px;
    font-weight: 700;
}

/* File Preview in Upload Area */
#filePreview {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.file-name {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.remove-file-btn {
    color: var(--error);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

/* Submission States */
.submission-state-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    height: 100%;
    min-height: 400px;
}

.state-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.state-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 400px;
    line-height: 1.5;
}

/* Loader */
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--ws-primary-soft);
    border-left-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 24px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Global Loader Overlay */
.loader-overlay {
    position: fixed;
    inset: 0;
    background: rgba(var(--ws-glass-rgb), 0.8);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

body.theme-dark .loader-overlay {
    background: var(--ws-bg);
}

.loader-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Success Icon */
.success-icon-circle {
    width: 80px;
    height: 80px;
    background: var(--ws-accent-emerald-soft);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    color: var(--ws-accent-emerald);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

body.theme-dark .success-icon-circle {
    background: var(--ws-accent-emerald-soft);
}

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Company Podium Card Specifics */
.leaderboard-card.company-card .podium-avatar-container {
    border-radius: 12px;
}

/* --- Refactored User Profile Modal --- */
.profile-modal-content {
    width: 400px;
    max-width: 90vw;
    padding: 32px; /* Increased padding */
    border-radius: 24px;
    text-align: center;
    background: var(--card-bg);
    position: relative; /* For absolute close button */
}

/* Close Button Override */
.profile-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px; /* Increased hit area */
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    transition: background 0.2s;
    z-index: 10;
}

.profile-close-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

body.theme-dark .profile-close-btn:hover {
    background: var(--ws-line);
}

/* Identity Section */
.profile-identity-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
}

.profile-avatar-wrapper {
    position: relative;
    width: 80px; /* Increased size */
    height: 80px;
    margin-bottom: 12px; /* Space for badge overlap adjustment */
}

.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    /* Theme-aware border ring */
    box-shadow: 0 0 0 4px var(--card-bg);
}

/* Company Shape Distinction */
.profile-avatar.company-shape {
    border-radius: 24px; /* rounded-2xl */
}

/* Level Badge - Pill Shape, Overlapping */
.profile-level-badge {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-color);
    color: white;
    padding: 2px 10px;
    border-radius: 100px; /* Pill shape */
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    border: 4px solid var(--modal-bg); /* Cutout effect */
    z-index: 2;
}

.profile-username {
    font-size: 24px; /* H3 equivalent */
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 8px; /* Ensure consistent margin */
    margin-bottom: 4px;
    text-transform: none; /* Keep original casing */
    line-height: 1.2;
}

/* Stats Container - Flat Design */
.profile-stats-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0; /* Gap handled by padding/divider */
    margin-bottom: 24px;
    background: rgba(0, 0, 0, 0.03); /* Very subtle bg for container */
    border-radius: 16px;
    padding: 16px 0;
}

body.theme-dark .profile-stats-container {
    background: var(--ws-surface-soft);
}

.profile-stat-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.profile-stat-divider {
    width: 1px;
    height: 32px;
    background: var(--ws-line-strong);
    opacity: 0.5;
}

.profile-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.profile-stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

/* Socials Row - Scalable */
.profile-socials-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

/* Icon Button Style */
.social-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px; /* Soft square */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    background: var(--segment-bg);
    color: var(--text-secondary);
}

.social-icon-btn:hover {
    transform: translateY(-2px);
    color: var(--text-primary);
    background: var(--input-bg);
    border-color: var(--ws-line-strong);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Specific Brand Colors on Hover (Optional, keeping monochrome for now as requested or subtle) */
.social-tg:hover { color: #2AABEE; }
.social-gh:hover { color: var(--text-primary); }
.social-vk:hover { color: #0077FF; }

/* Full Width Button Style (for single link) */
.social-full-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    border-radius: 12px;
    background: var(--segment-bg);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s;
}

.social-full-btn:hover {
    background: var(--ws-line-strong);
}

.profile-created-at {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 8px;
}

/* --- CLAIM REWARD MODAL (Victory Claim) --- */

/* Container */
.claim-modal-content {
    background: var(--card-bg); /* Light Theme Default */
    border-radius: 24px;
    padding: 40px 32px;
    width: 100%;
    max-width: 420px;
    position: relative;
    text-align: center;
    color: var(--text-primary);
    box-shadow: var(--card-shadow);
    border: var(--card-border);
}

/* Dark Theme Override */
body.theme-dark .claim-modal-content {
    background: var(--ws-bg); /* Deep Navy (Slate-900) */
    color: var(--ws-fg);
    /* Spotlight Effect */
    background-image: radial-gradient(circle at 50% 0%, var(--ws-line) 0%, transparent 60%);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--ws-surface-soft);
}

/* Close Button */
.claim-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
}

.claim-close-btn:hover {
    background: var(--segment-bg);
    color: var(--text-primary);
}

body.theme-dark .claim-close-btn {
    color: var(--ws-fg-soft);
}

body.theme-dark .claim-close-btn:hover {
    background: var(--ws-line);
    color: var(--ws-fg);
}

/* Hero Section */
.claim-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 32px;
}

.claim-icon-wrapper {
    margin-bottom: 24px;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.4)); /* Gold Glow */
}

.claim-icon {
    width: 64px;
    height: 64px;
    color: var(--ws-accent-gold); /* Darker Gold for Light Mode visibility */
    fill: none; /* No Fill */
    stroke-width: 2px;
}

body.theme-dark .claim-icon {
    color: var(--ws-accent-gold); /* Same color for both */
}

.claim-title {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

body.theme-dark .claim-title {
    color: var(--ws-fg-muted);
}

.claim-amount-wrapper {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}

.claim-amount {
    font-family: var(--font-display);
    font-size: 56px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    text-shadow: none;
}

body.theme-dark .claim-amount {
    color: var(--ws-fg);
    text-shadow: 0 4px 20px rgba(255, 215, 0, 0.3); /* Gold Glow only in Dark Mode */
}

.claim-currency {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-tertiary);
}

body.theme-dark .claim-currency {
    color: var(--ws-fg-muted);
}

/* Gamification Section (Progress Bar) */
.claim-progress-section {
    margin-bottom: 40px;
    text-align: left;
}

.claim-progress-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.claim-level-current {
    font-weight: 700;
    color: var(--text-primary);
}

body.theme-dark .claim-level-current {
    color: var(--ws-fg);
}

.claim-level-next {
    font-weight: 500;
    color: var(--text-tertiary);
}

body.theme-dark .claim-level-next {
    color: var(--ws-fg-soft);
}

.claim-progress-bar-bg {
    width: 100%;
    height: 8px;
    background: var(--segment-bg); /* Light Mode Bg */
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

body.theme-dark .claim-progress-bar-bg {
    background: var(--ws-line); /* Dark Mode Bg */
}

.claim-progress-bar-fill {
    height: 100%;
    width: 0%; /* Animated via JS */
    background: linear-gradient(90deg, var(--ws-accent-gold) 0%, #FFD700 100%); /* Orange to Gold */
    border-radius: 10px;
    transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1); /* Smooth ease-out */
}

.claim-xp-context {
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary); /* Light Mode: Secondary Text */
    font-weight: 500;
}

/* Actions */
.claim-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.claim-btn-primary {
    height: 56px;
    background: var(--ws-accent-gold); /* Primary Orange */
    color: #000000; /* Black Text for Contrast */
    font-weight: 700;
    font-size: 16px;
    border-radius: 16px;
    border: none;
    box-shadow: 0 4px 12px var(--ws-accent-gold-line);
}

.claim-btn-primary:hover {
    background: var(--ws-accent-gold);
    transform: scale(0.98);
}

.claim-btn-secondary {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    height: auto;
    padding: 8px;
}

.claim-btn-secondary:hover {
    background: var(--segment-bg);
    color: var(--text-primary);
}

body.theme-dark .claim-btn-secondary {
    color: var(--ws-fg);
}

body.theme-dark .claim-btn-secondary:hover {
    background: var(--ws-surface-soft);
}

.claim-share-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.claim-share-main {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.claim-share-sub {
    font-size: 11px;
    opacity: 0.6;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* Mobile Bottom Sheet Adaptation */
@media (max-width: 640px) {
    .claim-modal-content {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 24px 24px 0 0; /* Top corners only */
        padding: 32px 24px 48px 24px; /* Extra bottom padding for safe area */
        transform: translateY(0);
        margin: 0;
        animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes slideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
}

/* --- XP Context Text (Dark Mode Fix) --- */
body.theme-dark .claim-xp-context {
    color: var(--ws-fg-muted); /* Light Grey */
}

.xp-highlight {
    color: var(--ws-accent-gold); /* Gold/Yellow */
    font-weight: 700;
}

body.theme-dark .xp-highlight {
    color: var(--ws-accent-gold); /* Lighter Gold for Dark Mode */
}

/* --- WALLET DRAWER (NEW) --- */

.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 3000;
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.drawer-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.drawer-container {
    width: 100%;
    max-width: 480px; /* lg: max-w-xl equivalent approx */
    height: 100%;
    background: var(--ws-surface);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

body.theme-dark .drawer-container {
    background: var(--ws-bg); /* Dark Theme Background */
}

.drawer-overlay:not(.hidden) .drawer-container {
    transform: translateX(0);
}

/* Component 1: Hero Header (Sticky) */
.drawer-header {
    padding: 24px;
    background: var(--ws-surface); /* bg-white */
    border-bottom: 1px solid var(--ws-line); /* Gray-200 */
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
}

body.theme-dark .drawer-header {
    background: var(--ws-surface); /* Dark Header Bg */
    border-bottom: 1px solid var(--ws-surface); /* Dark Border */
}

.drawer-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.drawer-title {
    font-size: 20px; /* text-xl */
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.drawer-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}

.drawer-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

body.theme-dark .drawer-close:hover {
    background: var(--ws-line);
}

.balance-block {
    margin-top: 24px; /* mt-6 */
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
}

.balance-eyebrow {
    font-size: 12px; /* text-xs */
    text-transform: uppercase;
    letter-spacing: 0.05em; /* tracking-wider */
    color: var(--ws-fg-muted); /* Gray-500 */
    margin-bottom: 4px;
    font-weight: 500; /* font-medium */
}

body.theme-dark .balance-eyebrow {
    color: var(--ws-fg-muted); /* Gray-400 */
}

.balance-amount {
    font-family: var(--font-display);
    font-size: 48px; /* text-5xl approx */
    font-weight: 700;
    color: var(--ws-fg); /* Gray-900 */
    line-height: 1;
    font-variant-numeric: tabular-nums;
    margin-top: 4px; /* mt-1 */
    margin-bottom: 24px; /* mb-6 */
}

body.theme-dark .balance-amount {
    color: var(--ws-fg);
}

.btn-withdraw {
    width: 100%;
    padding: 14px;
    background: #FF8A00; /* Brand Orange */
    color: white;
    border: none;
    border-radius: 12px; /* rounded-xl */
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-withdraw:hover {
    background: #E67A00;
}

.btn-withdraw:disabled {
    background: var(--ws-line);
    color: var(--ws-fg-soft);
    cursor: not-allowed;
}

body.theme-dark .btn-withdraw:disabled {
    background: var(--ws-surface-strong);
    color: var(--ws-fg-muted);
}

/* Scrollable Body */
.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px; /* Added top padding for gap */
    /* Custom Scrollbar */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE 10+ */
}

.drawer-body::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Webkit */
}

/* Component 2: Interactive Chart */
.chart-container {
    padding: 24px; /* p-6 */
    margin-bottom: 32px; /* mb-8 */
    border-radius: 16px; /* rounded-2xl */
    background: var(--ws-bg-soft); /* bg-gray-50 */
    border: 1px solid #F3F4F6; /* border-gray-100 */
}

body.theme-dark .chart-container {
    background: var(--ws-bg); /* Dark Mode Card Bg */
    border: 1px solid var(--ws-surface-soft);
}

.chart-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px; /* mb-8 */
    width: 100%;
}

@media (min-width: 1280px) { /* xl breakpoint */
    .chart-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.chart-title {
    font-size: 18px; /* text-lg */
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.chart-controls-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

/* Chart Navigation Controls */
.chart-nav-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--segment-bg);
    padding: 0 8px;
    border-radius: 12px;
    height: 40px; /* Changed from 36px */
    flex: 1; /* Allow to grow */
    justify-content: space-between; /* Space out arrows and label */
}

body.theme-dark .chart-nav-controls {
    background: var(--ws-surface);
}

.nav-arrow {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.nav-arrow:hover:not(:disabled) {
    color: var(--text-primary);
}

.nav-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.nav-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 80px;
    text-align: center;
}

/* Small Segmented Control */
.segmented-control-small {
    background: var(--ws-bg-soft);
    padding: 4px; /* Changed from 2px */
    border-radius: 8px;
    display: inline-flex;
    height: auto; /* Changed from 36px to auto to fit pills + padding */
    align-items: center;
    flex: 1; /* Allow to grow to match width */
}

body.theme-dark .segmented-control-small {
    background: var(--ws-surface); /* Gray-800 */
}

.segment-pill {
    padding: 0 12px;
    height: 32px; /* Changed from 100% */
    font-size: 12px;
    font-weight: 600; /* Changed from 500 */
    color: var(--ws-fg-muted);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1; /* Distribute space equally */
}

body.theme-dark .segment-pill {
    color: var(--ws-fg-muted);
}

.segment-pill.active {
    background: var(--ws-surface);
    color: var(--ws-fg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    font-weight: 600;
}

body.theme-dark .segment-pill.active {
    background: var(--ws-surface-strong); /* Gray-700 */
    color: var(--ws-fg);
}

.chart-visual {
    height: 192px; /* h-48 */
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    position: relative;
    transition: opacity 0.3s ease; /* For fade effect */
    margin-bottom: 8px;
}

.chart-visual.fade-out {
    opacity: 0;
}

/* Chart Empty State */
.chart-empty-state {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.chart-empty-dashed {
    position: absolute;
    inset: 0;
    border: 2px dashed var(--ws-line);
    border-radius: 12px;
}

body.theme-dark .chart-empty-dashed {
    border-color: var(--ws-surface-strong);
}

.chart-empty-state p {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    max-width: 200px;
    z-index: 1;
    background: var(--card-bg); /* To cover dashes if needed, or just sit on top */
    padding: 8px;
}

/* Chart Bars (Dynamic) */
.chart-bar {
    width: 100%;
    background: var(--ws-line); /* Gray-200 (Inactive) */
    border-radius: 6px 6px 0 0; /* rounded-t-md */
    position: relative;
    cursor: pointer;
    transition: height 0.5s ease, background-color 0.2s;
    min-height: 4px; /* Ensure visibility for 0 values */
}

body.theme-dark .chart-bar {
    background: var(--ws-surface-soft); /* Gray-800/50 (Inactive) */
}

.chart-bar:hover {
    background: var(--ws-line-strong); /* Gray-300 */
}

body.theme-dark .chart-bar:hover {
    background: var(--ws-surface-soft);
}

.chart-bar.active {
    background: #FF8A00 !important; /* Brand Orange (Active State) - Forced for both themes */
}

.chart-bar.active:hover {
    filter: brightness(1.1);
}

/* X-Axis Labels */
.chart-x-axis {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 8px;
}

.x-axis-label {
    font-size: 10px; /* text-xs */
    color: var(--ws-fg-soft); /* text-gray-400 */
    text-align: center;
    width: 100%;
}

/* Tooltip */
.chart-tooltip {
    position: absolute;
    top: -50px; /* Adjusted for multi-line */
    left: 50%;
    transform: translateX(-50%);
    background: #111827;
    color: white;
    font-size: 10px;
    padding: 6px 8px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 20;
    text-align: center;
    line-height: 1.4;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body.theme-dark .chart-tooltip {
    background: var(--ws-fg);
    color: var(--ws-surface);
}

.chart-bar:hover .chart-tooltip {
    opacity: 1;
}

/* Component 3: Transaction Ledger */
.ledger-container {
    padding: 0; /* Reset padding as it's inside drawer-body now */
}

.ledger-filters-sticky {
    position: sticky;
    top: 0;
    background: inherit; /* Matches container bg */
    padding-bottom: 24px; /* mb-6 equivalent */
    z-index: 5;
}

/* Filter Pills Customization */
.ledger-filters-sticky .segmented-control-small {
    background: var(--ws-bg-soft); /* bg-gray-100 */
    border-radius: 8px; /* rounded-lg */
    padding: 4px; /* p-1 */
    height: auto;
    display: inline-flex;
}

body.theme-dark .ledger-filters-sticky .segmented-control-small {
    background: var(--ws-surface-soft); /* bg-gray-800/50 */
}

.ledger-filters-sticky .segment-pill {
    border-radius: 6px; /* rounded-md */
    padding: 6px 16px;
    height: 32px;
    color: var(--ws-fg-muted); /* text-gray-500 */
    font-weight: 600; /* Ensure bold */
}

.ledger-filters-sticky .segment-pill.active {
    background: var(--ws-surface); /* bg-white */
    color: var(--ws-fg); /* text-gray-900 */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); /* shadow-sm */
    font-weight: 600; /* Ensure bold */
}

body.theme-dark .ledger-filters-sticky .segment-pill.active {
    background: var(--ws-surface);
    color: var(--ws-fg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.ledger-list {
    display: flex;
    flex-direction: column;
    min-height: 200px; /* Ensure minimum height for empty state consistency */
}

.ledger-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0; /* py-4 */
    border-bottom: 1px solid #F3F4F6; /* border-gray-100 */
}

.ledger-item:last-child {
    border-bottom: none;
}

body.theme-dark .ledger-item {
    border-bottom: 1px solid var(--ws-surface-soft);
}

.ledger-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.ledger-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ledger-icon.income {
    background: var(--ws-accent-emerald-soft); /* bg-green-50 */
    color: var(--ws-accent-emerald); /* text-green-500 */
}

.ledger-icon.withdrawal {
    background: var(--ws-bg-soft); /* bg-gray-100 */
    color: var(--ws-fg-muted); /* text-gray-500 */
}

body.theme-dark .ledger-icon.withdrawal {
    background: var(--ws-surface);
    color: var(--ws-fg-muted);
}

.ledger-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ledger-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ledger-date {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.ledger-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
    margin-left: 12px;
}

.ledger-amount {
    font-family: var(--font-display);
    font-size: 14px; /* text-sm */
    font-weight: 500;
    color: var(--ws-fg); /* text-gray-900 (default) */
    font-variant-numeric: tabular-nums;
}

.ledger-amount.income {
    color: var(--ws-accent-emerald); /* Green */
}

.ledger-status {
    margin-top: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-pending {
    background: var(--ws-error-soft);
    color: var(--ws-error);
}

body.theme-dark .status-pending {
    background: var(--ws-error-soft);
    color: var(--ws-error);
}

/* Empty State Ledger */
.ledger-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    text-align: center;
    min-height: 200px; /* Match min-height of list container */
    height: 100%; /* Fill available space */
}

.ledger-empty-icon {
    width: 48px;
    height: 48px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.ledger-empty-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.btn-ghost-secondary {
    margin-top: 16px;
    padding: 8px 24px;
    background: var(--ws-surface);
    border: 1px solid var(--ws-line); /* border-gray-200 */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); /* shadow-sm */
    border-radius: 8px; /* rounded-lg */
    font-size: 14px; /* text-sm */
    font-weight: 500; /* font-medium */
    color: var(--ws-fg-muted); /* text-gray-700 */
    cursor: pointer;
    transition: background 0.2s;
    width: auto;
}

.btn-ghost-secondary:hover {
    background: var(--ws-bg-soft); /* hover: bg-gray-50 */
}

body.theme-dark .btn-ghost-secondary {
    background: var(--ws-surface-soft);
    border-color: var(--ws-line);
    color: var(--ws-fg);
}

body.theme-dark .btn-ghost-secondary:hover {
    background: var(--ws-line);
}

/* --- UNIFIED STATUS BADGE --- */
.status-badge {
    height: 28px; /* Fixed height */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    box-sizing: border-box;
}

.status-badge .icon {
    width: 14px;
    height: 14px;
    margin-right: 4px;
}

/* --- ARCHIVE TAB ANIMATION --- */
.archive-text-wrapper {
    width: 46px; /* Fixed width to hold "Архив" */
    text-align: left; /* Keep text aligned near icon */
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    perspective: 300px;
}

.text-archive, .text-count {
    display: block;
    transition: transform 0.5s cubic-bezier(0.2, 1, 0.8, 1), opacity 0.5s cubic-bezier(0.2, 1, 0.8, 1);
    backface-visibility: hidden;
}

.tab-btn[data-tab="archive"].animate .text-archive {
    transform: translateY(-150%) rotateX(90deg);
    opacity: 0;
}

.text-count {
    position: absolute;
    transform: translateY(150%) rotateX(-90deg);
    opacity: 0;
}

.tab-btn[data-tab="archive"].animate .text-count {
    transform: translateY(0) rotateX(0);
    opacity: 1;
}

/* --- Received Amount Container (New) --- */
.received-amount-container {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 12px;
    background-color: rgba(46, 204, 113, 0.08); /* Very pale green */
    border-radius: 8px; /* Or 100px if preferred */
}

.received-icon {
    width: 16px;
    height: 16px;
    color: var(--ws-accent-emerald); /* Strong green */
    margin-right: 6px;
}

.received-amount-text {
    font-weight: 600;
    color: var(--ws-accent-emerald); /* Strong green */
    font-size: 14px;
}

/* Dark Mode Override for Received Container */
body.theme-dark .received-amount-container {
    background-color: var(--ws-accent-emerald-soft); /* Keep pale green bg */
}

body.theme-dark .received-icon {
    color: var(--ws-accent-emerald);
}

body.theme-dark .received-amount-text {
    color: var(--ws-accent-emerald);
}

/* --- Contact Modal Styles --- */
.contact-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 8px;
    margin-top: 24px;
}

.contact-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.contact-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.contact-icon-container {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--ws-bg-soft);
    color: var(--text-primary);
}

body.theme-dark .contact-icon-container {
    background: var(--ws-surface);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    /* Added for truncation */
    min-width: 0;
    flex-shrink: 1;
}

.contact-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.contact-status {
    font-size: 13px;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.contact-action-btn {
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0; /* Prevent button shrinking */
}

/* Secondary / Outline Style */
.contact-action-btn.secondary {
    background: transparent;
    border: 1px solid var(--ws-line-strong);
    color: var(--ws-fg-muted);
}

.contact-action-btn.secondary:hover {
    background: rgba(0, 0, 0, 0.05);
}

body.theme-dark .contact-action-btn.secondary {
    border: 1px solid var(--ws-surface-strong);
    color: var(--ws-fg);
}

body.theme-dark .contact-action-btn.secondary:hover {
    background: var(--ws-line);
}

/* Ghost Style */
.contact-action-btn.ghost {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 12px; /* Increased padding */
}

.contact-action-btn.ghost:hover {
    background: var(--ws-error-soft); /* Red tint */
    color: var(--ws-error); /* Red text */
}

body.theme-dark .contact-action-btn.ghost:hover {
    background: var(--ws-error-soft);
    color: var(--ws-error);
}

/* Brand Icon Container */
.brand-icon-container {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Margin handled by parent gap */
}

/* --- Rank Styles --- */

/* Base Rank Item */
.status-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--input-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    opacity: 0.6; /* Inactive state */
    transition: all 0.3s ease;
    margin-bottom: 12px;
}

.status-item.active {
    opacity: 1;
    border-width: 2px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: scale(1.02);
}

.status-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    transition: all 0.3s ease;
}

.status-name {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 2px;
    transition: color 0.3s ease;
}

.status-range {
    font-size: 12px;
    color: var(--text-secondary);
}

/* --- Rank Specific Styles --- */

/* Seeker (Green) */
.rank-seeker .status-icon-box {
    background: var(--ws-accent-emerald-soft); /* Light Green bg */
    color: var(--rank-seeker);
}
.rank-seeker.active {
    border-color: var(--rank-seeker);
    box-shadow: 0 4px 12px var(--ws-accent-emerald-soft);
}
.rank-seeker.active .status-icon-box {
    background: var(--rank-seeker);
    color: white;
}
.rank-seeker.active .status-name {
    color: var(--rank-seeker);
}

/* Practitioner (Blue) */
.rank-practitioner .status-icon-box {
    background: var(--ws-verified-soft); /* Light Blue bg */
    color: var(--rank-practitioner);
}
.rank-practitioner.active {
    border-color: var(--rank-practitioner);
    box-shadow: 0 4px 12px var(--ws-verified-soft);
}
.rank-practitioner.active .status-icon-box {
    background: var(--rank-practitioner);
    color: white;
}
.rank-practitioner.active .status-name {
    color: var(--rank-practitioner);
}

/* Pro (Purple) */
.rank-pro .status-icon-box {
    background: rgba(139, 92, 246, 0.1); /* Light Purple bg */
    color: var(--rank-pro);
}
.rank-pro.active {
    border-color: var(--rank-pro);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
    background-image: radial-gradient(circle at top right, rgba(139, 92, 246, 0.05), transparent 70%);
}
.rank-pro.active .status-icon-box {
    background: var(--rank-pro);
    color: white;
}
.rank-pro.active .status-name {
    color: var(--rank-pro);
}

/* Expert (Gold) */
.rank-expert .status-icon-box {
    background: var(--ws-accent-gold-soft); /* Light Gold bg */
    color: var(--rank-expert);
}
.rank-expert.active {
    border-color: var(--rank-expert);
    box-shadow: 0 4px 12px var(--ws-accent-gold-soft);
    background-image: radial-gradient(circle at top right, rgba(245, 158, 11, 0.08), transparent 70%);
}
.rank-expert.active .status-icon-box {
    background: var(--rank-expert);
    color: white;
}
.rank-expert.active .status-name {
    color: var(--rank-expert);
}

/* Visionary (Red) */
.rank-visionary .status-icon-box {
    background: var(--ws-error-soft); /* Light Red bg */
    color: var(--rank-visionary);
}
.rank-visionary.active {
    border-color: var(--rank-visionary);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
    background-image: radial-gradient(circle at top right, var(--ws-error-soft), transparent 60%),
        linear-gradient(45deg, transparent 48%, rgba(239, 68, 68, 0.05) 50%, transparent 52%);
    background-size: 100% 100%, 20px 20px;
}
.rank-visionary.active .status-icon-box {
    background: var(--rank-visionary);
    color: white;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}
.rank-visionary.active .status-name {
    color: var(--rank-visionary);
}

/* Dark Theme Adjustments for Inactive States */
body.theme-dark .status-item {
    background: var(--ws-surface);
    border-color: var(--ws-surface-soft);
}

body.theme-dark .rank-seeker .status-icon-box { background: var(--ws-accent-emerald-soft); }
body.theme-dark .rank-practitioner .status-icon-box { background: var(--ws-verified-soft); }
body.theme-dark .rank-pro .status-icon-box { background: var(--ws-primary-soft); }
body.theme-dark .rank-expert .status-icon-box { background: var(--ws-accent-gold-soft); }
body.theme-dark .rank-visionary .status-icon-box { background: var(--ws-error-soft); }

/* --- Hero Badge & List Badge Coloring --- */

/* Hero Badge (Profile) */
.hero-level-badge.rank-seeker { background: var(--rank-seeker); box-shadow: 0 0 15px rgba(16, 185, 129, 0.4); }
.hero-level-badge.rank-practitioner { background: var(--rank-practitioner); box-shadow: 0 0 15px rgba(59, 130, 246, 0.4); }
.hero-level-badge.rank-pro { background: var(--rank-pro); box-shadow: 0 0 15px rgba(139, 92, 246, 0.4); }
.hero-level-badge.rank-expert { background: var(--rank-expert); box-shadow: 0 0 15px rgba(245, 158, 11, 0.4); }
.hero-level-badge.rank-visionary { background: var(--rank-visionary); box-shadow: 0 0 15px rgba(239, 68, 68, 0.4); }

/* List & Podium Badge (Leaderboard) */
.list-level-badge.rank-seeker, .level-badge.rank-seeker { color: var(--rank-seeker); background: var(--ws-accent-emerald-soft); }
.list-level-badge.rank-practitioner, .level-badge.rank-practitioner { color: var(--rank-practitioner); background: var(--ws-verified-soft); }
.list-level-badge.rank-pro, .level-badge.rank-pro { color: var(--rank-pro); background: rgba(139, 92, 246, 0.1); }
.list-level-badge.rank-expert, .level-badge.rank-expert { color: var(--rank-expert); background: var(--ws-accent-gold-soft); }
.list-level-badge.rank-visionary, .level-badge.rank-visionary { color: var(--rank-visionary); background: var(--ws-error-soft); }

/* Dark Theme Adjustments for Badges */
body.theme-dark .hero-level-badge.rank-seeker { background: var(--ws-accent-emerald-soft); color: var(--ws-accent-emerald); box-shadow: none; }
body.theme-dark .hero-level-badge.rank-practitioner { background: var(--ws-verified-soft); color: var(--ws-verified); box-shadow: none; }
body.theme-dark .hero-level-badge.rank-pro { background: var(--ws-primary-soft); color: var(--ws-primary); box-shadow: none; }
body.theme-dark .hero-level-badge.rank-expert { background: var(--ws-accent-gold-soft); color: var(--ws-accent-gold); box-shadow: none; }
body.theme-dark .hero-level-badge.rank-visionary { background: var(--ws-error-line); color: var(--ws-error); box-shadow: none; }

/* Dark Theme List Badges (Same as Light Theme but with adjusted colors if needed, currently reusing light theme logic but with dark theme colors) */
body.theme-dark .list-level-badge.rank-seeker, body.theme-dark .level-badge.rank-seeker { color: var(--ws-accent-emerald); background: var(--ws-accent-emerald-soft); }
body.theme-dark .list-level-badge.rank-practitioner, body.theme-dark .level-badge.rank-practitioner { color: var(--ws-verified); background: var(--ws-verified-soft); }
body.theme-dark .list-level-badge.rank-pro, body.theme-dark .level-badge.rank-pro { color: var(--ws-primary); background: var(--ws-primary-soft); }
body.theme-dark .list-level-badge.rank-expert, body.theme-dark .level-badge.rank-expert { color: var(--ws-accent-gold); background: var(--ws-accent-gold-soft); }
body.theme-dark .list-level-badge.rank-visionary, body.theme-dark .level-badge.rank-visionary { color: var(--ws-error); background: var(--ws-error-soft); }

/* Dark Theme Modal Active Border Fix */
body.theme-dark .status-item.rank-seeker.active { border-color: var(--rank-seeker); }
body.theme-dark .status-item.rank-practitioner.active { border-color: var(--rank-practitioner); }
body.theme-dark .status-item.rank-pro.active { border-color: var(--rank-pro); }
body.theme-dark .status-item.rank-expert.active { border-color: var(--rank-expert); }
body.theme-dark .status-item.rank-visionary.active { border-color: var(--rank-visionary); }

/* --- EMPTY STATE STYLES --- */
.empty-state-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    background: var(--card-bg);
    border-radius: 24px;
    border: var(--card-border);
    box-shadow: var(--card-shadow);
    margin-top: 20px;
}

.empty-state-icon-bg {
    width: 80px;
    height: 80px;
    background: var(--ws-accent-gold-soft); /* Amber/Gold tint */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

body.theme-dark .empty-state-icon-bg {
    background: var(--ws-accent-gold-soft);
}

.empty-state-icon {
    width: 40px;
    height: 40px;
    color: var(--ws-accent-gold);
}

.empty-state-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.empty-state-desc {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 300px;
    margin-bottom: 32px;
    line-height: 1.5;
}

/* --- GLOBAL LOADER --- */
.loader-overlay {
    position: fixed;
    inset: 0;
    background: rgba(var(--ws-glass-rgb), 0.8);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

body.theme-dark .loader-overlay {
    background: var(--ws-bg);
}

.loader-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* --- SETTINGS MODAL STYLES --- */

/* Settings Tabs */
.settings-tabs {
    display: flex;
    background: var(--segment-bg);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.settings-tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.settings-tab-pane:not(.hidden) {
    display: block;
}

/* Settings Group Header */
.settings-group-header {
    font-size: 12px; /* Updated to 12px */
    text-transform: uppercase;
    letter-spacing: 0.05em; /* Updated */
    font-weight: 600; /* Updated */
    color: var(--text-muted);
    margin-bottom: 16px; /* Updated spacing */
    margin-top: 32px;
}

.settings-group-header:first-child {
    margin-top: 0;
}

/* Settings Item Row */
.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Align top for icon stability */
    padding: 0; /* Reset padding */
    margin-bottom: 16px; /* Use gap instead of padding/border */
    border-bottom: none; /* Removed border */
}

.settings-item:last-child {
    margin-bottom: 0;
}

.settings-item-left {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex: 1;
    padding-right: 16px;
}

.settings-icon {
    width: 24px;
    height: 24px;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-top: 2px; /* Align with title */
}

.settings-text-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-title {
    font-size: 15px;
    font-weight: 500; /* Medium */
    color: var(--text-primary);
}

.settings-subtitle {
    font-size: 13px;
    color: var(--ws-fg-muted); /* Light Mode Contrast */
    line-height: 1.4;
}

body.theme-dark .settings-subtitle {
    color: var(--ws-fg-muted); /* Dark Mode Contrast */
}

/* --- WIZARD STYLES --- */
.wizard-container {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}

.wizard-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.progress-step {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--segment-bg);
    border: 2px solid var(--border-muted);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transition: all 0.3s ease;
}

.progress-step.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    transform: scale(1.1);
}

.progress-step.completed {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.progress-line {
    flex: 1;
    height: 2px;
    background: var(--border-muted);
}

.wizard-step {
    animation: fadeIn 0.5s ease;
}

.wizard-step h2 {
    text-align: center;
    margin-bottom: 32px;
}

.upload-limit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.upload-limit-row label {
    margin-bottom: 0;
}

.upload-limit-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--ws-primary-soft);
    color: var(--accent-color);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.upload-helper-text {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

.drop-zone.is-full {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.05);
}

.refs-preview {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.upload-preview-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--input-bg);
}

.upload-preview-item__meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.upload-preview-item__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
}

.upload-preview-item__badge {
    width: fit-content;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--segment-bg);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
}

.upload-preview-item__badge.is-new {
    background: rgba(249, 115, 22, 0.12);
    color: var(--warning-color);
}

.upload-preview-remove {
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 10px;
    transition: background 0.2s ease, color 0.2s ease;
}

.upload-preview-remove:hover {
    background: rgba(239, 68, 68, 0.08);
    color: var(--ws-error);
}

.wizard-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
    gap: 16px;
}

/* .wizard-actions .btn { flex: 1 } удалено — рушило layout стеклянной
   sticky-панели (каждая кнопка растягивалась в треть ширины).
   Canonical стили в company-dashboard.css: панель flex + group inline. */

/* Step 1: Type Pills (Inverted Trapezoid Layout) */
.type-selection-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Centers the items, creating the trapezoid effect */
    gap: 16px;
    max-width: 800px;
    margin: 0 auto;
}

.type-pill {
    position: relative;
    flex: 0 1 calc(33.333% - 16px); /* Roughly 1/3 width to fit 3 on top */
    min-width: 160px; /* Prevent becoming too small */
}

.type-pill input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.pill-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    border: 2px solid var(--ws-line-strong); /* Visible border in light mode */
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); /* Smooth transition */
    background: var(--input-bg);
}

.pill-content i {
    width: 32px;
    height: 32px;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.pill-content span {
    font-weight: 600;
    color: var(--text-primary);
}

/* Hover Effect (Light & Dark) */
.type-pill:hover .pill-content {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color); /* Highlight border on hover */
}

/* Active State */
.type-pill input[type="radio"]:checked + .pill-content {
    border-color: var(--accent-color);
    background: var(--ws-primary-soft);
    box-shadow: 0 0 0 3px var(--ws-primary-soft);
}

.type-pill input[type="radio"]:checked + .pill-content i {
    color: var(--accent-color);
}

/* Dark Theme Adjustments for Pills */
body.theme-dark .pill-content {
    border-color: var(--ws-line); /* Subtle border in dark mode */
    background: var(--ws-surface-soft);
}

body.theme-dark .type-pill:hover .pill-content {
    background: var(--ws-line);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-color);
}

/* Step 2: Char Counters & Visual Compass */
.char-counter {
    position: absolute;
    bottom: 12px;
    right: 16px;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--input-bg);
    padding: 2px 4px;
}

textarea + .char-counter {
    bottom: 16px;
}

#visualCompassBlock h3 {
    margin-bottom: 16px;
}

.compass-sliders {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 24px;
}

.compass-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
}

.compass-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}
.compass-label.right { text-align: right; }

.compass-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: var(--segment-bg);
    border-radius: 8px;
    outline: none;
    padding: 0;
}
.compass-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent-color);
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid var(--card-bg);
}
.compass-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--accent-color);
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid var(--card-bg);
}

/* Step 3: Boosters */
.boosters-block {
    margin-top: 32px;
    margin-bottom: 32px;
    border: 1px solid var(--border-muted);
    border-radius: var(--radius-lg);
    padding: 16px;
}
.boosters-block h3 {
    margin-bottom: 16px;
    padding-left: 8px;
}

.booster-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 8px;
    border-radius: var(--radius-md);
}
.booster-item:not(:last-child) {
    border-bottom: 1px solid var(--border-muted);
}

.booster-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 16px;
}
.booster-title {
    font-weight: 600;
    color: var(--text-primary);
}
.booster-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Step 4: Review Block */
.review-block {
    background: var(--segment-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.review-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
}
.review-label {
    color: var(--text-secondary);
    font-weight: 500;
}
.review-value {
    color: var(--text-primary);
    font-weight: 600;
}

/* --- Checkbox --- */
.checkbox-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 15px;
    color: var(--text-primary);
}
.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
}

/* --- Toggle Switch (iOS Style) --- */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--ws-line); /* Slate-200 */
    transition: .3s;
    border-radius: 24px;
}

body.theme-dark .toggle-slider {
    background-color: var(--ws-line-strong); /* Slate-700 equivalent */
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

input:checked + .toggle-slider {
    background-color: var(--accent-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* Added shadow for active state */
}

/* Disabled State for Toggle */
.toggle-switch.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* --- Palette Styles --- */
.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s, border-color 0.2s;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.selected {
    border-color: var(--text-primary);
    transform: scale(1.1);
    box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 4px var(--accent-color);
}

.btn-sm {
    height: 32px;
    font-size: 13px;
    padding: 0 12px;
}

/* --- Text Reset Button --- */
.btn-text-reset {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-text-reset:hover {
    color: var(--error);
    background: var(--ws-error-soft);
}

/* --- COLOR MOOD SECTION (NEW) --- */
.palette-group-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 12px;
    letter-spacing: 0.05em;
}

.color-grids-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100px, 100%), 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.color-grid-card {
    position: relative;
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    aspect-ratio: 1;
    border: 2px solid transparent;
}

.color-grid-card:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.color-grid-card.selected {
    box-shadow: 0 0 0 3px var(--accent-color);
    transform: scale(1.05);
}

.color-grid-card.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.mini-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    width: 100%;
    height: 100%;
}

.mini-cell {
    width: 100%;
    height: 100%;
}

/* Карточка «+» (добавить палитру / точный цвет).
   Было: transition: all — анимировались вообще все свойства, включая
   border-style у .blocked, отсюда дёрганый ховер. Плюс отдельный блок
   body.theme-dark дублировал те же роли другими значениями. Теперь
   переходы перечислены явно, а цвета приходят из токенов и работают
   в обеих темах без второго блока. */
.add-custom-card {
    border: 2px dashed var(--ws-line-strong);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--ws-surface-soft);
    color: var(--ws-fg-muted);
    border-radius: var(--ws-radius-md);
    cursor: pointer;
    transition: border-color .18s ease, color .18s ease, background-color .18s ease;
    aspect-ratio: 1;
    gap: 8px;
}

.add-custom-card:hover {
    border-color: var(--ws-primary);
    color: var(--ws-primary);
    background: var(--ws-primary-soft);
}

.add-custom-card:focus-visible {
    outline: 2px solid var(--ws-primary);
    outline-offset: 2px;
}

.add-custom-card.blocked {
    cursor: not-allowed;
    opacity: 0.6;
    border-style: solid;
}

/* У заблокированной карточки ховера нет вовсе — иначе она выглядит
   кликабельной. Раньше здесь гасились уже отработавшие эффекты. */
.add-custom-card.blocked:hover {
    border-color: var(--ws-line-strong);
    color: var(--ws-fg-muted);
    background: var(--ws-surface-soft);
}

.add-icon-wrapper {
    width: 32px;
    height: 32px;
    border-radius: var(--ws-radius-full);
    background: var(--ws-surface);
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color .18s ease, color .18s ease;
}

.add-custom-card:hover .add-icon-wrapper {
    background: var(--ws-primary);
    color: var(--ws-primary-fg);
}

.add-custom-card.blocked:hover .add-icon-wrapper {
    background: var(--ws-surface);
    color: inherit;
}

.add-text {
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

.check-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ws-on-scrim);
    opacity: 0;
    transition: opacity .18s ease;
    pointer-events: none;
}

.color-grid-card.selected .check-overlay {
    opacity: 1;
}

/* --- Delete Button for Custom Palettes --- */
.delete-palette-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    z-index: 10;
    padding: 0;
    margin: 0;
    /* Ensure no flex interference */
    display: block;
    border: none;
    outline: none;
}

.color-grid-card:hover .delete-palette-btn {
    opacity: 1;
}

.delete-palette-btn:hover {
    background: var(--ws-error); /* Solid Red */
}

.delete-palette-btn svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px; /* Slightly smaller to look better in 24px circle with bold stroke */
    height: 12px;
    stroke-width: 3px;
    display: block;
    pointer-events: none; /* Click goes through to button */
}

/* --- Palette Labels --- */
.palette-label-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    padding: 6px 0; /* Increased padding */
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.color-grid-card:hover .palette-label-overlay {
    opacity: 1;
}

/* Task Type Pills (Step 1 Sub-selection) */
.task-type-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.task-type-btn {
    padding: 10px 20px;
    border: 1px solid var(--border-muted);
    border-radius: 100px;
    background: var(--input-bg);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.task-type-btn:hover {
    border-color: var(--accent-color);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.task-type-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px var(--ws-primary-line);
}

/* Checkbox Group (Step 3) */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    font-size: 15px;
    color: var(--text-primary);
    cursor: pointer;
    text-transform: none; /* Override label uppercase */
    font-weight: 500;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
}

/* --- Dimensions Grid (Step 3) --- */
.dimensions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.dim-card {
    background: var(--input-bg);
    border: 2px solid var(--border-muted);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.dim-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.dim-card.selected {
    border-color: var(--accent-color);
    background: var(--ws-primary-soft);
    box-shadow: 0 0 0 2px var(--ws-primary-soft);
}

.dim-icon {
    margin-bottom: 12px;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.dim-card.selected .dim-icon {
    color: var(--accent-color);
}

.dim-icon svg {
    width: 40px;
    height: 40px;
}

.dim-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dim-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.dim-desc {
    font-size: 11px;
    color: var(--text-secondary);
}

.dim-sub {
    font-size: 10px;
    color: var(--text-tertiary);
    margin-top: 4px;
    font-weight: 500;
}

/* Custom Dimensions Inputs */
.custom-dim-wrapper {
    margin-top: 16px;
    animation: fadeIn 0.3s ease;
}

.custom-dim-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.input-wrapper {
    position: relative;
    flex: 1;
    max-width: 140px;
}

.input-wrapper input {
    padding-right: 32px; /* Space for unit */
    text-align: center;
    font-weight: 600;
}

.input-wrapper .unit {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 500;
    pointer-events: none;
}

.x-separator {
    color: var(--text-tertiary);
    font-size: 14px;
    font-weight: 600;
}

/* --- Naming wizard additions --- */
.naming-subsection {
    margin-top: 20px;
    padding: 16px;
    border: 1px solid var(--card-border, rgba(var(--ws-tint-rgb), 0.08));
    border-radius: 14px;
    background: var(--card-bg, rgba(var(--ws-glass-rgb), 0.02));
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.priority-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
    gap: 12px;
    margin-top: 8px;
}

.priority-chip {
    border: 1px solid var(--card-border, rgba(var(--ws-tint-rgb), 0.1));
    border-radius: 12px;
    padding: 12px;
    background: rgba(var(--ws-glass-rgb), 0.02);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.priority-chip.selected {
    border-color: var(--accent-color);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.18);
}

.priority-number {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--accent-color);
    color: var(--ws-primary-fg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.priority-actions {
    display: flex;
    gap: 6px;
}

.priority-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--card-border, rgba(var(--ws-tint-rgb), 0.12));
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.priority-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.priority-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 4px 0 6px;
}

.pill-toggle {
    display: inline-flex;
    gap: 8px;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--card-border, rgba(var(--ws-tint-rgb), 0.1));
    background: var(--card-bg, rgba(var(--ws-glass-rgb), 0.02));
}

.pill-toggle-btn {
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 0 rgba(var(--ws-tint-rgb), 0.12);
}

.pill-toggle-btn:hover {
    background: var(--ws-primary-soft);
    color: var(--text-primary);
}

.pill-toggle-btn.active {
    background: rgba(99, 102, 241, 0.14);
    border-color: var(--accent-color);
    color: var(--text-primary);
    font-weight: 700;
}

.phonetic-sliders {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.phonetic-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.phonetic-row span {
    width: 90px;
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
}

.phonetic-row input[type="range"] {
    flex: 1;
}

.example-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 8px 0;
}

.example-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.example-item input {
    flex: 1;
}

.example-item button {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--card-border, rgba(var(--ws-tint-rgb), 0.12));
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.example-item button:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.helper-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

@keyframes fadeInUpSoft {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
    animation: fadeInUpSoft 0.25s ease;
}

/* ================================================================
   Block 33: Public Profile Modal — verified badge + trust metrics
   ================================================================ */
.public-profile-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.company-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    color: white;
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
    margin-left: 8px;
}
.public-profile-trust {
    display: flex;
    gap: 24px;
    margin-top: 12px;
    padding: 16px;
    background: rgba(34, 197, 94, 0.08);
    border-radius: 12px;
}
.public-profile-trust .trust-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.public-profile-trust .trust-label {
    font-size: 12px;
    opacity: 0.7;
}
.public-profile-trust strong {
    font-size: 18px;
    font-weight: 700;
}
