:root {
  --ink: #171b2e;
  --muted: #747b8d;
  --line: #e8eaf0;
  --paper: #f7f8fc;
  --violet: #6842e8;
  --violet-dark: #5331ca;
  --mint: #e5f8f0;
  --danger: #c63e51;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); min-height: 100vh; }
a { color: inherit; text-decoration: none; }
.app-header { height: 76px; padding: 0 max(28px, calc((100% - 1190px) / 2)); display: flex; align-items: center; gap: 12px; background: white; border-bottom: 1px solid var(--line); }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: white; font-weight: 800; background: linear-gradient(140deg, #8b69ff, #5d38db); box-shadow: 0 7px 17px #6842e833; }
.brand-name { font-weight: 750; letter-spacing: -.03em; font-size: 17px; }
.brand-name span { display: block; color: var(--muted); font-size: 10px; letter-spacing: .15em; font-weight: 650; margin-top: 2px; }
.container { width: min(1190px, calc(100% - 48px)); margin: 0 auto; padding: 44px 0 76px; }
h1,h2,p { margin-top: 0; }
h1 { font-size: clamp(30px, 4vw, 42px); letter-spacing: -.045em; margin: 5px 0 9px; }
h2 { font-size: 18px; letter-spacing: -.02em; margin: 0; }
.eyebrow { color: var(--violet); font-size: 10px; letter-spacing: .15em; font-weight: 800; margin: 0 0 8px; text-transform: uppercase; }
.muted { color: var(--muted); line-height: 1.6; margin: 0; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 28px; }
.page-heading.compact { margin-bottom: 20px; }
.back-link { color: var(--violet); display: inline-block; margin-bottom: 20px; font-weight: 650; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 16px; min-height: 43px; padding: 0 16px; border: 1px solid transparent; border-radius: 10px; font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; transition: .15s ease; }
.button span { font-size: 17px; }
.button.primary { color: white; background: var(--violet); box-shadow: 0 5px 12px #6842e821; }
.button.primary:hover { background: var(--violet-dark); transform: translateY(-1px); }
.button.secondary { color: #51586c; background: white; border-color: var(--line); }
.button.secondary:hover { border-color: #c6c9d4; }
.button.full { width: 100%; }
.collection-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.collection-card { background: white; border: 1px solid var(--line); border-radius: 16px; padding: 21px; box-shadow: 0 8px 28px #242d4a08; display: flex; flex-direction: column; min-height: 244px; }
.collection-top { display: flex; justify-content: space-between; align-items: start; margin-bottom: 15px; }
.collection-top .eyebrow { color: #969bad; font-size: 9px; margin-bottom: 5px; }
.collection-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; color: var(--violet); background: #f0edff; font-weight: 800; }
.collection-items { flex: 1; margin-bottom: 18px; }
.collection-actions { display: grid; gap: 9px; margin-top: auto; }
.empty-state { padding: 9px 0; font-size: 13px; }
.content-row { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #f0f1f5; padding: 9px 0; font-size: 12px; }
.content-id { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; color: #555d73; overflow: hidden; text-overflow: ellipsis; }
.content-row form { margin: 0; }
.icon-button { border: 0; background: transparent; cursor: pointer; font: inherit; font-size: 12px; }
.danger-text { color: var(--danger); }
.editor-card { background: white; border: 1px solid var(--line); border-radius: 17px; padding: clamp(20px, 4vw, 34px); box-shadow: 0 10px 35px #242d4a0a; }
.generated-id { display: flex; align-items: center; gap: 12px; margin: 0 0 22px; }
.generated-id label { min-width: 145px; color: #3b4256; font-size: 12px; font-weight: 750; }
.generated-id label span { display: block; color: #969bad; font-size: 10px; font-weight: 500; margin-top: 3px; }
.generated-id input { max-width: 430px; width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #f7f8fc; color: #5b6275; font: 13px ui-monospace, SFMono-Regular, Consolas, monospace; }
.table-card { overflow-x: auto; background: white; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 8px 28px #242d4a08; }
.content-table { border-collapse: collapse; width: 100%; min-width: 700px; }
.content-table th { padding: 14px 17px; text-align: left; color: #8a90a1; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; background: #fbfbfd; }
.content-table td { padding: 14px 17px; border-top: 1px solid #f0f1f5; font-size: 13px; vertical-align: middle; }
.content-table td code { color: #626a7e; font-size: 11px; overflow-wrap: anywhere; }
.entry-title { min-width: 250px; max-width: 500px; font-weight: 650; line-height: 1.5; }
.actions-heading { text-align: right !important; }
.row-actions { display: flex; justify-content: end; align-items: center; gap: 8px; }
.row-actions form { margin: 0; }
.small-button { min-height: 33px; padding: 0 11px; font-size: 11px; }
.danger-button { color: var(--danger); background: #fff; border-color: #f0dadd; }
.danger-button:hover { background: #fff3f4; }
.empty-list { text-align: center; padding: 48px 20px; }
.empty-list h2 { margin-bottom: 8px; }
.empty-list .button { margin-top: 20px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px 22px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field:has(textarea[data-path="excerpt"]), .field:has(textarea[data-path="content"]), .field:has(textarea[data-path="fullDescription"]), .field:has(textarea[data-path="description"]) { grid-column: 1 / -1; }
.field label { color: #3b4256; font-size: 12px; font-weight: 700; }
.field input, .field textarea, .stack-form input { width: 100%; border: 1px solid #dfe2eb; border-radius: 9px; padding: 11px 12px; color: var(--ink); background: #fff; font: inherit; font-size: 13px; outline: none; transition: .15s; }
.field input:focus, .field textarea:focus, .stack-form input:focus { border-color: #9b84f2; box-shadow: 0 0 0 3px #6842e818; }
.field textarea { resize: vertical; line-height: 1.6; }
.upload-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.image-picker { max-width: 290px; font-size: 12px !important; padding: 8px !important; }
.upload-button { min-height: 37px; }
.upload-button:disabled { opacity: .55; cursor: wait; }
.upload-status { font-size: 12px; }
.upload-error { color: var(--danger); }
.image-preview { display: block; max-width: 240px; max-height: 150px; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); }
.field.wide-field, .repeat-field { grid-column: 1 / -1; }
.repeat-field { border: 0; border-top: 1px solid var(--line); padding: 20px 0 0; margin: 3px 0 0; }
.repeat-field h3 { font-size: 14px; margin: 0 0 12px; }
.repeat-item { margin: 12px 0; padding: 15px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; border: 1px solid var(--line); border-radius: 11px; }
.repeat-item .repeat-subfield:has(textarea) { grid-column: 1 / -1; }
.repeat-remove { justify-self: start; }
.repeat-add { margin-bottom: 4px; }
.checkbox-field { flex-direction: row; align-items: center; gap: 10px; min-height: 41px; }
.checkbox-field input { width: 17px; height: 17px; accent-color: var(--violet); }
.checkbox-field label { margin: 0; }
.form-footer { display: flex; justify-content: end; gap: 10px; border-top: 1px solid var(--line); margin-top: 28px; padding-top: 20px; }
.notice { border-radius: 10px; padding: 12px 15px; margin: 0 0 18px; font-size: 13px; line-height: 1.55; }
.notice.success { color: #176b4a; background: var(--mint); }
.notice.error { color: #8e2938; background: #fff0f1; border: 1px solid #f7d9dd; }
.auth-shell { min-height: 65vh; display: grid; place-items: center; }
.auth-card { width: min(430px, 100%); padding: 36px; background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 15px 45px #242d4a0d; }
.auth-card .brand-mark { margin-bottom: 24px; }
.auth-card h1 { font-size: 32px; }
.auth-card > .muted { font-size: 13px; margin-bottom: 22px; }
.stack-form { display: flex; flex-direction: column; gap: 10px; }
.stack-form label { color: #3b4256; font-size: 12px; font-weight: 700; margin-top: 7px; }
.stack-form .button { margin-top: 13px; }
footer { width: min(1190px, calc(100% - 48px)); margin: 0 auto; padding: 16px 0 25px; border-top: 1px solid var(--line); color: #9a9eac; font-size: 11px; }
@media (max-width: 850px) { .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .container { width: min(100% - 30px, 500px); padding-top: 28px; } .app-header { padding: 0 18px; } .collection-grid { grid-template-columns: 1fr; } .page-heading { align-items: flex-start; } .field-grid { grid-template-columns: 1fr; } .field { grid-column: 1 / -1; } .auth-card { padding: 26px; } }
