:root {
  --bg: #f3efe7;
  --paper: #fffdf8;
  --paper-warm: #fbf7ef;
  --ink: #18222f;
  --muted: #64717f;
  --line: #d9e0e3;
  --teal: #147783;
  --teal-dark: #0f3a43;
  --coral: #ce604c;
  --gold: #d7aa52;
  --green: #2f806b;
  --shadow: 0 24px 70px rgba(29, 38, 49, 0.14);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 2%, rgba(206, 96, 76, 0.12), transparent 26rem),
    radial-gradient(circle at 92% 10%, rgba(20, 119, 131, 0.13), transparent 31rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 24px;
  background: rgba(255, 253, 248, 0.88);
  border-bottom: 1px solid rgba(24, 34, 47, 0.1);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--teal-dark);
  color: #fff7e8;
  font-weight: 900;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.16);
}

.brand strong {
  display: block;
  font-size: 15px;
  line-height: 1.1;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.top-actions,
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.interface-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(24, 34, 47, 0.12);
  border-radius: 8px;
  background: #ece6dc;
}

.ui-segment {
  min-width: 42px;
  min-height: 32px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.ui-segment.active {
  background: var(--paper);
  color: var(--teal-dark);
  box-shadow: 0 6px 14px rgba(29, 38, 49, 0.1);
}

.primary-button,
.ghost-button {
  min-height: 40px;
  border-radius: 7px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.primary-button {
  background: var(--teal-dark);
  color: #fffdf8;
  box-shadow: 0 10px 24px rgba(15, 58, 67, 0.22);
}

.ghost-button {
  background: rgba(255, 253, 248, 0.8);
  color: var(--ink);
  border: 1px solid rgba(24, 34, 47, 0.14);
}

.compact {
  min-height: 34px;
  padding: 0 12px;
}

.builder-layout {
  display: grid;
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
  gap: 28px;
  width: min(1480px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 52px;
}

.control-panel {
  align-self: start;
  display: grid;
  gap: 14px;
}

.intro-panel,
.panel-block {
  background: rgba(255, 253, 248, 0.86);
  border: 1px solid rgba(24, 34, 47, 0.1);
  border-radius: var(--radius);
  box-shadow: 0 12px 34px rgba(29, 38, 49, 0.08);
}

.intro-panel {
  padding: 26px;
  background:
    linear-gradient(145deg, rgba(255, 253, 248, 0.92), rgba(238, 247, 246, 0.9)),
    var(--paper);
}

.intro-panel h1 {
  margin: 0;
  max-width: 10ch;
  font-size: 40px;
  line-height: 0.98;
  letter-spacing: 0;
}

.intro-panel p,
.block-heading p {
  margin: 10px 0 0;
  color: var(--muted);
}

.panel-block {
  padding: 20px;
}

.block-heading {
  margin-bottom: 14px;
}

.block-heading h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.15;
}

.block-heading p {
  font-size: 13px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px;
  border-radius: 8px;
  background: #ece6dc;
}

.segment {
  min-height: 36px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.segment.active {
  background: var(--paper);
  color: var(--teal-dark);
  box-shadow: 0 6px 14px rgba(29, 38, 49, 0.1);
}

.field-grid {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: #354453;
  font-size: 12px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(24, 34, 47, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  padding: 10px 11px;
  font-size: 14px;
  font-weight: 500;
}

textarea {
  resize: vertical;
  min-height: 74px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(20, 119, 131, 0.36);
  border-color: rgba(20, 119, 131, 0.55);
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 9px;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.section-list {
  display: grid;
  gap: 8px;
}

.section-toggle {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(24, 34, 47, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.section-toggle input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--teal);
}

.section-toggle strong {
  display: block;
  font-size: 14px;
}

.section-toggle span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.message-tool-list {
  display: grid;
  gap: 10px;
}

.message-tool-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(24, 34, 47, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.message-tool-main {
  min-width: 0;
}

.message-tool-card strong {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
}

.message-editor {
  min-height: 118px;
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(24, 34, 47, 0.12);
  border-radius: 7px;
  background: rgba(255, 253, 248, 0.78);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.message-editor:focus {
  outline: 2px solid rgba(20, 119, 131, 0.36);
  border-color: rgba(20, 119, 131, 0.55);
}

.message-tool-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.message-tool-actions .compact {
  min-width: 88px;
}

.message-tool-card.is-custom .message-editor {
  color: var(--ink);
}

.message-tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.inline-placeholder {
  color: var(--coral);
  font-weight: 850;
}

.preview-stage {
  min-width: 0;
}

.preview-toolbar {
  position: sticky;
  top: 75px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(24, 34, 47, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.9);
  backdrop-filter: blur(18px);
}

.preview-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.preview-toolbar strong {
  display: block;
  margin-top: 2px;
  font-size: 15px;
}

.guide-pages {
  display: grid;
  gap: 18px;
  padding: 18px;
  border-radius: var(--radius);
  background: rgba(224, 217, 203, 0.56);
  box-shadow: var(--shadow);
}

.print-page {
  width: min(100%, 8.5in);
  min-height: 11in;
  margin: 0 auto;
  padding: 0.58in;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(215, 170, 82, 0.16), transparent 2.4in),
    linear-gradient(180deg, var(--paper), var(--paper-warm));
  box-shadow: 0 14px 32px rgba(29, 38, 49, 0.16);
}

.print-page::before {
  content: "";
  position: absolute;
  inset: 0.28in;
  border: 1px solid rgba(24, 34, 47, 0.12);
  pointer-events: none;
}

.cover-page {
  display: grid;
  align-content: center;
  gap: 0.25in;
  text-align: center;
  color: #fffdf8;
  background:
    linear-gradient(135deg, rgba(20, 119, 131, 0.96), rgba(15, 58, 67, 0.98)),
    var(--teal-dark);
}

.cover-page::before {
  border-color: rgba(255, 255, 255, 0.24);
}

.guide-kicker,
.guide-label {
  margin: 0;
  color: var(--coral);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cover-page .guide-kicker {
  color: var(--gold);
}

.guide-title {
  margin: 0;
  font-size: 52px;
  line-height: 0.98;
  letter-spacing: 0;
}

.section-title {
  margin: 0 0 18px;
  font-size: 32px;
  line-height: 1.06;
  letter-spacing: 0;
}

.guide-subtitle {
  max-width: 5.8in;
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.84);
  font-size: 18px;
}

.guide-badges {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.guide-badge {
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.guide-meta {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.guide-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.26in;
}

.guide-columns.single {
  grid-template-columns: 1fr;
}

.guide-card,
.info-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 18px;
}

.guide-card.es {
  border-color: rgba(206, 96, 76, 0.36);
}

.guide-card h3,
.info-card h3 {
  margin: 18px 0 6px;
  color: var(--teal);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.guide-card h3:first-of-type,
.info-card h3:first-of-type {
  margin-top: 12px;
}

.guide-card p,
.info-card p {
  margin: 0 0 10px;
}

.placeholder {
  min-height: 28px;
  margin: 7px 0 13px;
  padding-top: 4px;
  color: var(--muted);
  border-bottom: 1px dashed rgba(24, 34, 47, 0.35);
}

.placeholder.big {
  min-height: 80px;
}

.guide-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.guide-list li {
  position: relative;
  margin: 8px 0;
  padding-left: 22px;
}

.guide-list li::before {
  content: "";
  width: 11px;
  height: 11px;
  border: 1.5px solid var(--teal);
  border-radius: 3px;
  position: absolute;
  left: 0;
  top: 5px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.18in;
}

.info-card {
  min-height: 1.82in;
}

.wifi-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: start;
}

.address-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: start;
}

.wifi-card .placeholder {
  margin-right: 0;
}

.wifi-qr,
.compact-qr {
  width: 1.48in;
  min-height: 1.78in;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.compact-qr {
  width: 1.18in;
  min-height: 1.42in;
}

.wifi-qr svg,
.compact-qr svg {
  width: 1.16in;
  height: 1.16in;
  display: block;
}

.compact-qr svg {
  width: 0.92in;
  height: 0.92in;
}

.wifi-qr span,
.compact-qr span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.sign-page,
.emergency-card-page {
  min-height: 8.2in;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.22in;
  text-align: center;
}

.sign-page h3,
.emergency-card-page h3 {
  margin: 0;
  max-width: 6.4in;
  color: var(--teal-dark);
  font-size: 44px;
  line-height: 1.02;
  letter-spacing: 0;
}

.sign-page p {
  max-width: 5.4in;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.sign-qr {
  width: 2.35in;
  height: 2.35in;
  display: grid;
  place-items: center;
  padding: 0.16in;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 30px rgba(29, 38, 49, 0.1);
}

.sign-qr svg {
  width: 2in;
  height: 2in;
}

.sign-details {
  width: min(100%, 5.8in);
  display: grid;
  gap: 10px;
}

.sign-details div {
  display: grid;
  grid-template-columns: 1.7in 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  text-align: left;
}

.sign-details span,
.emergency-card-grid h4,
.emergency-map-qr span {
  color: var(--coral);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sign-details strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1.1;
}

.sign-note {
  font-weight: 800;
}

.emergency-card-page {
  align-content: start;
  padding-top: 0.35in;
}

.emergency-card-page h3 span {
  display: block;
  margin-top: 0.08in;
  color: var(--coral);
  font-size: 78px;
}

.emergency-card-grid {
  width: min(100%, 6.6in);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.16in;
}

.emergency-card-grid section {
  min-height: 1.1in;
  padding: 0.16in;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  text-align: left;
}

.emergency-card-grid h4 {
  margin: 0 0 8px;
}

.emergency-card-grid p {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.3;
}

.emergency-map-qr {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 0.12in;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.emergency-map-qr svg {
  width: 1.15in;
  height: 1.15in;
}

.guide-footer {
  position: absolute;
  left: 0.58in;
  right: 0.58in;
  bottom: 0.38in;
  display: flex;
  justify-content: space-between;
  color: rgba(24, 34, 47, 0.45);
  font-size: 11px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 8in;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  color: var(--ink);
  font-size: 22px;
}

@media (max-width: 1080px) {
  .builder-layout {
    grid-template-columns: 1fr;
  }

  .intro-panel h1 {
    max-width: 16ch;
  }

  .preview-toolbar {
    top: 74px;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions,
  .toolbar-actions {
    width: 100%;
  }

  .top-actions button,
  .toolbar-actions button {
    flex: 1;
  }

  .builder-layout {
    width: min(100% - 22px, 1480px);
    padding-top: 16px;
  }

  .intro-panel h1 {
    font-size: 34px;
  }

  .preview-toolbar {
    align-items: stretch;
    flex-direction: column;
    top: 122px;
  }

  .guide-pages {
    padding: 10px;
  }

  .print-page {
    width: 100%;
    min-height: 0;
    padding: 28px;
  }

  .print-page::before,
  .guide-footer {
    display: none;
  }

  .guide-columns,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .wifi-card,
  .address-card,
  .message-tool-card,
  .sign-details div,
  .emergency-card-grid {
    grid-template-columns: 1fr;
  }

  .guide-title {
    font-size: 42px;
  }

  .sign-page h3,
  .emergency-card-page h3 {
    font-size: 34px;
  }

  .emergency-card-page h3 span {
    font-size: 58px;
  }
}

@page {
  size: Letter;
  margin: 0;
}

@media print {
  body {
    background: white;
  }

  .topbar,
  .control-panel,
  .preview-toolbar {
    display: none;
  }

  .builder-layout,
  .preview-stage,
  .guide-pages {
    display: block;
    width: auto;
    margin: 0;
    padding: 0;
    background: white;
    box-shadow: none;
  }

  .print-page {
    width: 8.5in;
    height: 11in;
    min-height: 11in;
    margin: 0;
    box-shadow: none;
    page-break-after: always;
  }

  .print-page:last-child {
    page-break-after: auto;
  }
}
