:root {
    font-family: "DM Sans", system-ui, sans-serif;
    color-scheme: dark;
    background: #151618;
    color: #f4f2ed;
    --border: #3a3c3e;
    --muted: #b9b8b2;
    --accent: #d9fa93;
}
* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, p { margin: 0 0 .85rem; }
h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); letter-spacing: -.045em; line-height: 1.12; }
h2 { font-size: 1.15rem; letter-spacing: -.02em; }
p { color: var(--muted); line-height: 1.5; }
a { color: var(--accent); }
progress { width: 100%; accent-color: var(--accent); }
.brand { color: var(--accent); font-weight: 750; text-decoration: none; letter-spacing: -.025em; }
.topbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: .75rem;
    padding: .8rem clamp(1rem, 6vw, 5rem); border-bottom: 1px solid var(--border);
}
.topbar-controls {
    display: flex; flex-wrap: wrap; align-items: end; justify-content: end;
    gap: .75rem; margin-inline-start: auto; max-width: 100%;
}
.studio { width: min(100% - 2rem, 56rem); margin: 2.7rem auto; }
.login { width: min(100% - 2rem, 26rem); margin: 12vh auto; padding: 2rem; }
.panel, .login {
    background: #202224; border: 1px solid var(--border); border-radius: 12px;
}
.panel { margin-block: 1rem; padding: clamp(1rem, 4vw, 1.5rem); }
.workspace-selector, .field-row, .actions {
    display: flex; flex-wrap: wrap; align-items: end; gap: .75rem;
}
.studio-nav { display: flex; flex-wrap: wrap; gap: .35rem; }
.studio-nav a { padding: .5rem .65rem; color: var(--muted); text-decoration: none; border-radius: 6px; }
.studio-nav a:hover, .studio-nav a[aria-current="page"], .studio-nav a[aria-current="true"] { background: #292b2e; color: #f4f2ed; }
.stack { display: grid; gap: 1rem; }
label { display: grid; gap: .35rem; color: var(--muted); font-size: .9rem; }
input, select, textarea, button {
    font: inherit; padding: .55rem .75rem; min-height: 2.6rem;
    color: inherit; background: #18191b; border: 1px solid #555857; border-radius: 6px;
}
input, select, textarea { width: 100%; min-width: 0; }
textarea { resize: vertical; }
.workspace-selector select { max-width: min(74vw, 22rem); }
button { cursor: pointer; font-weight: 650; white-space: nowrap; }
button:hover { border-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.danger { color: #fff; background: #a82832; border-color: #db5360; }
.danger:hover { background: #bb303b; border-color: #f9808a; }
.primary { color: #171b11; background: var(--accent); border-color: var(--accent); }
.field-row label:first-of-type { flex: 1 1 15rem; }
.key-form { margin-top: 1rem; }
.feedback { background: #272d23; border-left: 3px solid var(--accent); padding: .7rem 1rem; color: #e6f5d8; }
.error { background: #352526; border-color: #ffab9d; color: #fff2ee; }
.connected { color: var(--accent); }
details { margin-top: 1rem; }
summary { cursor: pointer; color: var(--muted); }
details p { margin-top: .6rem; }
.endpoint { display: block; padding: .7rem; background: #171819; border-radius: 6px; overflow-wrap: anywhere; }
.keys { margin: 1rem 0 0; padding: 0; list-style: none; }
.keys li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; border-top: 1px solid var(--border); padding: .6rem 0; }
.keys span { color: var(--muted); display: block; font-size: .85rem; }
.endpoint + p { margin-top: 1rem; }

.artist-result { flex-wrap: wrap; }
.artist-result-actions { align-items: start; }
.quick-add { margin: 0; }
.quick-add summary { padding: .55rem .75rem; min-height: 2.6rem; border: 1px solid #555857; border-radius: 6px; }
.quick-add form { margin-top: .55rem; }

.search-result-title { display: inline-flex; gap: .75rem; align-items: center; min-width: 0; }
.search-artwork {
    position: relative; display: inline-grid; place-items: center; flex: 0 0 48px;
    width: 48px; height: 48px; border-radius: 6px; overflow: hidden; background: #303335;
}
.search-artwork span { font-size: 1.25rem; }
.search-artwork img { position: absolute; inset: 0; display: block; object-fit: contain; }

.api-navigation { margin-block: 1rem; }
.api-table { overflow-x: auto; margin-bottom: 1rem; }
.api-table table { width: 100%; border-collapse: collapse; }
.api-table th, .api-table td { text-align: left; vertical-align: top; padding: .65rem; border-bottom: 1px solid var(--border); }
.api-table th { color: var(--muted); }

.api-section > summary { color: inherit; }
.api-section > summary > h2 { display: inline; margin: 0; }
.api-section[open] > summary { margin-bottom: 1rem; }
