/* Conversation and artifact workspace. The approved Clarity shell and controls stay canonical. */
.drafting-studio {
  --drafting-line: var(--border-default, #e7e9ee);
  --drafting-ink: var(--text-primary, #282c33);
  --drafting-muted: var(--text-secondary, #707782);
  display: grid;
  grid-template-columns: minmax(360px, 410px) minmax(0, 1fr);
  width: 100%;
  height: max(440px, calc(100dvh - 245px));
  min-height: 440px;
  border: 1px solid var(--drafting-line);
  border-radius: 15px;
  overflow: hidden;
  background: #fff;
  color: var(--drafting-ink);
  isolation: isolate;
}
.drafting-studio [hidden] { display: none !important; }
.drafting-chat, .drafting-canvas { min-width: 0; min-height: 0; }
.drafting-chat {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--drafting-line);
  background: #fff;
}
.drafting-thread {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #d8dbe1 transparent;
  padding: 25px 22px 14px;
  scroll-padding-block: 20px;
}
.drafting-message { position: relative; margin: 0 0 25px; font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.drafting-message > :first-child { margin-top: 0; }
.drafting-message > :last-child { margin-bottom: 0; }
.drafting-message p { margin: 8px 0; font-size: 13px; line-height: 1.8; }
.drafting-message :is(h2, h3, h4) { margin: 6px 0 10px; font-family: "DM Sans", Manrope, sans-serif; font-weight: 600; letter-spacing: -.02em; }
.drafting-message h2 { font-size: 19px; line-height: 1.4; }
.drafting-message h3 { font-size: 15px; line-height: 1.5; }
.drafting-message h4 { font-size: 13px; }
.drafting-message small { font-size: 11px; color: var(--drafting-muted); }
.drafting-message.is-user {
  width: fit-content;
  max-width: calc(100% - 26px);
  margin-left: auto;
  padding: 12px 15px;
  border-radius: 13px 13px 3px 13px;
  background: #f3f4f6;
  color: #3a414c;
  white-space: pre-wrap;
}
.drafting-message.is-assistant { padding-left: 0; }
.drafting-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  margin-bottom: 9px;
  border: 1px solid var(--drafting-line, #e7e9ee);
  border-radius: 9px;
  background: #fff;
  color: #515b6a;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.drafting-avatar :is(svg, img) { width: 17px; height: 17px; object-fit: contain; }
.drafting-question-card {
  margin: 14px 0;
  padding: 15px;
  border: 1px solid var(--drafting-line, #e7e9ee);
  border-radius: 11px;
  background: #fff;
  min-width: 0;
}
.drafting-question-card :is(h3, h4, p) { margin-top: 0; }
.drafting-question-card p:last-child { margin-bottom: 0; }
.drafting-question-card label { display: block; font-size: 12px; font-weight: 500; line-height: 1.7; }
.drafting-question-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 21px;
  min-height: 21px;
  padding: 3px 7px;
  margin: 0 7px 7px 0;
  border-radius: 6px;
  background: #f1f2f5;
  color: #727b88;
  font-size: 10px;
  font-weight: 600;
}
.drafting-choice-grid { display: flex; flex-wrap: wrap; gap: 7px; margin: 11px 0 0; }
.drafting-choice-grid button {
  min-height: 32px;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #fff;
  color: #687281;
  font: 500 11px/1.5 Manrope, "Segoe UI", sans-serif;
  text-align: left;
  cursor: pointer;
}
.drafting-choice-grid button:hover { background: #f7f8fa; border-color: #c8ced8; color: #354052; }
.drafting-choice-grid button:is(.active, [aria-pressed="true"], [aria-selected="true"]) { background: #f0f2f5; border-color: #aab4c4; color: #303a4b; }
.drafting-choice-grid button:disabled { opacity: .55; cursor: not-allowed; }
.drafting-reply {
  flex: 0 0 auto;
  margin: 0 15px 15px;
  padding: 13px 13px 10px;
  border: 1px solid #dfe3e9;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 9px #28304405;
}
.drafting-reply:focus-within { border-color: #a6b2cc; }
.drafting-reply textarea {
  display: block;
  width: 100%;
  min-height: 68px;
  max-height: 170px;
  margin: 0;
  padding: 0 2px 7px;
  resize: vertical;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--drafting-ink, #282c33);
  font: 400 13px/1.8 Manrope, "Segoe UI", sans-serif;
  box-shadow: none;
}
.drafting-reply textarea::placeholder { color: #929aa7; }
.drafting-studio .drafting-reply textarea:focus-visible { outline: 0; }
.drafting-composer-tools { display: flex; justify-content: space-between; align-items: center; gap: 9px; margin-top: 6px; min-width: 0; }
.drafting-composer-tools > div { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.drafting-composer-tools small { font-size: 10px; color: #89919d; }
.drafting-composer-tools .btn { flex-shrink: 0; }
.drafting-stagebar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 49px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--drafting-line, #e7e9ee);
  color: #8b929d;
  background: #fff;
  font-size: 10px;
  line-height: 1.5;
}
.drafting-stagebar > span { display: inline-flex; align-items: center; gap: 6px; }
.drafting-stagebar :is(.active, .is-active, [aria-current="step"]) { color: #354052; font-weight: 600; }
.drafting-stagebar :is(.complete, .is-complete) { color: #6f7988; }
.drafting-status { display: inline-flex; align-items: center; gap: 7px; color: #737d8c; font-size: 11px; line-height: 1.6; }
.drafting-status::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #a5adb8; flex-shrink: 0; }
.drafting-status:is(.running, .is-running)::before { background: #6d7e98; animation: drafting-status-pulse 1.4s ease-in-out infinite; }
.drafting-canvas { display: flex; flex-direction: column; background: #f8f9fa; }
.drafting-canvas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 15px;
  flex: 0 0 auto;
  min-height: 59px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--drafting-line, #e7e9ee);
  background: #fff;
}
.drafting-canvas-toolbar > div { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; min-width: 0; }
.drafting-canvas-toolbar :is(h2, h3, strong) { margin: 0; font-size: 12px; line-height: 1.6; font-weight: 600; overflow-wrap: anywhere; }
.drafting-canvas-toolbar small { color: #8b939f; font-size: 10px; }
.drafting-canvas-toolbar > span { color: #88919e; font-size: 13px; line-height: 1.6; }
footer.drafting-canvas-toolbar { min-height: 43px; padding-block: 10px; border-top: 1px solid var(--drafting-line, #e7e9ee); border-bottom: 0; }
.drafting-canvas-toolbar [role="tab"] { min-height: 33px; padding: 6px 10px; border: 0; border-radius: 7px; background: transparent; color: #8b939f; font: 500 11px/1.5 Manrope, sans-serif; cursor: pointer; }
.drafting-canvas-toolbar [role="tab"][aria-selected="true"] { background: #f0f2f5; color: #354052; }
.drafting-canvas-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #d8dbe1 transparent;
  padding: 24px;
}
.drafting-canvas-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  max-width: 340px;
  margin: 0 auto;
  padding: 35px 14px;
  text-align: center;
}
.drafting-canvas-empty > :is(svg, .icon) { width: 34px; height: 34px; margin-bottom: 18px; color: #a7afbb; stroke-width: 1.3; }
.drafting-canvas-empty :is(h2, h3) { margin: 0 0 10px; color: #5a6575; font: 500 19px/1.5 "DM Sans", Manrope, sans-serif; letter-spacing: -.02em; }
.drafting-canvas-empty p { max-width: 290px; margin: 0; color: #8a929e; font-size: 12px; line-height: 1.85; }
.drafting-plan { max-width: 760px; margin: 0 auto; padding: 27px; border: 1px solid #e5e8ed; border-radius: 12px; background: #fff; }
.drafting-plan > :first-child { margin-top: 0; }
.drafting-plan > :last-child { margin-bottom: 0; }
.drafting-plan :is(h2, h3) { color: #354052; font-family: "DM Sans", Manrope, sans-serif; font-weight: 600; letter-spacing: -.02em; }
.drafting-plan h2 { margin: 7px 0 17px; font-size: 24px; line-height: 1.4; }
.drafting-plan h3 { margin: 25px 0 12px; font-size: 14px; line-height: 1.6; }
.drafting-plan p { font-size: 12px; line-height: 1.9; color: #727c8b; }
.drafting-plan .ai-actions { margin-top: 22px; }
.drafting-brief-grid { display: grid; grid-template-columns: minmax(90px, .32fr) minmax(0, 1fr); gap: 14px 20px; padding: 18px 0; border-block: 1px solid #eceef2; margin: 18px 0; }
.drafting-brief-grid > div { min-width: 0; }
.drafting-brief-grid :is(dt, small, label) { display: block; margin: 0 0 5px; font-size: 10px; font-weight: 500; color: #929aa6; line-height: 1.6; }
.drafting-brief-grid :is(dd, strong, b) { display: block; margin: 0; color: #525e70; font-size: 12px; font-weight: 500; line-height: 1.8; overflow-wrap: anywhere; white-space: pre-wrap; }
.drafting-brief-grid p { margin: 0; color: #525e70; }
.drafting-outline { margin: 0; padding-left: 21px; color: #576375; font-size: 12px; line-height: 1.8; }
.drafting-outline li { padding: 6px 0 6px 6px; border-bottom: 1px solid #f0f1f4; }
.drafting-outline li:last-child { border-bottom: 0; }
.drafting-outline li::marker { color: #a1a8b3; font-size: 11px; }
.drafting-open-items { margin: 20px 0; padding: 14px 16px; border: 1px solid #e9e5d9; border-radius: 9px; background: #fcfbf7; color: #817866; font-size: 12px; line-height: 1.8; }
.drafting-open-items summary { font-size: 12px; font-weight: 500; cursor: pointer; }
.drafting-open-items :is(p, ul) { margin-block: 8px; color: inherit; }
.drafting-open-items ul { padding-left: 18px; }
.drafting-open-items li { margin: 5px 0; }
.drafting-document {
  max-width: 790px;
  min-height: 700px;
  margin: 0 auto;
  padding: 46px 43px;
  border: 1px solid #e3e5e9;
  border-radius: 3px;
  background: #fff;
  color: #303743;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  line-height: 1.95;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 4;
}
.drafting-document[contenteditable="true"]:focus { border-color: #a6b2cc; }
.drafting-document-nav { display: flex; align-items: center; gap: 6px; max-width: 790px; margin: 0 auto 15px; padding: 0 0 5px; overflow-x: auto; scrollbar-width: thin; }
.drafting-document-nav button { flex: 0 0 auto; min-height: 29px; max-width: 230px; padding: 5px 9px; border: 1px solid #e4e7ec; border-radius: 7px; background: #fff; color: #7b8594; font: 500 10px/1.6 Manrope, sans-serif; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; cursor: pointer; }
.drafting-document-nav button:hover, .drafting-document-nav button[aria-current="true"] { border-color: #bac4d3; background: #f3f5f8; color: #3c485c; }
.drafting-context-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; min-width: 0; padding: 0 0 14px; color: #828b99; font-size: 11px; line-height: 1.6; }
.drafting-context-strip :is(span, button, a) { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.drafting-context-strip > :is(span, button, a) { padding: 5px 8px; border: 1px solid #e8ebef; border-radius: 7px; background: #fff; }
.drafting-context-strip button { color: #747f90; font: inherit; cursor: pointer; }
.drafting-context-strip :is(svg, .icon) { width: 13px; height: 13px; flex-shrink: 0; }
.drafting-mobile-tabs { display: none; }
.drafting-source-row { display: flex; align-items: flex-start; gap: 10px; min-width: 0; margin: 10px 0; padding: 11px 12px; border: 1px solid #e7eaf0; border-radius: 9px; background: #fff; font-size: 12px; line-height: 1.7; }
.drafting-source-row > input { flex: 0 0 15px; width: 15px; min-height: 15px; height: 15px; margin: 3px 0 0; }
.drafting-source-row > :is(div, span) { min-width: 0; overflow-wrap: anywhere; }
.drafting-source-row strong { display: block; font-size: 12px; font-weight: 500; color: #525f71; }
.drafting-source-row small { display: block; margin-top: 3px; color: #9099a5; font-size: 10px; line-height: 1.7; }
.drafting-checklist { display: grid; gap: 10px; padding: 0; margin: 14px 0; list-style: none; color: #6d7889; font-size: 12px; line-height: 1.8; }
.drafting-checklist li { padding: 11px 13px; border: 1px solid #eaecf0; border-radius: 8px; background: #fff; }
.drafting-checklist label { display: flex; align-items: flex-start; gap: 9px; }
.drafting-checklist input { margin-top: 4px; }
.drafting-activity { margin: 15px 0; border-left: 1px solid #e1e5eb; padding: 0 0 0 15px; color: #8a939f; font-size: 11px; line-height: 1.8; }
.drafting-activity > :is(div, p, li) { position: relative; margin: 10px 0; }
.drafting-activity > :is(div, p, li)::before { content: ""; position: absolute; width: 5px; height: 5px; left: -18px; top: .7em; border-radius: 50%; background: #c4cad3; }
.drafting-activity strong { color: #697588; font-weight: 500; }
.drafting-demo-note { flex: 0 0 auto; color: #929aa6; font-size: 10px; line-height: 1.8; margin: 0; padding: 0 16px 12px; }
.drafting-thread .drafting-demo-note, .drafting-reply .drafting-demo-note { padding: 0; margin-top: 10px; }
.drafting-demo-note summary { cursor: pointer; }
.drafting-settings-panel { display: grid; gap: 15px; min-width: 0; }
.drafting-settings-panel .field { margin: 0; }
.drafting-settings-panel :is(p, small) { margin: 0; color: #8791a0; font-size: 11px; line-height: 1.8; }
.drafting-settings-panel .drafting-source-row { margin: 0; }
.drafting-settings-panel .ai-actions { margin-top: 5px; }
.drafting-file-card { display: flex; align-items: center; gap: 11px; max-width: 100%; margin: 14px 0; padding: 13px; border: 1px solid #e4e7ed; border-radius: 11px; background: #fff; color: #536074; text-align: left; }
.drafting-file-card > :is(svg, .icon) { width: 27px; height: 31px; color: #8b98aa; flex-shrink: 0; }
.drafting-file-card > :is(div, span) { min-width: 0; }
.drafting-file-card strong { display: block; font-size: 12px; font-weight: 600; line-height: 1.7; overflow-wrap: anywhere; }
.drafting-file-card small { display: block; margin-top: 3px; color: #939ca8; font-size: 10px; }
.drafting-selection { max-height: 180px; margin: 12px 0; padding: 12px 14px; overflow-y: auto; border-left: 2px solid #b4c0d3; background: #f6f8fb; color: #667287; font-size: 12px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.drafting-studio :is(button, a, input, select, textarea, [contenteditable], summary):focus-visible,
.drafting-context-strip :is(button, a):focus-visible,
.drafting-mobile-tabs button:focus-visible,
.drafting-settings-panel :is(button, input, select, textarea, summary):focus-visible { outline: 2px solid var(--focus-ring-color, #a6b2cc); outline-offset: 3px; }
@keyframes drafting-status-pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@media (min-width: 901px) and (max-width: 1150px) {
  .drafting-studio { grid-template-columns: 360px minmax(0, 1fr); }
  .drafting-thread { padding-inline: 18px; }
  .drafting-canvas-body { padding: 18px; }
  .drafting-document { padding: 32px 27px; }
  .drafting-plan { padding: 23px; }
}
@media (max-width: 900px) {
  .drafting-studio { display: flex; flex-direction: column; height: max(460px, calc(100dvh - 250px)); min-height: 460px; border-radius: 12px; }
  .drafting-chat, .drafting-canvas { flex: 1 1 auto; width: 100%; height: 100%; }
  .drafting-chat { border-right: 0; }
  .drafting-mobile-tabs { display: flex; align-items: center; gap: 4px; margin: 0 0 12px; padding: 4px; border: 1px solid #e6e9ef; border-radius: 9px; background: #f8f9fa; }
  .drafting-mobile-tabs button { flex: 1 1 0; min-height: 36px; padding: 7px 11px; border: 0; border-radius: 6px; background: transparent; color: #8a939f; font: 500 12px/1.5 Manrope, sans-serif; cursor: pointer; }
  .drafting-mobile-tabs button[aria-selected="true"], .drafting-mobile-tabs button.active { background: #fff; color: #3d495c; box-shadow: 0 1px 3px #29344906; }
  .drafting-context-strip { padding-bottom: 12px; gap: 6px; font-size: 10px; }
  .drafting-canvas-body { padding: 18px; }
  .drafting-document { padding: 32px 28px; }
  .drafting-brief-grid { gap: 14px 18px; }
}
@media (max-width: 520px) {
  .drafting-thread { padding: 20px 16px 10px; }
  .drafting-stagebar { padding: 11px 15px; gap: 7px; font-size: 9px; }
  .drafting-reply { margin: 0 11px 11px; padding: 12px; }
  .drafting-reply textarea { min-height: 74px; font-size: 14px; }
  .drafting-message.is-user { max-width: calc(100% - 15px); }
  .drafting-canvas-toolbar { padding: 11px 14px; gap: 9px; }
  .drafting-canvas-body { padding: 13px; }
  .drafting-plan { padding: 20px 17px; }
  .drafting-plan h2 { font-size: 21px; }
  .drafting-document { min-height: 620px; padding: 27px 20px; font-size: 14px; }
  .drafting-brief-grid { grid-template-columns: minmax(0, 1fr); }
  .drafting-question-card { padding: 13px; }
  .drafting-choice-grid button { min-height: 36px; }
  .drafting-context-strip > :is(span, button, a) { padding: 4px 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .drafting-status:is(.running, .is-running)::before { animation: none; }
  .drafting-thread, .drafting-canvas-body { scroll-behavior: auto; }
}

/* Focused drafting route: one task bar and the working surface fill the viewport. */
body.drafting-focus { overflow: hidden; }
body.drafting-focus .clarity-shell { height: 100dvh; min-height: 0; overflow: hidden; }
body.drafting-focus .clarity-shell > .workspace {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
body.drafting-focus .clarity-topbar {
  flex: 0 0 50px;
  height: 50px;
  min-height: 50px;
  padding: 0 22px;
  gap: 12px;
}
body.drafting-focus :is(.clarity-header-context, .clarity-role, .legal-header-context, .clarity-workspace-footer) { display: none !important; }
body.drafting-focus .clarity-workspace-identity,
body.drafting-focus .clarity-topbar-actions { gap: 10px; }
body.drafting-focus .clarity-topbar .clarity-icon-button { width: 32px; height: 32px; border-radius: 7px; }
body.drafting-focus .clarity-topbar .clarity-icon-button .icon { width: 19px; height: 19px; }
body.drafting-focus .clarity-wordmark img { width: 115px; height: 30px; }
body.drafting-focus .clarity-content.app-content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0 18px 14px;
  overflow: hidden;
}
.drafting-sessionbar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 46px;
  padding: 0 2px 9px;
  min-width: 0;
}
.drafting-session-title { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 auto; }
.drafting-session-title :is(h1, p),
h1.drafting-session-title {
  margin: 0;
  min-width: 0;
  color: #303741;
  font-family: "DM Sans", Manrope, sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.drafting-session-title :is(svg, .icon) { width: 18px; height: 18px; flex: 0 0 auto; color: #8a95a3; }
.drafting-session-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex: 0 1 auto; min-width: 0; }
body.drafting-focus .drafting-session-actions .btn {
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 7px;
  font-size: 11px;
  line-height: 1.5;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}
body.drafting-focus .drafting-session-actions .btn:first-child {
  max-width: min(300px, 30vw);
  overflow: hidden;
  text-overflow: ellipsis;
}
body.drafting-focus .drafting-studio {
  flex: 1 1 auto;
  grid-template-columns: minmax(340px, 400px) minmax(0, 1fr);
  height: auto;
  min-height: 0;
  border-radius: 10px;
}
body.drafting-focus .drafting-thread { padding: 21px 21px 12px; }
body.drafting-focus .drafting-reply { margin: 0 13px 13px; padding: 11px 12px 9px; }
body.drafting-focus .drafting-reply textarea { min-height: 59px; max-height: min(150px, 24dvh); }
body.drafting-focus .drafting-canvas-toolbar { min-height: 48px; padding: 8px 16px; gap: 8px 12px; }
body.drafting-focus .drafting-canvas-toolbar > div { gap: 5px; }
body.drafting-focus .drafting-canvas-toolbar [role="tab"] { min-height: 31px; padding: 5px 8px; }
body.drafting-focus footer.drafting-canvas-toolbar { min-height: 42px; justify-content: flex-end; }
.drafting-journey {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 18px;
  min-height: 35px;
  padding: 7px 18px;
  border-bottom: 1px solid #eceef1;
  color: #9aa1ab;
  background: #fff;
  font-size: 10px;
  line-height: 1.5;
}
.drafting-journey > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.drafting-journey > span::before { content: ""; width: 5px; height: 5px; border: 1px solid #cdd2da; border-radius: 50%; }
.drafting-journey > span.active { color: #435064; font-weight: 600; }
.drafting-journey > span.active::before { background: #667d9e; border-color: #667d9e; box-shadow: 0 0 0 3px #667d9e12; }
.drafting-journey > span.complete { color: #758193; }
.drafting-journey > span.complete::before { background: #b2bcc8; border-color: #b2bcc8; }
.drafting-run {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid #e5e8ed;
  border-radius: 11px;
  background: #fff;
  min-width: 0;
  font-size: 12px;
  line-height: 1.7;
}
.drafting-run > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 15px; min-width: 0; }
.drafting-run > header :is(h2, h3, strong, b) { margin: 0; color: #465264; font: 600 13px/1.6 Manrope, sans-serif; }
.drafting-run > header :is(span, small) { color: #9099a5; font-size: 10px; white-space: nowrap; }
.drafting-run-steps { display: grid; gap: 0; list-style: none; margin: 0; padding: 0; }
.drafting-run-steps > li { display: flex; align-items: flex-start; gap: 10px; position: relative; min-width: 0; padding: 0 0 17px; }
.drafting-run-steps > li:not(:last-child)::after { content: ""; position: absolute; left: 10px; top: 25px; bottom: 5px; width: 1px; background: #e8ebef; }
.drafting-run-steps > li:last-child { padding-bottom: 0; }
.drafting-run-icon {
  display: inline-flex;
  flex: 0 0 22px;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid #e1e5eb;
  border-radius: 50%;
  background: #fff;
  color: #a0a9b6;
  font-size: 10px;
  line-height: 1;
}
.drafting-run-steps > li > div { flex: 1 1 auto; min-width: 0; padding-top: 1px; }
.drafting-run-steps b { display: block; color: #8a95a4; font-size: 12px; font-weight: 500; line-height: 1.6; }
.drafting-run-steps small { display: block; margin-top: 3px; color: #a0a8b3; font-size: 10px; line-height: 1.65; overflow-wrap: anywhere; }
.drafting-run-steps .is-complete b { color: #627184; }
.drafting-run-steps .is-complete .drafting-run-icon { border-color: #dce3eb; background: #f3f5f8; color: #7b8ca1; }
.drafting-run-steps .is-running b { color: #36445a; font-weight: 600; }
.drafting-run-steps .is-running .drafting-run-icon { border-color: #a9b6c9; color: transparent; }
.drafting-run-steps .is-running .drafting-run-icon::before { content: ""; width: 10px; height: 10px; border: 1.5px solid #dbe1e9; border-top-color: #647f9f; border-radius: 50%; animation: drafting-run-spin .9s linear infinite; }
.drafting-run-steps .is-stopped b { color: #8e8b83; }
.drafting-run-steps .is-stopped .drafting-run-icon { background: #f8f7f3; border-color: #e4e1d8; color: #aaa18b; }
.drafting-run-steps .is-error b { color: #92715b; }
.drafting-run-steps .is-error .drafting-run-icon { background: #fcf8f5; border-color: #eaded4; color: #ab8a72; }
.drafting-run > footer { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.drafting-run-compact { margin: 12px 0; border: 1px solid #e6e9ee; border-radius: 9px; background: #fff; overflow: hidden; }
.drafting-run-compact > summary { display: flex; align-items: center; gap: 8px; padding: 10px 12px; color: #7e8998; font-size: 11px; line-height: 1.6; cursor: pointer; }
.drafting-run-compact > summary::before { content: "✓"; display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border-radius: 50%; background: #f0f3f7; color: #7c8da2; font-size: 10px; }
.drafting-run-compact[open] > summary { border-bottom: 1px solid #edf0f3; }
.drafting-run-compact .drafting-run { margin: 0; border: 0; border-radius: 0; padding: 13px; }
.drafting-run-compact .drafting-run > header { display: none; }
.drafting-sessionbar :is(button, a):focus-visible,
.drafting-run :is(button, a):focus-visible,
.drafting-run-compact > summary:focus-visible { outline: 2px solid var(--focus-ring-color, #a6b2cc); outline-offset: 3px; }
@keyframes drafting-run-spin { to { transform: rotate(360deg); } }
@media (min-width: 901px) and (max-width: 1150px) {
  body.drafting-focus .drafting-studio { grid-template-columns: 340px minmax(0, 1fr); }
  .drafting-session-actions { gap: 4px; }
}
@media (max-width: 900px) {
  body.drafting-focus .clarity-topbar { flex-basis: 48px; min-height: 48px; height: 48px; padding-inline: 15px; }
  body.drafting-focus .clarity-content.app-content { padding: 0 12px 11px; }
  .drafting-sessionbar { min-height: 45px; gap: 9px; padding-bottom: 8px; }
  .drafting-session-title { flex: 1 1 130px; }
  .drafting-session-title :is(h1, p), h1.drafting-session-title { font-size: 14px; }
  .drafting-session-actions { justify-content: flex-start; max-width: 67%; overflow-x: auto; scrollbar-width: none; }
  .drafting-session-actions::-webkit-scrollbar { display: none; }
  body.drafting-focus .drafting-session-actions .btn:first-child { max-width: 140px; }
  body.drafting-focus .drafting-studio { display: flex; height: auto; min-height: 0; border-radius: 9px; }
  body.drafting-focus .drafting-chat, body.drafting-focus .drafting-canvas { flex: 1 1 auto; min-height: 0; height: auto; }
  body.drafting-focus .drafting-mobile-tabs { flex: 0 0 auto; margin-bottom: 8px; padding: 3px; border-radius: 8px; }
  body.drafting-focus .drafting-mobile-tabs button { min-height: 31px; padding-block: 5px; }
  body.drafting-focus .drafting-thread { padding: 17px 17px 10px; }
  body.drafting-focus .drafting-canvas-toolbar { padding: 8px 12px; }
  .drafting-journey { min-height: 31px; padding: 6px 13px; gap: 13px; }
}
@media (max-width: 520px) {
  body.drafting-focus .clarity-wordmark img { width: 100px; }
  body.drafting-focus .clarity-topbar-actions { gap: 3px; }
  body.drafting-focus .clarity-topbar { padding-inline: 12px; }
  body.drafting-focus .clarity-content.app-content { padding-inline: 9px; }
  .drafting-session-title :is(h1, p), h1.drafting-session-title { font-size: 13px; }
  .drafting-session-actions { max-width: 64%; }
  body.drafting-focus .drafting-session-actions .btn { min-height: 29px; padding: 4px 7px; font-size: 10px; }
  body.drafting-focus .drafting-session-actions .btn:first-child { max-width: 120px; }
  body.drafting-focus .drafting-thread { padding: 16px 13px 9px; }
  body.drafting-focus .drafting-reply { margin: 0 9px 9px; padding: 10px; }
  body.drafting-focus .drafting-reply textarea { min-height: 57px; font-size: 13px; }
  .drafting-run { padding: 13px; }
  .drafting-run > header { margin-bottom: 12px; }
}
@media (max-height: 580px) {
  body.drafting-focus .clarity-topbar { flex-basis: 44px; min-height: 44px; height: 44px; }
  .drafting-sessionbar { min-height: 40px; padding-bottom: 5px; }
  body.drafting-focus .drafting-reply textarea { min-height: 42px; max-height: 90px; }
  body.drafting-focus .drafting-reply { padding-block: 8px; margin-bottom: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .drafting-run-steps .is-running .drafting-run-icon::before { animation: none; }
}

/* Keep document chrome on the same measure as its paper. */
body.drafting-focus .drafting-canvas-toolbar > .drafting-canvas-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 8px;
  margin-left: auto;
}
body.drafting-focus .drafting-canvas-actions .btn {
  min-height: 32px;
  margin: 0;
  padding: 6px 11px;
  font-size: 11px;
  line-height: 1.5;
  white-space: nowrap;
}
.drafting-document-frame {
  width: 100%;
  max-width: 790px;
  min-width: 0;
  margin: 0 auto;
}
.drafting-document-frame > .drafting-file-card {
  width: 100%;
  max-width: none;
  margin: 0 0 14px;
  padding: 14px 17px;
  align-items: flex-start;
  gap: 12px;
  border-radius: 10px;
}
.drafting-document-frame .drafting-file-card > .icon {
  flex: 0 0 20px;
  width: 20px;
  height: 24px;
  margin-top: 2px;
  color: #8390a0;
}
.drafting-file-meta { flex: 1 1 auto; min-width: 0; }
.drafting-file-meta strong {
  display: block;
  margin: 0;
  color: #354052;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.drafting-file-meta small { display: block; margin-top: 4px; line-height: 1.5; }
.drafting-file-card > .drafting-version-label {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 5px;
  background: #f2f4f7;
  color: #7b8695;
  font-size: 10px;
  line-height: 1.5;
}
.drafting-document-frame > .drafting-document-nav {
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0 0 13px;
}
.drafting-document-frame > .drafting-document {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin: 0;
}
@media (max-width: 520px) {
  body.drafting-focus .drafting-canvas-toolbar > .drafting-canvas-actions { gap: 6px; }
  body.drafting-focus .drafting-canvas-actions .btn { min-height: 31px; padding-inline: 9px; }
  .drafting-document-frame > .drafting-file-card { padding: 12px; gap: 9px; }
  .drafting-file-meta strong { font-size: 12px; }
}

/* Save feedback is docked outside the scroll area, alongside document actions. */
.drafting-canvas-footer {
  flex: 0 0 auto;
  min-width: 0;
  padding: 0 24px;
  border-top: 1px solid #e3e6ec;
  background: #fff;
}
.drafting-canvas-footer-inner {
  width: 100%;
  max-width: 790px;
  min-width: 0;
  margin: 0 auto;
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}
.drafting-canvas-footer #record-save-status {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: #8a929e;
  font: 400 11px/1.5 Manrope, sans-serif;
  overflow-wrap: anywhere;
}
.drafting-footer-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}
.drafting-footer-actions .btn { margin: 0; }
@media (max-width: 1150px) { .drafting-canvas-footer { padding-inline: 18px; } }
@media (max-width: 520px) {
  .drafting-canvas-footer { padding-inline: 13px; }
  .drafting-canvas-footer-inner { flex-wrap: wrap; gap: 7px; padding-block: 9px; }
  .drafting-canvas-footer #record-save-status { flex-basis: 100%; }
  .drafting-footer-actions { gap: 6px; }
}

/* Source cards give each filename and its details the full sidebar measure. */
.clarity-content[data-clarity-page="P07"] .editor-sources {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  min-width: 0;
  flex: 1 0 100%;
}
.clarity-content .editor-source-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid #e6e9ef;
  border-radius: 9px;
  background: #fff;
}
.clarity-content .editor-source-heading {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
}
.clarity-content .editor-source-heading .icon { flex: 0 0 15px; width: 15px; height: 18px; margin-top: 1px; color: #8a95a4; }
.clarity-content .editor-source-heading strong { min-width: 0; font-size: 12px; line-height: 1.6; font-weight: 600; overflow-wrap: anywhere; }
.clarity-content .editor-source-meta { margin: 9px 0 0; color: #8b939f; font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; }
.clarity-content .editor-source-note { margin: 6px 0 0; color: #929aa5; font-size: 10px; line-height: 1.6; }
.clarity-content .editor-source-actions { display: flex; margin-top: 11px; }
.clarity-content .editor-source-actions .btn { min-height: 29px; margin: 0; font-size: 10px; padding: 5px 9px; }
.clarity-content .editor-template-action {
  flex: 1 0 100%;
  width: 100%;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e8ebf0;
}
.clarity-content .editor-template-action .btn { width: 100%; margin: 0; }
@media (min-width: 1251px) {
  .clarity-content[data-clarity-page="P07"] .editor-wrap { grid-template-columns: 244px minmax(0, 1fr) 250px; }
}
@media (min-width: 761px) and (max-width: 1250px) {
  .clarity-content[data-clarity-page="P07"] .editor-sources { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .clarity-content .editor-template-action .btn { width: auto; min-width: 150px; }
}
/* Expanded source text belongs below its summary, rather than in a horizontal row. */
.drafting-plan details.drafting-source-row { display: block; }
.drafting-plan details.drafting-source-row summary { cursor: pointer; overflow-wrap: anywhere; }
.drafting-plan details.drafting-source-row .record-text {
  min-width: 0;
  width: 100%;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e9ecf1;
  font-size: 12px;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
