/* App shell: chat, auth, profile, settings.
   Visual layer only — selectors match existing markup and scripts. */

body.ds-chat {
    background: var(--ds-surface);
    color: var(--ds-ink);
    overflow: hidden;
}

body.ds-chat .container-fluid,
body.ds-chat .row.h-100 {
    background: var(--ds-surface);
}

/* Sidebar */
body.ds-chat #sidebar {
    width: var(--ds-sidebar) !important;
    min-width: 0 !important;
    background: var(--ds-bg) !important;
    border-right: 1px solid var(--ds-line) !important;
    color: var(--ds-ink);
}

body.ds-chat #sidebar.collapsed {
    width: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
    overflow: visible !important;
}

body.ds-chat #sidebar.collapsed > .d-flex {
    width: 56px !important;
    overflow: visible !important;
}

body.ds-chat #sidebar.collapsed .sidebar-content {
    display: flex !important;
    flex: 1 1 auto;
    min-height: 0;
    width: 56px;
    overflow: visible;
}

body.ds-chat #sidebar.collapsed .sidebar-content > *:not(.user-info-area):not(#user-menu) {
    display: none !important;
}

body.ds-chat #sidebar.collapsed .user-info-area {
    width: 56px;
    margin: auto 0 8px !important;
    padding: 8px 0 !important;
    justify-content: center;
}

body.ds-chat #sidebar.collapsed .user-info-area > span {
    display: none !important;
}

body.ds-chat #sidebar.collapsed .user-info-area .rounded-circle {
    width: 32px !important;
    height: 32px !important;
    margin: 0 !important;
}

body.ds-chat #sidebar.collapsed #user-menu.dropdown-menu {
    left: 60px !important;
    bottom: 12px !important;
    width: 200px !important;
    min-width: 200px !important;
    max-width: 220px !important;
}

body.ds-chat #sidebar.collapsed .sidebar-open-btn {
    display: flex !important;
    width: 56px !important;
    height: 52px !important;
    margin: 0 !important;
    padding: 0 !important;
    align-items: center !important;
    justify-content: center !important;
}

body.ds-chat #sidebar .border-bottom,
body.ds-chat #sidebar .border-top,
body.ds-chat #sidebarOffcanvas .border-bottom,
body.ds-chat #sidebarOffcanvas .border-top {
    border-color: transparent !important;
}

body.ds-chat .sidebar-brand {
    font-size: 15px;
    font-weight: 650;
    letter-spacing: -0.01em;
    color: var(--ds-ink);
    padding: 0 6px;
}

body.ds-chat .sidebar-brand:hover {
    color: var(--ds-ink);
}

body.ds-chat #sidebar .sidebar-content > .d-flex,
body.ds-chat #sidebar-mobile-content > .d-flex:first-child {
    padding: 12px 10px 8px !important;
    min-height: var(--ds-header);
}

body.ds-chat #sidebar .btn-icon,
body.ds-chat #sidebarOffcanvas .btn-icon {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    border: none !important;
    border-radius: 8px !important;
    color: var(--ds-ink-secondary) !important;
    background: transparent !important;
}

body.ds-chat #sidebar .btn-icon:hover,
body.ds-chat #sidebarOffcanvas .btn-icon:hover {
    background: rgba(17, 24, 39, 0.06) !important;
    color: var(--ds-ink) !important;
}

body.ds-chat #sidebar-search,
body.ds-chat #sidebar-search-mobile {
    height: 34px;
    border: none !important;
    border-radius: 8px !important;
    background: rgba(17, 24, 39, 0.05) !important;
    box-shadow: none !important;
    font-size: 13px;
    color: var(--ds-ink);
    padding-left: 12px;
}

body.ds-chat #sidebar-search:focus,
body.ds-chat #sidebar-search-mobile:focus {
    background: var(--ds-surface) !important;
    box-shadow: 0 0 0 1px var(--ds-line-strong) !important;
}

body.ds-chat #chat-groups,
body.ds-chat #chat-groups-mobile {
    padding: 4px 8px 12px;
}

body.ds-chat #chat-groups .fw-bold,
body.ds-chat #chat-groups-mobile .fw-bold {
    font-weight: 500 !important;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 11px !important;
    color: var(--ds-faint) !important;
    padding: 10px 8px 6px !important;
}

body.ds-chat .list-group-item {
    border-radius: 8px !important;
    margin: 1px 0;
    padding: 7px 8px !important;
    min-height: 34px;
    color: var(--ds-ink-secondary);
    font-size: 13.5px !important;
    background: transparent !important;
}

body.ds-chat .list-group-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

body.ds-chat .list-group-item .btn-light {
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--ds-faint);
    opacity: 0;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

body.ds-chat .list-group-item:hover .btn-light,
body.ds-chat .list-group-item:focus-within .btn-light {
    opacity: 1;
}

body.ds-chat .list-group-item .btn-light:hover {
    background: rgba(185, 28, 28, 0.08);
    color: var(--ds-danger);
}

body.ds-chat .list-group-item:hover {
    background: rgba(17, 24, 39, 0.05) !important;
    color: var(--ds-ink);
}

body.ds-chat .list-group-item.active,
body.ds-chat .list-group-item.active:hover,
body.ds-chat .list-group-item.active:focus {
    background: #e8e8ea !important;
    color: var(--ds-ink) !important;
    font-weight: 550;
}

body.ds-chat .user-info-area {
    margin: 8px;
    padding: 8px !important;
    border-radius: 10px;
    border-top: none !important;
    background: transparent;
}

body.ds-chat .user-info-area:hover {
    background: rgba(17, 24, 39, 0.05);
}

body.ds-chat .user-info-area .rounded-circle {
    width: 28px !important;
    height: 28px !important;
    background: var(--ds-ink) !important;
    font-size: 12px;
    font-weight: 600;
}

body.ds-chat #user-menu.dropdown-menu,
body.ds-chat #user-menu-mobile.dropdown-menu {
    width: calc(var(--ds-sidebar) - 16px) !important;
    min-width: calc(var(--ds-sidebar) - 16px) !important;
    max-width: calc(var(--ds-sidebar) - 16px) !important;
    left: 8px !important;
    border: 1px solid var(--ds-line) !important;
    border-radius: 12px !important;
    box-shadow: var(--ds-shadow) !important;
    padding: 6px !important;
    background: var(--ds-surface);
}

body.ds-chat #user-menu .dropdown-item,
body.ds-chat #user-menu-mobile .dropdown-item {
    border-radius: 8px !important;
    padding: 8px 10px !important;
    min-height: 34px !important;
    font-size: 13.5px;
    color: var(--ds-ink);
}

body.ds-chat #user-menu .dropdown-item:hover,
body.ds-chat #user-menu-mobile .dropdown-item:hover {
    background: var(--ds-bg-subtle);
}

/* Header */
body.ds-chat .chat-header-bar {
    left: var(--ds-sidebar);
    height: var(--ds-header);
    padding: 0 8px !important;
    background: rgba(255, 255, 255, 0.86) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--ds-line) !important;
    box-shadow: none !important;
}

body.ds-chat #sidebar.collapsed ~ .chat-header-bar {
    left: 56px !important;
}

body.ds-chat #model-select,
body.ds-chat #model-select-mobile {
    font-size: 14px !important;
    font-weight: 560 !important;
    color: var(--ds-ink) !important;
    border-radius: 8px !important;
    padding: 6px 28px 6px 10px !important;
}

body.ds-chat #model-select:hover,
body.ds-chat #model-select-mobile:hover,
body.ds-chat #model-select:focus,
body.ds-chat #model-select-mobile:focus {
    background: var(--ds-bg-subtle) !important;
    box-shadow: none !important;
    outline: none !important;
}

body.ds-chat .header-lang-switcher {
    gap: 2px;
    padding: 2px;
    margin-right: 8px;
    background: var(--ds-bg-subtle);
    border-radius: 8px;
}

body.ds-chat .header-lang-switcher button {
    border: none !important;
    border-radius: 6px !important;
    background: transparent !important;
    color: var(--ds-muted) !important;
    font-size: 12px !important;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 4px 8px !important;
    box-shadow: none !important;
}

body.ds-chat .header-lang-switcher button.active,
body.ds-chat .header-lang-switcher button.active:hover {
    background: var(--ds-surface) !important;
    color: var(--ds-ink) !important;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.06) !important;
}

body.ds-chat .mobile-menu-btn {
    border: none !important;
    background: transparent !important;
    color: var(--ds-ink) !important;
    border-radius: 8px !important;
}

/* Main column */
body.ds-chat .main-content {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding-top: var(--ds-header) !important;
    padding-left: var(--ds-sidebar) !important;
    padding-right: 0 !important;
    padding-bottom: 0 !important;
    height: 100vh !important;
    box-sizing: border-box !important;
    background: var(--ds-surface);
    display: flex;
    flex-direction: column;
}

body.ds-chat #sidebar.collapsed ~ .main-content {
    padding-left: 56px !important;
}

body.ds-chat .main-content > .container-lg {
    max-width: var(--ds-chat-col) !important;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}

body.ds-chat #main-container {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

body.ds-chat #chat-messages {
    flex: 1 1 auto;
    max-height: none !important;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 4px 168px !important;
}

body.ds-chat .welcome-message,
body.ds-chat .card:has(> .welcome-message),
body.ds-chat .card.rounded-3:has(.welcome-message) {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

body.ds-chat .welcome-message {
    min-height: 42vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ds-muted) !important;
    font-size: 15px;
    letter-spacing: -0.01em;
    padding: 32px 16px !important;
}

/* Messages */
body.ds-chat .message-wrapper {
    margin-bottom: 18px;
}

body.ds-chat .message-container {
    margin-bottom: 4px !important;
}

body.ds-chat .user-message-card {
    background: var(--ds-bg-subtle) !important;
    color: var(--ds-ink) !important;
    border-radius: 18px !important;
    max-width: min(78%, 560px);
    padding: 8px 12px !important;
    box-shadow: none !important;
    font-size: 15px;
    line-height: 1.55;
}

body.ds-chat .ai-message-body,
body.ds-chat .message-container .card.bg-white,
body.ds-chat .message-container .card-body {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

body.ds-chat .message-container .card-body,
body.ds-chat .ai-message-body {
    padding: 2px 2px 0 !important;
    color: var(--ds-ink);
    font-size: 15px;
    line-height: 1.65;
}

body.ds-chat .alert,
body.ds-chat .alert-primary,
body.ds-chat .alert-info,
body.ds-chat .alert-warning,
body.ds-chat .alert-success {
    background: transparent !important;
    color: var(--ds-ink) !important;
    border: none !important;
}

body.ds-chat .alert-danger {
    background: var(--ds-danger-soft) !important;
    color: var(--ds-danger) !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 12px 14px !important;
}

body.ds-chat .message-container pre,
body.ds-chat .alert pre {
    background: var(--ds-bg) !important;
    border: 1px solid var(--ds-line) !important;
    border-radius: 10px !important;
    padding: 12px 14px !important;
    font-family: var(--ds-mono);
    font-size: 13px;
}

body.ds-chat .message-container table th,
body.ds-chat .message-container table td,
body.ds-chat .alert table th,
body.ds-chat .alert table td {
    border-bottom: 1px solid var(--ds-line) !important;
    padding: 8px 10px !important;
}

body.ds-chat .stage-thinking {
    border-left: 2px solid var(--ds-line-strong);
    color: var(--ds-muted);
    border-radius: 0;
}

body.ds-chat .workflow-stage-card,
body.ds-chat .risk-assessment-form,
body.ds-chat .nurse-response-content {
    background: var(--ds-bg) !important;
    border: 1px solid var(--ds-line) !important;
    border-radius: 12px !important;
    box-shadow: none !important;
}

body.ds-chat .risk-assessment-form .card-header,
body.ds-chat .risk-assessment-form .card-body {
    background: transparent !important;
    padding: 14px 16px !important;
}

body.ds-chat .btn-icon.liked {
    color: var(--ds-success) !important;
    background: var(--ds-success-soft) !important;
}

body.ds-chat .btn-icon.disliked {
    color: var(--ds-danger) !important;
    background: var(--ds-danger-soft) !important;
}

/* Composer */
body.ds-chat .chat-input-bar {
    left: var(--ds-sidebar);
    background: linear-gradient(to top, #fff 70%, rgba(255, 255, 255, 0)) !important;
    border-top: none !important;
    box-shadow: none !important;
    padding: 8px 16px 14px !important;
}

body.ds-chat #sidebar.collapsed ~ .chat-input-bar {
    left: 56px !important;
}

body.ds-chat .chat-input-bar > .container-lg {
    max-width: var(--ds-chat-col) !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

body.ds-chat .composer {
    border: 1px solid var(--ds-line-strong);
    border-radius: 22px;
    background: var(--ds-surface);
    padding: 10px 10px 8px;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}

body.ds-chat .composer:focus-within {
    border-color: var(--ds-ink);
    box-shadow: 0 0 0 3px var(--ds-accent-ring);
}

body.ds-chat .composer #message-input {
    font-size: 15px;
    line-height: 1.5;
    color: var(--ds-ink);
    min-height: 44px;
}

body.ds-chat .composer #message-input::placeholder {
    color: var(--ds-faint);
}

body.ds-chat .composer-icon-btn {
    border-radius: 999px;
    color: var(--ds-ink-secondary);
}

body.ds-chat .composer-icon-btn:hover,
body.ds-chat .composer-icon-btn[aria-expanded="true"] {
    background: var(--ds-bg-subtle);
    color: var(--ds-ink);
}

body.ds-chat .ds-icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
    display: block;
}

body.ds-chat #sidebar svg,
body.ds-chat .chat-header-bar svg,
body.ds-chat .btn-icon svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.ds-chat .composer-switch .ds-icon,
body.ds-chat .composer-menu-item .ds-icon {
    width: 16px;
    height: 16px;
}

body.ds-chat .file-type-icon {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    color: var(--ds-ink-secondary);
}

body.ds-chat .composer-icon-btn svg,
body.ds-chat .composer-toolbar svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.ds-chat #send-button {
    color: var(--ds-muted);
}

body.ds-chat #send-button .ds-icon {
    fill: currentColor;
    stroke: none;
}

body.ds-chat #send-button.is-ready,
body.ds-chat #send-button.is-ready:hover,
body.ds-chat #send-button.is-ready:focus,
body.ds-chat #send-button.is-ready:active {
    background: var(--ds-ink) !important;
    color: #fff !important;
}

body.ds-chat #send-button.is-ready .ds-icon {
    color: #fff !important;
    fill: #fff !important;
    stroke: none !important;
    opacity: 1;
}

body.ds-chat .composer-switch.btn-primary .ds-icon,
body.ds-chat .composer-switch.btn-primary:hover .ds-icon,
body.ds-chat #voice-input-button.btn-primary,
body.ds-chat #voice-input-button.btn-primary svg {
    color: #fff !important;
    stroke: #fff !important;
}

body.ds-chat #voice-input-button.btn-primary,
body.ds-chat #voice-input-button.btn-primary:hover {
    background: var(--ds-ink) !important;
    color: #fff !important;
}

body.ds-chat .composer-switch.btn-primary {
    color: #fff !important;
}

body.ds-chat .composer-menu-item.btn-primary .ds-icon {
    stroke: currentColor;
}

body.ds-chat #send-button:disabled,
body.ds-chat .composer-icon-btn:disabled,
body.ds-chat .composer-switch:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

body.ds-chat .composer-switch {
    height: 30px;
    border: none !important;
    border-radius: 999px !important;
    background: var(--ds-bg-subtle) !important;
    color: var(--ds-ink-secondary) !important;
    font-size: 12.5px !important;
    font-weight: 500;
}

body.ds-chat .composer-switch:hover {
    background: #e8e8ea !important;
    color: var(--ds-ink) !important;
}

body.ds-chat .composer-switch.btn-primary {
    background: var(--ds-ink) !important;
    color: #fff !important;
    border-color: transparent !important;
}

body.ds-chat .composer-menu {
    border: 1px solid var(--ds-line);
    border-radius: 14px;
    box-shadow: var(--ds-shadow);
    padding: 6px;
}

body.ds-chat .composer-menu-item {
    border-radius: 8px !important;
    font-size: 13.5px;
    color: var(--ds-ink) !important;
}

body.ds-chat .composer-menu-item.btn-primary,
body.ds-chat .composer-menu-item.btn-primary:hover,
body.ds-chat .composer-menu-item.btn-primary:focus,
body.ds-chat .composer-menu-item.btn-primary:active {
    background: var(--ds-bg-subtle) !important;
    color: var(--ds-ink) !important;
    border-color: transparent !important;
    font-weight: 600;
}

body.ds-chat .composer-menu-item.btn-primary .ds-icon,
body.ds-chat .composer-menu-item.btn-primary:hover .ds-icon {
    color: var(--ds-ink) !important;
    stroke: currentColor !important;
    fill: none !important;
}

body.ds-chat .center-tip {
    color: var(--ds-faint);
    font-size: 12px;
    margin-top: 8px;
}

body.ds-chat .composer-chip {
    background: var(--ds-bg-subtle);
    color: var(--ds-ink);
}

body.ds-chat #toggle-input-bar-btn {
    border: 1px solid var(--ds-line) !important;
    box-shadow: var(--ds-shadow) !important;
    background: var(--ds-surface) !important;
    color: var(--ds-ink) !important;
}

/* Modals */
body.ds-chat .modal-content {
    border: 1px solid var(--ds-line) !important;
    border-radius: 16px !important;
    box-shadow: var(--ds-shadow) !important;
}

body.ds-chat #login-modal .modal-content {
    border-radius: 16px !important;
}

body.ds-chat #login-modal .tabs .tab,
body.ds-chat #login-modal .tab.active {
    color: var(--ds-muted) !important;
    border-bottom-color: transparent !important;
    font-weight: 560;
}

body.ds-chat #login-modal #login-tab.tab.active,
body.ds-chat #login-modal #register-tab.tab.active {
    color: var(--ds-ink) !important;
    border-bottom: 2px solid var(--ds-ink) !important;
}

body.ds-chat .form-control,
body.ds-chat .form-select {
    border: 1px solid var(--ds-line-strong);
    border-radius: 10px;
    min-height: 40px;
    box-shadow: none;
}

body.ds-chat .form-control:focus,
body.ds-chat .form-select:focus {
    border-color: var(--ds-ink);
    box-shadow: 0 0 0 3px var(--ds-accent-ring);
}

body.ds-chat .btn-primary {
    background: var(--ds-ink) !important;
    border-color: var(--ds-ink) !important;
    color: #fff !important;
    border-radius: 10px;
}

body.ds-chat .btn-primary:hover {
    background: var(--ds-accent-hover) !important;
    color: #fff !important;
}

body.ds-chat .btn-primary:disabled {
    opacity: 0.45;
}

body.ds-chat #fake-scrollbar .thumb {
    background: rgba(17, 24, 39, 0.18);
    width: 6px;
    left: 3px;
    border-radius: 99px;
}

@media (max-width: 767.98px) {
    body.ds-chat {
        overflow: auto;
    }

    body.ds-chat .chat-header-bar,
    body.ds-chat .chat-input-bar,
    body.ds-chat .main-content,
    body.ds-chat #sidebar.collapsed ~ .main-content {
        left: 0 !important;
    }

    body.ds-chat .main-content,
    body.ds-chat #sidebar.collapsed ~ .main-content {
        padding-left: 0 !important;
    }

    body.ds-chat .main-content {
        height: auto !important;
        min-height: 100vh;
        padding-top: var(--ds-header) !important;
        padding-bottom: 180px !important;
    }

    body.ds-chat #chat-messages {
        max-height: none !important;
    }

    body.ds-chat .user-message-card {
        max-width: 88%;
    }

    body.ds-chat .list-group-item .btn-light {
        opacity: 1;
    }

    body.ds-chat #sidebarOffcanvas {
        background: var(--ds-bg) !important;
        border-right: 1px solid var(--ds-line) !important;
        box-shadow: var(--ds-shadow) !important;
    }

    body.ds-chat #user-menu-mobile.dropdown-menu {
        width: min(280px, calc(100vw - 24px)) !important;
        min-width: 0 !important;
        max-width: calc(100vw - 24px) !important;
        left: 12px !important;
        border-radius: 12px !important;
    }
}

body.ds-chat .report-workflow {
    margin: 2px 0 8px;
}

body.ds-chat .report-export-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

body.ds-chat .report-export-btn {
    border: 1px solid var(--ds-line-strong);
    background: #fff;
    color: var(--ds-ink);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

body.ds-chat .report-export-btn:hover {
    background: var(--ds-bg-subtle);
}

body.ds-chat .report-export-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

body.ds-chat .report-stepper {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2px;
    margin: 0 0 14px;
}

body.ds-chat .report-step {
    position: relative;
    border: 0;
    background: transparent;
    padding: 0 2px 2px;
    color: var(--ds-muted);
    cursor: pointer;
    min-width: 0;
}

body.ds-chat .report-step:disabled {
    cursor: default;
}

body.ds-chat .report-step-mark {
    width: 22px;
    height: 22px;
    margin: 0 auto 6px;
    border-radius: 50%;
    border: 1.5px solid var(--ds-line-strong);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    line-height: 1;
    position: relative;
    z-index: 1;
}

body.ds-chat .report-step::before {
    content: "";
    position: absolute;
    top: 11px;
    left: -50%;
    width: 100%;
    height: 1.5px;
    background: var(--ds-line-strong);
    z-index: 0;
}

body.ds-chat .report-step:first-child::before {
    display: none;
}

body.ds-chat .report-step.is-done .report-step-mark,
body.ds-chat .report-step.is-current .report-step-mark {
    background: var(--ds-ink);
    border-color: var(--ds-ink);
    color: #fff;
}

body.ds-chat .report-step.is-done::before,
body.ds-chat .report-step.is-current::before {
    background: var(--ds-ink);
}

body.ds-chat .report-step-label {
    display: block;
    font-size: 12px;
    line-height: 1.3;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.ds-chat .report-step.is-selected .report-step-label,
body.ds-chat .report-step.is-current .report-step-label {
    color: var(--ds-ink);
    font-weight: 640;
}

body.ds-chat .report-step:focus-visible {
    outline: 2px solid var(--ds-ink);
    outline-offset: 2px;
    border-radius: 8px;
}

body.ds-chat .report-stage-kicker {
    font-size: 14px;
    font-weight: 640;
    letter-spacing: -0.01em;
    color: var(--ds-ink);
    margin: 0 0 10px;
}

body.ds-chat .report-workflow .workflow-stage-card {
    background: #fff !important;
    border: 1px solid var(--ds-line) !important;
    border-radius: 12px !important;
    padding: 14px 16px !important;
    box-shadow: none !important;
}

body.ds-chat .report-workflow .stage-content {
    border-left: none !important;
    padding-left: 0 !important;
    color: var(--ds-ink);
    font-size: 14px;
    line-height: 1.6;
}

body.ds-chat .report-workflow .stage-content h1,
body.ds-chat .report-workflow .stage-content h2,
body.ds-chat .report-workflow .stage-content h3,
body.ds-chat .report-workflow .stage-content h4,
body.ds-chat .report-workflow .stage-content h5,
body.ds-chat .report-workflow .stage-content h6 {
    color: var(--ds-ink);
    font-weight: 640;
    letter-spacing: -0.015em;
    line-height: 1.35;
    margin: 14px 0 6px;
}

body.ds-chat .report-workflow .stage-content h1 { font-size: 16px; }
body.ds-chat .report-workflow .stage-content h2 { font-size: 15px; }
body.ds-chat .report-workflow .stage-content h3 { font-size: 14px; }
body.ds-chat .report-workflow .stage-content h4,
body.ds-chat .report-workflow .stage-content h5,
body.ds-chat .report-workflow .stage-content h6 { font-size: 13.5px; }

body.ds-chat .report-workflow .stage-content :is(h1, h2, h3, h4, h5, h6):first-child {
    margin-top: 0;
}

body.ds-chat .report-workflow .stage-content p {
    margin: 0 0 8px;
}

body.ds-chat .report-workflow .stage-content ul,
body.ds-chat .report-workflow .stage-content ol {
    margin: 2px 0 10px;
    padding-left: 1.15em;
}

body.ds-chat .report-workflow .stage-content li {
    margin: 2px 0;
}

body.ds-chat .report-workflow .stage-content li p {
    margin: 0;
}

body.ds-chat .report-workflow .stage-content hr {
    border: 0;
    border-top: 1px solid var(--ds-line);
    margin: 12px 0;
    opacity: 1;
}

body.ds-chat .report-workflow .workflow-stage-card table {
    width: 100%;
    border-collapse: collapse;
    margin: 4px 0 12px;
    font-size: 13px;
    line-height: 1.45;
}

body.ds-chat .report-workflow .workflow-stage-card th,
body.ds-chat .report-workflow .workflow-stage-card td {
    border-bottom: 1px solid var(--ds-line);
    padding: 7px 8px;
    text-align: left;
    vertical-align: top;
}

body.ds-chat .report-workflow .workflow-stage-card th {
    font-size: 12px;
    font-weight: 600;
    color: var(--ds-muted);
}

body.ds-chat .report-think-btn {
    border: 0;
    background: transparent;
    color: var(--ds-muted);
    font-size: 12px;
    padding: 0 0 8px;
    cursor: pointer;
}

@media (max-width: 767.98px) {
    body.ds-chat .report-stepper {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        row-gap: 10px;
    }

    body.ds-chat .report-step::before {
        display: none;
    }

    body.ds-chat .report-step-label {
        white-space: normal;
    }
}

body.ds-chat .user-message-card img {
    max-width: 200px;
}

body.ds-chat .imaging-result,
body.ds-chat .imaging-section {
    border: 1px solid var(--ds-line);
    border-radius: 12px;
    background: #fff;
    padding: 14px 16px;
    margin: 0 0 12px;
}

body.ds-chat .imaging-result h3,
body.ds-chat .imaging-section h3 {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 640;
    letter-spacing: -0.01em;
}

body.ds-chat .imaging-frame {
    position: relative;
}

body.ds-chat .imaging-photo {
    display: block;
    width: 100%;
    max-width: 640px;
    height: auto;
    border-radius: 10px;
    cursor: pointer;
    background: #111;
}

body.ds-chat .imaging-toggle {
    display: inline-flex;
    gap: 2px;
    margin-top: 10px;
    padding: 2px;
    border-radius: 999px;
    background: var(--ds-bg-subtle);
}

body.ds-chat .imaging-toggle button {
    border: 0;
    background: transparent;
    color: var(--ds-muted);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
}

body.ds-chat .imaging-toggle button.is-active {
    background: #fff;
    color: var(--ds-ink);
    font-weight: 600;
}

body.ds-chat .imaging-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

body.ds-chat .imaging-stats div {
    min-width: 0;
}

body.ds-chat .imaging-stats span {
    display: block;
    color: var(--ds-muted);
    font-size: 12px;
    margin-bottom: 2px;
}

body.ds-chat .imaging-stats strong {
    display: block;
    font-size: 14px;
    font-weight: 640;
}

body.ds-chat .imaging-section-body {
    font-size: 14px;
    line-height: 1.6;
}

body.ds-chat .imaging-section-body p:last-child {
    margin-bottom: 0;
}

body.ds-chat .imaging-impression {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.55;
}

body.ds-chat .imaging-findings {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

body.ds-chat .imaging-findings div {
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--ds-bg-subtle);
}

body.ds-chat .imaging-findings strong {
    display: block;
    font-size: 13px;
    font-weight: 640;
}

body.ds-chat .imaging-findings p,
body.ds-chat .imaging-note {
    margin: 4px 0 0;
    color: var(--ds-muted);
    font-size: 13px;
    line-height: 1.5;
}

/* Login */
body.ds-auth {
    background:
        radial-gradient(900px 420px at 50% -10%, #eceff3 0%, transparent 60%),
        var(--ds-bg);
}

body.ds-auth .container {
    max-width: 400px;
}

body.ds-auth .logo-container h1 {
    font-size: 22px;
    font-weight: 640;
    letter-spacing: -0.03em;
    color: var(--ds-ink);
    margin: 0;
}

body.ds-auth .logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

body.ds-auth .form-container {
    border: 1px solid var(--ds-line);
    border-radius: 16px;
    box-shadow: none;
    padding: 24px;
}

body.ds-auth .tabs {
    border-bottom: 1px solid var(--ds-line);
    margin-bottom: 20px;
    gap: 4px;
}

body.ds-auth .tab {
    padding: 10px 8px;
    font-size: 14px;
    font-weight: 560;
    color: var(--ds-muted);
    border-bottom: 2px solid transparent;
}

body.ds-auth .tab.active {
    color: var(--ds-ink);
    border-bottom-color: var(--ds-ink);
}

body.ds-auth .form-group label {
    font-size: 13px;
    font-weight: 560;
    color: var(--ds-ink-secondary);
}

body.ds-auth .form-control {
    border: 1px solid var(--ds-line-strong);
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--ds-surface);
    color: var(--ds-ink);
}

body.ds-auth .form-control:focus {
    border-color: var(--ds-ink);
    box-shadow: 0 0 0 3px var(--ds-accent-ring);
}

body.ds-auth .form-control:disabled,
body.ds-auth .form-control[readonly] {
    background: var(--ds-bg-subtle);
    color: var(--ds-muted);
}

body.ds-auth .btn {
    border-radius: 10px;
    background: var(--ds-ink);
    font-weight: 560;
    min-height: 42px;
}

body.ds-auth .btn:hover {
    background: var(--ds-accent-hover);
}

body.ds-auth .btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

body.ds-auth #guest-login-btn {
    background: transparent !important;
    color: var(--ds-ink) !important;
    border: 1px solid var(--ds-line-strong) !important;
}

body.ds-auth #guest-login-btn:hover {
    background: var(--ds-bg-subtle) !important;
}

body.ds-auth .error-message {
    color: var(--ds-danger);
}

body.ds-auth .lang-switcher button,
body.ds-settings .lang-switcher button,
body.ds-profile .lang-switcher button {
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    box-shadow: none;
    color: var(--ds-muted);
    font-weight: 560;
    font-size: 13px;
}

body.ds-auth .lang-switcher button.active,
body.ds-settings .lang-switcher button.active,
body.ds-profile .lang-switcher button.active {
    background: var(--ds-ink);
    color: #fff;
    border-color: var(--ds-ink);
}

/* Settings */
body.ds-settings {
    background: var(--ds-bg);
    padding: 48px 20px 64px;
}

body.ds-settings .container {
    max-width: 640px;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

body.ds-settings .back-link {
    color: var(--ds-muted);
    font-size: 13px;
    font-weight: 560;
    margin-bottom: 20px;
}

body.ds-settings .back-link:hover {
    color: var(--ds-ink);
}

body.ds-settings .header {
    border-bottom: none;
    margin-bottom: 8px;
    padding-bottom: 0;
}

body.ds-settings .header h1 {
    font-size: 28px;
    letter-spacing: -0.03em;
    font-weight: 640;
}

body.ds-settings .header p {
    color: var(--ds-muted);
}

body.ds-settings .section {
    background: var(--ds-surface);
    border: 1px solid var(--ds-line);
    border-radius: 16px;
    padding: 20px 20px 8px;
    margin-top: 16px;
}

body.ds-settings .section-title {
    font-size: 14px;
    font-weight: 620;
    letter-spacing: -0.01em;
}

body.ds-settings .form-control {
    border: 1px solid var(--ds-line-strong);
    border-radius: 10px;
    min-height: 40px;
}

body.ds-settings .form-control:focus {
    border-color: var(--ds-ink);
    box-shadow: 0 0 0 3px var(--ds-accent-ring);
}

body.ds-settings .form-control[readonly] {
    background: var(--ds-bg-subtle);
    color: var(--ds-muted);
}

body.ds-settings .btn-primary {
    background: var(--ds-ink);
    border-radius: 10px;
    font-weight: 560;
}

body.ds-settings .btn-primary:hover {
    background: var(--ds-accent-hover);
}

body.ds-settings .alert-success,
body.ds-settings .alert-error {
    border: none;
    border-radius: 10px;
}

body.ds-settings .alert-success {
    background: var(--ds-success-soft);
    color: var(--ds-success);
}

body.ds-settings .alert-error {
    background: var(--ds-danger-soft);
    color: var(--ds-danger);
}

/* Profile */
body.ds-profile {
    background: var(--ds-bg);
}

body.ds-profile .sidebar {
    width: 280px;
    background: var(--ds-surface);
    border-right: 1px solid var(--ds-line);
    align-items: stretch;
    padding: 28px 16px 20px;
}

body.ds-profile .profile-avatar {
    width: 64px !important;
    height: 64px !important;
    margin: 8px auto 12px !important;
    background: var(--ds-ink) !important;
    font-size: 22px !important;
    font-weight: 620;
}

body.ds-profile .user-name {
    text-align: center;
    font-size: 16px !important;
    letter-spacing: -0.02em;
    margin-bottom: 16px !important;
}

body.ds-profile .user-info-list .info-item {
    border-bottom: none;
    padding: 8px 4px;
    font-size: 13px;
    color: var(--ds-muted);
    gap: 12px;
}

body.ds-profile .user-info-list .info-item span:first-child {
    white-space: nowrap;
}

body.ds-profile .user-info-list .info-item span:last-child {
    color: var(--ds-ink);
    font-weight: 520;
    text-align: right;
}

body.ds-profile .stat-number {
    font-size: 28px;
    font-weight: 640;
    letter-spacing: -0.04em;
    color: var(--ds-ink);
    line-height: 1.1;
}

body.ds-profile .stat-label {
    margin-top: 4px;
    font-size: 13px;
    color: var(--ds-muted);
}

body.ds-profile .btn-back-chat,
body.ds-profile .sidebar .btn-primary {
    width: 100% !important;
    margin: 16px 0 8px !important;
    background: var(--ds-ink) !important;
    border: none !important;
    border-radius: 10px !important;
    font-weight: 560;
}

body.ds-profile .btn-logout {
    width: 100% !important;
    margin-top: 4px !important;
    border-radius: 10px !important;
    border-color: var(--ds-line-strong) !important;
    color: var(--ds-danger) !important;
    background: transparent !important;
}

body.ds-profile .main-content {
    margin-left: 280px;
    padding: 28px 28px 48px;
    background: var(--ds-bg);
}

body.ds-profile .nav-tabs {
    border-bottom: none;
    gap: 6px;
    margin-bottom: 12px;
}

body.ds-profile .nav-tabs .nav-link {
    border: none !important;
    border-radius: 999px !important;
    background: transparent !important;
    color: var(--ds-muted) !important;
    padding: 6px 12px;
    font-size: 13.5px;
    font-weight: 560;
}

body.ds-profile .nav-tabs .nav-link.active {
    background: var(--ds-ink) !important;
    color: #fff !important;
}

body.ds-profile .tab-content {
    background: transparent;
    box-shadow: none;
    padding: 8px 0 0;
}

body.ds-profile .stat-item,
body.ds-profile .tab-content .card {
    background: var(--ds-surface) !important;
    border: 1px solid var(--ds-line) !important;
    border-radius: 14px !important;
    box-shadow: none !important;
    padding: 16px !important;
}

body.ds-profile .file-item {
    background: var(--ds-surface);
    border: 1px solid var(--ds-line);
    box-shadow: none;
}

body.ds-profile .file-item:hover {
    transform: none;
    background: var(--ds-bg-subtle);
    box-shadow: none;
}

body.ds-profile .file-action-btn {
    border-radius: 8px;
    border-color: var(--ds-line-strong);
}

body.ds-profile .empty-state,
body.ds-profile .loading {
    color: var(--ds-muted);
}

@media (max-width: 900px) {
    body.ds-profile .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--ds-line);
        padding-top: 72px;
    }

    body.ds-profile .main-content {
        margin-left: 0;
        padding: 16px 14px 32px;
    }
}
