* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f2f5fa;
  color: #172c42;
  font:
    14px/1.5 system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  border: 1px solid #cbd7e4;
  background: #fff;
  min-height: 42px;
  padding: 9px 14px;
  border-radius: 8px;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 3px solid #4b92f4;
  outline-offset: 3px;
}
button.active,
button[aria-pressed="true"] {
  border-color: #1769df;
  background: #e6f0ff;
  color: #0c51b4;
}
.primary {
  background: #1769df;
  border-color: #1769df;
  color: #fff;
}
button.primary.active {
  color: #fff;
  background: #1258bf;
}
.lab-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 24px;
  background: #11263b;
  color: #fff;
}
.lab-header strong {
  font-size: 18px;
  letter-spacing: -0.035em;
}
.lab-header span {
  margin-left: auto;
  font-size: 12px;
  color: #becfe1;
}
.lab-header button {
  background: transparent;
  color: white;
  border-color: #63768c;
  font-size: 12px;
}
main {
  max-width: 1400px;
  margin: auto;
  padding: 24px;
}
.lab-title {
  margin-bottom: 24px;
}
.lab-title h1 {
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.04em;
  margin: 0;
}
.lab-title p {
  color: #566b81;
  margin: 8px 0 0;
  max-width: 800px;
}
h2,
h3,
p {
  margin: 0;
}
h2 {
  font-size: 18px;
  letter-spacing: -0.025em;
}
h3 {
  font-size: 14px;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.card {
  background: #fff;
  border: 1px solid #d7e1ed;
  border-radius: 12px;
  padding: 22px;
  min-width: 0;
}
.card h2 {
  margin-bottom: 16px;
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
.muted,
small {
  color: #566b81;
  font-size: 12px;
}
.note {
  padding: 12px 16px;
  background: #e8f1ff;
  color: #285d98;
  border-radius: 8px;
  font-size: 12px;
  margin: 18px 0;
}
.label,
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin: 14px 0 6px;
}
input:not([type="checkbox"]):not([type="range"]):not([type="color"]),
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #c8d6e6;
  border-radius: 7px;
  background: white;
  min-height: 42px;
}
input[type="range"] {
  width: 100%;
  accent-color: #1769df;
  min-height: 32px;
}
input[type="color"] {
  width: 50px;
  height: 38px;
  border: 0;
  padding: 0;
  background: none;
}
input[type="checkbox"] {
  accent-color: #1769df;
  min-width: 18px;
  min-height: 18px;
}
textarea {
  resize: vertical;
  min-height: 110px;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.status {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 20px;
  background: #e6f0ff;
  color: #0c51b4;
  font-size: 12px;
}
.success {
  background: #e4f4ec;
  color: #176745;
}
.error {
  color: #ae253c;
  font-size: 13px;
  margin: 12px 0;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.metric {
  background: white;
  padding: 18px;
  border: 1px solid #d7e1ed;
  border-radius: 10px;
  min-width: 0;
}
.metric span {
  font-size: 12px;
  color: #566b81;
}
.metric strong {
  display: block;
  font-size: 27px;
  margin: 6px 0;
  letter-spacing: -0.04em;
}
.table-wrap {
  overflow: auto;
  max-height: 340px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}
th,
td {
  padding: 12px;
  border-bottom: 1px solid #e1e8f0;
  text-align: left;
  white-space: nowrap;
}
th {
  background: #f4f7fb;
  font-weight: 600;
  position: sticky;
  top: 0;
}
.bar-row {
  display: grid;
  grid-template-columns: minmax(60px, 1fr) 2fr 75px;
  gap: 12px;
  align-items: center;
  margin: 16px 0;
  font-size: 12px;
}
.bar-track {
  height: 12px;
  background: #eaf0f8;
  border-radius: 4px;
  overflow: hidden;
}
.bar-track i {
  display: block;
  height: 100%;
  background: #2586dc;
}
.notice {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: #142c46;
  color: white;
  border-radius: 10px;
  padding: 12px 20px;
  max-width: calc(100% - 32px);
  z-index: 20;
  display: none;
}
.notice.show {
  display: block;
}
.phone {
  max-width: 290px;
  margin: auto;
  background: #142d46;
  color: white;
  border-radius: 32px;
  padding: 30px 22px;
  text-align: center;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}
.phone .avatar {
  font-size: 36px;
  background: #234867;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  margin: auto;
}
.phone h2 {
  color: white;
  margin: 0;
}
.call-pulse {
  animation: callPulse 1s ease-in-out infinite;
}
.chat {
  background: #eef3f6;
  min-height: 300px;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bubble {
  background: white;
  padding: 14px 18px;
  border-radius: 0 12px 12px 12px;
  box-shadow: 0 1px 3px #122a4110;
  white-space: pre-line;
  line-height: 1.65;
  max-width: 95%;
  font-size: 13px;
}
.bubble.sent {
  align-self: end;
  background: #d9f3e6;
  border-radius: 12px 0 12px 12px;
}
.transcript {
  max-height: 220px;
  overflow: auto;
  margin-top: 20px;
}
.transcript p {
  padding: 10px 0;
  border-bottom: 1px solid #e5ecf4;
  font-size: 12px;
}
.transcript b {
  color: #1769df;
}
.workflow {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 18px 0;
}
.workflow span {
  padding: 6px 10px;
  background: #e9eef5;
  color: #566b81;
  border-radius: 6px;
  font-size: 12px;
}
.workflow span.done {
  background: #dcf1e8;
  color: #126744;
}
.editor-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 20px;
}
.controls {
  max-height: 700px;
  overflow: auto;
}
.controls details {
  border-bottom: 1px solid #dbe4ee;
  padding: 10px 0;
}
.controls summary {
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
  min-height: 36px;
}
.controls label {
  font-weight: 400;
}
.controls .row label {
  margin: 0;
}
.canvas-stage {
  display: grid;
  place-items: center;
  min-height: 300px;
  background: repeating-conic-gradient(#e3e9ef 0% 25%, #f1f4f8 0% 50%) 50%/24px 24px;
  border-radius: 9px;
  overflow: hidden;
  position: relative;
}
.canvas-stage canvas {
  display: block;
  max-width: 100%;
  max-height: 500px;
  width: auto;
  height: auto;
  touch-action: none;
}
.control-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.check-label {
  display: flex;
  gap: 9px;
  align-items: center;
  font-weight: 400;
}
.check-label input {
  margin: 0;
}
.swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.swatches button {
  font-size: 12px;
  min-height: 36px;
  padding: 6px 10px;
}
.timeline {
  margin: 20px 0;
  background: #eef3f8;
  border-radius: 8px;
  padding: 14px;
}
.clip-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0;
}
.clip {
  min-width: 150px;
  background: #dbe9fb;
  border: 1px solid #a5c4eb;
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  text-align: left;
}
.clip.active {
  background: #1769df;
  color: #fff;
}
.clip small {
  display: block;
  color: inherit;
  opacity: 0.85;
}
.editor-help {
  font-size: 12px;
  color: #566b81;
  margin: 12px 0;
}
.code-editor {
  font:
    14px/1.7 ui-monospace,
    Consolas,
    monospace;
  background: #10263c !important;
  color: #e7f1ff !important;
  tab-size: 2;
  min-height: 170px;
}
.schema {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.schema button {
  text-align: left;
}
.schema small {
  display: block;
}
.score-track {
  height: 8px;
  background: #e9eff6;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 12px;
}
.score-track i {
  height: 100%;
  display: block;
  background: #1769df;
  transition: width 180ms;
}
.serp {
  font:
    14px/1.5 Arial,
    sans-serif;
  padding: 22px;
  background: #fff;
  border: 1px solid #d7e1ed;
  border-radius: 12px;
}
.serp h3 {
  font-size: 20px;
  font-weight: 400;
  color: #1a0dab;
  margin: 6px 0;
}
.serp small {
  color: #176a37;
}
.local-profile {
  border-top: 1px solid #dbe4ee;
  margin-top: 18px;
  padding-top: 18px;
}
.changes {
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.8;
  color: #566b81;
}
@keyframes callPulse {
  50% {
    box-shadow: 0 0 0 12px #83b8f330;
  }
}
@media (max-width: 850px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }
  .editor-layout > section {
    order: -1;
  }
  .controls {
    max-height: none;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .metric-grid {
    gap: 8px;
  }
  .lab-header {
    gap: 12px;
    padding: 14px 16px;
  }
  .lab-header span {
    display: none;
  }
  .lab-header button {
    margin-left: auto;
  }
  main {
    padding: 16px;
  }
  .card {
    padding: 16px;
  }
  .canvas-stage canvas {
    max-height: 420px;
  }
  .controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .controls > h2,
  .controls > .row,
  .controls > .note,
  .controls > fieldset,
  .controls > button {
    grid-column: 1/-1;
  }
  .controls details {
    min-width: 0;
  }
}
@media (max-width: 480px) {
  .controls {
    display: block;
  }
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }
  .metric {
    padding: 14px;
  }
  .metric strong {
    font-size: 23px;
  }
  .bar-row {
    grid-template-columns: minmax(40px, 1fr) 1.4fr 62px;
    gap: 8px;
  }
  .lab-title h1 {
    font-size: 24px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
