/* Delve design tokens — source of truth: docs/delve-design-system.html
   (values lifted from ColorConstants.js, themeColors.js, DimensionsConstants.js). */

:root {
  /* ---- Warm neutrals (brand ink) ---- */
  --delve-black: #1A1615;
  --delve-dark-grey: #2E2826;
  --delve-light-grey: #979797;
  --delve-ultra-light-grey: #F0F0F0;
  --delve-white: #FFFFFF;

  /* ---- Cool neutral ramp ---- */
  --gray-50: #FAFAFA;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-900: #111827;

  /* ---- Blue (primary action / links) ---- */
  --blue: #4A90E2;
  --blue-link: #2170C4;
  --blue-light: #D2DFF0;
  --blue-selected-bg: #EBF3FD;
  --blue-selected-text: #2563EB;

  /* ---- Accent & semantic ---- */
  --highlight: #FFE28B;
  --hover-warm: #FFF8E3;
  --error-text: #D0021B;
  --danger-red: #DC2626;

  /* ---- Semantic aliases ---- */
  --text-primary: var(--delve-black);
  --text-body: var(--gray-900);
  --text-muted: var(--gray-500);
  --text-link: var(--blue-link);
  --surface-page: var(--delve-white);
  --surface-sunken: var(--gray-50);
  --surface-hover: var(--gray-50);
  --border-card: #dbdbdb;
  --border-subtle: var(--gray-200);
  --border-strong: var(--gray-300);
  --action-primary: var(--blue);
  --focus-ring: var(--blue);

  /* ---- Typography ---- */
  --font-serif: "Libre Baskerville", Georgia, "Times New Roman", serif;
  /* Bootstrap 3.3.7's exact stack — production renders Helvetica Neue, not
     the -apple-system/SF modern stack; keep parity until a deliberate
     typeface change ships. */
  --font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --font-display: var(--font-serif);
  --font-body: var(--font-sans);
  --text-xs: 10px;
  --text-sm: 12px;
  --text-md: 13px;
  --text-base: 14px;
  --text-lg: 15px;
  --text-xl: 16px;
  --text-2xl: 22px;
  --text-3xl: 30px;
  --text-display: 40px;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --leading-tight: 1.2;
  --leading-snug: 1.4;
  --leading-normal: 1.6;

  /* ---- Spacing ---- */
  --space-1: 2px;
  --space-2: 4px;
  --space-3: 8px;
  --space-4: 12px;
  --space-5: 14px;
  --space-6: 16px;
  --space-7: 20px;
  --space-8: 24px;
  --space-9: 30px;
  --space-10: 40px;

  /* ---- Radii ---- */
  --radius-xs: 3px;
  --radius-sm: 4px;
  --radius-md: 5px;
  --radius-lg: 6px;
  --radius-xl: 8px;
  --radius-pill: 20px;
  --radius-full: 9999px;

  /* ---- Shadows ---- */
  --shadow-card: 0 2px 6px 0 rgba(0, 0, 0, 0.12);
  --shadow-popover: 0 4px 16px rgba(0, 0, 0, 0.14);

  /* ---- Motion ---- */
  --ease-standard: ease-in-out;
  --duration-fast: 0.15s;
  --duration-base: 0.3s;
}

/* Delve UI kit styles — app/javascript/ui/
   Imported once from packs/projects.js. Components reference these classes.
   Metrics intentionally mirror Bootstrap 3.3.7 so migrated screens keep their
   current look; colors come from tokens.css (see docs/delve-design-system.html). */

/* ============ Base (global element styles) ============
   Replaces the Bootstrap 3.3.7 base layer (normalize + core typography) that
   the CDN stylesheet provided before rb-8 removed it. Metrics mirror
   Bootstrap 3.3.7; faces and colors come from tokens.css. Without this,
   text outside .ui-* components falls back to browser defaults (serif,
   16px, purple visited links, black form-control text). */

html {
  /* Bootstrap 3.3.7 set the rem base to 10px. The app's rem values and
     MUI's default (rem-based) theme were authored against that base —
     without this, every rem-sized surface renders 1.6x larger. */
  font-size: 10px;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.42857143;
  color: var(--text-body);
  background-color: var(--surface-page);
}

/* normalize.css (bundled in Bootstrap 3) made form controls inherit font and
   color; sanitize.css v13 does not. Components rely on it — e.g. the sidebar
   project-title <input> inherits white from its wrapper. */
button,
input,
optgroup,
select,
textarea {
  margin: 0;
  font: inherit;
  color: inherit;
}

a {
  color: var(--text-link);
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  font-family: inherit;
  font-weight: 500;
  line-height: 1.1;
  color: inherit;
}

h1, h2, h3 {
  margin-top: 20px;
  margin-bottom: 10px;
}

h4, h5, h6 {
  margin-top: 10px;
  margin-bottom: 10px;
}

h1 { font-size: 36px; }
h2 { font-size: 30px; }
h3 { font-size: 24px; }
h4 { font-size: 18px; }
h5 { font-size: 14px; }
h6 { font-size: 12px; }

p {
  margin: 0 0 10px;
}

label {
  display: inline-block;
  max-width: 100%;
  margin-bottom: 5px;
  font-weight: 700;
}

b,
strong {
  font-weight: bold;
}

small {
  font-size: 85%;
}

ul,
ol {
  margin-top: 0;
  margin-bottom: 10px;
}

ul ul,
ul ol,
ol ul,
ol ol {
  margin-bottom: 0;
}

hr {
  height: 0;
  margin-top: 20px;
  margin-bottom: 20px;
  border: 0;
  border-top: 1px solid #eeeeee;
  box-sizing: content-box;
}

table {
  border-spacing: 0;
  border-collapse: collapse;
}

th {
  text-align: left;
}

input[type="radio"],
input[type="checkbox"] {
  margin: 4px 0 0;
  line-height: normal;
}

[role="button"] {
  cursor: pointer;
}

/* Markdown surfaces (e.g. AI chat) rendered code/blockquote through
   Bootstrap's base styles. */
code,
kbd,
pre,
samp {
  font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
}

code {
  padding: 2px 4px;
  font-size: 90%;
  color: #c7254e;
  background-color: #f9f2f4;
  border-radius: var(--radius-sm);
}

pre {
  display: block;
  padding: 9.5px;
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.42857143;
  word-break: break-all;
  word-wrap: break-word;
  background-color: #f5f5f5;
  border: 1px solid #cccccc;
  border-radius: var(--radius-sm);
}

pre code {
  padding: 0;
  font-size: inherit;
  color: inherit;
  background-color: transparent;
  border-radius: 0;
}

blockquote {
  padding: 10px 20px;
  margin: 0 0 20px;
  border-left: 5px solid #eeeeee;
}

/* ============ Button ============ */

.ui-btn {
  display: inline-block;
  margin-bottom: 0;
  padding: 6px 12px;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: 1.42857143;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  background-image: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: background-color var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard);
}

.ui-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.ui-btn--blue,
.ui-btn--blue:hover,
.ui-btn--blue:focus {
  color: #ffffff;
  background-color: var(--blue);
  border-color: var(--blue);
}

.ui-btn--white,
.ui-btn--white:hover,
.ui-btn--white:focus {
  color: #000000;
  background-color: #ffffff;
  border-color: var(--delve-light-grey);
}

.ui-btn--red,
.ui-btn--red:hover,
.ui-btn--red:focus {
  color: #ffffff;
  background-color: var(--error-text);
  border-color: var(--error-text);
}

/* Stock Bootstrap 3 button colors — used by a few call sites that relied on
   the default theme rather than Delve's registered blue/white/red styles. */
.ui-btn--success,
.ui-btn--success:hover,
.ui-btn--success:focus {
  color: #ffffff;
  background-color: #5cb85c;
  border-color: #4cae4c;
}

.ui-btn--warning,
.ui-btn--warning:hover,
.ui-btn--warning:focus {
  color: #ffffff;
  background-color: #f0ad4e;
  border-color: #eea236;
}

.ui-btn--info,
.ui-btn--info:hover,
.ui-btn--info:focus {
  color: #ffffff;
  background-color: #5bc0de;
  border-color: #46b8da;
}

.ui-btn--danger,
.ui-btn--danger:hover,
.ui-btn--danger:focus {
  color: #ffffff;
  background-color: #d9534f;
  border-color: #d43f3a;
}

.ui-btn--link {
  color: var(--text-link);
  background-color: transparent;
  border-color: transparent;
}

.ui-btn--link:hover,
.ui-btn--link:focus {
  color: var(--blue);
  text-decoration: underline;
}

.ui-btn--lg {
  padding: 10px 16px;
  font-size: 18px;
  border-radius: var(--radius-lg);
}

.ui-btn--sm {
  padding: 5px 10px;
  font-size: var(--text-sm);
  border-radius: var(--radius-xs);
}

.ui-btn--xs {
  padding: 1px 5px;
  font-size: var(--text-sm);
  border-radius: var(--radius-xs);
}

.ui-btn--block {
  display: block;
  width: 100%;
}

.ui-btn.active {
  box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}

.ui-btn[disabled],
.ui-btn--disabled {
  cursor: not-allowed;
  opacity: 0.65;
  box-shadow: none;
  pointer-events: none;
}

a.ui-btn {
  text-decoration: none;
}

.ui-btn-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.ui-btn-group {
  display: inline-flex;
  vertical-align: middle;
}

.ui-btn-group > .ui-btn:not(:first-child) {
  margin-left: -1px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.ui-btn-group > .ui-btn:not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

/* ============ Alert ============ */

.ui-alert {
  padding: 15px;
  margin-bottom: var(--space-7);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  position: relative;
}

.ui-alert--success {
  color: #3c763d;
  background-color: #dff0d8;
  border-color: #d6e9c6;
}

.ui-alert--info {
  color: #31708f;
  background-color: #d9edf7;
  border-color: #bce8f1;
}

.ui-alert--warning {
  color: #8a6d3b;
  background-color: #fcf8e3;
  border-color: #faebcc;
}

.ui-alert--danger {
  color: #a94442;
  background-color: #f2dede;
  border-color: #ebccd1;
}

.ui-alert__dismiss {
  position: absolute;
  top: 10px;
  right: 12px;
  padding: 0;
  font-size: 21px;
  font-weight: var(--weight-bold);
  line-height: 1;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  opacity: 0.4;
}

.ui-alert__dismiss:hover {
  opacity: 0.7;
}

/* ============ Chip (Bootstrap Label) ============ */

.ui-chip {
  /* Bootstrap 3's .label was display:inline — CodePill's inner ellipsis div
     relies on it so its percentage maxWidth resolves against the excerpt row,
     not the shrink-to-fit chip (inline-block truncates every label). */
  display: inline;
  padding: 0.2em 0.6em 0.3em;
  font-size: 75%;
  font-weight: var(--weight-bold);
  line-height: 1;
  color: #ffffff;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25em;
}

.ui-chip--default { background-color: #777777; }
.ui-chip--primary { background-color: var(--blue); }
.ui-chip--success { background-color: #5cb85c; }
.ui-chip--info { background-color: #5bc0de; }
.ui-chip--warning { background-color: #f0ad4e; }
.ui-chip--danger { background-color: #d9534f; }

/* ============ Forms ============ */

.ui-form-group {
  margin-bottom: 15px;
}

.ui-control-label {
  display: inline-block;
  max-width: 100%;
  margin-bottom: 5px;
  font-weight: var(--weight-bold);
  font-size: var(--text-base);
}

.ui-form-control {
  display: block;
  width: 100%;
  height: 34px;
  padding: 6px 12px;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.42857143;
  color: #555555;
  background-color: #ffffff;
  border: 1px solid #cccccc;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  transition: border-color var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-fast) var(--ease-standard);
}

.ui-form-control:focus {
  border-color: var(--focus-ring);
  outline: 0;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px rgba(74, 144, 226, 0.4);
}

.ui-form-control::placeholder {
  color: var(--gray-400);
}

.ui-form-control[disabled] {
  background-color: var(--gray-100);
  cursor: not-allowed;
}

textarea.ui-form-control {
  height: auto;
}

.ui-help-block {
  display: block;
  margin-top: 5px;
  margin-bottom: 10px;
  color: #737373;
  font-size: var(--text-base);
}

.ui-input-group {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
}

.ui-input-group .ui-form-control {
  flex: 1 1 auto;
  width: 1%;
}

.ui-input-group .ui-form-control:not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.ui-input-group__btn {
  display: flex;
}

.ui-input-group__btn:not(:first-child) > .ui-btn {
  margin-left: -1px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.ui-checkbox,
.ui-radio {
  position: relative;
  display: block;
  margin-top: 10px;
  margin-bottom: 10px;
}

.ui-checkbox label,
.ui-radio label {
  min-height: 20px;
  padding-left: 20px;
  margin-bottom: 0;
  font-weight: var(--weight-regular);
  font-size: var(--text-base);
  cursor: pointer;
}

.ui-checkbox input[type='checkbox'],
.ui-radio input[type='radio'] {
  position: absolute;
  margin-left: -20px;
  margin-top: 4px;
}

/* ============ Modal ============ */

.ui-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1040;
}

.ui-modal {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 30px;
  width: 600px;
  max-width: calc(100vw - 20px);
  max-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  background-color: var(--surface-page);
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-lg);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  outline: 0;
  z-index: 1050;
}

.ui-modal--lg { width: 900px; }
.ui-modal--sm { width: 300px; }

.ui-modal__header {
  padding: 15px;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  flex-shrink: 0;
}

.ui-modal__title {
  margin: 0;
  font-size: 18px;
  font-weight: var(--weight-medium);
  line-height: 1.42857143;
  color: var(--text-primary);
}

.ui-modal__close {
  position: absolute;
  top: 12px;
  right: 15px;
  padding: 0;
  font-size: 21px;
  font-weight: var(--weight-bold);
  line-height: 1;
  color: #000000;
  background: none;
  border: 0;
  cursor: pointer;
  opacity: 0.3;
}

.ui-modal__close:hover {
  opacity: 0.6;
}

.ui-modal__body {
  position: relative;
  padding: 15px;
  overflow-y: auto;
}

.ui-modal__footer {
  padding: 15px;
  text-align: right;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.ui-modal__footer .ui-btn + .ui-btn {
  margin-left: 5px;
}

/* ============ Menu (DropdownButton) ============ */

.ui-menu {
  min-width: 160px;
  padding: 5px 0;
  margin: 0;
  font-size: var(--text-base);
  background-color: var(--surface-page);
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
  outline: 0;
  /* Base UI portals menus to <body>, so unlike Bootstrap's inline dropdowns
     (z-index 1000 inside the modal's stacking context) the popup must sit
     above .ui-modal (1050) or menus opened from modals paint behind them. */
  z-index: 1060;
}

.ui-menu__item {
  display: block;
  width: 100%;
  padding: 3px 20px;
  clear: both;
  font-weight: var(--weight-regular);
  line-height: 1.42857143;
  color: #333333;
  white-space: nowrap;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: none;
}

.ui-menu__item:hover,
.ui-menu__item:focus,
.ui-menu__item[data-highlighted] {
  color: #262626;
  background-color: #f5f5f5;
  outline: 0;
}

.ui-menu__item.active,
.ui-menu__item.active:hover,
.ui-menu__item.active:focus {
  color: #ffffff;
  background-color: var(--blue);
}

.ui-menu__item[data-disabled] {
  color: #777777;
  cursor: not-allowed;
  background: none;
}

.ui-menu__divider {
  height: 1px;
  margin: 9px 0;
  overflow: hidden;
  background-color: #e5e5e5;
}

.ui-menu__header {
  display: block;
  padding: 3px 20px;
  font-size: var(--text-sm);
  line-height: 1.42857143;
  color: #777777;
  white-space: nowrap;
}

.ui-caret {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 5px;
  vertical-align: middle;
  border-top: 4px dashed;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

/* ============ Popover ============ */

.ui-popover {
  max-width: 276px;
  font-family: var(--font-body);
  font-size: var(--text-base);
  background-color: var(--surface-page);
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-popover);
  z-index: 1060;
}

.ui-popover__title {
  margin: 0;
  padding: 8px 14px;
  font-size: var(--text-base);
  background-color: #f7f7f7;
  border-bottom: 1px solid #ebebeb;
  border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0;
}

.ui-popover__content {
  padding: 9px 14px;
}

/* ============ Tooltip ============ */

/* ui/Tooltip: the same surface as .ui-popover with its content padding,
   so a tooltip and a popover read as one family ("Coded by", Add memo). */
.ui-tooltip {
  /* A label stays on one line while it fits; longer content wraps at the cap. */
  width: max-content;
  max-width: 320px;
  padding: 9px 14px;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-body);
  background-color: var(--surface-page);
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-popover);
  z-index: 1070;
}

/* ============ Pagination ============ */

.ui-pagination {
  display: inline-block;
  padding-left: 0;
  margin: 20px 0;
  border-radius: var(--radius-sm);
  list-style: none;
}

.ui-pagination__item {
  display: inline;
}

.ui-pagination__item > button {
  position: relative;
  float: left;
  padding: 6px 12px;
  margin-left: -1px;
  font-size: var(--text-base);
  line-height: 1.42857143;
  color: var(--text-link);
  background-color: #ffffff;
  border: 1px solid #dddddd;
  cursor: pointer;
}

.ui-pagination__item:first-child > button {
  margin-left: 0;
  border-top-left-radius: var(--radius-sm);
  border-bottom-left-radius: var(--radius-sm);
}

.ui-pagination__item:last-child > button {
  border-top-right-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
}

.ui-pagination__item > button:hover {
  background-color: var(--gray-100);
}

.ui-pagination__item.active > button,
.ui-pagination__item.active > button:hover {
  color: #ffffff;
  background-color: var(--blue);
  border-color: var(--blue);
  cursor: default;
}

.ui-pagination__item.disabled > button,
.ui-pagination__item.disabled > button:hover {
  color: #777777;
  background-color: #ffffff;
  cursor: not-allowed;
}

/* ============ List group ============ */

.ui-list-group {
  padding-left: 0;
  margin-bottom: 20px;
}

.ui-list-group__item {
  position: relative;
  display: block;
  width: 100%;
  padding: 10px 15px;
  margin-bottom: -1px;
  font-size: var(--text-base);
  text-align: left;
  color: var(--text-body);
  background-color: #ffffff;
  border: 1px solid #dddddd;
  text-decoration: none;
  cursor: pointer;
}

.ui-list-group__item:first-child {
  border-top-left-radius: var(--radius-sm);
  border-top-right-radius: var(--radius-sm);
}

.ui-list-group__item:last-child {
  margin-bottom: 0;
  border-bottom-left-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
}

.ui-list-group__item:hover {
  background-color: var(--gray-50);
  color: var(--text-body);
  text-decoration: none;
}

/* ============ Toasts ============ */

.ui-toast {
  display: flex;
  align-items: flex-start;
  width: 360px;
  max-width: calc(100vw - 16px);
  background-color: var(--surface-page);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-popover);
  border-left: 4px solid var(--gray-400);
  font-size: var(--text-base);
  color: var(--text-body);
}

.ui-toast--error { border-left-color: #d9534f; }
.ui-toast--warning { border-left-color: #f0ad4e; }
.ui-toast--success { border-left-color: #5cb85c; }
.ui-toast--info { border-left-color: #5bc0de; }

.ui-toast__content {
  flex: 1;
  padding: 12px 14px;
  line-height: var(--leading-snug);
}

.ui-toast__dismiss {
  padding: 8px 10px;
  font-size: 18px;
  font-weight: var(--weight-bold);
  line-height: 1;
  color: var(--gray-400);
  background: none;
  border: 0;
  cursor: pointer;
}

.ui-toast__dismiss:hover {
  color: var(--gray-600);
}

/* Transcript memos (docs/transcript-memos-plan.md T7): stylesheet classes on
   the ui/ kit tokens, not inline style objects. Loaded by packs/projects.js
   after ui.css. */

/* The row under a paragraph: + then the count badge (walkthrough §1). It
   sits after the code tags, which space themselves with their own right
   margin, so no margin of its own; the gap between + and the badge matches
   that rhythm (V-13). */
.memo-row {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  vertical-align: middle;
}

.memo-row__button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: none;
  background: none;
  padding: 2px 3px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1;
  cursor: pointer;
}

.memo-row__button:hover {
  background: var(--surface-hover);
  color: var(--text-body);
}

/* Open: the filled glyph is the signal (V-12); it stays the same grey as the
   filled badge under selected memo'd text, so the two "on" states match. */
.memo-row__button[aria-expanded="true"] {
  background: var(--surface-hover);
  color: var(--text-muted);
}

.memo-row__button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.memo-row__icon {
  font-size: 1.15em !important;
}

/* The anchor sits in the code tags' line. No line box of its own: with
   the paragraph font's line-height it was 1.4px taller than the tags, so
   the paragraph (and the text column the rail watches) grew by that much
   whenever the row appeared or went, e.g. on saving a memo, in the same
   ResizeObserver pass as the rail cards' own resize: "ResizeObserver loop
   completed with undelivered notifications" (Firefox, Comparison). */
.memo-row-anchor {
  display: inline-block;
  vertical-align: middle;
  line-height: 0;
}

/* The popover (narrow layout). */
.memo-popover {
  width: 340px;
  max-width: calc(100vw - 32px);
  /* T-2: never taller than the room Base UI finds for it; the body scrolls. */
  max-height: min(480px, var(--available-height, 480px));
  background: var(--surface-page);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-popover);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.memo-popover__body {
  overflow-y: auto;
  /* 20px all round (LaiYee 2026-11-18: the memo and the reply row were
     nearly touching the edges), V-17. */
  padding: var(--space-7);
}

/* One thread (the memos on one excerpt), in the popover list or alone. The
   break between threads is the popover's 20px (V-17) above and below its
   line, so it reads as a bigger break than the 14px reply divider inside a
   thread, and the reply row has at least as much room below it as above
   (Matthew 2026-11-19: 8px left it cramped between the two lines). */
.memo-thread + .memo-thread {
  border-top: 1px solid var(--border-subtle);
  margin-top: var(--space-7);
  padding-top: var(--space-7);
}

.memo-quote {
  display: block;
  border-left: 3px solid var(--border-strong);
  padding-left: var(--space-3);
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
  overflow-wrap: anywhere;
}

.memo-saving {
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-style: italic;
}

/* Reply box and composer: a memo row (the prototype's MemoComposerRow) —
   the author's avatar, a borderless box that reads like a memo, and a round
   send button; the error and the "Unsent" note span the text and send
   columns beneath. */
.memo-input {
  display: grid;
  grid-template-columns: 18px 1fr 24px;
  column-gap: 10px;
  align-items: center;
  margin-top: var(--space-3);
}

.memo-input__textarea {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  padding: 0;
  resize: none;
  font: inherit;
  font-style: italic;
  color: inherit;
}

.memo-input__textarea::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.memo-input__send {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px; /* a rounded square, as the prototype's (a245ee08f) */
  padding: 0;
  display: grid;
  place-items: center;
  background: var(--action-primary);
  color: #fff;
  cursor: pointer;
}

.memo-input__send:disabled {
  background: var(--gray-100, #f0f0f0);
  color: var(--text-muted);
  cursor: default;
}

.memo-input__send:focus-visible,
.memo-unsent-note__discard:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.memo-input__send-icon {
  font-size: 16px !important;
}

/* The send button's name, for screen readers and tests, not for the eye. */
.memo-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.memo-input__error {
  grid-column: 2 / -1;
  margin-top: var(--space-2);
  color: var(--danger-red);
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* "Unsent memo · 4:20 PM · Discard" (D-5, D-6, D-7): a tinted bar under
   unsent text, sized like a memo's name line. Its text lines up with the
   typed text above; the tint bleeds 10px left into the avatar gap. */
.memo-unsent-note {
  grid-column: 2 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 10px 0 2px -10px;
  padding: 8px 10px;
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--action-primary) 8%, var(--surface-page));
  font-size: var(--text-sm);
  line-height: 1.4;
  font-style: normal;
  /* The prototype's grey for the time and Discard: the app's LIGHT_GREY
     (ColorConstants), between the gray-400 and gray-500 tokens. */
  color: #979797;
  min-width: 0;
}

.memo-unsent-note > * {
  white-space: nowrap;
}

.memo-unsent-note__icon {
  font-size: 12px !important;
  color: var(--action-primary);
  flex: none;
}

.memo-unsent-note b {
  font-weight: 700;
  color: var(--text-body);
}

.memo-unsent-note__when {
  font-variant-numeric: tabular-nums;
}

.memo-unsent-note__discard {
  margin-left: auto;
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 500;
  color: inherit;
  cursor: pointer;
}

.memo-unsent-note__discard:hover {
  color: var(--text-body);
}

/* Unsent text at rest (an unsent memo's card, D-7; an unsent reply on a
   folded card, D-6): the memo row's grid without its box — avatar and text,
   italic like typed text, at most three lines, the send column empty — and
   the note beneath, under the text as in the box. */
.memo-unsent {
  display: grid;
  grid-template-columns: 18px 1fr 24px;
  column-gap: 10px;
  align-items: start;
}

.memo-unsent__text {
  font-style: italic;
  white-space: pre-line;
  overflow: hidden;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* Under a thread, the reply row (open or at rest) sits below a divider,
   14px above and below it (the prototype's .memo-rail-reply had 10px;
   LaiYee 2026-11-18 asked for more room, V-17). */
.memo-thread__footer {
  border-top: 1px solid var(--border-subtle);
  margin-top: var(--space-5);
  padding-top: var(--space-5);
}

/* A thread's memos read as one conversation (V-17): 28px apart
   (MemoThread's THREAD_MEMO_GAP, Memo.jsx's gap prop) with a 1px line from
   each avatar down to the next memo's. The avatar column stretches to its
   row's height, so the line runs from under the avatar to the row's bottom
   and on across the gap, stopping 4px short of the next avatar. Not on the
   Snippets list, which has no .memo-thread. */
.memo-thread .memo-leaf__avatar {
  position: relative;
}

.memo-thread .memo-leaf:not(:last-child) .memo-leaf__avatar::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 22px; /* the 18px avatar and a 4px gap */
  bottom: -24px; /* the 28px gap less 4px */
  width: 1px;
  background: var(--border-subtle);
}

.memo-thread__footer > .memo-input {
  margin-top: 0;
}

.memo-unsent--reply {
  border-top: 1px solid var(--border-subtle);
  margin-top: 10px;
  padding-top: 10px;
}

/* An unsent memo's card: Memo.jsx's 8px above, and a click target. Nothing
   below the note but the card's own padding, so the note sits as close to
   the card's bottom edge as a thread's reply row does (Matthew, 2026-11-19). */
.memo-unsent--memo {
  padding: 8px 0 0;
  cursor: pointer;
}

.memo-unsent--memo .memo-unsent-note {
  margin-bottom: 0;
}

.memo-rail-card--draft:hover {
  border-color: color-mix(in srgb, var(--action-primary) 45%, var(--border-card));
}

/* "Memo not saved" toast. */
.memo-toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Wide layout: text + margin rail (R3, plan §2f). No position on the grid,
   so paragraphs keep their offset parent. The rail keeps clear of the text
   and of the page's right edge (the Codes panel's border, and the scrollbar
   that overlays it). */
.memo-margin-layout--wide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--memo-rail-width, 320px);
  column-gap: var(--space-8);
  padding-right: var(--space-7);
  align-items: start;
  transition: grid-template-columns 260ms cubic-bezier(0.2, 0, 0, 1), column-gap 260ms cubic-bezier(0.2, 0, 0, 1);
}

/* Nothing in the rail (R-14): no column for it, the text runs full width. */
.memo-margin-layout--empty {
  grid-template-columns: minmax(0, 1fr) 0px;
  column-gap: 0;
}

.memo-margin-layout--empty .memo-margin-layout__rail {
  overflow: hidden;
}

/* A new page or transcript lays out without sliding (MemoMarginLayout rule 7). */
.memo-margin-layout--no-motion,
.memo-margin-layout--no-motion .memo-rail-card {
  transition: none;
}

.memo-margin-layout__rail {
  position: relative;
  /* Card movement must never shift the scroll position; the text column
     keeps the browser's scroll anchoring. */
  overflow-anchor: none;
}

/* The margin rail (R-1…R-8). Cards are absolutely placed by marginLayout.js
   and moved with transform (T3), never top. The selected card's transform
   also steps it left of the others (FOCUS_SHIFT in MemoRail.jsx). */
.memo-rail {
  position: relative;
}

.memo-rail-card {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: var(--surface-page);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  /* The prototype card's padding was 10px 14px 12px (TranscriptMemoMargin
     CARD_BASE_STYLE). LaiYee's 2026-11-18 review asked for more room on
     every side (V-17): 18px 22px 20px, so the first memo's avatar sits
     33px below the card's top edge and its name 51px from the left edge.
     The expanded card's first memo (Memo.jsx, flush) and the folded preview
     (.memo-thread-preview) each add the same 8px above, so both read the
     same. */
  padding: 18px 22px 20px;
  box-sizing: border-box; /* its height is animated (useCardResizeAnimation) */
}

/* Motion (R-13). A placed card slides to each new place; the selected card
   lifts and steps left. The same 260ms curve as useCardResizeAnimation, which grows and
   shrinks a card's height on selection, so the cards move as one. A card's
   first placement (hidden until measured) does not slide in. */
.memo-rail-card--settled {
  transition:
    transform 260ms cubic-bezier(0.2, 0, 0, 1),
    box-shadow 200ms ease,
    border-color 200ms ease;
}

.memo-rail-card--active {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-popover);
  z-index: 1;
}

/* New card content (the thread on expanding, the preview on folding) fades
   in as the box resizes around it. */
.memo-rail-card__body {
  animation: memo-rail-card-body-in 200ms ease-out both;
}

@keyframes memo-rail-card-body-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.memo-rail-card__body[role="button"] {
  cursor: pointer;
}

/* A folded card (R-11): first memo, "Show N replies", last memo. The leaf
   mirrors Memo.jsx (avatar, name, time, text) clamped to two lines, at
   Memo.jsx's offsets (the prototype's card), so a folded and an expanded
   card put their first avatar and name at the same place: 10px above the
   first leaf, 8px below the last, 10px between an avatar and its text. */
.memo-thread-preview {
  padding: 10px 0 8px;
}

.memo-preview {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.memo-preview + .memo-preview,
.memo-thread__replies + .memo-preview {
  margin-top: var(--space-3);
}

.memo-preview__body {
  flex: 1;
  min-width: 0;
}

.memo-preview__head {
  font-size: var(--text-sm);
}

.memo-preview__time {
  color: var(--text-muted);
  margin-left: var(--space-2);
}

.memo-preview__text {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.memo-thread__replies {
  display: block;
  border: none;
  background: none;
  padding: 0;
  /* under the text, past the 18px avatar and its 10px gap */
  margin: var(--space-2) 0 0 28px;
  color: var(--text-muted);
  font-size: var(--text-sm);
  cursor: pointer;
}

.memo-thread__replies:hover {
  color: var(--text-body);
}

/* The expanded card's memos (R-12): bounded and scrolling, opened at the
   bottom where the latest memo is; the reply box sits below, always in view. */
.memo-thread__memos--scroll {
  max-height: min(360px, 50vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  /* Room for the scrollbar, so it never sits on a memo's delete button at
     the right edge (an overlay scrollbar draws over the padding; a classic
     one gets its own gutter, kept stable so the memos don't shift). */
  padding-right: var(--space-4);
  scrollbar-gutter: stable;
}

/* Document
 * ========================================================================== */

/**
 * 1. Add border box sizing in all browsers (opinionated).
 * 2. Backgrounds do not repeat by default (opinionated).
 */

*,
::before,
::after {
  box-sizing: border-box; /* 1 */
  background-repeat: no-repeat; /* 2 */
}

/**
 * 1. Add text decoration inheritance in all browsers (opinionated).
 * 2. Add vertical alignment inheritance in all browsers (opinionated).
 */

::before,
::after {
  text-decoration: inherit; /* 1 */
  vertical-align: inherit; /* 2 */
}

/**
 * 1. Use the default cursor in all browsers (opinionated).
 * 2. Change the line height in all browsers (opinionated).
 * 3. Breaks words to prevent overflow in all browsers (opinionated).
 * 4. Use a 4-space tab width in all browsers (opinionated).
 * 5. Remove the grey highlight on links in iOS (opinionated).
 * 6. Prevent adjustments of font size after orientation changes in iOS.
 */

:where(:root) {
  cursor: default; /* 1 */
  line-height: 1.5; /* 2 */
  overflow-wrap: break-word; /* 3 */
  -moz-tab-size: 4; /* 4 */
  tab-size: 4; /* 4 */
  -webkit-tap-highlight-color: transparent; /* 5 */
  -webkit-text-size-adjust: 100%; /* 6 */
}

/* Sections
 * ========================================================================== */

/**
 * Remove the margin in all browsers (opinionated).
 */

:where(body) {
  margin: 0;
}

/**
 * Correct the font size and margin on `h1` elements within `section` and
 * `article` contexts in Chrome, Edge, Firefox, and Safari.
 */

:where(h1) {
  font-size: 2em;
  margin: 0.67em 0;
}

/* Grouping content
 * ========================================================================== */

/**
 * Remove the margin on nested lists in Chrome, Edge, and Safari.
 */

:where(dl, ol, ul) :where(dl, ol, ul) {
  margin: 0;
}

/**
 * 1. Correct the inheritance of border color in Firefox.
 * 2. Add the correct box sizing in Firefox.
 */

:where(hr) {
  color: inherit; /* 1 */
  height: 0; /* 2 */
}

/**
 * Remove the list style on navigation lists in all browsers (opinionated).
 */

:where(nav) :where(ol, ul) {
  list-style-type: none;
  padding: 0;
}

/**
 * Prevent VoiceOver from ignoring list semantics in Safari (opinionated).
 */

:where(nav li)::before {
  content: "\200B";
  float: left;
}

/**
 * 1. Correct the inheritance and scaling of font size in all browsers.
 * 2. Correct the odd `em` font sizing in all browsers.
 * 3. Prevent overflow of the container in all browsers (opinionated).
 */

:where(pre) {
  font-family: monospace, monospace; /* 1 */
  font-size: 1em; /* 2 */
  overflow: auto; /* 3 */
}

/* Text-level semantics
 * ========================================================================== */

/**
 * Add the correct text decoration in Safari.
 */

:where(abbr[title]) {
  text-decoration: underline;
  text-decoration: underline dotted;
}

/**
 * Add the correct font weight in Chrome, Edge, and Safari.
 */

:where(b, strong) {
  font-weight: bolder;
}

/**
 * 1. Correct the inheritance and scaling of font size in all browsers.
 * 2. Correct the odd `em` font sizing in all browsers.
 */

:where(code, kbd, samp) {
  font-family: monospace, monospace; /* 1 */
  font-size: 1em; /* 2 */
}

/**
 * Add the correct font size in all browsers.
 */

:where(small) {
  font-size: 80%;
}

/* Embedded content
 * ========================================================================== */

/*
 * Change the alignment on media elements in all browsers (opinionated).
 */

:where(audio, canvas, iframe, img, svg, video) {
  vertical-align: middle;
}

/**
 * Remove the border on iframes in all browsers (opinionated).
 */

:where(iframe) {
  border-style: none;
}

/**
 * Change the fill color to match the text color in all browsers (opinionated).
 */

:where(svg:not([fill])) {
  fill: currentColor;
}

/* Tabular data
 * ========================================================================== */

/**
 * 1. Collapse border spacing in all browsers (opinionated).
 * 2. Correct table border color inheritance in all Chrome, Edge, and Safari.
 * 3. Remove text indentation from table contents in Chrome, Edge, and Safari.
 */

:where(table) {
  border-collapse: collapse; /* 1 */
  border-color: inherit; /* 2 */
  text-indent: 0; /* 3 */
}

/* Forms
 * ========================================================================== */

/**
 * Remove the margin on controls in Safari.
 */

:where(button, input, select) {
  margin: 0;
}

/**
 * Correct the inability to style buttons in iOS and Safari.
 */

:where(button, [type="button" i], [type="reset" i], [type="submit" i]) {
  -webkit-appearance: button;
}

/**
 * Change the inconsistent appearance in all browsers (opinionated).
 */

:where(fieldset) {
  border: 1px solid #a0a0a0;
}

/**
 * Add the correct vertical alignment in Chrome, Edge, and Firefox.
 */

:where(progress) {
  vertical-align: baseline;
}

/**
 * 1. Remove the margin in Firefox and Safari.
 * 3. Change the resize direction in all browsers (opinionated).
 */

:where(textarea) {
  margin: 0; /* 1 */
  resize: vertical; /* 3 */
}

/**
 * 1. Correct the odd appearance in Chrome, Edge, and Safari.
 * 2. Correct the outline style in Safari.
 */

:where([type="search" i]) {
  -webkit-appearance: textfield; /* 1 */
  outline-offset: -2px; /* 2 */
}

/**
 * Correct the cursor style of increment and decrement buttons in Safari.
 */

::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
  height: auto;
}

/**
 * Correct the text style of placeholders in Chrome, Edge, and Safari.
 */

::-webkit-input-placeholder {
  color: inherit;
  opacity: 0.54;
}

/**
 * Remove the inner padding in Chrome, Edge, and Safari on macOS.
 */

::-webkit-search-decoration {
  -webkit-appearance: none;
}

/**
 * 1. Correct the inability to style upload buttons in iOS and Safari.
 * 2. Change font properties to `inherit` in Safari.
 */

::-webkit-file-upload-button {
  -webkit-appearance: button; /* 1 */
  font: inherit; /* 2 */
}

/* Interactive
 * ========================================================================== */

/*
 * Add the correct styles in Safari.
 */

:where(dialog) {
  background-color: white;
  border: solid;
  color: black;
  height: -moz-fit-content;
  height: fit-content;
  left: 0;
  margin: auto;
  padding: 1em;
  position: absolute;
  right: 0;
  width: -moz-fit-content;
  width: fit-content;
}

:where(dialog:not([open])) {
  display: none;
}

/*
 * Add the correct display in Safari.
 */

:where(details > summary:first-of-type) {
  display: list-item;
}

/* Accessibility
 * ========================================================================== */

/**
 * Change the cursor on busy elements in all browsers (opinionated).
 */

:where([aria-busy="true" i]) {
  cursor: progress;
}

/*
 * Change the cursor on control elements in all browsers (opinionated).
 */

:where([aria-controls]) {
  cursor: pointer;
}

/*
 * Change the cursor on disabled, not-editable, or otherwise
 * inoperable elements in all browsers (opinionated).
 */

:where([aria-disabled="true" i], [disabled]) {
  cursor: not-allowed;
}

/*
 * Change the display on visually hidden accessible elements
 * in all browsers (opinionated).
 */

:where([aria-hidden="false" i][hidden]) {
  display: initial;
}

:where([aria-hidden="false" i][hidden]:not(:focus)) {
  clip: rect(0, 0, 0, 0);
  position: absolute;
}


/*# sourceMappingURL=projects-9a132e1c.css.map*/