/* App shell */
.app-shell {
  min-height: 100vh;
}

.sidebar {
  display: none;
}

.app-column {
  min-width: 0;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  background: rgba(251, 249, 245, .92);
  border-bottom: 1px solid rgba(232, 225, 217, .92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.topbar-mobile-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-mobile-brand > div {
  min-width: 0;
  display: grid;
}

.topbar-mobile-brand span:not(.logo-mark) {
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.25;
  text-transform: uppercase;
}

.topbar-mobile-brand strong {
  max-width: 160px;
  overflow: hidden;
  color: var(--ink-900);
  font-size: 15px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-desktop-title {
  display: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.topbar-actions .button {
  min-height: 38px;
  padding: 8px 10px;
}

.topbar-actions .button span {
  display: none;
}

.app-main {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 20px 14px calc(var(--mobile-nav-height) + 28px + env(safe-area-inset-bottom));
}

.mobile-bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  min-height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .95);
  border-top: 1px solid var(--line);
  box-shadow: 0 -12px 35px rgba(43, 35, 28, .08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.mobile-nav-link {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 4px 2px 2px;
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
}

.mobile-nav-link.is-active {
  color: var(--tea-800);
}

.mobile-nav-icon {
  min-width: 36px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-pill);
}

.mobile-nav-link.is-active .mobile-nav-icon {
  background: var(--tea-100);
}

.mobile-nav-add {
  color: var(--tea-900);
}

.mobile-nav-add .mobile-nav-icon {
  width: 46px;
  height: 46px;
  margin-top: -17px;
  color: #fff;
  background: var(--tea-800);
  border: 4px solid var(--surface);
  box-shadow: 0 7px 18px rgba(75, 84, 56, .28);
}

.logo-mark {
  --logo-size: 40px;
  width: var(--logo-size);
  height: var(--logo-size);
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  color: var(--tea-800);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-copy {
  display: grid;
  line-height: 1.05;
}

.brand-copy span {
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.brand-copy strong {
  margin-top: 3px;
  color: var(--ink-900);
  font-size: 14px;
}

.tj-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tj-monogram {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--surface);
  background: var(--tea-800);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.04em;
}

.tj-lockup > div {
  display: grid;
  line-height: .95;
}

.tj-lockup strong {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -.035em;
}

.tj-lockup > div span {
  margin-top: 4px;
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 760;
  letter-spacing: .22em;
  text-transform: uppercase;
}

/* Shared page framing */
.screen {
  display: grid;
  gap: 20px;
}

.page-intro {
  display: grid;
  gap: 16px;
}

.page-intro > div:first-child {
  min-width: 0;
}

.page-kicker,
.section-kicker,
.public-eyebrow {
  display: inline-block;
  color: var(--tea-700);
  font-size: 10px;
  font-weight: 780;
  letter-spacing: .13em;
  line-height: 1.2;
  text-transform: uppercase;
}

.page-intro h2 {
  margin-top: 6px;
  color: var(--ink-950);
  font-size: clamp(28px, 8vw, 40px);
}

.page-intro p {
  max-width: 660px;
  margin-top: 8px;
  font-size: 14px;
}

.page-intro-compact h2 {
  font-size: 30px;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.page-actions .button {
  flex: 1 1 auto;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h3 {
  margin-top: 5px;
  color: var(--ink-900);
  font-size: 20px;
}

.section-heading p {
  max-width: 620px;
  margin-top: 6px;
  font-size: 13px;
}

.section-heading-tight {
  align-items: center;
}

.count-badge,
.visibility-count,
.prototype-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  color: var(--ink-600);
  background: var(--ink-100);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

/* Summary cards */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.summary-card {
  min-width: 0;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  padding: 15px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-xs);
}

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

.summary-icon {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  color: var(--tea-800);
  background: var(--tea-100);
  border-radius: 11px;
}

.summary-warning .summary-icon {
  color: var(--amber-700);
  background: var(--amber-100);
}

.summary-danger .summary-icon {
  color: var(--red-700);
  background: var(--red-100);
}

.summary-success .summary-icon {
  color: var(--green-700);
  background: var(--green-100);
}

.summary-badge {
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 700;
}

.summary-value {
  margin-top: 16px;
  color: var(--ink-950);
  font-size: 28px;
  line-height: 1;
}

.summary-label {
  margin-top: 6px;
  color: var(--ink-800);
  font-size: 12px;
  font-weight: 720;
}

.summary-card p {
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.4;
}

.summary-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
  padding-top: 12px;
  color: var(--tea-800);
  font-size: 11px;
  font-weight: 700;
}

/* Status components */
.risk-pill,
.stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 760;
  line-height: 1;
  white-space: nowrap;
}

.risk-danger {
  color: var(--red-700);
  background: var(--red-100);
}

.risk-watch {
  color: var(--amber-700);
  background: var(--amber-100);
}

.risk-safe {
  color: var(--green-700);
  background: var(--green-100);
}

.risk-complete {
  color: var(--tea-800);
  background: var(--tea-100);
}

.stage-pill {
  color: var(--tea-800);
  background: var(--tea-100);
}

.stage-pill > span {
  width: 6px;
  height: 6px;
  background: var(--tea-600);
  border-radius: 50%;
}

.status-success {
  color: var(--green-700) !important;
}

.status-warning {
  color: var(--amber-700) !important;
}

.status-danger {
  color: var(--red-700) !important;
}

.avatar {
  --avatar-size: 40px;
  width: var(--avatar-size);
  height: var(--avatar-size);
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  color: var(--tea-900);
  background: linear-gradient(145deg, var(--tea-100), var(--surface-gold));
  border: 1px solid var(--tea-200);
  border-radius: 50%;
  font-size: calc(var(--avatar-size) * .32);
  font-weight: 780;
}

/* Production board and order cards */
.board-shell {
  position: relative;
  margin: 0 -14px;
}

.board-scroll-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 15px 14px 8px;
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 650;
}

.production-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(270px, 84vw);
  align-items: start;
  gap: 11px;
  padding: 0 14px 12px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-padding-inline: 14px;
  scroll-snap-type: inline mandatory;
}

.board-column {
  min-height: 270px;
  padding: 10px;
  background: var(--ink-50);
  border: 1px solid var(--line);
  border-radius: 17px;
  scroll-snap-align: start;
}

.board-column-header {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 3px 9px;
}

.board-column-header > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.board-column-header strong {
  overflow: hidden;
  color: var(--ink-700);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-dot,
.stage-setting-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  background: var(--tea-600);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--tea-100);
}

.stage-count {
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--ink-600);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 760;
}

.board-column-body {
  display: grid;
  gap: 8px;
}

.order-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-xs);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}

.order-card:hover {
  transform: translateY(-2px);
  border-color: var(--ink-300);
  box-shadow: var(--shadow-sm);
}

.order-card-compact {
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
}

.order-card-head,
.order-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.order-card-head > div {
  min-width: 0;
  display: grid;
}

.order-number {
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.order-card-head strong {
  overflow: hidden;
  margin-top: 2px;
  color: var(--ink-900);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-product {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.product-swatch {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  background: #7c835c;
  border: 3px solid rgba(255,255,255,.8);
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--line), inset 0 0 0 1px rgba(0,0,0,.05);
}

.product-swatch-tea-leaf { background: #727a55; }
.product-swatch-buff { background: #d2b59b; }
.product-swatch-real-teal { background: #2f7a78; }
.product-swatch-white { background: #f2f0e9; }
.product-swatch-hunter-green { background: #2f563f; }
.product-swatch-gold { background: #c59c4b; }
.product-swatch-spring-green { background: #93b34f; }
.product-swatch-country-blue { background: #5e85a5; }
.product-swatch-pumpkin { background: #be672f; }

.order-product > div {
  min-width: 0;
  display: grid;
}

.order-product strong {
  overflow: hidden;
  color: var(--ink-800);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-product span:not(.product-swatch) {
  overflow: hidden;
  margin-top: 1px;
  color: var(--ink-500);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-card-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.order-card-meta span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  color: var(--ink-600);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-card-meta .icon {
  color: var(--ink-400);
}

.order-card-footer {
  padding-top: 9px;
  border-top: 1px solid var(--ink-100);
}

.order-open {
  display: inline-flex;
  align-items: center;
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 700;
}

.empty-stage {
  min-height: 190px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--ink-400);
  border: 1px dashed var(--ink-200);
  border-radius: 13px;
}

.empty-stage span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .7);
  border-radius: 50%;
}

.empty-stage p {
  color: var(--ink-400);
  font-size: 11px;
}

/* Timeline */
.timeline {
  list-style: none;
}

.timeline-item {
  position: relative;
  min-height: 66px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 11px;
}

.timeline-item:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 26px;
  bottom: 0;
  left: 14px;
  width: 2px;
  background: var(--line);
}

.timeline-complete:not(:last-child)::before {
  background: var(--tea-300);
}

.timeline-marker {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--ink-400);
  background: var(--surface);
  border: 2px solid var(--line-strong);
  border-radius: 50%;
}

.timeline-complete .timeline-marker {
  color: #fff;
  background: var(--tea-700);
  border-color: var(--tea-700);
}

.timeline-current .timeline-marker {
  background: var(--tea-100);
  border-color: var(--tea-600);
  box-shadow: 0 0 0 5px rgba(110, 120, 82, .09);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--tea-700);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(110, 120, 82, .35);
  animation: pulse 2.1s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(110, 120, 82, .32); }
  70% { box-shadow: 0 0 0 8px rgba(110, 120, 82, 0); }
  100% { box-shadow: 0 0 0 0 rgba(110, 120, 82, 0); }
}

.timeline-copy {
  min-width: 0;
  padding: 3px 0 18px;
}

.timeline-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.timeline-copy strong {
  color: var(--ink-800);
  font-size: 13px;
}

.timeline-upcoming .timeline-copy strong {
  color: var(--ink-400);
}

.timeline-copy p {
  max-width: 580px;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.55;
}

.timeline-copy > span {
  display: inline-block;
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 10px;
}

.current-badge {
  padding: 4px 7px;
  color: var(--tea-800) !important;
  background: var(--tea-100);
  border-radius: var(--radius-pill);
  font-size: 9px !important;
  font-weight: 760;
  line-height: 1;
}

/* Progress photo */
.progress-visual {
  display: grid;
  gap: 12px;
}

.crochet-photo {
  position: relative;
  min-height: 220px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 24%, rgba(255,255,255,.5), transparent 28%),
    linear-gradient(140deg, #69724c 0%, #7d8660 45%, #59613f 100%);
  border-radius: 17px;
}

.progress-visual.is-empty .crochet-photo {
  background: linear-gradient(145deg, var(--ink-100), var(--surface-warm));
  border: 1px dashed var(--ink-300);
}

.crochet-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(36, 31, 26, .22), transparent 45%);
  pointer-events: none;
}

.crochet-swatch {
  position: relative;
  z-index: 1;
  width: min(76%, 300px);
  padding: 18px 14px;
  transform: rotate(-3deg);
  filter: drop-shadow(0 18px 18px rgba(35, 32, 22, .22));
}

.stitch-row {
  display: flex;
  justify-content: center;
  gap: 2px;
  margin-top: -5px;
  transform: translateX(calc((var(--row) % 2) * 8px));
}

.stitch-row i {
  width: 22px;
  height: 18px;
  display: block;
  border: 3px solid rgba(237, 237, 218, .78);
  border-top-color: rgba(225, 228, 201, .92);
  border-radius: 50% 50% 45% 45%;
  transform: rotate(calc((var(--col) - 4) * .6deg));
}

.progress-visual.is-empty .stitch-row i {
  border-color: rgba(170, 159, 148, .4);
}

.yarn-tail {
  position: absolute;
  z-index: 1;
  right: 13%;
  bottom: 18%;
  width: 86px;
  height: 48px;
  border: 4px solid rgba(236, 237, 216, .8);
  border-top-color: transparent;
  border-left-color: transparent;
  border-radius: 50%;
  transform: rotate(24deg);
}

.photo-label {
  position: absolute;
  z-index: 2;
  bottom: 12px;
  left: 12px;
  padding: 6px 9px;
  color: #fff;
  background: rgba(36, 31, 26, .45);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-pill);
  font-size: 9px;
  font-weight: 740;
  backdrop-filter: blur(8px);
}

.progress-visual.is-empty .photo-label {
  color: var(--ink-600);
  background: rgba(255,255,255,.76);
}

.progress-visual-copy {
  display: grid;
  gap: 3px;
}

.progress-visual-copy strong {
  color: var(--ink-800);
  font-size: 13px;
}

.progress-visual-copy span {
  color: var(--ink-500);
  font-size: 11px;
}

.upload-trigger {
  position: relative;
  overflow: hidden;
}

.upload-trigger input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Forms and shared details */
.form-field {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-700);
  font-size: 12px;
  font-weight: 680;
}

.field-label em {
  color: var(--ink-400);
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.form-field small {
  color: var(--ink-500);
  font-size: 10px;
}

.detail-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
}

.detail-row-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--ink-500);
  background: var(--ink-50);
  border-radius: 10px;
}

.detail-row > div {
  min-width: 0;
  display: grid;
  padding-top: 1px;
}

.detail-row > div span {
  color: var(--ink-500);
  font-size: 10px;
}

.detail-row > div strong {
  overflow-wrap: anywhere;
  color: var(--ink-800);
  font-size: 12px;
  line-height: 1.45;
}

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

.note-field > span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-700);
  font-size: 12px;
  font-weight: 700;
}

.note-field > span small {
  margin-left: auto;
  color: var(--ink-400);
  font-size: 9px;
  font-weight: 600;
}

.switch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.switch-row > span {
  display: grid;
}

.switch-row strong {
  color: var(--ink-800);
  font-size: 12px;
}

.switch-row small {
  color: var(--ink-500);
  font-size: 10px;
}

.switch-row input,
.visibility-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-row i,
.visibility-switch i {
  position: relative;
  width: 42px;
  height: 24px;
  background: var(--ink-200);
  border-radius: var(--radius-pill);
  transition: background .18s var(--ease);
}

.switch-row i::after,
.visibility-switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(43, 35, 28, .18);
  transition: transform .18s var(--ease);
}

.switch-row input:checked + i,
.visibility-switch input:checked + i {
  background: var(--tea-700);
}

.switch-row input:checked + i::after,
.visibility-switch input:checked + i::after {
  transform: translateX(18px);
}

.prototype-inline-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 12px;
  color: var(--ink-600);
  background: var(--surface-gold);
  border: 1px solid var(--gold-300);
  border-radius: 12px;
  font-size: 10px;
  line-height: 1.45;
}

.empty-state {
  min-height: 300px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 10px;
  padding: 32px 20px;
  text-align: center;
}

.empty-state-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  color: var(--tea-800);
  background: var(--tea-100);
  border-radius: 16px;
}

.empty-state h3 {
  color: var(--ink-900);
  font-size: 18px;
}

.empty-state p {
  max-width: 380px;
  font-size: 12px;
}

/* Modals and toast */
#modal-root:empty,
#toast-root:empty {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  align-items: end;
  padding: 12px;
  background: rgba(24, 20, 17, .55);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: fadeIn .18s var(--ease);
}

.modal-card {
  position: relative;
  width: 100%;
  max-height: calc(100vh - 24px);
  display: grid;
  gap: 16px;
  padding: 24px 18px 18px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  animation: modalUp .24s var(--ease);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
}

.modal-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 42px;
}

.modal-heading h3 {
  margin-top: 3px;
  color: var(--ink-900);
  font-size: 20px;
}

.modal-icon {
  width: 46px;
  height: 46px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: var(--tea-800);
  background: var(--tea-100);
  border-radius: 15px;
}

.modal-icon-warning {
  color: var(--red-700);
  background: var(--red-100);
}

.modal-body-copy {
  font-size: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

.modal-actions .button {
  flex: 1 1 0;
}

.update-recipient {
  min-width: 0;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 11px;
  background: var(--ink-50);
  border-radius: 14px;
}

.update-recipient > div {
  min-width: 0;
  display: grid;
}

.update-recipient strong,
.update-recipient span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.update-recipient strong {
  font-size: 12px;
}

.update-recipient > div span {
  color: var(--ink-500);
  font-size: 10px;
}

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

.contact-option {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.contact-option:hover {
  background: var(--ink-50);
  border-color: var(--ink-300);
}

.contact-option > .icon:first-child {
  width: 38px;
  height: 38px;
  padding: 9px;
  color: var(--tea-800);
  background: var(--tea-100);
  border-radius: 12px;
}

.contact-option > div {
  min-width: 0;
  display: grid;
}

.contact-option strong {
  font-size: 12px;
}

.contact-option span {
  overflow: hidden;
  color: var(--ink-500);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#toast-root {
  position: fixed;
  right: 12px;
  bottom: calc(var(--mobile-nav-height) + 14px + env(safe-area-inset-bottom));
  left: 12px;
  z-index: 150;
  pointer-events: none;
}

.toast {
  max-width: 470px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 auto;
  padding: 13px 14px;
  color: #fff;
  background: var(--ink-950);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  font-size: 12px;
  font-weight: 650;
  animation: toastIn .24s var(--ease);
}

.toast-pending {
  background: var(--tea-800);
}

#sync-status-root {
  position: fixed;
  top: calc(max(10px, env(safe-area-inset-top)) + 62px);
  right: 12px;
  left: 12px;
  z-index: 145;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.sync-status {
  max-width: min(520px, 100%);
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px 9px 12px;
  color: var(--tea-900);
  background: rgba(245, 241, 231, .97);
  border: 1px solid var(--tea-200);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  font-size: 12px;
  font-weight: 700;
  pointer-events: auto;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.sync-status-error,
.sync-status-offline {
  color: var(--red-700);
  background: color-mix(in srgb, var(--red-100) 94%, white);
  border-color: color-mix(in srgb, var(--red-700) 22%, transparent);
}

.sync-status button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  color: white;
  background: var(--red-700);
  font: inherit;
  cursor: pointer;
}

@media (min-width: 900px) {
  #sync-status-root {
    top: auto;
    bottom: 22px;
    left: var(--sidebar-width);
  }
}

@media (max-width: 680px) {
  .app-shell,
  .app-column {
    min-height: 100dvh;
  }

  .topbar-mobile-brand > a,
  .topbar-actions .button,
  .icon-button {
    min-width: 44px;
    min-height: 44px;
  }

  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  select {
    min-height: 44px;
  }

  .modal-card {
    max-height: calc(100dvh - max(20px, env(safe-area-inset-top)) - max(20px, env(safe-area-inset-bottom)));
  }
}

.toast-error {
  background: var(--red-700);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes toastIn {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (min-width: 720px) {
  .app-main {
    padding: 28px 24px calc(var(--mobile-nav-height) + 34px);
  }

  .page-intro {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .page-actions .button {
    flex: 0 0 auto;
  }

  .summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
  }

  .summary-card {
    min-height: 184px;
    padding: 18px;
  }

  .production-board {
    grid-auto-columns: 292px;
    padding-inline: 24px;
    scroll-padding-inline: 24px;
  }

  .board-shell {
    margin-inline: -24px;
  }

  .board-scroll-hint {
    margin-left: 24px;
  }

  .modal-backdrop {
    align-items: center;
    justify-items: center;
    padding: 24px;
  }

  .modal-card {
    max-width: 520px;
    padding: 28px;
  }

  .modal-card-wide {
    max-width: 620px;
  }

  .modal-actions .button {
    flex: 0 0 auto;
  }

  #toast-root {
    right: 24px;
    bottom: 24px;
    left: auto;
  }

  .toast {
    min-width: 320px;
  }
}

@media (min-width: 1080px) {
  .app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 60;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 22px 16px 18px;
    background: #f4f0e9;
    border-right: 1px solid var(--line);
  }

  .sidebar-top {
    min-height: 0;
  }

  .sidebar-brand {
    display: block;
    padding: 0 8px 20px;
  }

  .workspace-switcher {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 16px;
    align-items: center;
    gap: 9px;
    padding: 9px;
    background: rgba(255,255,255,.68);
    border: 1px solid var(--line);
    border-radius: 14px;
  }

  .workspace-avatar {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--tea-800);
    border-radius: 11px;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
  }

  .workspace-switcher > div {
    min-width: 0;
    display: grid;
  }

  .workspace-switcher strong,
  .workspace-switcher span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .workspace-switcher strong {
    font-size: 11px;
  }

  .workspace-switcher span {
    color: var(--ink-500);
    font-size: 9px;
  }

  .sidebar-nav {
    display: grid;
    gap: 4px;
    margin-top: 22px;
  }

  .sidebar-link {
    min-height: 44px;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    color: var(--ink-600);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 650;
  }

  .sidebar-link:hover {
    color: var(--ink-900);
    background: rgba(255,255,255,.55);
  }

  .sidebar-link.is-active {
    color: var(--tea-900);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
  }

  .sidebar-link.is-active .icon {
    color: var(--tea-700);
  }

  .nav-badge {
    padding: 4px 6px;
    color: var(--clay-800);
    background: var(--clay-100);
    border-radius: var(--radius-pill);
    font-size: 8px;
    font-weight: 780;
    text-transform: uppercase;
  }

  .prototype-note {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 9px;
    padding: 12px;
    color: var(--ink-600);
    background: rgba(255,255,255,.56);
    border: 1px solid var(--line);
    border-radius: 14px;
  }

  .prototype-note > .icon {
    padding: 5px;
    color: var(--gold-700);
    background: var(--gold-100);
    border-radius: 9px;
  }

  .prototype-note > div {
    display: grid;
  }

  .prototype-note strong {
    color: var(--ink-700);
    font-size: 10px;
  }

  .prototype-note span {
    margin-top: 2px;
    color: var(--ink-500);
    font-size: 9px;
    line-height: 1.4;
  }

  .topbar {
    min-height: var(--topbar-height);
    padding: 0 34px;
  }

  .topbar-mobile-brand {
    display: none;
  }

  .topbar-desktop-title {
    display: grid;
  }

  .topbar-desktop-title span {
    color: var(--ink-500);
    font-size: 9px;
    font-weight: 760;
    letter-spacing: .1em;
    text-transform: uppercase;
  }

  .topbar-desktop-title h1 {
    margin-top: 3px;
    color: var(--ink-900);
    font-size: 20px;
  }

  .topbar-actions .button {
    min-height: 40px;
    padding-inline: 13px;
  }

  .topbar-actions .button span {
    display: inline;
  }

  .app-main {
    padding: 34px 34px 52px;
  }

  .mobile-bottom-nav {
    display: none;
  }

  .screen {
    gap: 26px;
  }

  .page-intro h2 {
    font-size: 40px;
  }

  .summary-card {
    min-height: 192px;
    padding: 20px;
  }

  .summary-value {
    font-size: 34px;
  }

  .summary-label {
    font-size: 13px;
  }

  .summary-card p,
  .summary-link {
    font-size: 11px;
  }

  .board-shell {
    margin: 0;
  }

  .board-scroll-hint {
    display: none;
  }

  .production-board {
    grid-auto-columns: 300px;
    padding: 18px 2px 8px;
  }

  #toast-root {
    bottom: 24px;
  }
}

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