.app-prototype,
.app-prototype * {
  box-sizing: border-box;
}

.app-prototype {
  color: #242424;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

.app-prototype :where(button, input, select, textarea) {
  color: inherit;
  font: inherit;
}

.app-prototype button {
  border: 0;
}

@keyframes prototype-pointer-press {
  0% { opacity: 0; transform: scale(.35); }
  30% { opacity: .38; }
  100% { opacity: 0; transform: scale(1.45); }
}

.prototype-demo-pointer-host {
  position: relative;
}

.prototype-demo-pointer {
  position: absolute;
  z-index: 60;
  top: 0;
  left: 0;
  width: 18px;
  height: 22px;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(var(--prototype-pointer-x, 0), var(--prototype-pointer-y, 0), 0) scale(.9);
  transform-origin: 2px 2px;
  transition:
    opacity var(--prototype-pointer-opacity-duration, 160ms) ease,
    transform var(--prototype-pointer-duration, 420ms) cubic-bezier(.2, .8, .2, 1);
  will-change: transform, opacity;
}

.prototype-demo-pointer.is-visible {
  opacity: 1;
  transform: translate3d(var(--prototype-pointer-x, 0), var(--prototype-pointer-y, 0), 0) scale(1);
}

.prototype-demo-pointer.is-pressing {
  transform: translate3d(var(--prototype-pointer-x, 0), var(--prototype-pointer-y, 0), 0) scale(.84);
}

.prototype-demo-pointer svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .2));
}

.prototype-demo-pointer path {
  fill: rgba(255, 255, 255, .98);
  stroke: rgba(28, 28, 30, .82);
  stroke-linejoin: round;
  stroke-width: 1.15;
}

.prototype-demo-pointer i {
  position: absolute;
  top: -5px;
  left: -5px;
  width: 13px;
  height: 13px;
  border: 1.5px solid rgba(109, 78, 232, .7);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.prototype-demo-pointer.is-pressing i {
  animation: prototype-pointer-press .32s ease-out both;
}

.prototype-demo-pointer-host button.is-demo-pressed {
  filter: brightness(.94);
  transform: scale(.97);
}

.prototype-demo-pointer-host .point.is-demo-pressed {
  transform: scale(.985);
}

.app-prototype [hidden] {
  display: none !important;
}

.app-prototype :is(button, input, select, textarea):focus-visible {
  outline: 2px solid #6d4ee8;
  outline-offset: 2px;
}

.prototype-noscript {
  position: absolute;
  z-index: 8;
  top: 1rem;
  left: 50%;
  margin: 0;
  padding: .45rem .75rem;
  transform: translateX(-50%);
  border: 1px solid rgba(27, 31, 36, .1);
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: #5f5a56;
  font-size: .78rem;
  white-space: nowrap;
}

.demo-traffic {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: clamp(6px, .95cqw, 9px);
}

.demo-traffic i {
  display: block;
  width: clamp(8px, 1.3cqw, 14px);
  height: clamp(8px, 1.3cqw, 14px);
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 50%;
  background: #ff5f57;
}

.demo-traffic i:nth-child(2) {
  background: #febc2e;
}

.demo-traffic i:nth-child(3) {
  background: #28c840;
}

/* Editor prototype */

.typene-editor-demo {
  --demo-font-size: 15px;
  --demo-line-height: 1.47;
  --demo-titlebar-height: clamp(44px, 4vw, 53px);
  --demo-control-size: clamp(28px, 3.15cqw, 34px);
  --demo-icon-size: clamp(12px, 1.45cqw, 15px);
  --demo-file-size: clamp(10px, 1.3cqw, 14px);
  --demo-window-radius: clamp(12px, 2.05vw, 26px);
  --demo-status-height: clamp(22px, 2.5cqw, 24px);
  --demo-editor-bg: #fff;
  --demo-editor-ink: #24292f;
  --demo-gutter-ink: #8c959f;
  --demo-heading: #175aa6;
  --demo-mark: #8d4f16;
  --demo-quote: #2f7b3d;
  --demo-code: #b13a38;
  position: relative;
  isolation: isolate;
  display: block;
  width: 100%;
  aspect-ratio: 1984 / 1464;
  padding: 4% 5.55% 7.6%;
  overflow: hidden;
  border-radius: 1rem;
  background: transparent;
  contain: layout paint;
}

.showcase > .typene-editor-demo.showcase-image {
  padding: 7.5% 14.3% 16%;
}

@media (width > 720px) {
  .showcase > .typene-editor-demo.showcase-image {
    padding: 4% 14.3% 19.5%;
  }
}

@media (width > 640px) and (width <= 720px) {
  .showcase > .typene-editor-demo.showcase-image {
    padding: 4% 14.3% 19.5%;
  }
}

.typene-editor-demo--compact {
  --demo-titlebar-height: 40px;
  --demo-control-size: 28px;
  --demo-icon-size: 12px;
  --demo-file-size: 10px;
  --demo-window-radius: 15px;
  --demo-status-height: 22px;
}

.demo-window {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  grid-template-rows: var(--demo-titlebar-height) minmax(0, 1fr);
  border-radius: var(--demo-window-radius);
  box-shadow: 0 20px 36px -24px rgba(26, 22, 20, .28);
  container-name: editor-window;
  container-type: inline-size;
}

.typene-editor-demo .demo-titlebar {
  position: relative;
  z-index: 5;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: clamp(6px, .8cqw, 12px);
  padding: 0 clamp(10px, 1.55cqw, 16px);
  border: 1px solid rgba(27, 31, 36, .12);
  border-bottom-color: rgba(27, 31, 36, .1);
  border-radius: var(--demo-window-radius) var(--demo-window-radius) 0 0;
  background: rgba(244, 245, 247, .97);
}

.typene-editor-demo .demo-file-picker {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
}

.typene-editor-demo .demo-file-button {
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
  min-height: var(--demo-control-size);
  align-items: center;
  gap: .35rem;
  padding: .25rem .45rem;
  border-radius: .5rem;
  background: transparent;
  font-size: var(--demo-file-size);
  font-weight: 650;
  letter-spacing: -.02em;
  cursor: pointer;
}

.typene-editor-demo .demo-file-button:hover,
.typene-editor-demo .demo-file-button[aria-expanded="true"] {
  background: rgba(27, 31, 36, .07);
}

.typene-editor-demo .demo-file-button span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.typene-editor-demo .demo-file-button > span:last-child[aria-hidden="true"] {
  display: block;
  width: .42rem;
  height: .42rem;
  flex: 0 0 auto;
  border-right: 1.4px solid currentColor;
  border-bottom: 1.4px solid currentColor;
  font-size: 0;
  line-height: 0;
  transform: translateY(-.1rem) rotate(45deg);
}

.demo-file-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + .35rem);
  left: 0;
  display: grid;
  width: max-content;
  min-width: clamp(150px, 18cqw, 230px);
  gap: .18rem;
  padding: .35rem;
  border: 1px solid rgba(27, 31, 36, .12);
  border-radius: .7rem;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 18px 42px -20px rgba(31, 35, 40, .38);
  backdrop-filter: blur(18px);
  opacity: 1;
  scale: 1;
  transform-origin: top center;
  translate: 0 0;
  transition: opacity .16s ease, scale .16s cubic-bezier(.2, .8, .2, 1), translate .16s cubic-bezier(.2, .8, .2, 1);
}

.demo-file-menu:is(.is-opening, .is-closing) {
  opacity: 0;
  pointer-events: none;
  scale: .98;
  translate: 0 -4px;
}

.demo-file-menu button {
  display: flex;
  width: 100%;
  min-height: 2.1rem;
  align-items: center;
  padding: .4rem .65rem;
  border-radius: .45rem;
  background: transparent;
  font-size: clamp(10px, 1.08cqw, 14px);
  text-align: left;
  cursor: pointer;
}

.demo-file-menu button:hover,
.demo-file-menu button[aria-checked="true"] {
  color: #5c35c6;
  background: #f2ecff;
}

.demo-file-menu button::before {
  display: grid;
  width: .8rem;
  height: 1em;
  flex: 0 0 .8rem;
  place-items: center;
  margin-right: .45rem;
  content: "";
  font-weight: 700;
}

.demo-file-menu button[aria-checked="true"]::before {
  content: "✓";
}

.demo-toolbar {
  display: flex;
  flex: 0 0 auto;
  min-width: 0;
  align-items: center;
  gap: clamp(1px, .36cqw, 6px);
  margin-left: auto;
}

.demo-toolbar button {
  display: inline-grid;
  width: var(--demo-control-size);
  height: var(--demo-control-size);
  flex: 0 0 auto;
  place-items: center;
  border-radius: .52rem;
  background: transparent;
  color: #62676d;
  font-family: var(--sans);
  font-size: var(--demo-icon-size);
  font-weight: 600;
  cursor: pointer;
}

.demo-toolbar button:hover,
.demo-toolbar button[aria-pressed="true"] {
  color: #24292f;
  background: rgba(27, 31, 36, .08);
}

.demo-toolbar button:disabled {
  opacity: .36;
  cursor: default;
}

.demo-toolbar button[data-action="italic"] > i {
  font-family: Georgia, serif;
  font-size: 1.18em;
  font-weight: 400;
}

.demo-toolbar button[data-action="code"] {
  font-family: var(--mono);
  font-size: clamp(8px, 1.03cqw, 14px);
}

.demo-workspace {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(27, 31, 36, .1);
  border-top: 0;
  border-radius: 0 0 var(--demo-window-radius) var(--demo-window-radius);
  background: var(--demo-editor-bg);
}

.demo-editor-surface {
  position: absolute;
  inset: 0;
  display: grid;
  min-height: 0;
  grid-template-columns: clamp(34px, 5.2cqw, 68px) minmax(0, 1fr);
  overflow: hidden;
  background: var(--demo-editor-bg);
}

.demo-gutter {
  position: relative;
  z-index: 3;
  overflow: hidden;
  border-right: 1px solid rgba(27, 31, 36, .04);
  background: color-mix(in srgb, var(--demo-editor-bg) 97%, #8c959f);
  color: var(--demo-gutter-ink);
  font-family: var(--mono);
  font-size: var(--demo-font-size);
  line-height: calc(var(--demo-font-size) * var(--demo-line-height));
  text-align: right;
  user-select: none;
}

.demo-gutter > div {
  padding: clamp(9px, 1.25cqw, 20px) clamp(7px, .9cqw, 15px);
  will-change: transform;
}

.demo-gutter span {
  display: block;
  height: calc(var(--demo-font-size) * var(--demo-line-height));
}

.demo-code-pane {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--demo-editor-bg);
}

.demo-highlight,
.demo-input {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: clamp(9px, 1.25cqw, 20px) clamp(11px, 1.45cqw, 24px);
  border: 0;
  background: transparent;
  color: var(--demo-editor-ink);
  font-family: var(--mono);
  font-size: var(--demo-font-size);
  font-weight: 450;
  line-height: calc(var(--demo-font-size) * var(--demo-line-height));
  tab-size: 2;
  white-space: pre;
}

.demo-highlight {
  z-index: 1;
  min-width: 100%;
  width: max-content;
  height: auto;
  min-height: 100%;
  overflow: visible;
  opacity: 0;
  pointer-events: none;
  transform-origin: 0 0;
}

.demo-highlight-line {
  display: block;
  min-height: calc(var(--demo-font-size) * var(--demo-line-height));
}

.demo-line-content.is-demo-text-selected {
  border-radius: 2px;
  background: rgba(50, 120, 210, .2);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.demo-input {
  z-index: 3;
  overflow: auto;
  outline: 0;
  resize: none;
  scrollbar-color: rgba(106, 115, 125, .24) transparent;
  scrollbar-width: thin;
}

.typene-editor-demo.is-enhanced .demo-highlight {
  opacity: 1;
}

.typene-editor-demo.is-enhanced .demo-input {
  color: transparent;
  caret-color: var(--demo-editor-ink);
  -webkit-text-fill-color: transparent;
}

.typene-editor-demo.is-enhanced .demo-input::selection {
  background: rgba(50, 120, 210, .2);
}

.demo-active-line {
  position: absolute;
  z-index: 0;
  top: var(--demo-active-line-y, 9px);
  right: 0;
  left: 0;
  height: var(--demo-active-line-height, calc(var(--demo-font-size) * var(--demo-line-height)));
  background: rgba(140, 149, 159, .09);
  pointer-events: none;
}

.md-heading {
  color: var(--demo-heading);
  font-weight: 700;
}

.md-mark {
  color: var(--demo-mark);
}

.md-quote {
  color: var(--demo-quote);
  font-style: italic;
}

.md-code,
.md-keyword {
  color: var(--demo-code);
}

.md-string,
.md-link {
  color: var(--demo-heading);
}

.md-muted {
  color: var(--demo-gutter-ink);
}

.demo-preview {
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: clamp(18px, 3cqw, 48px) clamp(20px, 5cqw, 76px);
  background: var(--demo-editor-bg);
  color: var(--demo-editor-ink);
  font-family: var(--editorial);
  font-size: clamp(12px, 1.28cqw, 18px);
  line-height: 1.65;
  scrollbar-width: thin;
}

.typene-editor-demo.is-preview-ready .demo-editor-surface,
.typene-editor-demo.is-preview-ready .demo-preview {
  transition:
    opacity .22s cubic-bezier(.2, 0, 0, 1),
    transform .22s cubic-bezier(.2, 0, 0, 1),
    visibility 0s linear;
}

.typene-editor-demo.is-preview-ready .demo-editor-surface {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.typene-editor-demo.is-preview-ready .demo-preview {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(3px);
  transition-delay: 0s, 0s, .22s;
}

.typene-editor-demo.is-preview-ready.is-preview-open .demo-editor-surface {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-2px);
  transition-delay: 0s, 0s, .22s;
}

.typene-editor-demo.is-preview-ready.is-preview-open .demo-preview {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  transition-delay: 0s;
}

.demo-preview :is(h1, h2, h3) {
  margin: 0 0 .65em;
  color: var(--demo-heading);
  font-family: var(--sans);
  line-height: 1.2;
}

.demo-preview h1 {
  font-size: 1.8em;
}

.demo-preview h2 {
  margin-top: 1.35em;
  font-size: 1.35em;
}

.demo-preview p,
.demo-preview ul,
.demo-preview blockquote,
.demo-preview pre {
  margin: 0 0 .9em;
}

.demo-preview ul {
  padding-left: 1.4em;
}

.demo-preview blockquote {
  padding-left: 1em;
  border-left: 3px solid #7aa874;
  color: #397044;
  font-style: italic;
}

.demo-preview code {
  padding: .12em .3em;
  border-radius: .3em;
  background: rgba(175, 184, 193, .18);
  font-family: var(--mono);
  font-size: .9em;
}

.demo-preview pre {
  padding: .9em 1em;
  overflow: auto;
  border-radius: .65em;
  background: rgba(175, 184, 193, .12);
}

.demo-preview pre code {
  padding: 0;
  background: transparent;
}

.demo-preview .preview-task {
  list-style: none;
}

.demo-preview .preview-task::before {
  margin-right: .5em;
  content: "□";
  color: #6d4ee8;
}

.demo-preview .preview-task.is-done::before {
  content: "☑";
}

.demo-statusbar {
  position: absolute;
  z-index: 7;
  right: clamp(8px, 1.6cqw, 15px);
  bottom: clamp(8px, 1.6cqw, 15px);
  display: flex;
  width: max-content;
  min-height: var(--demo-status-height);
  align-items: center;
  gap: clamp(6px, 1cqw, 10px);
  padding: 0 clamp(7px, 1.2cqw, 10px);
  border: 1px solid rgba(27, 31, 36, .1);
  border-radius: clamp(6px, 1cqw, 8px);
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 8px 20px -13px rgba(31, 35, 40, .42);
  color: #697078;
  font-family: var(--mono);
  font-size: clamp(8px, 1cqw, 10px);
  backdrop-filter: blur(12px);
  opacity: 1;
  transform: translateY(0);
  transition: opacity .16s ease, transform .16s ease, visibility 0s linear;
}

.typene-editor-demo.is-preview-open .demo-statusbar {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(3px);
  transition-delay: 0s, 0s, .16s;
}

.demo-statusbar [data-demo-status] {
  color: #31363b;
}

.demo-statusbar [data-demo-save-state] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  white-space: nowrap;
}

.demo-statusbar [data-demo-save-state][data-state="dirty"] + [data-demo-status] {
  color: #9a5a12;
}

.demo-statusbar [data-demo-save-state][data-state="saved"] + [data-demo-status] {
  color: #397044;
}

.demo-mode {
  display: none;
}

.demo-mode i {
  width: .55em;
  height: .55em;
  border-radius: 50%;
  background: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .12);
}

.typene-editor-demo.demo-theme-dark {
  --demo-editor-bg: #0d1117;
  --demo-editor-ink: #e6edf3;
  --demo-gutter-ink: #7d8590;
  --demo-heading: #79c0ff;
  --demo-mark: #ffa657;
  --demo-quote: #7ee787;
  --demo-code: #ff7b72;
}

.typene-editor-demo.demo-theme-dark .demo-titlebar,
.typene-editor-demo.demo-theme-dark .demo-statusbar {
  border-color: rgba(240, 246, 252, .12);
  background: rgba(27, 31, 36, .98);
  color: #9da7b1;
}

.typene-editor-demo.demo-theme-dark .demo-file-button,
.typene-editor-demo.demo-theme-dark .demo-statusbar [data-demo-status] {
  color: #e6edf3;
}

.typene-editor-demo.demo-theme-dark .demo-toolbar button {
  color: #9da7b1;
}

.typene-editor-demo.demo-theme-dark .demo-toolbar button:hover,
.typene-editor-demo.demo-theme-dark .demo-toolbar button[aria-pressed="true"] {
  color: #e6edf3;
  background: rgba(240, 246, 252, .1);
}

.typene-editor-demo.demo-theme-duotone {
  --demo-editor-bg: #faf8ff;
  --demo-editor-ink: #313043;
  --demo-gutter-ink: #aaa4be;
  --demo-heading: #7454c7;
  --demo-mark: #ad5e7b;
  --demo-quote: #537da8;
  --demo-code: #b75a83;
}

.typene-editor-demo.demo-hide-line-numbers .demo-editor-surface {
  grid-template-columns: minmax(0, 1fr);
}

.typene-editor-demo.demo-hide-line-numbers .demo-gutter,
.typene-editor-demo.demo-hide-active-line .demo-active-line {
  display: none;
}

.typene-editor-demo.demo-line-height-tight {
  --demo-line-height: 1.32;
}

.typene-editor-demo.demo-line-height-relaxed {
  --demo-line-height: 1.78;
}

.typene-editor-demo.demo-wrap .demo-highlight,
.typene-editor-demo.demo-wrap .demo-input {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.typene-editor-demo.demo-wrap .demo-highlight {
  width: 100%;
  min-width: 0;
}

.typene-editor-demo.demo-toolbar-hidden .demo-toolbar {
  display: none;
}

.typene-editor-demo.demo-toolbar-compact .demo-toolbar button {
  width: max(24px, calc(var(--demo-control-size) - 4px));
  height: max(24px, calc(var(--demo-control-size) - 4px));
}

.media-panel.is-active {
  pointer-events: auto;
}

.media-panel[data-media="editor"] .typene-editor-demo {
  width: min(106%, 484px);
  max-width: none;
  filter: none;
}

.file-row {
  width: calc(100% - 14px);
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.file-row:hover {
  background: color-mix(in srgb, var(--purple) 6%, transparent);
}

.file-row:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: -2px;
}

.drop-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  font-size: .7rem;
}

.drop-arrow > span {
  font-size: 1.2rem;
}

/* Settings prototype */

.typene-settings-demo {
  position: relative;
  width: min(108%, 560px);
  height: auto;
  aspect-ratio: 1.28;
  overflow: visible;
  background: transparent;
  container-name: settings-demo;
  container-type: inline-size;
  contain: layout;
}

.settings-desktop {
  position: absolute;
  inset: 0;
  background: none;
}

.settings-window {
  --settings-window-width: min(79cqw, 420px);
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  display: grid;
  width: var(--settings-window-width);
  height: auto;
  min-height: 0;
  aspect-ratio: 580 / 545;
  grid-template-rows:
    clamp(18px, calc(var(--settings-window-width) * .0552), 32px)
    clamp(32px, calc(var(--settings-window-width) * .0966), 56px)
    minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(26, 22, 20, .09);
  border-radius: 14px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 8px 24px -20px rgba(26, 22, 20, .12);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transform: translate(-50%, -50%);
  transition: aspect-ratio .28s cubic-bezier(.2, 0, 0, 1);
  container-name: settings-window;
  container-type: inline-size;
}

.typene-settings-demo[data-settings-pane="assistant"] .settings-window {
  aspect-ratio: 580 / 349;
}

.typene-settings-demo[data-settings-pane="extensions"] .settings-window {
  aspect-ratio: 580 / 485;
}

.typene-settings-demo[data-settings-pane="general"] .settings-window {
  aspect-ratio: 580 / 340;
}

.typene-settings-demo[data-settings-pane="window"] .settings-window {
  aspect-ratio: 580 / 285;
}

.settings-titlebar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 clamp(8px, 2.4cqw, 14px);
}

.settings-titlebar .demo-traffic {
  position: absolute;
  left: clamp(8px, 2.4cqw, 14px);
  gap: clamp(5px, 1.55cqw, 9px);
}

.settings-titlebar .demo-traffic i {
  width: clamp(7px, 2.42cqw, 14px);
  height: clamp(7px, 2.42cqw, 14px);
}

.settings-titlebar .demo-traffic i:nth-child(2),
.settings-titlebar .demo-traffic i:nth-child(3) {
  background: #dadada;
}

.settings-titlebar strong {
  color: #575757;
  font-size: clamp(9px, 2.24cqw, 13px);
  font-weight: 650;
}

.settings-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1px, .7cqw, 4px);
  padding: 0 clamp(3px, 1.2cqw, 7px);
  border-bottom: 1px solid rgba(27, 31, 36, .08);
  background: transparent;
}

.settings-tabs button {
  display: flex;
  width: clamp(36px, 10.35cqw, 60px);
  height: calc(100% - clamp(2px, .7cqw, 4px));
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1px, .35cqw, 2px);
  padding: 0 1px;
  border-radius: clamp(6px, 1.72cqw, 10px);
  background: transparent;
  color: #767676;
  cursor: pointer;
}

html[lang="en"] .settings-tabs button {
  width: clamp(44px, 12.8cqw, 60px);
}

.settings-tabs button:hover {
  background: rgba(27, 31, 36, .05);
}

.settings-tabs button[aria-selected="true"] {
  color: #087ee1;
  background: rgba(220, 220, 220, .92);
  box-shadow: none;
}

.settings-tab-icon {
  width: clamp(14px, 4cqw, 23px);
  height: clamp(14px, 4cqw, 23px);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.settings-tabs button > b {
  overflow: hidden;
  max-width: 100%;
  font-size: clamp(8px, 2.24cqw, 13px);
  font-weight: 500;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-panels {
  min-height: 0;
  overflow: hidden;
}

.settings-panel {
  height: 100%;
  padding: clamp(10px, 4.1cqw, 24px) clamp(8px, 3.8cqw, 22px);
  overflow: auto;
  color: #303030;
  font-size: clamp(9px, 2.24cqw, 13px);
  opacity: 1;
  transform: translateY(0);
  transition: opacity .2s ease, transform .2s cubic-bezier(.2, 0, 0, 1);
  scrollbar-width: thin;
}

.typene-settings-demo.is-switching-pane .settings-panel:not([hidden]) {
  opacity: 0;
  transform: translateY(3px);
}

.settings-native-form {
  display: grid;
  width: min(70%, 420px);
  margin-inline: auto;
  gap: clamp(7px, 2.1cqw, 12px);
}

.settings-form-section {
  display: grid;
  gap: clamp(2px, .9cqw, 5px);
  min-width: 0;
}

.settings-form-divider {
  height: 1px;
  margin-inline: -3%;
  background: rgba(60, 60, 67, .14);
}

.settings-form-row {
  display: grid;
  min-width: 0;
  min-height: clamp(16px, 4.25cqw, 25px);
  grid-template-columns: clamp(58px, 18cqw, 104px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(5px, 1.55cqw, 9px);
}

.settings-form-row--top {
  align-items: start;
}

.settings-form-label {
  min-width: 0;
  padding-top: .1em;
  text-align: right;
  line-height: 1.22;
}

.settings-form-row--top > .settings-form-label {
  padding-top: .22em;
}

.settings-form-row select,
.settings-font-picker select,
.settings-number-control input {
  min-width: 0;
  height: clamp(18px, 4.25cqw, 25px);
  padding: 0 clamp(5px, 1.2cqw, 7px);
  border: 0;
  border-radius: clamp(4px, 1cqw, 6px);
  background: rgba(230, 230, 230, .96);
  color: inherit;
  font: inherit;
}

.settings-form-row > select {
  width: 100%;
}

.settings-font-picker {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) clamp(34px, 8.8cqw, 51px);
  gap: clamp(4px, 1.15cqw, 7px);
}

.settings-number-control {
  min-width: 0;
}

.settings-number-control input {
  width: 100%;
  padding-inline: clamp(3px, .8cqw, 5px);
  text-align: center;
}

.settings-control-stack {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(2px, .75cqw, 4px);
  line-height: 1.25;
}

.settings-control-stack label,
.settings-form-row--check > span,
.settings-radio-group label {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: clamp(3px, .8cqw, 5px);
}

.settings-control-stack small,
.extension-row small {
  color: #858585;
  font-size: clamp(8px, 2.06cqw, 12px);
  line-height: 1.2;
}

.settings-panel input[type="checkbox"] {
  width: clamp(12px, 2.76cqw, 16px);
  height: clamp(12px, 2.76cqw, 16px);
  flex: 0 0 auto;
  margin: 0;
  accent-color: #0a84ff;
}

.settings-radio-group {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: clamp(5px, 1.8cqw, 10px);
  white-space: nowrap;
}

.settings-radio-group input {
  width: clamp(11px, 2.6cqw, 15px);
  height: clamp(11px, 2.6cqw, 15px);
  margin: 0;
  accent-color: #0a84ff;
}

.settings-extension-list {
  display: grid;
  width: min(88%, 500px);
  margin-inline: auto;
  gap: clamp(6px, 1.9cqw, 11px);
}

.settings-panel .extension-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: clamp(8px, 2cqw, 12px);
  min-height: clamp(31px, 8cqw, 46px);
}

.extension-row > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.extension-row b {
  font-size: 1em;
  font-weight: 550;
}

.extension-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-toggle {
  position: relative;
  width: clamp(25px, 6.55cqw, 38px) !important;
  height: clamp(15px, 3.8cqw, 22px) !important;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: #cfcfcf;
  cursor: pointer;
  transition: background-color .16s ease;
}

.settings-toggle::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(100% / 2 - 1px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .24);
  content: "";
  transition: transform .16s ease;
}

.settings-toggle:checked {
  background: #0a84ff;
}

.settings-toggle:checked::after {
  transform: translateX(calc(100% - 2px));
}

.settings-note {
  padding-top: clamp(6px, 1.5cqw, 9px);
  border-top: 1px solid rgba(60, 60, 67, .14);
  color: #818181;
  font-size: clamp(8px, 2.06cqw, 12px);
  line-height: 1.25;
}

/* AI Writer prototype */

.typene-ai-demo {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  contain: layout paint;
}

.ai-demo-window {
  display: grid;
  width: min(90%, 430px);
  height: auto;
  min-height: 0;
  aspect-ratio: 1.32;
  grid-template-rows: clamp(38px, 3vw, 42px) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(27, 31, 36, .15);
  border-radius: clamp(12px, 3.3cqw, 22px);
  background: rgba(252, 252, 252, .96);
  box-shadow: 0 20px 36px -24px rgba(26, 22, 20, .28);
  backdrop-filter: blur(22px);
  container-name: ai-demo;
  container-type: inline-size;
}

.ai-demo-titlebar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(27, 31, 36, .08);
}

.ai-demo-titlebar .demo-traffic {
  position: absolute;
  left: clamp(10px, 3cqw, 18px);
}

.ai-demo-titlebar .demo-traffic i {
  width: clamp(7px, 1.8cqw, 11px);
  height: clamp(7px, 1.8cqw, 11px);
}

.ai-demo-titlebar strong {
  font-size: clamp(11px, 2.7cqw, 14px);
}

.ai-demo-titlebar > span {
  position: absolute;
  right: clamp(9px, 2.7cqw, 17px);
  padding: .25em .6em;
  border-radius: 999px;
  color: #6944c5;
  background: #eee7ff;
  font-size: clamp(7px, 1.65cqw, 10px);
  font-weight: 650;
}

.ai-demo-body {
  display: grid;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}

.ai-demo-content {
  display: grid;
  min-height: 0;
  grid-template-areas:
    "source"
    "model"
    "actions"
    "custom"
    "result";
  grid-template-rows: auto auto auto auto minmax(48px, 1fr);
  gap: clamp(5px, 1.25cqw, 8px);
  padding: clamp(9px, 2.5cqw, 15px) clamp(9px, 2.5cqw, 15px) clamp(6px, 1.5cqw, 9px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.ai-demo-source {
  display: grid;
  grid-area: source;
  gap: .3em;
  color: #6c6c6c;
  font-size: clamp(8.5px, 1.95cqw, 10px);
}

.ai-demo-source textarea {
  width: 100%;
  min-height: clamp(46px, 11cqw, 58px);
  padding: .65em .75em;
  border: 1px solid rgba(27, 31, 36, .1);
  border-radius: .7em;
  outline: 0;
  background: #fff;
  color: #282828;
  font-size: clamp(10px, 2.25cqw, 11.5px);
  line-height: 1.45;
  resize: none;
}

.ai-demo-model {
  display: flex;
  grid-area: model;
  align-items: center;
  gap: .45em;
  color: #545454;
  font-size: clamp(8.5px, 1.95cqw, 10px);
}

.ai-demo-model i {
  width: .65em;
  height: .65em;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #34c759;
  box-shadow: 0 0 0 3px rgba(52, 199, 89, .12);
}

.ai-demo-model small {
  margin-left: auto;
  color: #898989;
  font-size: .9em;
}

.ai-demo-actions {
  display: grid;
  grid-area: actions;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(3px, .8cqw, 6px);
}

.ai-demo-actions button {
  min-width: 0;
  min-height: clamp(24px, 5.2cqw, 28px);
  padding: .35em .3em;
  border: 1px solid rgba(27, 31, 36, .08);
  border-radius: .6em;
  background: #fff;
  color: #5b5b5b;
  font-size: clamp(8.5px, 1.95cqw, 10px);
  cursor: pointer;
  white-space: nowrap;
}

.ai-demo-actions button:hover,
.ai-demo-actions button[aria-pressed="true"] {
  border-color: rgba(139, 92, 246, .25);
  color: #6640c3;
  background: #f2ecff;
}

.ai-demo-custom input {
  width: 100%;
  height: clamp(24px, 5.2cqw, 28px);
  padding: 0 .75em;
  border: 1px solid rgba(27, 31, 36, .1);
  border-radius: .6em;
  background: #fff;
  font-size: clamp(9px, 2cqw, 10.5px);
}

.ai-demo-custom {
  grid-area: custom;
}

.ai-demo-result {
  grid-area: result;
  min-height: 0;
  padding: clamp(6px, 1.6cqw, 10px);
  overflow: hidden;
  border: 1px solid rgba(139, 92, 246, .14);
  border-radius: .75em;
  background: linear-gradient(135deg, #faf8ff, #fff);
}

.ai-demo-result > span {
  display: block;
  margin-bottom: .25em;
  color: #7156ba;
  font-size: clamp(8px, 1.75cqw, 9px);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ai-demo-result p {
  display: -webkit-box;
  overflow: hidden;
  color: #38353f;
  font-size: clamp(9.5px, 2.2cqw, 11px);
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.ai-demo-result[aria-busy="true"] p {
  color: #8d849d;
}

@keyframes ai-result-enter {
  from {
    opacity: .45;
    filter: blur(1px);
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

.ai-demo-result.is-result-entering p {
  animation: ai-result-enter .22s cubic-bezier(.2, 0, 0, 1) both;
}

.ai-demo-footer {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: .6em;
  padding: clamp(6px, 1.45cqw, 8px) clamp(9px, 2.5cqw, 15px);
  border-top: 1px solid rgba(27, 31, 36, .08);
  background: rgba(248, 248, 249, .94);
}

.ai-demo-footer > span {
  overflow: hidden;
  color: #777;
  font-size: clamp(8px, 1.75cqw, 9px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-demo-footer > div {
  display: flex;
  gap: clamp(3px, .7cqw, 5px);
  margin-left: auto;
}

.ai-demo-footer button {
  min-height: clamp(24px, 5.2cqw, 28px);
  padding: 0 clamp(6px, 1.6cqw, 10px);
  border-radius: .58em;
  font-size: clamp(8.5px, 1.95cqw, 9.5px);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.ai-demo-footer button:disabled {
  opacity: .38;
  cursor: default;
}

.ai-secondary {
  border: 1px solid rgba(27, 31, 36, .1) !important;
  background: #fff;
}

.ai-primary {
  color: #fff !important;
  background: linear-gradient(#2e2d2c, #171615);
  box-shadow: 0 5px 12px -8px rgba(0, 0, 0, .6);
}

/* Progressive reveal and responsive behavior */

.js [data-reveal] {
  visibility: hidden;
}

.js [data-reveal].is-visible {
  visibility: visible;
}

@container editor-window (max-width: 620px) {
  .demo-toolbar button[data-action="link"],
  .demo-toolbar button[data-action="code"] {
    display: none;
  }

  .demo-statusbar .demo-mode {
    display: none;
  }
}

@container editor-window (max-width: 430px) {
  .typene-editor-demo .demo-titlebar {
    padding-inline: 8px;
  }

  .typene-editor-demo .demo-traffic {
    display: none;
  }

  .typene-editor-demo .demo-file-picker {
    max-width: 46%;
  }

  .demo-file-menu {
    left: 0;
    min-width: 145px;
  }

}

@container editor-window (max-width: 499px) {
  .demo-toolbar button[data-action="italic"],
  .demo-toolbar button[data-action="list"] {
    display: none;
  }
}

@container editor-window (min-width: 360px) {
  .typene-editor-demo .demo-file-picker {
    position: absolute;
    left: 50%;
    width: max-content;
    max-width: 40%;
    flex: none;
    transform: translateX(-50%);
  }

  .demo-file-menu {
    left: 50%;
    transform: translateX(-50%);
  }
}

@container settings-demo (min-width: 500px) {
  .settings-window {
    --settings-window-width: min(73cqw, 390px);
  }
}

@container settings-demo (max-width: 500px) {
  .typene-settings-demo[data-settings-pane="assistant"] .settings-window,
  .typene-settings-demo[data-settings-pane="general"] .settings-window,
  .typene-settings-demo[data-settings-pane="window"] .settings-window {
    min-height: min(64cqw, 210px);
  }
}

@container settings-window (max-width: 400px) {
  .settings-panel {
    padding-block: 10px;
  }

  .settings-native-form {
    gap: 6px;
  }
}

@container settings-window (max-width: 330px) {
  .settings-panel {
    padding: 4px 8px;
  }

  .settings-native-form {
    width: 70%;
    gap: 2px;
  }

  html[lang="en"] .settings-native-form {
    width: 94%;
  }

  .settings-form-section {
    gap: 0;
  }

  .settings-form-row {
    min-height: 14px;
    grid-template-columns: 55px minmax(0, 1fr);
    gap: 4px;
  }

  html[lang="en"] .settings-form-row {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .settings-form-row select,
  .settings-font-picker select,
  .settings-number-control input {
    height: 16px;
  }

  .settings-extension-list {
    width: 90%;
    gap: 5px;
  }

  .settings-panel .extension-row {
    min-height: 30px;
  }
}

@media (width > 900px) {
  .media-panel[data-media="customize"] .typene-settings-demo {
    transform: translateY(-18px);
  }
}

@container ai-demo (max-width: 380px) {
  .ai-demo-model small {
    display: none;
  }

  .ai-demo-content {
    padding: 8px 8px 4px;
  }

  .ai-demo-result p {
    -webkit-line-clamp: 3;
  }

  .ai-demo-footer > span {
    max-width: 34%;
  }

  .ai-demo-actions button,
  .ai-demo-footer button {
    min-height: 36px;
  }
}

@media (width <= 640px) {
  .typene-editor-demo {
    --demo-titlebar-height: 40px;
    --demo-control-size: 32px;
    --demo-icon-size: 12px;
    --demo-file-size: 10px;
    --demo-status-height: 24px;
  }

  .typene-editor-demo--compact {
    --demo-window-radius: 12px;
  }

  .typene-editor-demo .demo-file-button {
    min-height: 32px;
  }

  .demo-statusbar {
    display: none;
  }

  .demo-input,
  .demo-highlight {
    font-size: max(16px, var(--demo-font-size));
    line-height: calc(max(16px, var(--demo-font-size)) * var(--demo-line-height));
  }

  .demo-gutter {
    font-size: max(16px, var(--demo-font-size));
    line-height: calc(max(16px, var(--demo-font-size)) * var(--demo-line-height));
  }

  .demo-gutter span {
    height: calc(max(16px, var(--demo-font-size)) * var(--demo-line-height));
  }

  .demo-active-line {
    height: var(
      --demo-active-line-height,
      calc(max(16px, var(--demo-font-size)) * var(--demo-line-height))
    );
  }

  .showcase > .typene-editor-demo.showcase-image {
    left: auto;
    width: 100%;
    height: auto;
    max-width: none;
    padding: 4.5% 7% 8.5%;
    aspect-ratio: 1984 / 1464;
    transform: none;
  }

  .media-panel[data-media="editor"] .typene-editor-demo {
    width: 116%;
  }

  .typene-settings-demo {
    width: 116%;
    aspect-ratio: 1.08;
  }

  .settings-window {
    --settings-window-width: min(91cqw, 420px);
    box-shadow: 0 6px 18px -16px rgba(26, 22, 20, .1);
  }

  .typene-settings-demo[data-settings-pane="editor"] .settings-window {
    min-height: 263px;
  }

  .typene-settings-demo[data-settings-pane="assistant"] .settings-window {
    min-height: 198px;
  }

  .typene-settings-demo[data-settings-pane="extensions"] .settings-window {
    min-height: 263px;
  }

  .typene-settings-demo[data-settings-pane="general"] .settings-window {
    min-height: 177px;
  }

  .ai-demo-window {
    aspect-ratio: 1.14;
    min-height: clamp(242px, calc(320px - 20vw), 256px);
    grid-template-rows: 32px minmax(0, 1fr);
  }

  .ai-demo-body {
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .ai-demo-content {
    grid-template-rows: auto auto auto auto minmax(60px, 1fr);
    gap: 3px;
    padding: 6px 6px 3px;
  }

  .ai-demo-source {
    gap: 2px;
  }

  .ai-demo-source textarea {
    height: 42px;
    min-height: 42px;
    padding: .45em .6em;
  }

  .ai-demo-actions button,
  .ai-demo-footer button {
    min-height: 24px;
  }

  .ai-demo-result {
    padding: 2px 6px;
  }

  .ai-demo-result > span {
    display: none;
  }

  .ai-demo-result p {
    -webkit-line-clamp: 1;
  }

  .ai-demo-result[data-result-state="ready"] p {
    -webkit-line-clamp: 4;
  }

  .ai-demo-footer > span {
    display: none;
  }

  .ai-demo-footer {
    min-height: 31px;
    padding: 3px 6px 4px;
  }
}

@media (width <= 340px) {
  .ai-demo-result[data-result-state="ready"] p {
    -webkit-line-clamp: 5;
  }
}

@media (width <= 330px) {
  .spot-media,
  .ai-media {
    aspect-ratio: .88;
  }
}

@media (width <= 640px) {
  @container settings-demo (max-width: 250px) {
    .settings-window {
      --settings-window-width: min(98cqw, 420px);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .prototype-demo-pointer {
    display: none !important;
  }

  .app-prototype *,
  .app-prototype *::before,
  .app-prototype *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
