@font-face {
  font-family: Inter;
  src: url('./brand/inter-latin.woff2') format('woff2');
  font-display: swap;
  font-weight: 100 900;
}
:root {
  color: #101b30;
  background: #fff;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --blue: #1355ff;
  --blue-dark: #1243c7;
  --ink: #101b30;
  --body: #485975;
  --line: #dce3ef;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--blue-dark); text-underline-offset: .24em; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.shell { width: min(1140px, calc(100% - clamp(28px, 6vw, 64px))); margin-inline: auto; }
.masthead { border-bottom: 1px solid #e9edf4; }
.nav { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.brand { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; color: var(--ink); text-decoration: none; font-weight: 750; letter-spacing: -.055em; font-size: 1.4rem; }
.brand img { display: block; object-fit: contain; }
.nav-link { display: inline-flex; align-items: center; gap: .3em; min-height: 44px; font-weight: 650; font-size: .875rem; }
.intro { padding: clamp(44px, 7vw, 88px) 0 clamp(28px, 4vw, 45px); }
h1 { font-size: clamp(2.75rem, 6.2vw, 5.1rem); font-weight: 740; letter-spacing: -.065em; line-height: 1.04; margin: 0; text-wrap: balance; }
.intro p { margin: 19px 0 0; max-width: 55ch; line-height: 1.58; color: var(--body); font-size: clamp(1rem, 2vw, 1.2rem); }
.demo { --frame-radius: 18px; --frame-border: 1px; border: var(--frame-border) solid var(--line); border-radius: var(--frame-radius); background: #f4f7fd; box-shadow: 0 18px 50px #23468b12; }
.demo-bar {
  background: #fff; border-bottom: 1px solid var(--line); display: grid;
  border-start-start-radius: calc(var(--frame-radius) - var(--frame-border));
  border-start-end-radius: calc(var(--frame-radius) - var(--frame-border));
  align-items: center; grid-template-columns: minmax(0, 1fr) auto minmax(max-content, 1fr);
  gap: 12px; padding: 12px clamp(12px, 2vw, 20px);
}
.sample-label { display: grid; gap: .25rem; font-size: .875rem; }
.sample-label strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sample-label span { color: var(--body); font-size: .75rem; }
.demo-bar button { cursor: pointer; font: inherit; font-size: .875rem; font-weight: 650; }
.demo-bar button:disabled { opacity: .65; cursor: default; }
.width-controls { display: flex; gap: 3px; padding: 3px; background: #edf2fb; border-radius: 10px; }
.width-controls button { min-height: 44px; border: 1px solid transparent; border-radius: 8px; color: var(--body); background: transparent; padding: 0 .9rem; }
.width-controls button[aria-pressed='true'] { color: var(--blue-dark); background: #fff; border-color: var(--line); }
.demo-body { padding: clamp(8px, 3vw, 32px); }
.document-shell { width: 100%; min-width: 0; margin: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.demo[data-width='narrow'] .document-shell { width: min(100%, 400px); }
#toolbar { min-width: 0; padding: 0 8px; border-bottom: 1px solid #e9edf4; }
#status { margin: 20px; color: var(--body); }
#status[hidden] { display: none; }
#editor { min-width: 0; min-height: 170px; padding: 16px clamp(11px, 3vw, 34px) 22px; }
.demo[data-width='narrow'] #editor { padding-inline: 14px; }
.integration { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem 2rem; align-items: center; padding: 36px 0 32px; }
.integration h2 { font-size: clamp(1.28rem, 3vw, 1.75rem); margin: 0; letter-spacing: -.04em; }
.integration p { color: var(--body); line-height: 1.6; max-width: 56ch; margin: .65rem 0 .8rem; }
.configuration { display: grid; gap: .7rem; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: #f6f8fc; }
.configuration code { color: #163b88; font-size: .875rem; overflow-wrap: anywhere; }
.configuration span { color: var(--body); font-size: .8125rem; }
footer { display: flex; flex-wrap: wrap; gap: 12px 24px; border-top: 1px solid #e9edf4; padding: 20px 0 40px; font-size: .875rem; }
.mobile-hint { display: none; }
@media (max-width: 680px) {
  .desktop-hint { display: none; }
  .mobile-hint { display: inline; }
  .nav { min-height: 60px; }
  .demo-bar { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 12px; gap: 8px; }
  .width-controls { display: none; }
  .demo-body { padding: 7px; }
  .integration { grid-template-columns: minmax(0, 1fr); }
}

[hidden] { display: none !important; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
.intro h1 { max-width: 17ch; font-size: clamp(2.45rem, 6vw, 4.7rem); }
.intro p { max-width: 63ch; }
.intro .layout-config { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 12px; font-size: .875rem; }
.layout-config code { padding: 3px 7px; border-radius: 5px; background: #edf2fb; color: #163b88; overflow-wrap: anywhere; }

.file-actions { display: flex; justify-content: flex-end; align-items: center; gap: 4px; }
.file-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 44px; min-height: 44px; padding: 0; border: 1px solid transparent; border-radius: 8px; color: var(--body); background: transparent; }
.file-actions #upload { padding-inline: 9px; }
.file-actions button:hover:not(:disabled) { color: var(--ink); border-color: var(--line); background: #f4f7fd; }
.file-actions svg { width: 16px; height: 16px; flex: none; }
.feedback { margin: 0; color: var(--blue-dark); background: #fff; font-size: .84rem; font-weight: 600; }
.feedback:not(:empty) { padding: 9px 20px; border-bottom: 1px solid var(--line); }
.questions { margin-top: clamp(34px, 6vw, 62px); }
.questions h2 { font-size: clamp(1.45rem, 3vw, 2rem); letter-spacing: -.045em; }
.questions details { border-top: 1px solid var(--line); }
.questions details:last-child { border-bottom: 1px solid var(--line); }
.questions summary { cursor: pointer; padding: 14px 0; min-height: 44px; font-weight: 650; }
.questions details p { max-width: 68ch; margin: 0 0 17px; color: var(--body); line-height: 1.64; }
.setup-links { display: flex; flex-wrap: wrap; gap: 12px 16px; }
footer span { color: var(--body); }
@media (max-width: 680px) {
  .file-actions { gap: 0; }
  .file-actions #upload { font-size: .75rem; padding-inline: 5px; }
  .intro { padding-top: 38px; }
}

#editor { scroll-margin-top: 64px; }
@media (max-width: 680px) {
  .intro h1 { font-size: clamp(2.2rem, 8.65vw, 2.7rem); max-width: 19ch; }
  .intro p { margin-top: 13px; }
  #editor .reply-input [contenteditable], #editor textarea:not(.ts-ime) { font-size: 16px; }
}
@media (max-width: 680px) {
  .comments-dialog [data-sd-comment-text] { font-size: 16px; }
}

.editor-hint { margin: 0; padding: 0 12px; color: var(--body); font-size: .76rem; }
.editor-hint button { padding: 0 4px; min-height: 44px; border: 0; background: transparent; color: var(--blue-dark); font: inherit; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.document-shell { position: relative; }
.selection-tools {
  position: absolute; z-index: 5; display: flex; align-items: center; gap: 2px;
  max-width: calc(100% - 16px); padding: 3px; border-radius: 10px;
  background: #10254a; color: white; box-shadow: 0 6px 22px #10254a3b;
}
.selection-tools button {
  min-width: 44px; min-height: 44px; padding: 0 10px; font: 650 .82rem Inter, sans-serif;
  border: 0; border-radius: 7px; background: transparent; color: inherit; cursor: pointer;
}
.selection-tools button:hover, .selection-tools button:focus-visible { background: #294672; }
.section-lead { max-width: 64ch; margin: 0 0 22px; color: var(--body); line-height: 1.6; }
.build-section { align-items: start; scroll-margin-top: 24px; }
.build-links { padding-left: 20px; line-height: 1.8; }
#thread-space { height: 0; }
[data-demo-thread-dismissed] { display: none !important; }
#toolbar { border-radius: 12px 12px 0 0; }
@media (max-width: 767px), (pointer: coarse) and (orientation: landscape) and (max-width: 950px) and (max-height: 500px) {
  .demo .comments-dialog.phone-thread {
    position: fixed;
    inset: var(--thread-bottom) auto auto var(--thread-left);
    transform: translateY(-100%);
    box-sizing: border-box;
    width: var(--thread-width);
    min-width: 0;
    max-width: none;
    max-height: min(65dvh, calc(var(--thread-height) - min(16dvh, 96px)));
    margin: 0;
    padding: 0 0 env(safe-area-inset-bottom, 0px);
    border: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
    background: white;
    box-shadow: 0 -8px 32px #101b3026;
    overflow: auto;
    overscroll-behavior: contain;
  }
  .phone-thread-heading {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    padding: 0 12px 0 16px;
    border-bottom: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font: 650 .9rem Inter, sans-serif;
  }
  .phone-thread-heading button {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    font: 400 26px/1 Inter, sans-serif;
    cursor: pointer;
  }
  .demo .phone-thread > .conversation-item { padding-inline: 16px; }
  .demo .phone-thread > :is(.reply-pill, .reply-expanded) {
    position: sticky;
    bottom: 0;
    z-index: 1;
    box-sizing: border-box;
  }
  .demo .phone-thread > .reply-pill {
    width: calc(100% - 24px);
    min-height: 44px;
    margin: 6px 12px 8px;
  }
  .demo .phone-thread > .reply-expanded {
    padding: 8px 12px;
    border-top: 1px solid var(--line);
    background: #fff;
  }
  .demo .phone-thread [data-sd-comment-text] {
    max-height: max(44px, min(96px, calc(var(--thread-height) * .25)));
    font-size: 16px;
    overflow-y: auto;
  }
  .demo .comments-dialog.phone-thread-short { max-height: calc(var(--thread-height) - 12px); }
  .demo .phone-thread-short > .reply-expanded {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px;
  }
  .demo .phone-thread-short .reply-actions { margin: 0; }
  .demo .phone-thread .reply-actions button { min-height: 44px; }
}

@media (any-pointer: coarse), (max-width: 768px) {
  .demo .comments-dialog button:is([data-comment-action='resolve'], [data-comment-action='reject']) {
    box-sizing: border-box;
    width: 44px;
    height: 44px;
  }
  .demo .comments-dialog button:is([data-comment-action='resolve'], [data-comment-action='reject']) svg {
    width: 16px;
    height: 16px;
  }
}
