:root {
  color-scheme: light;
  --lrl-ink: #14213d;
  --lrl-muted: #58647a;
  --lrl-blue: #174f8a;
  --lrl-blue-dark: #0c365f;
  --lrl-line: #d7dee8;
  --lrl-surface: #fff;
  --lrl-soft: #f3f6fa;
  --lrl-danger: #a5212a;
  --lrl-success: #17663a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--lrl-ink);
  background: var(--lrl-soft);
  font-size: 16px;
  line-height: 1.5;
}

a { color: var(--lrl-blue); }
button, input, select, textarea { font: inherit; }
button, input, select, textarea, a { outline-offset: 3px; }
:focus-visible { outline: 3px solid #f3a712; }

.lrl-skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  background: #fff;
  transform: translateY(-150%);
}
.lrl-skip-link:focus { transform: translateY(0); }

.lrl-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px clamp(18px, 4vw, 54px);
  color: #fff;
  background: var(--lrl-blue-dark);
}
.lrl-editor-header h1 { margin: 0; font-size: clamp(1.55rem, 3vw, 2.25rem); }
.lrl-editor-eyebrow { margin: 0 0 2px; color: #c9dcf1; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.lrl-editor-account { display: flex; align-items: center; gap: 16px; }
.lrl-editor-account a { color: #fff; }

.lrl-editor-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 0 clamp(14px, 4vw, 54px);
  border-bottom: 1px solid var(--lrl-line);
  background: #fff;
}
.lrl-editor-tabs button {
  min-height: 50px;
  padding: 0 16px;
  border: 0;
  border-bottom: 4px solid transparent;
  color: var(--lrl-muted);
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}
.lrl-editor-tabs button[aria-selected="true"] { border-color: var(--lrl-blue); color: var(--lrl-blue); }

.lrl-editor-main { width: min(1160px, calc(100% - 32px)); margin: 28px auto 80px; }
.lrl-editor-main h2 { margin: 0; }
.lrl-editor-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.lrl-editor-section-head p { margin: 4px 0 0; color: var(--lrl-muted); }
.lrl-editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.lrl-editor-notice {
  position: sticky;
  z-index: 20;
  top: 8px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid #88bda0;
  border-radius: 8px;
  color: var(--lrl-success);
  background: #effbf4;
}
.lrl-editor-notice.is-error { border-color: #df9ba0; color: var(--lrl-danger); background: #fff1f2; }

.lrl-panel, .lrl-record {
  margin-bottom: 18px;
  padding: clamp(16px, 3vw, 28px);
  border: 1px solid var(--lrl-line);
  border-radius: 12px;
  background: var(--lrl-surface);
  box-shadow: 0 4px 18px rgba(20,33,61,.05);
}
.lrl-record[aria-disabled="true"] { opacity: .72; }
.lrl-record__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.lrl-record__head h3 { margin: 0; }
.lrl-drag { padding: 7px 10px; border: 1px solid var(--lrl-line); border-radius: 6px; color: var(--lrl-muted); background: var(--lrl-soft); cursor: grab; }
.lrl-record.is-dragging { opacity: .45; }

.lrl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.lrl-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lrl-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lrl-field--wide { grid-column: 1 / -1; }
.lrl-field > span { font-weight: 700; }
.lrl-field small { color: var(--lrl-muted); }
.lrl-field input, .lrl-field textarea, .lrl-field select {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #aeb8c7;
  border-radius: 6px;
  color: var(--lrl-ink);
  background: #fff;
}
.lrl-field textarea { min-height: 112px; resize: vertical; }

.lrl-repeaters { margin-top: 22px; }
.lrl-repeaters h3 { margin: 0 0 10px; }
.lrl-repeater-row { margin-bottom: 12px; padding: 14px; border: 1px solid var(--lrl-line); border-radius: 8px; background: #fbfcfe; }
.lrl-repeater-row__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 10px; }

.lrl-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid var(--lrl-blue);
  border-radius: 7px;
  color: var(--lrl-blue);
  background: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.lrl-button--primary { color: #fff; background: var(--lrl-blue); }
.lrl-button--danger { border-color: var(--lrl-danger); color: var(--lrl-danger); }
.lrl-button:disabled { opacity: .55; cursor: wait; }

.lrl-media-control { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: center; }
.lrl-media-preview { width: 120px; aspect-ratio: 4 / 3; border: 1px solid var(--lrl-line); border-radius: 7px; background: #edf1f6; object-fit: cover; }
.lrl-media-preview:not([src]) { visibility: hidden; }
.lrl-upload-status { color: var(--lrl-muted); font-size: .9rem; }
.lrl-focal-preview { width: 100%; max-width: 360px; aspect-ratio: 4/3; object-fit: cover; border-radius: 7px; background: #edf1f6; }

.lrl-history { width: 100%; border-collapse: collapse; background: #fff; }
.lrl-history th, .lrl-history td { padding: 11px 12px; border-bottom: 1px solid var(--lrl-line); text-align: left; vertical-align: top; }
.lrl-history th { background: #edf2f8; }
.lrl-empty { padding: 32px; border: 1px dashed #aeb8c7; border-radius: 10px; text-align: center; color: var(--lrl-muted); background: #fff; }

.lrl-login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(145deg, #edf3f9, #dce8f4); }
.lrl-login__card { width: min(440px, 100%); padding: 34px; border-radius: 14px; background: #fff; box-shadow: 0 18px 55px rgba(20,33,61,.15); }
.lrl-login__card h1 { margin-top: 0; }
.lrl-login label { display: block; margin-bottom: 6px; font-weight: 700; }
.lrl-login input[type="text"], .lrl-login input[type="password"] { width: 100%; min-height: 46px; padding: 9px 11px; border: 1px solid #aeb8c7; border-radius: 6px; }
.lrl-login .login-submit input { width: 100%; min-height: 46px; border: 0; border-radius: 6px; color: #fff; background: var(--lrl-blue); font-weight: 700; cursor: pointer; }
.lrl-login__links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 0; }

@media (max-width: 720px) {
  .lrl-editor-header, .lrl-editor-section-head { align-items: flex-start; flex-direction: column; }
  .lrl-editor-account { width: 100%; justify-content: space-between; }
  .lrl-grid, .lrl-grid--three { grid-template-columns: 1fr; }
  .lrl-field--wide { grid-column: auto; }
  .lrl-editor-main { width: min(100% - 20px, 1160px); margin-top: 16px; }
  .lrl-panel, .lrl-record { padding: 16px; }
  .lrl-media-control { grid-template-columns: 84px 1fr; }
  .lrl-media-preview { width: 84px; }
  .lrl-history-wrap { overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
