:root {
  --page: #e4d3b5;
  --desk: #c9b390;
  --paper: #fff8e9;
  --paper-edge: #d7c39f;
  --paper-line: rgba(70, 112, 168, 0.16);
  --paper-margin: rgba(235, 111, 98, 0.2);
  --note-page: #fff8ea;
  --note-line: rgba(72, 113, 166, 0.18);
  --note-margin: rgba(224, 93, 90, 0.28);
  --ink: #312d27;
  --ink-soft: #746b5e;
  --window: #16171b;
  --chrome: #25262b;
  --row: #15181f;
  --row-strong: #1b1e26;
  --row-calc: #1b2029;
  --row-good: #17221d;
  --line: #343741;
  --line-soft: #252832;
  --text: #f5f5f6;
  --muted: #858590;
  --muted-2: #6f707a;
  --blue: #3f8cff;
  --green: #25d06d;
  --amber: #ffae12;
  --red: #ff5d57;
  --shadow:
    0 34px 90px rgba(65, 44, 20, 0.24),
    0 10px 32px rgba(31, 26, 20, 0.22),
    0 1px 0 rgba(255, 255, 255, 0.42) inset;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --sans: Avenir Next, Avenir, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--desk);
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(115deg, rgba(120, 93, 55, 0.18), transparent 38%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.32), transparent 42%, rgba(86, 65, 40, 0.16)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 7px),
    var(--page);
  color: var(--text);
  font-family: var(--sans);
}

body::before,
body::after {
  position: fixed;
  inset: auto;
  z-index: 0;
  pointer-events: none;
  content: "";
}

body::before {
  left: max(18px, calc((100vw - 1370px) / 2));
  top: 22px;
  width: min(1280px, calc(100vw - 56px));
  height: calc(100vh - 44px);
  border: 1px solid rgba(150, 115, 69, 0.24);
  border-radius: 18px;
  background:
    linear-gradient(90deg, transparent 0 72px, var(--paper-margin) 72px 74px, transparent 74px),
    repeating-linear-gradient(0deg, transparent 0 35px, var(--paper-line) 35px 36px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 250, 235, 0.86)),
    var(--paper);
  box-shadow:
    0 42px 120px rgba(70, 47, 20, 0.22),
    0 6px 0 rgba(184, 158, 115, 0.38),
    0 12px 0 rgba(166, 139, 96, 0.2);
}

body::after {
  left: max(30px, calc((100vw - 1350px) / 2 + 18px));
  top: 52px;
  width: 26px;
  height: calc(100vh - 104px);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 28px, rgba(100, 74, 42, 0.38) 0 4px, transparent 5px),
    radial-gradient(circle at 50% calc(100% - 28px), rgba(100, 74, 42, 0.34) 0 4px, transparent 5px),
    linear-gradient(90deg, rgba(111, 84, 50, 0.08), rgba(255, 255, 255, 0.5), rgba(111, 84, 50, 0.12));
  box-shadow:
    8px 0 18px rgba(108, 79, 45, 0.08),
    -1px 0 rgba(255, 255, 255, 0.62) inset;
}

button,
input {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: #101116;
  color: var(--text);
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease, transform 140ms ease;
}

button:hover {
  border-color: var(--blue);
  color: white;
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.ios-mock-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(360px, 430px) minmax(280px, 360px);
  gap: 26px;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(248, 249, 251, 0.94), rgba(239, 243, 238, 0.96)),
    #f6f7f4;
  color: #171717;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.validation-panel {
  display: grid;
  gap: 22px;
  width: min(360px, calc(100vw - 36px));
  border: 1px solid rgba(56, 70, 61, 0.1);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(247, 249, 244, 0.74)),
    #fafbf7;
  padding: 22px;
  box-shadow:
    0 24px 52px rgba(37, 50, 45, 0.1),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.validation-header,
.validation-block {
  display: grid;
  gap: 12px;
}

.validation-header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.validation-header span,
.validation-label {
  color: rgba(24, 24, 22, 0.46);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.validation-header strong {
  border-radius: 999px;
  background: #e9f2e9;
  color: #1c7058;
  padding: 7px 10px;
  font-size: 0.74rem;
  font-weight: 850;
}

.validation-notebooks,
.scenario-grid {
  display: grid;
  gap: 8px;
}

.validation-notebook,
.scenario-button,
.validation-action,
.validation-reset,
.validation-empty {
  min-width: 0;
  border: 1px solid rgba(48, 73, 62, 0.08);
  border-radius: 16px;
  background: rgba(244, 247, 241, 0.86);
  color: #1d211e;
  text-align: left;
}

.validation-notebook,
.scenario-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
}

.validation-notebook.active,
.scenario-button:hover {
  border-color: rgba(28, 112, 88, 0.32);
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(37, 50, 45, 0.07);
}

.validation-notebook span,
.scenario-button span {
  min-width: 0;
  overflow: hidden;
  color: #171817;
  font-size: 0.9rem;
  font-weight: 820;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.validation-notebook strong,
.scenario-button strong {
  color: rgba(24, 24, 22, 0.44);
  font-size: 0.72rem;
  font-weight: 850;
  white-space: nowrap;
}

.validation-action,
.validation-reset {
  display: grid;
  min-height: 42px;
  place-items: center;
  color: #1c7058;
  font-size: 0.82rem;
  font-weight: 850;
}

.validation-reset {
  color: #b5544e;
}

.app-shell.desktop-prototype {
  display: none;
}

.iphone-frame {
  width: min(430px, calc(100vw - 28px));
  aspect-ratio: 430 / 912;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 58px;
  background: #121315;
  padding: 10px;
  box-shadow:
    0 42px 90px rgba(28, 39, 35, 0.22),
    0 14px 34px rgba(20, 28, 26, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.28) inset;
}

.phone-screen {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
  height: 100%;
  overflow: hidden;
  border-radius: 48px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(248, 249, 246, 0.92)),
    #f8f7f2;
}

.phone-screen::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 36px, rgba(231, 97, 89, 0.16) 36px 37px, transparent 37px),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(82, 128, 176, 0.08) 31px 32px);
  content: "";
}

.ios-status,
.dynamic-island,
.ios-app-header,
.ios-panel-backdrop,
.ios-side-panel,
.composer-status-card,
.notebook-card,
.ios-composer-sheet {
  position: relative;
  z-index: 1;
}

.ios-panel-backdrop {
  position: absolute;
  inset: 0;
  z-index: 8;
  background: rgba(31, 35, 31, 0.18);
  backdrop-filter: blur(6px);
}

.ios-panel-backdrop[hidden] {
  display: none;
}

.ios-side-panel {
  position: absolute;
  left: 12px;
  top: 88px;
  bottom: 92px;
  z-index: 9;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(318px, calc(100% - 24px));
  border: 1px solid rgba(56, 70, 61, 0.12);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 249, 244, 0.9)),
    #fbfcf8;
  box-shadow:
    0 28px 58px rgba(34, 45, 40, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.86) inset;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-18px) scale(0.98);
  transition: opacity 180ms ease, transform 180ms ease;
}

.ios-side-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}

.side-panel-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(54, 70, 61, 0.08);
  padding: 18px;
}

.side-panel-header div,
.side-panel-list {
  min-width: 0;
}

.side-panel-header span {
  display: block;
  color: rgba(24, 24, 22, 0.44);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.side-panel-header strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #171817;
  font-size: 1rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-panel-action {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 15px;
  background: #f0f4ee;
  color: #1c7058;
  font-size: 0.94rem;
  font-weight: 900;
}

.side-panel-action.active {
  background: #1c7058;
  color: #fff;
}

.side-panel-actions {
  display: flex;
  gap: 8px;
}

.book-glyph,
.book-glyph::before,
.book-glyph::after {
  display: block;
  box-sizing: border-box;
}

.book-glyph {
  position: relative;
  width: 22px;
  height: 24px;
  border: 2px solid currentColor;
  border-radius: 5px 7px 7px 5px;
}

.book-glyph::before {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 7px;
  width: 2px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.book-glyph::after {
  position: absolute;
  right: -2px;
  bottom: 3px;
  left: 7px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.side-panel-view {
  display: none;
  min-height: 0;
  padding: 14px;
}

.ios-side-panel[data-panel="notebooks"] .notebooks-view,
.ios-side-panel[data-panel="settings"] .settings-view,
.ios-side-panel[data-panel="tutorial"] .tutorial-view {
  display: grid;
  align-content: start;
  gap: 10px;
}

.side-panel-list {
  display: grid;
  gap: 8px;
  overflow-y: auto;
  padding-right: 2px;
}

.side-panel-notebook,
.side-panel-folder,
.side-panel-create,
.settings-row,
.tutorial-step {
  min-width: 0;
  border: 1px solid rgba(48, 73, 62, 0.08);
  border-radius: 18px;
  background: rgba(244, 247, 241, 0.86);
}

.side-panel-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 2px 0;
  color: rgba(24, 24, 22, 0.42);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.side-panel-section-label strong {
  min-width: 0;
  overflow: hidden;
  color: #1c7058;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folders-label {
  margin-top: 8px;
}

.side-panel-notebook,
.side-panel-folder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 10px 12px;
  text-align: left;
}

.side-panel-notebook.active,
.side-panel-folder.active {
  border-color: rgba(28, 112, 88, 0.3);
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(37, 50, 45, 0.07);
}

.side-panel-notebook span,
.side-panel-notebook strong,
.side-panel-folder span,
.side-panel-folder strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-panel-notebook span,
.side-panel-folder span {
  color: #171817;
  font-size: 0.92rem;
  font-weight: 850;
}

.side-panel-notebook strong,
.side-panel-folder strong {
  color: rgba(24, 24, 22, 0.44);
  font-size: 0.72rem;
  font-weight: 850;
}

.side-panel-create {
  display: grid;
  min-height: 46px;
  place-items: center;
  color: #1c7058;
  font-size: 0.84rem;
  font-weight: 850;
}

.side-panel-create.danger {
  color: #b5544e;
}

.side-panel-empty,
.validation-empty {
  color: rgba(24, 24, 22, 0.46);
  font-size: 0.82rem;
  font-weight: 750;
  padding: 14px 12px;
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 12px;
}

.settings-row span {
  color: rgba(24, 24, 22, 0.54);
  font-size: 0.84rem;
  font-weight: 800;
}

.settings-row strong {
  color: #1c7058;
  font-size: 0.82rem;
  font-weight: 850;
}

.tutorial-step {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
}

.tutorial-step > span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 999px;
  background: #1c7058;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
}

.tutorial-step strong,
.tutorial-step p {
  margin: 0;
}

.tutorial-step strong {
  display: block;
  color: #171817;
  font-size: 0.9rem;
  font-weight: 850;
}

.tutorial-step p {
  margin-top: 4px;
  color: rgba(24, 24, 22, 0.5);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.38;
}

.ios-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 42px;
  padding: 8px 30px 0;
  color: rgba(23, 23, 23, 0.72);
  font-size: 0.78rem;
  font-weight: 700;
}

.dynamic-island {
  justify-self: center;
  width: 124px;
  height: 34px;
  margin-top: -36px;
  border-radius: 999px;
  background: #101113;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset;
}

.ios-app-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 22px 24px 12px;
}

.ios-app-header p,
.ios-app-header h1 {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ios-app-header p {
  color: rgba(23, 23, 23, 0.46);
  font-size: 0.82rem;
  font-weight: 700;
}

.ios-app-header h1 {
  color: #161713;
  font-size: 1.5rem;
  font-weight: 760;
  letter-spacing: 0;
}

.ios-mock-shell button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transform: none;
}

.ios-mock-shell button:hover {
  transform: none;
}

.ios-mock-shell button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.ios-icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow:
    0 10px 22px rgba(33, 40, 36, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.74) inset;
}

.ios-icon-button {
  gap: 4px;
  padding: 12px;
}

.ios-icon-button span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #232522;
}

.composer-status-card {
  display: grid;
  gap: 12px;
  margin: 4px 18px 10px;
  border: 1px solid rgba(56, 70, 61, 0.08);
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(249, 251, 246, 0.84)),
    #fbfcf8;
  padding: 14px;
  box-shadow:
    0 20px 48px rgba(37, 50, 45, 0.1),
    0 1px 0 rgba(255, 255, 255, 0.86) inset;
}

.composer-status-card[hidden] {
  display: none;
}

.composer-status-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pill-label,
.privacy-chip {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pill-label {
  color: #1c7058;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.privacy-chip {
  border-radius: 999px;
  background: #eef4ed;
  color: rgba(31, 50, 43, 0.68);
  padding: 7px 10px;
  font-size: 0.72rem;
  font-weight: 700;
}

.composer-orbit {
  position: relative;
  justify-self: center;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.88) 0 24%, rgba(239, 247, 240, 0.98) 25% 100%);
  box-shadow:
    0 18px 42px rgba(35, 116, 91, 0.18),
    0 0 0 12px rgba(50, 142, 108, 0.08),
    0 0 0 24px rgba(50, 142, 108, 0.04);
  transition: box-shadow 180ms ease, transform 180ms ease;
}

.composer-orbit .orbit-ring,
.composer-orbit .orbit-scan {
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(28, 112, 88, 0.18);
  border-radius: 999px;
  content: "";
}

.composer-orbit .orbit-scan {
  inset: 18px;
  border-color: transparent;
  border-top-color: rgba(28, 112, 88, 0.55);
  border-right-color: rgba(28, 112, 88, 0.2);
  animation: composerOrbit 1.2s linear infinite;
}

.composer-orbit-mic {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 18px;
  color: #1c7058;
}

.composer-orbit:active,
.ios-mock-shell[data-phase="listening"] .composer-orbit,
.ios-mock-shell[data-phase="thinking"] .composer-orbit {
  transform: scale(0.96);
}

.ios-mock-shell[data-phase="listening"] .composer-orbit {
  animation: micPulse 920ms ease-in-out infinite;
  box-shadow:
    0 18px 42px rgba(35, 116, 91, 0.24),
    0 0 0 16px rgba(50, 142, 108, 0.13),
    0 0 0 32px rgba(50, 142, 108, 0.06);
}

.ios-mock-shell[data-phase="thinking"] .composer-orbit {
  box-shadow:
    0 18px 42px rgba(154, 120, 42, 0.2),
    0 0 0 16px rgba(220, 174, 64, 0.12),
    0 0 0 32px rgba(220, 174, 64, 0.05);
}

.composer-stage-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.composer-stage-strip span {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(28, 112, 88, 0.1);
}

.composer-stage-strip span::after {
  display: block;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1c7058, #74d0a7);
  content: "";
  animation: composerScan 1.15s ease-in-out infinite;
}

.composer-stage-strip span:nth-child(2)::after {
  animation-delay: 120ms;
}

.composer-stage-strip span:nth-child(3)::after {
  animation-delay: 240ms;
}

.transcript-card {
  display: grid;
  gap: 8px;
  border-radius: 22px;
  background: rgba(244, 247, 241, 0.88);
  padding: 14px;
}

.transcript-card p {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.raw-line {
  overflow: hidden;
  color: rgba(24, 24, 22, 0.48);
  font-size: 0.86rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clean-line {
  overflow: hidden;
  color: #171717;
  font-family: var(--mono);
  font-size: 0.96rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intent-override-sheet {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 10px;
  margin: 0 18px 10px;
  border: 1px solid rgba(28, 112, 88, 0.16);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 249, 245, 0.9)),
    #fbfcf8;
  padding: 12px;
  box-shadow:
    0 16px 36px rgba(37, 50, 45, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.88) inset;
}

.intent-override-sheet[hidden] {
  display: none;
}

.intent-sheet-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
}

.intent-sheet-top span,
.intent-sheet-top strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intent-sheet-top span {
  color: #1c7058;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.intent-sheet-top strong {
  color: #171817;
  font-size: 0.86rem;
  font-weight: 850;
}

.intent-close {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: #edf3ed;
  color: rgba(24, 24, 22, 0.58);
  font-size: 1.2rem;
  font-weight: 700;
}

.intent-grid,
.intent-calculation-grid {
  display: grid;
  gap: 8px;
}

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

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

.intent-grid button,
.intent-calculation-grid button {
  min-width: 0;
  min-height: 38px;
  border-radius: 15px;
  background: #edf3ed;
  color: #1f3d33;
  font-size: 0.74rem;
  font-weight: 850;
}

.intent-calculation-grid button {
  background: #e6f3ec;
  color: #1c7058;
}

.intent-grid button:active,
.intent-calculation-grid button:active {
  transform: scale(0.98);
}

.notebook-card {
  display: grid;
  align-self: start;
  margin: 0 18px 12px;
  overflow: hidden;
  border: 1px solid rgba(56, 70, 61, 0.08);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow:
    0 18px 38px rgba(37, 50, 45, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.82) inset;
}

.ios-ledger-rows {
  display: grid;
  min-height: 292px;
}

.ios-ledger-swipe-row {
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.ios-ledger-swipe-row.open .ios-ledger-row {
  transform: translateX(-82px);
}

.swipe-delete-button {
  position: absolute;
  inset: 0 0 0 auto;
  display: grid;
  width: 82px;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: #d95b50;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 850;
  box-shadow: none;
}

.swipe-delete-button:hover,
.swipe-delete-button:focus-visible {
  border-color: transparent;
  background: #c94d45;
  color: #fff;
  transform: none;
}

.card-header,
.ios-ledger-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) minmax(84px, auto);
  align-items: center;
  gap: 12px;
}

.card-header {
  grid-template-columns: minmax(0, 1fr) minmax(84px, auto);
  padding: 16px 16px 10px;
  color: rgba(24, 24, 22, 0.44);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.card-header strong {
  justify-self: end;
}

.ios-ledger-row {
  position: relative;
  grid-template-columns: 28px minmax(0, 1fr);
  min-height: 58px;
  padding: 10px 104px 10px 16px;
  border-top: 1px solid rgba(71, 91, 78, 0.08);
  background: rgba(255, 255, 255, 0.84);
  cursor: pointer;
  outline: none;
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
  touch-action: pan-y;
}

.ios-ledger-row.added {
  animation: ledgerRowIn 360ms ease both;
}

.ios-ledger-row:hover,
.ios-ledger-row:focus-visible {
  background: rgba(235, 244, 236, 0.72);
}

.ios-ledger-row.editing {
  background: #fff8df;
  box-shadow:
    4px 0 0 #1c7058 inset,
    0 0 0 1px rgba(28, 112, 88, 0.12) inset;
}

.ios-ledger-row.editing small::after {
  color: #1c7058;
  content: " · editing";
  font-weight: 850;
}

.ios-ledger-row div {
  min-width: 0;
}

.ios-ledger-row p,
.ios-ledger-row small,
.ios-ledger-row strong {
  margin: 0;
  min-width: 0;
}

.ios-ledger-row p {
  overflow: hidden;
  color: #181816;
  font-family: var(--mono);
  font-size: 0.98rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ios-ledger-row small {
  display: block;
  margin-top: 4px;
  color: rgba(24, 24, 22, 0.43);
  font-size: 0.72rem;
  font-weight: 700;
}

.ios-ledger-row strong {
  position: absolute;
  right: 16px;
  justify-self: end;
  font-family: var(--mono);
  font-size: 0.94rem;
  font-weight: 850;
  white-space: nowrap;
}

.income-row strong {
  color: #158052;
}

.expense-row strong {
  color: #cc5a52;
}

.calculation-row {
  background: #e9f3ea;
}

.calculation-row p,
.calculation-row strong {
  color: #158052;
}

.note-row strong {
  color: rgba(24, 24, 22, 0.36);
}

.row-symbol {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
}

.money-symbol {
  border-radius: 9px;
  background:
    linear-gradient(90deg, transparent 47%, rgba(27, 123, 85, 0.34) 47% 53%, transparent 53%),
    #e8f4ea;
}

.money-symbol::after {
  color: #167a50;
  content: "$";
  font-size: 0.9rem;
  font-weight: 900;
}

.dot-symbol::after {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #d36b61;
  content: "";
}

.calculation-symbol,
.note-symbol {
  border-radius: 9px;
  background: #edf4ee;
}

.calculation-symbol::after,
.note-symbol::after {
  color: #167a50;
  content: "=";
  font-size: 0.9rem;
  font-weight: 900;
}

.note-symbol {
  background: #f1f1eb;
}

.note-symbol::after {
  color: rgba(24, 24, 22, 0.42);
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.ios-composer-sheet {
  position: relative;
  align-self: end;
  display: grid;
  margin-top: auto;
  border-radius: 30px 30px 0 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 249, 246, 0.96)),
    #fbfbf7;
  padding: 14px 16px 18px;
  box-shadow:
    0 -18px 36px rgba(38, 50, 45, 0.08),
    0 -1px 0 rgba(255, 255, 255, 0.84) inset;
}

.composer-input {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  border: 1px solid rgba(48, 73, 62, 0.08);
  border-radius: 24px;
  background: #f1f5ef;
  padding: 0 10px;
  box-shadow:
    0 8px 18px rgba(38, 50, 45, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.84) inset;
}

.composer-tools {
  display: grid;
  grid-template-columns: repeat(2, 34px);
  align-items: center;
  gap: 4px;
  min-width: 72px;
  border-right: 1px solid rgba(48, 73, 62, 0.1);
  padding-right: 8px;
}

.composer-icon {
  position: relative;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(28, 112, 88, 0.1);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 249, 244, 0.78));
  color: #1c7058;
  box-shadow:
    0 6px 14px rgba(37, 50, 45, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.86) inset;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.composer-icon:hover,
.composer-icon:focus-visible {
  background: #ffffff;
  box-shadow:
    0 8px 18px rgba(28, 112, 88, 0.12),
    0 0 0 3px rgba(28, 112, 88, 0.08);
}

.composer-icon:active {
  transform: scale(0.95);
}

.add-icon::before,
.add-icon::after {
  position: absolute;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.add-icon::after {
  transform: rotate(90deg);
}

.mic-icon::before {
  position: absolute;
  top: 6px;
  left: 50%;
  width: 10px;
  height: 18px;
  border: 2.4px solid currentColor;
  border-radius: 999px;
  content: "";
  transform: translateX(-50%);
}

.mic-icon::after {
  position: absolute;
  left: 50%;
  top: 18px;
  width: 22px;
  height: 16px;
  border: 2.4px solid currentColor;
  border-top: 0;
  border-radius: 0 0 999px 999px;
  background:
    linear-gradient(currentColor, currentColor) center 9px / 2.4px 7px no-repeat,
    linear-gradient(currentColor, currentColor) center 15px / 13px 2.4px no-repeat;
  content: "";
  transform: translateX(-50%);
}

.mic-icon.listening {
  color: #ffffff;
  background: #1c7058;
  box-shadow:
    0 10px 22px rgba(28, 112, 88, 0.24),
    0 0 0 4px rgba(28, 112, 88, 0.1);
}

.composer-input::before {
  display: none;
}

.write-button {
  display: grid;
  width: 40px;
  min-width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 999px;
  padding: 0;
}

.delete-line-button {
  display: grid;
  width: 38px;
  min-width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 999px;
  padding: 0;
}

.delete-line-button[hidden] {
  display: none;
}

.composer-input .delete-line-button {
  background:
    linear-gradient(180deg, #ef6d61, #c94d45);
  color: #fff;
  box-shadow:
    0 10px 20px rgba(201, 77, 69, 0.2),
    0 1px 0 rgba(255, 255, 255, 0.22) inset;
}

.trash-glyph {
  position: relative;
  display: block;
  width: 16px;
  height: 17px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 4px 4px;
}

.trash-glyph::before,
.trash-glyph::after {
  position: absolute;
  content: "";
}

.trash-glyph::before {
  left: 50%;
  top: -5px;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: translateX(-50%);
}

.trash-glyph::after {
  left: 50%;
  top: -8px;
  width: 8px;
  height: 4px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  transform: translateX(-50%);
}

.write-glyph {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
}

.write-glyph::before {
  position: absolute;
  left: 50%;
  top: 2px;
  width: 8px;
  height: 8px;
  border-top: 2.4px solid currentColor;
  border-left: 2.4px solid currentColor;
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.write-glyph::after {
  position: absolute;
  left: 50%;
  top: 5px;
  width: 2.4px;
  height: 13px;
  border-radius: 999px;
  background: currentColor;
  content: "";
  transform: translateX(-50%);
}

.composer-input input {
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  color: #171717;
  outline: none;
  font-size: 0.86rem;
  font-weight: 760;
}

.composer-input input::placeholder {
  color: rgba(23, 23, 23, 0.42);
}

.composer-input button {
  min-height: 38px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, #218164, #166a52);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 850;
  box-shadow:
    0 10px 20px rgba(28, 112, 88, 0.2),
    0 1px 0 rgba(255, 255, 255, 0.2) inset;
}

.composer-input .write-button,
.composer-input .delete-line-button {
  border-radius: 999px;
}

.composer-input .delete-line-button {
  background:
    linear-gradient(180deg, #ef6d61, #c94d45);
  color: #fff;
  box-shadow:
    0 10px 20px rgba(201, 77, 69, 0.2),
    0 1px 0 rgba(255, 255, 255, 0.22) inset;
}

.composer-input .delete-line-button[hidden] {
  display: none;
}

.composer-input .composer-icon {
  min-height: 36px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 249, 244, 0.78));
  color: #1c7058;
  box-shadow:
    0 6px 14px rgba(37, 50, 45, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.86) inset;
}

.capture-menu {
  position: absolute;
  left: 18px;
  right: 76px;
  bottom: 78px;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid rgba(48, 73, 62, 0.08);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 249, 244, 0.94)),
    #fbfcf8;
  padding: 8px;
  box-shadow:
    0 18px 38px rgba(37, 50, 45, 0.14),
    0 1px 0 rgba(255, 255, 255, 0.86) inset;
}

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

.ios-photo-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.capture-menu button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 16px;
  background: #f1f5ef;
  padding: 0 10px;
  text-align: left;
}

.capture-menu strong {
  min-width: 0;
  overflow: hidden;
  color: #1d211e;
  font-size: 0.75rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.camera-glyph,
.library-glyph {
  position: relative;
  display: block;
  width: 24px;
  height: 20px;
  border: 2px solid #1c7058;
  border-radius: 7px;
}

.camera-glyph::before {
  position: absolute;
  left: 5px;
  top: -6px;
  width: 10px;
  height: 5px;
  border-radius: 4px 4px 0 0;
  background: #1c7058;
  content: "";
}

.camera-glyph::after {
  position: absolute;
  left: 7px;
  top: 5px;
  width: 6px;
  height: 6px;
  border: 2px solid #1c7058;
  border-radius: 999px;
  content: "";
}

.library-glyph::before,
.library-glyph::after {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: #1c7058;
  content: "";
}

.library-glyph::before {
  left: 4px;
  top: 4px;
}

.library-glyph::after {
  right: 4px;
  bottom: 4px;
}

.composer-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #1c7058;
  box-shadow: 0 0 0 5px rgba(28, 112, 88, 0.12);
}

.composer-input p {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  color: rgba(23, 23, 23, 0.48);
  font-size: 0.88rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.capture-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  border-radius: 18px;
  background: #edf1eb;
  padding: 5px;
}

.capture-tab {
  min-height: 32px;
  border-radius: 14px;
  color: rgba(25, 28, 26, 0.5);
  font-size: 0.82rem;
  font-weight: 850;
}

.capture-tab.active {
  background: #ffffff;
  color: #1c7058;
  box-shadow: 0 8px 18px rgba(39, 54, 48, 0.08);
}

.capture-tab:active,
.tabbar-item:active,
.ios-icon-button:active,
.composer-input button:active {
  transform: scale(0.96);
}

.bottom-tabbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding-top: 2px;
}

.tabbar-item {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-height: 42px;
  color: rgba(23, 23, 23, 0.38);
}

.tabbar-item small {
  font-size: 0.64rem;
  font-weight: 800;
}

.tabbar-item.active {
  color: #1c7058;
}

.tabbar-icon {
  position: relative;
  display: block;
  width: 22px;
  height: 22px;
}

.notebook-icon {
  border: 2px solid currentColor;
  border-radius: 5px;
}

.notebook-icon::after {
  position: absolute;
  left: 5px;
  top: 4px;
  width: 9px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
  content: "";
}

.history-icon {
  border: 2px solid currentColor;
  border-radius: 999px;
}

.history-icon::after {
  position: absolute;
  left: 10px;
  top: 4px;
  width: 2px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 4px 7px 0 -1px currentColor;
  content: "";
}

.settings-icon {
  border: 2px solid currentColor;
  border-radius: 999px;
}

.settings-icon::after {
  position: absolute;
  left: 7px;
  top: 7px;
  width: 4px;
  height: 4px;
  border: 2px solid currentColor;
  border-radius: 999px;
  content: "";
}

@keyframes micPulse {
  0%,
  100% {
    transform: scale(0.96);
  }

  50% {
    transform: scale(1);
  }
}

@keyframes composerOrbit {
  to {
    transform: rotate(360deg);
  }
}

@keyframes composerScan {
  0% {
    transform: translateX(-120%);
  }

  55%,
  100% {
    transform: translateX(240%);
  }
}

@keyframes ledgerRowIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  width: min(1320px, calc(100vw - 36px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0;
  align-items: center;
}

.app-shell > * {
  position: relative;
  z-index: 1;
}

.app-shell::before {
  position: absolute;
  left: 6px;
  top: 50%;
  z-index: 0;
  width: 250px;
  height: min(420px, calc(100vh - 96px));
  border: 1px solid rgba(147, 116, 70, 0.18);
  border-radius: 24px;
  background:
    linear-gradient(90deg, rgba(121, 88, 45, 0.08), transparent 18%),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(68, 110, 160, 0.11) 31px 32px),
    #fff4d9;
  box-shadow: 0 18px 40px rgba(101, 72, 35, 0.16);
  content: "";
  transform: translateY(-50%) rotate(-1deg);
}

.notebook-rail {
  min-width: 0;
  border: 1px solid rgba(118, 88, 48, 0.22);
  border-radius: 22px;
  background:
    linear-gradient(90deg, rgba(119, 83, 43, 0.09), transparent 26%),
    repeating-linear-gradient(0deg, transparent 0 30px, rgba(75, 113, 160, 0.1) 30px 31px),
    rgba(255, 247, 227, 0.94);
  padding: 12px;
  box-shadow:
    0 20px 42px rgba(93, 65, 31, 0.16),
    0 1px 0 rgba(255, 255, 255, 0.76) inset;
}

.rail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: #8b6f48;
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
}

#newNotebook {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  min-height: 30px;
  border-radius: 10px;
  color: var(--blue);
  font-family: var(--mono);
  font-weight: 800;
}

.notebook-list {
  display: grid;
  gap: 8px;
}

.notebook-tab {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 62px;
  border-radius: 14px;
  padding: 10px 12px;
  text-align: left;
  font-family: var(--mono);
  border-color: rgba(117, 87, 48, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 245, 221, 0.66));
}

.notebook-tab span,
.notebook-tab strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notebook-tab span {
  color: #3b2e1d;
}

.notebook-tab strong {
  color: #8a714d;
  font-size: 0.86rem;
}

.notebook-tab.active {
  border-color: rgba(63, 140, 255, 0.58);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(236, 244, 255, 0.76));
  box-shadow: 0 0 0 3px rgba(63, 140, 255, 0.12);
}

.notebook-tab.active strong {
  color: var(--green);
}

.ledger-window {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(29, 30, 36, 0.72);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 80px),
    var(--window);
  box-shadow: var(--shadow);
}

.window-bar {
  position: relative;
  display: grid;
  grid-template-columns: 140px 1fr 140px;
  align-items: center;
  min-height: 78px;
  border-bottom: 1px solid rgba(69, 71, 80, 0.9);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent),
    var(--chrome);
  padding: 0 40px;
}

.traffic-lights {
  display: flex;
  gap: 16px;
}

.traffic-lights span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

.traffic-lights .red {
  background: var(--red);
}

.traffic-lights .yellow {
  background: #ffbf36;
}

.traffic-lights .green {
  background: #24c94a;
}

.notebook-title {
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.45rem;
  text-align: center;
  outline: none;
}

.notebook-title:focus {
  color: var(--text);
}

.provider-chip {
  justify-self: end;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 7px 12px;
  font-family: var(--mono);
  font-size: 0.75rem;
}

.ledger-body {
  position: relative;
  padding: 20px 0 0;
  background:
    linear-gradient(90deg, transparent 0 84px, var(--note-margin) 84px 86px, transparent 86px),
    repeating-linear-gradient(0deg, transparent 0 69px, var(--note-line) 69px 70px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 248, 232, 0.96)),
    var(--note-page);
  color: var(--ink);
}

.column-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, auto);
  gap: 20px;
  margin: 0 40px 18px;
  color: #9b8260;
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.column-head span:last-child {
  justify-self: end;
}

.ledger-block {
  min-width: 0;
}

.block-heading {
  margin: 0 40px 12px;
  color: #2f73df;
  font-family: var(--mono);
  font-size: 1.45rem;
  font-weight: 800;
  text-transform: uppercase;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.code-group {
  min-width: 0;
}

.income-group {
  border-left: 0;
  background: transparent;
}

.calculated-group {
  border-left: 0;
}

.ledger-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, auto);
  gap: 20px;
  align-items: center;
  min-height: 70px;
  padding: 0 40px;
  border-bottom: 1px solid rgba(70, 112, 168, 0.13);
  font-family: var(--mono);
  background: rgba(255, 253, 247, 0.2);
}

.income-group .ledger-row:last-child {
  border-bottom-color: rgba(70, 112, 168, 0.13);
}

.spend-group .ledger-row {
  min-height: 74px;
}

.spend-group {
  border-top: 1px solid rgba(140, 117, 82, 0.22);
}

.row-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 20px;
}

.row-icon {
  flex: 0 0 auto;
  width: 54px;
  text-align: center;
  font-size: 1.55rem;
}

.row-title,
.formula-name {
  min-width: 0;
  color: var(--ink);
  font-size: 1.55rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.canonical-line {
  color: var(--ink);
}

.formula-name {
  color: var(--blue);
  font-weight: 800;
}

.formula-name.good {
  color: var(--green);
}

.equals,
.formula-desc,
.row-expression {
  color: var(--ink-soft);
}

.equals {
  font-size: 1.35rem;
  font-weight: 700;
}

.formula-desc {
  min-width: 0;
  font-size: 1.08rem;
  overflow-wrap: anywhere;
}

.row-expression {
  justify-self: end;
  font-size: 1.05rem;
}

.amount {
  justify-self: end;
  color: var(--ink);
  font-size: 1.5rem;
  font-weight: 800;
  white-space: nowrap;
}

.amount.positive,
.amount.good {
  color: #1e9b57;
}

.amount.negative {
  color: #c75c52;
}

.amount.warning {
  color: var(--amber);
}

.rule-line {
  height: 1px;
  margin: 10px 40px 28px;
  background: rgba(114, 95, 68, 0.22);
}

.calculated-group .ledger-row:first-child {
  background: rgba(236, 244, 255, 0.58);
}

.calculated-group .ledger-row:last-child,
.total-row {
  border-bottom-color: rgba(131, 147, 99, 0.26);
  background:
    linear-gradient(90deg, rgba(252, 238, 146, 0.28), rgba(255, 248, 215, 0.68));
}

.calculation-row .row-icon {
  color: var(--blue);
  font-weight: 800;
}

.calculation-row .canonical-line {
  color: var(--blue);
}

.composer-trace {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr) minmax(220px, 0.8fr);
  gap: 14px;
  align-items: center;
  min-height: 58px;
  padding: 11px 40px;
  border-top: 1px solid rgba(114, 95, 68, 0.14);
  border-bottom: 1px solid rgba(114, 95, 68, 0.18);
  background:
    linear-gradient(90deg, rgba(255, 238, 164, 0.3), rgba(255, 250, 231, 0.62));
  font-family: var(--mono);
}

.composer-trace span {
  color: var(--blue);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.composer-trace strong,
.composer-trace em {
  min-width: 0;
  color: #7d735f;
  font-size: 0.92rem;
  font-style: normal;
  overflow-wrap: anywhere;
}

.composer-trace em {
  color: var(--green);
}

.composer-trace.empty {
  grid-template-columns: 138px minmax(0, 1fr);
}

.command-dock {
  border-top: 1px solid rgba(126, 103, 70, 0.24);
  background:
    linear-gradient(90deg, transparent 0 84px, var(--note-margin) 84px 86px, transparent 86px),
    repeating-linear-gradient(0deg, transparent 0 35px, rgba(72, 113, 166, 0.1) 35px 36px),
    #f8ecd1;
  padding: 20px 40px;
}

.composer-label {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  font-family: var(--mono);
}

.composer-label span {
  color: var(--blue);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.composer-label strong {
  min-width: 0;
  color: #776b59;
  font-size: 0.82rem;
  font-weight: 500;
  text-align: right;
}

.command-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px;
  gap: 10px;
}

.command-line input {
  min-width: 0;
  height: 64px;
  border: 1px solid rgba(101, 81, 48, 0.28);
  border-radius: 16px;
  background: rgba(255, 252, 244, 0.92);
  color: var(--ink);
  outline: none;
  padding: 0 28px;
  font-family: var(--mono);
  font-size: 1.32rem;
}

.command-line input::placeholder {
  color: var(--muted-2);
}

.command-line input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(63, 140, 255, 0.12);
}

#submitCommand {
  height: 64px;
  border-radius: 16px;
  border-color: rgba(63, 140, 255, 0.28);
  background: #f2f7ff;
  color: #2f73df;
  font-family: var(--mono);
  font-weight: 800;
}

.dock-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.mode-switch {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 198px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.mode-tab,
.tool-button {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.mode-tab {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
}

.mode-tab:last-child {
  border-right: 0;
}

.mode-tab.active {
  background: var(--blue);
  color: #050609;
}

.tool-button.danger {
  color: #ff8b84;
}

#photoInput {
  width: 182px;
  min-height: 34px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.76rem;
}

.status-line {
  min-height: 18px;
  margin: 12px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.82rem;
}

.status-line[data-kind="error"] {
  color: #ff8b84;
}

.status-line.secondary {
  display: none;
}

.receipt-preview {
  display: none;
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #050609;
}

.receipt-preview.visible {
  display: block;
}

@media (max-width: 1100px) {
  .ios-mock-shell {
    grid-template-columns: 1fr;
    align-content: start;
    padding: 18px;
  }

  .validation-panel {
    width: min(430px, calc(100vw - 36px));
  }

  .app-shell {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 24px 0;
  }

  .notebook-rail {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
  }

  .rail-heading {
    margin-bottom: 0;
  }

  .notebook-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .notebook-tab {
    flex: 0 0 190px;
  }
}

@media (max-width: 760px) {
  .ios-mock-shell {
    display: block;
    padding: 0;
    overflow-x: hidden;
  }

  .iphone-frame {
    width: 100vw;
    height: 100vh;
    aspect-ratio: auto;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
  }

  .phone-screen {
    border-radius: 0;
  }

  .validation-panel {
    width: 100%;
    border-width: 1px 0 0;
    border-radius: 0;
    padding: 18px;
  }

  .ios-status {
    min-height: 34px;
    padding-top: max(8px, env(safe-area-inset-top));
  }

  .dynamic-island {
    width: 108px;
    height: 28px;
    margin-top: -31px;
  }

  .ios-app-header {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    padding: 12px 18px 8px;
  }

  .ios-icon-button {
    width: 38px;
    height: 38px;
    border-radius: 14px;
  }

  .ios-app-header h1 {
    font-size: 1.32rem;
  }

  .composer-status-card {
    gap: 8px;
    margin: 0 12px 8px;
    border-radius: 26px;
    padding: 12px;
  }

  .composer-orbit {
    width: 62px;
    height: 62px;
    box-shadow:
      0 12px 28px rgba(35, 116, 91, 0.15),
      0 0 0 8px rgba(50, 142, 108, 0.08),
      0 0 0 16px rgba(50, 142, 108, 0.04);
  }

  .composer-orbit-mic {
    width: 34px;
    height: 34px;
    border-radius: 14px;
  }

  .transcript-card {
    gap: 5px;
    border-radius: 18px;
    padding: 10px;
  }

  .raw-line {
    font-size: 0.75rem;
  }

  .clean-line {
    font-size: 0.82rem;
  }

  .notebook-card {
    margin: 0 12px 8px;
    border-radius: 24px;
  }

  .card-header,
  .ios-ledger-row {
    grid-template-columns: 24px minmax(0, 1fr) minmax(76px, auto);
    gap: 8px;
  }

  .card-header {
    grid-template-columns: minmax(0, 1fr) minmax(76px, auto);
    padding: 11px 12px 7px;
  }

  .ios-ledger-row {
    grid-template-columns: 24px minmax(0, 1fr);
    min-height: 48px;
    padding: 7px 88px 7px 12px;
  }

  .ios-ledger-row p {
    font-size: 0.82rem;
  }

  .ios-ledger-row small {
    margin-top: 2px;
    font-size: 0.64rem;
  }

  .ios-ledger-row strong {
    right: 12px;
    font-size: 0.78rem;
  }

  .row-symbol {
    width: 24px;
    height: 24px;
  }

  .ios-composer-sheet {
    gap: 6px;
    border-radius: 24px 24px 0 0;
    padding: 10px 12px max(8px, env(safe-area-inset-bottom));
  }

  .composer-input {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    min-height: 48px;
    border-radius: 22px;
    gap: 8px;
    padding: 0 8px;
  }

  .composer-tools {
    grid-template-columns: repeat(2, 32px);
    min-width: 68px;
    gap: 3px;
    padding-right: 7px;
  }

  .composer-icon {
    width: 32px;
    height: 32px;
    border-radius: 13px;
  }

  .composer-input input {
    font-size: 0.78rem;
  }

  .composer-input button {
    min-height: 28px;
    font-size: 0.66rem;
  }

  .write-button {
    width: 36px;
    min-width: 36px;
    height: 36px;
  }

  .delete-line-button {
    width: 34px;
    min-width: 34px;
    height: 34px;
  }

  body::before {
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  body::after,
  .app-shell::before {
    display: none;
  }

  .app-shell {
    width: 100%;
    min-height: 100vh;
    padding: 0;
  }

  .ledger-window,
  .notebook-rail {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .notebook-rail {
    grid-template-columns: 1fr;
  }

  .window-bar {
    grid-template-columns: 86px 1fr auto;
    min-height: 68px;
    padding: 0 16px;
  }

  .traffic-lights {
    gap: 8px;
  }

  .traffic-lights span {
    width: 14px;
    height: 14px;
  }

  .notebook-title {
    font-size: 1rem;
  }

  .provider-chip {
    padding: 5px 8px;
    font-size: 0.68rem;
  }

  .ledger-body {
    padding-top: 18px;
  }

  .block-heading {
    margin: 0 18px 10px;
    font-size: 0.95rem;
  }

  .column-head {
    margin: 0 18px 12px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .ledger-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    min-height: 74px;
    padding: 12px 18px;
  }

  .composer-trace {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 12px 18px;
  }

  .spend-group .ledger-row {
    min-height: 78px;
  }

  .row-main {
    gap: 10px;
  }

  .row-icon {
    width: 30px;
    font-size: 1.1rem;
  }

  .row-title,
  .formula-name {
    font-size: 1.05rem;
  }

  .equals,
  .formula-desc,
  .row-expression {
    font-size: 0.92rem;
  }

  .amount {
    justify-self: end;
    padding-left: 0;
    font-size: 1.16rem;
  }

  .rule-line {
    margin: 8px 18px 22px;
  }

  .command-dock {
    padding: 16px;
  }

  .composer-label {
    display: grid;
  }

  .composer-label strong {
    text-align: left;
  }

  .command-line {
    grid-template-columns: 1fr;
  }

  .command-line input,
  #submitCommand {
    height: 56px;
    border-radius: 12px;
    padding: 0 14px;
    font-size: 1rem;
  }

  .dock-tools {
    gap: 6px;
  }

  .mode-switch {
    width: 100%;
  }

  #photoInput {
    width: 100%;
  }

  .tool-button {
    flex: 1 1 auto;
  }
}
