@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700&display=swap");

:root {
  --ink: #17211f;
  --ink-soft: #46504e;
  --ivory: #f4f0e7;
  --paper: #fffdf8;
  --blue: #246bfe;
  --blue-dark: #174bc0;
  --lime: #c9ff57;
  --green: #22845b;
  --orange: #e87729;
  --red: #d8483e;
  --line: #dedbd1;
  --muted: #777d7a;
  --shadow: 0 24px 60px rgba(28, 35, 33, 0.18);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ink);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 12%, rgba(36, 107, 254, 0.18), transparent 31rem),
    radial-gradient(circle at 82% 88%, rgba(201, 255, 87, 0.11), transparent 28rem),
    #101715;
  font-family: "DM Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button,
input {
  font: inherit;
}

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

button {
  color: inherit;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.is-hidden {
  display: none !important;
}

.ambient {
  position: fixed;
  border-radius: 999px;
  filter: blur(90px);
  pointer-events: none;
}

.ambient-one {
  width: 18rem;
  height: 18rem;
  top: -4rem;
  left: 5%;
  background: rgba(36, 107, 254, 0.18);
}

.ambient-two {
  width: 16rem;
  height: 16rem;
  right: 4%;
  bottom: -2rem;
  background: rgba(201, 255, 87, 0.1);
}

.app-frame {
  position: relative;
  width: min(100%, 430px);
  height: 100dvh;
  min-height: 680px;
  margin: 0 auto;
  overflow: hidden;
  background: var(--ivory);
}

.connect-screen {
  min-height: 100%;
  padding: calc(28px + var(--safe-top)) 24px calc(22px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.6), transparent 45%),
    var(--ivory);
}

.connect-art {
  position: relative;
  width: 164px;
  height: 164px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
}

.lighthouse {
  width: 40px;
  height: 40px;
  stroke-width: 3;
}

.lighthouse-large {
  width: 104px;
  height: 104px;
  position: relative;
  z-index: 2;
  color: var(--blue);
  stroke-width: 2.5;
}

.signal-ring {
  position: absolute;
  inset: 22px;
  border: 1px solid rgba(36, 107, 254, 0.24);
  border-radius: 50%;
  animation: signal 2.8s ease-out infinite;
}

.signal-two {
  animation-delay: 1.4s;
}

@keyframes signal {
  from {
    transform: scale(0.65);
    opacity: 0.8;
  }
  to {
    transform: scale(1.45);
    opacity: 0;
  }
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font: 700 0.68rem/1.2 "Manrope", sans-serif;
  letter-spacing: 0.13em;
}

.connect-copy h1,
.welcome h2,
.page-header h2,
.bottom-sheet h2,
.mini-sheet h2,
.sync-card h2 {
  margin: 0;
  font-family: "Manrope", sans-serif;
  letter-spacing: -0.035em;
}

.connect-copy h1 {
  max-width: 350px;
  font-size: clamp(2rem, 8.5vw, 2.5rem);
  line-height: 1.08;
}

.connect-copy > p:last-child {
  margin: 14px 0 22px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.55;
}

.connection-card {
  padding: 19px;
  border: 1px solid rgba(23, 33, 31, 0.09);
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.86);
  box-shadow: 0 20px 55px rgba(23, 33, 31, 0.08);
}

.connection-card label,
.mini-sheet label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.76rem;
  font-weight: 700;
}

.input-wrap {
  height: 52px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--muted);
  font-size: 0.9rem;
  transition: 0.2s ease;
}

.input-wrap:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(36, 107, 254, 0.12);
}

.input-wrap input {
  width: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.button {
  min-height: 48px;
  border: 0;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    background 0.15s ease;
}

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

.button svg {
  width: 19px;
  height: 19px;
  stroke-width: 2.5;
}

.button-primary {
  background: var(--blue);
  color: white;
  box-shadow: 0 8px 24px rgba(36, 107, 254, 0.24);
}

.button-primary:hover {
  background: var(--blue-dark);
}

.button-secondary {
  border: 1px solid var(--line);
  background: var(--paper);
}

.button-quiet {
  background: transparent;
}

.button-full {
  width: 100%;
}

.connection-card .button {
  margin-top: 12px;
}

.connection-note {
  margin: 13px 2px 0;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

.connection-note svg {
  width: 16px;
  min-width: 16px;
  height: 16px;
  color: var(--green);
}

.text-button {
  padding: 10px;
  border: 0;
  display: block;
  margin: 6px auto 0;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
  cursor: pointer;
}

.connect-footer {
  margin: auto 0 0;
  padding-top: 18px;
  color: var(--muted);
  text-align: center;
  font-size: 0.67rem;
}

.app-shell {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--ivory);
}

.topbar {
  min-height: calc(66px + var(--safe-top));
  padding: calc(10px + var(--safe-top)) 18px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(23, 33, 31, 0.07);
  background: rgba(244, 240, 231, 0.93);
  backdrop-filter: blur(14px);
  z-index: 4;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
}

.brand .lighthouse {
  width: 31px;
  height: 31px;
  color: var(--blue);
}

.brand span {
  display: flex;
  flex-direction: column;
}

.brand strong {
  font: 700 1.22rem/1 "Manrope", sans-serif;
  letter-spacing: -0.05em;
}

.brand small {
  margin-top: 3px;
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.connection-pill {
  padding: 7px 10px;
  border: 1px solid rgba(34, 132, 91, 0.18);
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(34, 132, 91, 0.07);
  color: #196342;
  font-size: 0.66rem;
  font-weight: 700;
  cursor: pointer;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2caf76;
  box-shadow: 0 0 0 4px rgba(44, 175, 118, 0.12);
}

.view-stack {
  min-height: 0;
  position: relative;
}

.view {
  position: absolute;
  inset: 0;
  display: none;
}

.view.is-active {
  display: block;
  animation: view-in 0.24s ease;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
}

.content-scroll {
  height: 100%;
  padding: 22px 18px 34px;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
}

.content-scroll::-webkit-scrollbar,
.filter-row::-webkit-scrollbar,
.sheet-scroll::-webkit-scrollbar {
  display: none;
}

.welcome h2,
.page-header h2 {
  font-size: 1.7rem;
  line-height: 1.16;
}

.welcome > p:last-child,
.page-header > p:last-child {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.deck-scroll {
  padding-top: 16px;
  padding-bottom: 16px;
  overflow-x: hidden;
}

.deck-welcome h2 {
  font-size: 1.48rem;
}

.deck-welcome > p:last-child {
  margin-top: 4px;
  font-size: 0.78rem;
}

.deck-section {
  margin-top: 16px;
}

.deck-toolbar {
  min-height: 40px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.deck-toolbar h3 {
  margin: 0;
  font: 700 1rem/1.2 "Manrope", sans-serif;
}

.deck-status {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 5px;
}

.deck-status .urgent-badge {
  padding: 4px 7px;
  background: rgba(232, 119, 41, 0.1);
  color: #a4430e;
  font-size: 0.58rem;
}

.deck-status strong {
  color: var(--muted);
  font-size: 0.58rem;
}

.deck-stage {
  height: min(400px, calc(100dvh - 350px));
  min-height: 340px;
  position: relative;
  margin: 14px 0 12px;
  perspective: 1000px;
}

.deck-card {
  position: absolute;
  inset: 0;
  padding: 17px;
  overflow: hidden;
  border: 1px solid rgba(23, 33, 31, 0.11);
  border-radius: 23px;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.95), rgba(255, 253, 248, 0.98)),
    var(--paper);
  box-shadow: 0 16px 40px rgba(23, 33, 31, 0.13);
  transform:
    translateY(calc(var(--deck-index) * 10px))
    scale(calc(1 - var(--deck-index) * 0.035));
  transform-origin: center bottom;
  transition:
    transform 0.24s ease,
    opacity 0.24s ease;
  user-select: none;
}

.deck-card::after {
  content: "";
  height: 4px;
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  border-radius: 0 0 8px 8px;
  background: var(--blue);
}

.deck-card[data-priority="urgent"]::after {
  background: var(--orange);
}

.deck-card.is-front {
  cursor: grab;
  touch-action: none;
}

.deck-card.is-front:active {
  cursor: grabbing;
}

.deck-card .card-top {
  min-height: 28px;
}

.deck-card .decision-ref {
  margin: 13px 0 5px;
}

.deck-card h4 {
  margin: 0;
  font: 700 clamp(1.28rem, 5.6vw, 1.52rem)/1.18 "Manrope", sans-serif;
  letter-spacing: -0.035em;
}

.deck-summary {
  margin: 10px 0 13px;
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.45;
}

.deck-card .card-metrics {
  margin: 0 0 12px;
  padding: 11px 0;
}

.deck-recommendation {
  padding: 12px 13px;
  border: 1px solid rgba(36, 107, 254, 0.14);
  border-radius: 14px;
  background: rgba(36, 107, 254, 0.055);
}

.deck-recommendation small,
.deck-recommendation strong {
  display: block;
}

.deck-recommendation small {
  margin-bottom: 4px;
  color: var(--blue);
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.09em;
}

.deck-recommendation strong {
  font-size: 0.72rem;
  line-height: 1.4;
}

.deck-confidence {
  margin-top: auto;
  padding-top: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.61rem;
}

.deck-confidence b {
  color: var(--blue);
}

.mini-confidence {
  width: 92px;
  height: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: #e2ded5;
}

.mini-confidence span {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--blue);
}

.swipe-stamp {
  position: absolute;
  z-index: 2;
  top: 76px;
  padding: 6px 10px;
  border: 3px solid currentColor;
  border-radius: 8px;
  opacity: 0;
  font: 800 1.2rem/1 "Manrope", sans-serif;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.skip-stamp {
  right: 20px;
  transform: rotate(10deg);
  color: var(--orange);
}

.action-stamp {
  left: 20px;
  transform: rotate(-10deg);
  color: var(--green);
}

.deck-card.swipe-left {
  transform: translateX(-135%) rotate(-18deg) !important;
  opacity: 0;
}

.deck-card.swipe-right {
  transform: translateX(135%) rotate(18deg) !important;
  opacity: 0;
}

.deck-actions {
  display: grid;
  grid-template-columns: 1fr 0.78fr 1fr;
  align-items: start;
  gap: 12px;
}

.deck-action {
  padding: 0;
  border: 0;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  cursor: pointer;
}

.deck-action > span {
  width: 53px;
  height: 53px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--paper);
  box-shadow: 0 7px 18px rgba(23, 33, 31, 0.08);
  transition:
    transform 0.15s ease,
    background 0.15s ease;
}

.deck-action:active > span {
  transform: scale(0.94);
}

.deck-action svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.3;
}

.deck-action small {
  color: var(--muted);
  font-size: 0.57rem;
  font-weight: 700;
}

.skip-action > span {
  color: var(--orange);
}

.detail-action > span {
  width: 43px;
  height: 43px;
  margin-top: 5px;
  color: var(--blue);
}

.detail-action svg {
  width: 20px;
  height: 20px;
}

.approve-action > span {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
  box-shadow: 0 8px 22px rgba(36, 107, 254, 0.25);
}

.swipe-guide {
  margin-top: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  color: var(--muted);
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.swipe-guide b {
  color: var(--ink-soft);
  font-size: 0.55rem;
}

.swipe-guide i {
  font-style: normal;
  font-size: 0.8rem;
  font-weight: 700;
}

.left-arrow {
  color: var(--orange);
}

.right-arrow {
  color: var(--green);
}

.session-tally {
  margin-top: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.56rem;
}

.session-tally b {
  color: var(--ink);
}

.session-tally i {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #a9aaa5;
}

.deck-complete {
  height: min(400px, calc(100dvh - 350px));
  min-height: 340px;
  margin: 14px 0 12px;
  padding: 30px 24px;
  border: 1px dashed var(--line);
  border-radius: 23px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: rgba(255, 253, 248, 0.72);
  text-align: center;
}

.complete-mark {
  width: 58px;
  height: 58px;
  margin-bottom: 15px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(34, 132, 91, 0.1);
  color: var(--green);
  font-size: 1.3rem;
  font-weight: 700;
}

.deck-complete h3 {
  margin: 0;
  font: 700 1.25rem/1.2 "Manrope", sans-serif;
}

.deck-complete p {
  max-width: 250px;
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

.impact-summary {
  position: relative;
  min-height: 140px;
  margin: 20px 0 26px;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  overflow: hidden;
  border-radius: 21px;
  background: var(--ink);
  color: white;
  box-shadow: 0 14px 35px rgba(23, 33, 31, 0.16);
}

.summary-main,
.summary-side {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
}

.summary-main > span,
.summary-main small,
.summary-side {
  color: rgba(255, 255, 255, 0.65);
}

.summary-main > span {
  font-size: 0.7rem;
  font-weight: 600;
}

.summary-main > strong {
  margin: 5px 0 1px;
  font: 700 2.25rem/1 "Manrope", sans-serif;
  letter-spacing: -0.05em;
}

.summary-main small {
  font-size: 0.62rem;
}

.summary-side {
  align-items: flex-end;
  justify-content: flex-start;
  gap: 10px;
  font-size: 0.68rem;
}

.summary-side b {
  color: white;
}

.urgent-badge {
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

.urgent-badge i {
  width: 6px;
  height: 6px;
  display: inline-block;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--orange);
}

.summary-wave {
  position: absolute;
  width: 75%;
  height: 60%;
  right: -5%;
  bottom: -3%;
  color: rgba(201, 255, 87, 0.38);
}

.summary-wave .wave-glow {
  stroke: rgba(201, 255, 87, 0.12);
  stroke-width: 12;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-heading h3 {
  margin: 0;
  font: 700 1.15rem/1.2 "Manrope", sans-serif;
}

.icon-button {
  width: 39px;
  height: 39px;
  position: relative;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  cursor: pointer;
}

.icon-button svg {
  width: 100%;
  height: 100%;
}

.filter-count {
  width: 15px;
  height: 15px;
  position: absolute;
  right: -4px;
  top: -4px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: white;
  font-size: 0.55rem;
  font-style: normal;
}

.filter-row {
  margin: 14px -18px 16px;
  padding: 0 18px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
}

.filter-chip {
  min-width: max-content;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  scroll-snap-align: start;
  background: var(--paper);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.filter-chip.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

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

.decision-card {
  position: relative;
  padding: 16px;
  overflow: hidden;
  border: 1px solid rgba(23, 33, 31, 0.1);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 7px 20px rgba(23, 33, 31, 0.05);
  cursor: pointer;
  animation: card-in 0.35s both;
}

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

.decision-card::before {
  content: "";
  width: 3px;
  position: absolute;
  left: 0;
  top: 15px;
  bottom: 15px;
  border-radius: 5px;
  background: var(--blue);
}

.decision-card[data-priority="urgent"]::before {
  background: var(--orange);
}

.card-top,
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.type-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--blue);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.type-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(36, 107, 254, 0.09);
}

.type-icon svg {
  width: 15px;
  height: 15px;
  stroke-width: 2;
}

.priority-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
}

.priority-label i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
}

.priority-label.urgent {
  color: #b94c11;
}

.priority-label.urgent i {
  background: var(--orange);
}

.decision-card h4 {
  margin: 13px 0 7px;
  font: 700 1.03rem/1.28 "Manrope", sans-serif;
  letter-spacing: -0.02em;
}

.decision-card > p {
  min-height: 36px;
  margin: 0 0 15px;
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.45;
}

.card-metrics {
  margin-bottom: 14px;
  padding: 11px 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid #ebe7de;
  border-bottom: 1px solid #ebe7de;
}

.card-metrics > div + div {
  padding-left: 13px;
  border-left: 1px solid #ebe7de;
}

.card-metrics span,
.card-metrics small {
  display: block;
}

.card-metrics span {
  color: var(--muted);
  font-size: 0.6rem;
}

.card-metrics strong {
  margin-top: 3px;
  display: block;
  font: 700 0.89rem/1.2 "Manrope", sans-serif;
}

.card-footer {
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 700;
}

.card-footer svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.5;
}

.queue-footer,
.version {
  margin: 22px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.62rem;
}

.empty-state {
  padding: 38px 20px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  text-align: center;
}

.empty-state > span {
  width: 42px;
  height: 42px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(34, 132, 91, 0.1);
  color: var(--green);
  font-weight: 700;
}

.empty-state h3 {
  margin: 0;
}

.empty-state p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.bottom-nav {
  min-height: calc(68px + var(--safe-bottom));
  padding: 8px 28px calc(8px + var(--safe-bottom));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(23, 33, 31, 0.09);
  background: rgba(255, 253, 248, 0.95);
  backdrop-filter: blur(14px);
  z-index: 5;
}

.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #858a87;
  text-decoration: none;
  font-size: 0.59rem;
  font-weight: 700;
}

.nav-item svg {
  width: 23px;
  height: 23px;
  stroke-width: 1.8;
}

.nav-item.is-active {
  color: var(--blue);
}

.nav-badge {
  min-width: 15px;
  height: 15px;
  position: absolute;
  top: 0;
  left: calc(50% + 7px);
  padding: 0 4px;
  border: 2px solid var(--paper);
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--orange);
  color: white;
  font-size: 0.5rem;
  font-style: normal;
}

.page-header {
  padding-top: 3px;
  margin-bottom: 23px;
}

.activity-tabs {
  margin-bottom: 20px;
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-radius: 12px;
  background: #e8e4da;
}

.activity-tabs button {
  padding: 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}

.activity-tabs button.is-active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 3px 8px rgba(23, 33, 31, 0.08);
}

.activity-list {
  position: relative;
  display: grid;
  gap: 4px;
}

.activity-item {
  position: relative;
  padding: 12px 0 16px 44px;
}

.activity-item::before {
  content: "";
  width: 1px;
  position: absolute;
  left: 16px;
  top: 43px;
  bottom: -5px;
  background: var(--line);
}

.activity-item:last-child::before {
  display: none;
}

.activity-mark {
  width: 32px;
  height: 32px;
  position: absolute;
  left: 0;
  top: 9px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(34, 132, 91, 0.12);
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 700;
}

.activity-mark.system {
  background: rgba(36, 107, 254, 0.1);
  color: var(--blue);
}

.activity-item strong,
.activity-item span,
.activity-item small {
  display: block;
}

.activity-item strong {
  font: 700 0.83rem/1.35 "Manrope", sans-serif;
}

.activity-item span {
  margin: 4px 0 6px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.4;
}

.activity-item small {
  color: var(--muted);
  font-size: 0.6rem;
}

.profile-card {
  padding: 17px;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
}

.avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--lime);
  font: 700 0.9rem/1 "Manrope", sans-serif;
}

.profile-card strong,
.profile-card span,
.profile-card small {
  display: block;
}

.profile-card strong {
  font: 700 0.95rem/1.2 "Manrope", sans-serif;
}

.profile-card span {
  margin: 3px 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.profile-card small {
  color: var(--muted);
  font-size: 0.63rem;
}

.settings-group {
  margin-top: 24px;
}

.settings-label {
  margin: 0 0 9px 4px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.settings-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--paper);
}

.setting-row {
  width: 100%;
  min-height: 62px;
  padding: 12px 13px;
  border: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  background: transparent;
  text-align: left;
}

button.setting-row {
  cursor: pointer;
}

.setting-row + .setting-row {
  border-top: 1px solid #ece8df;
}

.setting-row > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.setting-row strong,
.setting-row small {
  display: block;
}

.setting-row strong {
  font-size: 0.77rem;
}

.setting-row small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setting-row > svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.setting-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #efebe2;
  color: var(--ink-soft);
  font-weight: 700;
}

.setting-icon svg {
  width: 18px;
  height: 18px;
}

.acumatica-icon {
  background: #f0553e;
  color: white;
}

.success-icon {
  background: rgba(34, 132, 91, 0.11);
  color: var(--green);
}

.status-word {
  color: var(--green);
  font-size: 0.62rem;
  font-weight: 700;
}

.switch {
  width: 42px;
  height: 24px;
  position: relative;
  appearance: none;
  border-radius: 999px;
  background: #d8d5cd;
  cursor: pointer;
  transition: 0.2s;
}

.switch::after {
  content: "";
  width: 18px;
  height: 18px;
  position: absolute;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 5px rgba(23, 33, 31, 0.2);
  transition: 0.2s;
}

.switch:checked {
  background: var(--blue);
}

.switch:checked::after {
  transform: translateX(18px);
}

#reset-demo {
  margin-top: 25px;
}

.disconnect-button {
  width: 100%;
  padding: 13px;
  border: 0;
  background: transparent;
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.sheet-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  background: rgba(8, 13, 12, 0.58);
  backdrop-filter: blur(3px);
  animation: fade-in 0.2s ease;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.bottom-sheet,
.mini-sheet,
.action-menu {
  width: min(100%, 430px);
  position: fixed;
  z-index: 21;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  border-radius: 25px 25px 0 0;
  background: var(--paper);
  box-shadow: var(--shadow);
  animation: sheet-in 0.32s cubic-bezier(0.22, 0.74, 0.2, 1);
}

@keyframes sheet-in {
  from {
    transform: translate(-50%, 105%);
  }
}

.bottom-sheet {
  max-height: 94dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.sheet-grabber {
  width: 42px;
  height: 4px;
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  border-radius: 99px;
  background: #d8d5ce;
}

.sheet-header {
  padding: 23px 19px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sheet-type .type-badge {
  font-size: 0.7rem;
}

.close-sheet {
  border: 0;
  border-radius: 50%;
  background: #efebe3;
}

.sheet-scroll {
  padding: 3px 19px 20px;
  overflow-y: auto;
}

.decision-ref {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 0.63rem;
}

.bottom-sheet h2 {
  font-size: 1.55rem;
  line-height: 1.2;
}

.sheet-summary {
  margin: 11px 0 17px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.52;
}

.confidence-row {
  padding: 13px 14px;
  border-radius: 13px;
  background: #f0ede5;
}

.confidence-row > div:first-child {
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  font-size: 0.67rem;
}

.confidence-row strong {
  color: var(--blue);
}

.confidence-track {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: #d9d5cb;
}

.confidence-track span {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--blue);
  transition: width 0.5s ease;
}

.detail-section {
  margin-top: 22px;
}

.reason-list {
  display: grid;
  gap: 10px;
}

.reason-item {
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid #e9e5dc;
  border-radius: 13px;
}

.reason-item > span {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(36, 107, 254, 0.08);
  color: var(--blue);
  font-weight: 700;
}

.reason-item strong,
.reason-item small {
  display: block;
}

.reason-item strong {
  font-size: 0.76rem;
}

.reason-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.63rem;
  line-height: 1.35;
}

.impact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.impact-item {
  min-height: 78px;
  padding: 11px 9px;
  border-radius: 12px;
  background: #f0ede5;
}

.impact-item span,
.impact-item strong,
.impact-item small {
  display: block;
}

.impact-item span {
  color: var(--muted);
  font-size: 0.55rem;
}

.impact-item strong {
  margin: 4px 0 2px;
  font: 700 0.82rem/1.2 "Manrope", sans-serif;
}

.impact-item small {
  color: var(--green);
  font-size: 0.55rem;
  font-weight: 700;
}

.recommendation-box {
  padding: 14px;
  display: flex;
  gap: 10px;
  border: 1px solid rgba(36, 107, 254, 0.17);
  border-radius: 14px;
  background: rgba(36, 107, 254, 0.055);
}

.recommendation-icon {
  color: var(--blue);
}

.recommendation-box small,
.recommendation-box strong {
  display: block;
}

.recommendation-box small {
  margin-bottom: 4px;
  color: var(--blue);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.recommendation-box strong {
  font-size: 0.76rem;
  line-height: 1.4;
}

.link-row {
  width: 100%;
  margin-top: 16px;
  padding: 12px 0;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.link-row span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.link-row svg {
  width: 17px;
  height: 17px;
}

.sheet-actions {
  padding: 12px 19px calc(13px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.secondary-actions {
  margin-top: 7px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.mini-sheet {
  padding: 26px 20px calc(20px + var(--safe-bottom));
}

.mini-sheet h2 {
  font-size: 1.3rem;
}

.mini-sheet > p {
  margin: 7px 0 17px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.stepper {
  height: 54px;
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: 54px 1fr 54px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.stepper button,
.stepper input {
  border: 0;
  background: white;
  text-align: center;
}

.stepper button {
  color: var(--blue);
  font-size: 1.4rem;
  cursor: pointer;
}

.stepper input {
  width: 100%;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  outline: none;
  font-weight: 700;
}

.action-menu {
  padding: 18px 16px calc(16px + var(--safe-bottom));
}

.action-menu button {
  width: 100%;
  min-height: 56px;
  padding: 11px 10px;
  border: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.action-menu button + button {
  border-top: 1px solid var(--line);
}

.action-menu button > span:first-child {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #f0ede5;
  font-weight: 700;
}

.action-menu strong,
.action-menu small {
  display: block;
}

.action-menu strong {
  font-size: 0.76rem;
}

.action-menu small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.62rem;
}

.action-menu .cancel-menu {
  justify-content: center;
  color: var(--blue);
  text-align: center;
  font-weight: 700;
}

.sync-overlay {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--ink);
  color: white;
}

.sync-card {
  width: min(100%, 350px);
  text-align: center;
}

.sync-animation {
  width: 118px;
  height: 118px;
  position: relative;
  margin: 0 auto 24px;
  border: 1px solid rgba(201, 255, 87, 0.24);
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.sync-animation::before,
.sync-animation::after {
  content: "";
  position: absolute;
  inset: -1px;
  border: 1px solid transparent;
  border-top-color: var(--lime);
  border-radius: 50%;
  animation: spin 1.25s linear infinite;
}

.sync-animation::after {
  inset: 10px;
  border-top-color: rgba(201, 255, 87, 0.45);
  animation-direction: reverse;
  animation-duration: 1.8s;
}

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

.sync-animation.is-complete {
  border-color: var(--lime);
  background: rgba(201, 255, 87, 0.08);
}

.sync-animation.is-complete::before,
.sync-animation.is-complete::after {
  display: none;
}

.sync-animation.is-error {
  border-color: var(--orange);
  background: rgba(232, 119, 41, 0.08);
}

.sync-animation.is-error::before,
.sync-animation.is-error::after {
  display: none;
}

.sync-animation.is-error .sync-lighthouse {
  color: var(--orange);
}

.sync-lighthouse {
  width: 68px;
  height: 68px;
  color: var(--lime);
  stroke-width: 2.3;
}

.sync-card .eyebrow {
  color: var(--lime);
}

.sync-card h2 {
  font-size: 1.55rem;
}

.sync-card > p:not(.eyebrow) {
  margin: 9px 0 21px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.8rem;
  line-height: 1.5;
}

.sync-card .button {
  background: var(--lime);
  color: var(--ink);
  box-shadow: none;
}

.toast {
  width: calc(min(100%, 430px) - 36px);
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: calc(86px + var(--safe-bottom));
  transform: translateX(-50%);
  padding: 12px 15px;
  border-radius: 13px;
  background: var(--ink);
  color: white;
  box-shadow: 0 12px 30px rgba(23, 33, 31, 0.24);
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  animation: toast-in 0.24s ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
}

@media (min-width: 600px) {
  body {
    padding: 22px 0;
  }

  .app-frame {
    height: calc(100dvh - 44px);
    border: 8px solid #070b0a;
    border-radius: 38px;
    box-shadow: 0 35px 90px rgba(0, 0, 0, 0.45);
  }

  .connect-screen,
  .app-shell {
    border-radius: 29px;
  }

  .bottom-sheet,
  .mini-sheet,
  .action-menu {
    bottom: 22px;
    border-radius: 25px;
  }

  .sheet-backdrop {
    width: 430px;
    height: calc(100dvh - 44px);
    left: 50%;
    top: 22px;
    transform: translateX(-50%);
    border-radius: 38px;
  }

  .sync-overlay {
    width: 430px;
    height: calc(100dvh - 44px);
    left: 50%;
    top: 22px;
    transform: translateX(-50%);
    border-radius: 38px;
  }
}

@media (max-height: 720px) {
  .connect-art {
    width: 110px;
    height: 110px;
    margin-bottom: 4px;
  }

  .lighthouse-large {
    width: 80px;
    height: 80px;
  }

  .connect-copy h1 {
    font-size: 1.9rem;
  }

  .connect-copy > p:last-child {
    margin: 10px 0 14px;
  }

  .deck-stage,
  .deck-complete {
    min-height: 310px;
  }

  .deck-card {
    padding: 14px;
  }

  .deck-summary {
    margin: 7px 0 9px;
  }
}

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