:root {
    --bg-color: #0e0e10;
    --fg-color: white;
    --card-bg: #18181b;
    --btn-bg: #464649;
    --btn-danger: #ff4d4d;
    --btn-accent: #9147ff;
    --twitch-color: #9147ff;
    --youtube-color: #ff0000;
    --kick-color: #53fc18;
    --sidebar-width: 320px;
    --transition-speed: 0.3s;
  }

  /* Ensure no left sidebar exists */
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  /* Force platform select to be properly sized */
  .platform-select,
  .platform-select option {
    max-height: 36px !important;
    line-height: 1.2 !important;
    overflow: hidden !important;
  }

  body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-color);
    color: var(--fg-color);
    height: 100vh;
    overflow: auto;
    position: relative;
  }

  /* Prevent scrolling when streams are active */
  body.streams-active {
    overflow: hidden !important;
    height: 100vh !important;
    position: fixed !important;
    width: 100% !important;
  }

  html:has(body.streams-active) {
    overflow: hidden !important;
    height: 100vh !important;
  }

  /* Additional safeguard for webkit browsers */
  body.streams-active, body.streams-active * {
    -webkit-overflow-scrolling: auto !important;
  }

  /* Centered Welcome Interface (shown when no streams) */
  .welcome-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-color) 0%, #1a1a2e 50%, var(--bg-color) 100%);
    z-index: 1000;
    transition: opacity var(--transition-speed), visibility var(--transition-speed);
  }

  .welcome-container.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    display: none !important; /* Completely remove from layout when hidden */
  }

  /* SEO Content Container */
  .seo-content {
    position: absolute;
    top: 60vh;
    left: 0;
    width: 100%;
    min-height: 40vh;
    background: var(--bg-color);
    overflow-y: visible;
    padding-top: 20px;
    padding-bottom: 40px;
    z-index: 999; /* Just below welcome container */
    transition: opacity var(--transition-speed), visibility var(--transition-speed);
    scroll-behavior: smooth;
  }

  .seo-content.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    display: none !important; /* Completely remove from layout when hidden */
    transform: translateY(100vh) !important; /* Move completely off screen */
    z-index: -1 !important; /* Ensure it's behind everything */
  }

  .welcome-content {
    text-align: center;
    max-width: 500px;
    padding: 40px;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .brand-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
  }

  .brand-logo {
    width: 48px;
    height: 48px;
    filter: brightness(1.2) contrast(1.1);
    transition: transform 0.3s ease;
  }

  .brand-logo:hover {
    transform: scale(1.1) rotate(5deg);
  }

  .welcome-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0; /* No bottom margin since it's in brand-header now */
    background: linear-gradient(45deg, var(--twitch-color), var(--youtube-color), var(--kick-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .welcome-subtitle {
    font-size: 1.3rem;
    margin-bottom: 10px;
    opacity: 0.9;
    line-height: 1.5;
    color: var(--fg-color);
    font-weight: 600;
  }

  .welcome-tagline {
    font-size: 1rem;
    margin-bottom: 30px;
    opacity: 0.7;
    line-height: 1.5;
    color: var(--fg-color);
    font-weight: 400;
  }

  .welcome-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

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

  .form-label {
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.9;
  }

  .input-row {
    display: flex;
    gap: 10px;
  }

  .platform-select {
    flex: 0 0 120px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: var(--btn-bg);
    color: var(--fg-color);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
    height: 36px;
    line-height: 1.2;
    vertical-align: top;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="white" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 10px;
    padding-right: 28px;
  }

  .platform-select:focus {
    border-color: var(--btn-accent);
    box-shadow: 0 0 0 3px rgba(145, 71, 255, 0.1);
  }

  .stream-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: var(--btn-bg);
    color: var(--fg-color);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
    height: 36px;
    line-height: 1.2;
    vertical-align: top;
  }

  .stream-input:focus {
    border-color: var(--btn-accent);
    box-shadow: 0 0 0 3px rgba(145, 71, 255, 0.1);
  }

  .stream-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
  }

  .add-button {
    padding: 12px 24px;
    background: linear-gradient(45deg, var(--btn-accent), #772ce8);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .add-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(145, 71, 255, 0.3);
  }

  .add-button:active {
    transform: translateY(0);
  }

  /* SEO Content Sections */
  .benefits-section,
  .how-it-works,
  .faq-section {
    max-width: 800px;
    margin: 40px auto 0;
    padding: 0 20px;
    text-align: left;
  }

  .benefits-section h2,
  .how-it-works h2,
  .faq-section h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: var(--fg-color);
    font-weight: 700;
  }

  /* Benefits Grid */
  .benefit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
  }

  .benefit-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
  }

  .benefit-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  }

  .benefit-item i {
    font-size: 2.5rem;
    color: var(--btn-accent);
    margin-bottom: 15px;
    display: block;
  }

  .benefit-item h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: var(--fg-color);
    font-weight: 600;
  }

  .benefit-item p {
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.8;
    margin: 0;
  }

  /* How It Works Steps */
  .steps-list {
    list-style: none;
    padding: 0;
    margin: 30px 0;
  }

  .steps-list li {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
  }

  .steps-list li:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
  }

  .step-number {
    width: 40px;
    height: 40px;
    background: var(--btn-accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    margin-right: 20px;
    flex-shrink: 0;
  }

  .step-text {
    font-size: 1.1rem;
    line-height: 1.5;
    color: var(--fg-color);
  }

  /* FAQ Section */
  .faq-item {
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
  }

  .faq-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
  }

  .faq-item h3 {
    font-size: 1.15rem;
    margin-bottom: 12px;
    color: var(--fg-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .faq-item h3 i {
    color: var(--btn-accent);
    font-size: 1rem;
  }

  .faq-item p {
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0.85;
    margin: 0;
  }

  /* Sidebar (shown when streams exist) - RIGHT SIDE ONLY */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    right: -var(--sidebar-width) !important;
    left: auto !important; /* Force no left positioning */
    width: var(--sidebar-width) !important;
    height: 100% !important;
    background: var(--card-bg) !important;
    border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-right: none !important;
    z-index: 500 !important;
    transition: right var(--transition-speed) ease !important;
    overflow-y: auto !important;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2) !important;
    transform: translateX(0) !important; /* Reset any transforms */
  }

  .sidebar.active {
    right: 0 !important;
    left: auto !important; /* Ensure no left positioning */
  }

  /* Completely prevent any left-positioned elements */
  .sidebar {
    margin-left: 0 !important;
    transform: none !important;
  }

  /* Override any inherited positioning */
  #sidebar {
    position: fixed !important;
    top: 0 !important;
    right: -var(--sidebar-width) !important;
    left: auto !important;
    width: var(--sidebar-width) !important;
  }

  #sidebar.active {
    right: 0 !important;
    left: auto !important;
  }

  /* Chat Sidebar */
  .chat-sidebar {
    position: fixed !important;
    top: 0 !important;
    right: -var(--sidebar-width) !important;
    left: auto !important;
    width: var(--sidebar-width) !important;
    height: 100% !important;
    background: var(--card-bg) !important;
    border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-right: none !important;
    z-index: 499 !important; /* Lower than settings sidebar */
    transition: right var(--transition-speed) ease !important;
    overflow: hidden !important;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2) !important;
    transform: translateX(0) !important;
    display: flex !important;
    flex-direction: column !important;
    margin-left: 0 !important; /* Ensure no left margin */
    margin-right: 0 !important;
  }

  .chat-sidebar.active {
    right: 0 !important;
    left: auto !important;
  }

  /* Force chat sidebar to never appear on left */
  #chatSidebar {
    position: fixed !important;
    top: 0 !important;
    right: -var(--sidebar-width) !important;
    left: auto !important;
    width: var(--sidebar-width) !important;
    margin-left: 0 !important;
    transform: none !important;
  }

  #chatSidebar.active {
    right: 0 !important;
    left: auto !important;
  }

  .chat-sidebar-header {
    padding: 4px 20px; /* Reduced from 8px to 4px - half the height */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
  }

  .chat-sidebar-title {
    font-size: 1rem; /* Reduced from 1.2rem for more compact header */
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px; /* Reduced from 8px for more compact layout */
  }

  .chat-sidebar-close {
    background: transparent;
    border: none;
    color: var(--fg-color);
    font-size: 1rem; /* Reduced from 1.2rem for more compact header */
    cursor: pointer;
    padding: 4px; /* Reduced from 5px */
    border-radius: 4px; /* Reduced from 5px */
    transition: background 0.2s ease;
  }

  .chat-sidebar-close:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  .chat-tabs {
    display: flex;
    overflow-x: auto;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--btn-bg) transparent;
  }

  .chat-tabs::-webkit-scrollbar {
    height: 6px;
  }

  .chat-tabs::-webkit-scrollbar-track {
    background: transparent;
  }

  .chat-tabs::-webkit-scrollbar-thumb {
    background: var(--btn-bg);
    border-radius: 3px;
  }

  .chat-tab {
    display: flex;
    align-items: center;
    gap: 6px; /* Reduced from 8px for more compact layout */
    padding: 6px 16px; /* Reduced from 12px to 6px - half the height */
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    font-size: 0.8rem; /* Reduced from 0.9rem for more compact tabs */
    min-width: 100px; /* Reduced from 120px for more compact tabs */
    flex-shrink: 0;
  }

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

  .chat-tab.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--fg-color);
    border-bottom-color: var(--btn-accent);
  }

  .chat-tab-platform {
    width: 6px; /* Reduced from 8px for more compact tabs */
    height: 6px; /* Reduced from 8px for more compact tabs */
    border-radius: 50%;
    flex-shrink: 0;
  }

  .chat-tab-platform.twitch { background: var(--twitch-color); }
  .chat-tab-platform.youtube { background: var(--youtube-color); }
  .chat-tab-platform.kick { background: var(--kick-color); }

  .chat-tab-name {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60px; /* Reduced from 80px for more compact tabs */
  }

  .chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .chat-iframe-container {
    flex: 1;
    display: none;
    position: relative;
  }

  .chat-iframe-container.active {
    display: flex;
    flex-direction: column;
  }

  .chat-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: var(--bg-color);
  }

  .chat-no-streams {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    padding: 40px 20px;
    flex-direction: column;
    gap: 15px;
  }

  .chat-no-streams i {
    font-size: 2rem;
    opacity: 0.5;
    margin-bottom: 10px;
  }

  .sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .sidebar-title {
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .sidebar-logo {
    width: 24px;
    height: 24px;
    filter: brightness(1.2) contrast(1.1);
    transition: transform 0.2s ease;
    flex-shrink: 0;
  }

  .sidebar-brand {
    font-size: 1rem;
    font-weight: 600;
    color: var(--fg-color);
    white-space: nowrap;
  }

  .sidebar-close {
    background: transparent;
    border: none;
    color: var(--fg-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: background 0.2s ease;
  }

  .sidebar-close:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  .sidebar-content {
    padding: 20px;
  }

  .sidebar-section {
    margin-bottom: 25px;
  }

  .sidebar-section h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .sidebar .form-group {
    margin-bottom: 15px;
  }

  /* Proportional input row for streamlined add stream section */
  .proportional-input-row {
    display: flex;
    gap: 4px;
    align-items: center;
    margin-top: 10px;
  }

  /* Custom dropdown with icons for platform selection */
  .custom-select.compact {
    flex: 0 0 18%;
    position: relative;
    background: var(--bg-color);
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    color: var(--fg-color);
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .custom-select.compact:focus-within {
    border-color: var(--btn-accent);
    box-shadow: 0 0 0 2px rgba(145, 71, 255, 0.1);
  }

  .custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 4px;
    height: 100%;
    font-size: 0.8rem;
  }

  .platform-icon {
    color: var(--fg-color);
    font-size: 0.9rem;
    transition: color 0.2s ease;
  }

  /* Platform-specific colors for selected icon */
  .platform-icon.twitch {
    color: var(--twitch-color);
  }

  .platform-icon.youtube {
    color: var(--youtube-color);
  }

  .platform-icon.kick {
    color: var(--kick-color);
  }

  .dropdown-arrow {
    font-size: 0.6rem;
    opacity: 0.7;
    transition: transform 0.2s ease;
  }

  .custom-select.open .dropdown-arrow {
    transform: rotate(180deg);
  }

  .custom-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    margin-top: 2px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }

  .custom-select.open .custom-select-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .custom-option {
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 0.9rem;
    padding-left: 12px;
  }

  .custom-option:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  .custom-option:first-child {
    border-radius: 5px 5px 0 0;
  }

  .custom-option:last-child {
    border-radius: 0 0 5px 5px;
  }

  /* Platform-specific icon colors */
  .custom-option[data-value="twitch"] i {
    color: var(--twitch-color);
  }

  .custom-option[data-value="youtube"] i {
    color: var(--youtube-color);
  }

  .custom-option[data-value="kick"] i {
    color: var(--kick-color);
  }

  .stream-input.compact {
    flex: 0 0 42%;
    background: var(--bg-color);
    height: 32px;
    padding: 6px 8px;
    font-size: 0.8rem;
    line-height: 1.2;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    color: var(--fg-color);
    outline: none;
    transition: all 0.2s ease;
  }

  .stream-input.compact:focus {
    border-color: var(--btn-accent);
    box-shadow: 0 0 0 2px rgba(145, 71, 255, 0.1);
  }

  .stream-input.compact::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
  }

  .add-stream-btn {
    flex: 0 0 14%;
    height: 32px;
    background: var(--btn-accent);
    border: 1px solid var(--btn-accent);
    border-radius: 5px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 26px;
  }

  .add-stream-btn:hover {
    background: #772ce8;
    transform: scale(1.05);
  }

  .add-stream-btn:active {
    transform: scale(0.95);
  }

  .sidebar .platform-select,
  .sidebar .stream-input {
    background: var(--bg-color);
    height: 36px;
    padding: 8px 12px;
    font-size: 0.9rem;
    line-height: 1.2;
    vertical-align: top;
  }

  .sidebar .platform-select {
    padding-right: 28px;
  }

  .control-buttons {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
  }

  .icon-button {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    position: relative;
  }

  .icon-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }

  .icon-button.danger {
    background: var(--btn-danger);
    color: white;
  }

  .icon-button.primary {
    background: var(--btn-accent);
    color: white;
  }

  .icon-button.secondary {
    background: var(--btn-bg);
    color: var(--fg-color);
  }

  .tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    margin-bottom: 5px;
    z-index: 1000;
  }

  .icon-button:hover .tooltip {
    opacity: 1;
    visibility: visible;
  }

  .timer-select {
    background: var(--bg-color);
    color: var(--fg-color);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.9rem;
    height: 36px;
    width: 100%;
    margin-top: 8px;
  }

  /* Layout controls row for columns and alignment dropdowns */
  .layout-controls-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
  }

  .form-group.half-width {
    flex: 1;
    min-width: 0;
  }

  .form-group.half-width .timer-select {
    width: 100%;
  }

  .stream-list {
    margin-top: 15px;
  }

  .stream-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    cursor: default;
  }

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

  .stream-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px;
    margin: 2px 0;
  }

  .stream-item.drag-over {
    border-top: 2px solid var(--btn-accent);
    padding-top: 6px;
  }

  .stream-item-drag-handle {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    margin-right: 8px;
    font-size: 0.8rem;
    color: var(--fg-color);
  }

  .stream-item-drag-handle:hover {
    opacity: 1;
  }

  .stream-item-drag-handle:active {
    cursor: grabbing;
  }

  .stream-item-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  .stream-item-platform {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  .stream-item-platform.twitch { background: var(--twitch-color); }
  .stream-item-platform.youtube { background: var(--youtube-color); }
  .stream-item-platform.kick { background: var(--kick-color); }

  .stream-item-name {
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stream-item-delete {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--btn-danger);
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
  }

  .stream-item-delete:hover {
    background: var(--btn-danger);
    color: white;
  }

  .copy-tooltip {
    position: fixed;
    top: 130px;
    right: 20px;
    background: var(--btn-accent);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
  }

  .copy-tooltip.show {
    opacity: 1;
    visibility: visible;
  }

  .btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .btn-primary {
    background: var(--btn-accent);
    color: white;
    flex: 1;
  }

  .btn-danger {
    background: var(--btn-danger);
    color: white;
    flex: 1;
  }

  .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }

  /* Settings Toggle Button - Icon only - FORCE VISIBILITY */
  .settings-toggle {
    position: fixed !important;
    top: 80px;
    right: 20px;
    background: var(--btn-accent) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    padding: 12px !important;
    border-radius: 10px !important;
    cursor: move !important;
    z-index: 1000 !important;
    transition: all 0.2s ease !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1rem !important;
    width: 48px !important;
    height: 48px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    user-select: none !important;
    touch-action: none !important;
  }

  .settings-toggle.visible {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: all !important;
  }

  .settings-toggle:hover {
    background: #772ce8;
    transform: scale(1.05);
  }

  .settings-toggle.dragging {
    transition: none !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
    opacity: 0.9 !important;
  }

  /* Override positioning when dragged */
  .settings-toggle.custom-position {
    top: unset !important;
    right: unset !important;
    bottom: unset !important;
    left: unset !important;
  }

  /* Chat Toggle Button - Similar to settings but different positioning */
  .chat-toggle {
    position: fixed !important;
    top: 140px;
    right: 20px;
    background: var(--btn-accent) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    padding: 12px !important;
    border-radius: 10px !important;
    cursor: move !important;
    z-index: 1000 !important;
    transition: all 0.2s ease !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1rem !important;
    width: 48px !important;
    height: 48px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    user-select: none !important;
    touch-action: none !important;
  }

  .chat-toggle.visible {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: all !important;
  }

  .chat-toggle:hover {
    background: #772ce8;
    transform: scale(1.05);
  }

  .chat-toggle.dragging {
    transition: none !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
    opacity: 0.9 !important;
  }

  /* Override positioning when dragged */
  .chat-toggle.custom-position {
    top: unset !important;
    right: unset !important;
    bottom: unset !important;
    left: unset !important;
  }

  /* Stream Container - adjust for RIGHT sidebar only */
  .stream-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    transition: width var(--transition-speed) ease !important;
    margin-left: 0 !important; /* Ensure no left margin */
    margin-right: 0 !important;
    z-index: 1 !important; /* Ensure it's above other content */
    background: var(--bg-color) !important; /* Prevent any content bleeding through */
  }

  /* Force grid layout when multiple streams */
  .stream-container.grid-layout {
    display: grid !important;
    flex-direction: unset !important;
  }

  /* Alignment options for grid layout - JavaScript handles the actual positioning */
  .stream-container.grid-layout.align-center {
    /* Center alignment is handled by JavaScript positioning */
  }

  .stream-container.grid-layout.align-left {
    /* Left alignment is the default grid behavior */
  }

  .stream-container.grid-layout.align-right {
    /* Right alignment is handled by JavaScript positioning */
  }

  .stream-container.with-sidebar {
    width: calc(100% - var(--sidebar-width)) !important;
    left: 0 !important; /* Stay on left side */
    right: var(--sidebar-width) !important; /* Make room for right sidebar */
  }

  .stream-container.with-chat {
    width: calc(100% - var(--sidebar-width)) !important;
    left: 0 !important; /* Stay on left side */
    right: var(--sidebar-width) !important; /* Make room for right chat sidebar */
  }

  /* Ensure stream container fills full space when no panels are open */
  .stream-container:not(.with-sidebar):not(.with-chat):not(.with-mobile-chat) {
    width: 100% !important;
    height: 100vh !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
  }

  .stream-wrapper {
    position: relative;
    background: #000;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .stream-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
  }

  .stream-info {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(rgba(0, 0, 0, 0.7), transparent);
    color: white;
    padding: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
  }

  .stream-wrapper:hover .stream-info {
    opacity: 1;
  }

  .stream-info.mobile-active {
    opacity: 1;
  }

  .stream-platform {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 10px;
    vertical-align: middle;
  }

  .stream-channel {
    display: inline;
    font-size: 1.1rem;
    font-weight: 600;
    vertical-align: middle;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  }

  .stream-info-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0;
  }

  .stream-info-left {
    display: flex;
    align-items: center;
    gap: 0;
  }

  .stream-info-right {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .stream-action-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
  }

  .stream-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
  }

  .stream-action-btn.danger {
    background: rgba(255, 77, 77, 0.8);
  }

  .stream-action-btn.danger:hover {
    background: rgba(255, 77, 77, 1);
  }

  .stream-timer-display {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
  }

  .stream-timer-display.paused {
    background: #ff4d4d;
    color: white;
    animation: pulse 1.5s ease-in-out infinite alternate;
  }

  @keyframes pulse {
    from { opacity: 0.8; }
    to { opacity: 1; }
  }

  .platform-twitch { background: var(--twitch-color); }
  .platform-youtube { background: var(--youtube-color); }
  .platform-kick { background: var(--kick-color); color: black; }

  /* YouTube Channel Embed Placeholder */
  .youtube-channel-embed {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  }

  .youtube-channel-embed button {
    font-family: inherit;
    outline: none;
  }

  .youtube-channel-embed button:focus {
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.3);
  }

    /* Mobile responsive - ensure sidebar comes from right */
    @media (max-width: 768px) {
      :root {
        --sidebar-width: 100vw;
      }

      .welcome-container {
        height: 70vh; /* Increase height on mobile to prevent truncation */
        padding: 20px;
      }

      .welcome-content {
        margin: 20px;
        padding: 30px 25px;
        max-width: none; /* Remove max-width constraint on mobile */
        width: calc(100% - 40px); /* Account for margin */
      }

      .welcome-title {
        font-size: 1.8rem;
      }

      .brand-header {
        gap: 10px;
        margin-bottom: 15px;
      }

      .brand-logo {
        width: 40px;
        height: 40px;
      }

      .welcome-subtitle {
        font-size: 1.1rem;
      }

      .welcome-tagline {
        font-size: 0.9rem;
      }

      .benefit-grid {
        grid-template-columns: 1fr;
        gap: 20px;
      }

      .benefit-item {
        padding: 20px;
      }

      .benefit-item i {
        font-size: 2rem;
      }

      .steps-list li {
        flex-direction: column;
        text-align: center;
        gap: 10px;
      }

      .step-number {
        margin-right: 0;
        margin-bottom: 10px;
      }

      .faq-item {
        padding: 15px;
      }

      .benefits-section,
      .how-it-works,
      .faq-section {
        margin: 30px auto 0;
        padding: 0 15px;
      }

      /* Mobile layout adjustments */
      .seo-content {
        top: 70vh; /* Align with new welcome container height */
        padding-top: 20px;
        padding-bottom: 40px;
        min-height: 30vh; /* Ensure minimum content height */
      }

      /* Ensure SEO content is completely hidden on mobile when streams are active */
      .seo-content.hidden {
        display: none !important;
        position: fixed !important;
        top: 100vh !important;
        left: -100vw !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        z-index: -9999 !important;
      }

      /* Ensure welcome container doesn't get clipped on small mobile screens */
      .welcome-container {
        min-height: 70vh !important;
        height: auto !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
      }

      /* Ensure body takes up full screen on mobile */
      body.streams-active {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        overflow: hidden !important;
      }

      /* Sidebar mobile adjustments */
      .sidebar-logo {
        width: 20px;
        height: 20px;
      }

      .sidebar-brand {
        font-size: 0.9rem;
      }

      .input-row {
        flex-direction: column;
      }

      .platform-select {
        flex: none;
      }

      /* On mobile, sidebars should overlay, not resize */
      .stream-container.with-sidebar {
        width: 100% !important;
        left: 0 !important;
        right: 0 !important;
      }

      .stream-container.with-chat {
        width: 100% !important;
        left: 0 !important;
        right: 0 !important;
      }

      .sidebar {
        right: -100vw !important;
        left: auto !important;
        width: 100vw !important;
      }

      .sidebar.active {
        right: 0 !important;
        left: auto !important;
      }

      /* MOBILE CHAT - FORCE BOTTOM POSITIONING */
      .chat-sidebar {
        position: fixed !important;
        top: 100vh !important; /* HIDDEN: completely below screen */
        bottom: auto !important;
        right: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 50vh !important;
        z-index: 499 !important;
        transition: top var(--transition-speed) ease !important;
        transform: none !important;
      }

      .chat-sidebar.active {
        top: 50vh !important; /* VISIBLE: bottom half of screen */
      }

      /* Stream container adjustments for mobile chat - stays at top */
      .stream-container.with-mobile-chat {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 50vh !important;
        z-index: 500 !important;
      }

      .settings-toggle {
        right: 10px;
        top: 70px;
      }

      .chat-toggle {
        right: 10px;
        top: 130px;
      }
    }