:root {
  color-scheme: light;
  --background: #ffffff;
  --surface: #ffffff;
  --surface-raised: rgba(255, 255, 255, 0.88);
  --text: #111114;
  --muted: #707077;
  --quiet: #8d8d95;
  --primary: #007aff;
  --primary-dark: #0069d9;
  --green: #2f9e64;
  --red: #d92d20;
  --border: rgba(60, 60, 67, 0.15);
  --fill: rgba(118, 118, 128, 0.11);
  --fill-strong: rgba(118, 118, 128, 0.18);
  --shadow: 0 24px 70px rgba(17, 17, 20, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
  overflow-x: clip;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 300;
  width: 1px;
  height: 1px;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: #000000;
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
  text-decoration: none;
  clip-path: inset(50%);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.skip-link:focus {
  outline: none;
}

#main-content:focus {
  outline: none;
}

img,
canvas,
svg {
  max-width: 100%;
}

h1,
h2,
p {
  margin-top: 0;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid #e2e8f0;
  background: rgba(248, 250, 252, 0.94);
  backdrop-filter: blur(20px) saturate(180%);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 28px, 1040px);
  min-height: 62px;
  margin: 0 auto;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.brand-logo {
  display: block;
  height: auto;
  object-fit: contain;
}

.brand-logo-wordmark {
  width: clamp(135px, 15vw, 165px);
}

.brand-logo-symbol {
  display: none;
  width: 34px;
  height: 34px;
}

.account-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
  color: #475569;
  font-size: 0.88rem;
  font-weight: 720;
}

.top-navigation {
  gap: 16px;
}

.top-navigation-paid {
  gap: 28px;
}

.nav-menu {
  position: relative;
  flex: 0 0 auto;
}

.nav-menu > summary {
  list-style: none;
}

.nav-menu > summary::-webkit-details-marker {
  display: none;
}

.nav-menu-trigger,
.header-icon-button,
.profile-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #475569;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.header-icon-button {
  width: 40px;
  padding: 0;
  background: transparent;
  text-decoration: none;
}

.header-action-icon {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-menu-trigger {
  padding: 0 14px;
}

.homepage-notebook-link {
  text-decoration: none;
}

.header-icon-button:hover,
.header-icon-button:focus-visible {
  background: #dbeafe;
  color: #1e40af;
  outline: none;
}

.header-icon-button.is-active {
  background: transparent;
  color: #475569;
}

/* SHARED UPGRADE BUTTON */
.upgrade-button,
.header-upgrade-button,
.header-login-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 780;
  padding: 0 16px;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
  white-space: nowrap;
}

.upgrade-button,
.header-upgrade-button {
  background: #dbeafe;
  color: #1e40af;
}

.header-login-button {
  background: #000000;
  color: #ffffff;
}

.upgrade-button:hover,
.upgrade-button:focus-visible,
.header-upgrade-button:hover,
.header-upgrade-button:focus-visible {
  background: #bfdbfe;
  color: #1d4ed8;
  outline: none;
}

.header-login-button:hover,
.header-login-button:focus-visible {
  background: #1f2937;
  color: #ffffff;
  outline: none;
}

.upgrade-button:focus-visible,
.header-upgrade-button:focus-visible,
.header-login-button:focus-visible {
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.22);
}

.upgrade-button:active,
.header-upgrade-button:active,
.header-login-button:active {
  transform: scale(0.98);
}

.profile-trigger {
  width: 40px;
  padding: 0;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px #e2e8f0;
}

.profile-icon {
  position: relative;
  display: inline-block;
  width: 17px;
  height: 17px;
}

.profile-icon::before,
.profile-icon::after {
  position: absolute;
  left: 50%;
  content: "";
  transform: translateX(-50%);
}

.profile-icon::before {
  top: 1px;
  width: 6px;
  height: 6px;
  border: 1.8px solid currentColor;
  border-radius: 999px;
}

.profile-icon::after {
  bottom: 0;
  width: 13px;
  height: 7px;
  border: 1.8px solid currentColor;
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
}

.nav-menu-trigger:hover,
.nav-menu-trigger:focus-visible,
.nav-menu[open] > .nav-menu-trigger {
  background: #dbeafe;
  color: #1e40af;
  outline: none;
}

.nav-menu-trigger.is-active,
.nav-menu[open] > .nav-menu-trigger.is-active {
  background: #dee9fc;
  color: #263fa8;
}

.profile-trigger:hover,
.profile-trigger:focus-visible,
.profile-menu[open] > .profile-trigger {
  border-color: #dbeafe;
  background: #dbeafe;
  color: #1e40af;
  outline: none;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 30;
  display: grid;
  min-width: 168px;
  gap: 2px;
  padding: 6px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.13);
}

.nav-dropdown-right {
  right: 0;
  left: auto;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 34px;
  padding: 7px 9px;
  border-radius: 10px;
  color: #475569;
  text-decoration: none;
  white-space: nowrap;
  transition: background 150ms ease, color 150ms ease;
}


.nav-dropdown-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-dropdown-item:hover,
.nav-dropdown-item:focus-visible,
.nav-dropdown-item.is-active {
  background: #dbeafe;
  color: #1e40af;
  outline: none;
}

.nav-dropdown-item.is-disabled {
  color: #94a3b8;
  cursor: default;
}

.nav-dropdown-item.is-disabled:hover {
  background: transparent;
  color: #94a3b8;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 0.7rem;
  font-weight: 800;
}

.account-email {
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-shell {
  width: min(100% - 32px, 840px);
  margin: 0 auto;
  padding: 58px 0 56px;
}

/* ==========================================================
   HOMEPAGE HERO — DESKTOP
   "Finally, math clicks"
   ========================================================== */

.hero {
  margin: 0 auto;
  max-width: 760px;
  padding-bottom: 38px;
  text-align: center;
}

.eyebrow,
.section-kicker {
  margin-bottom: 10px;
  color: var(--primary);
  font-size: 1.25rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: var(--text);
  font-size: 20.48px;
  font-weight: 450;
  line-height: 1.35;
  text-transform: none;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2.4rem, 7.8vw, 4.2rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.12rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.composer-card,
.solution-box,
.example-card {
  background: var(--surface-raised);
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.composer-card {
  position: relative;
  z-index: 5;
  max-width: 840px;
  margin: 0 auto;
  padding: 16px;
  border-radius: 32px;
}

.composer-card.is-drag-over::before {
  content: "";
  position: absolute;
  inset: -4px;
  z-index: 20;
  border: 2px solid rgba(0, 122, 255, 0.72);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 0 0 6px rgba(0, 122, 255, 0.12);
  pointer-events: none;
}

.composer-card.is-drag-over::after {
  content: "Drop photo or file to solve";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 21;
  transform: translate(-50%, -50%);
  width: min(calc(100% - 48px), 360px);
  padding: 15px 18px;
  border-radius: 18px;
  background: rgba(17, 17, 20, 0.88);
  color: #ffffff;
  box-shadow: 0 18px 42px rgba(17, 17, 20, 0.2);
  font-size: 1rem;
  font-weight: 760;
  line-height: 1.25;
  text-align: center;
  pointer-events: none;
}

.history-detail-hero {
  padding-bottom: 24px;
}

.history-detail-page {
  width: min(100% - 32px, 840px);
  padding-top: 32px;
}

.history-detail-shell {
  margin: 0 auto 22px;
  padding-bottom: 5px;
  border-bottom: 1px solid #e5e7eb;
}

.history-detail-nav {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.history-detail-back {
  flex: 0 0 auto;
  color: #111827;
  font-size: 0.98rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.history-detail-back:hover,
.history-detail-back:focus-visible {
  color: #263fa8;
}

.history-detail-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
}

.history-detail-action {
  min-width: 38px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #475569;
  cursor: pointer;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.history-detail-action:hover,
.history-detail-action:focus-visible,
.history-detail-more[open] > .history-detail-action {
  border-color: #e2e8f0;
  background: #f1f5f9;
  color: #111827;
}

.history-detail-action.is-active {
  color: #263fa8;
}

.history-detail-action:focus-visible,
.history-detail-back:focus-visible,
.history-detail-menu-item:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.18);
  outline-offset: 2px;
}

.history-detail-more {
  position: relative;
}

.history-detail-more > summary {
  list-style: none;
}

.history-detail-more > summary::-webkit-details-marker {
  display: none;
}

.history-detail-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  min-width: 150px;
  padding: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.14);
}

.history-detail-menu-item {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #111827;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 400;
  text-align: left;
}

.history-detail-menu-item:hover,
.history-detail-menu-item:focus-visible {
  background: #f3f4f6;
}

.history-detail-menu-item.is-active {
  color: #263fa8;
}

.history-detail-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 25;
  width: min(180px, calc(100vw - 32px));
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.16);
  white-space: normal;
}

.problem-details-list {
  display: grid;
  gap: 4px;
}

.problem-detail-menu-separator {
  height: 1px;
  margin: 6px 2px;
  background: #e5e7eb;
}

.problem-detail-row {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #111827;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.problem-detail-row:hover,
.problem-detail-row:focus-visible {
  background: #f3f4f6;
  outline: none;
}

.problem-detail-row.is-readonly {
  cursor: default;
}

.problem-detail-row.is-readonly:hover {
  background: transparent;
}

.problem-detail-row-danger {
  color: #b42318;
}

.problem-detail-row-danger .problem-detail-label,
.problem-detail-row-danger .problem-detail-icon {
  color: #b42318;
}

.problem-detail-row-danger:hover,
.problem-detail-row-danger:focus-visible {
  background: #fff1f0;
}

.problem-detail-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.problem-detail-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.problem-detail-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.problem-detail-label {
  color: #111827;
  font-size: 0.9rem;
  font-weight: 400;
}

.problem-detail-summary {
  overflow: hidden;
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.problem-details-list[hidden] {
  display: none;
}

.problem-detail-textarea,
.problem-detail-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  color: #111827;
  font: inherit;
  font-size: 0.92rem;
}

.problem-detail-textarea {
  min-height: 126px;
  padding: 11px 12px;
  resize: vertical;
}

.problem-detail-input {
  min-height: 42px;
  padding: 0 12px;
}

.problem-detail-textarea:focus,
.problem-detail-input:focus {
  border-color: #93c5fd;
  outline: 3px solid rgba(37, 99, 235, 0.16);
  outline-offset: 0;
}

.problem-detail-readonly-value {
  margin: 0;
  color: #111827;
  font-weight: 650;
}

.problem-detail-unavailable {
  margin: 0;
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.45;
}

.problem-detail-readonly-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.problem-detail-readonly-meta div {
  display: grid;
  gap: 3px;
}

.problem-detail-readonly-meta span {
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 760;
  text-transform: uppercase;
}

.problem-detail-readonly-meta strong {
  color: #111827;
  font-size: 0.82rem;
  font-weight: 600;
}

.history-detail-problem {
  margin: 22px 0 0;
  color: #202024;
  font-size: 1.00rem;
  font-weight: 400;
  line-height: 1.70;
  overflow-wrap: anywhere;
}

.history-detail-page #final-answer-content {
  font-size: 1.0rem;
  font-weight: 400;
  line-height: 1.75x;
}

.history-detail-problem .katex-display {
  margin: 0;
  overflow-x: auto;
  overflow-y: hidden;
  text-align: left;
}

.notebook-inline-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.notebook-inline-tag-list {
  display: contents;
}

.notebook-inline-tag-add[hidden],
.notebook-inline-tag-editor[hidden],
.history-note-popover[hidden] {
  display: none;
}

.notebook-inline-tag-chip,
.notebook-inline-tag-add,
.notebook-inline-tag-editor input,
.history-note-trigger {
  min-height: 30px;
  border: 0;
  border-radius: 10px;
  background: rgba(60, 60, 67, 0.08);
  color: #3f3f46;
  font-size: 0.84rem;
  font-weight: 400;
}

.notebook-inline-tag-chip {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  overflow: hidden;
}

.notebook-inline-tag-link {
  min-width: 0;
  padding: 6px 8px 6px 10px;
  color: inherit;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.notebook-inline-tag-remove,
.notebook-inline-tag-add,
.history-note-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.notebook-inline-tag-remove {
  align-self: stretch;
  min-width: 28px;
  padding: 0 8px 0 4px;
  background: transparent;
  color: #71717a;
}

.notebook-inline-tag-add {
  padding: 0 10px;
}

.history-note-area {
  position: relative;
  display: inline-flex;
}

.history-note-trigger {
  gap: 6px;
  padding: 0 10px;
  color: #64748b;
  font-weight: 400;
}

.history-note-trigger.is-saved .history-note-icon {
  color: #93c5fd;
}

.history-note-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.history-note-icon svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.history-note-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  width: min(340px, calc(100vw - 48px));
  padding: 12px 12px 28px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.14);
}

.history-note-editor .problem-detail-textarea {
  min-height: 142px;
  padding: 4px 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #334155;
  font-size: 0.94rem;
  font-weight: 400;
  line-height: 1.5;
}

.history-note-editor .problem-detail-textarea:focus {
  border-color: transparent;
  outline: none;
}

.history-note-trigger:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.16);
  outline-offset: 3px;
}

.notebook-inline-tag-editor input {
  width: min(260px, calc(100vw - 48px));
  padding: 0 10px;
  border: 0;
  outline: none;
  box-shadow: none;
}

.notebook-inline-tag-chip:hover,
.notebook-inline-tag-chip:focus-within,
.notebook-inline-tag-add:hover,
.notebook-inline-tag-add:focus-visible,
.notebook-inline-tag-editor input:focus,
.history-note-trigger:hover,
.history-note-trigger:focus-visible,
.history-note-trigger[aria-expanded="true"] {
  background: rgba(60, 60, 67, 0.14);
  box-shadow: none;
}

.notebook-inline-tag-message {
  flex-basis: 100%;
  min-height: 18px;
  margin: 0;
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.35;
}

.notebook-inline-tag-message.is-error {
  color: #b42318;
}

.delete-solve-dialog {
  width: min(380px, calc(100vw - 32px));
  padding: 22px;
  border: 0;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 28px 78px rgba(15, 23, 42, 0.26);
  color: #111827;
}

.delete-solve-dialog::backdrop {
  background: rgba(15, 23, 42, 0.34);
}

.delete-solve-dialog h2,
.delete-solve-dialog p {
  margin: 0;
}

.delete-solve-dialog form {
  display: grid;
  gap: 12px;
}

.delete-solve-dialog h2 {
  font-size: 1.14rem;
  font-weight: 760;
}

.delete-solve-dialog p {
  color: #475569;
  font-size: 0.93rem;
  line-height: 1.45;
}

.delete-solve-message:empty {
  display: none;
}

.delete-solve-message {
  color: #b42318;
  font-weight: 650;
}

.delete-solve-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.delete-solve-cancel,
.delete-solve-confirm {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 720;
}

.delete-solve-cancel {
  background: #f1f5f9;
  color: #111827;
}

.delete-solve-confirm {
  background: #b42318;
  color: #ffffff;
}

.delete-solve-cancel:hover,
.delete-solve-cancel:focus-visible,
.delete-solve-confirm:hover,
.delete-solve-confirm:focus-visible {
  outline: 3px solid rgba(180, 35, 24, 0.16);
  outline-offset: 2px;
}

.delete-solve-cancel:disabled,
.delete-solve-confirm:disabled {
  cursor: default;
  opacity: 0.58;
}

.history-problem-card {
  margin-bottom: 26px;
}

.history-problem-content {
  padding: 8px 8px 10px;
  color: #202024;
  font-size: 1.08rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.history-page {
  max-width: 960px;
}

.history-hero {
  padding-bottom: 28px;
}

.history-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin: 0 auto 22px;
}

.notebook-feature-grid {
  display: grid;
  grid-template-columns: minmax(0, 860px);
  justify-content: center;
  margin: 0 auto 26px;
}

.notebook-feature-card {
  position: relative;
  display: flex;
  min-height: 430px;
  flex-direction: column;
  overflow: hidden;
  padding: 28px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 30px;
  background: #ffffff;
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 22px 54px rgba(15, 23, 42, 0.09);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.history-page .notebook-feature-card {
  gap: 0;
}

.notebook-feature-card:focus-within {
  border-color: #bfdbfe;
  outline: none;
  box-shadow: 0 22px 50px rgba(37, 99, 235, 0.14);
}

.notebook-feature-history {
  border-color: rgba(37, 99, 235, 0.2);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.notebook-feature-shape {
  position: absolute;
  top: -58px;
  right: -58px;
  width: 204px;
  height: 172px;
  border-radius: 54px;
  opacity: 0.58;
  pointer-events: none;
  transform: rotate(18deg);
}

.notebook-feature-history .notebook-feature-shape {
  background:
    radial-gradient(circle at 30% 30%, rgba(96, 165, 250, 0.42), transparent 54%),
    linear-gradient(135deg, rgba(219, 234, 254, 0.92), rgba(147, 197, 253, 0.12));
}

.notebook-feature-icon {
  position: relative;
  z-index: 1;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 18px;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.1);
}

.notebook-feature-icon svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.notebook-feature-history .notebook-feature-icon {
  background: #eff6ff;
  color: #2563eb;
}

.notebook-feature-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
}

.history-page .notebook-feature-copy {
  margin-bottom: 20px;
}

.notebook-feature-copy h1,
.notebook-feature-copy h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2rem);
  line-height: 1.05;
}

.notebook-feature-copy p {
  max-width: 34ch;
  margin: 0;
  color: #64748b;
  line-height: 1.48;
}

.notebook-feature-kicker {
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 820;
  text-transform: uppercase;
}

.notebook-feature-tabs {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-page .notebook-feature-tabs {
  gap: 12px;
  margin-top: 18px;
  margin-bottom: 22px;
}

.notebook-feature-tab {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: #f1f5f9;
  color: #111827;
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 780;
  text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.history-page .notebook-feature-tab {
  border-radius: 8px;
}

.notebook-feature-tab:hover,
.notebook-feature-tab:focus-visible {
  background: #e2e8f0;
  border-color: #cbd5e1;
  outline: none;
}

.notebook-feature-tab.is-active {
  background: #111111;
  border-color: #111111;
  box-shadow: none;
  color: #ffffff;
}

.notebook-feature-tab[aria-disabled="true"] {
  color: #111827;
  cursor: default;
}

.notebook-feature-tab[aria-disabled="true"]:hover {
  background: #f1f5f9;
  border-color: transparent;
}

.notebook-active-filter {
  position: relative;
  z-index: 1;
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 6px 8px 6px 10px;
  border-radius: 10px;
  background: rgba(60, 60, 67, 0.08);
  color: #475569;
  font-size: 0.84rem;
  font-weight: 650;
}

.notebook-active-filter span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.notebook-active-filter a {
  flex: 0 0 auto;
  color: #111827;
  font-weight: 780;
  text-decoration: none;
}

.notebook-active-filter a:hover,
.notebook-active-filter a:focus-visible {
  color: #263fa8;
  outline: none;
}

.notebook-active-tag-filters {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.notebook-active-tag-chip {
  display: inline-flex;
  max-width: 100%;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 10px;
  border: 0;
  border-radius: 10px;
  background: rgba(60, 60, 67, 0.08);
  color: #475569;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.2;
}

.notebook-active-tag-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.notebook-active-tag-remove {
  display: inline-flex;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #64748b;
  font-size: 0.92rem;
  font-weight: 760;
  line-height: 1;
  text-decoration: none;
}

.notebook-active-tag-chip:hover,
.notebook-active-tag-chip:focus-within {
  background: rgba(60, 60, 67, 0.14);
}

.notebook-active-tag-remove:hover,
.notebook-active-tag-remove:focus-visible {
  background: rgba(60, 60, 67, 0.1);
  color: #111827;
  outline: none;
}

.notebook-placeholder-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  padding: 20px;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.notebook-placeholder-panel p {
  max-width: 44ch;
  margin: 0;
  color: #475569;
  line-height: 1.5;
}

.notebook-feature-search {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.history-page .notebook-feature-search {
  margin-bottom: 36px;
}

.notebook-feature-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #0f172a;
  font-size: 0.95rem;
  outline: none;
}

.notebook-feature-search input::placeholder {
  color: #94a3b8;
}

.notebook-feature-filter-button {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  background: #eff6ff;
  color: #2563eb;
  text-decoration: none;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.notebook-feature-filter-button:hover,
.notebook-feature-filter-button:focus-visible {
  background: #dbeafe;
  color: #1e40af;
  outline: none;
  transform: translateY(-1px);
}

.notebook-feature-filter-button:disabled {
  color: #93c5fd;
  cursor: default;
  opacity: 0.78;
  transform: none;
}

.notebook-feature-filter-button svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.notebook-feature-preview {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.notebook-feature-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 12px 14px;
  border: 1px solid rgba(226, 232, 240, 0.72);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  color: #0f172a;
  text-decoration: none;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.notebook-feature-preview-row:hover,
.notebook-feature-preview-row:focus-visible {
  border-color: #bfdbfe;
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.1);
}

.notebook-feature-preview-row span:first-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.notebook-feature-preview-row strong {
  overflow: hidden;
  font-size: 0.92rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notebook-feature-preview-row small {
  color: #64748b;
  font-size: 0.78rem;
}

.notebook-feature-preview-row.is-empty {
  color: #64748b;
}

.notebook-empty-action {
  justify-self: end;
  padding: 8px 12px;
  border: 1px solid #111114;
  border-radius: 999px;
  color: #111114;
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.notebook-empty-action:hover,
.notebook-empty-action:focus-visible {
  background: #111114;
  color: #ffffff;
  outline: none;
}

.notebook-feature-link {
  position: relative;
  z-index: 1;
  width: max-content;
  color: #2563eb;
  font-size: 0.9rem;
  font-weight: 820;
  text-decoration: none;
}

.notebook-feature-link:hover,
.notebook-feature-link:focus-visible {
  color: #1e40af;
  outline: none;
  text-decoration: underline;
}

.notebook-feature-results {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
  margin-top: 4px;
}

.notebook-feature-result-row {
  position: relative;
  z-index: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 12px 14px;
  border: 1px solid rgba(226, 232, 240, 0.72);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  color: #0f172a;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.notebook-feature-result-row:hover,
.notebook-feature-result-row:focus-within {
  z-index: 1;
  background: #f3f4f6;
  border-color: #d1d5db;
  outline: none;
}

.history-row-link {
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.history-row-link:focus-visible {
  border-radius: 8px;
  outline: 2px solid #93c5fd;
  outline-offset: 3px;
}

.history-row-content {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.history-row-subject,
.history-row-result {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #a1a1aa;
  font-size: 0.70rem;
  font-weight: 400;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-row-result {
  color: #a1a1aa;
}

.history-row-content strong {
  overflow: hidden;
  color: #0f172a;
  font-size: 0.94rem;
  font-weight: 450;
  line-height: 1.22;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-row-time {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
}

.history-row-menu-root {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
}

.history-row-menu-trigger {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1.28rem;
  font-weight: 800;
  line-height: 1;
  opacity: 0;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, opacity 150ms ease;
}

.notebook-feature-result-row:hover .history-row-menu-trigger,
.notebook-feature-result-row:focus-within .history-row-menu-trigger,
.history-row-menu-trigger[aria-expanded="true"] {
  opacity: 1;
}

.history-row-menu-trigger:hover,
.history-row-menu-trigger:focus-visible {
  background: #ffffff;
  border-color: #d1d5db;
  color: #64748b;
  outline: none;
}

.history-row-menu {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 10;
  display: grid;
  min-width: 148px;
  padding: 6px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
}

.history-row-menu.opens-upward {
  top: auto;
  bottom: calc(100% + 8px);
}

.history-row-menu[hidden] {
  display: none;
}

.history-row-menu-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #111827;
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 450;
  text-align: left;
  text-decoration: none;
}

.history-row-menu-item:hover,
.history-row-menu-item:focus-visible {
  background: #f3f4f6;
  color: #111827;
  outline: none;
}

.history-row-menu-item[aria-disabled="true"] {
  color: #111827;
  cursor: default;
}

.history-row-menu-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  color: #111827;
  font-size: 0.95rem;
}

.history-row-menu-icon svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.history-row-menu-star.is-starred .history-row-menu-icon {
  color: #111827;
}

.history-row-menu-delete,
.history-row-menu-delete .history-row-menu-icon {
  color: #b42318;
}

.history-row-menu-delete:hover,
.history-row-menu-delete:focus-visible {
  background: #fff1f0;
  color: #b42318;
}

.notebook-feature-result-row.is-empty {
  pointer-events: none;
}

.history-pagination {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 10px;
}

.history-pagination-pages {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
}

.history-pagination-link,
.history-pagination-ellipsis {
  display: inline-flex;
  min-width: 34px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #475569;
  font-size: 0.86rem;
  font-weight: 760;
  text-decoration: none;
}

.history-pagination-link:hover,
.history-pagination-link:focus-visible {
  background: #dbeafe;
  color: #1e40af;
  outline: none;
}

.history-pagination-link.is-active {
  background: #2563eb;
  color: #ffffff;
}

.history-pagination-link.is-disabled,
.history-pagination-ellipsis {
  color: #94a3b8;
}

.history-pagination-link.is-disabled {
  pointer-events: none;
}

.history-pagination-step {
  padding: 0 12px;
}

.history-stat-card,
.history-list-card {
  background: var(--surface-raised);
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 54px rgba(17, 17, 20, 0.08);
}

.history-stat-card {
  min-width: 0;
  padding: 18px 20px;
  border-radius: 24px;
}

.history-stat-card p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.history-stat-card strong {
  display: block;
  color: var(--text);
  font-size: 2rem;
  line-height: 1;
}

.history-list-card {
  margin-bottom: 18px;
  overflow: hidden;
  border-radius: 30px;
}

.history-list-heading {
  padding: 24px 26px 18px;
  border-bottom: 1px solid var(--border);
}

.history-list-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 750;
}

.history-list {
  background: #ffffff;
}

.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px 18px 26px;
  color: inherit;
  text-decoration: none;
  transition: background 150ms ease;
}

.history-row + .history-row {
  border-top: 1px solid rgba(60, 60, 67, 0.1);
}

.history-row:hover,
.history-row:focus-visible {
  background: rgba(0, 122, 255, 0.06);
  outline: none;
}

.history-row-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.history-row-title,
.history-row-meta {
  display: block;
}

.history-row-title {
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 400;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-row-meta {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.history-row-answer {
  display: block;
  color: #202024;
  font-size: 0.94rem;
  font-weight: 650;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-row-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.notebook-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 4px 9px;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 999px;
  background: rgba(118, 118, 128, 0.08);
  color: #4d4d52;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
}

.notebook-badge-favorite {
  border-color: rgba(255, 149, 0, 0.25);
  background: rgba(255, 149, 0, 0.12);
  color: #965600;
}

.notebook-badge-review {
  border-color: rgba(0, 122, 255, 0.24);
  background: rgba(0, 122, 255, 0.1);
  color: #0757aa;
}

.notebook-badge-tag {
  border-color: rgba(52, 199, 89, 0.2);
  background: rgba(52, 199, 89, 0.09);
  color: #226b36;
}

.history-row-action {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: rgba(118, 118, 128, 0.1);
  color: var(--text);
  font-weight: 800;
}

.history-empty {
  margin: 0;
  padding: 26px;
  background: #ffffff;
  color: var(--muted);
  font-weight: 650;
}

.notebook-detail-card {
  max-width: 760px;
  margin: 0 auto 26px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 30px;
  background: var(--surface-raised);
  box-shadow: var(--shadow);
}

.notebook-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.notebook-detail-heading .eyebrow {
  margin-bottom: 6px;
}

.notebook-detail-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 760;
}

.notebook-toggle-group {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.notebook-toggle-button,
.notebook-save-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 999px;
  background: rgba(118, 118, 128, 0.1);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 750;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.notebook-toggle-button:hover,
.notebook-save-button:hover {
  background: rgba(118, 118, 128, 0.16);
}

.notebook-toggle-button:active,
.notebook-save-button:active {
  transform: scale(0.98);
}

.notebook-toggle-button:focus-visible,
.notebook-save-button:focus-visible,
.notebook-note-input:focus,
.notebook-tags-input:focus {
  outline: 3px solid rgba(0, 122, 255, 0.18);
  outline-offset: 2px;
}

.notebook-toggle-button.is-active {
  border-color: rgba(0, 122, 255, 0.26);
  background: rgba(0, 122, 255, 0.1);
  color: #0757aa;
}

.notebook-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.notebook-meta-item {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid rgba(60, 60, 67, 0.1);
  border-radius: 18px;
  background: #ffffff;
}

.notebook-meta-item span,
.notebook-field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.notebook-meta-item strong {
  display: block;
  color: var(--text);
  font-size: 0.96rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.notebook-note-input,
.notebook-tags-input {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 14px;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(60, 60, 67, 0.02);
  color: var(--text);
  font: inherit;
}

.notebook-note-input {
  min-height: 108px;
  padding: 13px 14px;
  resize: vertical;
}

.notebook-tags-input {
  min-height: 46px;
  padding: 0 14px;
}

.notebook-detail-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.notebook-save-button:disabled {
  cursor: default;
  opacity: 0.55;
}

.notebook-save-message {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.notebook-save-message:empty {
  display: none;
}

.notebook-save-message.is-error {
  color: #b42318;
}

.notebook-save-message.is-success {
  position: absolute;
  right: 28px;
  bottom: 8px;
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  margin: 0;
  border: 1px solid rgba(20, 136, 63, 0.26);
  border-radius: 50%;
  background: #ffffff;
  color: #14883f;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.notebook-tags-cloud {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.notebook-tag-cloud-item {
  display: inline-flex;
  max-width: 100%;
  align-items: baseline;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(60, 60, 67, 0.08);
  color: #27272a;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-decoration: none;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.notebook-tag-cloud-item:hover,
.notebook-tag-cloud-item:focus-visible {
  background: rgba(60, 60, 67, 0.14);
  color: #111827;
  outline: none;
  box-shadow: none;
  transform: none;
}

.notebook-tag-cloud-item[data-tier="1"] {
  font-size: 0.9rem;
}

.notebook-tag-cloud-item[data-tier="2"] {
  font-size: 1rem;
}

.notebook-tag-cloud-item[data-tier="3"] {
  font-size: 1.1rem;
}

.notebook-tag-cloud-item[data-tier="4"] {
  font-size: 1.2rem;
}

.notebook-tag-cloud-name {
  min-width: 0;
  font-weight: 760;
}

.notebook-tag-cloud-count {
  flex: 0 0 auto;
  color: #71717a;
  font-size: 0.82em;
  font-weight: 720;
}

.notebook-tags-empty {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 16px;
  background: rgba(60, 60, 67, 0.06);
}

.notebook-tags-empty strong,
.notebook-tags-empty p {
  margin: 0;
}

.notebook-tags-empty p {
  color: #64748b;
}

.notebook-tags-empty a {
  width: fit-content;
  color: #111827;
  font-weight: 760;
  text-decoration: none;
}

.notebook-tags-empty a:hover,
.notebook-tags-empty a:focus-visible {
  color: #263fa8;
  outline: none;
}

.notebook-review-page {
  max-width: 900px;
}

.notebook-review-entry,
.notebook-review-card,
.notebook-review-complete {
  background: var(--surface-raised);
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 54px rgba(17, 17, 20, 0.08);
}

.notebook-review-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 20px 22px;
  border-radius: 28px;
}

.notebook-review-entry h2,
.notebook-review-complete h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 760;
}

.notebook-review-entry p:not(.eyebrow),
.notebook-review-complete p:not(.eyebrow) {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
  font-weight: 650;
  line-height: 1.45;
}

.notebook-review-link,
.notebook-review-detail-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: #111114;
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 760;
  text-decoration: none;
  white-space: nowrap;
  transition: background 150ms ease, transform 150ms ease;
}

.notebook-review-link:hover,
.notebook-review-link:focus-visible,
.notebook-review-detail-link:hover,
.notebook-review-detail-link:focus-visible {
  background: #2b2b30;
  outline: none;
}

.notebook-review-link:active,
.notebook-review-detail-link:active {
  transform: scale(0.98);
}

button.notebook-review-link {
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.notebook-filter-card {
  margin-bottom: 18px;
  padding: 20px 22px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 28px;
  background: var(--surface-raised);
  box-shadow: 0 18px 54px rgba(17, 17, 20, 0.08);
}

.notebook-filter-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.notebook-filter-heading .eyebrow {
  margin-bottom: 6px;
}

.notebook-filter-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 760;
}

.notebook-clear-filters {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(118, 118, 128, 0.1);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 760;
  text-decoration: none;
  white-space: nowrap;
}

.notebook-clear-filters:hover,
.notebook-clear-filters:focus-visible {
  background: rgba(118, 118, 128, 0.16);
  outline: none;
}

.notebook-filter-form {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(120px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.notebook-filter-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.notebook-filter-search {
  grid-column: span 2;
}

.notebook-filter-field span,
.notebook-filter-check span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.notebook-filter-field input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  box-sizing: border-box;
  padding: 0 12px;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 16px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}

.notebook-filter-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 16px;
  background: #ffffff;
}

.notebook-filter-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #007aff;
}

.notebook-filter-submit {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: #111114;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 760;
  white-space: nowrap;
  transition: background 150ms ease, transform 150ms ease;
}

.notebook-filter-submit:hover {
  background: #2b2b30;
}

.notebook-filter-submit:active {
  transform: scale(0.98);
}

.notebook-filter-field input:focus,
.notebook-filter-check:focus-within,
.notebook-filter-submit:focus-visible {
  outline: 3px solid rgba(0, 122, 255, 0.18);
  outline-offset: 2px;
}

.notebook-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.notebook-active-filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border: 1px solid rgba(0, 122, 255, 0.2);
  border-radius: 999px;
  background: rgba(0, 122, 255, 0.09);
  color: #0757aa;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
}

.notebook-review-card {
  display: grid;
  gap: 18px;
  padding: 24px;
  border-radius: 30px;
}

.notebook-review-card.is-hidden {
  display: none;
}

.notebook-review-progress {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.notebook-review-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.notebook-review-card-heading .eyebrow {
  margin-bottom: 6px;
}

.notebook-review-card-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.32rem;
  font-weight: 760;
}

.notebook-review-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
}

.notebook-review-problem-content,
.notebook-review-answer,
.notebook-review-solution {
  padding: 18px;
  border: 1px solid rgba(60, 60, 67, 0.1);
  border-radius: 20px;
  background: #ffffff;
}

.notebook-review-problem-content {
  color: #202024;
  font-size: 1.08rem;
  line-height: 1.75;
}

.notebook-review-reveals,
.notebook-review-controls,
.notebook-review-rating > div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.notebook-review-answer,
.notebook-review-solution {
  display: none;
}

.notebook-review-answer.is-visible,
.notebook-review-solution.is-visible {
  display: block;
}

.notebook-review-answer p,
.notebook-review-solution p,
.notebook-review-rating p {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

#review-final-answer-content {
  color: #000000;
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

#review-solution-content {
  color: #202024;
  font-size: 1.02rem;
  line-height: 1.78;
  overflow-wrap: anywhere;
}

.notebook-rating-button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(0, 122, 255, 0.24);
  border-radius: 999px;
  background: rgba(0, 122, 255, 0.1);
  color: #0757aa;
  cursor: pointer;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 780;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.notebook-rating-button:hover {
  border-color: rgba(0, 122, 255, 0.34);
  background: rgba(0, 122, 255, 0.16);
}

.notebook-rating-button:active {
  transform: scale(0.98);
}

.notebook-rating-button:disabled {
  cursor: default;
  opacity: 0.55;
}

.notebook-review-complete {
  display: none;
  padding: 28px;
  border-radius: 30px;
  text-align: center;
}

.notebook-review-complete.is-visible {
  display: block;
}

.notebook-review-complete .notebook-review-link {
  margin-top: 18px;
}

.notebook-review-empty-actions {
  padding: 0 26px 26px;
  background: #ffffff;
}

.progress-page {
  max-width: 1040px;
}

.progress-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.progress-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.progress-summary-grid .history-stat-card strong {
  font-size: 1.65rem;
  line-height: 1.12;
}

.progress-panel {
  background: var(--surface-raised);
}

.progress-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
  background: #ffffff;
}

.progress-table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
  background: #ffffff;
}

.progress-table th,
.progress-table td {
  padding: 15px 18px;
  border-bottom: 1px solid rgba(60, 60, 67, 0.1);
  text-align: left;
}

.progress-table th {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.progress-table td {
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 650;
}

.progress-table tbody tr:last-child td {
  border-bottom: 0;
}

.progress-review-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 20px 22px 22px;
  background: #ffffff;
}

.progress-review-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(60, 60, 67, 0.1);
  border-radius: 20px;
  background: rgba(248, 248, 250, 0.84);
}

.progress-review-card p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.progress-review-card strong {
  display: block;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.35;
}

.progress-rating-list {
  display: grid;
  gap: 5px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
}

.progress-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 26px 26px;
  background: #ffffff;
}

/* ==========================================================
   MATH COMPOSER — DESKTOP
   ========================================================== */

.composer-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 4px 12px 8px;
}

.composer-topline h2 {
  font-size: 0.98rem;
  color: var(--text);
  font-weight: 500;
  line-height: 1.3;
}

.input-shell {
  overflow: visible;
}

.input-bar {
  display: grid;
  grid-template-columns: 42px 42px minmax(0, 1fr) 42px 42px 46px;
  grid-template-rows: minmax(48px, auto) 46px;
  align-items: center;
  column-gap: 8px;
  row-gap: 2px;
  min-height: 116px;
  padding: 10px;
  border: 1.5px solid transparent;
  border-radius: 30px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(60, 60, 67, 0.08);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input-bar:focus-within {
  border-color: rgba(0, 122, 255, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(0, 122, 255, 0.12),
    0 0 0 5px rgba(0, 122, 255, 0.12);
}

textarea {
  display: block;
  grid-column: 1 / -1;
  grid-row: 1;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  max-height: 170px;
  resize: none;
  padding: 10px 12px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1.48;
}

textarea::placeholder {
  color: var(--quiet);
}

.attachment-menu {
  grid-column: 1;
  grid-row: 2;
  position: relative;
}

.provider-menu {
  grid-column: 6;
  grid-row: 2;
  justify-self: end;
  position: relative;
  margin-left: 0;
}

.composer-right-actions {
  display: contents;
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.42rem;
  line-height: 1;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease, opacity 150ms ease;
}

.plus-button {
  position: relative;
  isolation: isolate;
  background: transparent;
  color: var(--text);
}

.math-toggle-button {
  grid-column: 2;
  grid-row: 2;
  background: transparent;
  color: var(--text);
}

.math-toggle-button.is-open {
  background: transparent;
  color: var(--text);
}

.math-toggle-button:not(:disabled):hover,
.math-toggle-button:not(:disabled):focus-visible {
  width: 38px;
  height: 38px;
  justify-self: center;
  align-self: center;
  background: var(--fill);
  color: var(--text);
  outline: none;
}

.math-toggle-button.is-open {
  background: transparent;
}

.math-toggle-button.is-open:hover,
.math-toggle-button.is-open:focus-visible {
  background: var(--fill);
}

.composer-chevron {
  display: block;
  width: 13px;
  height: 7px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
  transition: transform 180ms ease;
}

.chevron-icon {
  transform: rotate(0deg);
}

.math-toggle-button.is-open .chevron-icon {
  transform: rotate(180deg);
}

.provider-toggle-button {
  position: relative;
  isolation: isolate;
  background: transparent;
  color: var(--text);
}

.provider-toggle-button::before {
  content: "";
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--fill);
  opacity: 0;
  transition: opacity 150ms ease;
  pointer-events: none;
  z-index: -1;
}

.provider-toggle-button:hover,
.provider-toggle-button:focus-visible,
.provider-toggle-button.is-open {
  background: transparent;
  color: var(--text);
}

.provider-toggle-button:hover::before,
.provider-toggle-button:focus-visible::before,
.provider-toggle-button.is-open::before {
  opacity: 1;
}

.provider-chevron-icon {
  transform: rotate(180deg);
}

.provider-toggle-button.is-open .provider-chevron-icon {
  transform: rotate(0deg);
}

.provider-dropdown {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  display: none;
  min-width: 170px;
  padding: 6px;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.16);
}

.provider-dropdown.is-open {
  display: grid;
  gap: 2px;
}

.provider-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.provider-option:hover,
.provider-option:focus-visible {
  background: var(--fill);
}

.provider-check {
  color: var(--primary);
  font-size: 0.9rem;
  line-height: 1;
}

.provider-option-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.provider-option-name,
.provider-option-model {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-option-name {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.15;
}

.provider-option-model {
  color: #c0c0c0;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.2;
}

.plus-button.is-open {
  background: transparent;
  color: var(--text);
  transform: none;
}

.clear-button {
  grid-column: 5;
  grid-row: 2;
  visibility: hidden;
  background: transparent;
  color: var(--quiet);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.92);
}

.clear-button.is-visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.clear-button:hover,
.clear-button:focus-visible {
  width: 38px;
  height: 38px;
  justify-self: center;
  align-self: center;
  background: var(--fill);
  color: var(--text);
}

.math-toolbar {
  display: none;
  grid-template-rows: 0fr;
  margin-top: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transition: grid-template-rows 220ms ease, margin-top 220ms ease, opacity 180ms ease, transform 220ms ease;
}

.math-toolbar.is-open {
  display: grid;
  grid-template-rows: 1fr;
  margin-top: 12px;
  opacity: 1;
  transform: translateY(0);
}

.math-toolbar > * {
  min-height: 0;
}

.math-tabs {
  display: flex;
  gap: 6px;
  padding: 8px;
  overflow-x: auto;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 0 1px rgba(60, 60, 67, 0.08);
}

.math-tab {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 13px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 400;
}

.math-tab.is-active {
  background: var(--surface);
  color: var(--text);
  font-weight: 510;
  box-shadow: 0 6px 16px rgba(17, 17, 20, 0.08);
}

.math-mode-help {
  margin: 9px 2px 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 400;
  line-height: 1.35;
}

.trig-angle-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 9px 8px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 0 0 1px rgba(60, 60, 67, 0.08);
}

.trig-angle-control[hidden] {
  display: none;
}

.trig-angle-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.trig-angle-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(229, 231, 235, 0.72);
}

.trig-angle-button {
  min-width: 54px;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
  transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.trig-angle-button.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 5px 14px rgba(17, 17, 20, 0.1);
}

.trig-angle-button:hover,
.trig-angle-button:focus-visible {
  color: var(--primary);
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(0, 122, 255, 0.2);
}

.trig-angle-button.is-active:hover,
.trig-angle-button.is-active:focus-visible {
  color: var(--text);
  box-shadow: 0 5px 14px rgba(17, 17, 20, 0.1), inset 0 0 0 1px rgba(0, 122, 255, 0.18);
}

.math-symbol-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
  gap: 8px;
  padding-top: 10px;
}

.math-symbol {
  min-height: 46px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  cursor: pointer;
  font-size: 1.04rem;
  font-weight: 750;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(60, 60, 67, 0.08);
  transition: background 150ms ease, color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.math-symbol:hover,
.math-symbol:focus-visible {
  background: rgba(0, 122, 255, 0.1);
  color: var(--primary);
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(0, 122, 255, 0.18);
}

.calculator-history-panel {
  margin-top: 12px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(60, 60, 67, 0.08);
}

.calculator-history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.calculator-history-heading h3 {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 760;
}

.calculator-history-clear,
.calculator-history-action {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(60, 60, 67, 0.08);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 740;
  transition: background 150ms ease, color 150ms ease, opacity 150ms ease;
}

.calculator-history-action .toolbar-icon {
  width: 16px;
  height: 16px;
}

.calculator-history-copy-action {
  width: 32px;
  padding: 0;
}

.calculator-history-clear:hover,
.calculator-history-clear:focus-visible,
.calculator-history-action:hover,
.calculator-history-action:focus-visible {
  background: rgba(0, 122, 255, 0.1);
  color: var(--primary);
  outline: none;
}

.calculator-history-clear:disabled {
  cursor: default;
  opacity: 0.48;
}

.calculator-history-empty {
  margin-top: 8px;
  color: var(--quiet);
  font-size: 0.82rem;
  font-weight: 640;
}

.calculator-history-empty[hidden] {
  display: none;
}

.calculator-history-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  margin-top: 10px;
  overflow-y: auto;
  list-style: none;
}

.calculator-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.calculator-history-restore {
  display: grid;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(60, 60, 67, 0.08);
  transition: background 150ms ease, box-shadow 150ms ease;
}

.calculator-history-restore:hover,
.calculator-history-restore:focus-visible {
  background: rgba(0, 122, 255, 0.08);
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(0, 122, 255, 0.18);
}

.calculator-history-mode {
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.calculator-history-expression,
.calculator-history-result {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calculator-history-expression {
  margin-top: 3px;
  font-size: 0.9rem;
  font-weight: 760;
}

.calculator-history-result {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 680;
}

.calculator-history-time {
  margin-top: 4px;
  color: var(--quiet);
  font-size: 0.74rem;
  font-weight: 620;
}

.calculator-history-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.attachment-dropdown {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  display: grid;
  width: 180px;
  padding: 6px;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 48px rgba(17, 17, 20, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.98);
  transform-origin: bottom left;
  transition: opacity 160ms ease, transform 160ms ease;
  backdrop-filter: blur(18px) saturate(180%);
}

.attachment-dropdown.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.attachment-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  border-radius: 13px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 400;
  font-size: 0.9rem;
  line-height: 1.15;
  text-align: left;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.attachment-option:hover,
.attachment-option:focus-visible {
  background: rgba(118, 118, 128, 0.12);
  color: var(--text);
  outline: none;
}

.option-icon {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  color: currentColor;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.file-input {
  display: none;
}

.preview-area {
  padding: 0;
}

.selected-file {
  min-height: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
}

.selected-file:not(:empty) {
  margin: 2px 8px 10px;
}

.pdf-page-panel {
  margin: 0 8px 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pdf-page-panel[hidden] {
  display: none;
}

.pdf-page-panel p {
  width: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
}

.pdf-page-panel input {
  width: 64px;
}

.image-preview-wrap {
  display: none;
  position: relative;
  width: calc(100% - 16px);
  height: clamp(360px, 52vw, 460px);
  margin: 0 8px 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--fill);
}

.image-preview-wrap.is-visible {
  display: block;
}

.image-preview {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.roi-layer {
  position: absolute;
  inset: 0;
  display: none;
  overflow: hidden;
  z-index: 5;
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
}

.roi-layer.is-visible {
  display: block;
}

.roi-layer.is-panning {
  cursor: grabbing;
}

.roi-box {
  position: absolute;
  left: 15%;
  top: 20%;
  width: 70%;
  height: 45%;
  min-width: 44px;
  min-height: 44px;
  border: 3px solid #007aff;
  border-radius: 12px;
  background: rgba(0, 122, 255, 0.08);
  box-shadow:
    0 0 0 9999px rgba(17, 17, 20, 0.48),
    0 14px 34px rgba(0, 122, 255, 0.28);
  cursor: move;
  touch-action: none;
  z-index: 1;
}

.roi-box::before {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  content: "";
  pointer-events: none;
}

.roi-handle {
  position: absolute;
  display: block;
  background: #ffffff;
  border: 2px solid #007aff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.24);
  touch-action: none;
  z-index: 2;
}

.roi-handle-corner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.roi-handle-edge {
  border-radius: 999px;
}

.roi-handle-nw {
  top: -9px;
  left: -9px;
  cursor: nwse-resize;
}

.roi-handle-n {
  top: -5px;
  left: 50%;
  width: 30px;
  height: 10px;
  transform: translateX(-50%);
  cursor: ns-resize;
}

.roi-handle-ne {
  top: -9px;
  right: -9px;
  cursor: nesw-resize;
}

.roi-handle-e {
  top: 50%;
  right: -5px;
  width: 10px;
  height: 30px;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.roi-handle-se {
  right: -9px;
  bottom: -9px;
  cursor: nwse-resize;
}

.roi-handle-s {
  bottom: -5px;
  left: 50%;
  width: 30px;
  height: 10px;
  transform: translateX(-50%);
  cursor: ns-resize;
}

.roi-handle-sw {
  bottom: -9px;
  left: -9px;
  cursor: nesw-resize;
}

.roi-handle-w {
  top: 50%;
  left: -5px;
  width: 10px;
  height: 30px;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.remove-image-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 50%;
  background: rgba(17, 17, 20, 0.76);
  color: #ffffff;
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
  pointer-events: auto;
  backdrop-filter: blur(12px);
}

.remove-image-button:hover {
  background: var(--red);
}

.adjust-image-button,
.upload-roi-bottom-actions {
  display: none;
}

.adjust-image-button {
  position: absolute;
  top: 10px;
  right: 52px;
  z-index: 10;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 50%;
  background: rgba(17, 17, 20, 0.76);
  color: #ffffff;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  pointer-events: auto;
  backdrop-filter: blur(12px);
}

.adjust-image-button:hover {
  background: rgba(0, 122, 255, 0.86);
}

.adjust-image-icon {
  display: block;
  width: 19px;
  height: 19px;
}

.upload-roi-tools {
  display: none;
}

.form-message {
  min-height: 22px;
  margin: 12px 8px 0;
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 650;
  text-align: center;
}

.form-message:empty {
  min-height: 0;
  margin-top: 0;
}

.form-message.is-error {
  color: var(--red);
}

.form-message.auth-message {
  color: var(--text);
}

.quota-message {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--text);
}

.quota-message-actions {
  display: inline-flex;
  gap: 10px;
}

.quota-message-actions a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

body.camera-open {
  overflow: hidden;
}

.camera-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(17, 17, 20, 0.54);
  backdrop-filter: blur(18px) saturate(160%);
}

.camera-modal.is-visible {
  display: flex;
}

.camera-panel {
  display: grid;
  width: min(100%, 760px);
  max-height: min(100%, 920px);
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 28px;
  background: rgba(246, 246, 248, 0.96);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.camera-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.camera-header .eyebrow {
  margin: 0 0 4px;
}

.camera-header h2 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.2;
}

.camera-close-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(118, 118, 128, 0.14);
  color: var(--text);
  cursor: pointer;
  font-size: 1.45rem;
  line-height: 1;
}

.camera-preview-wrap {
  position: relative;
  width: 100%;
  height: clamp(320px, 62vh, 560px);
  overflow: hidden;
  border-radius: 22px;
  background: #000000;
}

.camera-preview-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-roi-layer {
  display: block;
}

.camera-roi-layer .roi-box {
  box-shadow:
    0 0 0 9999px rgba(17, 17, 20, 0.1),
    0 14px 34px rgba(0, 122, 255, 0.28);
}

.camera-hint {
  margin: -2px 2px 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  text-align: center;
}

.camera-zoom-controls {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.camera-zoom-controls.is-visible {
  display: flex;
}

.camera-zoom-button,
.camera-zoom-indicator {
  min-height: 42px;
  border-radius: 999px;
  background: rgba(118, 118, 128, 0.14);
  color: var(--text);
  font-weight: 750;
}

.camera-zoom-button {
  width: 42px;
  cursor: pointer;
  font-size: 1.24rem;
  line-height: 1;
}

.camera-zoom-button:disabled {
  cursor: default;
  opacity: 0.5;
}

.camera-zoom-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 0 12px;
  font-size: 0.9rem;
}

.camera-actions {
  display: grid;
  grid-template-columns: 1fr 56px 1.4fr;
  gap: 10px;
}

.camera-secondary-button,
.camera-light-button,
.camera-capture-button {
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 750;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.camera-secondary-button {
  background: rgba(118, 118, 128, 0.14);
  color: var(--text);
}

.camera-light-button {
  display: grid;
  place-items: center;
  background: rgba(118, 118, 128, 0.14);
  color: var(--text);
  font-size: 1.24rem;
}

.camera-light-button.is-active {
  background: rgba(255, 204, 0, 0.26);
  color: #5f4700;
}

.camera-capture-button {
  background: #000000;
  color: #ffffff;
}

.camera-light-button:disabled,
.camera-capture-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.camera-modal.camera-light-on .camera-preview-wrap::after {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: rgba(255, 255, 255, 0.24);
  content: "";
  pointer-events: none;
}

.solve-button,
.new-question-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 44px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 750;
  letter-spacing: 0;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease, opacity 150ms ease;
}

.solve-button {
  grid-column: 6;
  grid-row: 2;
  visibility: hidden;
  width: 46px;
  min-width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 0;
  border-radius: 50%;
  background: #000000;
  color: #ffffff;
  font-size: 1.32rem;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.92);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.input-bar.has-content .provider-menu {
  grid-column: 4;
}

.solve-button.is-visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.solve-button:hover {
  background: #111111;
}

.solve-button:disabled {
  cursor: wait;
  opacity: 0.64;
}

.solve-activity-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.solve-activity-dot {
  display: block;
  width: 4.8px;
  height: 4.8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.42;
  transform: scale(0.96);
  animation: solve-activity-dot-pulse 1.02s ease-in-out infinite;
}

.solve-activity-dot:nth-child(2) {
  animation-delay: 0.34s;
}

.solve-activity-dot:nth-child(3) {
  animation-delay: 0.68s;
}

@keyframes solve-activity-dot-pulse {
  0%,
  66%,
  100% {
    opacity: 0.42;
    transform: scale(0.96);
  }

  33% {
    opacity: 1;
    transform: scale(1.08);
  }
}

.new-question-button.is-hidden {
  display: none;
}

.icon-button:active,
.attachment-option:active,
.math-symbol:active,
.solve-button:active,
.new-question-button:active,
.remove-image-button:active,
.adjust-image-button:active,
.upload-roi-mode-button:active,
.upload-roi-tool-button:active,
.upload-roi-reset-view-button:active,
.upload-roi-done-button:active,
.camera-zoom-button:active {
  transform: scale(0.97);
}

.plus-button.is-open:active {
  transform: scale(0.97);
}

.plus-button:active,
.plus-button.is-open:active,
.math-toggle-button:active,
.provider-toggle-button:active,
.clear-button:active {
  transform: none;
}

.icon-button:focus-visible,
.solve-button:focus-visible,
.new-question-button:focus-visible,
.math-symbol:focus-visible,
.remove-image-button:focus-visible,
.adjust-image-button:focus-visible,
.upload-roi-mode-button:focus-visible,
.upload-roi-tool-button:focus-visible,
.upload-roi-reset-view-button:focus-visible,
.upload-roi-done-button:focus-visible,
.camera-zoom-button:focus-visible,
.nav-dropdown-item:focus-visible,
.nav-menu-trigger:focus-visible,
.profile-trigger:focus-visible,
.brand:focus-visible {
  outline: 3px solid rgba(0, 122, 255, 0.3);
  outline-offset: 2px;
}

.solution-workspace {
  display: none;
  max-width: 840px;
  margin: 26px auto 0;
}

.solution-workspace.is-hidden {
  display: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.solution-workspace.is-visible {
  display: block;
  animation: solution-in 260ms ease-out;
}

body.solution-focus-mode .practice-prompts-section,
body.solution-focus-mode .homepage-lower-content {
  display: none;
}

.solution-box {
  overflow: hidden;
  border: 1px solid rgba(60, 60, 67, 0.1);
  border-radius: 30px;
  background: #ffffff;
  box-shadow: 0 22px 70px rgba(17, 17, 20, 0.1);
}

.solution-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 28px 18px;
  border-bottom: 1px solid var(--border);
}

.solution-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.55rem;
  line-height: 1.18;
  font-weight: 400;
}

.solution-heading-title {
  display: grid;
  gap: 5px;
}

.solution-model-version {
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
}

.solution-heading-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.toolbar-icon {
  display: block;
  width: 19px;
  height: 19px;
  object-fit: contain;
  pointer-events: none;
}

.copy-icon-button,
.print-solution-button,
.workspace-favorite-button {
  position: relative;
  display: inline-grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  transition: opacity 150ms ease, transform 150ms ease;
}

.copy-icon-button .copy-icon {
    opacity: 0.60;
}

.workspace-favorite-button {
  font-size: 1.15rem;
  line-height: 1;
}

.workspace-favorite-button.is-active {
  color: #111827;
}

.copy-icon-button:hover,
.print-solution-button:hover,
.workspace-favorite-button:hover {
  background: rgba(118, 118, 128, 0.16);
}

.copy-icon-button.is-copied {
  border-color: rgba(52, 199, 89, 0.28);
  background: rgba(52, 199, 89, 0.12);
  color: #1d7f39;
}

.copy-icon-button:active,
.print-solution-button:active,
.workspace-favorite-button:active {
  transform: scale(0.96);
}

.copy-icon-button:focus-visible,
.print-solution-button:focus-visible,
.workspace-favorite-button:focus-visible {
  outline: 3px solid rgba(0, 0, 0, 0.18);
  outline-offset: 2px;
}

.solution-body {
  padding: 26px 28px 30px;
}

.print-problem-card {
  display: none;
}

.authenticated-home .solution-workspace .print-problem-card.has-content {
  display: block;
  margin: 0 0 16px;
  padding: 20px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 14px 38px rgba(17, 17, 20, 0.08);
}

.authenticated-home .solution-workspace .print-problem-card p {
  margin: 0 0 8px;
  color: #5b6676;
  font-size: 0.78rem;
  font-weight: 400;
}

.authenticated-home .solution-workspace #print-problem-content {
  color: #202024;
  font-size: 1.08rem;
  font-weight: 400;
  line-height: 1.4;
}

.final-answer-card {
  display: none;
  margin-bottom: 16px;
  padding: 20px;
  /* border: 1px solid rgba(0, 0, 0, 0.08); */
  border: 1px solid #c9def5;
  border-radius: 22px;
  background: #f0f8ff;
  box-shadow: 0 14px 38px rgba(17, 17, 20, 0.08);
}

.final-answer-card.is-visible {
  display: block;
}

.final-answer-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.final-answer-card p {
  margin: 0 0 10px;
  color: #8b8b8f;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
}

.final-answer-verification {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}

.final-answer-verification[hidden] {
  display: none;
}

.final-answer-verification.is-verified {
  color: #1d7f39;
}

.final-answer-verification.needs-review {
  color: #9a5a00;
}

#final-answer-content {
  color: #000000;
  font-size: 1.13rem;
  font-weight: 430;
  line-height: 1.55;
  overflow-wrap: anywhere;
  padding-bottom: 6px;
  white-space: pre-wrap;
}

.graph-panel {
  display: none;
  margin: 4px 0 30px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid rgba(60, 60, 67, 0.14);
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfd 100%);
  box-shadow: 0 18px 44px rgba(17, 17, 20, 0.07);
}

.graph-panel.is-visible {
  display: block;
}

.graph-panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 8px 12px;
}

.graph-panel-header h3 {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.2;
}

.graph-panel-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  overflow-wrap: anywhere;
  text-align: right;
}

#graph-canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 12 / 7;
  overflow: hidden;
  border: 1px solid rgba(60, 60, 67, 0.08);
  border-radius: 16px;
  background: #ffffff;
}

#graph-canvas.is-hidden {
  display: none;
}

.graph-image {
  display: none;
  width: 100%;
  max-width: 100%;
  height: auto;
  overflow: hidden;
  border: 1px solid rgba(60, 60, 67, 0.08);
  border-radius: 16px;
  background: #ffffff;
}

.graph-image.is-visible {
  display: block;
}

.graph-status-message {
  display: none;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.graph-status-message.is-visible {
  display: block;
}

#solution-content {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  color: #202024;
  font-size: 1.00rem;
  line-height: 1.70;
}

.followup-thread {
  display: grid;
  gap: 24px;
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid rgba(60, 60, 67, 0.1);
}

.followup-thread[hidden] {
  display: none;
}

.followup-exchange {
  display: grid;
  gap: 14px;
}

.followup-prompt {
  justify-self: end;
  width: fit-content;
  max-width: min(82%, 560px);
  padding: 12px 16px;
  border: 1px solid rgba(118, 118, 128, 0.16);
  border-radius: 18px;
  background: #f4f4f6;
  color: #202024;
  font-size: 0.98rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.followup-response {
  max-width: 100%;
  color: #202024;
  font-size: 1.04rem;
  line-height: 1.82;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.followup-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: end;
  gap: 10px;
  margin-top: 28px;
  padding: 12px;
  border: 1px solid rgba(60, 60, 67, 0.13);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(17, 17, 20, 0.06);
}

.followup-composer textarea {
  min-height: 42px;
  max-height: 180px;
  resize: none;
  border: 0;
  outline: 0;
  color: var(--text);
  font: inherit;
  line-height: 1.45;
}

.followup-composer textarea::placeholder {
  color: var(--muted);
}

.followup-submit-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #000000;
  color: #ffffff;
  cursor: pointer;
  font-size: 1.18rem;
}

.followup-submit-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.followup-message {
  min-height: 1.2em;
  margin: 10px 4px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.followup-message.is-error {
  color: #b42318;
}

.solution-text-fallback,
.solution-step-list {
  white-space: normal;
}

.verification-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 0 0 18px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.verification-badge-verified {
  border: 1px solid rgba(52, 199, 89, 0.28);
  background: rgba(52, 199, 89, 0.12);
  color: #1d7f39;
}

.verification-badge-warning {
  border: 1px solid rgba(255, 149, 0, 0.28);
  background: rgba(255, 149, 0, 0.12);
  color: #9a5a00;
}

.solution-step-list {
  display: grid;
  gap: 14px;
}

.solution-step-card {
  padding: 24px 20px 20px;
  border: 1px solid rgba(60, 60, 67, 0.11);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(17, 17, 20, 0.06);
}

.solution-step-number {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
}

.solution-step-card h3 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 1.03rem;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: 0;
}

.solution-step-content {
  min-width: 0;
  max-width: 100%;
  color: #202024;
  font-size: 1.00rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.chem-structure-block {
  display: block;
  max-width: 100%;
  margin: 0.9rem 0;
  padding: 0.75rem 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  color: #17171a;
  font-family: ui-monospace, "SFMono-Regular", "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
}

.chem-diagram-block {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 1rem 0;
  overflow: hidden;
}

.chem-diagram-svg {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
}

.chem-diagram-svg[hidden],
.chem-diagram-fallback[hidden] {
  display: none !important;
}

.chem-diagram-fallback {
  display: block;
  max-width: 100%;
  margin: 0;
  padding: 0.75rem 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  color: #17171a;
  font-family: ui-monospace, "SFMono-Regular", "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
}

#solution-content .math-line,
#final-answer-content .math-line,
.solution-step-content .math-line,
.notebook-review-problem-content .math-line,
#review-final-answer-content .math-line,
#review-solution-content .math-line {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: normal;
  word-break: normal;
}

#solution-content .math-line + .math-line,
#final-answer-content .math-line + .math-line,
.solution-step-content .math-line + .math-line {
  margin-top: 0.28em;
}

#solution-content .math-prose-expression,
.solution-step-content .math-prose-expression,
#solution-content .math-line-display,
.solution-step-content .math-line-display,
#solution-workspace .followup-response .math-prose-expression,
#solution-workspace .followup-response .math-line-display,
.history-detail-page .followup-response .math-prose-expression,
.history-detail-page .followup-response .math-line-display {
  padding-top: 1.1rem;
  margin-bottom: 1.1rem;
  text-align: center;
}

#solution-content .math-line-display,
#final-answer-content .math-line-display,
.solution-step-content .math-line-display,
.notebook-review-problem-content .math-line-display,
#review-final-answer-content .math-line-display,
#review-solution-content .math-line-display,
#solution-workspace .followup-response .math-line-display,
.history-detail-page .followup-response .math-line-display {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  color: #111114;
  font-family: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  letter-spacing: 0;
}

#solution-content .math-line:has(.math-frac),
#final-answer-content .math-line:has(.math-frac),
.solution-step-content .math-line:has(.math-frac),
#solution-workspace .followup-response .math-line:has(.math-frac),
.history-detail-page .followup-response .math-line:has(.math-frac),
#solution-content .math-line-katex:has(.mfrac),
#final-answer-content .math-line-katex:has(.mfrac),
.solution-step-content .math-line-katex:has(.mfrac),
#solution-workspace .followup-response .math-line-katex:has(.mfrac),
.history-detail-page .followup-response .math-line-katex:has(.mfrac) {
  display: inline-block;
  min-height: 2.75em;
  line-height: 2.35;
}

#solution-workspace .followup-response.is-physics-notation .math-line-display,
.history-detail-page .followup-response.is-physics-notation .math-line-display,
#solution-workspace .followup-response.is-physics-notation .math-line:has(.math-frac),
.history-detail-page .followup-response.is-physics-notation .math-line:has(.math-frac) {
  display: block;
  width: 100%;
}

#final-answer-content .math-line-display {
  overflow: visible;
}

#final-answer-content .math-den sup {
  top: 0;
}

#solution-content .math-line-katex .katex,
#final-answer-content .math-line-katex .katex,
.history-problem-content .math-line-katex .katex,
.history-detail-problem .math-line-katex .katex,
.notebook-review-problem-content .math-line-katex .katex,
#review-final-answer-content .math-line-katex .katex,
#review-solution-content .math-line-katex .katex {
  font-size: inherit;
  line-height: inherit;
}

#solution-content .math-line-katex,
#final-answer-content .math-line-katex,
.solution-step-content .math-line-katex,
.history-problem-content .math-line-katex,
.history-detail-problem .math-line-katex,
.notebook-review-problem-content .math-line-katex,
#review-final-answer-content .math-line-katex,
#review-solution-content .math-line-katex,
.katex-display {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

#solution-content .math-frac,
#print-problem-content .math-frac,
#history-problem-content .math-frac,
#final-answer-content .math-frac,
.solution-step-content .math-frac,
#solution-workspace .followup-response .math-frac,
.history-detail-page .followup-response .math-frac {
  display: inline-grid;
  align-items: center;
  justify-content: center;
  justify-items: center;
  grid-template-rows: auto auto;
  min-width: 1.25em;
  margin: 0 0.14em;
  vertical-align: middle;
  font-size: 0.92em;
  line-height: 1.14;
  text-align: center;
}

#solution-content .math-derivative,
#print-problem-content .math-derivative,
#history-problem-content .math-derivative,
#final-answer-content .math-derivative,
.solution-step-content .math-derivative {
  margin-right: 0.18em;
}

#solution-content .math-num,
#solution-content .math-den,
#print-problem-content .math-num,
#print-problem-content .math-den,
#history-problem-content .math-num,
#history-problem-content .math-den,
#final-answer-content .math-num,
#final-answer-content .math-den,
.solution-step-content .math-num,
.solution-step-content .math-den,
#solution-workspace .followup-response .math-num,
#solution-workspace .followup-response .math-den,
.history-detail-page .followup-response .math-num,
.history-detail-page .followup-response .math-den {
  display: block;
  width: 100%;
  padding: 0 0.28em;
  box-sizing: border-box;
  line-height: 1.18;
  white-space: nowrap;
}

#solution-content .math-num,
#print-problem-content .math-num,
#history-problem-content .math-num,
#final-answer-content .math-num,
.solution-step-content .math-num,
#solution-workspace .followup-response .math-num,
.history-detail-page .followup-response .math-num {
  border-bottom: 1.5px solid currentColor;
  padding-bottom: 0.26em;
}

#solution-content .math-den,
#print-problem-content .math-den,
#history-problem-content .math-den,
#final-answer-content .math-den,
.solution-step-content .math-den,
#solution-workspace .followup-response .math-den,
.history-detail-page .followup-response .math-den {
  padding-top: 0.28em;
}

#solution-content .math-radical,
#print-problem-content .math-radical,
#history-problem-content .math-radical,
#final-answer-content .math-radical,
#solution-workspace .followup-response .math-radical,
.history-detail-page .followup-response .math-radical {
  display: inline-flex;
  align-items: flex-start;
  margin: 0 0.06em;
  vertical-align: -0.18em;
}

#solution-content .math-root,
#print-problem-content .math-root,
#history-problem-content .math-root,
#final-answer-content .math-root,
#solution-workspace .followup-response .math-root,
.history-detail-page .followup-response .math-root {
  font-size: 1.22em;
  line-height: 1;
}

#solution-content .math-radicand,
#print-problem-content .math-radicand,
#history-problem-content .math-radicand,
#final-answer-content .math-radicand,
#solution-workspace .followup-response .math-radicand,
.history-detail-page .followup-response .math-radicand {
  display: inline-block;
  margin-left: 0.03em;
  padding: 0.12em 0.16em 0;
  border-top: 1.5px solid currentColor;
  line-height: 1.24;
}

#solution-content .math-power,
#solution-content .math-subscript,
#solution-content .math-variable,
#solution-content .math-unit-ratio,
#solution-content .math-number,
#solution-content .math-quantity,
#solution-content .math-product,
#print-problem-content .math-power,
#print-problem-content .math-subscript,
#print-problem-content .math-unit-ratio,
#print-problem-content .math-number,
#print-problem-content .math-quantity,
#print-problem-content .math-product,
#history-problem-content .math-power,
#history-problem-content .math-subscript,
#history-problem-content .math-unit-ratio,
#history-problem-content .math-number,
#history-problem-content .math-quantity,
#history-problem-content .math-product,
#final-answer-content .math-power,
#final-answer-content .math-subscript,
#final-answer-content .math-variable,
#final-answer-content .math-unit-ratio,
#final-answer-content .math-number,
#final-answer-content .math-quantity,
#final-answer-content .math-product,
.solution-step-content .math-power,
.solution-step-content .math-subscript,
.solution-step-content .math-variable,
.solution-step-content .math-unit-ratio,
.solution-step-content .math-number,
.solution-step-content .math-quantity,
.solution-step-content .math-product,
#solution-workspace .followup-response .math-power,
#solution-workspace .followup-response .math-subscript,
#solution-workspace .followup-response .math-variable,
#solution-workspace .followup-response .math-unit-ratio,
#solution-workspace .followup-response .math-number,
#solution-workspace .followup-response .math-quantity,
#solution-workspace .followup-response .math-product,
.history-detail-page .followup-response .math-power,
.history-detail-page .followup-response .math-subscript,
.history-detail-page .followup-response .math-variable,
.history-detail-page .followup-response .math-unit-ratio,
.history-detail-page .followup-response .math-number,
.history-detail-page .followup-response .math-quantity,
.history-detail-page .followup-response .math-product,
.library-solution-content .math-unit-ratio,
.library-result-content .math-unit-ratio,
.library-preview-content .math-unit-ratio,
.library-solution-content .math-number,
.library-result-content .math-number,
.library-preview-content .math-number,
.library-solution-content .math-quantity,
.library-result-content .math-quantity,
.library-preview-content .math-quantity,
.library-solution-content .math-product,
.library-result-content .math-product,
.library-preview-content .math-product {
  white-space: nowrap;
}

#solution-content .math-subscript .math-base,
#final-answer-content .math-subscript .math-base,
.solution-step-content .math-subscript .math-base,
#solution-workspace .followup-response .math-subscript .math-base,
.history-detail-page .followup-response .math-subscript .math-base,
#solution-content .math-subscript-letter sub,
#final-answer-content .math-subscript-letter sub,
.solution-step-content .math-subscript-letter sub,
#solution-workspace .followup-response .math-subscript-letter sub,
.history-detail-page .followup-response .math-subscript-letter sub,
#solution-content .math-variable,
#final-answer-content .math-variable,
.solution-step-content .math-variable,
#solution-workspace .followup-response .math-variable,
.history-detail-page .followup-response .math-variable {
  font-style: italic;
}

#solution-content .math-subscript-number sub,
#final-answer-content .math-subscript-number sub,
.solution-step-content .math-subscript-number sub,
#solution-workspace .followup-response .math-subscript-number sub,
.history-detail-page .followup-response .math-subscript-number sub {
  font-style: normal;
}

#solution-content .math-unit-ratio,
#final-answer-content .math-unit-ratio,
.solution-step-content .math-unit-ratio,
#solution-workspace .followup-response .math-unit-ratio,
.history-detail-page .followup-response .math-unit-ratio,
.library-solution-content .math-unit-ratio,
.library-result-content .math-unit-ratio,
.library-preview-content .math-unit-ratio {
  font-style: normal;
}

#solution-content .math-frac sup,
#print-problem-content .math-frac sup,
#history-problem-content .math-frac sup,
#final-answer-content .math-frac sup,
.solution-step-content .math-frac sup,
#solution-workspace .followup-response .math-frac sup,
.history-detail-page .followup-response .math-frac sup {
  position: relative;
  top: -0.18em;
  font-size: 0.58em;
  line-height: 0;
}

#solution-content sup,
#solution-content sub,
#print-problem-content sup,
#print-problem-content sub,
#history-problem-content sup,
#history-problem-content sub,
#final-answer-content sup,
#final-answer-content sub,
#solution-workspace .followup-response sup,
#solution-workspace .followup-response sub,
.history-detail-page .followup-response sup,
.history-detail-page .followup-response sub,
.library-solution-content sup,
.library-solution-content sub,
.library-result-content sup,
.library-result-content sub,
.library-preview-content sup,
.library-preview-content sub {
  position: relative;
  font-size: 0.68em;
  line-height: 0;
}

#solution-content sup,
#print-problem-content sup,
#history-problem-content sup,
#final-answer-content sup,
#solution-workspace .followup-response sup,
.history-detail-page .followup-response sup,
.library-solution-content sup,
.library-result-content sup,
.library-preview-content sup {
  top: -0.45em;
}

#solution-content .math-radicand sup,
#print-problem-content .math-radicand sup,
#history-problem-content .math-radicand sup,
#final-answer-content .math-radicand sup,
#solution-workspace .followup-response .math-radicand sup,
.history-detail-page .followup-response .math-radicand sup,
.library-solution-content .math-radicand sup,
.library-result-content .math-radicand sup,
.library-preview-content .math-radicand sup {
  top: -0.24em;
}

#solution-content sub,
#print-problem-content sub,
#history-problem-content sub,
#final-answer-content sub,
#solution-workspace .followup-response sub,
.history-detail-page .followup-response sub {
  bottom: -0.2em;
}

#solution-content .math-op,
#solution-content .math-greek,
#print-problem-content .math-op,
#print-problem-content .math-greek,
#history-problem-content .math-op,
#history-problem-content .math-greek,
#final-answer-content .math-op,
#final-answer-content .math-greek,
#solution-workspace .followup-response .math-op,
#solution-workspace .followup-response .math-greek,
.history-detail-page .followup-response .math-op,
.history-detail-page .followup-response .math-greek {
  font-weight: 720;
}

#final-answer-content .math-op,
#final-answer-content .math-greek {
  font-weight: 500;
}

.solution-actions {
  padding: 0 28px 24px;
  background: #ffffff;
}

.copy-message {
  min-height: 22px;
  margin: 0;
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 650;
}

.copy-message:empty {
  display: none;
}

.copy-message.is-error {
  color: var(--red);
}

.examples {
  max-width: 900px;
  margin: 28px auto 0;
  padding: 0;
}

.examples-heading {
  margin-bottom: 18px;
  text-align: center;
}

.examples-heading .section-kicker {
  margin-bottom: 8px;
}

.example-grid {
  display: grid;
  gap: 12px;
}

.example-card {
  min-height: 132px;
  padding: 20px;
  border-radius: 24px;
}

.example-card p {
  margin-bottom: 0;
}

.example-label {
  margin-bottom: 10px !important;
  color: #c0c0c0;
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
}

.homepage-marketing,
.topic-section {
  max-width: 940px;
  margin: 64px auto 0;
  padding: 48px 20px;
  border: 1px solid #e2e8f0;
  border-radius: 30px;
  background: #f8fafc;
}

.homepage-marketing {
  margin-top: 88px;
  margin-bottom: 88px;
  padding-top: 0;
  padding-bottom: 0;
  border-color: transparent;
  background: transparent;
}

.homepage-marketing-intro,
.topic-section-heading {
  max-width: 640px;
  margin: 0 auto 36px;
  text-align: center;
}


/* ==========================================================
   HOMEPAGE MARKETING — DESKTOP
   "Type it. Snap it. Solve it."
   "Powered by AI. Built for students."
   ========================================================== */

/*
 * APPROVED HOMEPAGE TYPOGRAPHY — PRESERVE
 *
 * These values were manually reviewed on desktop and mobile.
 * Do not replace, normalize, merge, or revert these typography rules
 * unless the task explicitly requests changes to these exact elements.
 */

.homepage-marketing-kicker {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: clamp(2.25rem, 4vw, 2.85rem);
  font-weight: 400;
  line-height: 1.1;
}

.homepage-marketing-intro h2 {
  margin: 0;
  color: #b0b0b0;
  font-size: clamp(1.32rem, 2.25vw, 1.76rem);
  font-weight: 400;
  line-height: 1.24;
}

.topic-section-heading h2 {
  margin: 0;
  color: #475569;
  font-size: clamp(1.45rem, 2.5vw, 1.88rem);
  font-weight: 400;
  line-height: 1.2;
}

.feature-zigzag {
  display: grid;
  gap: 72px;
}

.feature-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 38%);
  align-items: center;
  gap: 64px;
  min-height: 0;
  padding: 48px;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.055);
}

.feature-card-2,
.feature-card-4 {
  grid-template-columns: minmax(250px, 38%) minmax(0, 1fr);
}

.feature-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 420px;
}

.feature-card-topline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.feature-icon {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}

.feature-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-card-2 .feature-icon {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.feature-card-3 .feature-icon {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.feature-card-4 .feature-icon {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

.feature-label {
  margin: 0;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0;
  text-transform: uppercase;
}

.feature-card h3 {
  margin: 0 0 12px;
  color: #0f172a;
  font-size: 1.72rem;
  font-weight: 400;
  line-height: 1.24;
}

.feature-card p:last-child {
  margin: 0;
  color: #475569;
  font-size: 1.02rem;
  font-weight: 500;
  line-height: 1.62;
}

.feature-visual {
  display: grid;
  min-height: 206px;
  place-items: center;
  border: 1px solid rgba(226, 232, 240, 0.86);
  border-radius: 20px;
  background: #f8fafc;
}

.feature-visual svg {
  width: min(100%, 260px);
  height: auto;
  color: #6366f1;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-card-2 .feature-visual svg {
  color: #10b981;
}

.feature-card-3 .feature-visual svg {
  color: #3b82f6;
}

.feature-card-4 .feature-visual svg {
  color: #f59e0b;
}

.topic-section {
  margin-top: 48px;
  padding-top: 42px;
  padding-bottom: 42px;
}

.topic-section-heading {
  margin-bottom: 24px;
}

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

.topic-badge {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 62px;
  gap: 14px;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}

.topic-badge:hover,
.topic-badge:focus-visible {
  border-color: #c7d2fe;
  color: #0f172a;
  transform: translateY(-1px);
}

.topic-icon {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  color: var(--topic-accent, #6366f1);
}

.topic-icon-bg {
  fill: var(--topic-bg, #ede9fe);
  stroke: none;
}

.topic-symbol {
  fill: currentColor;
  stroke: none;
  font-family: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-style: italic;
  font-weight: 780;
  letter-spacing: 0;
}

.topic-symbol-xl {
  font-size: 34px;
  font-weight: 520;
}

.topic-symbol-lg {
  font-size: 22px;
}

.topic-symbol-md {
  font-size: 24px;
}

.topic-symbol-sm {
  font-size: 14px;
}

.topic-symbol-frac {
  font-size: 14px;
  font-weight: 760;
}

.topic-stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topic-fill {
  fill: currentColor;
  stroke: none;
}

.topic-icon-algebra,
.topic-icon-calculus,
.topic-icon-linear {
  --topic-accent: #6d4cff;
  --topic-bg: #eee7ff;
}

.topic-icon-geometry,
.topic-icon-precalc {
  --topic-accent: #059669;
  --topic-bg: #e8f6ef;
}

.topic-icon-trig,
.topic-icon-diffeq {
  --topic-accent: #2563eb;
  --topic-bg: #eaf2ff;
}

.topic-icon-statistics {
  --topic-accent: #f59e0b;
  --topic-bg: #fff4dc;
}

.topic-icon-probability {
  --topic-accent: #e11d48;
  --topic-bg: #fde8ef;
}

.topic-icon-physics {
  --topic-accent: #0f766e;
  --topic-bg: #dcfdfa;
}

.topic-icon-chemistry {
  --topic-accent: #7c3aed;
  --topic-bg: #ede9fe;
}

.homepage-faq-section {
  max-width: 940px;
  margin: 48px auto 0;
  padding: 42px 20px;
  border: 1px solid #e2e8f0;
  border-radius: 30px;
  background:
    radial-gradient(
      circle at 50% 15%,
      rgba(214, 233, 255, 0.50),
      rgba(255, 255, 255, 0) 360px
    ),
    #ffffff;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.055);
  text-align: center;
}

.homepage-faq-section .section-kicker {
  color: #0f172a;
  margin: 0 0 22px;
}

.homepage-faq-list {
  display: grid;
  width: 100%;
  max-width: 800px;
  margin-right: auto;
  margin-left: auto;
  gap: 13px;
}

.homepage-faq-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
  padding: 20px 25px;
  text-align: left;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.homepage-faq-row:hover,
.homepage-faq-row:focus-visible {
  border-color: #c7d2fe;
  color: #0f172a;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.homepage-faq-question {
  min-width: 0;
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.35;
}

.homepage-faq-chevron {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  color: #98a2b3;
}

.homepage-faq-chevron svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.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;
}

.passwordless-page {
  min-height: 100vh;
  min-height: 100dvh;
  background: #ffffff;
}

.passwordless-shell {
  display: grid;
  min-height: calc(100vh - 62px);
  min-height: calc(100dvh - 62px);
  width: min(100% - 48px, 1180px);
  margin: 0 auto;
  padding: clamp(184px, 24vh, 252px) 0 48px;
  place-items: start center;
}

.passwordless-logo {
  position: absolute;
  top: 42px;
  left: max(24px, calc((100vw - 1180px) / 2));
  display: inline-flex;
  align-items: center;
  color: #000000;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.passwordless-card {
  width: min(100%, 520px);
  padding: 52px 46px 42px;
}

.passwordless-card h1 {
  margin: 0;
  color: #000000;
  font-size: 2.75rem;
  line-height: 1.08;
  text-align: center;
}

.auth-heading-block {
  display: grid;
  gap: 12px;
  margin-bottom: 32px;
  text-align: center;
}

.auth-heading-block p {
  max-width: 360px;
  margin: 0 auto;
  color: #6f6f6f;
  font-size: 1rem;
  line-height: 1.5;
}

.auth-choice-list {
  display: grid;
  gap: 12px;
}

.auth-provider-button,
.auth-secondary-button,
.auth-back-link,
.auth-text-link {
  font: inherit;
}

.auth-provider-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 58px;
  gap: 12px;
  padding: 0 18px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 999px;
  background: #ffffff;
  color: #000000;
  cursor: pointer;
  font-size: 1.02rem;
  font-weight: 650;
  text-decoration: none;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.auth-provider-button:hover,
.auth-provider-button:focus-visible {
  border-color: #000000;
  background: #f5f5f5;
  outline: none;
}

.auth-provider-button:active {
  transform: scale(0.985);
}

.provider-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  color: #000000;
  font-size: 1rem;
  font-weight: 800;
  line-height: 0;
}

.provider-mark-apple {
  fill: currentColor;
}

.provider-mark-email {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
  color: #8a8a8a;
  font-size: 0.9rem;
}

.auth-divider::before,
.auth-divider::after {
  flex: 1;
  height: 1px;
  background: rgba(0, 0, 0, 0.12);
  content: "";
}

.auth-provider-message[hidden] {
  display: none;
}

.auth-back-link,
.auth-text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  color: #000000;
  font-size: 0.96rem;
  font-weight: 700;
  text-decoration: none;
}

.auth-back-link {
  margin: -16px 0 18px;
}

.auth-back-link::before {
  margin-right: 8px;
  content: "←";
}

.auth-text-link {
  width: 100%;
  margin-top: 12px;
}

.auth-text-link:hover,
.auth-back-link:hover {
  text-decoration: underline;
}

.passwordless-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 58px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 999px;
  background: #ffffff;
  color: #000000;
  cursor: pointer;
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: 0;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.passwordless-form {
  display: grid;
  gap: 18px;
}

.auth-field {
  display: grid;
  gap: 9px;
}

.field-label {
  color: #000000;
  font-size: 0.96rem;
  font-weight: 500;
}

.passwordless-form input[type="email"],
.passwordless-form input[type="password"],
.passwordless-form input[type="text"],
.passwordless-form select {
  width: 100%;
  min-height: 60px;
  padding: 0 18px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 14px;
  outline: none;
  background: #ffffff;
  color: #000000;
  font-size: 1.05rem;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.passwordless-form select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;

  background-image:
    linear-gradient(45deg, transparent 50%, #666 50%),
    linear-gradient(135deg, #666 50%, transparent 50%);
  background-position:
    calc(100% - 22px) 50%,
    calc(100% - 16px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.passwordless-form input[type="email"]:focus,
.passwordless-form input[type="password"]:focus,
.passwordless-form input[type="text"]:focus,
.passwordless-form select:focus {
  border-color: #000000;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.08);
}

.passwordless-form input::placeholder {
  color: #9a9a9a;
}

.passwordless-button {
  margin-top: 10px;
  border-color: #000000;
  background: #000000;
  color: #ffffff;
}

.passwordless-button:hover {
  background: #181818;
}

.passwordless-button[disabled],
.auth-secondary-button[disabled] {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.passwordless-button:active {
  transform: scale(0.985);
}

.passwordless-logo:focus-visible,
.passwordless-button:focus-visible,
.auth-provider-button:focus-visible,
.auth-secondary-button:focus-visible,
.auth-back-link:focus-visible,
.auth-text-link:focus-visible,
.auth-switch a:focus-visible {
  outline: 3px solid rgba(0, 0, 0, 0.18);
  outline-offset: 3px;
}

.passwordless-message {
  margin: -18px 0 22px;
  padding: 13px 15px;
  border-radius: 14px;
  background: rgba(47, 158, 100, 0.1);
  color: var(--green);
  font-size: 0.95rem;
  font-weight: 650;
  text-align: center;
}

.passwordless-message.is-error {
  background: rgba(217, 45, 32, 0.08);
  color: var(--red);
}

.auth-note {
  max-width: 420px;
  margin: 20px auto 0;
  color: #777777;
  font-size: 0.84rem;
  line-height: 1.45;
  text-align: center;
}

.auth-field-help {
  margin: 0;
  color: #777777;
  font-size: 0.86rem;
  line-height: 1.4;
}

.auth-code-input {
  text-align: center;
  letter-spacing: 0.28em;
}

.auth-resend-form {
  display: grid;
  margin-top: 14px;
}

.auth-secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 999px;
  background: #ffffff;
  color: #000000;
  cursor: pointer;
  font-size: 0.96rem;
  font-weight: 650;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.auth-secondary-button:hover {
  border-color: #000000;
  background: #f5f5f5;
}

.auth-switch {
  margin: 24px 0 0;
  color: #6f6f6f;
  font-size: 1rem;
  text-align: center;
}

.auth-switch a {
  color: #000000;
  font-weight: 700;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.public-page {
  min-height: 100vh;
  min-height: 100dvh;
  background: #ffffff;
}

.public-page-header {
  display: flex;
  align-items: center;
  width: min(100% - 32px, 920px);
  min-height: 72px;
  margin: 0 auto;
}

.public-shell {
  width: min(100% - 32px, 920px);
  margin: 0 auto;
  padding: 64px 0 88px;
}

.public-hero {
  max-width: 720px;
  margin-bottom: 44px;
}

.public-hero h1,
.public-error-card h1 {
  margin-bottom: 18px;
  color: #000000;
  font-size: clamp(2.35rem, 7vw, 4.9rem);
  line-height: 0.98;
}

.public-hero p,
.public-error-card p {
  max-width: 640px;
  color: #5f5f66;
  font-size: 1.04rem;
  line-height: 1.65;
}

.public-effective-date {
  margin-top: 18px;
  color: #111114;
  font-weight: 720;
}

.public-document {
  max-width: 720px;
  color: #202026;
  overflow-wrap: anywhere;
}

.public-document h2 {
  margin: 34px 0 10px;
  color: #000000;
  font-size: 1.28rem;
  line-height: 1.2;
}

.public-document p,
.public-document li {
  color: #45454c;
  font-size: 1rem;
  line-height: 1.7;
}

.public-document ul {
  display: grid;
  gap: 8px;
  margin: 0 0 24px;
  padding-left: 22px;
}

.public-placeholder {
  color: #000000;
  font-weight: 720;
  overflow-wrap: anywhere;
}

.public-primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 16px;
  padding: 0 20px;
  border: 1px solid #000000;
  border-radius: 999px;
  background: #000000;
  color: #ffffff;
  font-size: 0.98rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 150ms ease, transform 150ms ease;
}

.public-primary-link:hover,
.public-primary-link:focus-visible {
  background: #181818;
  outline: none;
}

.public-primary-link:focus-visible {
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.12);
}

.public-primary-link:active {
  transform: scale(0.985);
}

.public-error-shell {
  display: grid;
  min-height: calc(100vh - 210px);
  min-height: calc(100dvh - 210px);
  place-items: center start;
}

.public-error-card {
  max-width: 660px;
}

.public-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  background: #ffffff;
}

.public-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 32px, 1040px);
  min-height: 76px;
  margin: 0 auto;
  gap: 18px;
  color: #5f5f66;
  font-size: 0.92rem;
  font-weight: 650;
}

.public-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.public-footer a {
  color: #111114;
  text-decoration: none;
}

.public-footer a:hover,
.public-footer a:focus-visible {
  text-decoration: underline;
}

.public-footer a:focus-visible {
  outline: 3px solid rgba(0, 0, 0, 0.16);
  outline-offset: 4px;
}

@keyframes solution-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 760px) {
  .page-shell {
    padding-top: 72px;
  }

  .composer-card {
    padding: 18px;
  }

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

  .homepage-marketing,
  .topic-section,
  .homepage-faq-section {
    margin-top: 72px;
  }

  .topic-section {
    margin-top: 0;
  }

  .homepage-faq-section {
    margin-top: 88px;
  }

  .homepage-marketing {
    margin-top: 96px;
    margin-bottom: 88px;
  }

  .feature-zigzag {
    gap: 88px;
  }

  .feature-card {
    padding: 52px;
  }

  .topic-badge-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }

  .topic-badge {
    min-height: 72px;
  }
}

@media (max-width: 620px) {
  .passwordless-shell {
    min-height: calc(100vh - 58px);
    min-height: calc(100dvh - 58px);
    width: min(100% - 32px, 520px);
    padding: 64px 0 34px;
  }

  .passwordless-logo {
    top: 28px;
    left: 24px;
  }

  .passwordless-card {
    padding: 28px 0 10px;
  }

  .passwordless-card h1 {
    margin-bottom: 28px;
    font-size: 2.3rem;
  }

  .passwordless-button {
    min-height: 56px;
  }

  .public-page-header {
    min-height: 64px;
  }

  .public-shell {
    padding: 44px 0 64px;
  }

  .public-hero {
    margin-bottom: 34px;
  }

  .public-hero h1,
  .public-error-card h1 {
    font-size: 2.55rem;
  }

  .public-error-shell {
    min-height: calc(100dvh - 188px);
    place-items: center start;
  }

  .public-footer-inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    min-height: 104px;
    padding: 22px 0;
  }

  .public-footer-links {
    justify-content: flex-start;
  }

  .header-inner {
    width: min(100% - 22px, 1040px);
    min-height: 58px;
    gap: 10px;
  }

  .account-nav {
    flex: 1 1 auto;
    gap: 8px;
  }

  .top-navigation {
    gap: 10px;
  }

  .top-navigation-paid {
    gap: 18px;
  }

  .nav-menu-trigger,
  .header-upgrade-button,
  .header-login-button {
    min-height: 44px;
    padding: 0 10px;
    font-size: 0.82rem;
  }

  .header-icon-button,
  .profile-trigger {
    width: 44px;
    min-height: 44px;
  }

  .nav-dropdown {
    min-width: min(176px, calc(100vw - 32px));
    max-width: calc(100vw - 24px);
  }

  .nav-dropdown-right {
    right: 0;
  }

  .nav-dropdown-item {
    white-space: normal;
  }

  .notebook-feature-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .notebook-feature-card {
    min-height: 0;
    gap: 15px;
    padding: 20px;
    border-radius: 24px;
  }

  .history-page .notebook-feature-card {
    gap: 0;
  }

  .history-page .notebook-feature-copy {
    margin-bottom: 14px;
  }

  .history-page .notebook-feature-tabs {
    gap: 10px;
    margin-bottom: 18px;
  }

  .history-page .notebook-feature-search {
    margin-bottom: 24px;
  }

  .notebook-feature-shape {
    top: -58px;
    right: -66px;
    width: 154px;
    height: 136px;
  }

  .notebook-feature-icon {
    width: 50px;
    height: 50px;
    border-radius: 16px;
  }

  .notebook-feature-icon svg {
    width: 24px;
    height: 24px;
  }

  .notebook-feature-search {
    padding: 7px;
  }

  .notebook-feature-result-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    padding-right: 8px;
  }

  .history-row-content strong {
    display: -webkit-box;
    overflow: hidden;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .history-row-menu-trigger {
    width: 44px;
    height: 44px;
    opacity: 1;
  }

  .history-row-menu-root {
    transform: translateX(15px);
  }

  .history-row-menu {
    top: 0;
    right: 0;
    max-width: calc(100vw - 32px);
  }

  .history-row-menu.opens-upward {
    top: auto;
    bottom: calc(100% + 8px);
  }

  .history-row-menu-trigger:hover,
  .history-row-menu-trigger:focus-visible,
  .history-row-menu-trigger[aria-expanded="true"] {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
  }


  /* ==========================================================
     HOMEPAGE TYPOGRAPHY — TABLET / MOBILE
     ========================================================== */
  /*
   * APPROVED RESPONSIVE HOMEPAGE TYPOGRAPHY — PRESERVE
   */

  .page-shell {
    width: min(100% - 24px, 900px);
    padding: 38px 0 42px;
  }

  .hero {
    padding-bottom: 22px;
  }

  .hero h1 {
    font-size: clamp(2.25rem, 9.5vw, 3rem);
    line-height: 1.04;
  }

  .composer-card {
    padding: 12px;
    border-radius: 28px;
  }

  .hero .eyebrow {
    font-size: 1.0rem;
    line-height: 1.4;
  }

  .homepage-marketing,
  .topic-section,
  .homepage-faq-section {
    width: min(100%, 760px);
    margin-top: 56px;
    padding: 34px 18px;
    border-radius: 24px;
  }

  .homepage-marketing {
    margin-top: 72px;
    margin-bottom: 0;
  }

  .homepage-marketing + .topic-section {
    margin-top: 32px;
  }

  .topic-section + .homepage-faq-section {
    margin-top: 48px;
  }

  .homepage-marketing-intro,
  .topic-section-heading {
    margin-bottom: 28px;
    text-align: left;
  }

  .homepage-marketing-kicker {
    font-size: clamp(1.15rem, 5vw, 1.35rem);
  }

  .homepage-marketing-intro h2 {
    color: #b0b0b0;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.26;
  }

  .topic-section-heading h2 {
    font-size: clamp(1.08rem, 5.05vw, 1.45rem);
    font-weight: 500;
    line-height: 1.28;
  }

  .feature-zigzag {
    gap: 72px;
  }

  .feature-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 34px;
    gap: 34px;
    border-radius: 24px;
  }

  .feature-card-1,
  .feature-card-3 {
    flex-direction: column-reverse;
  }

  .feature-content {
    max-width: none;
  }

  .feature-card h3 {
    font-size: clamp(1.15rem, 5vw, 1.35rem);
    line-height: 1.26;
  }

  .feature-card p:last-child {
    font-size: 1rem;
    line-height: 1.58;
  }

  .feature-visual {
    width: 100%;
    min-height: 176px;
  }

  .feature-visual svg {
    width: min(100%, 230px);
  }

  .topic-badge-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .topic-badge {
    min-height: 60px;
    font-size: 0.88rem;
  }

  .camera-modal {
    align-items: stretch;
    justify-content: stretch;
    width: 100vw;
    height: 100dvh;
    padding: 0;
    background: #000000;
  }

  .camera-panel {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    max-height: none;
    gap: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #000000;
    box-shadow: none;
  }

  .camera-header {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    left: 14px;
    right: 14px;
    z-index: 10;
    align-items: center;
    pointer-events: none;
  }

  .camera-header > div {
    display: none;
  }

  .camera-close-button {
    margin-left: auto;
    width: 46px;
    height: 46px;
    background: rgba(17, 17, 20, 0.72);
    color: #ffffff;
    pointer-events: auto;
    backdrop-filter: blur(14px);
  }

  .camera-preview-wrap {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .camera-preview-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .camera-roi-layer .roi-handle::after {
    position: absolute;
    inset: -14px;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.001);
    content: "";
  }

  .camera-hint {
    position: fixed;
    left: 18px;
    right: 18px;
    bottom: calc(92px + env(safe-area-inset-bottom));
    z-index: 4;
    margin: 0;
    padding: 10px 12px;
    border-radius: 999px;
    background: rgba(17, 17, 20, 0.58);
    color: #ffffff;
    backdrop-filter: blur(14px);
  }

  .camera-zoom-controls {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    left: 14px;
    z-index: 10;
    pointer-events: auto;
  }

  .camera-zoom-button,
  .camera-zoom-indicator {
    min-height: 46px;
    background: rgba(17, 17, 20, 0.72);
    color: #ffffff;
    backdrop-filter: blur(14px);
  }

  .camera-zoom-button {
    width: 46px;
  }

  .camera-actions {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 10;
    grid-template-columns: 0.8fr 60px 1.2fr;
    pointer-events: auto;
  }

  .camera-secondary-button,
  .camera-light-button,
  .camera-capture-button {
    min-height: 60px;
  }

  .camera-secondary-button {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    backdrop-filter: blur(14px);
  }

  .camera-light-button {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    backdrop-filter: blur(14px);
  }

  .camera-light-button.is-active {
    background: rgba(255, 214, 10, 0.34);
    color: #ffffff;
  }

  .history-stats {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 18px;
  }

  .history-stat-card {
    padding: 16px 18px;
    border-radius: 20px;
  }

  .history-stat-card strong {
    font-size: 1.7rem;
  }

  .history-list-card {
    border-radius: 24px;
  }

  .history-list-heading {
    padding: 20px 20px 16px;
  }

  .history-row {
    align-items: flex-start;
    padding: 16px 16px 16px 20px;
  }

  .history-row-title {
    white-space: normal;
  }

  .history-row-answer {
    white-space: normal;
  }

  .history-row-action {
    width: 30px;
    height: 30px;
  }

  .notebook-detail-card {
    padding: 18px;
    border-radius: 24px;
  }

  .notebook-detail-heading {
    display: grid;
  }

  .notebook-toggle-group {
    justify-content: flex-start;
  }

  .history-detail-page {
    width: min(100% - 24px, 840px);
    padding-top: 28px;
  }

  .history-detail-nav {
    gap: 10px;
  }

  .history-detail-actions {
    gap: 2px;
  }

  .history-detail-action {
    min-width: 44px;
    min-height: 44px;
    padding: 0 8px;
  }

  .history-detail-action .action-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .history-detail-panel {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 12px;
    width: auto;
    max-height: min(78vh, 620px);
    max-height: min(78dvh, 620px);
    overflow-y: auto;
    border-radius: 24px;
  }

  .history-detail-problem {
    margin-top: 18px;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.70;
  }

  .notebook-meta-grid {
    grid-template-columns: 1fr;
  }

  .notebook-review-entry,
  .notebook-filter-heading,
  .notebook-review-card-heading {
    display: grid;
  }

  .notebook-filter-card {
    padding: 18px;
    border-radius: 24px;
  }

  .notebook-filter-form {
    grid-template-columns: 1fr;
  }

  .notebook-filter-search {
    grid-column: auto;
  }

  .notebook-review-card {
    padding: 18px;
    border-radius: 24px;
  }

  .notebook-toggle-button,
  .notebook-save-button,
  .notebook-rating-button,
  .notebook-review-link,
  .notebook-review-detail-link,
  .notebook-filter-submit,
  .notebook-clear-filters {
    min-height: 44px;
  }

  .passwordless-form input[type="email"],
  .passwordless-form input[type="password"],
  .passwordless-form input[type="text"],
  .problem-detail-textarea,
  .problem-detail-input,
  .notebook-inline-tag-editor input,
  .notebook-note-input,
  .notebook-tags-input,
  .notebook-filter-field input,
  .notebook-feature-search input {
    font-size: 1rem;
  }

  .notebook-review-detail-link,
  .notebook-review-link {
    width: fit-content;
  }

  .progress-actions,
  .progress-empty-actions {
    gap: 8px;
  }

  .progress-review-grid {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .progress-table {
    min-width: 460px;
  }

  .progress-table th,
  .progress-table td {
    padding: 13px 14px;
  }

  .composer-topline {
    padding-left: 6px;
  }

  .input-bar {
    min-height: 66px;
    gap: 6px;
    padding: 8px;
    border-radius: 26px;
  }

  .icon-button {
    width: 44px;
    height: 44px;
  }

  .solve-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  textarea {
    min-height: 42px;
    padding: 10px 2px;
    font-size: 1rem;
  }

  .attachment-dropdown {
    width: min(180px, calc(100vw - 54px));
  }

  .image-preview-wrap {
    height: clamp(280px, 64vw, 360px);
  }

  .image-preview {
    object-fit: cover;
  }

  .image-preview-wrap.is-visible.has-upload-roi .adjust-image-button {
    display: grid;
  }

  body.upload-roi-fullscreen {
    overflow: hidden;
  }

  body.upload-roi-fullscreen .app-header,
  body.upload-roi-fullscreen .hero,
  body.upload-roi-fullscreen .composer-topline,
  body.upload-roi-fullscreen .input-bar,
  body.upload-roi-fullscreen .selected-file,
  body.upload-roi-fullscreen .form-message {
    visibility: hidden;
  }

  body.upload-roi-fullscreen .composer-card,
  body.upload-roi-fullscreen .preview-area {
    position: static;
  }

  body.upload-roi-fullscreen .image-preview-wrap {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: block;
    width: 100vw;
    height: 100dvh;
    margin: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: #000000;
  }

  body.upload-roi-fullscreen .image-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  body.upload-roi-fullscreen .roi-layer {
    z-index: 5;
  }

  body.upload-roi-fullscreen #roi-layer .roi-handle::after {
    position: absolute;
    inset: -14px;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.001);
    content: "";
  }

  body.upload-roi-fullscreen .remove-image-button {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    right: 14px;
    z-index: 110;
    width: 46px;
    height: 46px;
    background: rgba(17, 17, 20, 0.72);
    color: #ffffff;
    pointer-events: auto;
    backdrop-filter: blur(14px);
  }

  body.upload-roi-fullscreen .upload-roi-tools {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    left: 14px;
    right: 76px;
    z-index: 110;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    pointer-events: auto;
  }

  body.upload-roi-fullscreen .upload-roi-mode-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    min-height: 46px;
    padding: 3px;
    border-radius: 999px;
    background: rgba(17, 17, 20, 0.72);
    backdrop-filter: blur(14px);
  }

  body.upload-roi-fullscreen .upload-roi-mode-button {
    min-width: 44px;
    padding: 0 10px;
    border-radius: 999px;
    background: transparent;
    color: rgba(255, 255, 255, 0.74);
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 750;
  }

  body.upload-roi-fullscreen .upload-roi-mode-button.is-active {
    background: #ffffff;
    color: #000000;
  }

  body.upload-roi-fullscreen .upload-roi-tool-button,
  body.upload-roi-fullscreen .upload-roi-reset-view-button,
  body.upload-roi-fullscreen .upload-roi-zoom-indicator {
    min-height: 46px;
    border-radius: 999px;
    background: rgba(17, 17, 20, 0.72);
    color: #ffffff;
    font-weight: 750;
    backdrop-filter: blur(14px);
  }

  body.upload-roi-fullscreen .upload-roi-tool-button {
    flex: 0 0 auto;
    width: 46px;
    cursor: pointer;
    font-size: 1.35rem;
    line-height: 1;
  }

  body.upload-roi-fullscreen .upload-roi-reset-view-button {
    flex: 0 1 auto;
    min-width: 0;
    padding: 0 14px;
    cursor: pointer;
    font-size: 0.86rem;
    white-space: nowrap;
  }

  body.upload-roi-fullscreen .upload-roi-zoom-indicator {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    padding: 0 12px;
    font-size: 0.9rem;
  }

  body.upload-roi-fullscreen .upload-roi-tool-button:disabled {
    cursor: default;
    opacity: 0.5;
  }

  body.upload-roi-fullscreen .image-preview-wrap.is-visible.has-upload-roi .adjust-image-button {
    display: none;
  }

  body.upload-roi-fullscreen .upload-roi-bottom-actions {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 110;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    pointer-events: auto;
  }

  body.upload-roi-fullscreen .upload-roi-reset-view-button,
  body.upload-roi-fullscreen .upload-roi-done-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 0 18px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 750;
    backdrop-filter: blur(14px);
  }

  body.upload-roi-fullscreen .upload-roi-reset-view-button {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
  }

  body.upload-roi-fullscreen .upload-roi-done-button {
    background: #ffffff;
    color: #000000;
  }

  .math-symbol-grid {
    grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
    gap: 7px;
  }

  .math-symbol {
    min-height: 44px;
    border-radius: 13px;
  }

  .solution-box {
    border-radius: 24px;
  }

  .solution-heading {
    padding: 22px 20px 16px;
  }

  .solution-heading h2 {
    font-size: 1.35rem;
  }

  .copy-icon-button,
  .workspace-favorite-button {
    width: 40px;
    height: 40px;
  }

  .print-solution-button {
    width: 40px;
    height: 40px;
  }

  .solution-body {
    padding: 22px 20px 24px;
  }

  /* Mobile History: hide the divider below the question controls. */
  .history-detail-shell {
    margin-bottom: 10px;
    padding-bottom: 0;
    border-bottom: 0;
  }

  /* Mobile History: space between the user's follow-up prompt and PercenX response. */
  .history-detail-page .followup-exchange {
    gap: 24px;
  }

  .final-answer-card {
    margin-bottom: 20px;
    padding: 18px;
    border-radius: 18px;
  }

  #final-answer-content {
    font-size: 1.28rem;
  }

  .graph-panel {
    margin-bottom: 22px;
    border-radius: 18px;
    padding: 10px;
  }

  .graph-panel-header {
    display: block;
  }

  .graph-panel-header p {
    margin-top: 5px;
    text-align: left;
  }

  #solution-content .math-line-display,
  #final-answer-content .math-line-display,
  .solution-step-content .math-line-display,
  .notebook-review-problem-content .math-line-display,
  #review-final-answer-content .math-line-display,
  #review-solution-content .math-line-display,
  #solution-workspace .followup-response .math-line-display,
  .history-detail-page .followup-response .math-line-display {
    padding-bottom: 2px;
  }

  #solution-content {
    font-size: 1rem;
    line-height: 1.70;
  }

  .solution-step-card {
    padding: 24px 16px 16px;
    border-radius: 16px;
  }

  .solution-step-card h3 {
    font-size: 0.98rem;
  }

  .solution-step-content {
    font-size: 1.0rem;
    line-height: 1.70;
  }

  .chem-diagram-block {
    width: 100%;
  }

  .chem-diagram-svg {
    max-height: 280px;
  }

  .solution-actions {
    padding: 0 20px 20px;
  }
}

@media (max-width: 600px) {
  .brand-logo-wordmark {
    display: none;
  }

  .brand-logo-symbol {
    display: block;
  }
}

@media (max-width: 430px) {
  /* ==========================================================
     HOMEPAGE TYPOGRAPHY — SMALL MOBILE
     ========================================================== */

  /*
   * APPROVED RESPONSIVE HOMEPAGE TYPOGRAPHY — PRESERVE
   * Keep responsive typography values synchronized with the
   * approved tablet/mobile hierarchy unless explicitly changing
   * homepage typography.
   */

  .page-shell {
    width: min(100% - 20px, 900px);
  }

  .hero h1 {
    font-size: clamp(2.15rem, 9.5vw, 2.5rem);
    line-height: 1.04;
  }

  .hero .eyebrow {
    font-size: 0.88rem;
  }

  .homepage-marketing-kicker {
    font-size: clamp(1.28rem, 7vw, 1.62rem);
  }

  .homepage-marketing-intro h2 {
    font-size: 1rem;
    line-height: 1.26;
    font-weight: 400;
    color: #b0b0b0;
  }

  .topic-section-heading h2 {
    font-size: clamp(1.35rem, 5.8vw, 1.6rem);
  }

  .history-detail-nav {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .history-detail-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .topic-badge-grid {
    grid-template-columns: 1fr;
  }

  .auth-code-input {
    letter-spacing: 0.18em;
  }

  .public-footer-links {
    gap: 10px 14px;
  }
}

@media print {
  @page {
    margin: 0.65in;
  }

  * {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  html,
  body {
    min-height: 0;
    background: #ffffff !important;
    color: #000000 !important;
  }

  .app-header,
  .hero,
  .composer-card,
  .examples,
  .homepage-lower-content,
  .camera-modal,
  .notebook-detail-card,
  .solution-heading-actions,
  .solution-actions,
  .copy-icon-button,
  .print-solution-button,
  .new-question-button {
    display: none !important;
  }

  main,
  .app-shell,
  .solution-workspace,
  .solution-workspace.is-visible,
  .solution-box {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    animation: none !important;
  }

  .solution-heading {
    display: block !important;
    padding: 0 0 14px !important;
    border-bottom: 1px solid #d1d5db !important;
  }

  .solution-heading h2 {
    color: #000000 !important;
    font-size: 22pt !important;
  }

  .solution-body {
    padding: 18px 0 0 !important;
  }

  .print-problem-card.has-content {
    display: block !important;
    margin: 0 0 18px !important;
    padding: 0 0 16px !important;
    border-bottom: 1px solid #e5e7eb !important;
  }

  .print-problem-card p,
  .final-answer-card p {
    margin: 0 0 10px !important;
    color: #4b5563 !important;
    font-size: 9pt !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
    text-transform: uppercase !important;
  }

  #print-problem-content,
  #solution-content {
    color: #000000 !important;
    font-size: 11pt !important;
    line-height: 1.55 !important;
    white-space: pre-wrap !important;
  }

  .verification-badge {
    margin: 0 0 12px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: #374151 !important;
    font-size: 9pt !important;
  }

  .solution-step-list {
    display: block !important;
  }

  .solution-step-card {
    break-inside: avoid !important;
    margin: 0 0 14px !important;
    padding: 10px 12px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    box-shadow: none !important;
  }

  .solution-step-number {
    margin-bottom: 4px !important;
    color: #4b5563 !important;
    font-size: 8pt !important;
  }

  .solution-step-card h3 {
    margin: 0 0 6px !important;
    color: #000000 !important;
    font-size: 11pt !important;
  }

  .solution-step-content {
    color: #000000 !important;
    font-size: 10.5pt !important;
    line-height: 1.70 !important;
  }

  .chem-diagram-block {
    break-inside: avoid !important;
    width: fit-content !important;
    max-width: 100% !important;
    margin: 8pt 0 10pt !important;
    overflow: visible !important;
  }

  .chem-diagram-svg {
    display: block !important;
    max-width: 100% !important;
    height: auto !important;
  }

  .chem-diagram-fallback {
    max-width: 100% !important;
    overflow: visible !important;
    white-space: pre-wrap !important;
  }

  .final-answer-card.is-visible {
    display: block !important;
    margin: 0 0 18px !important;
    padding: 12px 14px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 8px !important;
    background: #ffffff !important;
  }

  #final-answer-content {
    color: #000000 !important;
    font-size: 14pt !important;
    line-height: 1.35 !important;
  }

  .graph-panel.is-visible {
    display: block !important;
    break-inside: avoid !important;
    margin: 0 0 18px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
  }

  .graph-panel-header {
    display: block !important;
    padding: 0 0 8px !important;
  }

  .graph-panel-header h3 {
    color: #000000 !important;
    font-size: 13pt !important;
  }

  .graph-panel-header p {
    margin-top: 3px !important;
    color: #4b5563 !important;
    font-size: 9pt !important;
    text-align: left !important;
  }

  .graph-image.is-visible,
  #graph-canvas:not(.is-hidden) {
    display: block !important;
    max-width: 100% !important;
    height: auto !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    background: #ffffff !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .solve-activity-dot {
    opacity: 1;
    transform: none;
    animation: none !important;
  }
}

/* ==========================================================
   MATH COMPOSER — MOBILE iOS-STYLE LAYOUT
   Keep desktop composer unchanged.
   ========================================================== */

@media (max-width: 759px) {
  .input-bar {
    grid-template-columns: 44px 44px minmax(0, 1fr) 44px 44px;
    grid-template-rows: minmax(58px, auto) 44px;
    column-gap: 6px;
    row-gap: 2px;
    align-items: center;
    min-height: 122px;
    padding: 10px;
    border-radius: 28px;
  }

  #problem-input {
    grid-column: 1 / -1;
    grid-row: 1;
    align-self: stretch;

    min-height: 58px;
    max-height: 130px;

    padding: 8px 10px;
    margin: 0;

    font-size: 1.05rem;
    line-height: 1.45;
  }

  #problem-input::placeholder {
    color: rgba(142, 142, 147, 0.68);
  }

  .attachment-menu {
    grid-column: 1;
  }

  .math-toggle-button {
    grid-column: 2;
  }

  .provider-menu {
    grid-column: 5;
    justify-self: end;
  }

  .input-bar.has-content {
    grid-template-columns: 44px 44px minmax(0, 1fr) 44px 44px 44px;
  }

  .input-bar.has-content .provider-menu {
    grid-column: 4;
  }

  .clear-button {
    grid-column: 4;
  }

  .input-bar.has-content .clear-button {
    grid-column: 5;
  }

  .solve-button {
    grid-column: 5;
  }

  .input-bar.has-content .solve-button {
    grid-column: 6;
  }
}


@media (max-width: 759px) {
  #problem-input:focus::placeholder {
    color: transparent;
  }
}

/* Authenticated homepage workspace */
body.authenticated-home {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
}

body.authenticated-home .page-shell {
  flex: 1;
}

.authenticated-workspace-hero h1 {
  font-size: 1.875rem;
  font-weight: 400;
  line-height: 1.12;
}

@media (max-width: 759px) {
  .authenticated-workspace-hero h1 {
    font-size: 1.625rem;
    line-height: 1.15;
  }
}

.header-new-question-icon {
  width: 20px;
  height: 20px;
}


/* Notebook History follow-up composer uses the Math Composer controls without an AI selector. */
.history-followup-composer {
  grid-template-columns: 42px 42px minmax(0, 1fr) 42px 38px;
  grid-template-rows: minmax(48px, auto) 46px;
  align-items: center;
  column-gap: 8px;
  row-gap: 2px;
  min-height: 116px;
  padding: 10px;
  border-radius: 30px;
}

.history-followup-composer textarea {
  grid-column: 1 / -1;
  grid-row: 1;
}

.history-followup-composer .history-followup-attachment-menu {
  grid-column: 1;
  grid-row: 2;
}

.history-followup-composer .math-toggle-button {
  grid-column: 2;
  grid-row: 2;
}

.history-followup-composer .clear-button {
  grid-column: 4;
  grid-row: 2;
}

.history-followup-composer .followup-submit-button {
  grid-column: 5;
  grid-row: 2;
  width: 38px;
  height: 38px;
  justify-self: end;
}

.history-followup-attachment-menu .attachment-dropdown {
  left: 0;
  right: auto;
}

.history-followup-selected-file,
.history-followup-pdf-panel,
.history-followup-image-preview-wrap {
  width: calc(100% - 16px);
  max-width: 780px;
}

.history-math-toolbar {
  margin-top: 8px;
}

.solve-button {
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
}

.followup-submit-button {
  width: 38px;
  height: 38px;
}


/* PercenX plus-button transparent treatment */
.plus-button {
  background: transparent;
}

.plus-button::before {
  content: "";
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--fill);
  opacity: 0;
  transition: opacity 150ms ease;
  pointer-events: none;
  z-index: -1;
}

.plus-button:not(:disabled):hover,
.plus-button:not(:disabled):focus-visible {
  background: transparent;
}

.plus-button:not(:disabled):hover::before,
.plus-button:not(:disabled):focus-visible::before {
  opacity: 1;
}

.plus-button.is-open,
.plus-button.is-open:hover,
.plus-button.is-open:focus-visible {
  background: transparent;
  color: var(--text);
  transform: none;
}


/* Notebook History follow-up control states */
.history-followup-composer .followup-submit-button {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.92);
  transition: background 150ms ease, transform 150ms ease, opacity 150ms ease;
}

.history-followup-composer .followup-submit-button.is-visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.history-followup-composer .math-toggle-button {
  width: 42px;
  height: 42px;
  background: transparent;
  outline: none;
}

.history-followup-composer .math-toggle-button:hover,
.history-followup-composer .math-toggle-button:focus-visible {
  width: 38px;
  height: 38px;
  justify-self: center;
  align-self: center;
  background: var(--fill);
  outline: none;
}

.history-followup-composer .math-toggle-button.is-open {
  background: transparent;
}

.history-followup-composer .math-toggle-button.is-open:hover,
.history-followup-composer .math-toggle-button.is-open:focus-visible {
  background: var(--fill);
}

/* Match History follow-up utility icons to the main Math Composer. */
.history-followup-composer .history-followup-attachment,
.history-followup-composer .math-toggle-button,
.history-followup-composer .math-toggle-button.is-open {
  color: var(--text);
}
