:root {
    --color-bg: #08090b;
    --color-bg-secondary: #101216;
    --color-bg-tertiary: rgba(220, 38, 38, 0.06);
    --color-surface: rgba(15, 17, 21, 0.92);
    --color-surface-raised: #111419;
    --color-border: rgba(148, 163, 184, 0.16);
    --color-border-strong: rgba(220, 38, 38, 0.35);
    --color-text-primary: #ffffff;
    --color-text-secondary: #b6beca;
    --color-text-tertiary: #7b8494;
    --color-accent: #dc2626;
    --color-accent-hover: #991b1b;
    --color-code: #4ade80;
    --color-focus: #38bdf8;
    --font-sans: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Adding user's specific variables from Step 183 context if needed */
    --accent-primary: #dc2626;
    --accent-secondary: #991b1b;
    --accent-glow: rgba(220, 38, 38, 0.3);
    --border-color: rgba(148, 163, 184, 0.16);
    --text-secondary: #b6beca;
}

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

body {
    background: linear-gradient(135deg, #08090b 0%, #120b0d 52%, #071014 100%);
    color: var(--color-text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 78%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 78%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    padding: 40px 24px;
}

.app-shell {
    padding-top: 20px;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.app-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.header-avatar {
    width: 46px;
    height: 46px;
    min-width: 46px;
    font-size: 20px;
    margin: 0;
    border-radius: 10px;
}

.page-title {
    font-size: 24px;
    line-height: 1.1;
    margin: 0;
    letter-spacing: 0;
}

.page-subtitle {
    font-size: 14px;
    margin: 4px 0 0;
}

.home-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
}

/* --- Hero Glow --- */
.hero-glow {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 300px;
    background: radial-gradient(circle, rgba(220, 38, 38, 0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* --- Tool Section --- */
.tool-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.48);
}

.workspace-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
    border-bottom: 1px solid var(--color-border);
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.1), rgba(8, 9, 11, 0.55));
}

.workspace-kicker {
    color: var(--color-accent);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.workspace-bar h2 {
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: 0;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 320px;
    max-width: 440px;
    width: 42%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: rgba(8, 10, 13, 0.86);
    color: var(--color-text-tertiary);
}

.search-box input {
    width: 100%;
    border: 0;
    outline: 0;
    color: var(--color-text-primary);
    background: transparent;
    font-family: var(--font-sans);
    font-size: 13px;
}

.search-box:focus-within {
    border-color: var(--color-focus);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

.tool-selector {
    display: flex;
    border-bottom: 1px solid var(--color-border);
    background: rgba(8, 9, 11, 0.65);
    overflow-x: auto;
}

.tool-tab {
    flex: 1;
    min-width: 140px;
    padding: 15px 18px;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-tertiary);
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

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

.tool-tab.active {
    color: #fff;
    border-bottom-color: var(--color-accent);
    background: linear-gradient(180deg, rgba(220, 38, 38, 0.14), rgba(220, 38, 38, 0.035));
}

/* --- Credential Bar --- */
.cred-bar {
    background: rgba(13, 15, 19, 0.96);
    border-bottom: 1px solid var(--color-border);
    padding: 18px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.cred-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(128px, 1fr));
    gap: 12px;
}

.cred-item {
    min-width: 0;
}

.cred-item label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-text-tertiary);
    margin-bottom: 6px;
    letter-spacing: 0.04em;
}

.cred-item input {
    width: 100%;
    background: #080a0d;
    border: 1px solid var(--color-border);
    border-radius: 7px;
    padding: 10px 12px;
    font-size: 13px;
    color: #fff;
    transition: all 0.2s;
    font-family: var(--font-mono);
}

.cred-item input:focus {
    border-color: var(--color-focus);
    outline: none;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.13);
}

/* --- Protocol Tabs --- */
.tabs-container {
    border-bottom: 1px solid var(--color-border);
    background: rgba(8, 9, 11, 0.42);
}

.tabs {
    display: flex;
    gap: 4px;
    padding: 0 12px;
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    padding: 13px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-tertiary);
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

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

.tab.active {
    color: var(--color-text-primary);
    border-bottom-color: var(--color-accent);
    background: rgba(220, 38, 38, 0.07);
}

.tab.has-search-match {
    color: #fff;
}

/* --- Command Content --- */
.tool-content {
    padding: 22px;
    min-height: 400px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.section {
    margin-bottom: 34px;
}

.section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-text-tertiary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--color-border);
}

.cmd-block {
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
    position: relative;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.cmd-block[hidden],
.section[hidden] {
    display: none;
}

.cmd-block:hover {
    border-color: rgba(220, 38, 38, 0.32);
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.cmd-header {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.025);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cmd-label {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    line-height: 1.35;
}

.tag {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}

.tag-red {
    background: #450a0a;
    color: #fecaca;
}

.tag-amber {
    background: #451a03;
    color: #fde68a;
}

.tag-green {
    background: #064e3b;
    color: #d1fae5;
}

.tag-blue {
    background: #1e3a8a;
    color: #bfdbfe;
}

.tag-purple {
    background: #3b0764;
    color: #f3e8ff;
}

.tag-gray {
    background: #1e293b;
    color: #e2e8f0;
}

.cmd-body {
    position: relative;
}

.cmd-code {
    padding: 16px 86px 16px 16px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--color-code);
    white-space: pre-wrap;
    word-break: normal;
    overflow-wrap: anywhere;
    line-height: 1.6;
    background:
        linear-gradient(90deg, rgba(74, 222, 128, 0.08), transparent 35%),
        #080a0d;
}

.cmd-note {
    padding: 10px 16px 12px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--color-text-secondary);
    border-top: 1px solid rgba(148, 163, 184, 0.09);
    background: rgba(255, 255, 255, 0.018);
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 18, 22, 0.94);
    border: 1px solid var(--color-border);
    padding: 6px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--color-text-secondary);
    cursor: pointer;
    opacity: 0.78;
    transition: all 0.2s;
    z-index: 10;
}

.cmd-block:hover .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}

.copy-btn.copied {
    background: #22c55e;
    color: white;
    border-color: #22c55e;
    opacity: 1;
}

/* --- Grid Items (from Step 183) --- */
.section-header {
    margin-bottom: 32px;
    text-align: center;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.section-header p {
    color: #6b7280;
    font-size: 14px;
}

.cheatsheet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 48px;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 48px;
}

.cheatsheet-card {
    background: rgba(17, 20, 25, 0.82);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 24px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 16px;
}

.cheatsheet-card:hover {
    background: rgba(24, 27, 33, 0.95);
    border-color: var(--color-border-strong);
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.32);
}

.cs-icon {
    font-size: 24px;
    color: #dc2626;
    width: 48px;
    height: 48px;
    background: rgba(220, 38, 38, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cs-info h3 {
    font-size: 18px;
    color: #ffffff;
    margin-bottom: 4px;
}

.cs-info p {
    font-size: 13px;
    color: #9ca3af;
}

/* --- Footer --- */
.footer {
    text-align: center;
    padding: 32px;
    color: var(--color-text-tertiary);
    font-size: 14px;
}

/* --- Animations --- */
.animate-in {
    animation: fadeInUp 0.8s ease both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

.profile-avatar {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #dc2626, #991b1b);
    border-radius: 50%;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    box-shadow: 0 8px 32px rgba(220, 38, 38, 0.3);
}

.profile-avatar.header-avatar {
    width: 46px;
    height: 46px;
    min-width: 46px;
    font-size: 20px;
    margin: 0;
    border-radius: 10px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    color: #dc2626;
    transition: all 0.3s ease;
}

.protocol-btn {
    padding: 8px 20px;
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: all 0.3s;
}

.protocol-btn:hover {
    border-color: var(--color-border-strong);
    color: #fff;
}

.protocol-btn.active {
    background: rgba(220, 38, 38, 0.1);
    border-color: var(--color-accent);
    color: #fff;
}

@media (max-width: 980px) {
    .cred-grid {
        grid-template-columns: repeat(3, minmax(150px, 1fr));
    }

    .workspace-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .search-box {
        min-width: 0;
        max-width: none;
        width: 100%;
    }
}

@media (max-width: 720px) {
    .container {
        padding: 20px 14px;
    }

    .app-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .home-btn {
        width: 100%;
        justify-content: center;
    }

    .tool-section {
        border-radius: 10px;
    }

    .tool-tab {
        min-width: 120px;
    }

    .cred-bar {
        position: static;
        padding: 14px;
    }

    .cred-grid {
        grid-template-columns: 1fr 1fr;
    }

    .tool-content {
        padding: 16px;
    }

    .cmd-header {
        align-items: flex-start;
    }

    .cmd-code {
        padding: 52px 13px 14px;
        font-size: 12px;
        line-height: 1.55;
    }

    .copy-btn {
        left: 10px;
        right: auto;
    }
}

@media (max-width: 460px) {
    .cred-grid,
    .cheatsheet-grid,
    .links-grid {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: 21px;
    }

    .cmd-header {
        flex-direction: column;
        gap: 8px;
    }
}
