:root {
  color-scheme: light;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f0e7;
  color: #173f35;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.shell {
  display: flex;
  min-height: 100svh;
  max-width: 72rem;
  margin: 0 auto;
  padding: clamp(2rem, 7vw, 7rem) clamp(1.25rem, 5vw, 5rem);
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  margin: 0 0 1.5rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h1 {
  max-width: 15ch;
  margin: 0;
  font-size: clamp(2.5rem, 7vw, 6.5rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.lead {
  max-width: 38rem;
  margin: 2rem 0;
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  line-height: 1.55;
  color: #49675f;
}

.status {
  align-self: flex-start;
  border: 1px solid #b8c8be;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.shell-narrow {
  max-width: 48rem;
}

.stack {
  display: grid;
  width: min(100%, 34rem);
  gap: 0.75rem;
}

label {
  font-weight: 750;
}

input {
  width: 100%;
  border: 1px solid #8aa197;
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
  background: #fffdf8;
  color: inherit;
  font: inherit;
}

select,
textarea {
  width: 100%;
  border: 1px solid #8aa197;
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
  background: #fffdf8;
  color: inherit;
  font: inherit;
}

textarea { min-height: 6rem; resize: vertical; }

.item-list { display: grid; gap: 0.75rem; margin: 2rem 0 0; padding: 0; list-style: none; }
.item-list a { display: grid; gap: 0.25rem; border: 1px solid #b8c8be; border-radius: 0.75rem; padding: 1rem; color: inherit; text-decoration: none; }
.item-list span { color: #49675f; }

.item-list-compact { margin-top: 1rem; }
.item-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: 0.5rem 1rem; border-bottom: 1px solid #d3ddd6; padding: 0.8rem 0; }
.item-amount { color: #173f35 !important; font-weight: 750; text-align: right; }
.item-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin: 1.5rem 0; }
.action-form { margin: 0; }
.button-link-secondary { background: transparent; color: #173f35; box-shadow: inset 0 0 0 1px #8aa197; }
.valuation-history { display: grid; gap: 0.75rem; margin: 1rem 0 2rem; }
.valuation-row { display: grid; grid-template-columns: minmax(8rem, auto) minmax(0, 1fr); gap: 1rem; border: 1px solid #b8c8be; border-radius: 0.75rem; padding: 1rem; background: #fffdf8; }
.valuation-row dt { font-weight: 800; }
.valuation-row dd { display: grid; gap: 0.35rem; margin: 0; color: #49675f; }

/* Every primary control — buttons, link-styled buttons, and form inputs —
   keeps at least a 44x44 CSS px touch target, matching the phase 009 mobile
   UX requirement. min-height/min-width are used instead of fixed height so
   controls can still grow with their content or a larger font size. */
button,
.button-link,
input,
select,
textarea {
  min-height: 44px;
}

button,
.button-link {
  min-width: 44px;
}

input[type="checkbox"],
input[type="radio"] {
  width: 1.5rem;
  height: 1.5rem;
  min-height: 1.5rem;
  min-width: 1.5rem;
}

button,
.button-link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.2rem;
  background: #173f35;
  color: #ffffff;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

/* Child primary navigation: at most four destinations, rendered by
   view.Layout on every authenticated child page. Each link keeps the same
   44x44 touch target as every other primary control. */
.child-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #b8c8be;
}

.child-nav-link {
  flex: 1 1 auto;
  display: flex;
  min-height: 44px;
  min-width: 44px;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 0.75rem;
  border-radius: 0.75rem;
  color: #173f35;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
}

.child-nav-link:hover,
.child-nav-link:focus-visible {
  background: #e7ede9;
}

/* Contextual, dismissible install guidance. Rendered only for an
   authenticated parent, only after a first authenticated page view, and
   never on a /child/* page — see web.withInstallGuidancePrompt. */
.install-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
  padding: 0.85rem 1rem;
  border: 1px solid #b8c8be;
  border-radius: 0.75rem;
  background: #eef1ec;
}

.install-hint p {
  margin: 0;
  font-size: 0.95rem;
  color: #173f35;
}

.install-hint-dismiss {
  display: inline-flex;
  min-height: 44px;
  min-width: 44px;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  color: #173f35;
  font-weight: 700;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px #8aa197;
}

button:focus-visible,
.button-link:focus-visible,
input:focus-visible {
  outline: 3px solid #c06b2e;
  outline-offset: 3px;
}

select:focus-visible,
textarea:focus-visible,
a:focus-visible { outline: 3px solid #c06b2e; outline-offset: 3px; }

@media (max-width: 32rem) {
  .item-row, .valuation-row { grid-template-columns: 1fr; }
  .item-row { gap: 0.25rem; }
  .item-amount { text-align: left; }
  .item-actions > *, .item-actions .button-link, .item-actions button { width: 100%; text-align: center; }
}

.form-error {
  margin: 0;
  color: #8a2f25;
  font-weight: 700;
}

.fine-print {
  max-width: 38rem;
  margin-top: 2rem;
  color: #49675f;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* No animation or transition is used anywhere today. This block is a standing
   guarantee: anything added later is disabled for viewers who ask for reduced
   motion, without needing to remember to handle it at each call site. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
