@font-face {
  font-family: 'Instrument Sans';
  src: url('/admin/assets/instrument-sans.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  font-family: 'Instrument Sans', 'Segoe UI', sans-serif;
  color: #142544;
  background: #f5f7fb;
  color-scheme: light;
  --blue: #1c4ec2;
  --ink: #142544;
  --muted: #53627a;
  --line: #dbe3f0;
  --pale: #edf3ff;
  --sidebar-width: 236px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, h3, p { margin: 0; }
button, input, textarea, select { font: inherit; }
button, select, summary { cursor: pointer; }
button:disabled { cursor: default; }
a { color: var(--blue); }
input, textarea { color: var(--ink); }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid #4381f1; outline-offset: 3px; }

.session-screen { display: grid; min-height: 100dvh; padding: 24px; place-items: center; background: radial-gradient(ellipse at 25% 12%, #e6eeff, #f5f7fb 65%); }
.signin-card { width: min(100%, 430px); padding: clamp(24px, 6vw, 40px); background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 16px 60px #19315b12; }
.signin-logo { width: 142px; margin-bottom: 25px; }
.signin-card h1 { margin-bottom: 9px; font-size: clamp(1.6rem, 7vw, 2.12rem); letter-spacing: -.038em; }
.signin-card > p { color: var(--muted); line-height: 1.5; }
.signin-card form { display: grid; gap: 10px; margin-top: 20px; }
.signin-card form button { margin-top: 7px; }

.workspace { display: grid; min-height: 100dvh; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.skip { position: fixed; z-index: 10; top: 12px; left: 12px; padding: 12px; color: var(--ink); background: #fff; transform: translateY(-180%); }
.skip:focus { transform: none; }
.sidebar { position: sticky; top: 0; height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; gap: 18px; padding: 22px 15px; overflow-y: auto; background: #102445; color: #edf2ff; }
.sidebar-brand { justify-self: start; width: 142px; padding: 9px 10px; margin: 4px 0 8px 7px; border-radius: 8px; background: #fff; }
.sidebar nav, .sidebar-footer { display: grid; align-content: start; gap: 4px; }
.sidebar nav a, .sidebar-footer a, .sidebar-footer button { display: flex; width: 100%; min-height: 44px; align-items: center; gap: 11px; padding: 9px 11px; color: inherit; background: transparent; border: 1px solid transparent; border-radius: 8px; font-size: .94rem; font-weight: 600; text-align: start; text-decoration: none; }
.sidebar nav a:hover, .sidebar-footer a:hover, .sidebar-footer button:hover { background: #ffffff12; }
.sidebar nav a[aria-current='page'] { background: #294672; border-color: #5273a5; }
.nav-icon { display: grid; place-items: center; flex: none; color: #a7c1f5; }
.sidebar-footer { padding-top: 13px; border-top: 1px solid #4d6388; }
.sidebar-footer a, .sidebar-footer button { font-size: .87rem; }
.workspace-main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 2; background: #fff; border-bottom: 1px solid var(--line); }
.topbar-inner { min-height: 66px; display: flex; align-items: center; gap: 14px; max-width: 1140px; margin: 0 auto; padding: 8px clamp(20px, 3.6vw, 48px); }
.location { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .89rem; }
.location span:last-child { color: var(--ink); font-weight: 650; }
.location-divider { color: #7e8da7; }
.save-actions { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.change-indicator { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: .82rem; }
.change-indicator[data-dirty='true'] { color: #734718; }
.change-indicator[data-dirty='true']::before { width: 6px; height: 6px; background: #ab681f; border-radius: 100%; content: ''; }
.menu-toggle { display: none; }

.editor { max-width: 1140px; margin: 0 auto; padding: 34px clamp(20px, 3.6vw, 48px) 60px; }
.editor-heading { margin-bottom: 20px; }
.editor-heading h1 { font-size: clamp(1.95rem, 4vw, 2.82rem); font-weight: 650; line-height: 1.1; letter-spacing: -.044em; }
.editor-heading p { max-width: 65ch; margin-top: 9px; color: var(--muted); line-height: 1.55; }
.editor-status:not(:empty), .signin-card .status:not(:empty) { margin: 14px 0; padding: 10px 12px; border: 1px solid #c5d7ee; border-radius: 8px; background: #ecf5ff; color: #204777; line-height: 1.45; }
.status[data-error='true']:not(:empty) { border-color: #e9c8c8; background: #fff3f2; color: #8b2826; }
.panel { margin-bottom: 15px; padding: clamp(16px, 3vw, 24px); border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.panel h2 { font-size: 1.13rem; font-weight: 700; }
.panel h2 + p { margin-top: 5px; }
.panel p { color: var(--muted); font-size: .92rem; line-height: 1.5; }
.panel > :not(h2, p) { margin-top: 12px; }
.panel > :first-child { margin-top: 0; }
.panel-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.summary-list { display: grid; grid-template-columns: max-content 1fr; align-items: baseline; gap: 10px 18px; margin: 0; font-size: .91rem; }
.summary-list dt { color: var(--muted); }
.summary-list dd { margin: 0; font-weight: 650; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: fit-content; min-height: 40px; padding: 8px 13px; color: var(--ink); background: #fff; border: 1px solid #c5d0e4; border-radius: 7px; font-size: .87rem; font-weight: 700; text-align: center; text-decoration: none; }
.button:not(:disabled):hover { background: #edf3ff; border-color: #96a9cd; }
.button--primary { color: #fff; background: var(--blue); border-color: var(--blue); }
.button--primary:not(:disabled):hover { color: #fff; background: #173d9d; border-color: #173d9d; }
.button:disabled { opacity: .55; }
.button--remove { min-width: 40px; padding-inline: 9px; color: #902828; }
.button--remove:not(:disabled):hover { color: #902828; background: #fff3f2; border-color: #e2b8b7; }

.languages { display: flex; width: fit-content; gap: 4px; padding: 4px; margin-bottom: 15px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.languages button { min-height: 36px; padding: 6px 13px; color: var(--muted); background: transparent; border: 0; border-radius: 5px; font-weight: 650; }
.languages button[aria-pressed='true'] { color: #153a8d; background: var(--pale); }
.group { margin-bottom: 9px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.group > summary { display: flex; min-height: 46px; align-items: center; gap: 10px; padding: 11px 15px; color: var(--ink); font-weight: 700; list-style: none; }
.group > summary::-webkit-details-marker { display: none; }
.group > summary::after { width: 8px; height: 8px; margin: -4px 4px 0 auto; border-right: 2px solid #496799; border-bottom: 2px solid #496799; transform: rotate(45deg); content: ''; }
.group[open] > summary::after { margin-top: 4px; transform: rotate(225deg); }
.group-body { display: grid; gap: 13px; padding: 14px; border-top: 1px solid var(--line); }
.group-body .group { margin: 0; background: #fafbfd; }
.field { display: grid; align-content: start; gap: 5px; margin: 0; }
.field > span:first-child, .signin-card label, .array-title { color: var(--ink); font-size: .89rem; font-weight: 650; }
.field small { color: var(--muted); font-size: .79rem; line-height: 1.45; }
.field input:not([type='checkbox']), .field textarea, .signin-card input { width: 100%; min-width: 0; padding: 9px 11px; border: 1px solid #a8b8d1; border-radius: 7px; background: #fff; }
.field textarea { min-height: 73px; resize: vertical; }
.field-check { display: flex; align-items: start; gap: 9px; padding: 6px 0; color: var(--ink); font-size: .92rem; }
.field-check input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }
.field-check span { line-height: 1.35; }
.string-list { display: grid; gap: 7px; min-width: 0; margin: 0; padding: 9px 11px 11px; border: 1px solid var(--line); border-radius: 8px; }
.list-row { display: grid; align-items: end; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.panel .chat-setup-hint { margin-top: 10px; }
.chat-setup-hint code { color: var(--ink); overflow-wrap: anywhere; }
.schedule-grid { display: grid; gap: 9px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.schedule-day { min-width: 0; margin: 0; padding: 7px 11px 11px; border: 1px solid var(--line); border-radius: 8px; }
.schedule-day legend { padding-inline: 4px; color: var(--ink); font-size: .89rem; font-weight: 700; }
.schedule-controls { display: grid; gap: 7px; }
.schedule-times { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

@media (max-width: 780px) {
  .workspace { display: block; }
  .sidebar { position: fixed; inset: 65px auto 0 0; z-index: 4; display: none; width: min(280px, 88vw); height: auto; box-shadow: 8px 4px 30px #0f2a5533; }
  .workspace[data-menu='open'] .sidebar { display: grid; }
  .topbar-inner { min-height: 65px; gap: 10px; }
  .menu-toggle { display: grid; place-items: center; flex: none; width: 40px; height: 40px; color: var(--ink); border: 1px solid var(--line); border-radius: 7px; background: #fff; }
  .location span:not(:last-child) { display: none; }
}

@media (max-width: 510px) {
  .topbar-inner, .editor { padding-inline: 14px; }
  .editor { padding-top: 24px; }
  .save-actions { gap: 7px; }
  .change-indicator { font-size: .74rem; }
  .panel-row { grid-template-columns: minmax(0, 1fr); }
  .summary-list { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .summary-list dt:not(:first-child) { margin-top: 7px; }
}
