.ocs-wrap,
.ocs-wrap * {
    box-sizing: border-box;
}

.ocs-wrap {
    color: inherit;
}

.ocs-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 15px;
}

.ocs-eyebrow {
    margin: 0 0 4px;
    color: var(--focus-color);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
}

.ocs-hero h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
}

.ocs-subtitle,
.ocs-panel-head p,
.ocs-empty p,
.ocs-model-summary {
    color: var(--muted-2-color);
    line-height: 1.7;
}

.ocs-subtitle {
    max-width: 760px;
    margin: 5px 0 0;
    font-size: 13px;
}

.ocs-page-link {
    border: 0;
    white-space: nowrap;
}

.ocs-wrap .but.b-theme,
.ocs-wrap .but.b-theme:focus,
.ocs-wrap .but.b-theme:hover,
.ocs-wrap .but.b-theme:active {
    background: #2997f7 !important;
    border-color: #2997f7 !important;
    color: #fff !important;
    --this-bg: #2997f7;
    --this-border: #2997f7;
    --this-color: #fff;
}

.ocs-wrap [data-ocs-submit],
.ocs-wrap [data-ocs-submit]:focus,
.ocs-wrap [data-ocs-submit]:hover,
.ocs-wrap [data-ocs-submit]:active {
    background: #2997f7 !important;
    border-color: #2997f7 !important;
    color: #fff !important;
    --this-bg: #2997f7;
    --this-border: #2997f7;
    --this-color: #fff;
}

.ocs-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.ocs-panel-head h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
}

.ocs-panel-head p {
    margin: 3px 0 0;
    font-size: 12px;
}

.ocs-count {
    flex: 0 0 auto;
}

.ocs-list {
    display: grid;
    gap: 8px;
}

@media (min-width: 1180px) {
    .ocs-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ocs-meta {
        grid-template-columns: 1fr 0.75fr;
    }
}

.ocs-card {
    --this-bg: var(--body-bg-color);
    padding: 10px;
}

.ocs-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.ocs-card h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
}

.ocs-card-top p {
    margin: 3px 0 0;
    color: var(--muted-2-color);
    font-size: 12px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.ocs-status.is-fail {
    --this-color: #ff5473;
    --this-bg: rgba(255, 84, 115, 0.1);
}

.ocs-status.is-checking {
    --this-color: #2997f7;
    --this-bg: rgba(41, 151, 247, 0.1);
}

.ocs-status.is-partial {
    --this-color: #f0ad4e;
    --this-bg: rgba(240, 173, 78, 0.12);
}

.ocs-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(120px, 0.45fr) minmax(120px, 0.5fr);
    gap: 6px;
    margin-bottom: 8px;
}

.ocs-meta > div {
    min-width: 0;
    padding: 7px 8px;
    border-radius: var(--main-radius);
    background: var(--main-bg-color);
    border: 1px solid var(--main-border-color);
}

.ocs-meta span {
    display: block;
    margin-bottom: 3px;
    color: var(--muted-2-color);
    font-size: 12px;
    font-weight: 700;
}

.ocs-meta code {
    display: block;
    max-width: 100%;
    color: inherit;
    background: transparent;
    font-family: Consolas, Monaco, monospace;
    font-size: 11px;
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: anywhere;
}

.ocs-models-meta {
    grid-column: 1 / -1;
}

.ocs-model-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.ocs-model-pills code {
    display: inline-flex;
    width: auto;
    max-width: 100%;
    padding: 2px 7px;
    border-radius: 50px;
    background: var(--focus-color-opacity1);
    color: var(--focus-color);
}

.ocs-model-pills code.is-ok {
    background: rgba(18, 185, 40, 0.12);
    color: #12b928;
}

.ocs-model-pills code.is-fail {
    background: rgba(255, 84, 115, 0.12);
    color: #ff5473;
}

.ocs-model-pills code.is-unknown {
    background: var(--focus-color-opacity1);
    color: var(--focus-color);
}

.ocs-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.ocs-actions .but {
    margin: 0;
    padding: 0.22em 0.5em;
    font-size: 12px;
}

.ocs-empty {
    --this-bg: var(--body-bg-color);
    text-align: center;
    padding: 14px;
}

.ocs-empty h3 {
    margin: 0;
    font-size: 16px;
}

.ocs-empty p {
    margin: 8px 0 0;
    font-size: 14px;
}

.ocs-modal[hidden] {
    display: none !important;
}

.ocs-modal {
    z-index: 100060;
}

.ocs-modal .modal-dialog {
    width: min(520px, calc(100% - 20px));
}

.ocs-import-modal .modal-dialog {
    width: min(420px, calc(100% - 20px));
}

.ocs-modal .modal-content {
    position: relative;
}

.ocs-modal-body {
    padding: 14px;
}

.ocs-modal-close {
    position: absolute;
    top: 7px;
    right: 9px;
    z-index: 2;
    border: 0;
    background: transparent;
    color: var(--muted-2-color);
    font-size: 26px;
    line-height: 1;
}

.ocs-modal-title {
    margin: 0 34px 12px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--main-border-color);
}

.ocs-modal-title b {
    display: block;
    font-size: 16px;
    line-height: 1.35;
}

.ocs-modal-title p {
    margin: 4px 0 0;
    color: var(--muted-2-color);
    font-size: 13px;
    line-height: 1.7;
}

.ocs-form {
    display: grid;
    gap: 10px;
}

.ocs-import-form {
    display: grid;
    gap: 12px;
}

.ocs-claude-fields {
    display: grid;
    gap: 10px;
}

.ocs-claude-fields[hidden] {
    display: none;
}

.ocs-field {
    display: grid;
    gap: 5px;
    margin: 0;
}

.ocs-field > span {
    font-size: 13px;
    font-weight: 700;
}

.ocs-field input.form-control {
    width: 100%;
}

.ocs-app-radios {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.ocs-app-radios label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
}

.ocs-app-radios input {
    width: 15px;
    height: 15px;
    margin: 0;
}

.ocs-key-input,
.ocs-model-input {
    display: grid;
    gap: 8px;
}

.ocs-key-input {
    grid-template-columns: minmax(0, 1fr) 74px;
}

.ocs-model-input {
    grid-template-columns: minmax(0, 1fr) 76px;
}

.ocs-key-input .but,
.ocs-model-input .but {
    margin: 0;
}

.ocs-model-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ocs-model-toolbar .but {
    margin: 0;
    font-size: 13px;
}

.ocs-model-summary {
    min-height: 20px;
    font-size: 13px;
}

.ocs-model-options {
    display: grid;
    max-height: 170px;
    overflow: auto;
    gap: 5px;
    padding: 6px;
    border: 1px solid var(--main-border-color);
    border-radius: var(--main-radius);
    background: var(--body-bg-color);
}

.ocs-model-options:empty {
    display: none;
}

.ocs-model-options label {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    min-width: 0;
    margin: 0;
    padding: 5px 7px;
    border-radius: var(--main-radius);
    background: var(--main-bg-color);
    cursor: pointer;
    font-size: 13px;
    line-height: 1.45;
}

.ocs-model-options input {
    width: 15px;
    min-width: 15px;
    height: 15px;
    min-height: 15px;
    margin: 2px 0 0;
    padding: 0;
}

.ocs-model-options span {
    min-width: 0;
    overflow-wrap: anywhere;
    font-family: Consolas, Monaco, monospace;
    font-weight: 400;
}

.ocs-note {
    margin: 0;
    padding: 7px 9px;
    border-radius: var(--main-radius);
    background: var(--this-bg);
    color: var(--this-color);
    font-size: 13px;
    line-height: 1.7;
}

.ocs-modal-actions {
    display: flex;
    gap: 6px;
    margin-top: 2px;
}

.ocs-modal-actions .but {
    flex: 1;
    margin: 0;
}

.ocs-form-message {
    min-height: 22px;
    margin: -4px 0 8px;
    padding: 7px 9px;
    border-radius: var(--main-radius);
    background: var(--body-bg-color);
    color: var(--muted-2-color);
    font-size: 13px;
    line-height: 1.6;
}

.ocs-form-message.is-success {
    background: rgba(18, 185, 40, 0.1);
    color: #12b928;
}

.ocs-form-message.is-error {
    background: rgba(255, 84, 115, 0.1);
    color: #ff5473;
}

.ocs-form-message:empty {
    display: none;
}

body.ocs-modal-open {
    overflow: hidden;
}

.ocs-submit[disabled],
.ocs-actions button[disabled],
.ocs-model-input button[disabled],
.ocs-model-toolbar button[disabled] {
    cursor: wait;
    opacity: 0.65;
}

@media (max-width: 640px) {
    .ocs-hero,
    .ocs-panel-head,
    .ocs-card-top {
        align-items: stretch;
        flex-direction: column;
    }

    .ocs-hero h1 {
        font-size: 20px;
    }

    .ocs-page-link {
        width: 100%;
        margin: 0;
    }

    .ocs-meta {
        grid-template-columns: 1fr;
    }

    .ocs-actions .but {
        flex: 1 1 calc(50% - 6px);
    }

    .ocs-modal .modal-dialog,
    .ocs-import-modal .modal-dialog {
        width: 100%;
        max-width: calc(100% - 20px);
    }

    .ocs-modal-body {
        padding: 12px;
    }

    .ocs-key-input,
    .ocs-model-input {
        grid-template-columns: 1fr;
    }

    .ocs-model-toolbar .but {
        flex: 1 1 calc(33.333% - 6px);
    }
}
