/* Shell surfaces only. Authored documents keep their own palette. */
:root {
  color-scheme: light;
  --paper: #f5f3ef;
  --white: #fff;
  --ink: #292d31;
  --muted: #666c70;
  --line: #e3e2dc;
  --accent: #456b8a;
  --accent-hover: #365a77;
  --accent-tint: #eaf0f5;
  --accent-border: #b2c6d6;
  --on-accent: #fff;
  --header: #faf9f6;
  --canvas: #eeece7;
  --code: #f8f7f4;
  --hover: #f5f7f8;
  --hover-line: #b7c5cf;
  --placeholder: #70777e;
  --quote-ink: #4f6a80;
  --quote-bg: #f1f5f8;
  --danger: #a43c42;
  --danger-bg: #f7ebea;
  --danger-border: #edd9d7;
  --success: #4e7047;
  --success-bg: #edf2e9;
  --warning: #746044;
  --warning-bg: #f4efe5;
  --warning-border: #e5ddcc;
  --toast-bg: #292d31;
  --toast-ink: #fff;
  --backdrop: #25222c55;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
:root[data-theme="night"] {
  color-scheme: dark;
  --paper: #181c21;
  --white: #22282f;
  --ink: #e6ebef;
  --muted: #a8b2bd;
  --line: #46515e;
  --accent: #8cb9de;
  --accent-hover: #add2f0;
  --accent-tint: #2a3b4b;
  --accent-border: #597c99;
  --on-accent: #152231;
  --header: #1e242b;
  --canvas: #12171c;
  --code: #1b2128;
  --hover: #2c3540;
  --hover-line: #718599;
  --placeholder: #a2adb9;
  --quote-ink: #b7d0e5;
  --quote-bg: #283847;
  --danger: #ffb1ba;
  --danger-bg: #482b32;
  --danger-border: #8f5862;
  --success: #b0d6a7;
  --success-bg: #293e30;
  --warning: #e5c58f;
  --warning-bg: #3b3326;
  --warning-border: #776447;
  --toast-bg: #dce5ed;
  --toast-ink: #18212b;
  --backdrop: #0009;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  color: inherit;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-weight: 500;
}
h1 {
  line-height: 1.15;
  font-family: var(--sans);
  font-size: 27px;
  font-weight: 620;
  letter-spacing: -0.8px;
}
h2 {
  font-size: 18px;
  letter-spacing: -0.5px;
}
h3 {
  font-size: 16px;
}
input,
textarea,
select {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 7px;
  padding: 11px 12px;
  color: var(--ink);
}
input,
textarea {
  width: 100%;
}
textarea {
  resize: vertical;
  line-height: 1.65;
}
input::placeholder,
textarea::placeholder {
  color: var(--placeholder);
}
label {
  display: block;
  font-size: 12px;
  font-weight: 550;
  margin: 17px 0 7px;
}
label .muted {
  font-weight: 400;
  margin-left: 4px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
input:focus,
textarea:focus {
  border-color: var(--accent);
}
::selection {
  background: var(--accent-tint);
}
button {
  border: 0;
  background: none;
}
button,
.button {
  transition:
    background 0.16s,
    border-color 0.16s,
    box-shadow 0.16s,
    transform 0.16s;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 37px;
  padding: 9px 15px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
  line-height: 1.3;
  border: 1px solid transparent;
}
.primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
  box-shadow: 0 2px 3px #45345b0c;
}
.primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.secondary {
  background: var(--white);
  border-color: var(--line);
}
.secondary:hover:not(:disabled) {
  background: var(--hover);
  border-color: var(--hover-line);
}
.subtle:hover:not(:disabled) {
  background: var(--accent-tint);
}
.danger {
  background: #9a4242;
  color: white;
  border-color: #9a4242;
}
.danger:hover:not(:disabled) {
  background: #803535;
}
.danger-text {
  color: var(--danger);
}
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.full {
  width: 100%;
  justify-content: space-between;
}
.small-button {
  padding: 7px 12px;
  min-height: 31px;
}
.theme-toggle > span {
  display: inline-flex;
}
.theme-toggle[aria-checked="false"] .theme-icon-moon,
.theme-toggle[aria-checked="true"] .theme-icon-sun {
  display: none;
}
.theme-switch {
  width: 28px;
  height: 16px;
  margin-left: auto;
  padding: 2px;
  border-radius: 10px;
  background: var(--muted);
}
.theme-switch::after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--white);
}
.theme-toggle[aria-checked="true"] .theme-switch {
  background: var(--accent);
  justify-content: flex-end;
}
.ui-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  vertical-align: middle;
}
.icon-button .ui-icon,
.thread-icon .ui-icon {
  width: 18px;
  height: 18px;
}
.icon-button,
.thread-icon {
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: var(--icon-button-size, 36px);
  height: var(--icon-button-size, 36px);
  min-height: var(--icon-button-size, 36px);
  padding: 0;
}
.icon-button:where(:not(.primary):not(.danger-text)),
.thread-icon {
  color: var(--muted);
}
.icon-button:where(:not(.primary):not(.danger-text)):hover:not(:disabled) {
  background: var(--accent-tint);
  color: var(--accent);
}
.icon-button.danger-text:hover:not(:disabled),
.icon-button.thread-delete:hover:not(:disabled) {
  color: var(--danger);
  background: var(--danger-bg);
}
.muted {
  color: var(--muted);
}
.eyebrow {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.7px;
  color: var(--accent);
  margin-bottom: 13px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.wordmark {
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -1px;
}
.brand-dot {
  color: var(--accent);
  display: none;
}
.artiflect-mark {
  display: inline-block;
  position: relative;
  color: var(--ink);
  width: 25px;
  height: 25px;
}
.artiflect-mark:before,
.artiflect-mark:after {
  content: "";
  position: absolute;
  width: 11px;
  height: 11px;
  border: 2px solid currentColor;
}
.artiflect-mark:before {
  left: 0;
  top: 0;
  border-right: 0;
  border-bottom: 0;
}
.artiflect-mark:after {
  right: 0;
  bottom: 0;
  border-left: 0;
  border-top: 0;
}
.tiny {
  width: 17px;
  height: 17px;
}
.tiny:before,
.tiny:after {
  width: 7px;
  height: 7px;
  border-width: 1.5px;
}
.mini-mark {
  color: var(--accent);
  font-size: 23px;
}
.avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: var(--accent-tint);
  color: var(--quote-ink);
  font-size: 11px;
  border: 2px solid var(--white);
  border-radius: 50%;
  font-weight: 500;
}
.avatar.small {
  width: 25px;
  height: 25px;
  font-size: 9px;
  border-width: 1px;
}
.avatar.tiny-avatar {
  width: 20px;
  height: 20px;
  font-size: 8px;
}
.pill,
.version-mini {
  font-size: 10px;
  line-height: 1.5;
  background: var(--accent-tint);
  color: var(--quote-ink);
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
}
.status-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--success);
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.sr-only {
  position: absolute !important;
  clip: rect(0, 0, 0, 0);
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
}
.skip-link {
  position: fixed;
  top: -60px;
  left: 12px;
  padding: 10px;
  background: var(--white);
  z-index: 100;
}
.skip-link:focus {
  top: 12px;
}
[hidden] {
  display: none !important;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: var(--toast-bg);
  color: var(--toast-ink);
  border-radius: 7px;
  padding: 13px 18px;
  box-shadow: 0 7px 30px #30273c22;
  font-size: 12px;
  max-width: calc(100vw - 30px);
}
.error-toast {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
  display: flex;
  gap: 20px;
  align-items: center;
}
.toast button {
  color: inherit;
  font-size: 20px;
}
.inline-error {
  padding: 13px 15px;
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
  border-radius: 6px;
  font-size: 12px;
  margin: 12px 0;
  overflow-wrap: anywhere;
}
.library-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 20px;
  color: var(--accent);
  font-size: 12px;
  margin-bottom: 10px;
}
.library-loading-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: library-loading-spin 0.8s linear infinite;
}
@keyframes library-loading-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .library-loading-spinner { animation: none; }
}
.empty-state {
  grid-column: 1/-1;
  min-height: 310px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: var(--white);
  border: 1px dashed var(--line);
  border-radius: 9px;
  text-align: center;
}
.empty-symbol {
  display: inline-flex;
  color: var(--muted);
  margin-bottom: 20px;
}
.empty-symbol .ui-icon {
  width: 20px;
  height: 20px;
}
.empty-state h3 {
  margin-bottom: 10px;
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 600;
}
.empty-state p {
  font-size: 13px;
  color: var(--muted);
}
.library-notices {
  margin: 0 0 24px;
  padding: 14px 20px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent-tint);
  font-size: 13px;
}
.library-notices li + li {
  margin-top: 4px;
}
.library-onboarding,
.library-search-empty {
  min-height: 0;
  padding: 32px;
  border-style: solid;
}
.library-onboarding h2,
.library-search-empty h2 {
  margin-bottom: 10px;
  font-size: 24px;
}
.library-onboarding > p,
.library-search-empty > p {
  max-width: 510px;
  font-size: 14px;
}
.library-onboarding .empty-symbol {
  color: var(--accent);
  padding: 12px;
  margin-bottom: 16px;
  background: var(--accent-tint);
  border-radius: 12px;
}
.library-onboarding .library-privacy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 12px;
}
.library-empty-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.library-workflow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  width: 100%;
  margin: 30px 0 0;
  padding: 24px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
  counter-reset: workflow;
  text-align: left;
}
.library-workflow li {
  counter-increment: workflow;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 4px 10px;
}
.library-workflow li::before {
  content: counter(workflow);
  grid-row: span 2;
  display: grid;
  place-items: center;
  align-self: start;
  height: 28px;
  background: var(--accent-tint);
  color: var(--accent);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
}
.library-workflow strong {
  font-weight: 600;
}
.library-workflow span {
  grid-column: 2;
  color: var(--muted);
  font-size: 13px;
}
.library-search-empty .button {
  margin-top: 20px;
}
.app-header {
  position: relative;
  flex-shrink: 0;
  min-height: 52px;
  padding: 4px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.app-version {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.app-version:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.user-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.library-main {
  max-width: 1240px;
  margin: auto;
  padding: 43px 28px 40px;
}
.library-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}
.library-heading h1 {
  font: 620 27px/1.3 var(--sans);
  letter-spacing: -0.8px;
}
.library-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}
.search {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 0 11px;
  width: 230px;
  height: 38px;
  color: var(--muted);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-weight: 400;
}
.search input {
  min-width: 0;
  padding: 8px 0;
  border: 0;
  background: transparent;
  font-size: 13px;
}
.search input:focus {
  outline: none;
}
.search:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.artifact-grid > .artifact-count,
.artifact-grid > nav {
  grid-column: 1 / -1;
}
.artifact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px 26px;
}
.artifact-card {
  display: block;
  min-width: 0;
  border-radius: 9px;
}
.card-preview {
  container-type: inline-size;
  position: relative;
  aspect-ratio: 1.46;
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow:
    0 3px 8px #252b3305,
    0 15px 35px #252b3306;
  transition:
    box-shadow 0.2s,
    transform 0.2s,
    border-color 0.2s;
}
.artifact-card:hover .card-preview {
  transform: translateY(-2px);
  border-color: var(--hover-line);
  box-shadow:
    0 4px 10px #252b3308,
    0 13px 32px #252b3312;
}
/* The iframe element's color-scheme controls embedded prefers-color-scheme, too. */
.artifact-thumbnail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: white;
  color-scheme: light;
  transform-origin: top left;
  pointer-events: none;
}
/* Modern browsers keep the upload's desktop viewport. Older browsers get a
   card-sized responsive document rather than a cropped, unscaled desktop one. */
@supports (container-type: inline-size) and (transform: scale(calc(100cqw / 800px))) {
  .artifact-thumbnail {
    width: 800px;
    height: 550px;
    transform: scale(calc(100cqw / 800px));
  }
}
.card-body {
  padding: 14px 2px 0;
}
.card-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  justify-content: space-between;
}
.card-title h3 {
  font-size: 15px;
  line-height: 1.4;
  font-weight: 580;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-body > p {
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  font-size: 12px;
  color: var(--muted);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
  padding: 28px 30px;
  box-shadow: 0 30px 120px #2d253c35;
  max-height: 90vh;
  overflow: auto;
}
dialog::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(3px);
}
dialog header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
dialog h2 {
  font: 600 20px/1.3 var(--sans);
  letter-spacing: -0.4px;
}
dialog header .eyebrow {
  margin-bottom: 8px;
}
dialog > p {
  font-size: 12px;
  margin: 13px 0 15px;
}
dialog footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
}
.save-dialog.share-dialog {
  width: min(650px, calc(100vw - 32px));
}
.shortcut-dialog {
  width: min(380px, calc(100vw - 32px));
}
.shortcut-list {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}
.shortcut-list li {
  align-items: center;
  display: flex;
  gap: 12px;
}
.shortcut-list kbd,
.shortcut-keys kbd {
  background: var(--accent-tint);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 11px;
  min-width: 58px;
  padding: 3px 6px;
  text-align: center;
}
.shortcut-keys {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.shortcut-keys kbd {
  min-width: 20px;
  padding: 1px 4px;
  font-family: inherit;
  line-height: 1.4;
}
.share-link,
.access-fields,
.access-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.share-link input,
.access-name,
.access-principal {
  flex: 1;
  min-width: 0;
}
.share-link {
  margin: 20px 0;
}
.access-list {
  border-block: 1px solid var(--line);
  margin: 20px 0;
}
.access-row {
  padding: 14px 0;
  justify-content: space-between;
}
.access-row + .access-row {
  border-top: 1px solid var(--line);
}
.access-row small {
  display: block;
  color: var(--muted);
}
.access-row select {
  width: 140px;
}
.access-form .access-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  align-items: start;
}
.access-fields label {
  margin: 0 0 7px;
}
.access-fields input,
.access-fields select {
  width: 100%;
  height: 44px;
}
.share-link .icon-button {
  align-self: center;
}
.access-form > .button {
  margin-top: 16px;
}
.access-row > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  .access-form .access-fields {
    grid-template-columns: 1fr;
  }
}
.create-dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow: hidden;
}
.create-dialog[open] {
  display: flex;
  flex-direction: column;
}
.create-dialog > header {
  flex-shrink: 0;
  padding: 20px 24px 16px;
}
.create-dialog > form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.create-dialog-body {
  min-height: 0;
  padding: 0 24px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.create-intro {
  color: var(--muted);
  font-size: 13px;
}
.create-dialog label {
  margin-top: 14px;
}
.create-dialog .field-hint,
.create-dialog .security-note {
  font-size: 12px;
  line-height: 1.5;
}
.create-dialog .file-input {
  font-size: 13px;
}
.create-dialog .code-input {
  font-size: 12px;
}
.create-source {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.create-source summary {
  width: fit-content;
  color: var(--accent);
  font-weight: 550;
  cursor: pointer;
}
.create-source summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.create-dialog footer {
  flex-shrink: 0;
  flex-wrap: wrap;
  margin: 0;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: var(--white);
}
.create-dialog footer .inline-error {
  flex-basis: 100%;
  margin: 0;
}
.save-dialog {
  width: 470px;
}
.code-input {
  font:
    11px/1.6 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  background: var(--code);
}
.file-input {
  padding: 8px;
  font-size: 11px;
  border-style: dashed;
}
.file-input::file-selector-button {
  background: var(--accent-tint);
  border: 0;
  color: var(--accent);
  padding: 6px 11px;
  border-radius: 4px;
  margin-right: 10px;
  cursor: pointer;
  font: inherit;
}
.field-hint {
  font-size: 9px;
  color: var(--muted);
  margin-top: 7px;
}
.security-note {
  font-size: 9px;
  color: var(--muted);
  margin-top: 11px;
}
.save-dialog label {
  margin-top: 22px;
}
.login-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
.login-story {
  padding: 42px 56px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #f0eee7;
  position: relative;
  overflow: hidden;
}
.story-copy {
  margin: auto 0;
  padding: 60px 0;
  max-width: 475px;
}
.story-copy h1 {
  font-size: 51px;
  letter-spacing: -1.8px;
  line-height: 1.12;
}
.story-copy > p:not(.eyebrow) {
  font-size: 13px;
  line-height: 1.9;
  color: #938b95;
  max-width: 330px;
  margin-top: 23px;
}
.story-note {
  margin: 60px 0 0 40px;
  border: 1px solid #d6cddc;
  background: #f4f1f6;
  width: 260px;
  padding: 25px 30px 30px;
  position: relative;
  transform: rotate(-4deg);
  box-shadow: 6px 6px 0 #e4dfdf;
}
.story-note:before {
  content: "";
  position: absolute;
  right: -5px;
  top: -5px;
  width: 18px;
  height: 18px;
  border-top: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
}
.note-mark {
  color: #afa1bf;
  font: 45px/1 var(--serif);
}
.story-note p {
  font: 27px/1.18 var(--serif);
  color: #766285;
  letter-spacing: -0.4px;
}
.note-line {
  display: block;
  width: 43px;
  height: 1px;
  background: #c4b7d0;
  margin-top: 21px;
}
.login-story footer {
  font-size: 8px;
  letter-spacing: 1.6px;
  color: #a69caa;
}
.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 70px 45px;
}
.login-card {
  width: 335px;
}
.login-card h2 {
  font: 32px/1.2 var(--serif);
  letter-spacing: -1px;
}
.login-card > .muted {
  font-size: 12px;
  margin: 12px 0 33px;
}
.login-card input {
  font-size: 13px;
  padding: 12px;
}
.login-card .primary {
  margin-top: 26px;
  padding: 13px 15px;
}
.login-help {
  font-size: 10px;
  color: #aaa3ad;
  margin-top: 26px;
  text-align: center;
}
.login-bottom {
  position: absolute;
  bottom: 42px;
  font-size: 10px;
  color: #b5acb9;
}
.changelog-page {
  max-width: 800px;
  margin: auto;
  padding: clamp(28px, 5vw, 48px) 20px;
  font-size: 15px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.changelog-page h1 {
  margin-bottom: 24px;
}
.changelog-page h2 {
  margin: 36px 0 16px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 22px;
}
.changelog-page h3 {
  margin: 20px 0 8px;
  font-weight: 600;
}
.changelog-page p,
.changelog-page ul,
.changelog-page ol {
  margin: 12px 0;
}
.changelog-page ul,
.changelog-page ol {
  padding-left: 24px;
}
.changelog-page li + li {
  margin-top: 8px;
}
.changelog-page a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.changelog-page a:hover {
  color: var(--accent-hover);
}
.changelog-page code {
  background: var(--code);
  border-radius: 3px;
  padding: 2px 4px;
}
.changelog-page pre {
  overflow-x: auto;
  padding: 16px;
  background: var(--code);
}
.error-page {
  max-width: 700px;
  padding: 70px 40px;
  margin: auto;
}
.error-page p {
  margin: 25px 0;
  color: var(--muted);
}
.artifact-shell {
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
.review-app {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.review-app > header,
.review-app > .notice-banner {
  flex-shrink: 0;
}
.review-header {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 6px 20px;
  gap: 4px 12px;
  background: var(--header);
  flex-wrap: wrap;
}
.artifact-heading {
  display: flex;
  flex: 1 1 260px;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  min-width: min(100%, 260px);
}
.review-header h1 {
  min-width: 0;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 600 14px/1.4 var(--sans);
  max-width: 280px;
}
.version-badge {
  color: var(--accent);
  background: var(--accent-tint);
  border: 1px solid var(--accent-border);
  border-radius: 4px;
  padding: 3px 7px;
  white-space: nowrap;
  font-size: 11px;
}
.header-actions {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  max-width: 100%;
  gap: 6px;
  align-items: center;
}
.header-actions .button,
.toolbar-right .button {
  min-height: 32px;
  padding: 6px 9px;
  gap: 6px;
  font-size: 12px;
}
#artifact-actions-button {
  anchor-name: --artifact-actions;
}
.artifact-actions-popover {
  position: fixed;
  position-anchor: --artifact-actions;
  inset: auto;
  position-area: bottom span-left;
  justify-self: end;
  position-try-fallbacks: flip-block, flip-inline;
  width: 208px;
  max-width: calc(100vw - 16px);
  max-height: calc(100dvh - 16px);
  overflow-y: auto;
  margin: 4px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 8px 28px #00000018;
}
.artifact-actions-popover .button {
  width: 100%;
  justify-content: flex-start;
  border: 0;
  min-height: 36px;
}
.artifact-actions-popover hr {
  margin: 4px;
  border: 0;
  border-top: 1px solid var(--line);
}
.artifact-actions-popover .danger-text:hover:not(:disabled) {
  background: var(--danger-bg);
}
.saved-status {
  color: var(--muted);
  white-space: nowrap;
  margin-right: 4px;
  font-size: 11px;
}
.saved-status.unsaved {
  color: var(--warning);
}
.review-controls {
  display: contents;
}
.mode-switch {
  display: inline-flex;
  flex-shrink: 0;
  border-radius: 6px;
  border: 0;
  background: transparent;
  padding: 0;
  gap: 3px;
}
.mode-switch button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted);
  border-radius: 4px;
  white-space: nowrap;
  font-size: 12px;
  min-height: 32px;
  padding: 6px 9px;
}
.mode-switch button.selected {
  color: var(--accent);
  background: var(--accent-tint);
  box-shadow: none;
}
.toolbar-hint {
  order: 1;
  flex: 1 0 100%;
  min-width: 0;
  font-size: 11px;
  color: var(--muted);
}
.toolbar-right {
  flex-shrink: 0;
  flex-wrap: wrap;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
}
#comment-mode.selected {
  color: var(--accent);
  background: var(--accent-tint);
}
.notice-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 11px 20px;
  border-bottom: 1px solid var(--accent-border);
  background: var(--accent-tint);
  font-size: 11px;
  color: var(--quote-ink);
}
.notice-banner .button {
  font-size: 10px;
  min-height: 28px;
  padding: 6px 9px;
}
.history-banner {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: var(--warning-border);
}
.review-main {
  --review-rail-default: 330px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10px min(var(--review-rail-width, var(--review-rail-default)), max(0px, calc(100% - 370px)));
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.review-main.review-sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr) 44px;
}
.review-sidebar-reopen {
  align-self: start;
  justify-self: center;
  margin-top: 10px;
}
.review-sidebar-resizer {
  cursor: ew-resize;
  touch-action: none;
  background: var(--canvas);
  display: flex;
  align-items: center;
  justify-content: center;
}
.review-sidebar-resizer::before {
  content: "";
  width: 2px;
  height: 36px;
  border-radius: 2px;
  background: var(--muted);
}
.review-sidebar-resizer:hover::before,
.review-sidebar-resizer:focus-visible::before {
  background: var(--accent);
}
.review-sidebar-resizer:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
body:has(.review-sidebar-resizing),
body:has(.review-sidebar-resizing) * {
  cursor: ew-resize !important;
  user-select: none !important;
}
/* Pointer capture alone does not reliably prevent iframe interception. */
.review-sidebar-resizing iframe {
  pointer-events: none;
}
.canvas-area {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 22px 28px 12px;
  background: var(--canvas);
}
.element-picker {
  position: absolute;
  z-index: 4;
  bottom: 8px;
  left: 8px;
  max-width: calc(100% - 16px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
  box-shadow: 0 5px 18px #45345b35;
  font-size: 11px;
  color: var(--muted);
}
.element-picker:not(:has(button)) {
  display: none;
}
.element-picker > span {
  flex-shrink: 0;
}
.element-picker > div {
  display: flex;
  min-width: 0;
  gap: 4px;
  overflow-x: auto;
}
.element-picker button {
  min-height: 28px;
  flex-shrink: 0;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 4px 7px;
  border: 1px solid var(--accent-border);
  border-radius: 4px;
  background: var(--accent-tint);
  color: var(--quote-ink);
  cursor: pointer;
}
.element-picker button:hover:not(:disabled) {
  background: var(--white);
  border-color: var(--accent);
}
.canvas-frame {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  margin: 0 auto;
  background: white;
  border: 1px solid var(--line);
  overflow: hidden;
  border-radius: 2px;
  box-shadow:
    0 2px 5px #29303905,
    0 18px 40px #2930390a;
}
.inline-comments {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.inline-comment-pin {
  position: absolute;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid var(--white);
  border-radius: 50% 50% 50% 3px;
  background: var(--quote-ink);
  color: var(--white);
  box-shadow: 0 2px 8px #30253d40;
  font: 600 11px/1 var(--sans);
  pointer-events: auto;
  cursor: pointer;
}
.inline-comment-pin:hover,
.inline-comment-pin[aria-expanded="true"] {
  transform: scale(1.1);
}
.inline-thread-preview {
  position: absolute;
  z-index: 1;
  width: min(280px, calc(100% - 8px));
  max-height: calc(100% - 8px);
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--accent-border);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 8px 28px #45345b30;
  pointer-events: auto;
}
.inline-thread-preview header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}
.inline-thread-body {
  max-height: 180px;
  overflow: auto;
  margin: 10px 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.5;
}
.inline-thread-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--quote-ink);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.inline-thread-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.selection-toolbar {
  position: absolute;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  max-width: calc(100% - 16px);
  padding: 3px;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 5px 18px #45345b35;
}
.selection-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 32px;
  padding: 5px 9px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
}
.selection-toolbar button:hover:not(:disabled) {
  background: var(--accent-tint);
}
.selection-toolbar button:focus-visible {
  outline-offset: -2px;
}
.comment-popover {
  position: absolute;
  z-index: 5;
  width: min(310px, calc(100% - 16px));
  padding: 12px;
  border: 1px solid var(--accent-border);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 8px 28px #45345b30;
}
.comment-popover-heading,
.comment-popover-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.comment-popover-heading {
  color: var(--quote-ink);
  font-size: 10px;
}
.comment-popover-heading .icon-button {
  margin-left: auto;
}
.comment-popover blockquote {
  margin: 9px 0;
  padding: 7px 9px;
  max-height: 70px;
  overflow: auto;
  border-left: 2px solid var(--accent-border);
  background: var(--accent-tint);
  color: var(--quote-ink);
  font: 11px/1.45 var(--serif);
  overflow-wrap: anywhere;
}
.comment-popover textarea {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  font-size: 11px;
  padding: 8px;
  background: var(--white);
  color: var(--ink);
}
.comment-popover-actions {
  justify-content: flex-end;
  margin-top: 8px;
}
.canvas-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: white;
  color-scheme: light;
  display: block;
}
.canvas-frame.show-source iframe {
  visibility: hidden;
}
.canvas-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  padding-top: 10px;
}
.source-panel {
  position: absolute;
  inset: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--code);
}
.source-panel textarea {
  min-height: 0;
  flex: 1;
  resize: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 24px;
  font:
    12px/1.8 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  color: var(--ink);
  white-space: pre;
  tab-size: 2;
  overflow: auto;
}
.source-panel p {
  font-size: 9px;
  color: var(--muted);
  padding: 11px 20px;
  border-top: 1px solid var(--line);
}
.review-rail {
  min-width: 0;
  border-left: 1px solid var(--line);
  background: var(--white);
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.rail-tabs,
#artifact-presence,
.rail-heading {
  flex-shrink: 0;
}
#review-comments-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.review-history-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 25px;
}
.rail-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--white);
  display: flex;
  border-bottom: 1px solid var(--line);
  height: 53px;
  padding: 0 20px;
  gap: 24px;
}
.rail-tabs button:not(.icon-button) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  position: relative;
  padding: 15px 0;
  font-size: 13px;
}
.rail-tabs .review-sidebar-toggle {
  flex-shrink: 0;
  align-self: center;
  margin-left: auto;
  padding: 0;
}
.rail-tabs button.active {
  color: var(--accent);
  font-weight: 550;
}
.rail-tabs button.active:after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
}
.artifact-presence {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--accent-tint);
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.presence-entry + .presence-entry {
  margin-top: 8px;
}
.presence-name {
  color: var(--ink);
  font-weight: 600;
}
.presence-owner {
  display: block;
  font-size: 11px;
}
.thread-presence {
  margin: 0.5rem 0;
  font-size: 0.75rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.presence-open-thread {
  margin-inline-start: 0.5rem;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
  background: transparent;
  border: 0;
}
.rail-heading {
  display: flex;
  justify-content: space-between;
  gap: 9px;
  padding: 16px 18px;
  align-items: center;
}
.rail-heading label {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.rail-heading h2 {
  letter-spacing: -0.4px;
  font-family: var(--sans);
  font-size: 16px;
}
.rail-heading select {
  color: var(--muted);
  background: var(--code);
  font-size: 12px;
  max-width: 110px;
  padding: 5px 8px;
}
.comment-threads {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 18px;
}
.comment-thread {
  border: 1px solid var(--line);
  border-radius: 7px;
  margin-bottom: 12px;
  background: var(--white);
  padding: 15px 13px;
}
.comment-thread > header {
  display: flex;
  align-items: center;
  gap: 7px;
}
.thread-author {
  flex: 1;
  min-width: 0;
}
.comment-thread > header strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 600;
}
.thread-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.comment-thread time {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  color: var(--muted);
}
.comment-thread > header .version-mini {
  font-size: 8px;
  padding: 2px 4px;
}
.thread-quote {
  display: block;
  background: var(--quote-bg);
  border-left: 2px solid var(--accent-border);
  text-align: left;
  padding: 8px 10px;
  width: 100%;
  margin: 13px 0 9px;
  overflow-wrap: anywhere;
  border-radius: 0 3px 3px 0;
  font-size: 12px;
  color: var(--quote-ink);
  font: 12px/1.6 var(--sans);
}
.thread-quote:hover {
  background: var(--accent-tint);
  color: var(--accent);
}
.comment-body {
  min-width: 0;
  max-width: 100%;
  margin: 10px 0 7px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.7;
}
.comment-body > :first-child {
  margin-top: 0;
}
.comment-body > :last-child {
  margin-bottom: 0;
}
.comment-body p,
.comment-body ul,
.comment-body ol,
.comment-body blockquote,
.comment-body pre {
  margin: 0.6em 0;
}
.comment-body ul,
.comment-body ol {
  padding-left: 1.5em;
}
.comment-body blockquote {
  border-left: 2px solid var(--accent-border);
  padding-left: 0.8em;
  color: var(--muted);
}
.comment-body h1,
.comment-body h2,
.comment-body h3,
.comment-body h4,
.comment-body h5,
.comment-body h6 {
  margin: 0.8em 0 0.4em;
  font: 600 1em/1.5 var(--sans);
  letter-spacing: normal;
}
.comment-body code {
  border-radius: 3px;
  background: var(--code);
  padding: 0.1em 0.25em;
  font-size: 0.9em;
}
.comment-body pre {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre;
  overflow-wrap: normal;
  border-radius: 4px;
  background: var(--code);
  padding: 8px;
}
.comment-body pre code {
  padding: 0;
}
.thread-actions {
  display: flex;
  flex-shrink: 0;
  gap: 2px;
  margin-left: auto;
}
.resolved .thread-status {
  color: var(--success);
  background: var(--success-bg);
}
.thread-reply {
  border-left: 1px solid var(--line);
  padding: 8px 0 0 10px;
  margin: 0 0 9px 12px;
}
.thread-reply header {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}
.thread-reply header strong {
  min-width: 0;
  overflow-wrap: anywhere;
}
.thread-reply time {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 10px;
}
.thread-reply .comment-body {
  margin: 5px 0;
  font-size: 12px;
}
.reply-form {
  display: flex;
  align-items: center;
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 8px;
  gap: 4px;
}
.reply-input {
  flex: 1;
  resize: vertical;
  border: 0;
  background: transparent;
  min-width: 0;
  font-size: 12px;
  padding: 7px 2px;
}
.reply-input::placeholder {
  color: var(--placeholder);
}
.comments-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 0 30px;
  color: var(--muted);
}
.comments-empty .empty-symbol {
  color: var(--muted);
  margin-bottom: 16px;
}
.comments-empty h3 {
  letter-spacing: -0.2px;
  color: var(--ink);
  font: 600 16px var(--sans);
}
.comments-empty p {
  line-height: 1.9;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
}
.comment-compose {
  flex-shrink: 0;
  max-height: 60%;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-top: 1px solid var(--line);
  padding: 12px 18px 14px;
}
.compose-heading {
  display: none;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 12px;
}
.compose-heading strong {
  font-weight: 500;
}
.compose-heading > span:last-child {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}
.comment-compose textarea {
  margin-top: 11px;
  padding: 10px;
  background: var(--white);
  min-height: 87px;
  resize: vertical;
  border-color: var(--line);
  font-size: 13px;
}
.comment-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
}
.comment-input:focus-within {
  border-color: var(--accent);
}
.comment-input:has(textarea:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.comment-input textarea {
  display: block;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  resize: none;
  margin: 0;
  border: 0;
  background: transparent;
}
.comment-input textarea:focus-visible {
  outline: none;
}
.composer-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}
.composer-shortcuts > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.compose-footer {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
}
.compose-footer > button {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 5px;
}
/* A retained quote can outlive Feedback picking; expand without moving or replacing inputs. */
.comment-compose:not(:focus-within):not([data-expanded="true"]):not(:has(.quote-preview:not([hidden]))) .composer-shortcuts {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.comment-compose:is(:focus-within, [data-expanded="true"], :has(.quote-preview:not([hidden]))) .compose-heading {
  display: flex;
}
.comment-compose:is(:focus-within, [data-expanded="true"], :has(.quote-preview:not([hidden]))) .comment-input {
  margin-top: 11px;
  grid-template-columns: minmax(0, 1fr);
}
.comment-compose:is(:focus-within, [data-expanded="true"], :has(.quote-preview:not([hidden]))) .comment-input textarea {
  height: 96px;
  min-height: 64px;
  max-height: none;
  resize: vertical;
}
.compose-help {
  margin-top: 10px;
  line-height: 1.5;
  color: var(--muted);
  font-size: 11px;
}
.quote-preview {
  margin-top: 9px;
  background: var(--accent-tint);
  display: flex;
  align-items: flex-start;
  padding: 8px 5px 8px 10px;
  border-radius: 4px;
  border-left: 2px solid var(--accent-border);
  gap: 7px;
}
.quote-preview blockquote {
  margin: 0;
  flex: 1;
  font: 11px/1.5 var(--serif);
  color: var(--quote-ink);
  max-height: 65px;
  overflow: auto;
  overflow-wrap: anywhere;
}
.version-history {
  padding: 16px 19px;
}
.history-item {
  display: flex;
  position: relative;
  text-align: left;
  gap: 13px;
  width: 100%;
  padding: 13px 4px 20px;
}
.history-item:before {
  content: "";
  position: absolute;
  left: 9px;
  top: 22px;
  bottom: -14px;
  width: 1px;
  background: var(--line);
}
.history-item:last-child:before {
  display: none;
}
.history-node {
  width: 11px;
  height: 11px;
  border: 1px solid var(--accent-border);
  background: var(--accent-tint);
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.history-content {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.history-title {
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.history-title .pill {
  font-size: 10px;
}
.history-content strong {
  color: var(--ink);
  font-weight: 400;
  font-size: 13px;
}
.history-meta {
  color: var(--muted);
  font-size: 11px;
}
.history-arrow {
  color: var(--muted);
  margin-left: auto;
}
.history-item:hover:not(:disabled) .history-content strong,
.history-item:hover:not(:disabled) .history-title {
  color: var(--accent);
}
.header-byline {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
/* One account panel, anchored on desktop and content-height on mobile. */
.navigation-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 40px;
  max-width: min(320px, 60vw);
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 13px;
}
.navigation-trigger:hover,
.navigation-trigger[aria-expanded="true"] {
  background: var(--accent-tint);
}
.navigation-trigger > .ui-icon {
  width: 14px;
  height: 14px;
  color: var(--muted);
}
.navigation-trigger .avatar,
.navigation-identity .avatar {
  flex-shrink: 0;
}
.navigation-drawer {
  position: absolute;
  inset: calc(100% + 8px) 24px auto auto;
  z-index: 20;
  width: 288px;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 80px);
  height: auto;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 8px 28px #00000018;
}
.navigation-drawer .navigation-heading {
  align-items: center;
  gap: 8px;
  padding: 8px 4px 12px 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.navigation-heading h2 {
  font: 600 14px/1.4 var(--sans);
  letter-spacing: 0;
}
.navigation-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.navigation-identity-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.navigation-identity .user-name {
  font-size: 13px;
  font-weight: 550;
}
.user-email {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.navigation-heading .icon-button {
  margin-left: auto;
}
.app-header-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.navigation-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font: 400 13px/1.4 var(--sans);
  text-align: left;
}
.navigation-row .ui-icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
}
.navigation-row:hover {
  background: var(--hover);
}
.navigation-footer {
  margin-top: 6px;
  padding: 8px 10px 4px;
  border-top: 1px solid var(--line);
}
html:has(#navigation-drawer:modal),
html:has(#navigation-drawer:modal) body {
  overflow: hidden;
}
@media (max-width: 800px) {
  :root {
    --icon-button-size: 44px;
  }
  .navigation-trigger {
    min-height: 44px;
  }
  .navigation-drawer:modal {
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    max-width: none;
    height: auto;
    max-height: calc(100dvh - 24px);
    margin: 0;
    padding: 12px 16px max(16px, env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 32px #00000018;
    animation: navigation-enter 160ms ease-out;
  }
  .navigation-drawer::backdrop {
    background: var(--backdrop);
    backdrop-filter: none;
  }
  .navigation-identity .user-name,
  .navigation-row {
    font-size: 14px;
  }
  .app-header {
    flex-wrap: nowrap;
  }
  .library-tools .button,
  .library-tools .search {
    min-height: 44px;
  }
  .review-header {
    padding: 4px 12px;
  }
  .review-header .header-actions .button,
  .review-controls .mode-switch button,
  .review-controls .toolbar-right .button {
    min-height: 44px;
  }
  .review-controls .mode-switch {
    flex: 1;
    justify-content: space-between;
  }
  .review-controls .mode-switch button {
    padding-inline: 6px;
  }
  .compose-footer > button {
    width: 44px;
    height: 44px;
    min-height: 44px;
  }
  .review-controls .toolbar-right {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
  }
  .save-version-label {
    display: none;
  }
}
@keyframes navigation-enter {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@media (max-width: 1150px) {
  .toolbar-hint {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .review-header h1 {
    max-width: 230px;
  }
  .header-actions {
    gap: 5px;
  }
  .review-main {
    --review-rail-default: 305px;
  }
  .canvas-area {
    padding: 20px 18px 12px;
  }
  .login-story {
    padding: 35px;
  }
  .story-copy h1 {
    font-size: 43px;
  }
}
@media (max-width: 900px) {
  .artifact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .library-heading {
    flex-wrap: wrap;
  }
  .library-tools {
    margin-left: auto;
  }
}
@media (max-width: 800px) {
  .artifact-shell {
    height: auto;
    min-height: 100dvh;
  }
  .review-app {
    overflow: visible;
  }
  .review-main,
  .review-main.review-sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
  }
  .review-sidebar-reopen {
    justify-self: end;
    margin: 0 18px 10px;
  }
  .review-sidebar-resizer {
    display: none;
  }
  .canvas-area {
    padding: 18px;
  }
  .canvas-frame {
    flex: none;
    height: 65dvh;
    min-height: 300px;
  }
  .review-rail {
    height: min(800px, 100dvh);
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .comment-threads {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
    align-content: start;
  }
  .comment-thread {
    margin-bottom: 0;
  }
  .comments-empty {
    grid-column: 1/-1;
  }
  .comment-compose {
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
    padding: 18px;
  }
  .version-history {
    max-width: 650px;
    margin: auto;
  }
  .login-story {
    padding: 28px;
  }
  .story-copy h1 {
    font-size: 37px;
  }
  .story-note {
    margin-left: 5px;
    width: 230px;
  }
  .login-panel {
    padding: 45px 28px;
  }
  .login-card h2 {
    font-size: 28px;
  }
}
@media (max-width: 600px) {
  .app-header {
    padding: 4px 16px;
    gap: 14px;
  }
  .library-main {
    padding: 29px 20px 30px;
  }
  .library-heading {
    display: block;
    margin-bottom: 24px;
  }
  .library-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 21px;
    gap: 10px;
  }
  .library-tools .search {
    grid-column: 1/-1;
    grid-row: 1;
    width: 100%;
  }
  .library-onboarding,
  .library-search-empty {
    padding: 26px 20px;
  }
  .library-onboarding h2,
  .library-search-empty h2 {
    font-size: 22px;
  }
  .library-empty-actions {
    width: 100%;
  }
  .library-empty-actions .button {
    width: 100%;
  }
  .library-workflow {
    grid-template-columns: 1fr;
    gap: 18px;
    margin-top: 24px;
  }
  .search {
    flex: 1;
    min-width: 0;
    width: auto;
  }
  .library-tools .button {
    padding: 9px 10px;
  }
  .artifact-grid {
    grid-template-columns: 1fr;
    gap: 27px;
  }
  .card-body {
    padding-top: 12px;
  }
  .artifact-heading {
    flex-basis: 100%;
  }
  .review-header h1 {
    flex: 1;
    max-width: none;
  }
  .header-actions {
    width: 100%;
    margin: 0;
  }
  .canvas-area {
    padding: 13px 10px 12px;
  }
  .canvas-footer {
    font-size: 10px;
  }
  .comment-threads {
    display: block;
    padding: 0 17px;
  }
  .comment-thread {
    margin-bottom: 12px;
  }
  .notice-banner {
    flex-wrap: wrap;
    font-size: 12px;
    text-align: center;
    padding: 10px 12px;
    gap: 8px;
  }
  .source-panel textarea {
    padding: 15px;
  }
  .login-layout {
    grid-template-columns: 1fr;
  }
  .login-story {
    min-height: 145px;
    padding: 25px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .story-copy {
    padding: 24px 0 2px;
  }
  .story-copy .eyebrow,
  .story-copy > p,
  .story-note,
  .login-story footer {
    display: none;
  }
  .story-copy h1 {
    font-size: 29px;
  }
  .story-copy h1 br {
    display: none;
  }
  .login-panel {
    min-height: calc(100vh - 215px);
    padding: 50px 28px 75px;
    align-items: flex-start;
  }
  .login-bottom {
    bottom: 22px;
  }
  .login-card > .muted {
    margin-bottom: 24px;
  }
  .login-card h2 {
    font-size: 30px;
  }
  .save-dialog {
    width: calc(100vw - 24px);
    padding: 23px 20px;
  }
  .create-dialog > header,
  .create-dialog-body,
  .create-dialog footer {
    padding-inline: 18px;
  }
}
@media (max-width: 380px) {
  .app-header {
    padding-inline: 16px;
    gap: 8px;
  }
  .app-header .wordmark {
    font-size: 20px;
  }
  .app-header .brand {
    gap: 6px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Suggestions are feedback, never an editable projection of the artifact. */
.suggestion-compose {
  margin: 10px 0;
}
.suggestion-compose label {
  display: block;
  margin: 10px 0 6px;
  font-weight: 600;
}
.suggestion-compose textarea {
  width: 100%;
  white-space: pre-wrap;
}
.suggestion-compose .muted {
  font-size: 12px;
  margin: 6px 0;
}
.suggestion-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 6px;
}
.thread-quote:has(.suggestion-diff) {
  --suggestion-deleted-bg: #fbe5e5;
  --suggestion-deleted-ink: #832e36;
  --suggestion-inserted-bg: #e0f0e4;
  --suggestion-inserted-ink: #245c38;
  color: var(--ink);
  background: var(--white);
  border-left-color: var(--accent);
}
.thread-quote:has(.suggestion-diff):hover {
  background: var(--accent-tint);
}
.suggestion-diff {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.suggestion-diff del {
  background: var(--suggestion-deleted-bg);
  color: var(--suggestion-deleted-ink);
  text-decoration: line-through;
}
.suggestion-diff ins {
  background: var(--suggestion-inserted-bg);
  color: var(--suggestion-inserted-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
:root[data-theme="night"] .thread-quote:has(.suggestion-diff) {
  --suggestion-deleted-bg: #502b33;
  --suggestion-deleted-ink: #ffd4d9;
  --suggestion-inserted-bg: #234331;
  --suggestion-inserted-ink: #c9efd4;
}
