:root {
  color-scheme: dark;
  --ink: #101418;
  --panel: #191e23;
  --well: #12171b;
  --bone: #f3f2eb;
  --muted: #b2b7bb;
  --line: #384147;
  --warning: #ffb29f;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  background: var(--ink);
  color: var(--bone);
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; }
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, .button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.skip { position: absolute; left: 1rem; top: -8rem; padding: .7rem; background: var(--bone); color: var(--ink); z-index: 5; }
.skip:focus { top: .5rem; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.mast { border-bottom: 1px solid var(--line); }
.mast-inner, main { width: min(100% - 3rem, 73rem); margin: auto; }
.mast-inner { display: flex; align-items: center; gap: 1.25rem; min-height: 4.6rem; }
.studio-label { border-left: 1px solid var(--line); padding-left: 1.25rem; font-size: .875rem; color: var(--muted); }
.mast-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; margin-left: auto; gap: 1.1rem; font-size: .875rem; }
.mast-actions a, .text-button { text-underline-offset: .25em; }
.mast-actions a { text-decoration-color: var(--line); }
.text-button { border: 0; padding: 0; color: var(--muted); background: transparent; }
.text-button:hover, .mast-actions a:hover { color: var(--accent); }
main { padding: 1.75rem 0 5rem; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.13; }
h1, h2 { letter-spacing: -.055em; font-family: "Barlow Condensed", "Arial Narrow", "Segoe UI", sans-serif; }
h1 { font-size: clamp(2.7rem, 5vw, 4.5rem); font-weight: 750; }
h2 { font-size: 2rem; }
h3 { font-size: 1.12rem; letter-spacing: -.025em; }
.sections { display: flex; gap: 1.75rem; border-bottom: 1px solid var(--line); }
.sections button { border: 0; border-bottom: 3px solid transparent; background: transparent; padding: .65rem 0 .9rem; color: var(--muted); font-size: .94rem; font-weight: 600; }
.sections [aria-current] { color: var(--bone); border-bottom-color: var(--accent); }
.section-head, .tools, .dialog-head, .dialog-foot { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; }
.section-head { margin: 2.8rem 0 2rem; }
.section-head p, .login-card p, .hint, .subtle, .optional, .record-meta, .sync-state { color: var(--muted); }
.section-head p { margin-top: .5rem; }
.primary, .secondary, .danger, .button { display: inline-flex; align-items: center; justify-content: center; border-radius: .3rem; min-height: 2.7rem; padding: .6rem 1.05rem; border: 1px solid transparent; text-decoration: none; line-height: 1.25; font-weight: 650; }
.primary { background: var(--accent); color: #121416; }
.primary:hover { background: var(--accent-hover); }
.secondary, .button { background: var(--panel); border-color: var(--line); color: var(--bone); }
.secondary:hover, .button:hover { border-color: var(--muted); }
.danger { background: #aa3731; color: white; }
button:disabled { cursor: default; opacity: .55; }
.tools { margin-bottom: 1rem; }
.search-wrap { width: min(100%, 25rem); }
.subtle, .record-meta, .hint, .optional, .sync-state { font-size: .875rem; }
input:not([type=checkbox]), select, textarea { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: .25rem; background: var(--well); color: var(--bone); padding: .68rem .8rem; }
input::placeholder { color: #929ba2; }
select { appearance: none; padding-right: 2rem; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-size: .3rem .3rem; background-position: right .95rem center, right .65rem center; background-repeat: no-repeat; }
textarea { resize: vertical; }
.login-card, dialog { background: var(--panel); border: 1px solid var(--line); border-radius: .5rem; }
.login-card { max-width: 31rem; margin: min(12vh, 7rem) auto; padding: clamp(1.4rem, 5vw, 2.7rem); border-top: 3px solid var(--accent); }
.login-card h1 { font-size: 2.8rem; }
.login-card p { margin: .8rem 0 2rem; }
.login-card input { margin-bottom: 1rem; }
label { display: block; font-size: .93rem; font-weight: 600; }
label input:not([type=checkbox]), label textarea, .slug-input { margin-top: .4rem; }
.optional { font-weight: normal; }
.record-list { border-top: 1px solid var(--line); }
.record, .connection { padding: 1.35rem 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: start; }
.record h3, .connection h3 { overflow-wrap: anywhere; }
.record-meta { margin-top: .35rem; display: flex; flex-wrap: wrap; gap: .25rem .85rem; align-items: center; }
.record-meta a { text-decoration-color: #687179; text-underline-offset: .2em; }
.actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .2rem .85rem; }
.actions button, .actions a { padding: .25rem 0; border: 0; background: transparent; color: var(--bone); font-size: .875rem; text-underline-offset: .2em; }
.actions .delete-action { color: var(--muted); }
.actions button:hover, .actions a:hover { color: var(--accent); }
.actions a { text-decoration-color: var(--line); }
.credits { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .65rem; }
.credit { border: 1px solid var(--line); border-radius: 2rem; padding: .14rem .55rem; font-size: .8rem; color: #d3d6d6; }
details { margin-top: .75rem; font-size: .875rem; }
summary { width: fit-content; color: var(--muted); cursor: pointer; }
.platform-metric { margin-top: .65rem; padding-left: .7rem; border-left: 2px solid var(--line); }
.platform-metric a { font-weight: 650; }
.platform-metric p { margin-top: .12rem; }
.copy-fallback { margin-top: .5rem; }
.empty { padding: 2.3rem 0; color: var(--muted); }
.connection-list { border-top: 1px solid var(--line); }
.sync-state { margin-top: 1.25rem; }
.warning, .form-error { color: var(--warning); }
#notice { padding: .7rem 1rem; margin-bottom: 1rem; border-left: 3px solid var(--accent); background: var(--panel); overflow-wrap: anywhere; }
.connection p { margin-top: .25rem; }
dialog { position: fixed; width: min(38rem, calc(100% - 1.5rem)); max-height: calc(100dvh - 2rem); padding: 0; color: var(--bone); box-shadow: 0 2rem 5rem #03060988; }
dialog::backdrop { background: #080a0cbb; }
dialog form { padding: clamp(1.2rem, 4vw, 2rem); }
.dialog-head { margin-bottom: 1.5rem; }
.close { display: grid; place-items: center; min-width: 2.5rem; min-height: 2.5rem; font-size: 1.6rem; line-height: 1; border: 1px solid var(--line); border-radius: 50%; color: var(--bone); background: transparent; }
dialog label { margin-top: .8rem; }
dialog fieldset { margin: 1.35rem 0 0; border: 0; padding: .8rem 0 0; min-width: 0; border-top: 1px solid var(--line); }
dialog legend { padding: 0 .5rem 0 0; font-weight: 700; }
.hint { margin-top: .35rem; }
.fields { display: grid; grid-template-columns: minmax(0, 1fr) 10.5rem; gap: .75rem; }
.fields label { margin: 0; }
.export-fields { display: grid; grid-template-columns: repeat(auto-fit,minmax(9rem,1fr)); gap: .4rem .75rem; }
.slug-input { display: flex; align-items: center; padding-left: .75rem; border: 1px solid var(--line); border-radius: .25rem; background: var(--well); color: var(--muted); }
.slug-input input { border: 0; margin: 0 !important; }
.toggle { display: flex; align-items: center; gap: .65rem; padding: .45rem 0; }
.toggle input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.credit-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,.9fr) 2.35rem; align-items: center; gap: .5rem; margin: .75rem 0; }
.credit-row .close { min-width: 2.35rem; min-height: 2.35rem; }
#add-credit { margin-top: .65rem; }
.form-error { margin-top: 1rem; }
.dialog-foot { justify-content: flex-end; margin-top: 1.5rem; border-top: 1px solid var(--line); padding-top: 1rem; }
@media (max-width: 600px) {
  .mast-inner, main { width: min(100% - 2rem, 73rem); }
  .mast-inner { gap: .7rem; }
  .studio-label { display: none; }
  .section-head { align-items: flex-start; flex-direction: column; margin: 2rem 0 1.5rem; }
  .record, .connection { grid-template-columns: 1fr; }
  .actions { justify-content: flex-start; }
  .connection .button { justify-self: start; }
  .sections { gap: 1.1rem; }
  .sections button { font-size: .875rem; }
  .fields { grid-template-columns: 1fr; }
  .credit-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr) 2rem; gap: .3rem; }
  .credit-row select { padding-left: .35rem; }
}
