:root {
  --ink: #101010;
  --charcoal: #1c1f21;
  --paper: #f6f3ee;
  --panel: #ffffff;
  --line: #d7d0c4;
  --muted: #6e6961;
  --steel: #52707b;
  --clay: #a94f3c;
  --brass: #b28a4b;
  --ok: #2d7658;
  --shadow: 0 18px 44px rgba(16, 16, 16, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button {
  border: 0;
  cursor: pointer;
}

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

.loading-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  font-size: 1rem;
  font-weight: 700;
}

.inline.toast {
  position: sticky;
  top: 12px;
  z-index: 8;
  display: block;
  width: min(720px, 100%);
  margin: 0 auto 16px;
  max-width: 720px;
  text-align: center;
}

.small-muted {
  color: var(--muted);
  font-size: 0.78rem;
}

.draft-file {
  margin: -4px 0 4px;
}

.compact {
  min-height: 34px;
  padding: 8px 10px;
  font-size: 0.78rem;
}

.full {
  width: 100%;
  justify-content: center;
  margin-top: 12px;
}

.build-bar {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 243, 238, 0.96);
}

.build-bar strong,
.build-bar span {
  display: block;
}

.build-picker {
  display: grid;
  gap: 9px;
}

.build-picker-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.centered-panel {
  text-align: center;
}

.danger-zone {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.invite-result {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  padding: 14px;
  background: #f7fbf8;
  border: 1px solid rgba(45, 118, 88, 0.24);
  border-left: 4px solid var(--ok);
  border-radius: 8px;
}

.invite-result.warn {
  background: #fff8ed;
  border-color: rgba(178, 138, 75, 0.3);
  border-left-color: var(--brass);
}

.invite-result span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.invite-result strong {
  font-weight: 900;
}

.invite-result p {
  margin: 0;
  color: var(--muted);
}

.invite-result code {
  width: fit-content;
  max-width: 100%;
  padding: 8px 10px;
  overflow-x: auto;
  background: var(--ink);
  color: #fff;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 900;
}

.client-login-tools {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.client-login-tools p {
  margin: 0;
}

.today-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 22px;
  align-items: center;
  margin-bottom: 18px;
}

.today-summary {
  display: grid;
  align-content: center;
  gap: 10px;
  min-width: 0;
}

.today-summary h1 {
  margin: 0;
  font-size: 3.1rem;
  line-height: 0.98;
}

.today-client {
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
  font-weight: 800;
}

.delivery-card {
  width: fit-content;
  min-width: min(310px, 100%);
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brass);
  border-radius: 8px;
}

.delivery-card span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.delivery-card strong {
  font-size: 1.04rem;
  font-weight: 900;
}

.hero-photo,
.item-photo,
.doc-photo {
  width: 100%;
  object-fit: cover;
  cursor: zoom-in;
  background: #ddd6ca;
}

.hero-photo {
  aspect-ratio: 16 / 10;
  border-radius: 8px;
}

.item-photo {
  aspect-ratio: 4 / 3;
  border-radius: 8px 0 0 8px;
}

.feed {
  display: grid;
  gap: 14px;
}

.vision-photo-feed {
  margin-top: 12px;
}

.today-open-decisions {
  display: grid;
  gap: 16px;
}

.today-open-decisions .item-card {
  align-items: stretch;
}

.today-open-decisions .item-photo {
  height: 100%;
  min-height: 100%;
  aspect-ratio: auto;
  object-fit: contain;
  background: #f6f3ee;
}

.vision-notes-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

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

.vision-section-header {
  display: grid;
  gap: 5px;
}

.vision-section-header h2,
.vision-section-header p {
  margin: 0;
}

.add-vision-form {
  margin-top: 8px;
}

.vision-note-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.vision-note-form input {
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.vision-note-form .primary {
  min-width: 82px;
  justify-content: center;
}

.vision-checklist {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.vision-checklist li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  column-gap: 12px;
  row-gap: 8px;
  align-items: start;
  min-height: 42px;
  padding: 12px;
  background: #fbfaf7;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.vision-row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.vision-row-actions.client-actions {
  grid-column: 3;
  grid-row: 1;
  align-self: start;
}

.vision-row-actions.staff-actions {
  grid-column: 2 / -1;
  justify-content: flex-start;
}

.vision-row-actions .compact {
  min-height: 42px;
  padding: 10px 14px;
}

.vision-note-text {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 42px;
}

.vision-inline-edit {
  grid-column: 2 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.vision-inline-edit input {
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.vision-owner-response {
  grid-column: 2 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.vision-response-form {
  grid-column: 2 / -1;
  display: grid;
  gap: 8px;
  align-items: start;
}

.vision-response-form input {
  min-width: 0;
  min-height: 42px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.vision-response-form .staff-actions {
  grid-column: 1;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 1px;
}

.doc-note-response {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.check-box {
  width: 16px;
  height: 16px;
  margin-top: 13px;
  background: #fff;
  border: 2px solid var(--brass);
  border-radius: 4px;
}

.doc-note-list ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.doc-section-block {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.doc-section-block h3 {
  margin: 0 0 18px;
  text-transform: uppercase;
}

.doc-entry-list {
  display: grid;
  gap: 18px;
}

.doc-entry {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  break-inside: avoid;
}

.doc-entry:first-child {
  border-top: 0;
  padding-top: 0;
}

.doc-entry > div {
  min-width: 0;
}

.doc-entry p {
  margin: 8px 0 0;
  line-height: 1.55;
}

.doc-note-list {
  display: block;
  padding: 16px 18px;
  background: #fbfaf7;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.doc-note-list.doc-entry {
  display: block;
  border-top: 0;
}

.doc-note-list ul {
  margin-top: 12px;
}

.doc-note-list li {
  margin-bottom: 10px;
  line-height: 1.55;
}

.doc-note-list li:last-child {
  margin-bottom: 0;
}

.item-card {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.item-body {
  padding: 16px;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.comment-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.compact-form {
  margin-top: 12px;
}

.entry-comment-form {
  gap: 10px;
  margin-top: 10px;
}

.entry-comment-form textarea {
  min-height: 86px;
}

.entry-comment-form .secondary {
  justify-self: flex-start;
}

.decision-button-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
}

.decision-button-row .secondary,
.decision-button-row .icon-delete {
  flex: 0 0 auto;
  height: 42px;
  min-height: 42px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.86);
}

.lightbox img {
  max-width: min(1100px, 94vw);
  max-height: 86vh;
  border-radius: 8px;
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
}

@media (max-width: 760px) {
  .two-col,
  .today-hero,
  .item-card {
    grid-template-columns: 1fr;
  }

  .item-photo {
    border-radius: 8px 8px 0 0;
  }

  .today-open-decisions .item-photo {
    height: auto;
    min-height: 0;
    aspect-ratio: 4 / 3;
    object-fit: cover;
  }

  .vision-note-form {
    grid-template-columns: 1fr;
  }

  .vision-inline-edit {
    grid-template-columns: 1fr;
  }

  .vision-response-form {
    grid-template-columns: 1fr;
  }

  .vision-row-actions.client-actions,
  .vision-row-actions.staff-actions {
    grid-column: 2 / -1;
    grid-row: auto;
    justify-content: flex-start;
  }
}

.app-header .home-button {
  position: static;
  transform: none;
  right: auto;
  top: auto;
}

.badge.warn {
  background: #fff3d7;
  color: #755015;
}

.doc-photo {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
}

.admin-start {
  width: min(680px, 100%);
  margin: 0 auto;
}

.admin-start .panel {
  padding: clamp(24px, 4vw, 36px);
}

.admin-start .form {
  gap: 15px;
}

.admin-start input,
.admin-start textarea,
.admin-start select,
.admin-home input,
.admin-home textarea,
.admin-home select {
  width: 100%;
  min-height: 46px;
}

.admin-start .primary,
.admin-home .primary {
  min-height: 48px;
  justify-content: center;
}

.admin-home {
  align-items: start;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
  gap: 28px;
  max-width: 1120px;
  margin: 0 auto;
}

.admin-home .panel {
  padding: 28px;
}

.admin-home .form {
  gap: 15px;
}

.admin-home .panel h2 + .form {
  margin-top: 4px;
}

.admin-home input,
.admin-home textarea,
.admin-home select {
  min-height: 48px;
}

.admin-home .client-login-tools,
.admin-home .invite-result,
.admin-home .danger-zone {
  margin-top: 18px;
}

.login-shell {
  grid-template-columns: minmax(0, 1fr) minmax(380px, 480px);
}

.login-shell .login-card {
  align-self: center;
  justify-self: center;
  width: min(420px, calc(100% - 48px));
  min-height: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  padding: 28px;
  border-radius: 8px;
  text-align: left;
}

.login-shell .login-card h2 {
  margin: 0;
  font-size: 1.45rem;
}

.login-shell .login-card p {
  margin: -8px 0 0;
  line-height: 1.45;
}

.login-notice {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #dfb7ab;
  background: #fff7f3;
  color: #7d3022;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
}

.login-shell .form {
  gap: 12px;
}

.login-shell .primary {
  min-height: 48px;
  justify-content: center;
}

@media (max-width: 920px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-hero {
    min-height: 54vh;
    padding: 32px 22px 58px;
  }

  .login-shell .login-card {
    width: min(520px, calc(100% - 32px));
    margin: -34px auto 32px;
  }
}

@media (max-width: 760px) {
  .admin-home {
    grid-template-columns: 1fr;
    max-width: 560px;
  }
}

@media (max-width: 520px) {
  .login-shell .login-card,
  .admin-home .panel {
    padding: 20px;
  }
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 0.65fr);
  background: var(--ink);
}

.login-hero {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  padding: 44px;
  text-align: center;
  color: var(--paper);
  background: linear-gradient(rgba(16, 16, 16, 0.42), rgba(16, 16, 16, 0.72)), url("assets/stock-branding.png") center / cover;
}

.login-hero h1 {
  margin: 0;
  font-size: clamp(32px, 6vw, 74px);
  text-transform: uppercase;
}

.login-hero p {
  margin: 0;
  max-width: 560px;
  color: #f8efe2;
  font-size: 1.1rem;
}

.home-logo {
  width: min(360px, 70vw);
  margin: 0 auto;
}

.login-hero .home-logo {
  transform: translateX(clamp(9px, 1vw, 14px));
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 74px;
  display: grid;
  grid-template-columns: minmax(64px, 1fr) auto minmax(64px, 1fr);
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  background: var(--ink);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.header-logo {
  width: min(260px, 42vw);
  justify-self: center;
}

.header-spacer {
  width: 56px;
  min-height: 1px;
}

.account-bar {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  justify-self: end;
  gap: 12px;
  width: min(520px, 100%);
  padding: 8px 8px 8px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  box-shadow: none;
}

.account-bar .compact {
  flex: 0 0 auto;
}

.account-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.account-bar > div:not(.account-actions) {
  flex: 1 1 auto;
  min-width: 0;
}

.account-bar span,
.account-bar strong {
  display: block;
}

.account-bar span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.account-bar strong {
  color: #fff;
  max-width: 100%;
  overflow-wrap: normal;
  font-size: 0.98rem;
  font-weight: 850;
  line-height: 1.15;
  white-space: nowrap;
  word-break: normal;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(16, 16, 16, 0.58);
}

.account-panel {
  position: relative;
  width: min(430px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.account-panel h2,
.account-panel p {
  margin: 0;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
}

@media (max-width: 760px) {
  .app-header {
    grid-template-columns: 48px 1fr 48px;
    row-gap: 10px;
  }

  .account-bar {
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
  }

  .account-bar .compact {
    width: auto;
  }

  .account-actions {
    gap: 6px;
  }

  .today-summary h1 {
    font-size: 2.25rem;
  }

  .delivery-card {
    width: 100%;
  }
}

.content-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 102px;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  display: grid;
  grid-template-columns: repeat(var(--nav-count, 5), minmax(0, 1fr));
  background: var(--ink);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.bottom-nav button {
  min-height: 70px;
  min-width: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  color: #cfc6b9;
  background: transparent;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.bottom-nav button:first-child {
  border-left: 0;
}

.bottom-nav button.active {
  color: var(--ink);
  background: #fff;
}

.bottom-nav svg,
.home-button svg,
.icon-delete svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-stage {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px;
  overflow: hidden;
}

.brand-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(16, 16, 16, 0.24), rgba(16, 16, 16, 0.74)),
    url("assets/stock-branding.png") center / cover no-repeat;
  transform: scale(1.02);
}

.brand-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 100% 12px;
  mix-blend-mode: soft-light;
  opacity: 0.4;
}

.brand-lockup {
  position: relative;
  z-index: 1;
  color: #fff;
  max-width: 720px;
  width: 100%;
  margin-inline: auto;
  text-align: center;
}

.logo-mark {
  display: block;
  width: 100%;
  max-width: 232px;
  height: auto;
  margin-inline: auto;
  object-fit: contain;
}

.logo-large {
  max-width: 320px;
}

.logo-header {
  max-width: 250px;
  max-height: 130px;
  margin: 0 auto;
}

.logo-dark {
  max-width: 220px;
}

.brand-lockup h1,
.page-title h1 {
  margin: 20px auto 10px;
  max-width: 100%;
  font-size: clamp(42px, 7vw, 88px);
  line-height: 0.92;
  letter-spacing: 0;
  text-transform: uppercase;
  text-wrap: balance;
}

.brand-lockup p,
.page-title p {
  margin: 0 auto;
  max-width: 520px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 16px;
  line-height: 1.55;
  text-align: center;
}

.login-panel {
  min-height: 100vh;
  background: var(--paper);
  padding: 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-panel h2 {
  margin: 0 0 6px;
  font-size: 22px;
  text-transform: uppercase;
}

.login-panel > p {
  margin: 0 0 22px;
  color: var(--muted);
}

.login-grid {
  display: grid;
  gap: 12px;
}

.login-card {
  min-height: 78px;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 6px 18px rgba(16, 16, 16, 0.05);
}

.login-card strong {
  display: block;
  font-size: 16px;
}

.login-card span {
  color: var(--muted);
  font-size: 13px;
}

.login-card:hover,
.login-card:focus-visible,
.primary:hover,
.secondary:hover,
.icon-button:hover,
.tab-button:hover {
  outline: 2px solid var(--steel);
  outline-offset: 2px;
}

.portal {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  padding-bottom: 82px;
}

.sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  padding: 24px;
  background: var(--ink);
  color: #fff;
}

.side-top {
  display: grid;
  gap: 22px;
}

.brand-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 136px;
  padding-inline: 48px;
}

.brand-row .logo-header {
  flex: 0 1 auto;
  align-self: center;
}

.account-block {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding-top: 18px;
}

.account-block strong {
  display: block;
  margin-bottom: 4px;
}

.account-block span {
  color: rgba(255, 255, 255, 0.64);
  font-size: 13px;
}

.build-menu {
  position: relative;
  width: 100%;
  margin-top: 0;
}

.build-menu-button {
  width: 100%;
  min-height: 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 11px 14px;
  text-align: left;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 850;
  list-style: none;
}

.build-menu-button::-webkit-details-marker {
  display: none;
}

.build-menu-button span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.build-menu-button span:last-child {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.build-menu-list {
  display: none;
  position: absolute;
  z-index: 25;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 260px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.build-menu[open] .build-menu-list,
.build-menu.open .build-menu-list {
  display: grid;
}

.build-menu-item {
  min-height: 54px;
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  background: #fff;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.build-menu-item strong,
.build-menu-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.build-menu-item strong {
  font-size: 1rem;
}

.build-menu-item span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.build-menu-item:last-child {
  border-bottom: 0;
}

.build-menu-item.active,
.build-menu-item:hover,
.build-menu-item:focus-visible {
  background: var(--ink);
  color: #fff;
}

.build-menu-item.active span,
.build-menu-item:hover span,
.build-menu-item:focus-visible span {
  color: rgba(255, 255, 255, 0.7);
}

.tabs {
  display: grid;
  gap: 0;
}

.tab-button {
  width: 100%;
  min-height: 58px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  padding: 8px 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.66);
  text-align: center;
}

.bottom-tabs {
  position: fixed;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: 0;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  min-height: 72px;
  padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
  background: var(--ink);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 -14px 32px rgba(16, 16, 16, 0.18);
}

.bottom-tabs .tab-button {
  min-width: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.bottom-tabs .tab-button:first-child {
  border-left: 0;
}

.tab-button.active {
  background: #fff;
  color: var(--ink);
}

.tab-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.tab-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  color: currentColor;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-transform: uppercase;
}

.main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.topbar-left {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.home-button {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  display: inline-grid;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.62);
  color: #fff;
}

.home-button.active {
  background: #fff;
  color: var(--ink);
  border-color: #fff;
}

.home-button .tab-svg {
  width: 18px;
  height: 18px;
}

.page-title h1 {
  color: var(--ink);
  font-size: clamp(30px, 4vw, 52px);
}

.page-title p {
  color: var(--muted);
}

.actions {
  position: relative;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.inbox-menu {
  position: relative;
}

.inbox-button {
  white-space: nowrap;
}

.count-pill {
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  background: var(--clay);
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

.inbox-list {
  position: absolute;
  z-index: 35;
  display: none;
  right: 0;
  top: calc(100% + 8px);
  width: min(390px, calc(100vw - 56px));
  max-height: min(460px, calc(100vh - 160px));
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.inbox-menu.open .inbox-list {
  display: grid;
}

.inbox-item {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.inbox-item.has-photo {
  grid-template-columns: minmax(0, 1fr) 72px;
  align-items: start;
}

.inbox-item-main {
  display: grid;
  gap: 5px;
  width: 100%;
  min-width: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  border: 0;
  text-align: left;
}

.inbox-item:hover,
.inbox-item:focus-within {
  background: var(--paper);
}

.inbox-item-main strong,
.inbox-item-main span,
.inbox-item-main small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inbox-item-main span {
  white-space: nowrap;
}

.inbox-media {
  width: 72px;
}

.inbox-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  background: #e4dfd6;
  border: 1px solid var(--line);
}

.inbox-type {
  color: var(--clay);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.inbox-client {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.inbox-empty {
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
}

.focus-pulse {
  outline: 3px solid var(--brass);
  outline-offset: 3px;
}

.primary,
.secondary,
.danger,
.danger-outline,
.file-label {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 0;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.primary {
  background: var(--ink);
  color: #fff;
}

.secondary,
.file-label {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
}

.danger {
  background: #5b1f18;
  color: #fff;
}

.danger-outline {
  background: #fff;
  color: #5b1f18;
  border: 1px solid rgba(91, 31, 24, 0.35);
}

.item-actions {
  justify-content: flex-start;
  align-items: center;
}

.icon-delete {
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  display: inline-grid;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: #fff;
  color: #7d3022;
  border: 1px solid #dfb7ab;
}

.icon-delete .tab-svg {
  width: 17px;
  height: 17px;
}

.icon-delete:hover,
.icon-delete:focus-visible {
  outline: 2px solid #7d3022;
  outline-offset: 2px;
}

.section {
  margin-top: 18px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.panel,
.item,
.doc-page {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 7px 20px rgba(16, 16, 16, 0.05);
}

.panel {
  padding: 18px;
}

.span-4 {
  grid-column: span 4;
}

.span-5 {
  grid-column: span 5;
}

.span-7 {
  grid-column: span 7;
}

.span-8 {
  grid-column: span 8;
}

.span-12 {
  grid-column: span 12;
}

.hero-photo {
  min-height: 360px;
  object-fit: cover;
  width: 100%;
  height: 100%;
  border: 1px solid var(--line);
}

.metric {
  display: grid;
  gap: 6px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.metric:last-child {
  border-bottom: 0;
}

.eyebrow,
label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.metric strong {
  font-size: 22px;
}

.form {
  display: grid;
  gap: 13px;
}

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

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  border-radius: 0;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.file-input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.stack {
  display: grid;
  gap: 14px;
}

.item {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.item.with-photo {
  grid-template-columns: minmax(130px, 180px) minmax(0, 1fr);
}

.thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #e4dfd6;
  border: 1px solid var(--line);
}

.image-preview-trigger {
  display: block;
  width: 100%;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.image-preview-trigger:hover,
.image-preview-trigger:focus-visible {
  outline: 3px solid var(--brass);
  outline-offset: 3px;
}

.image-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
}

.image-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 16, 16, 0.82);
}

.image-modal-panel {
  position: relative;
  z-index: 1;
  width: min(1080px, 100%);
  max-height: calc(100vh - 56px);
  display: grid;
  gap: 10px;
}

.image-modal-panel img {
  max-width: 100%;
  max-height: calc(100vh - 118px);
  margin: 0 auto;
  object-fit: contain;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: var(--shadow);
}

.image-modal-close {
  justify-self: end;
  min-height: 38px;
  padding: 8px 12px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.item h3,
.panel h2 {
  margin: 0;
}

.item h3 {
  font-size: 18px;
}

.panel h2 {
  font-size: 20px;
  text-transform: uppercase;
}

.body-text,
.empty,
.meta {
  color: var(--muted);
  line-height: 1.5;
}

.meta {
  font-size: 13px;
}

.badge-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  background: #eee7dc;
  border: 1px solid var(--line);
  color: var(--charcoal);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.badge.open {
  background: #f6e7e1;
  border-color: #dfb7ab;
  color: #7d3022;
}

.badge.done {
  background: #e1eee8;
  border-color: #afcec0;
  color: var(--ok);
}

.badge.seen-badge {
  background: #eef8f1;
  border-color: #c7e7d0;
  color: #2f6f46;
}

.comment-log {
  padding: 10px;
  background: #f6f3ee;
  border: 1px solid var(--line);
}

.comment-log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.comment-log .actions {
  margin-top: 10px;
}

.doc-page {
  width: min(100%, 980px);
  min-height: 1100px;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 30px;
}

.doc-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  align-items: start;
  gap: 18px;
  border-bottom: 3px solid var(--ink);
  padding-bottom: 18px;
  margin-bottom: 20px;
  min-height: 154px;
}

.doc-brand-block,
.doc-build-meta {
  min-width: 0;
}

.doc-build-meta {
  text-align: right;
}

.doc-build-meta p {
  margin: 0 0 8px;
}

.doc-logo {
  display: block;
  width: 220px;
  max-width: 220px;
  height: auto;
  object-fit: contain;
  margin-bottom: 14px;
}

.doc-section {
  break-inside: avoid;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.doc-section h3 {
  margin: 0 0 12px;
  text-transform: uppercase;
}

.doc-comments {
  margin-top: 12px;
  padding: 10px 12px;
  background: #f6f3ee;
  border: 1px solid var(--line);
}

.doc-comments p {
  margin: 0 0 8px;
}

.doc-comments p:last-child {
  margin-bottom: 0;
}

.doc-image {
  width: 220px;
  height: 165px;
  object-fit: cover;
  border: 1px solid var(--line);
  margin-bottom: 10px;
}

.image-preview-trigger .doc-image {
  margin-bottom: 10px;
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  min-width: min(320px, calc(100vw - 40px));
  padding: 14px 18px;
  background: var(--ink);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

@media (max-width: 920px) {
  .login-shell,
  .portal {
    grid-template-columns: 1fr;
  }

  .brand-stage,
  .login-panel,
  .sidebar {
    min-height: auto;
  }

  .brand-stage {
    min-height: 360px;
    padding: 28px;
  }

  .brand-lockup {
    max-width: 620px;
  }

  .sidebar {
    position: static;
  }

  .bottom-tabs {
    min-height: 76px;
    padding-inline: 8px;
  }

  .span-4,
  .span-5,
  .span-7,
  .span-8,
  .span-12 {
    grid-column: span 12;
  }
}

@media (max-width: 620px) {
  .bottom-nav button {
    font-size: 0.58rem;
    letter-spacing: 0.04em;
  }

  .bottom-nav svg {
    width: 20px;
    height: 20px;
  }

  .portal {
    padding-bottom: 92px;
  }

  .main,
  .login-panel {
    padding: 20px;
  }

  .brand-stage {
    min-height: 340px;
    padding: 24px 18px;
  }

  .logo-large {
    max-width: min(260px, 82vw);
  }

  .brand-lockup h1 {
    font-size: clamp(36px, 12vw, 54px);
    line-height: 0.96;
  }

  .brand-lockup p {
    max-width: min(340px, 92vw);
    font-size: 15px;
  }

  .topbar {
    display: grid;
  }

  .doc-header {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .doc-build-meta {
    text-align: left;
  }

  .doc-entry {
    grid-template-columns: 1fr;
  }

  .doc-photo {
    max-width: 100%;
  }

  .topbar-left {
    display: grid;
  }

  .actions {
    justify-content: flex-start;
  }

  .inbox-menu {
    position: static;
  }

  .inbox-list {
    position: fixed;
    left: 18px;
    right: 18px;
    top: 138px;
    width: auto;
    max-height: min(520px, calc(100vh - 220px));
  }

  .item.with-photo {
    grid-template-columns: 1fr;
  }

  .bottom-tabs {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: 76px;
  }

  .tab-button {
    min-height: 54px;
    padding-inline: 4px;
  }

  .bottom-tabs .tab-label {
    font-size: 9px;
    letter-spacing: 0.04em;
  }
}

@media print {
  body {
    background: #fff;
  }

  .sidebar,
  .bottom-tabs,
  .topbar,
  .non-print {
    display: none !important;
  }

  .portal,
  .main {
    display: block;
    padding: 0;
  }

  .doc-page {
    border: 0;
    box-shadow: none;
    max-width: none;
  }
}

.app-header .home-button {
  position: static;
  transform: none;
  right: auto;
  top: auto;
}

.badge.warn {
  background: #fff3d7;
  color: #755015;
}

.doc-photo {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
}

@media (max-width: 760px) {
  .doc-photo {
    max-width: 100%;
  }
}
