/* ─────────────────────────────────────────────────────────────────────────────
   Partnership brief · "Edit bay"
   The brief is laid out like a video: each step is a chapter on a scrubber,
   with a timecode, and the red playhead marks where you are. Builds on the
   tokens in site.css.
   ───────────────────────────────────────────────────────────────────────────── */

.brief-page {
  min-height: 100vh;
}

/* ── Header: brand, chapter scrubber, timecode ────────────────────────────── */

.bt-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: var(--ink-1);
}

.bt-bar-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "brand scrub btn"
    "brand meta btn";
  align-content: center;
  column-gap: 40px;
  row-gap: 2px;
  min-height: 72px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.bt-bar .brand {
  grid-area: brand;
  align-self: center;
}

.bt-preview-btn {
  grid-area: btn;
  align-self: center;
}

.scrub {
  position: relative;
  grid-area: scrub;
}

.scrub-list {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 20px;
}

.seg {
  position: relative;
  flex: 1 1 0;
  min-width: 6px;
  height: 100%;
}

.seg-hit {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: none;
}

button.seg-hit {
  cursor: pointer;
}

.seg-bar {
  position: relative;
  display: block;
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(238, 240, 245, 0.16);
  transition: transform var(--t-fast) var(--ease);
}

.seg-bar i {
  position: absolute;
  inset: 0;
  background: rgba(238, 240, 245, 0.55);
  transform: scaleX(var(--f, 0));
  transform-origin: left center;
  transition:
    transform var(--t-move) var(--ease),
    background-color var(--t-fast) var(--ease);
}

.seg.is-current .seg-bar i {
  background: var(--playhead);
}

.scrub:hover .seg-bar {
  transform: scaleY(1.5);
}

button.seg-hit:hover .seg-bar i,
button.seg-hit:focus-visible .seg-bar i {
  background: var(--text);
}

.seg-tip {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  z-index: 2;
  padding: 4px 8px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: var(--ink-3);
  color: var(--text);
  font: 500 12px/1.4 var(--mono);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -2px);
  transition:
    opacity var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease);
}

.seg-tip span {
  margin-right: 8px;
  color: var(--text-3);
}

.seg:hover .seg-tip,
.seg:focus-within .seg-tip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.seg:first-child .seg-tip {
  left: 0;
  transform: translate(0, -2px);
}

.seg:last-child .seg-tip {
  right: 0;
  left: auto;
  transform: translate(0, -2px);
}

.seg:first-child:hover .seg-tip,
.seg:first-child:focus-within .seg-tip,
.seg:last-child:hover .seg-tip,
.seg:last-child:focus-within .seg-tip {
  transform: none;
}

.scrub-head {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--playhead);
  box-shadow: 0 0 0 3px var(--ink-1);
  pointer-events: none;
  transform: translateX(var(--x, 0px));
  transition: transform var(--t-move) var(--ease);
}

.scrub-head.is-instant {
  transition: none;
}

.scrub-meta {
  display: flex;
  grid-area: meta;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 18px;
}

.scrub-tc {
  flex: none;
  color: var(--text);
  font: 500 12px/18px var(--mono);
  font-variant-numeric: tabular-nums;
}

.scrub-ch {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scrub-ch:not(:empty)::before {
  content: "·";
  margin-right: 8px;
  color: var(--text-3);
}

@media (max-width: 720px) {
  .bt-bar-inner {
    grid-template-areas:
      "brand meta btn"
      "scrub scrub scrub";
    column-gap: 12px;
    row-gap: 6px;
    min-height: 0;
    padding-top: 10px;
    padding-bottom: 6px;
  }

  .bt-bar .brand-name {
    display: none;
  }

  .scrub-meta {
    align-self: center;
  }
}

/* ── Layout ───────────────────────────────────────────────────────────────── */

.bt-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
  gap: 64px;
  padding-top: 48px;
  padding-bottom: 96px;
}

.bt-main {
  width: 100%;
  max-width: 640px;
}

/* ── Step ─────────────────────────────────────────────────────────────────── */

.st {
  animation: st-in 420ms var(--ease) both;
}

.st.from-left {
  animation-name: st-in-back;
}

@keyframes st-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes st-in-back {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
}

.st-eyebrow {
  color: var(--text-3);
  font: 500 12px/1.5 var(--mono);
  font-variant-numeric: tabular-nums;
}

.st-title {
  margin-top: 12px;
  font-size: clamp(28px, 3.2vw, 36px);
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.st-title:focus {
  outline: none;
}

.st-intro {
  max-width: 52ch;
  margin-top: 12px;
  color: var(--text-2);
}

.st-intro b {
  color: var(--text);
  font-weight: 500;
}

.st-fields {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-top: 40px;
}

.rv-confirm {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 32px;
}

/* ── Fields ───────────────────────────────────────────────────────────────── */

.field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.f-top {
  display: block;
  width: 100%;
  margin-bottom: 12px;
  padding: 0;
}

.f-label {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
}

.f-opt {
  margin-left: 8px;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 400;
}

.f-hint {
  display: block;
  margin-top: 2px;
  color: var(--text-3);
  font-size: 13px;
  line-height: 1.5;
}

.input {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--ink-2);
  color: var(--text);
  font: 400 15px/1.5 var(--font);
  -webkit-appearance: none;
  appearance: none;
  transition:
    border-color var(--t-fast) var(--ease),
    background-color var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease);
}

.input::placeholder {
  color: var(--text-3);
  opacity: 1;
}

.input:hover {
  border-color: var(--line-3);
}

.input:focus {
  border-color: rgba(238, 240, 245, 0.5);
  outline: none;
  box-shadow: 0 0 0 3px rgba(238, 240, 245, 0.08);
}

textarea.input {
  min-height: 96px;
  resize: vertical;
}

input[type="date"].input {
  max-width: 240px;
}

.is-invalid .input {
  border-color: rgba(229, 72, 77, 0.72);
}

.is-invalid .input:focus {
  box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.16);
}

.f-error {
  margin-top: 8px;
  color: var(--neg-text);
  font-size: 13px;
  line-height: 1.5;
}

.f-meta {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.f-count {
  color: var(--text-3);
  font: 400 12px/1.4 var(--mono);
  font-variant-numeric: tabular-nums;
}

.f-count.is-near {
  color: var(--text);
}

/* Visually hidden native inputs keep keyboard and screen-reader behavior. */
.opt input,
.card-opt input,
.vid-opt input,
.consent input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Chips (single and multi choice) */

.opts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.opt {
  position: relative;
  display: inline-flex;
}

.opt span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--ink-2);
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.35;
  cursor: pointer;
  user-select: none;
  transition:
    border-color var(--t-fast) var(--ease),
    background-color var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease);
}

.opt span:hover {
  border-color: var(--line-3);
  color: var(--text);
}

.opt input[type="checkbox"] + span::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  border: 1px solid var(--line-3);
  border-radius: 4px;
  transition:
    background-color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease);
}

.opt input:checked + span {
  border-color: var(--text);
  background: var(--ink-3);
  color: var(--text);
}

.opt input[type="checkbox"]:checked + span::before {
  border-color: var(--text);
  background: var(--text)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b0d14' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E")
    center / 10px no-repeat;
}

.opt input:focus-visible + span,
.card-opt input:focus-visible + .card-box,
.vid-opt input:focus-visible + .vid-box,
.consent input:focus-visible + .box {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.opt.bump span {
  animation: bump 320ms var(--ease);
}

@keyframes bump {
  30% {
    transform: translateX(-3px);
  }
  60% {
    transform: translateX(3px);
  }
}

/* Cards (compensation, formats) */

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.card-opt {
  position: relative;
  display: flex;
}

.card-box {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: 14px 44px 14px 16px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--ink-2);
  cursor: pointer;
  transition:
    border-color var(--t-fast) var(--ease),
    background-color var(--t-fast) var(--ease);
}

.card-box:hover {
  border-color: var(--line-3);
}

.card-box b {
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
}

.card-box small {
  color: var(--text-3);
  font-size: 13px;
  line-height: 1.5;
}

.card-price {
  margin-top: 4px;
  color: var(--text-2);
  font: 400 12px/1.4 var(--mono);
}

.card-opt input:checked + .card-box,
.vid-opt input:checked + .vid-box {
  border-color: var(--text);
  background: var(--ink-3);
}

.card-opt input:checked + .card-box small {
  color: var(--text-2);
}

.tick {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line-3);
  border-radius: 50%;
  color: transparent;
  transition:
    background-color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease);
}

.tick svg {
  width: 12px;
  height: 12px;
}

input:checked + .card-box .tick,
input:checked + .vid-box .tick {
  border-color: var(--text);
  background: var(--text);
  color: var(--ink-1);
}

.group-label {
  margin: 24px 0 8px;
  color: var(--text-3);
  font-size: 13px;
}

.group-label:first-of-type {
  margin-top: 0;
}

/* Video picker */

.vids {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.vid-opt {
  position: relative;
  display: flex;
}

.vid-box {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 6px 6px 10px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--ink-2);
  cursor: pointer;
  transition:
    border-color var(--t-fast) var(--ease),
    background-color var(--t-fast) var(--ease);
}

.vid-box:hover {
  border-color: var(--line-3);
}

.vid-thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 7px;
  background: var(--ink-0);
  color: var(--text-3);
}

.vid-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vid-thumb svg {
  width: 20px;
  height: 20px;
}

.vid-dur {
  position: absolute;
  right: 4px;
  bottom: 4px;
  padding: 0 4px;
  border-radius: 3px;
  background: rgba(7, 8, 13, 0.85);
  color: #ffffff;
  font: 500 10px/16px var(--mono);
}

.vid-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 0 4px;
}

.vid-text b {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.vid-text small {
  color: var(--text-3);
  font: 400 12px/1.4 var(--mono);
}

/* The tick sits on the thumbnail, so it gets its own backing. */
.vid-box .tick {
  top: 12px;
  right: 12px;
  border-color: rgba(238, 240, 245, 0.6);
  background: rgba(7, 8, 13, 0.6);
}

/* Notices */

.notice {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--ink-2);
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.55;
}

.notice svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--text-3);
}

.notice b {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
  font-weight: 500;
}

.notice.warn svg {
  color: var(--text-2);
}

.notice.policy {
  border-color: rgba(229, 72, 77, 0.36);
}

.notice.policy svg {
  color: var(--neg);
}

/* Agreements */

.consent {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--ink-2);
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease);
}

.consent:hover {
  border-color: var(--line-3);
}

.consent .box {
  display: grid;
  flex: none;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 1px solid var(--line-3);
  border-radius: 6px;
  color: transparent;
  transition:
    background-color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease);
}

.consent .box svg {
  width: 12px;
  height: 12px;
}

.consent input:checked + .box {
  border-color: var(--text);
  background: var(--text);
  color: var(--ink-1);
}

.consent .text {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.55;
}

.is-invalid .consent {
  border-color: rgba(229, 72, 77, 0.72);
}

/* ── Navigation ───────────────────────────────────────────────────────────── */

.bt-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

#back {
  margin-left: -12px;
}

.bt-hint {
  margin-left: auto;
  color: var(--text-3);
  font: 400 12px/1.4 var(--mono);
}

.bt-nav .btn-primary {
  min-width: 136px;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(11, 13, 20, 0.24);
  border-top-color: var(--ink-1);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.bt-restore {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  padding: 8px 8px 8px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ink-2);
  color: var(--text-2);
  font-size: 14px;
}

.submit-error {
  margin-top: 24px;
  padding: 14px 16px;
  border: 1px solid rgba(229, 72, 77, 0.45);
  border-radius: 12px;
  background: rgba(229, 72, 77, 0.06);
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.6;
}

.submit-error b {
  color: var(--text);
  font-weight: 500;
}

.submit-error a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 560px) {
  .bt-hint {
    display: none;
  }

  .bt-nav {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin-top: 40px;
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
    background: var(--ink-1);
  }

  .bt-nav .btn-primary {
    flex: 1;
    margin-left: auto;
  }

  .cards {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ── Review ───────────────────────────────────────────────────────────────── */

.rv-banner {
  margin-top: 32px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ink-2);
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.6;
}

.rv-banner b {
  color: var(--text);
  font-weight: 500;
}

.rv-banner.paid::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--pos);
  vertical-align: 2px;
}

.rv {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.rv-sec {
  padding: 4px 16px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--ink-2);
}

.rv-sec header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 8px;
}

.rv-sec h3 {
  font-size: 14px;
}

.rv-edit {
  padding: 4px 8px;
  margin-right: -8px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-2);
  font-size: 13px;
  text-decoration: underline;
  text-decoration-color: var(--line-3);
  text-underline-offset: 3px;
  cursor: pointer;
  transition:
    color var(--t-fast) var(--ease),
    text-decoration-color var(--t-fast) var(--ease);
}

.rv-edit:hover {
  color: var(--text);
  text-decoration-color: currentColor;
}

.rv-banner .rv-edit {
  margin: 0;
  padding: 0;
  color: var(--text);
  font-size: inherit;
}

.rv-row {
  display: grid;
  grid-template-columns: 38% minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.5;
}

.rv-row dt {
  color: var(--text-3);
}

.rv-row dd {
  color: var(--text);
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.rv-empty {
  padding: 8px 0;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 14px;
}

#turnstile {
  margin-top: 8px;
}

@media (max-width: 560px) {
  .rv-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
}

/* ── Sent: the end screen ─────────────────────────────────────────────────── */

.done {
  animation: st-in 480ms var(--ease) both;
}

.done .st-eyebrow::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--pos);
  vertical-align: 1px;
}

.done-ref {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 440px;
  margin-top: 32px;
  padding: 8px 8px 8px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ink-2);
  color: var(--text-3);
  font-size: 13px;
}

.done-ref b {
  color: var(--text);
  font: 500 15px/1 var(--mono);
  letter-spacing: 0.02em;
}

.done-ref .btn {
  margin-left: auto;
}

.done-h {
  margin-top: 40px;
  font-size: 15px;
}

.done-steps {
  margin-top: 12px;
  counter-reset: step;
}

.done-steps li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.55;
  counter-increment: step;
}

.done-steps li::before {
  content: counter(step, decimal-leading-zero);
  color: var(--text-3);
  font: 500 12px/24px var(--mono);
}

.done-note {
  max-width: 60ch;
  margin-top: 20px;
  color: var(--text-3);
  font-size: 14px;
  line-height: 1.6;
}

.done-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

/* ── Live preview of the brief ────────────────────────────────────────────── */

.bt-preview {
  position: sticky;
  top: 104px;
  max-height: calc(100vh - 128px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-3) transparent;
}

.doc {
  position: relative;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--ink-2);
  transition: border-color var(--t-move) var(--ease);
}

.doc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

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

.doc-brand b {
  display: block;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
}

.doc-brand span {
  display: block;
  color: var(--text-3);
  font-size: 13px;
  line-height: 1.4;
}

.doc-ref {
  color: var(--text-3);
  font-size: 12px;
  text-align: right;
}

.doc-ref b {
  display: block;
  color: var(--text-2);
  font: 500 12px/1.5 var(--mono);
  white-space: nowrap;
}

.doc-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-3);
}

.status.ready::before {
  background: var(--text);
}

.status.sent {
  color: var(--text);
}

.status.sent::before {
  background: var(--pos);
}

.doc-saved {
  color: var(--text-3);
  font: 400 12px/1.4 var(--mono);
  text-align: right;
}

.doc-body {
  padding: 4px 0;
}

.doc-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.5;
}

.doc-row:last-child {
  border-bottom: 0;
}

.doc-row dt {
  color: var(--text-3);
}

.doc-row dd {
  margin: 0 -6px;
  padding: 0 6px;
  border-radius: 4px;
  color: var(--text);
  overflow-wrap: anywhere;
  transition: background-color 900ms var(--ease);
}

.doc-row dd.flash {
  background: rgba(238, 240, 245, 0.08);
  transition: none;
}

.doc-sub {
  display: -webkit-box;
  margin-top: 2px;
  overflow: hidden;
  color: var(--text-3);
  font-size: 12px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.sk {
  display: block;
  width: 72%;
  height: 8px;
  margin: 6px 0;
  border-radius: 4px;
  background: rgba(238, 240, 245, 0.06);
}

.sk + .sk {
  width: 44%;
}

.doc-foot {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.doc-meter {
  display: flex;
  justify-content: space-between;
  color: var(--text-3);
  font-size: 12px;
}

.doc-meter b {
  color: var(--text-2);
  font: 500 12px/1.4 var(--mono);
}

.doc-meter-bar {
  height: 4px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(238, 240, 245, 0.1);
}

.doc-meter-bar i {
  display: block;
  height: 100%;
  background: var(--text-2);
  transform: scaleX(var(--p, 0));
  transform-origin: left center;
  transition:
    transform var(--t-move) var(--ease),
    background-color var(--t-move) var(--ease);
}

.doc.is-sent {
  border-color: rgba(76, 195, 138, 0.32);
}

.doc.is-sent .doc-meter-bar i {
  background: var(--pos);
}

.doc-note {
  margin-top: 12px;
  color: var(--text-3);
  font-size: 13px;
  text-align: center;
}

.doc-close {
  display: none;
}

@media (min-width: 1021px) {
  .bt-preview-btn,
  .bt-scrim {
    display: none;
  }
}

/* Below 1020px the preview becomes a bottom sheet. */
@media (max-width: 1020px) {
  .bt-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding-top: 32px;
    padding-bottom: 48px;
  }

  .bt-main {
    margin: 0 auto;
  }

  .bt-preview {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    max-height: 88vh;
    max-height: 88svh;
    padding: 16px var(--gutter) calc(24px + env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    border-top: 1px solid var(--line-2);
    border-radius: var(--r-panel) var(--r-panel) 0 0;
    background: var(--ink-1);
    visibility: hidden;
    transform: translateY(100%);
    transition:
      transform 380ms var(--ease),
      visibility 0s linear 380ms;
  }

  .bt-preview.is-open {
    visibility: visible;
    transform: none;
    transition:
      transform 380ms var(--ease),
      visibility 0s;
  }

  .bt-preview .doc {
    max-width: 560px;
    margin: 0 auto;
  }

  .doc-close {
    display: flex;
    margin: 0 0 12px auto;
  }

  .doc-note {
    display: none;
  }

  .bt-scrim {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(4, 5, 8, 0.64);
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms var(--ease);
  }

  .bt-scrim.is-open {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 560px) {
  .bt-layout {
    padding-top: 24px;
  }

  .st-fields {
    gap: 28px;
    margin-top: 32px;
  }

  .doc {
    padding: 16px;
  }
}
