body {
    background: #0b0b0c;
    color: #e5e5e5;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 16px;
}

/* HEADER */
h2 {
    text-align: center;
    font-weight: 500;
    margin-bottom: 20px;
    color: #ffffff;
}

/* GRID */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

/* CARD */
.card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    padding: 14px;
    transition: 0.2s;
}

.card:hover {
    border-color: rgba(255,255,255,0.15);
}

/* HEADER ROW */
.top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.card h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #aaa;
}

/* CREDENTIAL LABEL */
.cred-label {
    font-size: 12px;
    color: #22c55e;
    margin-right: 6px;
}

/* ICON BUTTON */
.icon-btn {
    background: rgba(255,255,255,0.05);
    color: #aaa;
    padding: 6px 8px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
}

.icon-btn:hover {
    background: rgba(255,255,255,0.1);
}

/* INPUTS */
.search, .manual {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    margin-bottom: 8px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.08);
    background: #111;
    color: white;
    font-size: 13px;
}

.search:focus, .manual:focus {
    outline: none;
    border-color: #22c55e;
}

/* RESULTS */
.results {
    max-height: 110px;
    overflow-y: auto;
    font-size: 13px;
    margin-bottom: 8px;
}

.channel {
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    color: #ccc;
}

.channel:hover {
    background: rgba(255,255,255,0.06);
}

/* BUTTONS */
.buttons {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

button {
    flex: 1;
    padding: 8px;
    font-size: 13px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
}

.start {
    background: #22c55e;
    color: black;
}

.stop {
    background: #ef4444;
    color: white;
}

.apply {
    background: #3b82f6;
    color: white;
}

.reset {
    background: #6b7280;
    color: white;
}

/* CREDS BOX */
.creds-box {
    display: none;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 10px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
}

/* STATUS */
.status {
    margin-top: 8px;
    font-size: 13px;
    text-align: center;
    line-height: 1.4;
}

.live {
    color: #22c55e;
}

h2 {
    margin-top: 60px;
}

.error {
    color: #ef4444;
}

.channel-title {
    font-size: 16px;
    font-weight: bold;
    background: transparent;
    border: none;
    color: white;
    width: 120px;
    cursor: pointer;
}

/* 👇 hidden border normally */
.channel-title {
    border-bottom: 1px solid transparent;
}

/* 👇 only show underline when editing */
.channel-title:focus {
    outline: none;
    border-bottom: 1px solid #888;
    cursor: text;
}

.channel-title:hover {
    border-bottom: 1px dashed #666;
}


/* LOGIN */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    width: 100%;
    max-width: 360px;

    padding: 22px;

    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
    border-radius: 14px;
}

.login-title {
    text-align: center;
    font-size: 18px;
    margin-bottom: 16px;
    color: #fff;
}

.login-card .manual {
    padding: 10px 12px;
    font-size: 14px;
    margin-bottom: 10px;
}

.login-card .apply {
    padding: 10px;
    font-size: 14px;
}

.login-error {
    margin-top: 10px;
    text-align: center;
    font-size: 13px;
    color: #ef4444;
}

/* MESSAGE */
.message {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    top: auto !important;
    left: auto !important;
    display: inline-block !important;
    width: auto !important;
    max-width: 260px;
    height: auto !important;
    max-height: none !important;
    padding: 10px 14px;
    background: #333;
    color: #fff;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.4;
    z-index: 9999;
    white-space: normal;
    word-break: break-word;
    opacity: 0.95;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Optional nicer colors */
.message.success { background: #22c55e; color: green; }
.message.error { background: #ef4444; color: red; }

/* MOBILE */
@media (max-width:600px){
    body { padding: 12px; }
}

/* HEADER FIX */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.top-bar {
    display: flex;
    gap: 10px;
}

.top-bar form {
    margin: 0;
}

/* MOBILE HEADER FIX */
@media (max-width:600px){

    .header {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .top-bar {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .top-bar button {
        flex: 1;
    }

    h2 {
        margin-top: 0 !important;
        text-align: center;
    }
}