/* ==========================================================================
   Merrow Halstead LLP — client portal app concept
   Only used by /concepts/law/app/. Same family as law-demo.css: same ink,
   same bond paper, same rose ribbon, same four-holder colour key.
   ========================================================================== */

@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --lw-ink: #16212e;
  --lw-ink-2: #253546;
  --lw-muted: #55636f;
  --lw-paper: #f1eee6;
  --lw-paper-2: #e6e1d5;
  --lw-card: #fbf9f4;
  --lw-line: rgba(22, 33, 46, 0.15);
  --lw-line-soft: rgba(22, 33, 46, 0.08);

  --lw-you: #7c2a37;
  --lw-you-bg: #f6e5e6;
  --lw-you-lite: #efaeb5;
  --lw-firm: #245746;
  --lw-firm-bg: #dfebe4;
  --lw-firm-lite: #8fcfb4;
  --lw-outside: #435162;
  --lw-outside-bg: #e3e6ea;
  --lw-public: #6f5312;
  --lw-public-bg: #f0e8d3;

  --lw-shadow: 0 30px 90px rgba(10, 15, 21, 0.3);
  --lw-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --lw-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

body {
  min-width: 20rem;
  min-height: 100svh;
  background: #0e161f;
  color: var(--lw-ink);
  font-family: var(--lw-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body:has(dialog[open]) {
  overflow: hidden;
}

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

button {
  border: 0;
  background: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4 {
  font-family: var(--lw-display);
  font-variation-settings: "SOFT" 0, "WONK" 0, "opsz" 144;
  font-weight: 530;
  letter-spacing: -0.028em;
  line-height: 1.08;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--lw-you);
  outline-offset: 2px;
  border-radius: 0.3rem;
}

.lwa-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.lwa-icon {
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lwa-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.lwa-skip {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 300;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: var(--lw-card);
  color: var(--lw-ink);
  font-weight: 700;
  transform: translateY(-200%);
}

.lwa-skip:focus {
  transform: translateY(0);
}

/* ------------------------------------------------------------- the stage -- */

.lwa-stage {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(22rem, 0.82fr) minmax(30rem, 1.18fr);
}

.lwa-pitch {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1.6rem, 4vw, 4.2rem);
  background: var(--lw-ink);
  color: var(--lw-card);
}

.lwa-back {
  width: fit-content;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(251, 249, 244, 0.68);
  font-size: 0.78rem;
  font-weight: 640;
}

.lwa-back:hover {
  color: var(--lw-card);
}

.lwa-pitch__copy {
  max-width: 38rem;
  margin-block: 3rem;
}

.lwa-kicker {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--lw-you-lite);
  font-size: 0.68rem;
  font-weight: 780;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lwa-kicker::before {
  width: 0.36rem;
  height: 0.36rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.lwa-pitch h1 {
  max-width: 15ch;
  margin-top: 1rem;
  font-size: clamp(2.4rem, 4.4vw, 4rem);
}

.lwa-pitch__copy > p:not(.lwa-kicker) {
  max-width: 44ch;
  margin-top: 1.2rem;
  color: rgba(251, 249, 244, 0.76);
  font-size: 0.95rem;
}

.lwa-pitch ul {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.8rem;
  padding: 0;
  list-style: none;
  color: rgba(251, 249, 244, 0.82);
  font-size: 0.88rem;
}

.lwa-pitch li {
  display: flex;
  align-items: start;
  gap: 0.6rem;
}

.lwa-pitch li svg {
  margin-top: 0.24rem;
  color: var(--lw-firm-lite);
}

.lwa-pitch__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.lwa-pitch__actions a {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border: 1px solid rgba(251, 249, 244, 0.24);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 640;
}

.lwa-pitch__actions p {
  color: rgba(251, 249, 244, 0.55);
  font-size: 0.72rem;
}

/* ------------------------------------------------------------ the device -- */

.lwa-device-wrap {
  min-width: 0;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 4vw, 4rem);
  background: radial-gradient(circle at 50% 26%, #f6f3ec, #d9d5c9 78%);
}

.lwa-device {
  position: relative;
  width: min(100%, 27.5rem);
  height: min(56rem, calc(100svh - 3rem));
  min-height: 44rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 0.5rem solid #0b1219;
  border-radius: 3rem;
  background: var(--lw-paper);
  box-shadow: var(--lw-shadow);
}

.lwa-statusbar,
.lwa-header,
.lwa-demo-banner,
.lwa-matterswitch,
.lwa-tabbar {
  flex: 0 0 auto;
}

.lwa-device__sensor {
  position: absolute;
  top: 0.55rem;
  left: 50%;
  z-index: 20;
  width: 5.6rem;
  height: 1.3rem;
  border-radius: 999px;
  background: #0b1219;
  transform: translateX(-50%);
}

.lwa-statusbar {
  height: 2.5rem;
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding: 0.7rem 1.35rem 0.2rem;
  font-size: 0.68rem;
  font-weight: 700;
}

.lwa-statusbar__right {
  display: flex;
  gap: 0.22rem;
}

.lwa-statusbar__right i {
  width: 0.42rem;
  height: 0.62rem;
  border-radius: 1px;
  background: var(--lw-ink);
}

.lwa-statusbar__right i:nth-child(2) {
  height: 0.5rem;
}

.lwa-statusbar__right i:nth-child(3) {
  width: 0.9rem;
  height: 0.5rem;
  border-radius: 2px;
}

.lwa-header {
  min-height: 3.6rem;
  display: grid;
  grid-template-columns: 2.75rem 1fr 2.75rem;
  gap: 0.5rem;
  align-items: center;
  padding: 0.4rem 0.85rem;
}

.lwa-avatar,
.lwa-header-action {
  position: relative;
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--lw-line);
  border-radius: 50%;
  background: var(--lw-card);
  font-size: 0.72rem;
  font-weight: 760;
}

.lwa-header-action b {
  position: absolute;
  top: 0.1rem;
  right: 0.1rem;
  min-width: 1.05rem;
  height: 1.05rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--lw-you);
  color: var(--lw-card);
  font-size: 0.6rem;
  font-style: normal;
  font-weight: 760;
}

.lwa-brandline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.lwa-brandmark {
  width: 1.55rem;
  height: 1.55rem;
  display: grid;
  place-items: center;
  border-radius: 0.4rem 0.4rem 0.4rem 0.12rem;
  background: var(--lw-ink);
  color: var(--lw-card);
  font-family: var(--lw-display);
  font-variation-settings: "SOFT" 0, "WONK" 0, "opsz" 144;
  font-size: 0.6rem;
  font-weight: 620;
}

.lwa-brandline strong {
  font-family: var(--lw-display);
  font-variation-settings: "SOFT" 0, "WONK" 0, "opsz" 144;
  font-size: 0.95rem;
  font-weight: 560;
  letter-spacing: -0.01em;
}

.lwa-demo-banner {
  min-height: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.2rem 0.6rem;
  background: var(--lw-ink);
  color: rgba(251, 249, 244, 0.78);
  font-size: 0.63rem;
  font-weight: 620;
  text-align: center;
}

.lwa-demo-banner span {
  width: 0.34rem;
  height: 0.34rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--lw-firm-lite);
}

/* matter switcher */

.lwa-matterswitch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
  padding: 0.5rem 0.85rem;
  border-bottom: 1px solid var(--lw-line-soft);
  background: var(--lw-paper-2);
}

.lwa-matterswitch button {
  min-height: 2.9rem;
  display: grid;
  align-content: center;
  gap: 0.05rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 0.6rem;
  text-align: left;
}

.lwa-matterswitch small {
  color: var(--lw-muted);
  font-size: 0.6rem;
  font-weight: 600;
}

.lwa-matterswitch strong {
  font-size: 0.76rem;
  font-weight: 660;
  line-height: 1.2;
}

.lwa-matterswitch button.is-active {
  border-color: var(--lw-ink);
  background: var(--lw-card);
}

.lwa-matterswitch button.is-active small {
  color: var(--lw-you);
}

.lwa-screen {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.lwa-screen::-webkit-scrollbar {
  display: none;
}

.lwa-tabbar {
  z-index: 10;
  height: 4.7rem;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 0.4rem 0.35rem 0.6rem;
  border-top: 1px solid var(--lw-line);
  background: color-mix(in srgb, var(--lw-card) 94%, transparent);
  backdrop-filter: blur(16px);
}

.lwa-tabbar button {
  position: relative;
  min-height: 2.75rem;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.2rem;
  color: var(--lw-muted);
}

.lwa-tabbar button.is-active {
  color: var(--lw-you);
}

.lwa-tabbar span {
  font-size: 0.58rem;
  font-weight: 680;
}

.lwa-tabbar b {
  position: absolute;
  top: 0.05rem;
  right: 0.85rem;
  min-width: 0.95rem;
  height: 0.95rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--lw-you);
  color: var(--lw-card);
  font-size: 0.55rem;
  font-weight: 760;
}

/* ------------------------------------------------------------- screen bits -- */

.lwa-pad {
  display: grid;
  gap: 0.7rem;
  padding: 0.9rem 0.85rem 1.6rem;
}

.lwa-greeting {
  display: grid;
  gap: 0.15rem;
}

.lwa-greeting p {
  color: var(--lw-muted);
  font-size: 0.72rem;
}

.lwa-greeting h1,
.lwa-greeting h2 {
  font-size: 1.65rem;
}

.lwa-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.7rem;
  margin-top: 0.5rem;
}

.lwa-section-title h2,
.lwa-section-title h3 {
  font-size: 1.15rem;
}

.lwa-section-title span {
  color: var(--lw-muted);
  font-size: 0.68rem;
}

.lwa-card {
  display: grid;
  gap: 0.5rem;
  padding: 0.9rem;
  border: 1px solid var(--lw-line);
  border-radius: 0.85rem;
  background: var(--lw-card);
}

.lwa-card__kicker {
  color: var(--lw-you);
  font-size: 0.62rem;
  font-weight: 760;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.lwa-card h3,
.lwa-card h4 {
  font-size: 1.05rem;
}

.lwa-card p {
  color: var(--lw-ink-2);
  font-size: 0.8rem;
}

.lwa-fine {
  color: var(--lw-muted);
  font-size: 0.7rem;
  line-height: 1.45;
}

/* the turn card — the centre of the whole app */

.lwa-turn {
  display: grid;
  gap: 0.55rem;
  padding: 1rem;
  border-radius: 0.95rem;
  border: 1px solid transparent;
}

.lwa-turn--you {
  background: var(--lw-you-bg);
  border-color: var(--lw-you);
  color: #5c1c26;
}

.lwa-turn--firm {
  background: var(--lw-firm-bg);
  border-color: var(--lw-firm);
  color: #16362a;
}

.lwa-turn--outside {
  background: var(--lw-outside-bg);
  border-color: var(--lw-outside);
  color: #2b3644;
}

.lwa-turn--public {
  background: var(--lw-public-bg);
  border-color: var(--lw-public);
  color: #4b380b;
}

.lwa-turn__label {
  font-size: 0.62rem;
  font-weight: 780;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.lwa-turn h2,
.lwa-turn h3 {
  font-size: 1.5rem;
}

.lwa-turn p {
  font-size: 0.81rem;
}

.lwa-turn__who {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: fit-content;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  font-size: 0.7rem;
  font-weight: 700;
}

.lwa-turn__who::before {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

/* the client-facing timeline */

.lwa-stagecard {
  display: grid;
  gap: 0.6rem;
  padding: 0.95rem;
  border-radius: 0.95rem;
  background: var(--lw-ink);
  color: var(--lw-card);
}

.lwa-stagecard h3,
.lwa-stagecard h4 {
  color: var(--lw-card);
  font-size: 1.2rem;
}

.lwa-stagecard p {
  color: rgba(251, 249, 244, 0.76);
  font-size: 0.79rem;
}

.lwa-stagecard__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}

.lwa-stagecard__count {
  color: rgba(251, 249, 244, 0.6);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lwa-track {
  display: flex;
  gap: 0.18rem;
}

.lwa-track span {
  height: 0.32rem;
  flex: 1;
  border-radius: 999px;
  background: rgba(251, 249, 244, 0.22);
}

.lwa-track span.is-done {
  background: var(--lw-firm-lite);
}

.lwa-track span.is-now {
  background: var(--lw-you-lite);
}

.lwa-steps {
  display: grid;
  gap: 0.4rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.lwa-steps li {
  display: grid;
  grid-template-columns: 1.35rem minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
  font-size: 0.76rem;
}

.lwa-steps li > span:first-child {
  width: 1.35rem;
  height: 1.35rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(251, 249, 244, 0.14);
  color: rgba(251, 249, 244, 0.6);
  font-size: 0.58rem;
  font-weight: 720;
}

.lwa-steps li.is-done > span:first-child {
  background: var(--lw-firm-lite);
  color: #16362a;
}

.lwa-steps li.is-now > span:first-child {
  background: var(--lw-you-lite);
  color: #5c1c26;
}

.lwa-steps li.is-now strong {
  color: var(--lw-card);
}

.lwa-steps strong {
  color: rgba(251, 249, 244, 0.82);
  font-weight: 620;
}

.lwa-steps small {
  display: block;
  color: rgba(251, 249, 244, 0.5);
  font-size: 0.68rem;
}

/* action rows */

.lwa-row {
  width: 100%;
  min-height: 3.4rem;
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--lw-line);
  border-radius: 0.8rem;
  background: var(--lw-card);
  text-align: left;
}

.lwa-row--flag {
  border-color: var(--lw-you);
  background: var(--lw-you-bg);
}

.lwa-row__icon {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 0.55rem;
  background: var(--lw-paper-2);
  color: var(--lw-you);
}

.lwa-row--flag .lwa-row__icon {
  background: rgba(255, 255, 255, 0.66);
}

.lwa-row__body {
  display: grid;
  min-width: 0;
  gap: 0.08rem;
}

.lwa-row strong {
  font-size: 0.83rem;
  font-weight: 660;
}

.lwa-row span {
  color: var(--lw-muted);
  font-size: 0.71rem;
}

.lwa-row--flag span {
  color: #6b2531;
}

.lwa-row > svg:last-child {
  width: 0.9rem;
  color: var(--lw-muted);
}

.lwa-pill {
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.63rem;
  font-weight: 720;
  white-space: nowrap;
}

.lwa-pill--done {
  background: var(--lw-firm-bg);
  color: var(--lw-firm);
}

.lwa-pill--wait {
  background: var(--lw-you-bg);
  color: var(--lw-you);
}

.lwa-pill--info {
  background: var(--lw-outside-bg);
  color: var(--lw-outside);
}

.lwa-pill--court {
  background: var(--lw-public-bg);
  color: var(--lw-public);
}

/* buttons */

.lwa-primary,
.lwa-secondary {
  min-height: 2.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 660;
}

.lwa-primary {
  background: var(--lw-ink);
  color: var(--lw-card);
}

.lwa-primary--accent {
  background: var(--lw-you);
}

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

.lwa-primary:disabled,
.lwa-secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.lwa-full {
  width: 100%;
}

/* segmented control */

.lwa-seg {
  display: grid;
  grid-auto-flow: column;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: var(--lw-paper-2);
}

.lwa-seg button {
  min-height: 2.5rem;
  border-radius: 999px;
  color: var(--lw-muted);
  font-size: 0.76rem;
  font-weight: 660;
}

.lwa-seg button.is-active {
  background: var(--lw-card);
  color: var(--lw-ink);
  box-shadow: 0 1px 3px rgba(22, 33, 46, 0.12);
}

/* money and ledgers */

.lwa-figure {
  display: grid;
  gap: 0.15rem;
  padding: 0.95rem;
  border-radius: 0.9rem;
  background: var(--lw-ink);
  color: var(--lw-card);
}

.lwa-figure small {
  color: rgba(251, 249, 244, 0.62);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lwa-figure strong {
  font-family: var(--lw-display);
  font-variation-settings: "SOFT" 0, "WONK" 0, "opsz" 144;
  font-size: 2.2rem;
  font-weight: 540;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.lwa-figure p {
  color: rgba(251, 249, 244, 0.7);
  font-size: 0.72rem;
}

.lwa-figure__bar {
  height: 0.35rem;
  overflow: hidden;
  margin-top: 0.4rem;
  border-radius: 999px;
  background: rgba(251, 249, 244, 0.2);
}

.lwa-figure__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--lw-firm-lite);
  transition: width 400ms ease;
}

.lwa-figure__bar span.is-low {
  background: var(--lw-you-lite);
}

.lwa-ledger {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--lw-line);
  border-radius: 0.8rem;
  background: var(--lw-card);
}

.lwa-ledger > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--lw-line-soft);
  font-size: 0.77rem;
}

.lwa-ledger > div:last-child {
  border-bottom: 0;
}

.lwa-ledger dt {
  min-width: 0;
}

.lwa-ledger dt small {
  display: block;
  color: var(--lw-muted);
  font-size: 0.68rem;
}

.lwa-ledger dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  text-align: right;
  white-space: nowrap;
}

.lwa-ledger .is-credit dd {
  color: var(--lw-firm);
}

.lwa-ledger .is-total {
  background: var(--lw-paper-2);
  font-weight: 700;
}

/* messages */

.lwa-thread {
  display: grid;
  gap: 0.55rem;
}

.lwa-msg {
  max-width: 85%;
  display: grid;
  gap: 0.2rem;
  padding: 0.65rem 0.8rem;
  border-radius: 0.85rem;
  font-size: 0.81rem;
}

.lwa-msg--them {
  border: 1px solid var(--lw-line);
  border-bottom-left-radius: 0.25rem;
  background: var(--lw-card);
}

.lwa-msg--you {
  justify-self: end;
  border-bottom-right-radius: 0.25rem;
  background: var(--lw-ink);
  color: var(--lw-card);
}

.lwa-msg b {
  font-size: 0.68rem;
  font-weight: 720;
}

.lwa-msg--them b {
  color: var(--lw-you);
}

.lwa-msg--you b {
  color: var(--lw-you-lite);
}

.lwa-msg small {
  font-size: 0.65rem;
}

.lwa-msg--them small {
  color: var(--lw-muted);
}

.lwa-msg--you small {
  color: rgba(251, 249, 244, 0.6);
}

.lwa-compose {
  display: grid;
  gap: 0.5rem;
  padding: 0.85rem;
  border: 1px solid var(--lw-line);
  border-radius: 0.85rem;
  background: var(--lw-card);
}

.lwa-compose textarea {
  width: 100%;
  min-height: 4.6rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--lw-line);
  border-radius: 0.6rem;
  background: var(--lw-paper);
  font-size: 0.83rem;
  resize: vertical;
}

.lwa-compose label > span {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.75rem;
  font-weight: 660;
}

/* dates */

.lwa-date {
  display: grid;
  grid-template-columns: 3.1rem minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: center;
  width: 100%;
  min-height: 3.4rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--lw-line);
  border-radius: 0.8rem;
  background: var(--lw-card);
  text-align: left;
}

.lwa-date__chip {
  display: grid;
  place-items: center;
  padding: 0.35rem 0.2rem;
  border-radius: 0.5rem;
  background: var(--lw-paper-2);
  line-height: 1.05;
}

.lwa-date__chip b {
  font-size: 0.95rem;
  font-weight: 740;
}

.lwa-date__chip i {
  font-size: 0.6rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lwa-date--firm .lwa-date__chip {
  background: var(--lw-public-bg);
  color: var(--lw-public);
}

.lwa-date__body {
  display: grid;
  min-width: 0;
  gap: 0.08rem;
}

.lwa-date strong {
  font-size: 0.83rem;
  font-weight: 660;
}

.lwa-date span {
  color: var(--lw-muted);
  font-size: 0.71rem;
}

/* empty state */

.lwa-empty {
  display: grid;
  gap: 0.35rem;
  padding: 1.6rem 1rem;
  border: 1px dashed var(--lw-line);
  border-radius: 0.85rem;
  text-align: center;
}

.lwa-empty strong {
  font-size: 0.9rem;
}

.lwa-empty span {
  color: var(--lw-muted);
  font-size: 0.75rem;
}

.lwa-warn {
  display: flex;
  align-items: start;
  gap: 0.55rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.7rem;
  background: var(--lw-you-bg);
  color: #5c1c26;
  font-size: 0.75rem;
  line-height: 1.45;
}

.lwa-warn svg {
  margin-top: 0.2rem;
  flex: 0 0 auto;
  color: var(--lw-you);
}

/* ---------------------------------------------------------------- dialogs -- */

.lwa-dialog,
.lwa-alert {
  position: fixed;
  inset: auto;
  top: var(--lwa-cy, 50%);
  left: var(--lwa-cx, 50%);
  width: min(calc(100% - 1.5rem), var(--lwa-mw, 26rem), 26rem);
  max-height: min(var(--lwa-mh, 88svh), 88svh, 46rem);
  margin: 0;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--lw-line);
  border-radius: 1.2rem;
  background: var(--lw-paper);
  color: var(--lw-ink);
  box-shadow: var(--lw-shadow);
  transform: translate(-50%, -50%);
}

/* .lwa-alert sets display, which would beat the UA's dialog:not([open])
   rule and leave the alert on screen at load. Put it back. */
dialog:not([open]) {
  display: none;
}

.lwa-dialog::backdrop,
.lwa-alert::backdrop {
  background: rgba(8, 13, 19, 0.7);
  backdrop-filter: blur(5px);
}

.lwa-dialog__head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.9rem;
  border-bottom: 1px solid var(--lw-line);
  background: color-mix(in srgb, var(--lw-paper) 93%, transparent);
  backdrop-filter: blur(12px);
}

.lwa-dialog__head h2 {
  margin-top: 0.2rem;
  font-size: 1.35rem;
}

.lwa-dialog__close {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--lw-line);
  border-radius: 50%;
  background: var(--lw-card);
}

.lwa-dialog__body {
  display: grid;
  gap: 0.75rem;
  padding: 0.9rem;
}

.lwa-dialog__body p {
  font-size: 0.83rem;
}

.lwa-alert {
  width: min(calc(100% - 1.5rem), var(--lwa-mw, 23rem), 23rem);
  display: grid;
  gap: 0.5rem;
  padding: 1.4rem;
  text-align: center;
}

.lwa-alert h2 {
  font-size: 1.5rem;
}

.lwa-alert p {
  color: var(--lw-ink-2);
  font-size: 0.83rem;
}

.lwa-alert .lwa-kicker {
  justify-content: center;
  color: var(--lw-you);
}

.lwa-alert .lwa-primary {
  width: 100%;
  margin-top: 0.4rem;
}

/* the signature pad */

.lwa-sign {
  display: grid;
  gap: 0.55rem;
}

.lwa-sign__pad {
  position: relative;
  border: 1px solid var(--lw-line);
  border-radius: 0.7rem;
  background: var(--lw-card);
  touch-action: none;
}

.lwa-sign__pad canvas {
  width: 100%;
  height: 9rem;
  display: block;
  border-radius: inherit;
  cursor: crosshair;
}

.lwa-sign__rule {
  position: absolute;
  right: 1.2rem;
  bottom: 2.1rem;
  left: 1.2rem;
  height: 1px;
  background: var(--lw-line);
  pointer-events: none;
}

.lwa-sign__hint {
  position: absolute;
  bottom: 0.7rem;
  left: 1.2rem;
  color: var(--lw-muted);
  font-size: 0.68rem;
  pointer-events: none;
}

.lwa-sign__typed {
  min-height: 9rem;
  display: grid;
  place-items: center;
  padding: 1rem;
  border: 1px solid var(--lw-line);
  border-radius: 0.7rem;
  background: var(--lw-card);
  font-family: var(--lw-display);
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 24;
  font-size: 1.9rem;
  font-weight: 400;
}

.lwa-sign__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
}

.lwa-field {
  display: grid;
  gap: 0.3rem;
}

.lwa-field > span {
  font-size: 0.75rem;
  font-weight: 660;
}

.lwa-field input,
.lwa-field select {
  width: 100%;
  min-height: 2.85rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--lw-line);
  border-radius: 0.6rem;
  background: var(--lw-card);
  font-size: 0.85rem;
}

.lwa-toast {
  position: fixed;
  z-index: 200;
  bottom: var(--lwa-toast-bottom, 1rem);
  left: var(--lwa-cx, 50%);
  width: min(calc(100% - 1.5rem), var(--lwa-mw, 20rem), 20rem);
  padding: 0.7rem 0.9rem;
  border-radius: 0.7rem;
  background: var(--lw-ink);
  color: var(--lw-card);
  box-shadow: var(--lw-shadow);
  font-size: 0.79rem;
  text-align: center;
  transform: translateX(-50%);
}

/* ------------------------------------------------------------- responsive -- */

@media (max-width: 56rem) {
  .lwa-stage {
    grid-template-columns: 1fr;
  }

  .lwa-pitch {
    min-height: auto;
    align-items: center;
    flex-direction: row;
    gap: 1rem;
    padding: 0.85rem 1.1rem;
  }

  .lwa-pitch__copy {
    display: none;
  }

  .lwa-pitch__actions {
    margin-left: auto;
  }

  .lwa-pitch__actions p {
    display: none;
  }

  .lwa-device-wrap {
    min-height: 0;
    padding: 1rem;
  }

  .lwa-device {
    height: min(56rem, calc(100svh - 6.5rem));
    min-height: 0;
  }
}

@media (max-width: 34rem) {
  body {
    background: var(--lw-paper);
  }

  .lwa-pitch {
    display: none;
  }

  .lwa-device-wrap {
    min-height: 100svh;
    padding: 0;
    background: var(--lw-paper);
  }

  .lwa-device {
    width: 100%;
    height: 100svh;
    min-height: 100svh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .lwa-device__sensor {
    display: none;
  }

  .lwa-statusbar {
    height: calc(2.5rem + env(safe-area-inset-top));
    padding-top: max(0.7rem, env(safe-area-inset-top));
  }

  .lwa-tabbar {
    height: calc(4.5rem + env(safe-area-inset-bottom));
    padding-bottom: max(0.55rem, env(safe-area-inset-bottom));
  }
}

@media (max-width: 23.5rem) {
  .lwa-matterswitch strong {
    font-size: 0.71rem;
  }

  .lwa-row {
    grid-template-columns: 1.8rem minmax(0, 1fr) auto;
    gap: 0.5rem;
  }

  .lwa-figure strong {
    font-size: 1.9rem;
  }
}

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