:root {
  --paper: #fffaf5;
  --canvas: #f1efe7;
  --surface: #ffffff;
  --ink: #242321;
  --muted: #6f6961;
  --line: #e2d8cc;
  --accent: #d85d3f;
  --accent-dark: #a33a2b;
  --accent-soft: #fff0e8;
  --green: #386641;
  --green-soft: #edf6ee;
  --indigo: #3e4c8a;
  --gold: #c99121;
  --danger: #a62d2d;
  --shadow: 0 18px 42px rgba(36, 35, 33, 0.14);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(62, 76, 138, 0.32);
  outline-offset: 2px;
}

svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

noscript {
  display: block;
  width: min(100% - 32px, 520px);
  margin: 16px auto;
  color: var(--muted);
  text-align: center;
}

.app {
  position: relative;
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-inline: 1px solid rgba(36, 35, 33, 0.08);
  box-shadow: 0 0 80px rgba(36, 35, 33, 0.08);
}

.boot-title {
  margin: 0;
  padding: 28px 20px;
  font-size: 34px;
  line-height: 40px;
}

.view {
  flex: 1;
  padding: max(20px, env(safe-area-inset-top)) 20px max(104px, env(safe-area-inset-bottom));
}

.onboarding {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: max(14px, env(safe-area-inset-top)) 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 250, 245, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(226, 216, 204, 0.72);
}

.brand-button {
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: var(--ink);
  font-size: 22px;
  font-weight: 950;
}

.brand-mark,
.mark {
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
}

.brand-mark svg {
  width: 21px;
  height: 21px;
}

.mark {
  width: 68px;
  height: 68px;
  border-radius: 50%;
}

.mark svg {
  width: 32px;
  height: 32px;
}

.pill {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.kicker {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 950;
  line-height: 16px;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 38px;
  line-height: 43px;
  letter-spacing: 0;
}

h2 {
  margin-top: 6px;
  font-size: 26px;
  line-height: 31px;
  letter-spacing: 0;
}

.lead {
  color: var(--muted);
  font-size: 18px;
  line-height: 27px;
}

.lead.small {
  margin-top: 10px;
  font-size: 16px;
  line-height: 24px;
}

.body,
.plan p,
.paywall p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 21px;
}

.screen-head {
  display: grid;
  gap: 4px;
}

.steps,
.stack,
.list,
.mini-list {
  display: grid;
  gap: 12px;
}

.step,
.card,
.stat,
.note-panel,
.paywall,
.settings-row,
.plan,
.mini-entry {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.step {
  min-height: 62px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}

.step span {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--green-soft);
  color: var(--green);
  flex: 0 0 auto;
}

.step strong {
  font-size: 16px;
  line-height: 20px;
}

.field {
  display: grid;
  gap: 8px;
}

.label {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.input,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.input {
  min-height: 52px;
  padding: 0 14px;
  font-size: 18px;
  font-weight: 850;
}

.textarea {
  min-height: 132px;
  padding: 13px 14px;
  resize: vertical;
  font-size: 16px;
  line-height: 24px;
}

.primary,
.secondary,
.icon-btn,
.tab,
.record,
.settings-row {
  border-radius: 8px;
}

.primary,
.secondary {
  min-height: 54px;
  padding: 0 16px;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 16px;
  font-weight: 950;
}

.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 24px rgba(216, 93, 63, 0.22);
}

.primary.compact {
  min-width: 130px;
}

.primary svg,
.secondary svg,
.settings-row svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.secondary {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.today {
  min-height: calc(100vh - 176px);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.record {
  position: relative;
  align-self: center;
  width: 222px;
  height: 222px;
  border: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  overflow: visible;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow);
}

.record.recording {
  background: var(--accent-dark);
  animation: record-pulse 900ms ease-in-out infinite;
}

.record.locked {
  background: #5d5a55;
}

.record-icon,
.record-label {
  position: relative;
  z-index: 2;
}

.record-icon svg {
  width: 58px;
  height: 58px;
}

.record-label {
  font-size: 21px;
  font-weight: 950;
}

.record-ring {
  position: absolute;
  inset: -10px;
  z-index: 1;
  border: 2px solid rgba(216, 93, 63, 0.38);
  border-radius: 50%;
  animation: record-ring 1.4s ease-out infinite;
}

.record-ring.ring-two {
  animation-delay: 700ms;
}

.wave {
  position: relative;
  z-index: 2;
  height: 22px;
  display: inline-flex;
  align-items: end;
  justify-content: center;
  gap: 4px;
}

.wave i {
  display: block;
  width: 4px;
  height: 10px;
  border-radius: 999px;
  background: #fff;
  animation: wave 650ms ease-in-out infinite;
}

.wave i:nth-child(2) {
  animation-delay: 110ms;
}

.wave i:nth-child(3) {
  animation-delay: 220ms;
}

.wave i:nth-child(4) {
  animation-delay: 330ms;
}

@keyframes record-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

@keyframes record-ring {
  0% {
    opacity: 0.9;
    transform: scale(0.96);
  }
  100% {
    opacity: 0;
    transform: scale(1.28);
  }
}

@keyframes wave {
  0%,
  100% {
    height: 7px;
  }
  50% {
    height: 22px;
  }
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat {
  min-height: 92px;
  padding: 14px;
  display: grid;
  align-content: center;
}

.stat.wide {
  grid-column: 1 / -1;
}

.stat strong {
  color: var(--indigo);
  font-size: 28px;
  line-height: 32px;
}

.stat span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.note-panel {
  padding: 16px;
  display: grid;
  gap: 14px;
  background: var(--green-soft);
  border-color: #bfd7c0;
}

.action-row,
.settings-inline,
.card-head,
.card-foot,
.plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-inline .input {
  min-width: 0;
}

.settings-inline .secondary {
  min-width: 104px;
  flex: 0 0 auto;
}

.mini-entry {
  min-height: 104px;
  padding: 14px;
  display: grid;
  gap: 6px;
}

.mini-entry span,
.meta {
  color: var(--muted);
  font-size: 13px;
}

.mini-entry strong {
  color: var(--green);
  font-size: 14px;
}

.mini-entry p {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  line-height: 20px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.paywall,
.plan {
  padding: 16px;
}

.paywall {
  background: var(--accent-soft);
  border-color: #f0c2b5;
}

.paywall strong,
.plan strong {
  font-size: 16px;
}

.plan.pro {
  border-color: #cfd5ef;
  background: #f3f5ff;
}

.plan.lifetime {
  border-color: #ecd69a;
  background: #fff8df;
}

.plan-head span {
  color: var(--accent);
  font-size: 14px;
  font-weight: 950;
  white-space: nowrap;
}

.card {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.card.draft {
  border-style: dashed;
  background: #fffdf9;
}

.date {
  color: var(--ink);
  font-size: 17px;
  font-weight: 950;
}

.tag {
  min-height: 30px;
  max-width: 170px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transcript {
  color: var(--ink);
  font-size: 16px;
  line-height: 24px;
}

.card-foot {
  justify-content: start;
}

.card-foot .meta {
  flex: 1;
  font-weight: 850;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border: 0;
  display: grid;
  place-items: center;
  background: #f0ece4;
  color: var(--ink);
  flex: 0 0 auto;
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

.icon-btn.danger,
.danger-text {
  color: var(--danger);
}

.empty {
  min-height: calc(100vh - 220px);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  text-align: center;
}

.settings-row {
  width: 100%;
  min-height: 56px;
  padding: 0 14px;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.tabs {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 8;
  width: min(100%, 520px);
  transform: translateX(-50%);
  padding: 10px 10px max(10px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.tab {
  min-height: 54px;
  border: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
}

.tab svg {
  width: 21px;
  height: 21px;
}

.tab.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  z-index: 20;
  width: min(calc(100% - 32px), 488px);
  transform: translateX(-50%);
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 850;
}

@media (max-width: 380px) {
  .view {
    padding-inline: 16px;
  }

  h1 {
    font-size: 34px;
    line-height: 39px;
  }

  .record {
    width: 204px;
    height: 204px;
  }

  .settings-inline {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
