:root {
    --bg-main: #000000;
    --bg-alt: #1C1C1E;
    --bg-hover: #2A2A2E;
    --text-main: #F9F9FA;
    --text-muted: #B1B1B3;
    --accent-main: #0060DF;
    --accent-alt: #C7008B;
    --border-main: #454545;
  }
  
  html {
    height: 100%;
  }
  
  body {
    background: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    overflow-y: hidden;
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
  }
  
  * {
    font-family: 'Inter', sans-serif;
  }
  
  i {
    font-size: 1.5rem !important;
  }
  
  .nav-link:hover,
  .nav-link.active {
    color: var(--accent-alt) !important;
  }
  
  a {
    color: var(--accent-alt);
    text-decoration: none;
    transition: color 0.2s ease;
  }
  
  a:hover {
    color: var(--bg-hover);
  }
  
  .address-bar-row {
    display: flex;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 0;
  }
  
  header input {
    margin: 0 0.25rem;
    background: radial-gradient(circle, rgba(198, 0, 139, 0.1) 0%, rgba(0, 96, 223, 0.05) 100%);
    border: 1px solid var(--border-main);
    color: var(--text-muted);
    border-radius: 0.5rem;
    padding: 0.5rem;
    flex: 1;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
  }
  
  header input:focus {
    color: var(--text-main);
    outline: none;
    border-color: var(--accent-main);
    box-shadow: 0 0 0 2px rgba(0, 96, 223, 0.3);
  }
  
  #nav {
    display: flex;
    padding: 0.5rem;
  }
  
  #nav .backward, #nav .forward, #nav .reload {
    font-weight: bold;
    padding: 0.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
  }
  
  #nav .backward:hover, #nav .forward:hover, #nav .reload:hover {
    color: var(--accent-alt);
  }
  
  hr {
    display: block;
    height: 1px;
    border: 0;
    border-top: 1px solid var(--border-main);
    margin: 1rem 0;
    padding: 0;
  }
  
  #tabs-wrapper {
    width: 100%;
    display: flex;
    align-items: flex-end;
    height: 2.5rem;
    overflow: hidden;
    position: relative;
  }
  
  .tabs {
    flex: 1;
    overflow-x: auto;
    white-space: nowrap;
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: flex-end;
    scrollbar-width: none;
    position: relative;
    overflow-y: hidden;
  }
  
  .tabs::-webkit-scrollbar {
    display: none;
  }
  
  .tabs li.tab {
    display: inline-flex;
    align-items: center;
    line-height: 1rem;
    padding: 0.5rem 0.625rem;
    border-radius: 0.375rem 0.375rem 0 0;
    margin: 0 0.125rem -0.0625rem 0;
    border: 1px solid var(--border-main);
    border-bottom: none;
    cursor: pointer;
    color: var(--text-muted);
    flex: 1 1 0;
    max-width: 15rem;
    min-width: 4rem;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    transition: min-width 0.2s, background-color 0.2s ease, color 0.2s ease;
    background: var(--bg-alt);
    color: var(--text-main);
  }
  
  .tabs li.tab:hover {
    background: var(--bg-hover);
    color: var(--text-main);
  }
  
  .tabs li.tab.active {
    background: var(--bg-main);
    border: 1px solid var(--border-main);
    color: var(--text-main);
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
  }
  
  .tabs li.tab .favicon, .tabs li.tab .tab-close {
    flex-shrink: 0;
  }
  
  .tabs li.tab span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .tab .tab-close {
    cursor: pointer;
    font-size: 1rem;
    padding-left: 0.375rem;
    color: var(--text-muted);
    transition: color 0.2s ease;
  }
  
  .tab .tab-close:hover {
    color: var(--accent-alt);
  }
  
  .tabs .new-tab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1rem;
    padding: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    flex: 0 0 auto;
    min-width: auto;
    margin: 0 0.125rem -0.0625rem 0;
    position: sticky;
    right: 0;
    z-index: 1;
    background: var(--bg-main);
    transition: color 0.2s ease;
  }
  
  .new-tab-btn {
    transform: translateY(-0.25vh);
  }
  
  .tabs .new-tab-btn:hover {
    color: var(--accent-alt);
  }
  
  #bookmark-star, #menu-button {
    padding: 0.5rem 0.25rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
  }
  
  #menu-button {
    margin-right: 0.5rem;
  }
  
  #bookmark-star:hover, #menu-button:hover {
    color: var(--accent-alt);
  }
  
  #bookmarks-bar {
    background: var(--bg-main);
    border-bottom: 1px solid var(--border-main);
    height: 2.5rem;
    overflow: hidden;
    white-space: nowrap;
    display: none;
    margin-bottom: 0.5rem;
  }
  
  #bookmarks-bar ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  
  #bookmarks-bar li {
    display: inline-block;
    padding: 0.625rem 0.5rem;
    position: relative;
    transition: background-color 0.2s ease;
  }
  
  #bookmarks-bar li:hover {
    background-color: var(--bg-hover);
  }
  
  #bookmarks-bar a {
    color: var(--accent-alt);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
  }
  
  #bookmarks-bar a:hover {
    color: var(--bg-hover);
  }
  
  #bookmarks-bar a i {
    font-size: 1rem !important;
  }
  
  #bookmarks-bar .bookmark-close {
    cursor: pointer;
    font-size: 0.8rem;
    padding-left: 0.25rem;
    color: var(--text-muted);
    transition: color 0.2s ease;
  }
  
  #bookmarks-bar .bookmark-close:hover {
    color: var(--accent-alt);
  }
  
  #page-content {
    height: 100%;
    width: auto;
    position: relative;
    flex: 1;
    margin-left: 0;
    overflow: hidden;
  }
  
  #page-content .page {
    height: 100%;
    width: 100%;
    display: none;
    position: absolute;
    top: 0;
    left: 0;
  }
  
  #page-content .page.active {
    display: block;
  }
  
  #sidebar {
    width: 4rem;
    height: 100%;
    background: var(--bg-alt);
    overflow-y: auto;
    text-align: left;
    border-right: 1px solid var(--border-main);
    z-index: 100000;
    overflow-x: hidden;
    scrollbar-width: thin;
    transition: background-color 0.2s ease;
  }
  
  #sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
  }
  
  #sidebar a {
    color: var(--text-muted);
    display: block;
    text-decoration: none;
    padding: 1rem;
    transition: background-color 0.2s ease, color 0.2s ease;
  }
  
  #sidebar a:hover {
    color: var(--text-main);
    background: var(--bg-hover);
  }
  
  #sidebar h2 {
    margin-top: 0;
    color: var(--accent-alt);
    padding: 0 0.625rem;
  }
  
  .favicon {
    margin-right: 0.3125rem;
  }
  
  #settings-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-alt);
    padding: 1.25rem;
    border: 1px solid var(--border-main);
    border-radius: 0.5rem;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }
  
  #settings-modal.show {
    display: block;
  }
  
  #settings-modal select {
    width: 100%;
    padding: 0.3125rem;
    margin-bottom: 0.625rem;
    background-color: var(--bg-hover);
    color: var(--text-main);
    border: 1px solid var(--border-main);
    border-radius: 0.25rem;
    transition: border-color 0.2s ease;
  }
  
  #settings-modal select:focus {
    border-color: var(--accent-main);
  }
  
  #settings-modal button {
    padding: 0.3125rem 0.625rem;
    background: var(--bg-main);
    border: none;
    color: var(--text-main);
    cursor: pointer;
    border-radius: 0.25rem;
    transition: background-color 0.2s ease, color 0.2s ease;
  }
  
  #settings-modal button:hover {
    background: var(--accent-main);
    color: var(--text-main);
  }
  
  main {
    display: flex;
    flex: 1;
    overflow: hidden;
  }
  
  @media (max-width: 64rem) {
    #sidebar {
      width: 9.375rem;
    }
    #page-content {
      flex: 1;
      margin-left: 0;
    }
    header input {
      width: calc(100% - 12.5rem);
    }
    .tabs li.tab {
      padding: 0.5rem 0.5rem;
      max-width: 12rem;
    }
    #sidebar li {
      padding: 0.75rem 0;
    }
  }
  
  @media (max-width: 48rem) {
    #sidebar {
      width: 6.25rem;
    }
    #page-content {
      flex: 1;
      margin-left: 0;
    }
    header input {
      width: calc(100% - 10rem);
    }
    .tabs li.tab {
      padding: 0.375rem 0.375rem;
      max-width: 10rem;
    }
    #sidebar li {
      padding: 0.5rem 0;
    }
  }

#settings-modal {
    max-height: 60vh;
    overflow-y: auto;
    padding: 1em;
    background: var(--bg-alt);
    position: fixed;
    top: 5vh;
    left: 50%;
    transform: translateY(50%) translateX(-50%);
    z-index: 9999;
    border: 1px solid var(--border-main);
    border-radius: 8px;
}

.settings-top-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    position: sticky;
    top: 0;
    background: var(--bg-alt);
    padding-bottom: 8px;
}
