:root {
  --ui-bg: #ffffff;
  --ui-ink: #20242a;
  --ui-muted: #6c7178;
  --ui-panel: #e8e8e8;
  --ui-border: #cfd5dc;
  --ui-blue: #1e96ff;
  --ui-shadow: 0 8px 18px rgba(18, 26, 36, .12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f5f5f5;
  color: var(--ui-ink);
}

.preview-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 390px 1fr;
}

.design-pane {
  height: 100vh;
  overflow: hidden;
  background: var(--ui-bg);
  color: var(--ui-ink);
  border-right: 1px solid #d9dee4;
}

.design-panel {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 34px 22px 46px;
  scrollbar-color: #8b8b8b #f6f6f6;
  scrollbar-width: thin;
}

.design-panel::-webkit-scrollbar {
  width: 14px;
}

.design-panel::-webkit-scrollbar-track {
  background: #f6f6f6;
}

.design-panel::-webkit-scrollbar-thumb {
  background: #8b8b8b;
  border: 4px solid #f6f6f6;
  border-radius: 999px;
}

h1 {
  margin: 0 0 30px;
  color: #07182d;
  font-size: 36px;
  line-height: .98;
  letter-spacing: -.04em;
}

h2 {
  margin: 0 0 18px;
  font-size: 20px;
  line-height: 1.15;
}

h3 {
  margin: 0 0 14px;
  font-size: 17px;
}

button,
select {
  font: inherit;
}

a {
  color: #1687ff;
}

.author-picker label {
  display: block;
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ui-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.author-picker select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
}

.toolbar-author-picker .author-picker {
  min-width: 220px;
}

.toolbar-author-picker .author-picker label {
  margin-bottom: 4px;
  font-size: 10px;
}

.toolbar-author-picker .author-picker select {
  min-height: 38px;
}

.pane-section-block {
  margin: 0 0 28px;
}

.spotlight-summary-card {
  background: #e5e5e5;
  padding: 20px;
  text-align: center;
}

.spotlight-preview {
  width: 100%;
  object-fit: cover;
  display: block;
  box-shadow: var(--ui-shadow);
  margin-bottom: 16px;
}

.spotlight-summary-card h3 {
  margin: 0 0 16px;
  font-size: 18px;
}

.primary-action,
.browse-button {
  min-height: 58px;
  border: 1px solid #b8bec5;
  border-radius: 10px;
  background: #fff;
  color: var(--ui-ink);
  padding: 0 22px;
  cursor: pointer;
}

.primary-action {
  font-size: 16px;
}

.wide-action {
  width: 100%;
}

.text-action {
  border: 0;
  background: transparent;
  color: var(--ui-ink);
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}

.style-row {
  width: 100%;
  display: grid;
  grid-template-columns: 64px 1fr 26px;
  gap: 14px;
  align-items: center;
  min-height: 82px;
  margin: 0 0 14px;
  border: 0;
  background: var(--ui-panel);
  color: var(--ui-ink);
  padding: 12px 16px;
  text-align: left;
  cursor: pointer;
}

.style-thumb {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  background: #fff;
  overflow: hidden;
}

.style-thumb-header {
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  padding: 17px 8px;
}

.style-thumb-header i {
  height: 4px;
  border-radius: 999px;
  background: #d9d9d9;
}

.style-thumb-font b {
  font-size: 19px;
  font-weight: 900;
  color: #050505;
}

.palette-thumb {
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 7px;
  place-items: stretch;
}

.palette-thumb i {
  border: 1px solid #c5c5c5;
}

.palette-thumb i:first-child {
  grid-column: 1 / -1;
}

.style-copy strong,
.style-copy span {
  display: block;
}

.style-copy strong {
  margin-bottom: 5px;
  font-size: 17px;
}

.style-copy span {
  font-size: 16px;
}

.edit-icon {
  color: #777;
  font-size: 20px;
}

.width-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0 0;
  padding: 14px 0;
  border-top: 1px solid #c9c9c9;
  border-bottom: 1px solid #c9c9c9;
}

.width-inline strong,
.width-inline small {
  display: block;
}

.width-inline small {
  color: var(--ui-muted);
  margin-top: 4px;
}

.segmented-control {
  display: inline-flex;
  padding: 3px;
  border: 1px solid #bfc5cb;
  border-radius: 999px;
  background: #fff;
}

.segmented-control button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  padding: 7px 12px;
  cursor: pointer;
}

.segmented-control button.active {
  background: var(--ui-blue);
  color: #fff;
}

.section-list-title {
  padding-bottom: 8px;
  border-bottom: 1px solid #c6c6c6;
}

.section-link-row {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 26px;
  gap: 8px;
  align-items: center;
  min-height: 72px;
  border: 0;
  border-bottom: 1px solid #d0d0d0;
  background: transparent;
  color: var(--ui-ink);
  padding: 12px 4px 12px 18px;
  text-align: left;
  cursor: pointer;
}

.section-link-row span {
  font-size: 17px;
}

.section-link-row small {
  grid-column: 1;
  color: var(--ui-muted);
  font-size: 13px;
}

.section-link-row b {
  grid-row: 1 / span 2;
  grid-column: 2;
  font-size: 42px;
  line-height: .6;
}

.muted-row {
  color: var(--ui-muted);
  font-size: 13px;
}

.back-button {
  display: inline-block;
  margin: -16px 0 10px;
  border: 0;
  background: transparent;
  color: #06101d;
  padding: 0;
  font-size: 16px;
  cursor: pointer;
}

.pane-description {
  margin: -22px 0 28px;
  color: #07111c;
  font-size: 16px;
  line-height: 1.35;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0px;
  padding: 14px 5px;
  border-top: 1px solid #c8c8c8;
  font-size: 16px;
}

.toggle-stack {
  margin: 0 0 18px;
}

.toggle-stack .toggle-row:first-child {
  border-top: 1px solid #c8c8c8;
}

.toggle-stack .toggle-row {
  border-top-color: #d9d9d9;
}

.alternating-toggle-row {
  flex-wrap: wrap;
}

.alternating-toggle-row small {
  flex-basis: 100%;
  color: var(--ui-muted);
  font-size: 13px;
}

.alternating-toggle-row .switch input:disabled + i {
  opacity: .55;
  cursor: not-allowed;
}

.switch {
  position: relative;
  width: 58px;
  height: 34px;
  display: inline-block;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch i {
  position: absolute;
  inset: 0;
  background: #fff;
  border: 1px solid #bfc4c9;
  border-radius: 999px;
  transition: background .18s ease;
}

.switch i::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #edf2f3;
  border: 1px solid #b8bec5;
  transition: transform .18s ease;
}

.switch input:checked + i {
  background: var(--ui-blue);
  border-color: var(--ui-blue);
}

.switch input:checked + i::after {
  transform: translateX(24px);
  background: #fff;
  border-color: #fff;
}

.selected-presentation {
  background: #e6e6e6;
  margin: 0 0 16px;
  padding: 20px;
  text-align: center;
}

.selected-title {
  margin-bottom: 14px;
  font-size: 17px;
}

.selected-title button {
  border: 0;
  background: transparent;
  color: #1687ff;
  text-decoration: underline;
  cursor: pointer;
}

.selected-preview {
  width: 100%;
  object-fit: cover;
  display: block;
  background: #d7d7d7;
  box-shadow: var(--ui-shadow);
}

.browse-button {
  width: 100%;
  margin-bottom: 28px;
  font-size: 16px;
}

.card-list {
  display: grid;
  gap: 18px;
}

.spotlight-category-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 18px 0;
}

.spotlight-category-button {
  min-height: 42px;
  border: 1px solid var(--ui-border);
  border-radius: 999px;
  background: #fff;
  color: var(--ui-ink);
  padding: 0 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.spotlight-category-button.active {
  border-color: var(--ui-blue);
  background: var(--ui-blue);
  color: #fff;
}

.choice-card-large {
  width: 100%;
  display: block;
  border: 2px solid var(--ui-border);
  border-radius: 10px;
  background: #fff;
  color: var(--ui-ink);
  padding: 11px 13px;
  text-align: left;
  cursor: pointer;
}

.choice-card-large.active {
  border-color: var(--ui-blue);
  box-shadow: 0 4px 14px rgba(30, 150, 255, .26);
}

.presentation-card strong,
.theme-choice strong {
  display: block;
  margin-bottom: 11px;
  font-size: 17px;
}

.presentation-preview {
  width: 100%;
  object-fit: cover;
  display: block;
  background: #e1e1e1;
}

.preview-placeholder {
  display: grid;
  place-items: center;
  min-height: 160px;
  background: #e1e1e1;
  color: var(--ui-muted);
  font-weight: 800;
}

.theme-swatch-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.theme-swatch-row i {
  border: 1px solid #c3c8cd;
  border-radius: 8px;
  height: 22px;
}

.font-card span {
  display: block;
}

.font-card .logo-font {
  margin-bottom: 18px;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -.03em;
}

.font-card .header-font {
  margin-bottom: 8px;
  font-size: 15px;
  letter-spacing: .02em;
}

.font-card .body-font {
  font-size: 15px;
}

.custom-font-card {
  text-align: center;
}

.custom-font-card span {
  display: block;
  margin-bottom: 14px;
  color: var(--ui-muted);
}

.custom-font-card button {
  width: 100%;
  min-height: 48px;
  border: 1px solid #bfc5cb;
  border-radius: 8px;
  background: rgba(0, 0, 0, .08);
  cursor: pointer;
}

.section-extra,
.section-extra-text {
  margin: 10px 0 28px;
  font-size: 16px;
  line-height: 1.45;
}

.section-extra h3 {
  margin: 28px 0 12px;
  padding-top: 12px;
  border-top: 1px solid #c8c8c8;
}

.section-extra a {
  display: block;
  margin: 16px 0;
}

.utility-row {
  width: 100%;
  display: grid;
  grid-template-columns: 72px 1fr 28px;
  gap: 18px;
  align-items: center;
  min-height: 82px;
  border: 0;
  background: var(--ui-panel);
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.utility-row img,
.text-icon {
  width: 58px;
  height: 58px;
  object-fit: cover;
  background: #fff;
}

.text-icon {
  display: grid;
  place-items: center;
  border: 2px dashed #777;
  font-weight: 900;
}

.utility-row span {
  font-size: 16px;
}

.feedback {
  margin-top: 54px;
  font-size: 16px;
}

.feedback strong,
.feedback a {
  display: block;
}

.feedback strong {
  margin-bottom: 4px;
}

main {
  min-width: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  background: #d9d5ce;
}

.viewport-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 28px;
  border-bottom: 1px solid #d8d4ce;
  background: #fff;
}

.preview-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.open-preview-button,
.reset-preview-button {
  min-height: 40px;
  border: 1px solid #cfc8bc;
  border-radius: 8px;
  background: #fff;
  color: #111;
  padding: 0 16px;
  cursor: pointer;
}

.open-preview-button:hover,
.reset-preview-button:hover {
  border-color: #2493f3;
  color: #0c72c7;
}

.reset-preview-button {
  background: #f8f4ef;
}

.viewport-buttons {
  display: flex;
  gap: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
}

.viewport-button {
  width: 58px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 0;
  background: #fff;
  color: #111;
  padding: 0;
  cursor: pointer;
}

.viewport-button.active {
  background: #2493f3;
  color: #fff;
}

.viewport-icon {
  position: relative;
  display: block;
}

.viewport-icon-desktop {
  width: 28px;
  height: 20px;
  border: 3px solid currentColor;
  border-radius: 2px;
}

.viewport-icon-desktop::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 3px;
  height: 7px;
  background: currentColor;
  transform: translateX(-50%);
}

.viewport-icon-desktop::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -12px;
  width: 14px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  transform: translateX(-50%);
}

.viewport-icon-mobile {
  width: 17px;
  height: 30px;
  border: 3px solid currentColor;
  border-radius: 4px;
}

.viewport-icon-mobile::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 5px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: translateX(-50%);
}

.frame-stage {
  min-height: 0;
  overflow-y: hidden;
  overflow-x: hidden;
  padding: 42px 64px;
  background: #e3e4e2;
}

.preview-frame {
  width: 100%;
  max-width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
  box-shadow: none;
}

.frame-stage.mobile .preview-frame {
  width: 390px;
  max-width: 100%;
  height: 820px;
  transform: none;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .18);
}

.frame-stage.desktop .preview-frame {
  display: block;
  transform-origin: 0 0;
  width: calc(100% * 10 / 7);
  max-width: none;
  height: calc(100% * 10 / 7);
  transform: scale(.7);
  box-shadow: 0 18px 45px rgba(0, 0, 0, .18);
}

.error {
  color: #b00020;
}

.editor-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(0, 0, 0, .56);
}

.editor-modal {
  position: relative;
  width: min(620px, 100%);
  max-height: min(860px, 92vh);
  overflow: auto;
  border-radius: 10px;
  background: #fff;
  padding: 46px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .28);
}

.editor-modal-wide {
  width: min(940px, 100%);
}

.editor-modal h2 {
  margin: 0 0 28px;
  font-size: 36px;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 22px;
  border: 0;
  background: transparent;
  color: #777;
  font-size: 42px;
  line-height: 1;
  cursor: pointer;
}

.editor-modal label {
  display: block;
  margin: 20px 0 8px;
  font-size: 24px;
}

.editor-modal input,
.editor-modal textarea {
  width: 100%;
  border: 1px solid #c7ccc8;
  border-radius: 8px;
  background: #f3f7f1;
  color: var(--ui-ink);
  padding: 18px;
  font-size: 20px;
}

.editor-modal textarea {
  min-height: 220px;
  resize: vertical;
}

.rich-editor-toolbar {
  display: flex;
  gap: 22px;
  align-items: center;
  border: 1px solid #c7ccc8;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #f3f7f1;
  padding: 18px 22px;
  color: #626662;
  font-size: 22px;
}

.rich-editor-toolbar + textarea {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.modal-note,
.character-count {
  color: #5f676e;
  font-size: 18px;
  line-height: 1.45;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 32px;
}

.modal-actions button {
  min-height: 60px;
  border: 1px solid #c7c7c7;
  border-radius: 8px;
  background: #fff;
  font-size: 20px;
  cursor: pointer;
}

.modal-actions button:last-child {
  border-color: #2995ee;
  background: #2995ee;
  color: #fff;
}

.modal-link {
  display: block;
  margin: 22px auto 0;
  border: 0;
  background: transparent;
  color: var(--ui-ink);
  text-decoration: underline;
  cursor: pointer;
}

@media(max-width: 900px) {
  .preview-app {
    grid-template-columns: 1fr;
  }

  .design-pane {
    height: auto;
    max-height: 54vh;
  }

  main {
    height: 70vh;
  }
}
