:root {
    --bg: #020617;
    --bg-panel: #020617;
    --border-subtle: #1e293b;
    --text-main: #e5e7eb;
    --text-muted: #64748b;
    --accent: #22d3ee;
    --danger: #f97373;
    --success: #4ade80;
    --radius-lg: 16px;
    --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.55);
  }
  
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }
  
  body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
      "Inter", sans-serif;
    background: radial-gradient(circle at top, #0f172a 0, #020617 55%, #000 100%);
    color: var(--text-main);
  }
  
  .app {
    min-height: 100vh;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 12px 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
  }
  
  /* Header */
  
  .app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  
  .logo {
    font-weight: 700;
    letter-spacing: 0.18em;
    font-size: 0.9rem;
    text-transform: uppercase;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: radial-gradient(circle at top left, #22d3ee33, transparent 55%);
    backdrop-filter: blur(18px);
    text-decoration: none;
    color: var(--text-main);
    display: inline-block;
    cursor: pointer;
    transition: opacity 0.2s ease;
  }

  .logo:hover {
    opacity: 0.8;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: radial-gradient(circle at top left, #22d3ee33, transparent 55%);
    backdrop-filter: blur(18px);
  }
  
  .nav {
    display: flex;
    gap: 8px;
  }
  
  .nav-btn {
    border: none;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.8rem;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
  }
  
  .nav-btn:hover {
    background: rgba(15, 23, 42, 0.8);
    color: var(--text-main);
  }
  
  .nav-btn--active {
    background: rgba(15, 23, 42, 0.95);
    color: var(--accent);
  }
  
  /* Layout */
  
  main {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  
  .panel {
    background: rgba(15, 23, 42, 0.9);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(24px);
  }
  
  .panel-title {
    margin: 0 0 12px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
  }
  
  /* Market Overview Section */
  
  .metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 0;
  }
  
  .metric-card {
    background: rgba(15, 23, 42, 0.9);
    border-radius: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(30, 64, 175, 0.4);
    text-align: center;
  }
  
  .metric-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
    letter-spacing: 0.05em;
  }
  
  .metric-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 2px;
    line-height: 1.2;
  }
  
  .metric-change {
    font-size: 0.75rem;
    margin-top: 2px;
  }
  
  .metric-fng-class {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
    text-transform: capitalize;
  }
  
  .trending-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-subtle);
  }
  
  .trending-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin: 0 0 16px;
  }
  
  .trending-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
  }
  
  .trending-coin {
    background: rgba(15, 23, 42, 0.9);
    border-radius: 10px;
    padding: 12px;
    border: 1px solid rgba(30, 64, 175, 0.3);
    cursor: pointer;
    transition: all 0.15s ease;
  }
  
  .trending-coin:hover {
    background: rgba(15, 23, 42, 1);
    border-color: rgba(148, 163, 184, 0.5);
    transform: translateY(-2px);
  }
  
  .trending-coin-name {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 4px;
  }
  
  .trending-coin-symbol {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
  }
  
  .trending-coin-volume {
    font-size: 0.75rem;
    color: var(--text-muted);
  }
  
  .trending-coin-change {
    font-size: 0.8rem;
    margin-top: 4px;
  }
  
  /* Markets list */
  
  .coin-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 500px;
    overflow-y: auto;
    /* Custom scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
  }
  
  .coin-list::-webkit-scrollbar {
    width: 6px;
  }
  
  .coin-list::-webkit-scrollbar-track {
    background: transparent;
  }
  
  .coin-list::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 3px;
  }
  
  .coin-list::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
  }
  
  .coin-row {
    display: grid;
    grid-template-columns: 1.8fr 1fr 1fr;
    align-items: center;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.12s ease, transform 0.05s ease;
  }
  
  .coin-row:hover {
    background: rgba(15, 23, 42, 0.9);
    transform: translateY(-1px);
  }
  
  .coin-row--active {
    background: rgba(15, 23, 42, 1);
    border: 1px solid rgba(148, 163, 184, 0.5);
  }
  
  .coin-main {
    display: flex;
    flex-direction: column;
  }
  
  .coin-name {
    font-size: 0.9rem;
  }
  
  .coin-symbol {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
  }
  
  .coin-price {
    font-size: 0.9rem;
    text-align: right;
  }
  
  .coin-change {
    font-size: 0.8rem;
    text-align: right;
  }
  
  /* Detail panel */
  
  .detail-name {
    margin: 0 0 4px;
    font-size: 1.2rem;
  }
  
  .detail-price {
    margin: 0 0 4px;
    font-size: 1.8rem;
  }
  
  .detail-change {
    margin: 0 0 16px;
    font-size: 0.9rem;
  }
  
  .detail-change--positive {
    color: var(--success);
  }
  
  .detail-change--negative {
    color: var(--danger);
  }
  
  .detail-timestamp {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    margin-top: -4px;
  }
  
  .chart-placeholder {
    margin-top: 8px;
    margin-bottom: 20px;
    border-radius: 14px;
    border: 1px dashed rgba(148, 163, 184, 0.5);
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--text-muted);
  }
  
  .stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
  
  .stat {
    background: rgba(15, 23, 42, 0.9);
    border-radius: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(30, 64, 175, 0.4);
  }
  
  .stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
  }
  
  .stat-value {
    font-size: 0.9rem;
  }
  
  /* Top 100 Markets Table */
  
  .table-container {
    overflow-x: auto;
    /* Custom scrollbar for horizontal scroll on mobile */
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
  }
  
  .table-container::-webkit-scrollbar {
    height: 6px;
  }
  
  .table-container::-webkit-scrollbar-track {
    background: transparent;
  }
  
  .table-container::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 3px;
  }
  
  .markets-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
  }
  
  .markets-table thead {
    border-bottom: 1px solid var(--border-subtle);
  }
  
  .markets-table th {
    text-align: left;
    padding: 12px 8px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
  }
  
  .markets-table tbody tr {
    border-bottom: 1px solid rgba(30, 41, 59, 0.3);
    cursor: pointer;
    transition: all 0.15s ease;
    border-left: 2px solid transparent; /* Reserve space for hover border */
  }
  
  .markets-table tbody tr:hover {
    background: rgba(34, 211, 238, 0.08);
    border-left-color: var(--accent);
    box-shadow: 0 0 8px rgba(34, 211, 238, 0.2);
  }
  
  .markets-table tbody tr:last-child {
    border-bottom: none;
  }
  
  .markets-table td {
    padding: 10px 8px;
    vertical-align: middle;
  }
  
  /* Column widths and alignment */
  .col-favorite {
    width: 35px;
    text-align: center;
    padding: 12px 4px !important;
  }
  
  .col-rank {
    width: 45px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
  }
  
  .col-name {
    min-width: 160px;
    max-width: 180px;
  }
  
  .col-price {
    text-align: right;
    font-weight: 500;
    white-space: nowrap;
    width: 110px;
  }
  
  .col-change {
    text-align: right;
    white-space: nowrap;
    width: 70px;
  }
  
  .col-mcap,
  .col-volume {
    text-align: right;
    color: var(--text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
    width: 120px;
  }
  
  .col-supply {
    text-align: right;
    color: var(--text-muted);
    font-size: 0.8rem;
    width: 130px;
  }
  
  .col-sparkline {
    width: 120px;
    min-width: 120px;
    text-align: center;
    padding: 12px 6px !important;
  }
  
  /* Star button for favorites */
  .star-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    transition: all 0.15s ease;
    opacity: 0.5;
  }
  
  .star-btn:hover {
    opacity: 1;
    color: var(--accent);
    transform: scale(1.1);
  }
  
  .star-btn.active {
    opacity: 1;
    color: var(--accent);
  }
  
  /* Coin name with logo */
  .col-name {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .coin-logo {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
  }
  
  .coin-name-group {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.3;
  }
  
  .table-coin-name {
    font-weight: 500;
    font-size: 0.9rem;
    line-height: 1.2;
  }
  
  .table-coin-symbol {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    line-height: 1.2;
  }
  
  /* Change percentages with arrows */
  .table-change-positive {
    color: var(--success);
  }
  
  .table-change-negative {
    color: var(--danger);
  }
  
  /* Volume with secondary value */
  .volume-secondary {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
  }
  
  /* Supply progress bar */
  .supply-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
  }
  
  .supply-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s ease;
  }
  
  /* Sparkline chart */
  .sparkline {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
  }
  
  .col-sparkline svg {
    width: 100%;
    height: auto;
  }
  
  .sparkline-placeholder {
    color: var(--text-muted);
    font-size: 0.8rem;
  }
  
  /* Responsive */
  
  @media (max-width: 800px) {
    .metrics-grid {
      grid-template-columns: repeat(2, 1fr);
    }
    
    .markets-table {
      font-size: 0.8rem;
    }
    
    .markets-table th,
    .markets-table td {
      padding: 10px 6px;
    }
    
    /* Hide less critical columns on mobile */
    .col-favorite,
    .col-change:nth-of-type(1), /* Hide 1h column */
    .col-change:nth-of-type(3), /* Hide 7d column */
    .col-mcap,
    .col-volume,
    .col-supply,
    .col-sparkline {
      display: none;
    }
  }

  /* ========================================
     Coin Detail Page Styles
     ======================================== */

  /* Hero Header Section */
  .coin-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 0;
    margin-bottom: 24px;
  }

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

  .coin-icon-wrapper {
    position: relative;
  }

  .coin-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
  }

  .coin-icon-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(34, 211, 238, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent);
  }

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

  .coin-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .coin-separator {
    color: var(--text-muted);
    font-weight: 400;
  }

  .coin-rank {
    font-size: 0.9rem;
    color: var(--text-muted);
  }

  .coin-hero-right {
    display: flex;
    align-items: center;
    gap: 24px;
  }

  .coin-price-section {
    text-align: right;
  }

  .coin-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
  }

  .coin-change-24h {
    font-size: 1rem;
  }

  .watchlist-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.3);
    border-radius: 8px;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .watchlist-btn:hover {
    background: rgba(34, 211, 238, 0.2);
    border-color: var(--accent);
  }

  .watchlist-icon {
    font-size: 1.2rem;
  }

  /* Chart Section */
  .panel--chart {
    margin-bottom: 24px;
  }

  /* Chart Header */
  .chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
  }

  .chart-header-left {
    display: flex;
    align-items: center;
  }

  .chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
  }

  .chart-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .chart-header-price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
  }

  .chart-header-change-pill {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
  }

  .chart-header-change-pill.change-positive {
    background: rgba(74, 222, 128, 0.15);
    color: var(--success);
  }

  .chart-header-change-pill.change-negative {
    background: rgba(249, 115, 115, 0.15);
    color: var(--danger);
  }

  .chart-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 12px;
  }

  .chart-tab {
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
  }

  .chart-tab:hover {
    background: rgba(34, 211, 238, 0.1);
    color: var(--accent);
  }

  .chart-tab--active {
    background: rgba(34, 211, 238, 0.15);
    color: var(--accent);
  }

  .chart-container {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 8px 0;
  }

  .chart-placeholder {
    color: var(--text-muted);
    font-size: 0.9rem;
  }

  .price-chart {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
  }

  /* Y-axis labels styling */
  .y-axis-labels text {
    font-family: system-ui, -apple-system, sans-serif;
  }

  /* Chart hover elements */
  .chart-hover-dot {
    pointer-events: none;
  }

  .chart-hover-line {
    pointer-events: none;
  }

  .chart-tooltip {
    pointer-events: none;
  }

  .tooltip-bg {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
  }

  .tooltip-price {
    font-family: system-ui, -apple-system, sans-serif;
  }

  .tooltip-date {
    font-family: system-ui, -apple-system, sans-serif;
  }

  .tooltip-change {
    font-family: system-ui, -apple-system, sans-serif;
  }

  /* Stats Grid */
  .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
  }

  .stat-card {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 10px;
    padding: 16px;
    border: 1px solid rgba(30, 64, 175, 0.2);
  }

  .stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
    letter-spacing: 0.05em;
  }

  .stat-value {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-main);
  }

  .stat-change {
    font-size: 0.85rem;
    margin-top: 4px;
  }

  /* About Section */
  .coin-description {
    margin-bottom: 24px;
    line-height: 1.6;
    color: var(--text-main);
  }

  .coin-description p {
    margin: 0 0 12px;
  }

  .read-more-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    margin-top: 8px;
  }

  .read-more-link:hover {
    text-decoration: underline;
  }

  /* Description Editor */
  .panel-header-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
  }

  .edit-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-main);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .edit-btn:hover {
    background: rgba(148, 163, 184, 0.15);
    border-color: var(--accent);
  }

  .edit-icon {
    font-size: 0.9rem;
  }

  .coin-description-edit {
    margin-bottom: 24px;
  }

  .coin-description-textarea {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.6;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s ease;
  }

  .coin-description-textarea:focus {
    outline: none;
    border-color: var(--accent);
  }

  .description-edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
  }

  .save-btn,
  .cancel-btn,
  .use-coingecko-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
  }

  .save-btn {
    background: var(--accent);
    color: var(--bg-main);
    border-color: var(--accent);
  }

  .save-btn:hover {
    opacity: 0.9;
  }

  .cancel-btn {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-main);
    border-color: var(--border-subtle);
  }

  .cancel-btn:hover {
    background: rgba(148, 163, 184, 0.15);
  }

  .use-coingecko-btn {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border-subtle);
    margin-left: auto;
  }

  .use-coingecko-btn:hover {
    color: var(--text-main);
    border-color: var(--text-muted);
  }

  .links-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 12px;
  }

  .links-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
  }

  .link-item {
    padding: 8px 16px;
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 6px;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
  }

  .link-item:hover {
    background: rgba(34, 211, 238, 0.2);
    border-color: var(--accent);
  }

  /* ============================================
     TOOLS PAGES STYLES
     ============================================ */

  /* Tools Homepage */
  .tools-main {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
  }

  .tools-hero {
    text-align: center;
    margin-bottom: 48px;
  }

  .tools-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 12px;
  }

  .tools-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin: 0;
  }

  .tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 32px;
  }

  .tool-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: all 0.2s ease;
    backdrop-filter: blur(18px);
  }

  .tool-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
  }

  .tool-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .tool-card-icon {
    font-size: 3rem;
    margin-bottom: 16px;
  }

  .tool-card-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 12px;
  }

  .tool-card-description {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0 0 24px;
  }

  .tool-card-button {
    display: inline-block;
    padding: 12px 24px;
    background: var(--accent);
    color: var(--bg-main);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s ease;
  }

  .tool-card-button:hover {
    opacity: 0.9;
  }

  /* Tool Page Layout */
  .tool-page {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
  }

  .tool-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    gap: 20px;
  }

  .tool-header-content {
    flex: 1;
  }

  .tool-page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 8px;
  }

  .tool-page-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin: 0;
  }

  .tool-share-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .tool-share-btn:hover {
    background: rgba(148, 163, 184, 0.15);
    border-color: var(--accent);
    color: var(--accent);
  }

  .tool-input-panel {
    margin-bottom: 32px;
  }

  .tool-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
  }

  .form-group-inline {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
  }

  .date-range-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
  }

  .form-input {
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s ease;
  }

  .form-input:focus {
    outline: none;
    border-color: var(--accent);
  }

  .btn-link {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px 0;
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  .btn-link:hover {
    opacity: 0.8;
  }

  .btn-primary {
    padding: 12px 24px;
    background: var(--accent);
    color: var(--bg-main);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: opacity 0.2s ease;
    margin-top: 8px;
  }

  .btn-primary:hover {
    opacity: 0.9;
  }

  .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  /* Coin Select Component */
  .coin-select-container {
    position: relative;
  }

  .coin-select-input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: inherit;
  }

  .coin-select-input:focus {
    outline: none;
    border-color: var(--accent);
  }

  .coin-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--shadow-soft);
  }

  .coin-select-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    cursor: pointer;
    transition: background 0.15s ease;
  }

  .coin-select-item:hover {
    background: rgba(15, 23, 42, 0.8);
  }

  .coin-select-item-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
  }

  .coin-select-item-icon-placeholder {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.2);
    flex-shrink: 0;
  }

  .coin-select-item-info {
    flex: 1;
  }

  .coin-select-item-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
  }

  .coin-select-item-symbol {
    font-size: 0.8rem;
    color: var(--text-muted);
  }

  .coin-select-empty,
  .coin-select-error {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
  }

  .coin-select-more {
    padding: 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-subtle);
    background: rgba(15, 23, 42, 0.4);
  }

  /* Result Card */
  .result-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 32px;
    backdrop-filter: blur(18px);
  }

  .result-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
  }

  .result-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 4px;
  }

  .result-card-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0;
  }

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

  .result-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-main);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .result-action-btn:hover {
    background: rgba(148, 163, 184, 0.15);
    border-color: var(--accent);
  }

  .result-card-chart {
    margin: 24px 0;
  }

  .dca-chart-container {
    width: 100%;
    overflow-x: auto;
  }

  .dca-chart {
    display: block;
    width: 100%;
    height: auto;
  }

  .result-card-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 24px;
  }

  .result-stat {
    padding: 16px;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
  }

  .result-stat--large {
    grid-column: span 2;
    padding: 24px;
  }

  .result-stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
  }

  .result-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
  }

  .result-stat--large .result-stat-value {
    font-size: 2rem;
  }

  .result-card-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
  }

  .result-card-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
  }

  /* Market Cap Comparison - Custom Visual Design */
  .mcap-compare-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 28px;
    backdrop-filter: blur(18px);
  }

  .mcap-compare-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
  }

  .mcap-compare-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 6px;
  }

  .mcap-compare-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
  }

  .mcap-compare-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin: 24px 0;
    padding: 20px;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
  }

  .mcap-compare-coin {
    flex: 1;
    max-width: 240px;
    padding: 18px;
    background: rgba(15, 23, 42, 0.8);
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
  }

  .mcap-compare-coin--current {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.2);
  }

  .mcap-compare-coin--reference {
    border-color: rgba(148, 163, 184, 0.3);
  }

  .mcap-compare-coin-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
  }

  .mcap-compare-coin-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
  }

  .mcap-compare-coin-icon-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.2);
  }

  .mcap-compare-coin-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 3px;
  }

  .mcap-compare-coin-symbol {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
  }

  .mcap-compare-coin-price {
    margin-bottom: 12px;
  }

  .mcap-compare-price-label,
  .mcap-compare-mcap-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
  }

  .mcap-compare-price-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
  }

  .mcap-compare-mcap-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
  }

  .mcap-compare-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  .mcap-compare-arrow-icon {
    font-size: 2rem;
    color: var(--accent);
    font-weight: 300;
  }

  .mcap-compare-multiple {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent);
    padding: 5px 10px;
    background: rgba(34, 211, 238, 0.15);
    border-radius: 6px;
    border: 1px solid rgba(34, 211, 238, 0.3);
  }

  .mcap-compare-result {
    text-align: center;
    padding: 28px;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.1) 0%, rgba(15, 23, 42, 0.6) 100%);
    border-radius: 12px;
    border: 2px solid var(--accent);
    margin: 24px 0;
  }

  .mcap-compare-result-label {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    font-weight: 500;
  }

  .mcap-compare-result-price {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 12px;
    line-height: 1.2;
    text-shadow: 0 0 20px rgba(34, 211, 238, 0.3);
  }

  .mcap-compare-result-price--up {
    color: var(--success);
    text-shadow: 0 0 20px rgba(74, 222, 128, 0.3);
  }

  .mcap-compare-result-price--down {
    color: var(--danger);
    text-shadow: 0 0 20px rgba(249, 115, 115, 0.3);
  }

  .mcap-compare-result-change {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.95rem;
    flex-wrap: wrap;
  }

  .mcap-compare-change-arrow {
    font-size: 1.1rem;
    font-weight: 700;
  }

  .mcap-compare-change-value {
    font-weight: 600;
  }

  .mcap-compare-change--positive {
    color: var(--success);
  }

  .mcap-compare-change--negative {
    color: var(--danger);
  }

  .mcap-compare-change-multiple {
    color: var(--text-muted);
    font-size: 0.95rem;
  }

  .mcap-compare-footer {
    margin-top: 20px;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
  }

  /* Responsive for Market Cap Comparison */
  @media (max-width: 768px) {
    .mcap-compare-visual {
      flex-direction: column;
      gap: 16px;
    }

    .mcap-compare-arrow {
      transform: rotate(90deg);
    }

    .mcap-compare-result-price {
      font-size: 2rem;
    }

    .mcap-compare-header {
      flex-direction: column;
      gap: 12px;
    }

    .mcap-compare-card {
      padding: 20px;
    }
  }

  /* Loading and Error States */
  .loading-state,
  .error-state {
    padding: 48px;
    text-align: center;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
  }

  .loading-state {
    color: var(--text-muted);
  }

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

  .error-hint {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--text-muted);
  }

  /* Responsive */
  @media (max-width: 768px) {
    .tools-title {
      font-size: 2rem;
    }

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

    .tool-header {
      flex-direction: column;
      gap: 12px;
    }

    .tool-share-btn {
      align-self: flex-start;
    }

    .tool-page-title {
      font-size: 1.5rem;
    }

    .date-range-group {
      flex-direction: column;
    }

    .result-card-header {
      flex-direction: column;
      gap: 16px;
    }

    .result-card-actions {
      width: 100%;
      justify-content: flex-start;
    }

    .result-card-stats {
      grid-template-columns: 1fr;
    }

    .result-stat--large {
      grid-column: span 1;
    }

    .dca-chart-container {
      overflow-x: scroll;
    }
  }

  /* Placeholder Sections */
  .placeholder-content {
    padding: 20px 0;
  }

  .placeholder-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0 0 8px;
  }

  .placeholder-subtext {
    color: var(--text-muted);
    font-size: 0.85rem;
    opacity: 0.7;
    margin: 0;
  }

  /* Responsive: Coin Detail Page */
  @media (max-width: 768px) {
    .coin-hero {
      flex-direction: column;
      align-items: flex-start;
      gap: 20px;
    }

    .coin-hero-right {
      width: 100%;
      justify-content: space-between;
    }

    .coin-price {
      font-size: 1.5rem;
    }

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

    .chart-tabs {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }

    .chart-tab {
      white-space: nowrap;
      flex-shrink: 0;
    }
  }