:root {
  --lh-bg: #ffffff;
  --lh-surface: #ffffff;
  --lh-surface-muted: #fbfbfd;
  --lh-text: #1d1d1f;
  --lh-muted: #86868b;
  --lh-border: rgba(29, 29, 31, 0.08);
  --lh-border-strong: rgba(29, 29, 31, 0.12);
  --lh-accent: #007aff;
  --lh-accent-soft: #eff6ff;
  --lh-danger: #ff3b30;
  --lh-danger-soft: #fff1f0;
  --lh-shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 28px rgba(15, 23, 42, 0.06);
  --lh-shadow-floating: 0 20px 48px rgba(15, 23, 42, 0.18);
  --lh-radius-card: 16px;
  --lh-radius-input: 14px;
  --lh-transition: 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

#learnings-app {
  min-height: 240px;
  color: var(--lh-text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro', 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.lh-shell {
  display: grid;
  gap: 16px;
  padding: 2px 0 20px;
}

.lh-toolbar,
.lh-section,
.lh-empty,
.lh-modal-card,
.lh-toast-stack {
  width: 100%;
  box-sizing: border-box;
}

.lh-toolbar {
  background: linear-gradient(180deg, #ffffff 0%, #fcfcfe 100%);
  border: 1px solid var(--lh-border);
  border-radius: 20px;
  padding: 16px;
  display: grid;
  gap: 14px;
  box-shadow: var(--lh-shadow-card);
}

.lh-toolbar-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.lh-toolbar h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--lh-text);
}

.lh-toolbar p {
  margin: 6px 0 0;
  color: var(--lh-muted);
  font-size: 13px;
  line-height: 1.45;
}

.lh-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--lh-border);
  background: var(--lh-surface-muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: border-color var(--lh-transition), box-shadow var(--lh-transition), background var(--lh-transition);
}

.lh-search:focus-within {
  background: #ffffff;
  border-color: rgba(0, 122, 255, 0.28);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.08);
}

.lh-search span {
  flex: 0 0 auto;
  font-size: 14px;
  opacity: 0.72;
}

.lh-search input,
.lh-field input,
.lh-field textarea,
.lh-field select {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--lh-text);
  font: inherit;
  box-sizing: border-box;
}

.lh-search input {
  font-size: 15px;
}

.lh-search input::placeholder,
.lh-field textarea::placeholder,
.lh-field input::placeholder {
  color: var(--lh-muted);
}

.lh-auth-row,
.lh-filter-pills,
.lh-card-actions,
.lh-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lh-auth-row {
  justify-content: flex-end;
  align-items: center;
}

.lh-filter-pills {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
  margin: 0 -2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.lh-filter-pills::-webkit-scrollbar {
  display: none;
}

.lh-btn,
.lh-pill,
.lh-status {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--lh-border);
  background: #ffffff;
  color: var(--lh-text);
  font: inherit;
  transition: transform 120ms ease, background-color var(--lh-transition), color var(--lh-transition), border-color var(--lh-transition), box-shadow var(--lh-transition), opacity var(--lh-transition);
}

.lh-btn,
.lh-pill {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.lh-btn {
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.lh-btn:hover,
.lh-pill:hover,
.lh-status:hover {
  border-color: var(--lh-border-strong);
}

.lh-btn:active,
.lh-pill:active,
.lh-status:active {
  transform: scale(0.97);
}

.lh-btn:focus-visible,
.lh-pill:focus-visible,
.lh-status:focus-visible,
.lh-field input:focus-visible,
.lh-field textarea:focus-visible,
.lh-field select:focus-visible {
  outline: none;
}

.lh-btn:focus-visible,
.lh-pill:focus-visible,
.lh-status:focus-visible {
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12);
}

.lh-pill {
  background: #ffffff;
  color: #515154;
}

.lh-pill.active {
  color: var(--lh-accent);
  background: var(--lh-accent-soft);
  border-color: rgba(0, 122, 255, 0.18);
}

.lh-btn-primary {
  background: var(--lh-accent);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(0, 122, 255, 0.2);
}

.lh-btn-primary:hover {
  background: #0071eb;
}

.lh-btn-danger {
  color: var(--lh-danger);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

#lh-auth-row .lh-btn:not(.lh-btn-primary) {
  background: rgba(255, 255, 255, 0.9);
}

.lh-section {
  display: grid;
  gap: 10px;
}

.lh-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 0;
}

.lh-section-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--lh-muted);
  letter-spacing: 0.02em;
}

.lh-grid {
  display: grid;
  gap: 10px;
}

.lh-card {
  background: linear-gradient(180deg, #ffffff 0%, #fcfcfd 100%);
  border: 1px solid var(--lh-border);
  border-radius: var(--lh-radius-card);
  padding: 14px;
  display: grid;
  gap: 10px;
  box-shadow: var(--lh-shadow-card);
  transform-origin: center;
  transition: transform 140ms ease, box-shadow var(--lh-transition), border-color var(--lh-transition), background var(--lh-transition);
  animation: lh-card-fade 220ms ease both;
}

.lh-card:hover {
  border-color: rgba(29, 29, 31, 0.12);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05), 0 14px 30px rgba(15, 23, 42, 0.07);
  transform: translateY(-1px);
}

.lh-card:active {
  transform: scale(0.992);
}

.lh-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.lh-card-top > div:first-child {
  min-width: 0;
}

.lh-card h4 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--lh-text);
}

.lh-card a {
  color: var(--lh-accent);
  text-decoration: none;
}

.lh-card a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lh-status {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: none;
}

button.lh-status {
  cursor: pointer;
}

button.lh-status:active {
  transform: scale(0.95);
}

.lh-status-saved {
  color: #b26a00;
  background: #fff7e6;
  border-color: rgba(178, 106, 0, 0.12);
}

.lh-status-watched {
  color: #0b6b2d;
  background: #eefbf2;
  border-color: rgba(11, 107, 45, 0.12);
}

.lh-status-skimmed {
  color: #5e5ce6;
  background: #f1f0ff;
  border-color: rgba(94, 92, 230, 0.14);
}

.lh-notes {
  color: var(--lh-muted);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.lh-meta {
  margin-top: 4px;
  color: var(--lh-muted);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.lh-meta a {
  color: var(--lh-accent);
}

.lh-card-actions {
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid rgba(29, 29, 31, 0.06);
}

.lh-card-actions .lh-btn {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--lh-accent);
}

.lh-card-actions .lh-btn[data-move-id] {
  min-width: 20px;
  text-align: center;
  color: #6e6e73;
}

.lh-card-actions .lh-btn.lh-btn-danger {
  color: var(--lh-danger);
}

.lh-empty {
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfd 100%);
  border: 1px dashed rgba(29, 29, 31, 0.14);
  border-radius: 18px;
  padding: 22px 16px;
  text-align: center;
  color: var(--lh-muted);
  font-size: 13px;
  line-height: 1.5;
}

.lh-loading {
  color: var(--lh-muted);
  padding: 30px 0;
  text-align: center;
  font-size: 14px;
}

.lh-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 16px 12px 0;
  z-index: 1000;
  animation: lh-overlay-fade 180ms ease;
}

.lh-modal.open {
  display: flex;
}

.lh-modal-card {
  background: #ffffff;
  border-radius: 20px 20px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  box-shadow: var(--lh-shadow-floating);
  display: grid;
  gap: 14px;
  border: 1px solid rgba(29, 29, 31, 0.08);
}

.lh-modal-card h3,
.lh-modal-card p {
  margin: 0;
}

.lh-modal-card h3 {
  font-size: 20px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lh-modal-card p {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--lh-muted);
}

#lh-login-modal {
  align-items: center;
  padding: 16px;
}

#lh-login-modal .lh-modal-card {
  width: min(100%, 320px);
  border-radius: 22px;
  padding: 18px;
}

#lh-editor-modal .lh-modal-card {
  width: min(100%, 680px);
  max-height: min(88vh, 760px);
  overflow-y: auto;
  animation: lh-sheet-up 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lh-form {
  display: grid;
  gap: 12px;
}

.lh-field {
  display: grid;
  gap: 7px;
  border: 1px solid var(--lh-border);
  border-radius: var(--lh-radius-input);
  padding: 12px 13px;
  background: var(--lh-surface-muted);
  transition: border-color var(--lh-transition), box-shadow var(--lh-transition), background var(--lh-transition);
}

.lh-field:focus-within {
  background: #ffffff;
  border-color: rgba(0, 122, 255, 0.25);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.08);
}

.lh-field span {
  font-size: 12px;
  font-weight: 600;
  color: var(--lh-muted);
}

.lh-field input,
.lh-field textarea,
.lh-field select {
  font-size: 15px;
  line-height: 1.4;
}

.lh-field select {
  cursor: pointer;
}

.lh-field textarea {
  min-height: 120px;
  resize: vertical;
}

.lh-field-row {
  display: grid;
  gap: 12px;
}

.lh-modal-actions {
  justify-content: flex-end;
  padding-top: 4px;
}

.lh-modal-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(29, 29, 31, 0.15);
  margin: -4px auto 0;
}

.lh-toast-stack {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 8px;
  z-index: 1100;
  pointer-events: none;
}

.lh-toast {
  min-width: 180px;
  max-width: min(92vw, 360px);
  background: #1d1d1f;
  color: #ffffff;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  box-shadow: var(--lh-shadow-floating);
  animation: lh-toast-up 220ms ease;
}

/* Shared vault card controls, including the inline destructive-action guard. */
.vh-actions,
.vh-delete-confirm,
.lh-delete-confirm {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.vh-actions button,
.vh-delete-confirm button {
  appearance: none;
  border: 1px solid var(--lh-border-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--lh-text);
  cursor: pointer;
  padding: 4px 7px;
  line-height: 1;
}

.vh-actions [data-delete],
.vh-delete-yes {
  color: #b42318;
}

.vh-delete-confirm {
  font-size: 12px;
  color: var(--lh-muted);
}

.vh-notice {
  min-height: 1em;
  color: #147a42;
  font-size: 13px;
}

/* Shared login dialog used by the lightweight vault resource tabs. */
.vh-login-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.vh-login-card {
  width: min(100%, 320px);
  padding: 18px;
  background: #fff;
  border: 1px solid var(--lh-border);
  border-radius: 22px;
  box-shadow: var(--lh-shadow-floating);
}

.vh-login-card form,
.vh-login-card label {
  display: grid;
  gap: 12px;
}

.vh-login-card h3,
.vh-login-card p { margin: 0; }
.vh-login-card p { color: var(--lh-muted); font-size: 13px; line-height: 1.5; }
.vh-login-card input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--lh-border-strong);
  border-radius: 10px;
  font: inherit;
}
.vh-login-card form > div { display: flex; justify-content: flex-end; gap: 8px; }
.vh-login-card button { cursor: pointer; padding: 8px 12px; border: 1px solid var(--lh-border-strong); border-radius: 9px; background: #fff; font: inherit; }
.vh-login-card button[type="submit"] { background: var(--lh-accent); border-color: var(--lh-accent); color: #fff; }
.vh-login-card .vh-error { min-height: 1.2em; color: #b42318; }

@keyframes lh-card-fade {
  from {
    opacity: 0;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes lh-overlay-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes lh-sheet-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes lh-toast-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 720px) {
  .lh-toolbar {
    padding: 18px;
  }

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

  .lh-field-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lh-modal {
    align-items: center;
    padding: 24px;
  }

  #lh-editor-modal .lh-modal-card {
    border-radius: 22px;
    padding: 20px;
  }

  .lh-toast-stack {
    bottom: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lh-card,
  .lh-toast,
  .lh-modal,
  #lh-editor-modal .lh-modal-card,
  .lh-btn,
  .lh-pill,
  .lh-status,
  .lh-search,
  .lh-field {
    animation: none;
    transition: none;
  }
}

/* Cardle identity and the optional overview primer stay independent of the live feed. */
.app-hdr { gap: 12px; }
.cardle-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: #10204a;
  text-decoration: none;
}
.cardle-brand:focus-visible,
.cardle-info-trigger:focus-visible { outline: 3px solid rgba(37, 99, 235, .38); outline-offset: 3px; }
.cardle-mark { flex: 0 0 auto; width: 34px; height: 34px; filter: drop-shadow(0 4px 8px rgba(47, 77, 192, .2)); }
.cardle-wordmark { display: inline-flex; align-items: flex-start; font-size: 20px; font-weight: 780; letter-spacing: -.055em; line-height: 1; }
.cardle-wordmark small { margin: -2px 0 0 3px; color: #5271ff; font-size: 8px; font-weight: 800; letter-spacing: .08em; }
.cardle-info-trigger {
  min-height: 34px;
  margin-left: 2px;
  padding: 0 10px;
  border: 1px solid #dbe6fb;
  border-radius: 999px;
  color: #2651b8;
  background: #f5f8ff;
  cursor: pointer;
  font: 700 12px/1 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.cardle-info-trigger:hover { border-color: #adc6ff; background: #edf4ff; }
.cardle-info { margin: 2px 0 18px; overflow: hidden; border: 1px solid #dbe7fb; border-radius: 20px; background: radial-gradient(circle at 87% 8%, rgba(132, 186, 255, .22), transparent 30%), linear-gradient(135deg, #f8fbff, #fff 62%); box-shadow: 0 12px 32px rgba(45, 76, 150, .08); }
.cardle-info[hidden] { display: none; }
.cardle-info-intro { padding: 20px 18px 18px; border-bottom: 1px solid rgba(148, 163, 184, .18); }
.cardle-eyebrow { margin: 0 0 7px; color: #3565cf; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.cardle-info h2 { max-width: 25ch; margin: 0; color: #172554; font-size: clamp(21px, 5vw, 29px); line-height: 1.13; letter-spacing: -.035em; }
.cardle-info-intro > p:last-child { max-width: 66ch; margin: 10px 0 0; color: #526176; font-size: 14px; line-height: 1.55; }
.cardle-info-grid { display: grid; }
.cardle-info-card { min-width: 0; padding: 17px 18px 19px; border-bottom: 1px solid rgba(148, 163, 184, .16); }
.cardle-info-card:last-child { border-bottom: 0; }
.cardle-info-icon { display: grid; width: 28px; height: 28px; place-items: center; margin-bottom: 12px; border-radius: 9px; color: #fff; background: linear-gradient(135deg, #315dd3, #7559d9); box-shadow: 0 5px 12px rgba(61, 94, 200, .2); font-size: 15px; font-weight: 800; }
.cardle-info-card h3 { margin: 0; color: #1e293b; font-size: 15px; letter-spacing: -.01em; }
.cardle-info-card p,
.cardle-help-list { margin: 6px 0 0; color: #64748b; font-size: 13px; line-height: 1.52; }
.cardle-help-list { padding: 0; list-style: none; }
.cardle-help-list li { position: relative; padding-left: 15px; }
.cardle-help-list li + li { margin-top: 4px; }
.cardle-help-list li::before { position: absolute; left: 0; color: #4f78dd; content: '•'; }
@media (min-width: 720px) {
  .cardle-info-intro { padding: 25px 25px 21px; }
  .cardle-info-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cardle-info-card { min-height: 182px; padding: 20px 22px; border-right: 1px solid rgba(148, 163, 184, .16); border-bottom: 0; }
  .cardle-info-card:last-child { border-right: 0; }
}
@media (max-width: 480px) {
  .cardle-info-trigger { padding: 0 8px; font-size: 11px; }
  .app-hdr .sub { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cardle-info-trigger { transition: none; }
}

