:root {
  --bt-ink: #163b3a;
  --bt-muted: #647b79;
  --bt-teal: #07877e;
  --bt-teal-dark: #05645e;
  --bt-coral: #ef7f63;
  --bt-red: #c94747;
  --bt-blue: #3e6fa4;
  --bt-line: #d7e7e5;
  --bt-pale: #f1f8f7;
  --bt-shadow: 0 18px 50px rgba(26, 77, 73, .12);
}

.bt-app, .bt-app *, .bt-login-page, .bt-login-page * { box-sizing: border-box; }
.bt-app, .bt-login-page { color: var(--bt-ink); font-family: Inter, "Segoe UI", Arial, sans-serif; }
.bt-app { min-height: 720px; background: #f3f8f8; }

.bt-header {
  position: sticky; z-index: 100; top: 0; display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 24px;
  min-height: 74px; padding: 8px clamp(16px, 3vw, 50px); color: #fff;
  background: linear-gradient(120deg, #0a5551, #087f78); box-shadow: 0 5px 22px rgba(8, 65, 61, .2);
}
.bt-brand { display: inline-flex; align-items: center; gap: 11px; color: #fff; text-decoration: none; }
.bt-brand > span:last-child, .bt-brand strong, .bt-brand small { display: block; }
.bt-brand strong { font-size: 1.04rem; }
.bt-brand small { margin-top: 2px; color: #c9e8e4; font-size: .72rem; }
.bt-brand-mark { position: relative; display: inline-flex; flex: 0 0 44px; width: 44px; height: 39px; align-items: center; justify-content: center; gap: 8px; border: 3px solid currentColor; border-radius: 13px; color: #fff; background: rgba(255,255,255,.12); }
.bt-brand-mark::before { position: absolute; top: -9px; width: 3px; height: 8px; border-radius: 3px; content: ""; background: var(--bt-coral); }
.bt-brand-mark i { width: 5px; height: 9px; border-radius: 5px; background: currentColor; }
.bt-nav { display: flex; justify-content: center; gap: 3px; }
.bt-nav a { padding: 9px 12px; border-radius: 10px; color: #dff0ee; font-size: .86rem; font-weight: 750; text-decoration: none; white-space: nowrap; }
.bt-nav a:hover, .bt-nav a.active { color: var(--bt-teal-dark); background: #fff; }
.bt-user { display: flex; align-items: center; gap: 10px; font-size: .82rem; }
.bt-user form, .bt-actions form { margin: 0; }
.bt-link-button { padding: 7px 10px; border: 1px solid rgba(255,255,255,.5); border-radius: 9px; color: #fff; background: transparent; font: inherit; cursor: pointer; }

.bt-main { width: min(1480px, calc(100% - 36px)); margin: 0 auto; padding: 22px 0 42px; }
.bt-hero { display: flex; min-height: 132px; margin-bottom: 20px; padding: 22px clamp(24px,4vw,42px); align-items: center; justify-content: space-between; overflow: hidden; border-radius: 22px; color: #fff; background: radial-gradient(circle at 88% 18%, rgba(255,255,255,.16) 0 10%, transparent 11%), linear-gradient(125deg,#087c74,#36a798); box-shadow: var(--bt-shadow); }
.bt-hero h1, .bt-page-heading h1 { margin: 0; font-size: clamp(1.8rem,3.4vw,2.7rem); font-weight: 900; letter-spacing: -.045em; }
.bt-hero p:last-child { max-width: 690px; margin: 7px 0 0; color: rgba(255,255,255,.9); }
.bt-hero-icon { font-size: clamp(4rem,8vw,7rem); filter: drop-shadow(0 9px 12px rgba(0,0,0,.18)); }
.bt-eyebrow { margin: 0 0 6px; color: #adf0e7; font-size: .73rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.bt-page-heading .bt-eyebrow { color: var(--bt-teal); }
.bt-page-heading { display: flex; margin-bottom: 20px; align-items: flex-end; justify-content: space-between; gap: 20px; }
.bt-page-heading h1 { color: var(--bt-ink); }
.bt-page-heading p:last-child { margin: 6px 0 0; color: var(--bt-muted); }

.bt-dashboard-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.bt-card, .bt-level-card, .bt-editor-sidebar, .bt-editor-canvas, .bt-empty { border: 1px solid var(--bt-line); border-radius: 21px; background: #fff; box-shadow: var(--bt-shadow); }
.bt-card { padding: clamp(21px,3vw,31px); }
.bt-card--status { border-top: 5px solid var(--bt-teal); }
.bt-card--levels { border-top: 5px solid var(--bt-blue); }
.bt-card--password { border-top: 5px solid var(--bt-coral); }
.bt-card--security { border-top: 5px solid #825fa7; }
.bt-card-heading { display: flex; align-items: center; gap: 14px; }
.bt-card-heading > span { display: grid; flex: 0 0 50px; width: 50px; height: 50px; place-items: center; border-radius: 15px; background: var(--bt-pale); font-size: 1.45rem; }
.bt-card-heading small { color: var(--bt-teal); font-size: .72rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.bt-card-heading h2 { margin: 2px 0 0; font-size: 1.4rem; }
.bt-card > p { color: var(--bt-muted); line-height: 1.5; }
.bt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 17px; }
.bt-btn { display: inline-flex; min-height: 40px; padding: 8px 14px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 10px; color: #fff; background: var(--bt-blue); font: inherit; font-size: .86rem; font-weight: 800; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; }
.bt-btn:hover { color: #fff; filter: brightness(1.05); }
.bt-btn:disabled { opacity: .42; cursor: default; filter: none; }
.bt-btn--green { background: var(--bt-teal); }
.bt-btn--red { background: var(--bt-red); }
.bt-btn--outline { color: var(--bt-teal-dark); border-color: #a9c8c5; background: #fff; }
.bt-btn--outline:hover { color: var(--bt-teal-dark); background: var(--bt-pale); }
.bt-btn--danger-outline { color: #a52f35; border-color: #e5adb0; background: #fff; }
.bt-btn--danger-outline:hover { color: #7d2025; background: #fff3f3; }
.bt-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 18px; }
.bt-stats div { padding: 13px 8px; border-radius: 12px; text-align: center; background: #edf5fb; }
.bt-stats strong, .bt-stats span { display: block; }
.bt-stats strong { color: var(--bt-blue); font-size: 1.55rem; }
.bt-stats span { margin-top: 3px; color: var(--bt-muted); font-size: .73rem; }
.bt-copy-field { margin-top: 18px; }
.bt-copy-field label { display: block; margin-bottom: 6px; font-weight: 800; }
.bt-copy-field input { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid #b6cbca; border-radius: 9px; background: #f8fbfb; }

.bt-form, .bt-login-form { display: grid; gap: 8px; margin-top: 18px; }
.bt-form label, .bt-login-form label, .bt-editor-sidebar label { color: #385553; font-size: .82rem; font-weight: 800; }
.bt-form input, .bt-login-form input, .bt-editor-sidebar input, .bt-editor-sidebar textarea, .bt-editor-sidebar select, .bt-grid-settings input, .bt-grid-settings select { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #aec6c3; border-radius: 9px; color: var(--bt-ink); background: #fff; font: inherit; }
.bt-form .bt-btn { margin-top: 5px; }
.bt-inline-form { margin-top: 10px; }
.bt-check { display: flex; align-items: center; gap: 8px; }
.bt-check input { width: 18px; height: 18px; }

.bt-level-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.bt-level-card { display: grid; grid-template-columns: 52px minmax(0,1fr); gap: 14px; padding: 21px; }
.bt-level-card.is-draft { border-style: dashed; background: #fbfcfc; }
.bt-level-icon { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 15px; background: var(--bt-pale); font-size: 1.5rem; }
.bt-level-card h2 { margin: 5px 0 3px; font-size: 1.18rem; }
.bt-level-card strong { font-size: .8rem; }
.bt-level-card p { min-height: 37px; margin: 5px 0 0; color: var(--bt-muted); line-height: 1.4; }
.bt-state { display: inline-block; padding: 3px 8px; border-radius: 999px; color: #146348; background: #dcf5e8; font-size: .69rem; font-weight: 850; }
.is-draft .bt-state { color: #86530c; background: #fff1c9; }
.bt-level-card dl { grid-column: 1/-1; display: flex; gap: 23px; margin: 2px 0 0; padding-top: 12px; border-top: 1px solid var(--bt-line); }
.bt-level-card dl div { display: flex; gap: 5px; }
.bt-level-card dt { color: var(--bt-muted); }
.bt-level-card dd { margin: 0; font-weight: 800; }
.bt-level-card .bt-actions { grid-column: 1/-1; margin-top: 0; }
.bt-empty { padding: 55px 24px; text-align: center; }
.bt-empty > span { font-size: 3rem; }
.bt-empty h2 { margin-bottom: 4px; }
.bt-empty p { color: var(--bt-muted); }

.bt-editor-form { display: grid; grid-template-columns: minmax(290px,370px) minmax(520px,1fr); gap: 18px; align-items: start; }
.bt-editor-sidebar { display: grid; gap: 7px; padding: 22px; }
.bt-editor-sidebar h2 { margin: 0 0 7px; }
.bt-editor-sidebar textarea { min-height: 72px; resize: vertical; }
.bt-two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.bt-two-fields > div { display: grid; gap: 6px; }
.bt-save { width: 100%; margin-top: 5px; }
.bt-block-picker { margin: 7px 0; padding: 10px; border: 1px solid var(--bt-line); border-radius: 11px; }
.bt-block-picker summary { cursor: pointer; font-weight: 850; }
.bt-block-picker fieldset { margin: 11px 0 0; padding: 8px; border: 1px solid var(--bt-line); border-radius: 9px; }
.bt-block-picker legend { padding: 0 5px; color: var(--bt-teal); font-size: .76rem; font-weight: 900; }
.bt-check-grid { display: grid; gap: 5px; }
.bt-check-grid label { display: flex; align-items: flex-start; gap: 6px; font-size: .76rem; font-weight: 650; }
.bt-check-grid input { width: 16px; height: 16px; min-height: 0; flex: 0 0 auto; }
.bt-editor-canvas { min-width: 0; padding: 22px; }
.bt-editor-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.bt-editor-heading h2 { margin: 0 0 4px; }
.bt-editor-heading p { margin: 0; color: var(--bt-muted); }
.bt-file-actions, .bt-tools, .bt-grid-settings { display: flex; flex-wrap: wrap; gap: 8px; }
.bt-grid-settings { margin-top: 17px; padding: 11px; border-radius: 11px; background: var(--bt-pale); }
.bt-grid-settings label { display: grid; grid-template-columns: auto 83px; align-items: center; gap: 7px; font-size: .78rem; font-weight: 800; }
.bt-grid-settings label:last-child { grid-template-columns: auto 132px; }
.bt-tools { margin-top: 12px; }
.bt-tools button { min-height: 38px; padding: 7px 11px; border: 1px solid #a9c6c3; border-radius: 9px; color: var(--bt-ink); background: #fff; font: inherit; font-size: .8rem; font-weight: 800; cursor: pointer; }
.bt-tools button:hover, .bt-tools button.active { color: #fff; border-color: var(--bt-teal); background: var(--bt-teal); }
.bt-editor-status { margin: 10px 0; padding: 9px 11px; border: 1px solid var(--bt-line); border-radius: 9px; font-size: .8rem; font-weight: 750; background: #f8fbfb; }
.bt-editor-status.is-valid { color: #17613d; border-color: #a8d9be; background: #ecf9f1; }
.bt-editor-status.is-warning { color: #8a5514; border-color: #ead19e; background: #fff8e9; }
.bt-editor-grid-wrap { display: grid; min-height: 520px; padding: 18px; place-items: center; overflow: auto; border: 1px solid var(--bt-line); border-radius: 16px; background: #f5faf9; }
.bt-editor-grid { --bt-cols: 7; --bt-rows: 7; display: grid; grid-template-columns: repeat(var(--bt-cols),minmax(42px,62px)); grid-template-rows: repeat(var(--bt-rows),minmax(42px,62px)); gap: 3px; touch-action: none; }
.bt-editor-cell { display: grid; place-items: center; border: 1px solid #c4d8d6; border-radius: 7px; color: var(--bt-teal-dark); background: #fff; font-size: 1.05rem; cursor: pointer; user-select: none; }
.bt-editor-cell:hover { border-color: var(--bt-teal); background: #edf8f6; }
.bt-editor-cell.is-wall { border-color: #7b9492; background: repeating-linear-gradient(135deg,#9dafad 0 6px,#8ba09e 6px 12px); }
.bt-editor-cell.is-start { border: 3px solid var(--bt-teal); background: #e8f7f4; font-size: .88rem; }
.bt-editor-cell.is-goal { color: #d99700; border-color: #f0ca66; background: #fff7cf; font-size: 1.65rem; }

.bt-login-page { display: grid; min-height: 680px; padding: 42px 22px; place-items: center; background: radial-gradient(circle at 20% 10%,#dff3ef,transparent 38%),linear-gradient(145deg,#f8fbfb,#e6f1f0); }
.bt-login-card { width: min(470px,100%); padding: clamp(28px,5vw,46px); border: 1px solid #d6e8e5; border-radius: 25px; background: rgba(255,255,255,.97); box-shadow: 0 28px 70px rgba(14,72,67,.2); }
.bt-login-logo { display: grid; margin-bottom: 13px; place-items: center; }
.bt-login-logo .bt-brand-mark { width: 70px; height: 61px; color: var(--bt-teal); background: #eaf7f5; }
.bt-login-card h1 { margin: 0; font-size: 2rem; text-align: center; }
.bt-login-card > p { color: var(--bt-muted); line-height: 1.5; text-align: center; }
.bt-login-card .bt-eyebrow { color: var(--bt-teal); text-align: center; }
.bt-login-form .bt-btn { width: 100%; margin-top: 6px; }

@media (max-width: 1080px) {
  .bt-header { grid-template-columns: auto 1fr; }
  .bt-nav { grid-column: 1/-1; grid-row: 2; justify-content: flex-start; overflow-x: auto; }
  .bt-user { justify-self: end; }
  .bt-editor-form { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .bt-header { gap: 10px; padding: 8px 12px; }
  .bt-brand small, .bt-user > span { display: none; }
  .bt-nav a { flex: 0 0 auto; padding: 8px 9px; font-size: .78rem; }
  .bt-main { width: min(100% - 20px,1480px); padding-top: 14px; }
  .bt-dashboard-grid, .bt-level-grid { grid-template-columns: 1fr; }
  .bt-page-heading, .bt-editor-heading { align-items: flex-start; flex-direction: column; }
  .bt-hero { min-height: 112px; padding: 17px 20px; }
  .bt-hero-icon { opacity: .35; }
  .bt-editor-canvas { padding: 14px; }
  .bt-editor-grid-wrap { min-height: 430px; padding: 10px; }
  .bt-editor-grid { grid-template-columns: repeat(var(--bt-cols),minmax(32px,1fr)); grid-template-rows: repeat(var(--bt-rows),minmax(32px,1fr)); }
}
@media (max-width: 520px) {
  .bt-card, .bt-level-card, .bt-editor-sidebar { padding: 17px; }
  .bt-level-card { grid-template-columns: 44px minmax(0,1fr); gap: 10px; }
  .bt-level-icon { width: 44px; height: 44px; }
  .bt-level-card dl { flex-direction: column; gap: 4px; }
  .bt-actions > .bt-btn, .bt-actions > form, .bt-actions form .bt-btn { width: 100%; }
  .bt-two-fields { grid-template-columns: 1fr; }
}
