/* ============================================================
   Studio shell + PENTEST OVERVIEW + REPORT views.
   Verbatim copies of the real legacy-studio.css / legacy-portal.css
   rules, each selector prefixed with ".smk " to scope + win
   specificity over the marketing page's blue theme. Tokens come
   from _base.css (defined on .smk); var(...) refs are kept intact.
   ============================================================ */

/* ---- App root + Nav Rail (legacy-portal.css) ----------------------------- */
.smk .app-root {
    display: flex;
    height: 100%;
    overflow: hidden;
}

.smk .app-view {
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.smk .nav-rail {
    width: 64px;
    min-width: 64px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 100;
}

.smk .nav-rail-top,
.smk .nav-rail-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.smk .nav-rail-top {
    padding-top: 8px;
}

.smk .nav-rail-bottom {
    padding-bottom: 12px;
}

.smk .nav-rail-logo {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    margin-bottom: 12px;
    filter: drop-shadow(0 0 6px var(--text-dim));
}

.smk .nav-rail-item {
    width: 52px;
    height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0;
    font-family: var(--font-mono);
}

.smk .nav-rail-item:hover {
    color: var(--text-dim);
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
}

.smk .nav-rail-item.active {
    color: var(--text-primary);
    background-color: rgba(0, 212, 255, 0.08);
    border-color: var(--text-primary);
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.15);
}

.smk .nav-rail-label {
    font-size: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

.smk .nav-rail-user {
    gap: 2px;
}

.smk .nav-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-white);
}

.smk .nav-rail-item.nav-rail-user:hover .nav-user-avatar {
    border-color: var(--accent-red);
}

.smk .nav-rail-item.nav-rail-user:hover {
    color: var(--accent-red);
}

/* The studio root is a horizontal flex (rail + studio view) filling the canvas. */
.smk .smk-studio-root {
    width: 100%;
    height: 100%;
}

/* ---- Main container / header (legacy-studio.css) ------------------------- */
.smk .main-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 1;
    background:
        linear-gradient(90deg, rgba(0,212,255,0.015) 1px, transparent 1px),
        linear-gradient(rgba(0,212,255,0.015) 1px, transparent 1px);
    background-size: 20px 20px;
}

.smk .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-lg);
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    min-height: 42px;
}

.smk .header-left, .smk .header-center, .smk .header-right {
    flex: 1;
}

.smk .header-center {
    text-align: center;
}

.smk .header-right {
    text-align: right;
}

.smk .title {
    font-size: var(--font-size-md);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--text-dim);
}

.smk .ip-address {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.smk .datetime {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

/* ---- Content wrapper (3-column grid) ------------------------------------- */
.smk .content-wrapper {
    display: grid;
    grid-template-columns: 1fr 4fr 1fr;
    grid-template-rows: minmax(0, 1fr);
    flex: 1;
    overflow: hidden;
    transition: grid-template-columns 0.2s ease;
}

.smk .content-wrapper:has(.right-panel.collapsed),
.smk .content-wrapper.has-collapsed {
    grid-template-columns: 1fr 5fr 24px;
}

.smk .left-panel, .smk .right-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    overflow: hidden;
}

.smk .right-panel {
    border-right: none;
    border-left: 1px solid var(--border-color);
    position: relative;
    overflow: visible;
}

.smk .panel-collapse-btn {
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 48px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--text-dim);
    border-radius: 4px 0 0 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.5), 0 0 6px rgba(0, 212, 255, 0.25);
    transition: background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.smk .panel-collapse-btn:hover {
    background-color: var(--bg-secondary);
    border-color: var(--text-primary);
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.5), 0 0 10px rgba(0, 212, 255, 0.45);
}

.smk .panel-collapse-btn .collapse-icon {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: bold;
    transition: transform 0.2s ease;
}

.smk .right-panel.collapsed {
    border-left: 1px solid var(--border-color);
    overflow: visible;
}

.smk .right-panel.collapsed .panel-collapse-btn {
    left: 0;
    border-radius: 0;
    width: 100%;
    height: 100%;
    top: 0;
    transform: none;
    border: none;
}

.smk .right-panel.collapsed .collapse-icon {
    transform: rotate(180deg);
}

.smk .right-panel.collapsed .panel-section {
    display: none;
}

.smk .center-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    background-color: var(--bg-primary);
}

/* ---- Panel sections ----------------------------------------------------- */
.smk .panel-section {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--border-color);
}

.smk .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.smk .section-title {
    margin: 0;
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: #4a9eff;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.smk .header-actions {
    display: flex;
    gap: 2px;
    justify-content: flex-end;
}

.smk .icon-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-dim);
    padding: 2px 6px;
    font-size: var(--font-size-xs);
    font-family: var(--font-mono);
    cursor: pointer;
    transition: var(--transition-fast);
    border-radius: var(--border-radius);
}

.smk .icon-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
    text-shadow: 0 0 5px var(--text-dim);
}

.smk .icon-btn.active {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

/* ---- Servers section ---------------------------------------------------- */
.smk .servers-section {
    max-height: 160px;
    min-height: 100px;
}

.smk .servers-list {
    padding: var(--spacing-xs);
    overflow-y: auto;
    max-height: 110px;
}

.smk .server-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-sm);
    margin-bottom: 2px;
    background-color: var(--bg-tertiary);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: var(--font-size-xs);
}

.smk .server-item:hover {
    border-color: var(--border-highlight);
    background-color: var(--bg-secondary);
}

.smk .server-item.active {
    border-left: 3px solid var(--text-primary);
    background-color: rgba(0, 212, 255, 0.08);
}

.smk .server-item.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.smk .server-item.disabled:hover {
    border-color: transparent;
    background-color: var(--bg-tertiary);
}

.smk .server-item .server-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: var(--spacing-sm);
    background-color: var(--status-error);
    flex-shrink: 0;
}

.smk .server-item.active .server-status-dot {
    background-color: var(--status-success);
    box-shadow: 0 0 6px var(--status-success);
}

.smk .server-item .server-name {
    flex: 1;
    color: var(--text-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.smk .server-item .server-host {
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    margin-left: var(--spacing-xs);
}

/* ---- Pentests section --------------------------------------------------- */
.smk .pentests-section {
    flex: 1;
    min-height: 150px;
    overflow: hidden;
}

.smk .pentests-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-xs);
}

.smk .pentest-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm);
    margin-bottom: 2px;
    background-color: var(--bg-tertiary);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
}

.smk .pentest-item:hover {
    border-color: var(--border-highlight);
    background-color: var(--bg-secondary);
}

.smk .pentest-item.selected {
    border-left: 3px solid var(--text-primary);
    background-color: rgba(0, 212, 255, 0.08);
}

.smk .pentest-item.status-completed .pentest-status-dot {
    background-color: var(--status-success);
    box-shadow: 0 0 6px var(--status-success);
}

.smk .pentest-item.status-cancelled .pentest-status-dot {
    background-color: var(--status-error);
    box-shadow: 0 0 6px var(--status-error);
}

.smk .pentest-item.status-failed .pentest-status-dot {
    background-color: var(--status-error);
    box-shadow: 0 0 6px var(--status-error);
}

.smk .pentest-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: var(--spacing-sm);
    flex-shrink: 0;
}

.smk .pentest-info {
    flex: 1;
    overflow: hidden;
}

.smk .pentest-target {
    font-size: var(--font-size-sm);
    color: var(--text-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.smk .pentest-meta {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

/* ---- Pentest details ---------------------------------------------------- */
.smk .pentest-details-section {
    min-height: 160px;
}

.smk .pentest-details {
    padding: var(--spacing-sm);
    overflow-y: auto;
    max-height: 320px;
}

.smk .detail-row {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-xs) 0;
    border-bottom: 1px solid var(--bg-tertiary);
}

.smk .detail-label {
    color: var(--text-muted);
    font-size: var(--font-size-xs);
}

.smk .detail-value {
    color: var(--text-white);
    font-size: var(--font-size-xs);
    text-align: right;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.smk .detail-value.status-completed { color: var(--accent-cyan); }

/* ---- Connection section ------------------------------------------------- */
.smk .connection-section {
    min-height: 80px;
}

.smk .connection-status {
    padding: var(--spacing-md);
}

.smk .connection-indicator {
    display: flex;
    align-items: center;
    margin-bottom: var(--spacing-sm);
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.smk .globe-icon {
    width: 18px;
    height: 18px;
    color: #666666;
    margin-right: var(--spacing-xs);
    flex-shrink: 0;
}

.smk .globe-icon.connected {
    color: #888888;
}

.smk .status-text {
    font-size: var(--font-size-sm);
    color: var(--text-white);
}

.smk .country-name {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-left: var(--spacing-xs);
}

.smk .country-name::before {
    content: '|';
    margin-right: var(--spacing-xs);
    color: var(--border-color);
}

.smk .connection-indicator.state-connected .status-text {
    color: var(--status-success);
}

.smk .connection-indicator.state-connected .globe-icon {
    color: var(--status-success);
}

.smk .server-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.smk .server-label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.smk .server-address {
    font-size: var(--font-size-sm);
    color: var(--text-white);
}

/* ---- Center panel console ----------------------------------------------- */
.smk .console-output-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.smk .console-tabs {
    display: flex;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    scrollbar-width: thin;
}

.smk .console-tabs::-webkit-scrollbar {
    height: 3px;
}

.smk .console-tabs .tab {
    display: flex;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-md);
    background-color: var(--bg-tertiary);
    border-right: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
    min-width: 80px;
    max-width: 180px;
}

.smk .console-tabs .tab:hover {
    background-color: var(--bg-secondary);
}

.smk .console-tabs .tab.active {
    background-color: var(--bg-primary);
    border-bottom: 2px solid var(--text-primary);
}

.smk .console-tabs .tab .tab-title {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.smk .console-tabs .tab.active .tab-title {
    color: var(--text-primary);
}

.smk .console-tabs .tab .tab-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 2px;
    margin-left: var(--spacing-xs);
    font-size: var(--font-size-sm);
    line-height: 1;
    opacity: 0;
    transition: var(--transition-fast);
}

.smk .console-tabs .tab:hover .tab-close {
    opacity: 1;
}

.smk .console-tabs .tab .tab-close:hover {
    color: var(--status-error);
}

.smk .console-tabs-content {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* ---- Pentest results / report view container ---------------------------- */
.smk .pentest-results {
    position: absolute;
    top: 0;
    left: 0;
    right: 16px;
    bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--bg-primary);
}

.smk .pentest-results-viewer {
    overflow: hidden;
}

/* ---- Console input ------------------------------------------------------ */
.smk .console-input-section {
    padding: var(--spacing-md);
    background-color: var(--bg-secondary);
    position: relative;
}

.smk .console-input-wrapper {
    display: flex;
    align-items: center;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: var(--spacing-sm);
}

.smk .prompt {
    color: var(--text-primary);
    margin-right: var(--spacing-sm);
    font-weight: 700;
}

.smk .input-autocomplete-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.smk .console-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-white);
    font-family: var(--font-mono);
    font-size: var(--font-size-base);
    caret-color: var(--text-primary);
    position: relative;
    z-index: 2;
}

.smk .console-input::placeholder {
    color: var(--text-muted);
}

.smk .console-quick-actions {
    display: flex;
    gap: var(--spacing-xs);
    margin-left: var(--spacing-sm);
}

.smk .console-action-btn {
    width: 24px;
    height: 24px;
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.smk .console-action-btn:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--text-primary);
    color: var(--text-primary);
}

/* ---- Right panel chat --------------------------------------------------- */
.smk .chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 300px;
    overflow: hidden;
}

.smk .chat-context {
    padding: var(--spacing-xs) var(--spacing-md);
    background-color: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    font-size: var(--font-size-xs);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.smk .context-label {
    color: var(--text-muted);
}

.smk .context-value {
    color: var(--accent-cyan);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.smk .chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: var(--spacing-md);
    background-color: var(--bg-primary);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.smk .chat-message {
    max-width: 90%;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 4px;
    font-size: var(--font-size-sm);
    line-height: 1.4;
}

.smk .chat-message.assistant {
    align-self: flex-start;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-white);
    animation: smk-msg-in 0.5s ease both;
}

.smk .chat-message.assistant .message-content {
    white-space: pre-wrap;
}

@keyframes smk-msg-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.smk .chat-input-section {
    padding: var(--spacing-sm);
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.smk .chat-input-wrapper {
    display: flex;
    gap: var(--spacing-xs);
}

.smk .chat-input {
    flex: 1;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: var(--spacing-sm);
    color: var(--text-white);
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    outline: none;
}

.smk .chat-input:focus {
    border-color: var(--text-dim);
}

.smk .chat-send-btn {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: var(--spacing-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.smk .chat-send-btn svg {
    width: 16px;
    height: 16px;
    color: var(--text-dim);
}

.smk .chat-send-btn:hover svg {
    color: var(--text-primary);
}

/* ---- Quick actions ------------------------------------------------------ */
.smk .actions-section {
    min-height: auto;
}

.smk .quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
}

.smk .action-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm);
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-dim);
    cursor: pointer;
    transition: var(--transition-fast);
    font-family: var(--font-mono);
}

.smk .action-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
    background-color: rgba(0, 212, 255, 0.05);
}

.smk .action-btn:active {
    background-color: rgba(0, 212, 255, 0.1);
}

.smk .btn-icon {
    font-size: var(--font-size-lg);
    margin-bottom: 2px;
}

.smk .btn-text {
    font-size: var(--font-size-xs);
    letter-spacing: 1px;
}

/* ---- Footer ------------------------------------------------------------- */
.smk .footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-lg);
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    min-height: 48px;
}

.smk .footer-left, .smk .footer-center, .smk .footer-right {
    flex: 1;
}

.smk .footer-center {
    text-align: center;
}

.smk .footer-right {
    text-align: right;
}

.smk .footer-text {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.smk .version {
    font-size: var(--font-size-xs);
    color: var(--text-dim);
}

.smk .footer-status {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

/* ===========================================================================
   OVERVIEW CONTENT
   =========================================================================== */
.smk .overview-tab-content {
    padding: var(--spacing-lg);
    overflow-y: auto;
    height: 100%;
    background-color: var(--bg-primary);
}

.smk .overview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.smk .overview-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--accent-cyan);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.smk .overview-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.smk .overview-btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.smk .overview-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

/* ---- Target Info Row ---------------------------------------------------- */
.smk .overview-target-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    background-color: rgba(20, 20, 22, 0.8);
    border: 1px solid var(--border-color);
    margin-bottom: var(--spacing-lg);
}

.smk .target-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 var(--spacing-lg);
}

.smk .target-group:first-child {
    padding-left: 0;
}

.smk .target-group:last-child {
    padding-right: 0;
    text-align: right;
}

.smk .target-label {
    font-size: 18px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.smk .target-value {
    font-size: var(--font-size-md);
    color: var(--text-white);
}

.smk .target-value.status-completed {
    color: #4ade80;
    display: flex;
    align-items: center;
    gap: 0;
}

.smk .target-separator {
    width: 1px;
    height: 40px;
    background-color: var(--border-color);
    flex-shrink: 0;
}

.smk .scan-id {
    color: var(--text-white);
}

/* ---- Main 3-column grid ------------------------------------------------- */
.smk .overview-main-grid {
    display: grid;
    grid-template-columns: minmax(270px, 310px) 1fr minmax(290px, 350px);
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.smk .overview-card {
    background-color: rgba(26, 26, 26, 0.5);
    border: 1px solid var(--border-color);
    padding: var(--spacing-md);
}

.smk .overview-card-title {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--spacing-md);
}

.smk .overview-column-left,
.smk .overview-column-center,
.smk .overview-column-right {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* ---- Security score ----------------------------------------------------- */
.smk .security-score {
    text-align: left;
}

.smk .security-score .score-value {
    font-size: 56px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: var(--spacing-xs);
}

.smk .security-score .score-max {
    font-size: 24px;
    color: var(--text-muted);
}

.smk .security-score.critical .score-value { color: var(--severity-critical); }
.smk .security-score.high .score-value { color: var(--severity-high); }
.smk .security-score.medium .score-value { color: var(--severity-medium); }
.smk .security-score.low .score-value { color: var(--severity-low); }
.smk .security-score.none .score-value { color: var(--text-primary); }

/* risk-level word under the score — coloured to match the severity band. */
.smk .risk-level {
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: var(--spacing-sm);
}

.smk .risk-level.critical { color: var(--severity-critical); }
.smk .risk-level.high { color: var(--severity-high); }
.smk .risk-level.medium { color: var(--severity-medium); }
.smk .risk-level.low { color: var(--severity-low); }

/* ---- Findings summary --------------------------------------------------- */
.smk .findings-summary {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.smk .finding-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-xs) 0;
}

.smk .finding-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-sm);
}

.smk .finding-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.smk .finding-dot.critical { background: var(--severity-critical); }
.smk .finding-dot.high { background: var(--severity-high); }
.smk .finding-dot.medium { background: var(--severity-medium); }
.smk .finding-dot.low { background: var(--severity-low); }
.smk .finding-dot.info { background: var(--text-muted); }

.smk .finding-count {
    font-weight: 500;
    font-size: var(--font-size-sm);
}

.smk .finding-count.critical { color: var(--severity-critical); }
.smk .finding-count.high { color: var(--severity-high); }
.smk .finding-count.medium { color: var(--severity-medium); }
.smk .finding-count.low { color: var(--severity-low); }
.smk .finding-count.info { color: var(--text-muted); }
.smk .finding-count.total { color: var(--text-primary); }

.smk .finding-row.info-row {
    padding-top: var(--spacing-sm);
    margin-top: var(--spacing-sm);
    border-top: 1px solid var(--border-color);
}

.smk .finding-row.total-row {
    padding-top: var(--spacing-sm);
    margin-top: var(--spacing-sm);
    border-top: 1px solid var(--border-color);
}

.smk .finding-row.total-row .finding-label {
    color: var(--text-secondary);
}

/* ---- Attack surface ----------------------------------------------------- */
.smk .attack-surface-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.smk .surface-item {
    text-align: left;
}

.smk .surface-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.smk .surface-label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: 2px;
}

/* ---- Penetration depth / radar ----------------------------------------- */
.smk .penetration-depth-card {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.smk .radar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
}

.smk .radar-legend {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: var(--font-size-xs);
}

.smk .legend-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--text-muted);
}

.smk .legend-line {
    width: 20px;
    height: 2px;
}

.smk .legend-line.target {
    background-color: var(--accent-cyan);
}

.smk .legend-line.avg {
    background: repeating-linear-gradient(
        90deg,
        var(--text-muted) 0px,
        var(--text-muted) 4px,
        transparent 4px,
        transparent 8px
    );
}

.smk .radar-chart-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: var(--spacing-sm) var(--spacing-md);
}

.smk .radar-svg {
    width: 85%;
    max-width: 570px;
    margin: 0 auto;
    display: block;
}

/* Target polygon scales in from the centre of the 400x400 viewBox. */
.smk .radar-target-group {
    transform-box: view-box;
    transform-origin: 200px 200px;
    animation: smk-radar-in 0.9s 0.2s ease both;
}

@keyframes smk-radar-in {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.smk .radar-label {
    position: absolute;
    font-size: clamp(10px, 1.2vw, 16px);
    color: var(--text-muted);
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.smk .radar-label.top {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.smk .radar-label.top-right {
    top: 15%;
    right: 5%;
}

.smk .radar-label.right {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
}

.smk .radar-label.bottom-right {
    bottom: 20%;
    right: 10%;
}

.smk .radar-label.bottom-left {
    bottom: 20%;
    left: 10%;
}

.smk .radar-label.left {
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.smk .radar-label.top-left {
    top: 15%;
    left: 5%;
}

/* ---- Scan stages -------------------------------------------------------- */
.smk .scan-stages {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
    container-type: inline-size;
}

.smk .stages-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
}

.smk .stages-title {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.smk .stages-count {
    font-size: var(--font-size-xs);
    color: var(--text-white);
}

.smk .stages-bar {
    display: flex;
    gap: 1px;
    margin-bottom: var(--spacing-xs);
}

.smk .stage-segment {
    flex: 1;
    height: 5px;
    background: #1a1a1e;
}

.smk .stage-segment.completed {
    background: #22d3ee;
    animation: smk-seg-fill 0.5s ease both;
    animation-delay: calc(var(--seg-i, 0) * 70ms);
}

/* Stagger the segment fill via nth-child since markup has no per-segment var. */
.smk .stages-bar .stage-segment.completed:nth-child(1) { animation-delay: 0ms; }
.smk .stages-bar .stage-segment.completed:nth-child(2) { animation-delay: 70ms; }
.smk .stages-bar .stage-segment.completed:nth-child(3) { animation-delay: 140ms; }
.smk .stages-bar .stage-segment.completed:nth-child(4) { animation-delay: 210ms; }
.smk .stages-bar .stage-segment.completed:nth-child(5) { animation-delay: 280ms; }
.smk .stages-bar .stage-segment.completed:nth-child(6) { animation-delay: 350ms; }
.smk .stages-bar .stage-segment.completed:nth-child(7) { animation-delay: 420ms; }

@keyframes smk-seg-fill {
    from { transform: scaleX(0); transform-origin: left; }
    to { transform: scaleX(1); transform-origin: left; }
}

.smk .stages-labels {
    display: flex;
    justify-content: space-between;
    font-size: clamp(6px, 3.2cqw, 11px);
    color: var(--text-muted);
    letter-spacing: 0;
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
}

.smk .stages-labels span {
    flex: 1;
    min-width: 0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.smk .stages-labels span:first-child {
    text-align: left;
}

.smk .stages-labels span:last-child {
    text-align: right;
}

/* SCAN STAGES bar in the left PENTEST DETAILS panel. */
.smk .pentest-stage-bar {
    padding: var(--spacing-sm) var(--spacing-md) var(--spacing-md);
    container-type: inline-size;
    border-bottom: 1px solid var(--border-color);
}

.smk .stage-status {
    padding-top: var(--spacing-sm);
}

.smk .stage-status-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-sm);
    color: #4ade80;
    margin-bottom: var(--spacing-xs);
}

.smk .stage-status-title .checkmark {
    color: #4ade80;
}

.smk .stage-status-desc {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    line-height: 1.4;
}

/* ---- Classification ----------------------------------------------------- */
.smk .classification-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.smk .classification-title.critical { color: var(--severity-critical); }
.smk .classification-title.high { color: var(--severity-high); }
.smk .classification-title.medium { color: var(--severity-medium); }
.smk .classification-title.low { color: var(--severity-low); }

.smk .classification-desc {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    line-height: 1.5;
}

/* ---- Weakness metrics --------------------------------------------------- */
.smk .weakness-metrics {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.smk .weakness-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.smk .weakness-name {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    min-width: 120px;
    flex-shrink: 0;
}

.smk .weakness-bar-bg {
    flex: 1;
    height: 6px;
    background-color: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.smk .weakness-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.smk .weakness-bar.cyan { background: var(--accent-secondary); }
.smk .weakness-bar.red { background: var(--severity-critical); }
.smk .weakness-bar.orange { background: #f97316; }
.smk .weakness-bar.amber { background: var(--severity-medium); }
.smk .weakness-bar.yellow { background: #eab308; }
.smk .weakness-bar.purple { background: #a855f7; }
.smk .weakness-bar.green { background: #10b981; }
.smk .weakness-bar.blue { background: var(--severity-low); }

/* Bars fill from 0 to their data width, staggered. Resting state is the final width. */
.smk .weakness-bar-anim {
    width: var(--bar-w, 0%);
    animation: smk-bar-fill 0.7s ease both;
    animation-delay: calc(var(--i, 0) * 90ms);
}

@keyframes smk-bar-fill {
    from { width: 0%; }
    to { width: var(--bar-w, 0%); }
}

.smk .weakness-score {
    font-size: var(--font-size-xs);
    min-width: 60px;
    text-align: right;
    color: var(--text-white);
    flex-shrink: 0;
}

/* ---- Priority target ---------------------------------------------------- */
.smk .priority-target-card {
    background: rgba(248, 113, 113, 0.05);
    border: 1px solid rgba(248, 113, 113, 0.2);
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
}

.smk .priority-target-card .priority-alert {
    font-size: var(--font-size-xs);
    color: rgba(248, 113, 113, 0.7);
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-xs);
}

.smk .priority-target-card .priority-title {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
}

.smk .priority-target-card .priority-scores {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

.smk .priority-target-card .priority-score {
    font-size: 36px;
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1;
}

.smk .priority-target-card .priority-desc {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: var(--spacing-sm);
}

.smk .warning-icon {
    color: var(--severity-critical);
    margin-right: 4px;
}

/* ===========================================================================
   REPORT VIEWER (markdown / github-dark-ish)
   =========================================================================== */
.smk .file-viewer-header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-md);
}

.smk .viewer-title {
    font-size: var(--font-size-md);
    font-weight: 700;
    color: var(--accent-cyan);
    margin-bottom: var(--spacing-xs);
}

.smk .viewer-path {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: var(--spacing-xs);
    font-family: var(--font-mono);
}

.smk .viewer-help {
    font-size: var(--font-size-xs);
    color: var(--text-dim);
}

.smk .file-viewer-content {
    flex: 1;
    overflow: hidden;
    padding: var(--spacing-md);
    background-color: var(--bg-primary);
}

.smk .markdown-body {
    background-color: transparent !important;
    font-family: var(--font-mono) !important;
    color: var(--text-white);
}

.smk .file-viewer-content .file-markdown-content.markdown-body {
    padding: var(--spacing-md);
    font-size: 14px;
    line-height: 1.5;
    max-width: 100%;
}

.smk .file-viewer-content .file-markdown-content h2 {
    font-size: 18px;
    margin-bottom: 0.4em;
    color: var(--accent-cyan);
    font-weight: 700;
}

.smk .file-viewer-content .file-markdown-content h2:first-child {
    margin-top: 0;
    padding-top: 0;
}

.smk .file-viewer-content .file-markdown-content p {
    margin-bottom: 0.6em;
    color: var(--text-white);
}

.smk .file-viewer-content .file-markdown-content table {
    font-size: 13px;
    border-collapse: collapse;
    margin-bottom: 0.8em;
    width: 100%;
}

.smk .markdown-body table {
    border-color: var(--border-color) !important;
}

.smk .markdown-body table th,
.smk .markdown-body table td {
    border: 1px solid var(--border-color) !important;
    padding: 6px 13px;
    text-align: left;
    vertical-align: top;
}

.smk .markdown-body table tr {
    background-color: transparent !important;
}

.smk .markdown-body table tr:nth-child(2n) {
    background-color: var(--bg-secondary) !important;
}

.smk .markdown-body table th {
    background-color: var(--bg-tertiary) !important;
    color: var(--accent-cyan);
    font-weight: 700;
}

/* Report table rows fade/slide in, staggered. Resting state fully visible. */
.smk .markdown-body table tbody tr.report-row {
    animation: smk-row-in 0.5s ease both;
    animation-delay: calc(var(--i, 0) * 120ms + 200ms);
}

@keyframes smk-row-in {
    from { opacity: 0; transform: translateX(-12px); }
    to { opacity: 1; transform: translateX(0); }
}
