/* ============================================================
   PREMIUM SILVER THEME – RENSAD OCH STABILISERAD
============================================================ */

.hidden-field {
    display: none !important;
}

/* Theme switching - reduce flicker */
html.theme-switching {
    opacity: 0 !important;
    transition: opacity 0.15s ease;
}
html.theme-switching * {
    transition: none !important;
}

:root{
    --ui-scale: 1;
    --bg-main:#C8C9CE;
    --bg-elevated:#D0D1D6;
    --bg-card:#EBECF1;
    --accent:#7B9FE8;
    --accent-soft:rgba(123,159,232,0.15);
    --accent-warm:#B8BCC8;
    --text-main:#25262A;
    --text-muted:#535459;
    --border-subtle:#B0B1B8;
    --border-cool:#A8A9B2;
    --radius-card:14px;
    --shadow-soft:0 4px 12px rgba(0,0,0,0.08);
    --shadow-card:0 8px 24px rgba(0,0,0,0.1);
    --transition-fast:0.2s ease-out;
    --transition-med:0.3s ease-out;
    /* Diagram-färger för silver tema */
    --chart-text:#25262A;
    --chart-grid:#A8A9B2;
    --ucoin-color:#C0C1C8;
    --silver-color:#C0C1C8;
    --silver-highlight:#D8D9E0;
}
*{ box-sizing:border-box; caret-color: #2A2B2F; }
.hidden {
    display: none !important;
}
body{
    margin:0;
    padding:0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: calc(16px * var(--ui-scale));
    background:
        radial-gradient(circle at top left, #D8D9DE 0, transparent 55%),
        radial-gradient(circle at bottom right, #C8C8D0 0, transparent 55%),
        var(--bg-main);
    color:var(--text-main);
    line-height:1.6;
    caret-color: #2A2B2F;
    transition: opacity 0.5s ease-in-out;
    min-height:100vh;
}
body.fade-out {
    opacity: 0;
}
/* ============================================================
   HEADER + NAVIGATION
============================================================ */
header{
    position:sticky;
    top:0;
    z-index:20;
    padding:14px 20px;
    -webkit-backdrop-filter:blur(18px);
    backdrop-filter:blur(18px);
    background:linear-gradient(to bottom, rgba(208,209,214,0.96), rgba(208,209,214,0.82));
    border-bottom:1px solid rgba(0,0,0,0.08);
    display:flex;
    align-items:center;
    justify-content:space-between;
}
header nav { flex: 1; }
nav{
    display:flex;
    gap:8px;
    position: relative;
}
nav button{
    background:transparent;
    color:var(--text-muted);
    border:1px solid transparent;
    padding:8px 14px;
    border-radius:999px;
    cursor:pointer;
    font-size:13px;
    letter-spacing:0.03em;
    text-transform:uppercase;
    transition:var(--transition-fast);
}
nav button:hover{
    background:rgba(0,0,0,0.05);
    color:var(--text-main);
    border-color:rgba(0,0,0,0.1);
    transform:translateY(-1px);
}
/* DROPDOWN */
.dropdown { position: relative; display: inline-block; }
.dropbtn{
    background:transparent;
    color:var(--text-muted);
    border:1px solid transparent;
    padding:8px 14px;
    border-radius:999px;
    cursor:pointer;
    font-size:13px;
    letter-spacing:0.03em;
    text-transform:uppercase;
    transition:var(--transition-fast);
}
.dropbtn:hover{
    background:rgba(0,0,0,0.05);
    color:var(--text-main);
}
.dropdown-content {
    line-height: 1.2 !important;
    display:none;
    position:absolute;
    background:var(--bg-card);
    min-width:200px;
    box-shadow:0 4px 12px rgba(0,0,0,0.15);
    border-radius:8px;
    z-index:50;
    padding:0;
}
.dropdown-content a{
    color:var(--text-main);
    padding:10px 16px;
    text-decoration:none;
    display:block;
    font-size:13px;
    cursor:pointer;
    line-height: 1.2 !important;
}
.dropdown-content a:hover{
    background:rgba(0,0,0,0.05);
}
.dropdown:hover .dropdown-content{
    display:block;
}
/* ============================================================
   MENY - DIVIDER
============================================================ */
.menu-divider {
    border-top: 1px solid rgba(0,0,0,0.08);
    margin: 6px 0;
}
/* ============================================================
   SELLER LINK STYLING
============================================================ */
.seller-link {
    color: var(--accent);
    cursor: pointer;
    text-decoration: none;
    border-bottom: 1px dotted var(--accent);
    transition: all 0.2s ease;
}

.seller-link:hover {
    color: #5B8BF7;
    border-bottom-color: #5B8BF7;
}
#appTitle {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-weight: 400;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-size: 18px;
    color: var(--text-main);
    opacity: 0;
    animation: fadeInTitle 0.8s ease forwards;
    pointer-events: none;
}
#viewForm {
    position: relative;
    z-index: 9999 !important;
}
@keyframes fadeInTitle {
    to { opacity: 1; }
}
.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  color: var(--text-main);
  text-decoration: none;
  line-height: 1.2 !important;
}
.menu-text {
  font-size: 14px;
  color: var(--text-main);
}
.menu-icon {
  width: 16px;
  height: 16px;
  opacity: 0.85;
  margin-left: 8px;
}
.menu-icon.market-icon {
  width: 14px;
  height: 14px;
}
/* === PREMIUM INPUT BASE – MER METALLISK LYSTER === */
#searchInput,
#silverPriceInput {
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(0,0,0,0.15);
    box-shadow:
        0 0 12px rgba(0,0,0,0.1),
        0 0 24px rgba(0,0,0,0.05);
    transition: 0.25s ease;
}

/* === HOVER – TYDLIGARE CHROME-SHINE === */
#searchInput:hover,
#silverPriceInput:hover {
    background: rgba(255,255,255,0.95);
    border-color: rgba(0,0,0,0.25);
    box-shadow:
        0 0 16px rgba(0,0,0,0.15),
        0 0 32px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

/* === FOCUS – MER DEFINIERAD METALLRING + INRE GLOW === */
#searchInput:focus,
#silverPriceInput:focus {
    background: rgba(255,255,255,0.98);
    border-color: rgba(0,0,0,0.4);
    box-shadow:
        0 0 0 2px rgba(143,179,255,0.35),
        0 0 20px rgba(143,179,255,0.2),
        0 0 40px rgba(143,179,255,0.1);
    color: var(--text-main);
}

/* === PREMIUM PLACEHOLDER – LJUSARE SILVERVIT === */
#searchInput::placeholder,
#silverPriceInput::placeholder {
    color: rgba(0,0,0,0.4);
    transition: 0.25s ease;
}

/* Vid fokus – ännu renare och mer polerad ton */
#searchInput:focus::placeholder,
#silverPriceInput:focus::placeholder {
    color: rgba(0,0,0,0.5);
}

/* ============================================================
   SEARCH + HEADER CONTROLS
============================================================ */
header .rightControls{
    margin-left:auto;
    display:flex;
    gap:10px;
    align-items:center;
}
#searchInput,#silverPriceInput{
    padding:8px 12px;
    border-radius:999px;
    color:var(--text-main);
    font-size:13px;
    outline:none;
    min-width:140px;
    transition:var(--transition-fast);
}
#searchInput{ width:170px; }
#silverPriceInput{ width:140px; }
/* Premium sökfält – isolerad klass */
.vc-search {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 24px 0;
}
.vc-search input[type="text"] {
  width: 70%;
  padding: 10px 14px;
  background: #fff;
  color: #2A2B2F;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.05);
}
.vc-search input[type="text"]:focus {
  border-color: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 10px rgba(143, 179, 255, 0.3);
}
#searchResults {
    max-height: 70vh;
    overflow-y: auto;
    min-height: 0;
}
.searchRow {
    padding: calc(18px * var(--ui-scale)) calc(20px * var(--ui-scale));
    border-radius: 8px;
}
/* Premium kort scroll */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #D8D9DE;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #B8B8C0, #D8D9DE);
    border-radius: 4px;
    border: 1px solid #A8A8B0;
    min-height: 30px;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #A8A8B0, #C8C8D0);
}
.compactRow-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}
.compactThumb {
    width: 60px !important;
    height: 60px !important;
    flex: 0 0 62px !important;
    object-fit: cover;
    border-radius: 6px;
}
.compactInfo strong {
    font-size: 15px;
    line-height: 1.25;
}
.compactInfo span {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.2;
}
/* --- Notisblock för förvaringsplats (premiumren version) --- */
.storage-note-block {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.08);
    margin-bottom: 32px;
    animation: fadeIn 0.25s ease-out;
}
.storage-note-title {
    font-size: 13px;
    color: var(--text-main);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-align: center;
}
.storage-note-input {
    width: 100%;
    min-height: 100px;
    background: var(--bg-card);
    border: 1px solid rgba(0, 0, 0, 0.18);
    box-shadow: inset 0 0 6px rgba(0,0,0,0.05),
                0 0 6px rgba(0,0,0,0.05);
    border-radius: 6px;
    padding: 12px 14px;
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.45;
    resize: vertical;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.storage-note-input:focus {
    border-color: rgba(143, 179, 255, 0.5);
    box-shadow:
        inset 0 0 6px rgba(143, 179, 255, 0.15),
        0 0 5px rgba(143, 179, 255, 0.25);
}
.storage-note-input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}
/* --- Platser (kapacitet / använda) --- */
.storage-slots-card {
    margin-bottom: 24px;
}
.storage-slots-hint {
    text-align: center;
    margin: 0 auto 14px;
    max-width: 520px;
    line-height: 1.45;
}
.storage-slots-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
    margin-bottom: 14px;
}
@media (max-width: 520px) {
    .storage-slots-grid {
        grid-template-columns: 1fr;
    }
}
.storage-slot-field label {
    display: block;
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-align: center;
}
.storage-slots-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    font-size: 17px;
    font-weight: 600;
    text-align: center;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.14);
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-main);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.storage-slots-input:focus {
    outline: none;
    border-color: rgba(143, 179, 255, 0.6);
    box-shadow: 0 0 0 2px rgba(143, 179, 255, 0.2);
}
.storage-slots-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.1);
    overflow: hidden;
}
.storage-slots-fill {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: var(--accent);
    transition: width 0.35s ease;
}
.storage-slots-fill--warn,
.storage-box-slots-fill--warn {
    background: linear-gradient(90deg, #c45c4a, #e08a6a);
}
.storage-box-slots {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}
.storage-box-slots-meta {
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
    opacity: 0.92;
}
.storage-box-slots-track {
    height: 4px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.1);
    overflow: hidden;
}
.storage-box-slots-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width 0.3s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.imageRow {
    display: flex;
    gap: 12px;
    align-items: center;
}
/* ============================================================
   TAGGAR
============================================================ */
.tagContainer {
    margin-top: 12px;
    margin-bottom: 8px;
}
.tagChip {
    display: inline-block;
    background: rgba(0,0,0,0.08);
    padding: 4px 10px;
    margin: 3px;
    border-radius: 8px;
    font-size: 12px;
    letter-spacing: 0.03em;
    color: var(--text-main);
}
.tagFilterWrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
}
.tagFilterLabel {
    font-size: 14px;
    color: var(--text-main);
    opacity: 0.8;
}
/* Clear button for input fields */
.clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 16px;
    color: rgba(0,0,0,0.4);
    padding: 0 4px;
    line-height: 1;
    -webkit-user-select: none;
    user-select: none;
    display: none;
}
.clear-btn:hover {
    color: rgba(0,0,0,0.6);
}
/* Show clear button when input has value */
input:not(:placeholder-shown) + .clear-btn {
    display: block;
}
#viewList #tagFilter {
    background: rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.2) !important;
    padding: 10px 12px;
    border-radius: 10px;
    width: 150px !important;
    height: 34px;
    box-sizing: border-box;
    color: var(--text-main);
    font-size: 14px;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: 0.2s ease;
}
#viewList #tagFilter::placeholder {
    color: rgba(0,0,0,0.35);
}
#viewList #tagFilter:focus {
    border-color: rgba(0,0,0,0.3) !important;
    background: rgba(0,0,0,0.08);
}
#reportView {
    background: rgba(255,0,0,0.1);
}
canvas {
    pointer-events: auto;
}
/* ============================================================
   VIEWS
============================================================ */
.view{
    display:none;
    max-width:980px;
    margin:26px auto 40px auto;
    padding:0 18px 40px 18px;
}
.sectionHeader{
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:14px;
}
h2{
    margin:0 0 14px 0;
    font-size:22px;
    letter-spacing:0.06em;
    text-transform:uppercase;
    color:var(--text-main);
    text-shadow: 0 1px 2px rgba(255,255,255,0.5);
}
h3{
    margin-top:18px;
    margin-bottom:8px;
    font-size:15px;
    letter-spacing:0.08em;
    text-transform:uppercase;
    color:var(--text-muted);
    opacity: 0.85;
}
/* ============================================================
   BUTTONS
============================================================ */
.btn{
    background:linear-gradient(135deg, var(--accent), #A8C8FF);
    color:#25262A;
    border:1px solid rgba(123,159,232,0.3);
    padding: 9px 18px;
    border-radius:999px;
    cursor:pointer;
    font-size:13px;
    font-weight:600;
    letter-spacing:0.06em;
    text-transform:uppercase;
    box-shadow:0 4px 12px rgba(123,159,232,0.25), inset 0 1px 0 rgba(255,255,255,0.4);
    transition:var(--transition-fast);
    position: relative;
}
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 50%);
    pointer-events: none;
}
.btn:hover{
    transform:translateY(-1px);
    box-shadow:0 6px 18px rgba(123,159,232,0.35), inset 0 1px 0 rgba(255,255,255,0.5);
    border-color: rgba(123,159,232,0.5);
}
.btn.secondary{
    background:linear-gradient(135deg,
        rgba(200,205,215,0.95) 0%,
        rgba(215,220,230,0.9) 50%,
        rgba(190,195,205,0.95) 100%);
    color:var(--text-main);
    border:1px solid var(--border-cool);
    box-shadow:0 4px 12px rgba(0,0,0,0.08),
                inset 0 1px 0 rgba(255,255,255,0.6),
                inset 0 -1px 0 rgba(0,0,0,0.1);
    -webkit-backdrop-filter:blur(8px);
    backdrop-filter:blur(8px);
}

.tab-btn {
    background: linear-gradient(135deg,
        rgba(180,185,195,0.95) 0%,
        rgba(195,200,210,0.85) 50%,
        rgba(170,175,185,0.9) 100%);
    color: var(--text-main);
    border: 1px solid rgba(0,0,0,0.12);
    padding: 8px 18px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1),
                inset 0 1px 0 rgba(255,255,255,0.5),
                inset 0 -1px 0 rgba(0,0,0,0.1);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.tab-btn:hover {
    color: var(--text-main);
    background: linear-gradient(135deg,
        rgba(195,200,210,0.95) 0%,
        rgba(210,215,225,0.85) 50%,
        rgba(185,190,200,0.9) 100%);
    border-color: rgba(0,0,0,0.18);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15),
                inset 0 1px 0 rgba(255,255,255,0.6),
                inset 0 -1px 0 rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.tab-btn.active {
    color: var(--text-main);
    background: linear-gradient(135deg,
        rgba(195,200,210,0.95) 0%,
        rgba(210,215,225,0.85) 50%,
        rgba(185,190,200,0.9) 100%);
    border-color: rgba(0,0,0,0.18);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15),
                inset 0 1px 0 rgba(255,255,255,0.6),
                inset 0 -1px 0 rgba(0,0,0,0.08);
}

/* ============================================================
   VALUEINDEX LIST ITEMS – SILVER THEME
============================================================ */
#viewValueIndexStats div[style*="padding: 12px 0"] {
    border-radius: 6px;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

#viewValueIndexStats div[style*="padding: 12px 0"]:hover {
    background: rgba(0, 0, 0, 0.05);
    border-left: 2px solid rgba(0, 0, 0, 0.2);
    padding-left: 8px;
    padding-right: 8px;
}

#viewValueIndexStats div[style*="padding: 12px 0"]:hover span:first-child {
    color: var(--accent);
}

.btn.secondary::before{
    content:'';
    position:absolute;
    top:0;
    left:0;
    right:0;
    bottom:0;
    background:linear-gradient(135deg, 
        rgba(255,255,255,0.3) 0%,
        transparent 50%,
        rgba(255,255,255,0.15) 100%);
    border-radius:999px;
    opacity:0.6;
}
.btn.secondary:hover{
    background:linear-gradient(135deg, 
        rgba(190,195,205,0.95) 0%, 
        rgba(205,210,220,0.85) 50%,
        rgba(180,185,195,0.9) 100%);
    color:var(--text-main);
    border-color:rgba(0,0,0,0.18);
    box-shadow:0 6px 20px rgba(0,0,0,0.15), 
                inset 0 1px 0 rgba(255,255,255,0.6),
                inset 0 -1px 0 rgba(0,0,0,0.08);
    transform:translateY(-1px);
}
.btn.secondary:hover::before{
    opacity:0.8;
    background:linear-gradient(135deg, 
        rgba(255,255,255,0.4) 0%,
        transparent 50%,
        rgba(255,255,255,0.2) 100%);
}
.btn.secondary:active{
    transform:translateY(0);
    box-shadow:0 2px 8px rgba(0,0,0,0.1), 
                inset 0 1px 0 rgba(255,255,255,0.3),
                inset 0 -1px 0 rgba(0,0,0,0.15);
}
.btn.secondary.selected{
    border-color: var(--accent) !important;
    background: rgba(123,159,232,0.3) !important;
    box-shadow: 0 0 0 1px var(--accent) !important;
}
/* Icon-only button styling */
.btn.icon-only {
    padding: 8px;
    min-width: auto;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--border-subtle);
}
.btn.icon-only .refresh-icon {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}
.btn.icon-only:hover .refresh-icon {
    transform: rotate(180deg);
}
/* Special silver metallic buttons for Settings, Market and PurchasedCoins in silver theme */
#viewSettings .btn.secondary,
#viewMarket .btn.secondary,
#viewPurchasedCoins .btn.secondary {
    background:linear-gradient(135deg, 
        rgba(180,185,195,0.95) 0%, 
        rgba(195,200,210,0.85) 50%,
        rgba(170,175,185,0.9) 100%);
    color:var(--text-main);
    border:1px solid rgba(0,0,0,0.12);
    box-shadow:0 4px 15px rgba(0,0,0,0.1), 
                inset 0 1px 0 rgba(255,255,255,0.5),
                inset 0 -1px 0 rgba(0,0,0,0.1);
    -webkit-backdrop-filter:blur(8px);
    backdrop-filter:blur(8px);
    position:relative;
}

/* Scale font-size in purchased coins view */
#viewPurchasedCoins {
    font-size: calc(1em * var(--ui-scale));
}

#viewPurchasedCoins .marketRow,
#viewPurchasedCoins .coinRow,
#viewPurchasedCoins .countryRow,
#viewPurchasedCoins .yearRow {
    font-size: inherit;
}

/* Scale font-size in about view */
#viewAbout {
    font-size: calc(1em * var(--ui-scale));
}
#viewSettings .btn.secondary::before,
#viewMarket .btn.secondary::before,
#viewPurchasedCoins .btn.secondary::before {
    content:'';
    position:absolute;
    top:0;
    left:0;
    right:0;
    bottom:0;
    background:linear-gradient(135deg, 
        rgba(255,255,255,0.4) 0%,
        transparent 50%,
        rgba(255,255,255,0.2) 100%);
    border-radius:999px;
    opacity:0.7;
}
#viewSettings .btn.secondary:hover,
#viewMarket .btn.secondary:hover {
    background:linear-gradient(135deg, 
        rgba(195,200,210,0.95) 0%, 
        rgba(210,215,225,0.85) 50%,
        rgba(185,190,200,0.9) 100%);
    border-color:rgba(0,0,0,0.18);
    box-shadow:0 6px 20px rgba(0,0,0,0.15), 
                inset 0 1px 0 rgba(255,255,255,0.6),
                inset 0 -1px 0 rgba(0,0,0,0.08);
    transform:translateY(-1px);
}
#viewSettings .btn.secondary:hover::before,
#viewMarket .btn.secondary:hover::before {
    opacity:0.9;
    background:linear-gradient(135deg, 
        rgba(255,255,255,0.5) 0%,
        transparent 50%,
        rgba(255,255,255,0.25) 100%);
}
#viewSettings .btn.secondary:active,
#viewMarket .btn.secondary:active {
    transform:translateY(0);
    box-shadow:0 2px 8px rgba(0,0,0,0.1), 
                inset 0 1px 0 rgba(255,255,255,0.4),
                inset 0 -1px 0 rgba(0,0,0,0.12);
}
/* Ensure refresh icon inherits proper color in Market view */
#viewMarket .btn.icon-only .refresh-icon {
    stroke: currentColor !important;
    fill: none !important;
    color: var(--text-main) !important;
}
#viewMarket .btn.icon-only {
    color: var(--text-main) !important;
}
/* Premium silver Report button in collection view - EXACTLY like Menu/My Collection but smaller */
#viewList .tagFilterWrapper .btn.secondary[onclick="showFilterReport()"] {
    background: linear-gradient(
        135deg,
        #dfe4ef 0%,
        #f8f9fb 35%,
        #caced8 55%,
        #e6e8ee 100%
    );
    color: #0a0c14;
    border: 1px solid rgba(255,255,255,0.35);
    padding: 8px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow:
        0 0 6px rgba(255,255,255,0.35),
        0 0 14px rgba(255,255,255,0.18),
        inset 0 0 6px rgba(255,255,255,0.25);
    transition: 0.25s ease;
    filter: brightness(0.95);
}
#viewList .tagFilterWrapper .btn.secondary[onclick="showFilterReport()"]:hover {
    background: linear-gradient(
        135deg,
        #ffffff 0%,
        #f2f3f7 40%,
        #d4d7df 70%,
        #fafbff 100%
    );
    box-shadow:
        0 0 10px rgba(255,255,255,0.55),
        0 0 18px rgba(255,255,255,0.35),
        inset 0 0 8px rgba(255,255,255,0.35);
    transform: translateY(-1px);
    filter: brightness(1);
}
#viewList .tagFilterWrapper .btn.secondary[onclick="showFilterReport()"]:active {
    transform: translateY(0);
}
/* Lägg till button in tagFilterWrapper - match Rapport button exactly */
#viewList .tagFilterWrapper #btnAddCoin {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.35);
}
/* ============================================================
   VALUTA-VAL MODAL KNAPPAR
============================================================ */
#currencyModal .btn.primary {
    background: linear-gradient(
        135deg,
        #dfe4ef 0%,
        #f8f9fb 35%,
        #caced8 55%,
        #e6e8ee 100%
    );
    color: #0a0c14;
    border: 1px solid rgba(255,255,255,0.35);
    padding: 15px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow:
        0 0 6px rgba(255,255,255,0.35),
        0 0 14px rgba(255,255,255,0.18),
        inset 0 0 6px rgba(255,255,255,0.25);
    transition: 0.25s ease;
    filter: brightness(0.95);
}
#currencyModal .btn.primary:hover {
    background: linear-gradient(
        90deg,
        #e8ecf5 0%,
        #ffffff 35%,
        #d8dce4 55%,
        #f0f2f6 100%
    );
    box-shadow:
        0 0 8px rgba(255,255,255,0.45),
        0 0 18px rgba(255,255,255,0.25),
        inset 0 0 8px rgba(255,255,255,0.35);
    transform: translateY(-1px);
    filter: brightness(1);
}
#currencyModal .btn.primary:active {
    transform: translateY(0);
}
/* ============================================================
   PREMIUM SILVERKNAPP – ENDAST FÖR "Meny" och "Min samling"
============================================================ */
nav .dropbtn,
nav button[onclick="showView('list')"] {
    background: linear-gradient(
        135deg,
        #dfe4ef 0%,
        #f8f9fb 35%,
        #caced8 55%,
        #e6e8ee 100%
    );
    color: #0a0c14;
    border: 1px solid rgba(255,255,255,0.35);
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow:
        0 0 6px rgba(255,255,255,0.35),
        0 0 14px rgba(255,255,255,0.18),
        inset 0 0 6px rgba(255,255,255,0.25);
    transition: 0.25s ease;
}
nav .dropbtn,
nav button[onclick="showView('list')"] {
    filter: brightness(0.95);
    transition: filter 0.25s ease, transform 0.25s ease;
}
nav .dropbtn:hover,
nav button[onclick="showView('list')"]:hover {
    background: linear-gradient(
        135deg,
        #ffffff 0%,
        #f2f3f7 40%,
        #d4d7df 70%,
        #fafbff 100%
    );
    box-shadow:
        0 0 10px rgba(255,255,255,0.55),
        0 0 18px rgba(255,255,255,0.35),
        inset 0 0 8px rgba(255,255,255,0.35);
    transform: translateY(-1px);
    filter: brightness(1);
}
/* ============================================================
   PREMIUM SILVERTITEL – EXTRA METALLISK VERSION
============================================================ */
.CoinIndex-title {
    display: inline-block;
    background: linear-gradient(
        135deg,
        #f5f7fa 0%,
        #ffffff 22%,
        #d7dbe3 48%,
        #eef0f5 100%
    );
    color: #05060a;
    border: 1px solid rgba(255,255,255,0.55);
    padding: 14px 32px;
    border-radius: 999px;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    box-shadow:
        0 0 10px rgba(255,255,255,0.45),
        0 0 22px rgba(255,255,255,0.25),
        inset 0 0 10px rgba(255,255,255,0.35);
    transition: 0.25s ease;
}
.CoinIndex-title:hover {
    background: linear-gradient(
        135deg,
        #ffffff 0%,
        #f7f8fc 30%,
        #d2d6de 65%,
        #fdfdff 100%
    );
    box-shadow:
        0 0 14px rgba(255,255,255,0.65),
        0 0 26px rgba(255,255,255,0.40),
        inset 0 0 12px rgba(255,255,255,0.45);
    transform: translateY(-1px);
}
/* ============================================================
   SÖKFUNKTION
=============================================================*/
.compactRow {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    cursor: pointer;
}
.compactThumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    background: rgba(0,0,0,0.03);
}
.compactInfo {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    line-height: 1.2;
}
/* ============================================================
   LISTVY
============================================================ */
.card{
    background:var(--bg-card);
    border-radius:var(--radius-card);
    border:1px solid var(--border-cool);
    box-shadow:var(--shadow-card);
    padding: calc(12px * var(--ui-scale));
    position: relative;
}
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--radius-card);
    background: linear-gradient(135deg, rgba(216,217,224,0.3) 0%, transparent 50%);
    pointer-events: none;
}
.countryRow,.yearRow,.coinRow{
    border-radius:10px;
    border:1px solid var(--border-cool);
    background:linear-gradient(135deg, rgba(255,255,255,0.6), rgba(235,236,241,0.95));
    box-shadow:0 4px 12px rgba(0,0,0,0.06);
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding: calc(6px * var(--ui-scale)) calc(14px * var(--ui-scale));
    margin-bottom: calc(4px * var(--ui-scale));
    cursor:pointer;
    transition:var(--transition-fast);
    position: relative;
}
.countryRow::before,.yearRow::before,.coinRow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(216,217,224,0.2) 0%, transparent 50%);
    pointer-events: none;
}
.countryRow:hover,.yearRow:hover,.coinRow:hover{
    transform:translateY(-1px);
    border-color:rgba(123,159,232,0.5);
    background:linear-gradient(135deg, rgba(255,255,255,0.75), rgba(245,246,249,0.98));
    box-shadow:0 6px 18px rgba(123,159,232,0.15);
}
.countryRow span, .yearRow span, .coinRow span {
    color: var(--text-main);
    opacity: 0.95;
}
.countryRow:hover span, .yearRow:hover span, .coinRow:hover span {
    opacity: 1;
}
.yearRow{ margin-left:10px; }
.coinRow{ margin-left:26px; }
.coinThumb{
    width:60px;
    height:60px;
    border-radius:10px;
    box-shadow:0 10px 26px rgba(0,0,0,0.1);
    object-fit:cover;
}
.flagSmall{
    width:20px;
    height:20px;
    border-radius:6px;
    box-shadow:0 0 0 1px rgba(0,0,0,0.1);
}
/* ============================================================
   DETALJVY
============================================================ */
.detailBox{
    background:var(--bg-card);
    border-radius:var(--radius-card);
    border:1px solid var(--border-subtle);
    box-shadow:var(--shadow-soft);
    padding:18px;
    margin-bottom:16px;
}
.detailImage{
    width:110px;
    height:110px;
    border-radius:12px;
    box-shadow:0 18px 40px rgba(0,0,0,0.12);
    margin-bottom:12px;
    object-fit:cover;
}
/* ============================================================
   MARKNAD
============================================================ */
.marketCard{
    background:var(--bg-card);
    border-radius:var(--radius-card);
    border:1px solid var(--border-subtle);
    box-shadow:var(--shadow-soft);
    padding:16px 18px;
    margin-bottom:14px;
}
.marketRow{
    background:linear-gradient(135deg, rgba(255,255,255,0.4), rgba(208,209,214,0.9));
    border-radius:10px;
    border:1px solid rgba(0,0,0,0.1);
    padding:12px 14px;
    margin-bottom:8px;
    cursor:pointer;
    display:flex;
    justify-content:space-between;
    transition:0.2s ease;
}
.marketRow:hover{
    border-color:rgba(143,179,255,0.5);
}
.deleteIcon{
    color:#CC4444;
    font-weight:bold;
    opacity:0.7;
    transition:0.15s;
}
.marketRow:hover .deleteIcon{
    opacity:1;
}
/* ============================================================
   CANVAS (diagram)
============================================================ */
canvas{
    background:#E8E9EC;
    border-radius:var(--radius-card);
    border:1px solid var(--border-subtle);
    box-shadow:var(--shadow-soft);
    padding:18px;
    margin-top:10px;
    min-height: 300px;
}
/* ============================================================
   PREMIUM SILVER INPUTS – MATCHAR APPENS DESIGN
============================================================ */
.card input {
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 15px;
  letter-spacing: 0.02em;
  transition: 0.25s ease;
  box-shadow: inset 0 0 0 0 rgba(143,179,255,0);
  caret-color: #2A2B2F;
}
.card input:hover {
    background: rgba(255,255,255,0.98);
    border-color: rgba(0,0,0,0.2);
}
.card input:focus {
    background: rgba(255,255,255,1);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(143,179,255,0.35);
    outline: none;
}
datalist option {
    background: #E5E6EB !important;
    color: var(--text-main) !important;
}

/* ============================================================
   PREMIUM INPUT WITH DATALIST – MATCHAR APPENS DESIGN
============================================================ */
input.premium-select {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 15px;
  letter-spacing: 0.02em;
  transition: 0.25s ease;
  box-shadow: inset 0 0 0 0 rgba(143,179,255,0);
}

input.premium-select:hover {
    background: rgba(255,255,255,0.98);
    border-color: rgba(0,0,0,0.2);
}

input.premium-select:focus {
    background: rgba(255,255,255,1);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(143,179,255,0.35);
    outline: none;

    .goal-year-badge.exists {
        background: rgba(34, 197, 94, 0.15);
        border-color: rgba(34, 197, 94, 0.5);
        color: #22c55e;
    }

    .goal-year-badge.missing {
        background: rgba(239, 68, 68, 0.15);
        border-color: rgba(239, 68, 68, 0.5);
        color: #ef4444;
    }

    .goal-year-badge .remove-hint {
        position: absolute;
        top: 2px;
        right: 6px;
        font-size: 12px;
        opacity: 0.4;
        transition: opacity 0.2s ease;
    }

    .goal-year-badge:hover .remove-hint {
        opacity: 0.8;
    }

    /* ============================================================
       PREMIUM INPUT WITH DATALIST – MATCHAR APPENS DESIGN
    ============================================================= */
    input.premium-select {
      width: 100%;
      padding: 12px 14px;
      margin-bottom: 12px;
      background: rgba(255,255,255,0.95);
      border: 1px solid rgba(0,0,0,0.15);
      border-radius: 8px;
      color: var(--text-main);
      font-size: 15px;
      letter-spacing: 0.02em;
      transition: 0.25s ease;
      box-shadow: inset 0 0 0 0 rgba(143,179,255,0);
    }

    input.premium-select:hover {
        background: rgba(255,255,255,0.98);
        border-color: rgba(0,0,0,0.2);
    }

    input.premium-select:focus {
        background: rgba(255,255,255,1);
        border-color: var(--accent);
        box-shadow: 0 0 0 2px rgba(143,179,255,0.35);
        outline: none;
    }

    datalist option {
        background: #E5E6EB;
        color: var(--text-main);
        padding: 10px;
    }
    /* Custom Dropdown */
    .custom-dropdown {
        position: relative;
        width: 100%;
        margin-bottom: 12px;
    }
    .custom-dropdown input {
        width: 100%;
        padding: 12px 36px 12px 16px;
        background: rgba(255,255,255,0.9);
        border: 1px solid rgba(0,0,0,0.15);
        border-radius: 12px;
        color: var(--text-main);
        font-size: 14px;
        letter-spacing: 0.02em;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 2px 8px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.5);
        caret-color: #2A2B2F;
    }
    .custom-dropdown input:focus {
        background: rgba(255,255,255,1);
        border-color: var(--accent);
        box-shadow: 0 0 0 2px rgba(143,179,255,0.35);
        outline: none;
    }
    .custom-dropdown input:hover {
        background: rgba(255,255,255,0.95);
        border-color: rgba(0,0,0,0.2);
    }
    .dropdown-arrow {
        position: absolute;
        right: 16px;
        top: 50%;
        transform: translateY(-50%);
        color: #5A5B60;
        pointer-events: none;
        font-size: 10px;
        transition: transform 0.3s ease;
    }
    .custom-dropdown.open .dropdown-arrow {
        transform: translateY(-50%) rotate(180deg);
    }
    .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        margin-top: 4px;
        background: rgba(255,255,255,0.98);
        border: 1px solid rgba(0,0,0,0.15);
        border-radius: 12px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.15);
        max-height: 200px;
        overflow-y: auto;
        z-index: 1000;
        display: none;
    }
    .custom-dropdown.open .dropdown-menu {
        display: block;
    }
    .dropdown-item {
        padding: 10px 16px;
        color: var(--text-main);
        font-size: 14px;
        cursor: pointer;
        transition: background 0.2s ease;
        line-height: 1.2 !important;
    }
    .dropdown-item:hover {
        background: rgba(143,179,255,0.15);
    }
    .dropdown-item.hidden {
        display: none;
    }
    .card label {
        display: block;
        margin-bottom: 4px;
        margin-top: 10px;
        font-size: 12px;
        color: var(--text-muted);
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }
    /* ============================================================
       TOPPLISTA – ENDAST UNDERRUBRIKER
    ============================================================= */
    .topHeader {
        text-align: center;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        font-size: 15px;
        padding: 14px 0;
        margin-top: 18px;
        cursor: pointer;
        color: var(--text-main);
        transition: 0.25s ease;
        text-shadow: 0 0 6px rgba(0,0,0,0.1);
    }
    .topHeader:hover {
        text-shadow: 0 2px 8px rgba(0,0,0,0.2);
        color: var(--text-main);
    }
    /* Force top lists to always be visible */
    #viewTop .accContent {
        display: block !important;
    }
    /* ============================================================
       TOPPLISTA – PREMIUM FÄRGER FÖR TOPP 10
    ============================================================= */
    .toplist-item {
        padding: 12px 16px;
        margin-bottom: 8px;
        background: rgba(255,255,255,0.85);
        border: 1px solid rgba(0,0,0,0.1);
        border-radius: 10px;
        color: var(--text-main);
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 15px;
        letter-spacing: 0.02em;
    }
    .toplist-1 {
        background: linear-gradient(
            135deg,
            #8A6B2F 0%,
            #C8A44E 35%,
            #F0D58A 55%,
            #A8843A 100%
        );
        color: #1a1a1a;
        font-weight: 700;
    }
    .toplist-2 {
        background: linear-gradient(
            135deg,
            #6F737A 0%,
            #AEB4C0 35%,
            #E6E8ED 55%,
            #8F949C 100%
        );
        color: #1a1a1a;
        font-weight: 700;
    }
    .toplist-3 {
        background: linear-gradient(
            135deg,
            #6A4F2C 0%,
            #9C7444 35%,
            #D8A86A 55%,
            #8A653A 100%
        );
        color: #1a1a1a;
        font-weight: 700;
    }
    .coinThumbWrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
        cursor: pointer;
    }
    .clickHint {
        font-size: 11px;
        color: var(--text-muted);
        margin-top: 4px;
        opacity: 0.7;
    }
    .toplist-item {
        cursor: pointer;
        transition: 0.2s ease;
    }
    .toplist-item:hover {
        transform: translateY(-2px);
        border-color: rgba(143,179,255,0.35);
        background: rgba(255,255,255,0.95);
    }
    /* ============================================================
       STATISTIK – ÖVERSIKT
    ============================================================= */
    .statsOverview {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 16px;
        margin-top: 20px;
    }
    .statsBox {
        background: var(--bg-card);
        border-radius: var(--radius-card);
        border: 1px solid var(--border-subtle);
        box-shadow: var(--shadow-soft);
        padding: 18px;
        text-align: center;
    }
    .statsNumber {
        font-size: 28px;
        font-weight: 700;
        color: var(--accent);
        margin-bottom: 6px;
    }
    margin-bottom: 12px;
}
.custom-dropdown input {
    width: 100%;
    padding: 12px 36px 12px 16px;
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 14px;
    letter-spacing: 0.02em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.5);
    caret-color: #2A2B2F;
}
.custom-dropdown input:focus {
    background: rgba(255,255,255,1);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(143,179,255,0.35);
    outline: none;
}
.custom-dropdown input:hover {
    background: rgba(255,255,255,0.95);
    border-color: rgba(0,0,0,0.2);
}
.dropdown-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #5A5B60;
    pointer-events: none;
    font-size: 10px;
    transition: transform 0.3s ease;
}
.custom-dropdown.open .dropdown-arrow {
    transform: translateY(-50%) rotate(180deg);
}
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: rgba(255,255,255,0.98);
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}
.custom-dropdown.open .dropdown-menu {
    display: block;
}
.dropdown-item {
    padding: 10px 16px;
    color: var(--text-main);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
    line-height: 1.2 !important;
}
.dropdown-item:hover {
    background: rgba(143,179,255,0.15);
}
.dropdown-item.hidden {
    display: none;
}
.card label {
    display: block;
    margin-bottom: 4px;
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
/* ============================================================
   TOPPLISTA – ENDAST UNDERRUBRIKER
============================================================ */
.topHeader {
    text-align: center;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 15px;
    padding: 14px 0;
    margin-top: 18px;
    cursor: pointer;
    color: var(--text-main);
    transition: 0.25s ease;
    text-shadow: 0 0 6px rgba(0,0,0,0.1);
}
.topHeader:hover {
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
    color: var(--text-main);
}
/* Force top lists to always be visible */
#viewTop .accContent {
    display: block !important;
}
/* ============================================================
   TOPPLISTA – PREMIUM FÄRGER FÖR TOPP 10
============================================================ */
.toplist-item {
    padding: 12px 16px;
    margin-bottom: 8px;
    background: rgba(255,255,255,0.85);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    letter-spacing: 0.02em;
}
.toplist-1 {
    background: linear-gradient(
        135deg,
        #8A6B2F 0%,
        #C8A44E 35%,
        #F0D58A 55%,
        #A8843A 100%
    );
    color: #1a1a1a;
    font-weight: 700;
}
.toplist-2 {
    background: linear-gradient(
        135deg,
        #6F737A 0%,
        #AEB4C0 35%,
        #E6E8ED 55%,
        #8F949C 100%
    );
    color: #1a1a1a;
    font-weight: 700;
}
.toplist-3 {
    background: linear-gradient(
        135deg,
        #6A4F2C 0%,
        #9C7444 35%,
        #D8A86A 55%,
        #8A653A 100%
    );
    color: #1a1a1a;
    font-weight: 700;
}
.coinThumbWrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}
.clickHint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    opacity: 0.7;
}
.toplist-item {
    cursor: pointer;
    transition: 0.2s ease;
}
.toplist-item:hover {
    transform: translateY(-2px);
    border-color: rgba(143,179,255,0.35);
    background: rgba(255,255,255,0.95);
}
/* ============================================================
   STATISTIK – ÖVERSIKT
============================================================ */
.statsOverview {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-top: 20px;
}
.statsBox {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-soft);
    padding: 18px;
    text-align: center;
}
.statsNumber {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 6px;
}
.statsLabel {
    font-size: 14px;
    opacity: 0.7;
}
/* ============================================================
   STATISTIK – BÄSTA KÖP
============================================================ */
.bestBuys {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}
.bestBuyCategory {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-soft);
    padding: 16px;
}
.bestBuyTitle {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    opacity: 0.9;
}
.bestBuyItem {
    font-size: 15px;
    opacity: 0.85;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
    line-height: 1.35;
    cursor: pointer;
    transition: 0.15s ease;
}
.bestBuyItem:hover {
    transform: translateY(-2px);
    background: rgba(0,0,0,0.05);
}
/* ============================================================
   SÄLJARÖVERSIKT MODAL
============================================================ */
.seller-coins-list {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 12px;
    padding: 8px 20px;
}
.seller-coin-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    font-size: 13px;
}
.seller-coin-item:last-child {
    border-bottom: none;
}
.seller-coin-name {
    color: var(--text-main);
    font-weight: 500;
}
.seller-coin-price {
    color: var(--text-muted);
    font-size: 12px;
}
.seller-coins-link {
    cursor: pointer;
    text-decoration: none;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 5px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 13px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.seller-coins-link:hover {
    background: rgba(143, 179, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(143, 179, 255, 0.3);
}
/* ============================================================
   SÄLJAR MYNT LISTA MODAL
============================================================ */
.seller-coins-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease-out;
}
.seller-coins-modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-soft);
    max-width: 400px;
    width: 90%;
    max-height: 60vh;
    overflow: hidden;
    animation: modalSlideIn 0.25s ease-out;
}
.seller-coins-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
}
.seller-coins-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}
.seller-coins-modal-header .modal-close {
    background: rgba(123, 159, 232, 0.08);
    border: 1px solid rgba(123, 159, 232, 0.2);
    color: var(--accent);
    font-size: 22px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: var(--transition-fast);
    line-height: 1;
}
.seller-coins-modal-header .modal-close:hover {
    background: rgba(123, 159, 232, 0.25);
    color: #5B8BF7;
    border-color: rgba(123, 159, 232, 0.4);
    transform: scale(1.05);
}
.seller-coins-modal-body {
    padding: 16px 20px;
    max-height: calc(60vh - 60px);
    overflow-y: auto;
}
.seller-coins-modal-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 14px;
}
.seller-coins-modal-item:last-child {
    border-bottom: none;
}
.seller-coins-modal-name {
    color: var(--text-main);
    font-weight: 500;
}
.seller-coins-modal-price {
    color: var(--text-muted);
    font-size: 13px;
}
/* ============================================================
   SELLER OVERVIEW MODAL
============================================================ */
#sellerOverviewModal {
    position: absolute;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: none;
}

#sellerOverviewModal[style*="block"] {
    opacity: 1;
}

.seller-overview-modal {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-cool);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    max-width: 280px;
    width: auto;
    margin: 0;
}

.seller-modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    overflow: visible;
    max-height: 80vh;
    overflow-y: auto;
}

.seller-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-cool);
    background: var(--bg-elevated);
}

.seller-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}

.seller-modal-body {
    padding: 0;
}

.seller-info-grid {
    padding: 16px 20px;
}

.seller-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-cool);
}

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

.seller-info-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.seller-info-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.coinName {
    font-weight: 500;
    opacity: 0.9;
    color: #5A5B60;
}
.storageItem {
    background: rgba(255,255,255,0.85);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.2s ease;
    cursor: pointer;
}
.storageItem:hover {
    background: rgba(0,0,0,0.05);
    border-color: rgba(143,179,255,0.35);
    transform: translateY(-1px);
}
.storagePlace {
    font-size: 15px;
    color: var(--text-main);
    letter-spacing: 0.3px;
}
.storageValue {
    font-size: 17px;
    font-weight: 600;
    color: var(--accent);
}
.statsHeader {
    text-align: center;
    width: 100%;
    display: flex;
    justify-content: center;
}
#marketSellList {
    min-height: 40px;
}
.storageBox {
    background: var(--bg-card);
    border-radius: 6px;
    padding: 16px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, background 0.2s ease;
    cursor: pointer;
}
.storageBox:hover {
    transform: translateY(-3px);
    background: var(--bg-elevated);
}
.storageBox .statsNumber {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
}
.storageBox .statsLabel {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}
.collectionSort {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}
.sortBtn {
    padding: 10px 18px;
    background: rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 6px;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
.sortBtn:hover {
    background: rgba(0,0,0,0.1);
    border-color: rgba(0,0,0,0.2);
}
.sortBtn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
}
.btn.danger {
    background: #c45c4a;
    color: #fff;
    border: 1px solid #d47a6a;
    transition: 0.25s ease;
}
.btn.danger:hover {
    background: #d47a6a;
    color: #fff;
    box-shadow: 0 0 6px rgba(196, 92, 74, 0.35);
    transform: translateY(-1px);
}
#btnDeleteCoin {
    margin-left: 20px;
}
/* ============================================================
   SCROLL TO TOP BUTTON
============================================================ */
.scroll-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #A8C8FF);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(143, 179, 255, 0.4);
    z-index: 1000;
}
.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.scroll-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(143, 179, 255, 0.6);
}
.scroll-to-top:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(143, 179, 255, 0.5);
}
.scroll-to-top svg {
    color: #2A2B2F;
    transition: transform 0.3s ease;
}
.scroll-to-top:hover svg {
    transform: translateY(-2px);
}
/* ============================================================
   RARITY TOOLTIP
============================================================ */
.rarity-tooltip {
    position: relative;
    text-decoration: none;
    border-bottom: 1px dotted transparent;
    transition: border-bottom-color 0.2s ease;
    cursor: text;
}
.rarity-tooltip:hover {
    border-bottom-color: var(--accent);
}
.rarity-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    padding: 8px 14px;
    background: var(--bg-elevated);
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    border-radius: 10px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}
.rarity-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
/* ============================================================
   SILVER TOOLTIP
============================================================ */
.silver-tooltip {
    position: relative;
    cursor: help;
}
.silver-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 50%;
    right: 100%;
    transform: translateY(-50%) translateX(-8px);
    padding: 10px 16px;
    background: var(--bg-elevated);
    color: var(--text-main);
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    border-radius: 10px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.silver-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(-12px);
}
/* ============================================================
   SÄLLSYNTHET-SLIDER
============================================================ */
.rarity-container {
    margin: 8px 0 16px 0;
}

.rarity-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right,
        #cc0000 0%,     /* Djup röd - mycket ovanlig */
        #ff0000 20%,    /* Stark röd - ovanlig */
        #ff4444 40%,    /* Medium röd */
        #8888ff 60%,    /* Medium blå */
        #4444ff 80%,    /* Stark blå - vanlig */
        #0066ff 100%    /* Djup blå - mycket vanlig */
    );
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.rarity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: 2px solid #333;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.rarity-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

.rarity-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: 2px solid #333;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.rarity-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

.rarity-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.rarity-rare {
    color: #ff4444;
    font-weight: 500;
}

.rarity-common {
    color: #4444ff;
    font-weight: 500;
}

.rarity-current {
    font-weight: 600;
    color: var(--text-main);
}
/* ============================================================
   BILDFÖRHANDSVISNINGAR
============================================================ */
.image-preview-small {
    width: 120px;
    border-radius: 10px;
    cursor: pointer;
}

/* Date input styling - make calendar picker more visible */
input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.8;
    padding: 5px;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Date input tooltip */
input[type="date"] {
    position: relative;
}

input[type="date"]::after {
    content: "Klicka på kalendern för att välja datum";
    position: absolute;
    top: -30px;
    right: 0;
    background: var(--bg-card);
    color: var(--text-main);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 400;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    border: 1px solid var(--border-cool);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

input[type="date"]:hover::after,
input[type="date"]:focus::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(-4px);
}

/* Date field tooltip - one-time tip */
.date-field-tooltip {
    margin-top: 8px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-cool);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-main);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

.tooltip-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.tooltip-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
}
/* ============================================================
   FORMULÄR - NOTERING
============================================================ */
.textarea-notering {
    width: 100%;
    min-height: 80px;
    padding: 12px 14px;
    margin-bottom: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-cool);
    border-radius: 10px;
}

/* ------------------------------------------------------------
   SAMLINGENS VÄGLEDNING
------------------------------------------------------------ */
.guidance-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0 0 16px 0;
    font-style: italic;
}

.guidance-textarea {
    width: 100%;
    min-height: 420px;
    padding: 20px 22px;
    background: var(--bg-card);
    border: 1px solid var(--border-cool);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.8;
    letter-spacing: 0.02em;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.guidance-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.guidance-hint {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
    opacity: 0.7;
}
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* ============================================================
   MODAL STYLES
============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease-out;
}
.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-soft);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    animation: modalSlideIn 0.25s ease-out;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
}
.modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}
.modal-header .modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: var(--transition-fast);
}
.modal-header .modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
}
.modal-body {
    padding: 20px;
    max-height: calc(80vh - 70px);
    overflow-y: auto;
}
/* ============================================================
   SETTINGS VIEW
============================================================ */
.settings-section {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-soft);
    padding: 20px;
    margin-bottom: 20px;
}
.settings-section h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}
.settings-row:last-child {
    border-bottom: none;
}
.settings-label {
    font-size: 14px;
    color: var(--text-main);
}
.settings-value {
    font-size: 14px;
    color: var(--text-muted);
}
/* ============================================================
   ABOUT VIEW
============================================================ */
.about-content {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-soft);
    padding: 20px;
    margin-bottom: 20px;
}
.about-content h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}
.about-content p {
    font-size: 14px;
    color: var(--text-main);
    line-height: 1.6;
    margin-bottom: 12px;
}
.about-content ul {
    font-size: 14px;
    color: var(--text-main);
    line-height: 1.6;
    margin-left: 20px;
}
/* ============================================================
   VALUE INDEX VIEW
============================================================ */
.value-index-item {
    padding: 12px 16px;
    margin-bottom: 8px;
    background: rgba(255,255,255,0.85);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    transition: 0.2s ease;
}
.value-index-item:hover {
    background: rgba(0,0,0,0.05);
    border-color: rgba(143,179,255,0.35);
    transform: translateY(-1px);
}
.value-index-name {
    font-weight: 500;
}
.value-index-value {
    font-weight: 600;
    color: var(--accent);
}
/* ============================================================
   RESPONSIVE DESIGN
============================================================ */
@media (max-width: 768px) {
    .view {
        padding: 0 12px 30px 12px;
    }
    .statsOverview {
        grid-template-columns: repeat(2, 1fr);
    }
    .bestBuys {
        grid-template-columns: 1fr;
    }
    header {
        padding: 10px 14px;
    }
    #searchInput {
        width: 120px;
    }
    #silverPriceInput {
        width: 100px;
    }
}
@media (max-width: 480px) {
    .statsOverview {
        grid-template-columns: 1fr;
    }
    .countryRow, .yearRow, .coinRow {
        padding: calc(4px * var(--ui-scale)) calc(10px * var(--ui-scale));
    }
    .coinThumb {
        width: 50px;
        height: 50px;
    }
}
/* ============================================================
   REPORT MODAL – PREMIUMRAPPORT
============================================================ */
.report-modal {
    background: var(--bg-card);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    width: 80%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow:
        0 30px 90px rgba(0, 0, 0, 0.3),
        0 15px 40px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    opacity: 0;
    transform: translateY(40px) scale(0.98);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.show .report-modal {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.report-header h3 {
    margin: 0 auto;
    font-size: 28px;
    font-weight: 600;
    color: var(--text-main);
    text-align: center;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: block;
    max-width: calc(100% - 60px);
    padding-bottom: 8px;
}

.report-content {
    padding: 48px 60px;
    max-height: 60vh;
    overflow-y: auto;
}

.report-text {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 17px;
    line-height: 2.0;
    color: var(--text-main);
    white-space: pre-wrap;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    text-align: center;
    letter-spacing: 0.3px;
}

.report-footer {
    padding: 32px 60px 48px 60px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: var(--bg-card);
    display: flex;
    justify-content: center;
}

.report-footer .btn {
    min-width: 120px;
    max-width: 200px;
}
/* ============================================================
   VALUE OVERVIEW MODAL – VÄRDEDATA
============================================================ */
.value-overview-modal {
    position: relative;
    background: var(--bg-card);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.25),
        0 10px 30px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    opacity: 0;
    transform: translateY(30px) scale(0.98);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.show .value-overview-modal {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.value-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 8px;
}

.value-item.full-width {
    grid-column: span 2;
}

.value-item {
    background: linear-gradient(145deg, var(--bg-elevated) 0%, var(--bg-card) 100%);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    padding: 24px 20px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.value-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    border-radius: 16px;
    pointer-events: none;
}

.value-item label {
    display: block;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.value-amount {
    font-size: 28px;
    font-weight: 700;
    color: #5B8BF7;
    line-height: 1.2;
    text-shadow: 0 0 20px rgba(91, 139, 247, 0.3);
}

.value-trend-indicator {
    display: flex;
    align-items: center;
    position: absolute;
    right: 50px;
}

.trend-arrow {
    font-size: 18px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: inline-block;
    position: relative;
    cursor: help;
}

.trend-arrow.up {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
}

.trend-arrow.neutral {
    color: var(--text-muted);
    background: rgba(139, 146, 163, 0.1);
}

.trend-arrow.down {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
}

.trend-arrow::after {
    content: attr(data-tooltip);
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-elevated);
    color: var(--text-main);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 400;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 200px;
    white-space: normal;
    word-wrap: break-word;
}

.trend-arrow:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}
/* ============================================================
   WELCOME TIP - NY ANVÄNDARE
============================================================ */
.welcome-tip {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card);
    color: var(--text-main);
    padding: 18px 22px;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    width: 90%;
    max-width: 420px;
    max-height: 90vh;
    z-index: 99999;
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-size: 14px !important;
    border: 1px solid rgba(0,0,0,0.15);
    overflow-y: auto;
}

.welcome-tip * {
    font-size: inherit !important;
}

.welcome-tip.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -10px);
}

.tip-btn {
    margin-top: 12px;
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, var(--accent), #A8C8FF);
    border: none;
    border-radius: 6px;
    color: #2A2B2F;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(143,179,255,0.3);
    transition: all 0.25s ease;
}

.tip-btn:hover {
    background: linear-gradient(135deg, #A8C8FF, var(--accent));
    box-shadow: 0 6px 16px rgba(143,179,255,0.4);
    transform: translateY(-1px);
}

.tip-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(143,179,255,0.3);
}

.spotlight-image {
    width: 100%;
    max-width: 300px;
    max-height: 300px;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
    align-self: center;
    background: var(--bg-elevated);
}

/* ------------------------------------------------------------
   CUSTOM DROPDOWN - basregel (återställd på toppnivå)
   Originalet hamnade nästat i ett obrutet block tidigare i
   filen och gällde därför inte. Utan position:relative
   positioneras .dropdown-menu mot fel förfader.
------------------------------------------------------------- */
.custom-dropdown {
    position: relative;
    width: 100%;
    margin-bottom: 12px;
}
/* Info-ikon for kopta mynt - silvertema */
.info-icon {
    color: #5a6478;
    font-size: 16px;
    cursor: default;
    border: 2px solid #b9c4d6;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-style: italic;
    font-weight: 600;
    background: linear-gradient(145deg, #ffffff, #eef2f8);
    box-shadow: 0 3px 6px rgba(90, 100, 120, 0.15);
    -webkit-user-select: none;
    user-select: none;
    transition: all 0.2s ease;
}

.info-icon:hover {
    color: #3a4256;
    border-color: #5B8BF7;
    box-shadow: 0 5px 10px rgba(90, 100, 120, 0.22);
}
