.task-detail-view {
    max-width: 1280px;
}

.task-detail-header {
    padding-bottom: 18px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--bs-border-color);
}

.task-detail-breadcrumb {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 6px;
    color: var(--bs-secondary-color);
    font-size: 13px;
    font-weight: 700;
}

.task-detail-title {
    display: block;
    width: 100%;
    margin: -4px -6px 12px;
    padding: 4px 6px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--bs-body-color);
    text-align: left;
    font-size: 30px;
    font-weight: 800;
}

.task-detail-title:hover,
.task-detail-title:focus,
.task-inline-field:hover,
.task-inline-field:focus {
    border-color: var(--bs-border-color);
    background: var(--bs-secondary-bg);
    outline: 0;
}

.task-detail-title.is-readonly:hover,
.task-detail-title.is-readonly:focus,
.task-inline-field.is-readonly:hover,
.task-inline-field.is-readonly:focus {
    border-color: transparent;
    background: transparent;
}

.task-detail-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.task-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.task-status-slot {
    display: flex;
    justify-content: flex-end;
    min-width: 150px;
}

.task-status-control {
    position: relative;
}

.task-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 5px 10px;
    border: 1px solid color-mix(in srgb, var(--task-status-color, var(--color-accent)) 55%, var(--bs-border-color));
    border-radius: 999px;
    background: color-mix(in srgb, var(--task-status-color, var(--color-accent)) 16%, transparent);
    color: var(--bs-body-color);
    font-size: 13px;
    font-weight: 800;
}

.task-status-button {
    cursor: pointer;
}

.task-status-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 12;
    display: grid;
    min-width: 190px;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    background: var(--bs-body-bg);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

.task-status-menu button {
    display: grid;
    gap: 2px;
    padding: 9px 11px;
    border: 0;
    border-bottom: 1px solid var(--bs-border-color);
    background: transparent;
    color: var(--bs-body-color);
    text-align: left;
    font-weight: 800;
}

.task-status-menu button:last-child {
    border-bottom: 0;
}

.task-status-menu button:hover,
.task-status-menu button:focus {
    background: var(--bs-secondary-bg);
    outline: 0;
}

.task-status-menu small {
    color: var(--bs-secondary-color);
    font-size: 12px;
    font-weight: 700;
}

.task-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 32px;
    align-items: start;
}

.task-detail-panel {
    margin-bottom: 28px;
}

.task-detail-panel h2 {
    margin: 0 0 14px;
    color: var(--bs-body-color);
    font-size: 16px;
    font-weight: 800;
}

.task-detail-description {
    min-height: 90px;
    color: var(--bs-body-color);
    line-height: 1.6;
    white-space: pre-wrap;
}

.task-custom-field-list {
    display: grid;
    gap: 10px;
}

.task-custom-field-row {
    display: grid;
    grid-template-columns: minmax(160px, 0.45fr) minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.task-custom-field-row > span {
    color: var(--bs-secondary-color);
    font-size: 14px;
    font-weight: 700;
}

.task-custom-field-value {
    display: block;
    min-height: 34px;
    padding: 5px 7px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--bs-body-color);
    font-weight: 700;
    white-space: pre-wrap;
}

.task-custom-field-value:hover,
.task-custom-field-value:focus {
    border-color: var(--bs-border-color);
    background: var(--bs-secondary-bg);
    outline: 0;
}

.task-custom-field-value.is-readonly:hover,
.task-custom-field-value.is-readonly:focus {
    border-color: transparent;
    background: transparent;
}

.task-custom-field-value.is-empty {
    color: var(--bs-secondary-color);
    font-style: italic;
}

.task-inline-field {
    width: 100%;
    min-height: 34px;
    padding: 5px 7px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--bs-body-color);
    text-align: left;
}

.task-inline-field.is-empty {
    color: var(--bs-secondary-color);
    font-style: italic;
}

.task-inline-field.is-saving {
    opacity: 0.65;
    pointer-events: none;
}

.task-inline-form {
    display: grid;
    gap: 8px;
}

.task-inline-actions {
    display: flex;
    gap: 8px;
}

.task-inline-actions .btn {
    display: inline-grid;
    width: 36px;
    height: 32px;
    place-items: center;
    padding: 0;
}

.task-inline-input,
.task-inline-select {
    width: 100%;
}

textarea.task-inline-input {
    min-height: 120px;
    resize: vertical;
}

.task-detail-meta {
    display: grid;
    gap: 12px;
}

.task-detail-meta-row {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    font-size: 14px;
}

.task-detail-meta-row > span {
    color: var(--bs-secondary-color);
    font-weight: 700;
}

.task-detail-meta-row > strong {
    min-width: 0;
    color: var(--bs-body-color);
    font-weight: 700;
}

.meta-badge,
.meta-user {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    gap: 7px;
    color: var(--bs-body-color);
    font-weight: 700;
}

.meta-icon {
    display: inline-block;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px;
    max-width: 16px !important;
    max-height: 16px !important;
    object-fit: contain;
}

.task-comments-panel {
    max-width: 760px;
}

.task-comment-form {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.task-comment-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.task-comment-status {
    color: var(--bs-secondary-color);
    font-size: 13px;
    font-weight: 700;
}

.task-comment-list {
    display: grid;
    gap: 12px;
}

.task-comment {
    margin-left: calc(var(--comment-depth, 0) * 28px);
    padding: 12px 14px;
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    background: var(--bs-body-bg);
}

.task-comment.is-reply {
    border-left: 3px solid var(--color-accent);
}

.task-comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.task-comment-id {
    color: var(--bs-secondary-color);
    font-size: 12px;
    font-weight: 800;
}

.task-comment-body {
    margin-bottom: 10px;
    color: var(--bs-body-color);
    line-height: 1.55;
    white-space: pre-wrap;
}

.task-comment-reply-form,
.task-comment-edit-form {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.task-comment-reply-actions {
    display: flex;
    gap: 8px;
}

.task-comment-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.task-comment-action {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--bs-secondary-color);
    font-size: 13px;
    font-weight: 800;
}

.task-comment-action:hover,
.task-comment-action:focus {
    color: var(--bs-body-color);
}

@media (max-width: 1000px) {
    .task-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .task-detail-action-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .task-status-slot {
        justify-content: flex-start;
    }

    .task-detail-meta-row {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .task-custom-field-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .task-comment {
        margin-left: calc(var(--comment-depth, 0) * 14px);
    }
}
