:root {
    --kb-ink: #172033;
    --kb-muted: #5b6474;
    --kb-panel: #ffffff;
    --kb-line: #d9dee8;
    --kb-soft: #f5f7fb;
    --kb-accent: #0f766e;
    --kb-accent-strong: #115e59;
    --kb-danger: #b42318;
    --primary: #0f766e;
    --secondary: #172033;
    --link-fg: #0f766e;
    --link-selected-fg: #0f766e;
    --button-bg: #0f766e;
    --button-hover-bg: #115e59;
    --default-button-bg: #0f766e;
    --default-button-hover-bg: #115e59;
}

body {
    background: #f1f4f8;
    color: var(--kb-ink);
}

#header {
    background: #111827;
    color: #fff;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.16);
}

#branding h1,
#branding h1 a:link,
#branding h1 a:visited {
    color: #fff;
}

.kb-admin-brand {
    align-items: center;
    display: flex;
    gap: 12px;
    line-height: 1.1;
}

.kb-admin-brand strong,
.kb-admin-brand small {
    display: block;
}

.kb-admin-brand small {
    color: #b8c3d4;
    font-size: 12px;
    margin-top: 3px;
}

.kb-admin-mark {
    align-items: center;
    background: #0f766e;
    border-radius: 8px;
    color: #fff;
    display: inline-flex;
    font-weight: 800;
    height: 36px;
    justify-content: center;
    letter-spacing: 0;
    width: 42px;
}

#content {
    padding: 24px 28px;
}

.module,
.inline-group,
.submit-row,
.change-list .filtered #changelist,
#changelist {
    border: 1px solid var(--kb-line);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.module h2,
.module caption,
.inline-group h2 {
    background: #172033;
    color: #fff;
    font-size: 13px;
    letter-spacing: 0;
}

fieldset.module {
    background: var(--kb-panel);
    margin-bottom: 18px;
}

.aligned label {
    color: #344054;
    font-weight: 700;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="number"],
textarea,
select,
.vTextField {
    border: 1px solid #cdd5df;
    border-radius: 8px;
    box-shadow: none;
    min-height: 38px;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--kb-accent);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
    outline: none;
}

.object-tools a,
.button,
input[type="submit"],
button,
.submit-row input,
a.button {
    border-radius: 8px;
    font-weight: 700;
}

.kb-admin-image-preview {
    background: #eef2f7;
    border: 1px solid var(--kb-line);
    border-radius: 8px;
    display: block;
    max-height: 260px;
    max-width: min(520px, 100%);
    object-fit: contain;
    padding: 6px;
}

.kb-editor-source {
    display: none !important;
}

.kb-editor-shell {
    background: var(--kb-panel);
    border: 1px solid #cdd5df;
    border-radius: 8px;
    max-width: 1000px;
    overflow: hidden;
}

.kb-editor-toolbar {
    align-items: center;
    background: #f8fafc;
    border-bottom: 1px solid var(--kb-line);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
    position: sticky;
    top: 0;
    z-index: 2;
}

.kb-editor-toolbar button {
    background: #fff;
    border: 1px solid #cdd5df;
    border-radius: 7px;
    color: var(--kb-ink);
    cursor: pointer;
    min-height: 34px;
    padding: 6px 10px;
}

.kb-editor-toolbar button:hover,
.kb-editor-toolbar button:focus {
    border-color: var(--kb-accent);
    color: var(--kb-accent-strong);
}

.kb-editor-surface {
    background: #fff;
    color: #111827;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
    line-height: 1.7;
    min-height: 620px;
    overflow-wrap: anywhere;
    padding: 28px;
}

.kb-editor-surface:focus {
    outline: none;
}

.kb-editor-surface p,
.kb-editor-surface h2,
.kb-editor-surface h3,
.kb-editor-surface blockquote,
.kb-editor-surface ul,
.kb-editor-surface ol,
.kb-editor-surface figure {
    margin: 0 0 20px;
}

.kb-editor-surface h2 {
    font-size: 28px;
    line-height: 1.24;
}

.kb-editor-surface h3 {
    font-size: 22px;
    line-height: 1.3;
}

.kb-editor-surface blockquote {
    border-left: 4px solid var(--kb-accent);
    color: #344054;
    margin-left: 0;
    padding-left: 18px;
}

.kb-editor-surface img {
    border-radius: 8px;
    cursor: pointer;
    display: block;
    height: auto;
    max-width: 100%;
}

.kb-editor-surface img.kb-selected-image {
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.22);
}

.kb-editor-surface figure {
    margin-left: 0;
    margin-right: 0;
}

.kb-editor-surface figcaption {
    color: #667085;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    margin-top: 8px;
    min-height: 20px;
    text-align: center;
}

.kb-editor-surface .article-embed {
    background: #f8fafc;
    border: 1px solid var(--kb-line);
    border-radius: 8px;
    margin: 22px 0;
    max-width: 100%;
    overflow: hidden;
}

.kb-editor-surface .article-embed iframe,
.kb-editor-surface .article-embed video {
    border: 0;
    display: block;
    min-height: 320px;
    width: 100%;
}

.kb-editor-surface .article-embed-video {
    aspect-ratio: 16 / 9;
    background: #000;
}

.kb-editor-surface .article-embed-wide iframe {
    min-height: 152px;
}

.kb-editor-surface .article-embed-tall iframe {
    min-height: 420px;
}

.kb-editor-surface .article-embed-spotify iframe {
    min-height: 152px;
}

.kb-editor-surface .article-embed-soundcloud iframe {
    min-height: 166px;
}

.kb-editor-surface .article-embed-video iframe,
.kb-editor-surface .article-embed-video video {
    height: 100%;
    min-height: 0;
}

.kb-editor-surface .article-embed-social {
    padding: 18px;
}

.kb-editor-surface .article-embed-social blockquote {
    margin: 0;
}

.kb-editor-help {
    background: #f8fafc;
    border-top: 1px solid var(--kb-line);
    color: var(--kb-muted);
    font-size: 12px;
    padding: 9px 12px;
}

.kb-dialog-backdrop {
    align-items: center;
    background: rgba(15, 23, 42, 0.48);
    display: none;
    inset: 0;
    justify-content: center;
    position: fixed;
    z-index: 10000;
}

.kb-dialog-backdrop.is-open {
    display: flex;
}

.kb-dialog {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
    max-width: 620px;
    padding: 20px;
    width: min(620px, calc(100vw - 32px));
}

.kb-dialog h3 {
    font-size: 18px;
    margin: 0 0 14px;
}

.kb-dialog label {
    color: #344054;
    display: block;
    font-weight: 700;
    margin: 12px 0 6px;
}

.kb-dialog input,
.kb-dialog textarea {
    box-sizing: border-box;
    width: 100%;
}

.kb-dialog-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}

.kb-dialog-error {
    background: #fff1f0;
    border: 1px solid #f3b3ac;
    border-radius: 8px;
    color: var(--kb-danger);
    font-size: 13px;
    font-weight: 700;
    margin: 12px 0 0;
    padding: 10px 12px;
}

.kb-dialog-actions button {
    background: #fff;
    border: 1px solid #cdd5df;
    color: var(--kb-ink);
    padding: 8px 12px;
}

.kb-dialog-actions button[data-primary] {
    background: var(--kb-accent);
    border-color: var(--kb-accent);
    color: #fff;
}

.kb-link-results {
    border: 1px solid var(--kb-line);
    border-radius: 8px;
    display: grid;
    gap: 0;
    margin-top: 8px;
    max-height: 220px;
    overflow: auto;
}

.kb-link-result {
    background: #fff;
    border: 0;
    border-bottom: 1px solid var(--kb-line);
    color: var(--kb-ink);
    cursor: pointer;
    display: block;
    padding: 10px;
    text-align: left;
}

.kb-link-result:last-child {
    border-bottom: 0;
}

.kb-link-result strong,
.kb-link-result small {
    display: block;
}

.kb-link-result small {
    color: var(--kb-muted);
    font-weight: 400;
    margin-top: 3px;
}
