@font-face {
  font-family: "SF Pro Display Local";
  src:
    local("SF Pro Display Regular"),
    local("SFProDisplay-Regular"),
    url("fonts/SFPRODISPLAYREGULAR.OTF") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: block;
}

@font-face {
  font-family: "SF Pro Display Local";
  src:
    local("SF Pro Display Medium"),
    local("SFProDisplay-Medium"),
    url("fonts/SFPRODISPLAYMEDIUM.OTF") format("opentype");
  font-style: normal;
  font-weight: 500;
  font-display: block;
}

@font-face {
  font-family: "SF Pro Display Local";
  src:
    local("SF Pro Display Bold"),
    local("SFProDisplay-Bold"),
    url("fonts/SFPRODISPLAYBOLD.OTF") format("opentype");
  font-style: normal;
  font-weight: 700;
  font-display: block;
}

:root {
  color-scheme: dark;
  --page: #07130f;
  --panel: rgba(13, 31, 25, 0.88);
  --panel-strong: #0d1f19;
  --panel-soft: #112820;
  --field: #07130f;
  --border: rgba(160, 255, 213, 0.14);
  --border-focus: #20d69a;
  --line: rgba(160, 255, 213, 0.14);
  --accent: #20d69a;
  --accent-strong: #0e9f73;
  --text: #f5fff9;
  --muted: #a7bdb3;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }

body {
  min-width: 320px;
  background: var(--page);
  color: var(--text);
  font-family: "Roboto", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, textarea, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.saas-editor-page {
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 2%, rgba(32, 214, 154, 0.14), transparent 28%),
    radial-gradient(circle at 94% 22%, rgba(32, 214, 154, 0.08), transparent 25%),
    var(--page);
  background-attachment: fixed;
}

.app-shell {
  width: min(1360px, calc(100% - clamp(28px, 5vw, 88px)));
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 0 32px;
}

.editor-header {
  min-height: 80px;
  margin-bottom: clamp(20px, 2.2vw, 32px);
  padding: 14px clamp(16px, 2vw, 26px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: 0 0 24px 24px;
  border-top: 0;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.editor-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.calls-wordmark {
  color: var(--text);
  font-size: 29px;
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 1;
}

.calls-wordmark span { color: var(--accent); }

.editor-brand-copy {
  min-width: 0;
  padding-left: 16px;
  display: grid;
  gap: 2px;
  border-left: 1px solid var(--line);
}

.editor-brand-copy strong {
  color: #eaf7f1;
  font-size: 12px;
  font-weight: 700;
}

.editor-brand-copy span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 9px;
}

.header-badges span,
.form-chip,
#counter {
  padding: 8px 11px;
  border: 1px solid rgba(32, 214, 154, 0.18);
  border-radius: 999px;
  background: rgba(32, 214, 154, 0.055);
  color: #8fe9c8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .055em;
  white-space: nowrap;
}

.builder-layout {
  display: grid;
  grid-template-columns: minmax(380px, 460px) minmax(400px, 1fr);
  align-items: start;
  gap: clamp(24px, 3vw, 48px);
}

.builder-panel { min-width: 0; }
.builder-panel-preview { display: flex; justify-content: center; }

.panel,
.mockup-preview-shell {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel.mockup-form {
  width: 100%;
  height: min(840px, calc(100vh - 144px));
  min-height: 560px;
  padding: clamp(22px, 2.2vw, 32px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}

.panel.mockup-form::-webkit-scrollbar { display: none; }

.form-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .16em;
}

h1, h2, p { margin-top: 0; }
h1 {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 27px;
  line-height: 1.02;
  letter-spacing: -0.045em;
}
h2 {
  margin-bottom: 0;
  color: #eef5f2;
  font-size: 17px;
  letter-spacing: -0.025em;
}

.subtitle {
  max-width: 330px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.font-status {
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(5, 18, 14, 0.5);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}
.font-status.ok {
  border-color: rgba(32, 214, 154, 0.24);
  background: rgba(32, 214, 154, 0.055);
  color: #79efc8;
}
.font-status.warn {
  border-color: rgba(255, 196, 92, 0.2);
  color: #ffd59a;
}

.form-divider {
  margin: 19px 2px 14px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}
.form-divider span { height: 1px; background: var(--line); }
.form-divider strong {
  color: #cfe2da;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
}

.field { display: block; margin-top: 14px; }
.field > span,
.timing-control > span {
  display: block;
  margin-bottom: 8px;
  color: #dfece6;
  font-size: 12px;
  font-weight: 600;
}
.field small,
.timing-control small { color: var(--muted); font-weight: 500; }

textarea,
.time-generator-row input[type="time"],
.fine-grid input,
.fine-grid select {
  width: 100%;
  border: 1px solid rgba(169, 218, 197, 0.19);
  border-radius: 12px;
  background: var(--field);
  color: var(--text);
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}

textarea {
  min-height: 150px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.44;
  font-size: 12px;
}

textarea::placeholder,
input::placeholder { color: #71877f; }

textarea:focus,
input:focus,
select:focus {
  border-color: var(--border-focus) !important;
  box-shadow: 0 0 0 3px rgba(32, 214, 154, 0.1);
}

.time-generator-row {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(128px, .8fr);
  gap: 12px;
  align-items: stretch;
}

.time-generator-row input[type="time"] {
  min-height: 46px;
  padding: 0 14px;
  color-scheme: dark;
}
.time-generator-row input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: 1;
  cursor: pointer;
}

.timing-help {
  display: block;
  margin-top: 8px;
  color: #789087 !important;
  font-size: 10px;
  line-height: 1.4;
}

button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--panel-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease, filter .15s ease;
}
button:hover:not(:disabled) {
  border-color: rgba(32, 214, 154, 0.28);
  background: #17352b;
}
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .55; cursor: wait; }
button.accent-outline {
  border-color: rgba(32, 214, 154, 0.28);
  color: #79efc8;
}
button.primary {
  border-color: rgba(32, 214, 154, 0.64);
  background: linear-gradient(145deg, var(--accent), #15b982);
  color: #032219;
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(32, 214, 154, 0.13);
}
button.primary:hover:not(:disabled) {
  border-color: var(--accent);
  background: linear-gradient(145deg, #29e2a5, #19c38a);
  filter: brightness(1.02);
}

.actions {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.actions .primary { grid-column: 1 / -1; }

.fine-tune {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.fine-tune summary {
  color: #eef5f2;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}
.fine-grid {
  margin-top: 13px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.fine-grid label { color: var(--muted); font-size: 10px; }
.fine-grid input,
.fine-grid select {
  min-height: 38px;
  margin-top: 6px;
  padding: 0 10px;
  font-size: 11px;
}

.mockup-stage {
  position: sticky;
  top: 18px;
  width: 100%;
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 12px;
}

.preview-head {
  width: min(100%, 508px);
  padding: 0 4px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.mockup-preview-shell,
.canvas-shell {
  width: min(100%, 508px);
  height: 806px;
  padding: 16px;
  display: grid;
  justify-items: center;
  align-items: start;
  overflow: hidden;
}

canvas {
  display: block;
  flex: 0 0 auto;
  width: 370px;
  height: 771px;
  max-width: none;
  background: #000;
  filter: drop-shadow(0 22px 38px rgba(0, 0, 0, .28));
}

@media (max-width: 1020px) {
  .app-shell {
    width: min(760px, calc(100% - 24px));
  }
  .editor-header {
    border-radius: 0 0 18px 18px;
  }
  .header-badges { display: none; }
  .editor-brand-copy { display: none; }
  .builder-layout { grid-template-columns: 1fr; gap: 24px; }
  .panel.mockup-form { height: auto; min-height: 0; }
  .mockup-stage { position: static; }
  .mockup-preview-shell,
  .canvas-shell { height: auto; min-height: 360px; }
}

@media (max-width: 560px) {
  .app-shell { width: calc(100% - 18px); }
  .editor-header { min-height: 68px; padding-inline: 14px; }
  .calls-wordmark { font-size: 25px; }
  .panel.mockup-form { padding: 20px 16px; border-radius: 18px; }
  .form-chip { display: none; }
  .time-generator-row { grid-template-columns: 1fr; }
  .actions { grid-template-columns: 1fr; }
  .actions .primary { grid-column: auto; }
  .fine-grid { grid-template-columns: 1fr; }
  .preview-head { padding-inline: 2px; }
  .mockup-preview-shell { border-radius: 18px; padding: 10px; }
}
