/* ============================================
   BASE STYLES
   ============================================ */
* { 
    box-sizing: border-box; 
    font-family: 'Courier New', 'Liberation Mono', 'DejaVu Sans Mono', Courier, monospace !important; 
}

body { 
    background: #0d1117; 
    color: #e6edf3; 
    margin: 0; 
    height: 100vh; 
    overflow: hidden; 
}

html, body {
    position: fixed;
    overflow: hidden;
    width: 100%;
    height: 100%;
    -webkit-overflow-scrolling: touch;
}

.main { 
    display: flex; 
    height: 100vh; 
    width: 100vw; 
    position: fixed; 
    top: 0; 
    left: 0; 
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar { 
    width: 320px; 
    min-width: 320px;
    max-width: 320px;
    background: #161b22; 
    border-right: 1px solid #30363d; 
    display: flex; 
    flex-direction: column; 
    height: 100vh;
}

.sidebar-top { 
    background: #21262d; 
    padding: 10px 16px; 
    border-bottom: 1px solid #30363d; 
    flex-shrink: 0;
    height: 50px;
    min-height: 50px;
    max-height: 50px;
}

.search-container {
    background: #161b22;
    padding: 7px;
    border-bottom: 1px solid #30363d;
    flex-shrink: 0;
    height: 48px;
    min-height: 48px;
    max-height: 48px;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.node-search {
    background: #0d1117;
    border: 1px solid #30363d;
    color: #e6edf3;
    padding: 8px 12px;
    padding-right: 35px;
    border-radius: 4px;
    font-size: 12px;
    width: 100%;
    margin: 0;
    height: 34px;
}

.search-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: #7d8590;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: all 0.12s ease;
}

.search-clear:hover {
    background: #30363d;
    color: #e6edf3;
}

.sort-container {
    background: #161b22;
    padding: 6px 8px;
    border-bottom: 1px solid #30363d;
    flex-shrink: 0;
    height: 32px;
    min-height: 32px;
    max-height: 32px;
    position: relative;
    z-index: 50;
}

.sort-container select {
    background: #0d1117;
    border: 1px solid #30363d;
    color: #e6edf3;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
    width: 100%;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.sort-container select:hover {
    border-color: #58a6ff;
}

.sort-container select:focus {
    outline: none;
    border-color: #58a6ff;
}

.node-list-container { 
    flex: 1; 
    overflow-y: auto; 
    padding-top: 0;
    position: relative;
    z-index: 1;
}

.node-list { 
    padding: 6px; 
}

.node-item { 
    background: #21262d; 
    border: 1px solid #30363d; 
    margin: 0 0 4px 0; 
    padding: 10px; 
    border-radius: 6px; 
    transition: all 0.12s ease; 
    cursor: pointer; 
}

.node-item:hover { 
    background: #30363d; 
    border-color: #58a6ff; 
}

.node-item.selected { 
    background: #0969da; 
    border-color: #1f6feb; 
}

.node-item.selected .node-title { 
    color: #ffffff; 
}

.node-item.selected .node-hash, 
.node-item.selected .node-info { 
    color: rgba(255,255,255,0.8); 
}

.node-title { 
    color: #58a6ff; 
    font-weight: 600; 
    margin-bottom: 4px; 
    font-size: 12px; 
    line-height: 1.2; 
}

.node-hash { 
    color: #8b949e; 
    font-size: 11px; 
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace; 
    word-break: break-all; 
    margin-bottom: 4px; 
    line-height: 1.3; 
}

.node-info { 
    color: #7d8590; 
    font-size: 12px; 
    margin-bottom: 6px; 
}

.browse-btn { 
    background: #30363d; 
    color: #ffffff; 
    border: none; 
    padding: 5px 10px; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 10px; 
    font-weight: 600; 
    transition: all 0.12s ease; 
    width: 100%; 
}

.browse-btn:hover { 
    background: #1f6feb; 
}

.status-bar {
    position: absolute !important;
    bottom: 30px !important;
    left: 0 !important;
    right: 0 !important;
    padding: 4px 8px !important;
    margin: 0 !important;
    font-size: 12px !important;
    line-height: 1.1 !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    box-sizing: border-box !important;
    background: #21262d;
    border-top: 1px solid #30363d;
}

.status-bar .online { 
    color: #3fb950; 
    font-weight: bold; 
}

.status-bar .count { 
    color: #58a6ff; 
    font-weight: bold; 
}

.online, .waiting, .connerror {
    font-weight: bold;
}

.online {
    color: #40ed3a;
}

.waiting {
    color: #f59e0b;
}

.connerror {
    color: #ef4444;
}

/* ============================================
   CONTENT AREA
   ============================================ */
.content { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    background: #0d1117;
    width: calc(100vw - 320px);
    min-width: calc(100vw - 320px);
    max-width: calc(100vw - 320px);
    height: 100vh;
    overflow: hidden;
    padding-bottom: 30px;
}

/* ============================================
   NAVIGATION BAR
   ============================================ */
.nav-bar { 
    background: #21262d; 
    padding: 12px 16px; 
    border-bottom: 1px solid #30363d; 
    display: flex; 
    align-items: center; 
    gap: 8px;
    height: 60px;
    min-height: 60px;
    max-height: 60px;
    flex-shrink: 0;
}

.nav-controls { 
    display: flex; 
    gap: 4px; 
}

.nav-btn { 
    background: #30363d; 
    border: 1px solid #3d444d; 
    color: #e6edf3; 
    padding: 6px 8px; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 12px; 
    transition: all 0.12s ease; 
    min-width: 28px; 
    text-align: center; 
}

.nav-btn:hover { 
    background: #484f58; 
    border-color: #58a6ff; 
}

.nav-btn:disabled { 
    background: #21262d; 
    color: #656d76; 
    cursor: not-allowed; 
    border-color: #30363d; 
}

.address-bar { 
    flex: 1; 
    background: #0d1117; 
    border: 1px solid #30363d; 
    color: #e6edf3; 
    padding: 8px 12px; 
    border-radius: 4px; 
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace; 
    font-size: 13px; 
}

.address-bar:focus { 
    outline: none; 
    border-color: #58a6ff; 
}

.go-btn { 
    background: #30363d; 
    border: 1px solid #3d444d; 
    color: #ffffff; 
    padding: 5px 10px; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 12px; 
    font-weight: 600; 
    transition: all 0.20s ease; 
}

.go-btn:hover { 
    background: #1ec735; 
}

.search-btn { 
    background: #30363d; 
    border: 1px solid #30363d; 
    color: #58a6ff; 
    padding: 6px 11px; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 15px; 
    font-weight: 600; 
    transition: all 0.30s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover { 
    background: #1ec735; 
}

.star-btn { 
    background: #30363d; 
    border: 1px solid #30363d; 
    color: #ffa657; 
    padding: 5px 10px; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 15px; 
    font-weight: 600;
    transition: all 0.30s ease; 
    min-width: 28px; 
    text-align: center; 
}

.star-btn:hover { 
    background: #030c04; 
    border-color: #ffa657; 
    color: #030c04;
}

.star-btn.favorited {
    border: 2px solid #fad42d;
    color: #0d1117;
}

.star-btn.favorited:hover {
    background: #110d09;
}

.star-btn.favorited img {
    filter: brightness(0) saturate(100%) invert(70%) sepia(98%) saturate(460%) hue-rotate(2deg) brightness(104%) contrast(101%);
}

.ping-btn { 
    background: #30363d; 
    border: 1px solid #30363d; 
    color: #58a6ff; 
    padding: 6px 11px; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 15px; 
    font-weight: 600; 
    transition: all 0.30s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ping-btn img {
    filter: invert(18%) sepia(89%) saturate(1690%) hue-rotate(195deg) brightness(153%) contrast(121%);
}

.ping-btn:hover { 
    background: #1ec735; 
    border-color: #58a6ff; 
}

.ping-btn:disabled { 
    background: #6e7681; 
    cursor: not-allowed; 
    opacity: 0.6; 
}

.fingerprint-btn { 
    background: #30363d; 
    border: 1px solid #30363d; 
    color: #ffffff; 
    padding: 6px 11px; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 15px; 
    font-weight: 600; 
    transition: all 0.30s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fingerprint-btn img {
    filter: invert(48%) sepia(89%) saturate(1690%) hue-rotate(195deg) brightness(153%) contrast(101%);
}

.fingerprint-btn:hover { 
    background: #1ec735; 
}

.fingerprint-btn:disabled { 
    background: #6e7681; 
    cursor: not-allowed; 
    opacity: 0.6; 
}

.info-btn-nav { 
    background: #30363d; 
    border: 1px solid #30363d; 
    color: #58a6ff; 
    padding: 6px 11px; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 15px; 
    font-weight: 600; 
    transition: all 0.30s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-btn-nav:hover { 
    background: #1ec735; 
    border-color: #58a6ff; 
}

.info-btn-nav:disabled { 
    background: #6e7681; 
    cursor: not-allowed; 
    opacity: 0.6; 
}

/* ============================================
   HEADER / PAGE INFO
   ============================================ */
.header {
    background: #21262d;
    padding: 12px 24px; 
    color: #f0f6fc;
    border-bottom: 1px solid #30363d;
    position: relative;
    height: 50px;
    min-height: 50px; 
    max-height: 50px; 
    flex-shrink: 0;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.page-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
    margin-right: 0;
    overflow: hidden;
}

.page-title {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #f0f6fc;
    margin: 0;
    margin-bottom: 4px;
}

.page-title .node-name {
    color: #f0f6fc;
    font-weight: 600;
}

.page-title .label {
    color: #7d8590;
    font-weight: normal;
}

.page-details {
    font-size: 13px;
    color: #7d8590;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-details .label,
.page-details .path-info,
.page-details .address-info {
    color: #7d8590;
    font-weight: normal;
}

.page-details .value {
    color: #f0f6fc;
    font-weight: 600;
}

.page-url {
    font-size: 13px;
    color: #7d8590;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-left: 8px;
}

.header-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.view-toggle {
    position: relative;
    top: auto;
    right: auto;
    transform: none;
    background: #21262d;
    border: 1px solid #30363d;
    color: #e6edf3;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.12s ease;
    z-index: 10;
    display: none;
    white-space: nowrap;
    min-width: 90px;
    text-align: center;
}

.view-toggle:hover {
    background: #30363d;
    border-color: #58a6ff;
}

.ascii-control {
    position: relative;
    top: auto;
    right: auto;
    transform: none;
    display: none;
    align-items: center;
    gap: 6px;
    z-index: 10;
}

.ascii-status {
    color: #e6edf3;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #30363d;
    transition: .3s;
    border-radius: 24px;
    border: 1px solid #58a6ff;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: #e6edf3;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #58a6ff;
}

input:checked + .slider:before {
    transform: translateX(16px);
}

input:disabled + .slider {
    cursor: not-allowed;
    opacity: 0.5;
}

.auto-reload-btn {
    position: relative;
    top: auto;
    right: auto;
    transform: none;
    background: #21262d;
    border: 1px solid #30363d;
    color: #e6edf3;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    z-index: 10;
    display: none;
    white-space: nowrap;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: auto;
    line-height: 1;
}

.auto-reload-btn:hover {
    background: #30363d;
    border-color: #58a6ff;
}

.auto-reload-btn.active {
    background: #238636;
    color: #ffffff;
    border-color: #2ea043;
    animation: pulse-reload 2s ease-in-out infinite;
}

.auto-reload-btn.active:hover {
    background: #2ea043;
}

@keyframes pulse-reload {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.reload-countdown {
    font-size: 11px;
    color: #ffffff;
    font-weight: 600;
    margin-left: 2px;
    line-height: 1;
}

/* ============================================
   BROWSER AREA / PAGE CONTENT
   ============================================ */
.browser-area { 
    flex: 1; 
    overflow-y: auto; 
    overflow-x: hidden;
    background: #0d1117; 
    position: relative;
    height: auto;
    min-height: 0;
}

.browser-area::-webkit-scrollbar {
    width: 12px;
    background: #0d1117;
}

.browser-area::-webkit-scrollbar-track {
    background: #161b22;
    border-radius: 6px;
    margin: 4px;
}

.browser-area::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 6px;
    border: 2px solid #161b22;
}

.browser-area::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

.browser-area {
    scrollbar-width: auto;
    scrollbar-color: #30363d #161b22;
}

.page-content {
    font-size: 15px;
    line-height: 1.2;
    letter-spacing: 0px;
    color: #e6edf3;
    background: #0d1117;
    padding: 5px;
    border-radius: 8px;
    border: 1px solid #21262d;
    min-height: 200px;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-family: 'Consolas', 'Courier New', 'Liberation Mono', monospace;
    font-weight: 600;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: unset;
    font-smooth: never;
    transition: all 0.2s ease;
    overflow: visible;
    display: block;
}

.page-content.ascii-optimized {
    font-size: 16px;
    line-height: 1.0;
}

.page-content.raw { 
    white-space: pre-wrap; 
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace; 
    overflow: auto;
}

.page-content a { 
    color: #58a6ff; 
    text-decoration: underline; 
    cursor: pointer; 
    transition: color 0.12s ease; 
}

.page-content a:hover { 
    color: #79c0ff; 
}

.page-content .nomadnet-link { 
    color: #58a6ff; 
    background: #0969da20; 
    padding: 2px 6px; 
    border-radius: 3px; 
    border: 1px solid #0969da40; 
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    margin: 1px 2px;
}

.page-content .nomadnet-link:hover { 
    background: #0969da40; 
    border-color: #0969da80; 
    color: #79c0ff;
    text-decoration: none;
}

mark {
    background-color: #ffd700;
    color: #0d1117;
    padding: 2px 4px;
    border-radius: 2px;
    font-weight: 600;
}

.error { 
    color: #ff7b72; 
    background: #490202; 
    padding: 20px; 
    border: 1px solid #da3633; 
    border-radius: 8px; 
}

.welcome { 
    text-align: center; 
    padding: 60px 40px; 
    color: #7d8590; 
}

.welcome h2 { 
    color: #f0f6fc; 
    font-size: 28px; 
    font-weight: 700; 
    margin-bottom: 16px; 
}

.welcome p { 
    font-size: 16px; 
    line-height: 1.6; 
    max-width: 500px; 
    margin: 0 auto; 
}

/* ============================================
   TABS
   ============================================ */
.tab-bar {
    background: #21262d;
    border-bottom: 1px solid #30363d;
    display: flex;
    align-items: center;
    padding: 8px 16px;
    overflow-x: auto;
    min-height: 48px;
    max-height: 48px;
    flex-shrink: 0;
    gap: 8px;
}

.tabs-container {
    display: flex;
    flex: 1;
    overflow-x: auto;
    gap: 2px;
    margin-right: 8px;
}

.tabs-container::-webkit-scrollbar {
    height: 4px;
}

.tabs-container::-webkit-scrollbar-track {
    background: #161b22;
}

.tabs-container::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 2px;
}

.tabs-container::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

.tab {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px 6px 0 0;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    min-width: 120px;
    max-width: 200px;
    user-select: none;
    transition: all 0.12s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab:hover {
    background: #21262d;
    border-color: #58a6ff;
}

.tab.active {
    background: #58a6ff;
    color: #0d1117;
    border-color: #58a6ff;
    font-weight: 600;
}

.tab-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
}

.tab-close {
    margin-left: 8px;
    font-weight: bold;
    font-size: 16px;
    opacity: 0.7;
    cursor: pointer;
    padding: 0 4px;
    border-radius: 2px;
    transition: all 0.12s ease;
}

.tab-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.tab.active .tab-close {
    color: #0d1117;
}

.tab.active .tab-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

.tab.loading .tab-title::after {
    content: '●';
    animation: pulse 1s infinite;
    margin-left: 4px;
}

@keyframes pulse {
    0%, 50% { opacity: 1; }
    25%, 75% { opacity: 0.3; }
}

.new-tab-btn {
    background: #161b22;
    border: 1px solid #30363d;
    color: #e6edf3;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 12px;
    flex-shrink: 0;
    transition: all 0.12s ease;
}

.new-tab-btn:hover {
    background: #21262d;
    border-color: #58a6ff;
    color: #58a6ff;
}

.search-tab-btn {
    background: #0969da;
    border: 1px solid #30363d;
    color: white;
    padding: 3px 7px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 12px;
    flex-shrink: 0;
    transition: all 0.12s ease;
}

.search-tab-btn:hover {
    background: #1f6feb;
    border: 1px solid #121416;
}

.tab-content-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.tab-content {
    display: none;
    flex-direction: column;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.tab-content.active {
    display: flex;
    position: relative;
}

#tab-content-template {
    display: none;
}

/* ============================================
   SEARCH RESULTS
   ============================================ */
#search-results::-webkit-scrollbar {
    width: 8px;
}

#search-results::-webkit-scrollbar-track {
    background: #161b22;
    border-radius: 4px;
}

#search-results::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
}

#search-results::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

/* ============================================
   SHORTCUTS BAR
   ============================================ */
.shortcuts-bar {
    position: fixed;
    bottom: 0;
    left: 50 !important;
    right: 0;
    background: #21262d;
    border-top: 1px solid #4f545a;
    padding: 4px 8px;
    font-size: 12px;
    color: #a3afbe;
    z-index: 1000;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.shortcut-item {
    white-space: nowrap;
}

.shortcut-item kbd {
    background: #30363d;
    border: 1px solid #5b6068;
    border-radius: 3px;
    padding: 1px 4px;
    font-size: 11px;
    font-family: monospace;
}

/* ============================================
   AUTO-RELOAD MODAL
   ============================================ */
.auto-reload-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auto-reload-dialog {
    background: #161b22;
    border: 2px solid #30363d;
    color: #e6edf3;
    padding: 24px;
    border-radius: 8px;
    max-width: 450px;
    min-width: 350px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.auto-reload-dialog h3 {
    margin: 0 0 20px 0;
    color: #58a6ff;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auto-reload-setting {
    margin-bottom: 16px;
    padding: 12px;
    background: #0d1117;
    border-radius: 6px;
    border: 1px solid #30363d;
}

.auto-reload-setting label {
    display: block;
    color: #e6edf3;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.auto-reload-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 24px;
    background: #30363d;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-switch.active {
    background: #3fb950;
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle-switch.active .toggle-slider {
    transform: translateX(24px);
}

.interval-input {
    width: 100%;
    padding: 8px 12px;
    background: #0d1117;
    border: 1px solid #30363d;
    color: #e6edf3;
    border-radius: 4px;
    font-size: 14px;
    margin-top: 8px;
}

.interval-input:focus {
    outline: none;
    border-color: #58a6ff;
}

.interval-presets {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.preset-btn {
    padding: 4px 10px;
    background: #21262d;
    border: 1px solid #30363d;
    color: #e6edf3;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.preset-btn:hover {
    background: #30363d;
    border-color: #58a6ff;
}

.auto-reload-info {
    padding: 10px;
    background: #1c2128;
    border-left: 3px solid #58a6ff;
    border-radius: 4px;
    font-size: 13px;
    color: #7d8590;
    margin-top: 12px;
}

.auto-reload-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 20px;
}

.auto-reload-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-cancel {
    background: #21262d;
    color: #e6edf3;
}

.btn-cancel:hover {
    background: #30363d;
}

.btn-save {
    background: #238636;
    color: white;
}

.btn-save:hover {
    background: #2ea043;
}

/* ============================================
   RESPONSIVE - DESKTOP SIZES
   ============================================ */

/* Large screens (1920px+) */
@media (min-width: 1920px) {
    .sidebar {
        width: 400px;
        min-width: 400px;
        max-width: 400px;
    }
    
    .content {
        width: calc(100vw - 400px);
        min-width: calc(100vw - 400px);
        max-width: calc(100vw - 400px);
    }
    
    .page-content {
        font-size: 16px;
        padding: 5px;
    }
}

/* Medium screens (1200px - 1440px) */
@media (min-width: 1200px) and (max-width: 1440px) {
    .sidebar {
        width: 280px;
        min-width: 280px;
        max-width: 280px;
    }
    
    .content {
        width: calc(100vw - 280px);
        min-width: calc(100vw - 280px);
        max-width: calc(100vw - 280px);
    }
    
    .nav-bar {
        padding: 8px 12px;
    }
    
    .address-bar {
        font-size: 12px;
    }
    
    .page-content {
        padding: 5px;
        font-size: 14px;
    }
}

/* Small laptops and tablets landscape (768px - 1199px) */
@media (min-width: 768px) and (max-width: 1199px) {
    .sidebar {
        width: 260px;
        min-width: 260px;
        max-width: 260px;
    }
    
    .content {
        width: calc(100vw - 260px);
        min-width: calc(100vw - 260px);
        max-width: calc(100vw - 260px);
    }
    
    .nav-bar {
        flex-wrap: wrap;
        height: auto;
        min-height: 60px;
    }
    
    .address-bar {
        flex: 1 1 100%;
        min-width: 100%;
        margin-bottom: 4px;
    }
    
    .page-title {
        font-size: 14px;
    }
    
    .page-details {
        font-size: 11px;
    }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */

/* Tablets portrait and large phones (481px - 767px) */
@media (min-width: 481px) and (max-width: 767px) {
    body {
        overflow: hidden;
    }
    
    .main {
        display: block;
        flex-direction: initial;
    }
    
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        width: 280px;
        min-width: 280px;
        max-width: 280px;
        height: 100vh;
        z-index: 2000;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0,0,0,0.5);
    }
    
    .sidebar.mobile-show {
        left: 0;
    }
    
    .content {
        position: fixed;
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        min-width: 100vw;
        max-width: 100vw;
        height: 100vh;
    }
    
    .nav-controls {
        display: none;
    }
    
    .shortcuts-bar {
        display: none;
    }
    
    .mobile-nodes-btn {
        display: block !important;
        background: #238636;
        border: 1px solid #2ea043;
        color: white;
        padding: 10px 12px;
        border-radius: 4px;
        font-size: 12px;
        font-weight: 600;
    }
}

/* Small phones (320px - 480px) */
@media (max-width: 480px) {
    .page-content {
        font-size: 13px;
        padding: 5px;
    }
    
    .tab {
        min-width: 70px;
        max-width: 100px;
        font-size: 11px;
    }
}

/* Mobile class-based detection for desktop browsers that support .mobile-device class */
.mobile-device body {
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.mobile-device .main {
    display: block !important;
    flex-direction: initial !important;
    height: 100vh !important;
    width: 100vw !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
}

.mobile-device .sidebar {
    position: fixed !important;
    left: -320px !important;
    top: 0 !important;
    width: 280px !important;
    min-width: 280px !important;
    max-width: 280px !important;
    height: 100vh !important;
    z-index: 2000 !important;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0,0,0,0.5);
}

.mobile-device .sidebar.mobile-show {
    left: 0 !important;
}

.mobile-device .content {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    min-width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    z-index: 1 !important;
}

.mobile-device .nav-controls {
    display: none !important;
}

.mobile-device .shortcuts-bar {
    display: none !important;
}

.mobile-device .mobile-nodes-btn {
    display: block !important;
}

/* Touch device optimization */
@media (hover: none) and (pointer: coarse) {
    * {
        box-sizing: border-box;
    }
    
    body {
        overflow: hidden;
        margin: 0;
        padding: 0;
    }
    
    .main {
        display: block !important;
        flex-direction: initial !important;
        height: 100vh !important;
        width: 100vw !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
    }
    
    .sidebar {
        position: fixed !important;
        left: -320px !important;
        top: 0 !important;
        width: 280px !important;
        min-width: 280px !important;
        max-width: 280px !important;
        height: 100vh !important;
        z-index: 2000 !important;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0,0,0,0.5);
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .sidebar.mobile-show {
        left: 0 !important;
    }
    
    .content {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        min-width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        z-index: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        padding: 0 !important;
        margin: 0 !important;
        transform: none !important;
    }
    
    .shortcuts-bar {
        display: none !important;
    }
    
    .mobile-nodes-btn {
        background: #238636;
        border: 1px solid #2ea043;
        color: white;
        padding: 10px 12px;
        cursor: pointer;
        border-radius: 4px;
        font-size: 12px;
        flex-shrink: 0;
        transition: all 0.12s ease;
        white-space: nowrap;
        font-weight: 600;
    }
    
    .mobile-nodes-btn:active {
        background: #2ea043;
    }
    
    .nav-controls {
        display: none !important;
    }
    
    .nav-bar {
        padding: 4px !important;
        height: auto !important;
        min-height: 48px !important;
        max-height: none !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 4px !important;
        flex-shrink: 0;
        width: 100% !important;
        align-items: center;
    }
    
    .address-bar {
        flex: 1 !important;
        width: auto !important;
        min-width: 0 !important;
        min-height: 44px;
        font-size: 16px;
        margin: 0 !important;
    }
    
    .go-btn, .star-btn, .fingerprint-btn,
    .search-btn, .ping-btn, .info-btn-nav {
        min-height: 44px !important;
        max-height: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
        padding: 10px !important;
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .go-btn img, .search-btn img, .star-btn img,
    .ping-btn img, .fingerprint-btn img, .info-btn-nav img {
        width: 20px !important;
        height: 20px !important;
        object-fit: contain !important;
    }
    
    .tab-bar {
        padding: 4px;
        flex-shrink: 0;
        width: 100% !important;
        min-height: 52px !important;
        max-height: 52px !important;
        display: flex;
        gap: 4px;
    }
    
    .tabs-container {
        flex: 1;
        overflow-x: auto;
    }
    
    .tab {
        min-width: 90px;
        max-width: 120px;
        padding: 10px 8px;
        font-size: 12px;
    }
    
    .tab-close {
        padding: 4px 8px;
        font-size: 16px;
    }
    
    .new-tab-btn, .search-tab-btn {
        display: none !important;
    }
    
    .tab-content-wrapper {
        flex: 1;
        overflow: hidden;
        width: 100% !important;
        position: relative !important;
    }
    
    .tab-content {
        width: 100% !important;
        height: 100% !important;
    }
    
    .header {
        padding: 6px !important;
        height: auto !important;
        min-height: 40px !important;
        max-height: none !important;
        flex-shrink: 0;
        width: 100% !important;
    }
    
    .page-info {
        flex-direction: column;
        gap: 2px;
    }
    
    .page-title {
        font-size: 13px;
    }
    
    .page-details {
        font-size: 11px;
    }
    
    .view-toggle {
        position: relative;
        top: auto;
        right: auto;
        transform: none;
        margin-top: 4px;
    }
    
    .browser-area {
        flex: 1;
        overflow-y: auto;
        width: 100% !important;
    }
    
    .page-content {
        padding: 5px;
        font-size: 14px;
        word-wrap: break-word;
        overflow-wrap: break-word;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .node-item {
        padding: 12px;
        margin-bottom: 4px;
    }
    
    .browse-btn, .info-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 8px;
    }
    
    .sidebar .node-item .star-btn,
    .sidebar .node-item .info-btn {
        display: none !important;
    }
    
    html {
        position: fixed !important;
        overflow: hidden !important;
        width: 100% !important;
        height: 100% !important;
    }
    
    body {
        position: fixed !important;
        overflow: hidden !important;
        width: 100% !important;
        height: 100% !important;
        margin: 0;
        padding: 0;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: none;
    }
    
    .main {
        overscroll-behavior: none !important;
        -webkit-overflow-scrolling: touch;
    }
    
    .browser-area {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    
    .sidebar {
        overscroll-behavior: contain !important;
    }
    
    .node-list-container {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
}

@media (max-width: 1499px) {
    .shortcuts-bar {
        display: none !important;
    }
}

/* Ubuntu Touch / Morph Browser specific fixes */
@media (max-width: 767px) {
    /* Force proper viewport handling */
    html {
        position: fixed !important;
        overflow: hidden !important;
        width: 100% !important;
        height: 100% !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    body {
        position: fixed !important;
        overflow: hidden !important;
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Ensure main container fills screen */
    .main {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        overflow: hidden !important;
    }
    
    /* Fix content area */
    .content {
        position: fixed !important;
        width: 100vw !important;
        height: 100vh !important;
        left: 0 !important;
        top: 0 !important;
    }
    
    /* Sidebar mobile positioning */
    .sidebar {
        position: fixed !important;
        left: -320px !important;
        top: 0 !important;
        height: 100vh !important;
        width: 280px !important;
        z-index: 2000 !important;
        transition: left 0.3s ease;
    }
    
    .sidebar.mobile-show {
        left: 0 !important;
    }
}

/* Additional fixes for touch-based browsers */
@supports (-webkit-touch-callout: none) {
    body {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
    
    html {
        height: -webkit-fill-available;
    }
}

@media (max-width: 767px) {
    body {
        overflow: hidden;
        margin: 0;
        padding: 0;
    }
    
    .main {
        display: block !important;
        flex-direction: initial !important;
        height: 100vh !important;
        width: 100vw !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
    }
    
    .sidebar {
        position: fixed !important;
        left: -320px !important;
        top: 0 !important;
        width: 280px !important;
        min-width: 280px !important;
        max-width: 280px !important;
        height: 100vh !important;
        z-index: 2000 !important;
        transition: left 0.3s ease;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .sidebar.mobile-show {
        left: 0 !important;
    }
    
    .content {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        min-width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        z-index: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        padding: 0 !important;
        margin: 0 !important;
        transform: none !important;
    }
    
    .shortcuts-bar {
        display: none !important;
    }
    
    .mobile-nodes-btn {
        background: #238636;
        border: 1px solid #2ea043;
        color: white;
        padding: 10px 12px;
        cursor: pointer;
        border-radius: 4px;
        font-size: 12px;
        flex-shrink: 0;
        transition: all 0.12s ease;
        white-space: nowrap;
        font-weight: 600;
    }
    
    .mobile-nodes-btn:active {
        background: #2ea043;
    }
    
    .nav-controls {
        display: none !important;
    }
    
    .nav-bar {
        padding: 4px !important;
        height: auto !important;
        min-height: 48px !important;
        max-height: none !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 4px !important;
        flex-shrink: 0;
        width: 100% !important;
        align-items: center;
    }
    
    .address-bar {
        flex: 1 !important;
        width: auto !important;
        min-width: 0 !important;
        min-height: 44px;
        font-size: 16px;
        margin: 0 !important;
    }
    
    .go-btn, .star-btn, .fingerprint-btn,
    .search-btn, .ping-btn, .info-btn-nav {
        min-height: 44px !important;
        max-height: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
        padding: 10px !important;
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .go-btn img, .search-btn img, .star-btn img,
    .ping-btn img, .fingerprint-btn img, .info-btn-nav img {
        width: 20px !important;
        height: 20px !important;
        object-fit: contain !important;
    }
    
    .tab-bar {
        padding: 4px;
        flex-shrink: 0;
        width: 100% !important;
        min-height: 52px !important;
        max-height: 52px !important;
        display: flex;
        gap: 4px;
    }
    
    .tabs-container {
        flex: 1;
        overflow-x: auto;
    }
    
    .tab {
        min-width: 90px;
        max-width: 120px;
        padding: 10px 8px;
        font-size: 12px;
    }
    
    .tab-close {
        padding: 4px 8px;
        font-size: 16px;
    }
    
    .new-tab-btn, .search-tab-btn {
        display: none !important;
    }
    
    .tab-content-wrapper {
        flex: 1;
        overflow: hidden;
        width: 100% !important;
        position: relative !important;
    }
    
    .tab-content {
        width: 100% !important;
        height: 100% !important;
    }
    
    .header {
        padding: 6px !important;
        height: auto !important;
        min-height: 40px !important;
        max-height: none !important;
        flex-shrink: 0;
        width: 100% !important;
    }
    
    .page-info {
        flex-direction: column;
        gap: 2px;
    }
    
    .page-title {
        font-size: 13px;
    }
    
    .page-details {
        font-size: 11px;
    }
    
    .view-toggle {
        position: relative;
        top: auto;
        right: auto;
        transform: none;
        margin-top: 4px;
    }
    
    .browser-area {
        flex: 1;
        overflow-y: auto;
        width: 100% !important;
    }
    
    .page-content {
        padding: 5px;
        font-size: 14px;
        word-wrap: break-word;
        overflow-wrap: break-word;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .node-item {
        padding: 12px;
        margin-bottom: 4px;
    }
    
    .browse-btn, .info-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 8px;
    }
    
    .sidebar .node-item .star-btn,
    .sidebar .node-item .info-btn {
        display: none !important;
    }
    
    html {
        position: fixed !important;
        overflow: hidden !important;
        width: 100% !important;
        height: 100% !important;
    }
    
    body {
        position: fixed !important;
        overflow: hidden !important;
        width: 100% !important;
        height: 100% !important;
        margin: 0;
        padding: 0;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: none;
    }
    
    .main {
        overscroll-behavior: none !important;
        -webkit-overflow-scrolling: touch;
    }
    
    .browser-area {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    
    .sidebar {
        overscroll-behavior: contain !important;
    }
    
    .node-list-container {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    
    /* Force proper viewport handling for mobile */
    html {
        position: fixed !important;
        overflow: hidden !important;
        width: 100% !important;
        height: 100% !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    body {
        position: fixed !important;
        overflow: hidden !important;
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Ensure main container fills screen */
    .main {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        overflow: hidden !important;
    }
    
    /* Fix content area */
    .content {
        position: fixed !important;
        width: 100vw !important;
        height: 100vh !important;
        left: 0 !important;
        top: 0 !important;
    }
    
    /* Sidebar mobile positioning */
    .sidebar {
        position: fixed !important;
        left: -320px !important;
        top: 0 !important;
        height: 100vh !important;
        width: 280px !important;
        z-index: 2000 !important;
        transition: left 0.3s ease;
    }
    
    .sidebar.mobile-show {
        left: 0 !important;
    }
}
