    * { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      --bg: #0a0a0a;
      --bg2: #111111;
      --surface: rgba(20, 20, 20, 0.7);
      --surface-hover: rgba(30, 30, 30, 0.85);
      --border: rgba(255, 255, 255, 0.08);
      --border-hover: rgba(255, 255, 255, 0.12);
      --text: #fafafa;
      --muted: #a1a1aa;
      --accent: #3b82f6;
      --accent-hover: #60a5fa;
      --green: #10b981;
      --red: #ef4444;
      --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
      --radius: 12px;
    }

    html, body {
      width: 100%;
      height: 100%;
      overflow: hidden;
      font-family: Inter, system-ui, -apple-system, sans-serif;
      color: var(--text);
      background: var(--bg);
      position: relative;
    }

    #background {
      position: fixed;
      inset: 0;
      background-size: cover;
      background-position: center;
      background-repeat: no-repeat;
      opacity: 0;
      transition: opacity 0.6s ease;
      z-index: 0;
    }

    #background.loaded {
      opacity: 0.65;
    }

    body::after {
      content: '';
      position: fixed;
      inset: 0;
      background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.4) 100%);
      z-index: 0;
      pointer-events: none;
    }

    #browser {
      position: relative;
      z-index: 1;
      width: 100%;
      height: 100%;
      display: flex;
      flex-direction: column;
      gap: 8px;
      padding: 12px;
    }

    .glass {
      background: var(--surface);
      backdrop-filter: blur(20px) saturate(180%);
      -webkit-backdrop-filter: blur(20px) saturate(180%);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
    }

    #tab-row {
      display: flex;
      align-items: center;
      min-height: 42px;
      padding: 0 6px;
      gap: 6px;
    }

    #tabs-list {
      display: flex;
      align-items: stretch;
      gap: 4px;
      overflow-x: auto;
      flex: 1;
      scrollbar-width: none;
    }
    #tabs-list::-webkit-scrollbar { display: none; }

    .tab {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 130px;
      max-width: 240px;
      padding: 6px 10px;
      border-radius: 8px;
      border: none;
      background: transparent;
      color: var(--muted);
      cursor: pointer;
      user-select: none;
      transition: all 0.15s cubic-bezier(0.2, 0, 0.2, 1);
    }

    .tab:hover {
      background: rgba(255, 255, 255, 0.05);
      color: var(--text);
    }

    .tab.active {
      background: var(--surface-hover);
      color: var(--text);
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }

    .tab-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 500; }
    .tab-fav { width: 16px; text-align: center; font-size: 12px; }
    .tab-fav img { width: 16px; height: 16px; object-fit: contain; border-radius: 2px; }

    .tab-close {
      border: 0;
      width: 20px;
      height: 20px;
      border-radius: 4px;
      background: transparent;
      color: inherit;
      cursor: pointer;
      opacity: 0.6;
      margin-left: auto;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.1s ease;
    }
    .tab:hover .tab-close, .tab-close:hover { opacity: 1; background: rgba(255, 255, 255, 0.1); }

    .action-btn {
      width: 32px;
      height: 32px;
      border-radius: 8px;
      border: none;
      background: transparent;
      color: var(--muted);
      cursor: pointer;
      flex-shrink: 0;
      transition: all 0.15s ease;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 15px;
    }
    .action-btn:hover:not(:disabled) {
      color: var(--text);
      background: rgba(255, 255, 255, 0.08);
    }
    .action-btn:disabled { opacity: 0.4; cursor: default; }

    #toolbar {
      display: grid;
      grid-template-columns: auto auto auto minmax(120px, 1fr) auto auto auto;
      gap: 6px;
      align-items: center;
      padding: 6px 8px;
    }

    #address-bar, #search-engine {
      height: 34px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: rgba(255, 255, 255, 0.04);
      color: var(--text);
      outline: none;
      transition: all 0.15s ease;
    }

    #address-bar {
      width: 100%;
      padding: 0 12px;
      font-size: 13px;
      font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    }

    #address-bar:focus {
      border-color: var(--accent);
      background: rgba(255, 255, 255, 0.06);
    }

    #search-engine {
      padding: 0 8px;
      font-size: 12px;
      min-width: 110px;
      cursor: pointer;
    }
    #search-engine option { background: #1a1a1a; }

    #content {
      position: relative;
      flex: 1;
      min-height: 0;
      border-radius: var(--radius);
      border: 1px solid var(--border);
      overflow: hidden;
      background: rgba(0, 0, 0, 0.3);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
    }

    .tab-frame {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      border: 0;
      display: none;
      background: #fff;
    }

    #newtab {
      position: absolute;
      inset: 0;
      overflow: auto;
      display: grid;
      place-items: center;
      padding: 24px;
    }

    .hero {
      width: min(720px, 100%);
      border-radius: 16px;
      border: 1px solid var(--border);
      background: rgba(20, 20, 20, 0.6);
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
      backdrop-filter: blur(24px);
      -webkit-backdrop-filter: blur(24px);
      padding: 32px;
      display: flex;
      flex-direction: column;
      gap: 24px;
    }

    .logo { font-family: Inter, sans-serif; font-weight: 700; letter-spacing: -0.02em; font-size: clamp(1.6rem, 3vw, 2.2rem); }
    .logo strong { color: var(--accent); }
    .subtitle { color: var(--muted); font-size: 0.95rem; line-height: 1.5; }

    #nt-form { display: flex; gap: 8px; }
    #nt-input {
      flex: 1;
      height: 48px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: rgba(255, 255, 255,.05);
      color: var(--text);
      padding: 0 16px;
      font-size: 15px;
      outline: none;
      transition: all 0.15s ease;
    }

    #nt-input:focus {
      border-color: var(--accent);
      background: rgba(255, 255, 255, 0.08);
    }

    #nt-go {
      min-width: 100px;
      border-radius: 10px;
      border: none;
      background: var(--accent);
      color: #fff;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.15s ease;
      font-size: 14px;
    }
    #nt-go:hover:not(:disabled) { background: var(--accent-hover); }
    #nt-go:disabled { opacity: 0.5; cursor: default; }

    .quick-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
      gap: 8px;
    }

    .quick-link {
      border: 1px solid var(--border);
      border-radius: 10px;
      background: rgba(255, 255, 255,.03);
      color: var(--text);
      min-height: 56px;
      display: grid;
      place-items: center;
      cursor: pointer;
      text-align: center;
      font-size: 0.9rem;
      padding: 12px 8px;
      transition: all 0.15s ease;
      font-weight: 500;
    }
    .quick-link:hover {
      border-color: var(--border-hover);
      background: rgba(255, 255, 255, 0.06);
      transform: translateY(-1px);
    }

    #status {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      border-radius: 999px;
      width: fit-content;
      padding: 8px 14px;
      font-size: 12px;
      border: 1px solid var(--border);
      font-weight: 500;
    }

    #status[data-state="loading"] { color: #fbbf24; background: rgba(251, 191, 36, 0.1); }
    #status[data-state="ready"] { color: var(--green); background: rgba(16, 185, 129, 0.1); }
    #status[data-state="error"] { color: var(--red); background: rgba(239, 68, 68, 0.1); }

    .dot {
      width: 6px;
      height: 6px;
      border-radius: 999px;
      background: currentColor;
      animation: pulse 2s infinite;
    }

    @keyframes pulse {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.4; }
    }

    #toast {
      position: fixed;
      left: 50%;
      bottom: 20px;
      transform: translateX(-50%) translateY(10px);
      z-index: 9999;
      min-width: 220px;
      max-width: min(600px, calc(100vw - 32px));
      padding: 12px 16px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: rgba(20, 20, 20, 0.95);
      color: var(--text);
      box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
      opacity: 0;
      pointer-events: none;
      transition: all 0.2s ease;
      text-align: center;
      font-size: 13px;
      font-weight: 500;
    }

    #toast.show {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }

    #toast.error {
      color: #fca5a5;
      background: rgba(127, 29, 29, 0.9);
    }

    #settings-btn.active ~ #settings-overlay {
      display: block;
    }

    #settings-overlay {
      position: fixed;
      inset: 0;
      z-index: 998;
      display: none;
      background: rgba(0, 0, 0, 0.4);
    }

    #settings-panel {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%) scale(0.95);
      z-index: 999;
      width: min(420px, calc(100vw - 32px));
      max-height: 80vh;
      padding: 0;
      opacity: 0;
      pointer-events: none;
      transition: all 0.2s ease;
    }

    #settings-panel.active {
      opacity: 1;
      pointer-events: auto;
      transform: translate(-50%, -50%) scale(1);
    }

    .settings-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 16px 20px;
      border-bottom: 1px solid var(--border);
    }

    .settings-header h3 {
      font-size: 16px;
      font-weight: 600;
    }

    .settings-section {
      padding: 20px;
    }

    .settings-label {
      display: block;
      font-size: 13px;
      font-weight: 500;
      color: var(--muted);
      margin-bottom: 12px;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }

    .background-options {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 8px;
      margin-bottom: 16px;
    }

    .bg-option {
      padding: 12px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: rgba(255, 255, 255, 0.03);
      color: var(--text);
      cursor: pointer;
      transition: all 0.15s ease;
      font-size: 14px;
      font-weight: 500;
    }

    .bg-option:hover {
      background: rgba(255, 255, 255, 0.06);
    }

    .bg-option.active {
      background: var(--accent);
      border-color: var(--accent);
      color: white;
    }

    .refresh-btn {
      width: 100%;
      padding: 12px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: rgba(255, 255, 255, 0.03);
      color: var(--text);
      cursor: pointer;
      transition: all 0.15s ease;
      font-size: 14px;
      font-weight: 500;
    }

    .refresh-btn:hover {
      background: rgba(255, 255, 255, 0.06);
    }

    .custom-bg-section {
      display: flex;
      gap: 8px;
      margin-bottom: 16px;
    }

    #custom-bg-input {
      flex: 1;
      height: 40px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: rgba(255, 255, 255, 0.04);
      color: var(--text);
      padding: 0 12px;
      font-size: 13px;
      outline: none;
      transition: all 0.15s ease;
    }

    #custom-bg-input:focus {
      border-color: var(--accent);
      background: rgba(255, 255, 255, 0.06);
    }

    .apply-custom-btn {
      min-width: 80px;
      height: 40px;
      border-radius: 8px;
      border: none;
      background: var(--accent);
      color: #fff;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.15s ease;
      font-size: 13px;
    }

    .apply-custom-btn:hover {
      background: var(--accent-hover);
    }

    @media (max-width: 800px) {
      #browser { padding: 8px; gap: 6px; }
      #toolbar {
        grid-template-columns: auto auto auto minmax(80px, 1fr) auto auto;
      }
      #search-engine { display: none; }
      .hero { padding: 20px; }
      #nt-go { min-width: 80px; }
      .background-options {
        grid-template-columns: 1fr;
      }
      .custom-bg-section {
        flex-direction: column;
      }
      .apply-custom-btn {
        width: 100%;
      }
    }
