:root {
  --z-navigation: 10;
  --z-floating: 20;
  color-scheme: light;
  --bg: oklch(1 0 0);
  --surface: oklch(0.972 0.003 355);
  --ink: oklch(0.22 0.01 355);
  --muted: oklch(0.46 0.012 355);
  --primary: oklch(0.43 0.15 355);
  --primary-hover: oklch(0.36 0.14 355);
  --accent: oklch(0.94 0.014 250);
  --line: oklch(0.87 0.008 355);
  --danger: oklch(0.46 0.18 25);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

/* Account creation follows the same field-first controls as project entry. */
.user-row { flex-wrap: wrap; }
.list-row.user-row:hover { background: transparent; }
.user-row h2 { font-size: 1rem; margin: 0; overflow-wrap: anywhere; }
.user-row .row-content { min-width: 0; }
.user-row .row-content > span { overflow-wrap: anywhere; }
.user-row p { margin: 6px 0 0; font-size: 0.875rem; color: var(--muted); }
.user-state { font-size: 0.875rem; color: var(--muted); }
.user-form { max-width: 560px; }
.user-form .field-hint { margin: -8px 0 0; }
.user-form-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.user-form-actions .primary { flex: 1; }
.user-notice { padding: 20px; background: var(--surface); margin-bottom: 24px; }
.user-notice p { max-width: 65ch; line-height: 1.6; }
@media (max-width: 500px) {
  .user-state { flex-basis: 100%; padding-left: 62px; }
}

/* Commercial presentation: familiar document hierarchy, exact tabular values. */
.demo-customer-filter {
  max-width: 350px;
  margin: 24px 0;
}
.overview-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin: 32px 0 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}
.overview-totals dt {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 10px;
}
.overview-totals dd {
  font-size: 1.65rem;
  font-weight: 650;
  margin: 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
}
.overview-totals > div:last-child dd {
  color: var(--primary);
}
.demo-project-row {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.demo-project-row:hover {
  text-decoration: none;
}
.demo-project-row:hover h2 {
  text-decoration: underline;
}
.demo-project-row h2 {
  font-size: 1.2rem;
  margin: 8px 0 12px;
}
.demo-project-row small {
  color: var(--muted);
}
.demo-project-row p {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 0.875rem;
}
.demo-project-balance {
  text-align: right;
  min-width: 170px;
}
.demo-project-balance strong {
  display: block;
  margin: 6px 0;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 600px) {
  .overview-totals {
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 24px 0;
  }
  .overview-totals > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
  }
  .overview-totals dd {
    font-size: 1.1rem;
  }
  .demo-project-row {
    flex-wrap: wrap;
    gap: 8px;
  }
  .demo-project-balance {
    text-align: left;
  }
}
.demo-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: baseline;
  padding: 16px 20px;
  background: oklch(0.97 0.025 85);
  border-left: 3px solid oklch(0.61 0.09 75);
  border-radius: 0 8px 8px 0;
  margin-bottom: 24px;
  font-size: 0.9rem;
}
.demo-banner > strong {
  color: oklch(0.38 0.06 65);
}
.demo-banner > details {
  flex-basis: 100%;
}
.demo-banner summary {
  cursor: pointer;
  padding: 10px 0 4px;
  min-height: 44px;
}
.demo-banner p {
  margin: 8px 0;
  max-width: 78ch;
  line-height: 1.6;
}
.commercial-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}
.commercial-steps a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  padding: 14px 10px;
  min-height: 72px;
}
.commercial-steps a[aria-current] {
  color: var(--primary);
  box-shadow: inset 0 -3px var(--primary);
}
.commercial-steps small {
  display: block;
  font-size: 0.75rem;
  margin-top: 4px;
}
.step-number {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 0.875rem;
}
.commercial-steps [aria-current] .step-number {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.commercial-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 32px;
  align-items: start;
}
.commercial-main {
  min-width: 0;
}
.commercial-overview {
  border-left: 1px solid var(--line);
  padding-left: 24px;
  font-size: 0.875rem;
}
.commercial-overview h3 {
  margin: 16px 0 8px;
  font-size: 1rem;
}
.commercial-overview .outstanding-value {
  font-size: 1.65rem;
  color: var(--primary);
  font-weight: 650;
  letter-spacing: -0.04em;
  margin: 0 0 24px;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.commercial-overview .money-summary > div {
  display: block;
  padding: 8px 0;
}
.commercial-overview dd {
  margin: 4px 0 0;
}
.commercial-overview hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}
.workspace-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.workspace-heading h2 {
  font-size: 1.5rem;
  margin: 6px 0 8px;
  letter-spacing: -0.025em;
}
.workspace-heading p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}
.demo-status {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 650;
  border-radius: 6px;
  white-space: nowrap;
  line-height: 1.4;
}
.status-approved,
.status-won,
.status-paid {
  color: oklch(0.34 0.065 160);
  background: oklch(0.96 0.023 160);
  border-color: oklch(0.86 0.038 160);
}
.status-review,
.status-partially_paid {
  color: oklch(0.4 0.08 70);
  background: oklch(0.96 0.025 85);
  border-color: oklch(0.86 0.05 85);
}
.status-cancelled,
.status-rejected,
.status-lost {
  color: var(--danger);
}
.money-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.875rem;
}
.money-table th {
  text-align: left;
  font-weight: 550;
  color: var(--muted);
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.money-table td {
  padding: 16px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.money-table td:first-child {
  min-width: 170px;
}
.money-table td:not(:first-child),
.money-table th:not(:first-child) {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.money-table small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}
.table-scroll {
  max-width: 100%;
  overflow: auto;
}
.money-summary {
  margin: 20px 0;
  font-variant-numeric: tabular-nums;
}
.money-summary > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 9px 0;
}
.money-summary dt {
  color: var(--muted);
}
.money-summary dd {
  margin: 0;
  font-weight: 600;
  white-space: nowrap;
}
.commercial-main > .money-summary > div:last-child {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 16px;
}
.editor-section {
  padding: 8px 0;
  margin: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.editor-section > summary {
  cursor: pointer;
  min-height: 48px;
  padding: 12px 0;
  font-weight: 650;
}
.demo-form {
  display: grid;
  gap: 18px;
  padding: 16px 0 24px;
}
.demo-form h3 {
  margin: 0;
}
.demo-form > button {
  justify-self: start;
}
.demo-form .field {
  margin: 0;
}
.line-editor {
  display: grid;
  gap: 20px;
}
.editor-line {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
  border: 1px solid var(--line);
  padding: 16px;
  margin: 0;
  border-radius: 8px;
}
.editor-line legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.875rem;
}
.line-description {
  grid-column: 1/-1;
}
.editor-line input,
.term-row input {
  min-width: 0;
  width: 100%;
}
.remove-line {
  justify-self: start;
  align-self: end;
  padding: 8px 0;
  color: var(--danger);
  background: transparent;
  font-size: 0.875rem;
}
.demo-form .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.form-hint,
.margin-note {
  font-size: 0.875rem;
  line-height: 1.6;
}
.margin-note {
  padding: 14px 0;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}
.next-action {
  padding: 22px 0;
  margin: 24px 0;
  border-top: 1px solid var(--line);
}
.next-action h3 {
  margin: 0;
}
.next-action p {
  color: var(--muted);
  line-height: 1.6;
}
.term-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr;
  gap: 14px;
  border: 0;
  padding: 12px 0;
  min-width: 0;
  border-bottom: 1px solid var(--line);
  margin: 0 0 16px;
}
.term-row legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.term-row .remove-line {
  grid-column: 1/-1;
}
.term-item {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.term-item > div {
  flex: 1;
  min-width: 160px;
}
.term-item h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}
.term-item p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.875rem;
}
.term-item small {
  color: var(--muted);
}
.term-seq {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: var(--surface);
  border-radius: 5px;
  color: var(--primary);
}
.invoice-list {
  margin: 32px 0;
}
.invoice-list > h3 {
  margin-bottom: 24px;
}
.invoice-item,
.receipt-item,
.credit-list article {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}
.invoice-item > header,
.receipt-item > header,
.credit-list header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.invoice-item h4,
.receipt-item h3,
.credit-list h4 {
  margin: 0;
  font-size: 1rem;
  overflow-wrap: anywhere;
}
.invoice-item p,
.receipt-item p,
.credit-list p {
  font-size: 0.875rem;
  line-height: 1.6;
}
.invoice-item header p {
  margin: 8px 0;
  color: var(--muted);
}
.invoice-item .money-summary {
  font-size: 0.875rem;
}
.correction {
  font-size: 0.875rem;
}
.correction > summary {
  min-height: 48px;
  padding: 14px 0;
  cursor: pointer;
  color: var(--primary);
}
.allocation-row {
  border-left: 2px solid var(--line);
  padding-left: 16px;
}
.overdue {
  color: var(--danger);
  font-weight: 600;
}
.history {
  margin-top: 24px;
  font-size: 0.875rem;
}
.history summary {
  cursor: pointer;
  min-height: 48px;
  padding: 14px 0;
}
.history small {
  display: block;
  color: var(--muted);
  margin: 6px 0 14px;
}
.history ol {
  list-style: none;
  padding: 0;
}
.history li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.document-history-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.demo-feedback:empty {
  display: none;
}
.demo-feedback {
  color: var(--primary);
  background: var(--surface);
  padding: 14px 18px;
  margin-bottom: 20px;
  border-radius: 6px;
}
@media (max-width: 1050px) {
  .commercial-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .commercial-overview {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 24px 0;
  }
  .commercial-overview .money-summary > div {
    display: flex;
  }
}
@media (max-width: 600px) {
  .commercial-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .commercial-steps a {
    padding: 12px 4px;
  }
  .commercial-steps small {
    font-size: 0.6875rem;
  }
  .editor-line {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px;
    gap: 12px;
  }
  .term-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .term-row .field:first-of-type {
    grid-column: 1/-1;
  }
  .demo-form .form-grid {
    grid-template-columns: 1fr;
  }
  .workspace-heading {
    flex-wrap: wrap;
  }
  .money-summary {
    font-size: 0.875rem;
  }
  .term-item {
    gap: 12px;
  }
  .term-item > strong {
    margin-left: 44px;
  }
}
@media (max-width: 600px) {
  .commercial-main .money-table,
  .commercial-main .money-table tbody {
    display: block;
  }
  .commercial-main .money-table thead {
    display: none;
  }
  .commercial-main .money-table tr {
    display: block;
    border-bottom: 1px solid var(--line);
    padding: 16px 0;
  }
  .commercial-main .money-table td {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 6px 0;
    border: 0;
    white-space: normal;
    text-align: right;
  }
  .commercial-main .money-table td:first-child {
    display: block;
    text-align: left;
    font-weight: 600;
    padding-bottom: 10px;
    min-width: 0;
  }
  .commercial-main .money-table td:not(:first-child)::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 400;
    text-align: left;
  }
  .commercial-main .money-table small {
    font-weight: 400;
  }
}

/* Project workspaces retain the Foundation tokens and 48px touch targets. */
.project-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  margin: 0 0 28px;
  padding-bottom: 2px;
}
.project-nav a {
  white-space: nowrap;
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 10px 16px;
  color: var(--muted);
  border-radius: 6px 6px 0 0;
}
.project-nav a[aria-current] {
  color: var(--primary);
  background: var(--surface);
  box-shadow: inset 0 -2px var(--primary);
  font-weight: 650;
}
.upload-section {
  background: var(--surface);
  border-radius: 12px;
  padding: 0 20px;
  margin: 24px 0 32px;
}
.upload-section summary,
.delete-confirm summary {
  cursor: pointer;
  min-height: 56px;
  padding: 16px 0;
  font-weight: 650;
  color: var(--primary);
}
.inline-form {
  max-width: 680px;
  display: grid;
  gap: 18px;
  padding: 8px 0 24px;
}
.inline-form button[type='submit'] {
  justify-self: start;
}
.upload-picker {
  display: grid;
  gap: 10px;
}
.camera-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  width: max-content;
  padding: 10px 18px;
  font-weight: 600;
}
.camera-button:focus-within {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}
.selected-file {
  overflow-wrap: anywhere;
  margin: 0;
  font-weight: 600;
}
progress {
  width: 100%;
  height: 10px;
  accent-color: var(--primary);
}
.file-filter {
  max-width: 280px;
  margin-bottom: 24px;
}
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 24px;
  padding-bottom: 32px;
}
.file-tile {
  display: block;
  color: var(--ink);
  min-width: 0;
}
.file-tile:hover {
  text-decoration: none;
}
.file-tile:hover strong {
  text-decoration: underline;
}
.file-preview {
  aspect-ratio: 4/3;
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.file-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.document-mark {
  display: grid;
  place-items: center;
  min-width: 56px;
  height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--bg);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
}
.file-caption {
  padding: 12px 2px;
  display: grid;
  gap: 4px;
}
.file-caption strong {
  overflow-wrap: anywhere;
  font-weight: 600;
}
.file-caption span {
  color: var(--muted);
  font-size: 0.875rem;
}
.file-detail h2 {
  overflow-wrap: anywhere;
}
.file-original {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
  margin: 0 auto;
  background: var(--surface);
}
.full-image-link {
  display: block;
  border-radius: 8px;
  overflow: hidden;
}
.document-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px 20px;
  background: var(--surface);
  border-radius: 10px;
  text-align: center;
  overflow-wrap: anywhere;
}
.document-preview p {
  margin: 0;
  max-width: 100%;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 11px 18px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}
.button.primary {
  color: white;
  background: var(--primary);
}
.notice {
  padding: 16px;
  background: var(--surface);
  border-radius: 8px;
}
.save-feedback {
  color: var(--primary);
}
.delete-confirm {
  border-top: 1px solid var(--line);
  padding: 8px 0 28px;
}
.delete-confirm summary {
  color: var(--danger);
}
.drawing-group {
  margin-bottom: 36px;
}
.drawing-row {
  gap: 16px;
}
.drawing-preview {
  display: grid;
  place-items: center;
  background: var(--surface);
  width: 80px;
  min-width: 80px;
  height: 72px;
  overflow: hidden;
  border-radius: 6px;
}
.drawing-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.drawing-preview .document-mark {
  transform: scale(0.65);
}
.drawing-heading {
  margin-bottom: 24px;
}
.drawing-heading h2 {
  margin: 6px 0 8px;
}
.version-history {
  margin-top: 36px;
}
.version-list {
  list-style: none;
  padding: 0;
}
.version-list a {
  display: flex;
  gap: 20px;
  padding: 18px 0;
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  min-height: 64px;
}
.version-list a > strong {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--surface);
  border-radius: 6px;
  color: var(--primary);
}
.version-list a > span:nth-child(2) {
  flex: 1;
}
.version-list small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}
@media (max-width: 500px) {
  .file-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .file-caption strong {
    font-size: 0.9rem;
  }
  .upload-section {
    padding: 0 14px;
  }
  .project-nav a {
    padding: 10px 12px;
  }
}
@media (max-width: 600px) {
  .project-nav {
    flex-wrap: wrap;
  }
  .project-nav a {
    flex: 1 0 calc(50% - 4px);
    justify-content: center;
    font-size: 0.875rem;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.6;
}
button {
  min-height: 48px;
  padding: 11px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 600;
  transition: background 150ms;
}
button:active {
  transform: translateY(1px);
}
a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}
input,
select,
textarea {
  border: 1px solid oklch(0.65 0.015 355);
  border-radius: 7px;
  padding: 12px;
  color: var(--ink);
  background: var(--bg);
  width: 100%;
  min-width: 0;
  min-height: 48px;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
input[aria-invalid='true'] {
  border-color: var(--danger);
}
textarea {
  resize: vertical;
}
h1,
h2,
p {
  margin-top: 0;
}
h1 {
  font-size: 2rem;
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin-bottom: 12px;
  font-weight: 650;
  overflow-wrap: anywhere;
}
h2 {
  font-size: 1.125rem;
  line-height: 1.4;
  font-weight: 650;
}
p {
  line-height: 1.55;
}
small,
.muted {
  color: var(--muted);
}
.primary {
  background: var(--primary);
  color: white;
}
.primary:hover {
  background: var(--primary-hover);
}
.secondary {
  border-color: var(--line);
  background: var(--bg);
  color: var(--ink);
}
.secondary:hover {
  background: var(--surface);
}
.danger {
  background: var(--danger);
  color: white;
}
.danger:hover {
  background: oklch(0.38 0.16 25);
}
.text-button {
  color: var(--primary);
  background: transparent;
  padding: 10px 8px;
}
.text-button:hover {
  background: var(--surface);
}
.destructive {
  color: var(--danger);
}
.icon-button {
  width: 48px;
  flex-shrink: 0;
  font-size: 1.6rem;
  background: transparent;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  clip: rect(0, 0, 0, 0);
  overflow: hidden;
  white-space: nowrap;
  border: 0;
}
.boot-message {
  padding: 32px;
}
.wordmark {
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9375rem;
  letter-spacing: -0.02em;
}
.wordmark:hover {
  text-decoration: none;
}
.wordmark strong {
  font-weight: 650;
}
.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1.5px solid currentColor;
  color: var(--primary);
  font-weight: 750;
  font-size: 1.125rem;
}
.app-header {
  min-height: 76px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8125rem;
}
.user-chip > span {
  max-width: 100px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
main:not(.auth-page) {
  max-width: 1000px;
  margin: auto;
  padding: 32px 20px 190px;
}
.page-heading {
  margin-bottom: 26px;
}
.page-heading > p:not(.eyebrow) {
  color: var(--muted);
  margin: 0;
}
.eyebrow {
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 12px;
}
.heading-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.count {
  color: var(--muted);
  font-size: 0.875rem;
  padding: 3px 9px;
  background: var(--surface);
  border-radius: 5px;
  margin-bottom: 12px;
}
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.search {
  flex: 1 1 220px;
}
.filter {
  flex: 0 1 190px;
}
.filter select {
  background: var(--surface);
  border-color: var(--line);
}
.list {
  border-top: 1px solid var(--line);
}
.list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 0;
  min-height: 88px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.list-row:hover {
  text-decoration: none;
  background: var(--surface);
}
.initial {
  display: grid;
  place-items: center;
  background: var(--accent);
  border-radius: 6px;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  font-size: 1rem;
  font-weight: 600;
}
.row-content {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 0;
}
.row-content strong {
  font-size: 1rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.row-content > span:not(.project-no) {
  font-size: 0.875rem;
  color: var(--muted);
}
.project-no {
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.row-arrow {
  color: var(--muted);
}
.row-end {
  display: flex;
  align-items: end;
  flex-direction: column;
  gap: 18px;
}
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 140px;
  padding: 5px 8px;
  border-radius: 5px;
  background: var(--accent);
  color: var(--ink);
  font-size: 0.75rem;
  line-height: 1.3;
}
.status-chip > span {
  font-size: 0.6875rem;
}
.floating {
  position: fixed;
  bottom: calc(92px + env(safe-area-inset-bottom));
  right: max(20px, calc((100vw - 960px) / 2));
  z-index: 2;
  box-shadow: 0 3px 12px oklch(0.22 0.01 355 / 0.13);
}
.bottom-nav {
  position: fixed;
  z-index: 3;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  display: flex;
  justify-content: center;
  padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.bottom-nav a {
  flex: 1;
  max-width: 170px;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  justify-content: center;
  align-items: center;
  color: var(--muted);
  font-size: 0.75rem;
  border-radius: 7px;
}
.bottom-nav a > span {
  font-size: 1.25rem;
}
.bottom-nav a[aria-current] {
  color: var(--primary);
  background: var(--surface);
  font-weight: 700;
}
.bottom-nav a:hover {
  text-decoration: none;
  background: var(--surface);
}
.empty-state {
  padding: 48px 12px;
  text-align: center;
}
.empty-state p {
  color: var(--muted);
  max-width: 360px;
  margin: 0 auto;
}
.empty-state h2 {
  margin-bottom: 8px;
}
.empty-symbol {
  font-size: 2rem;
  color: var(--muted);
  margin-bottom: 20px;
}
.error-state {
  border-left: 3px solid var(--danger);
  background: var(--surface);
  padding: 18px;
  margin: 12px 0;
  overflow-wrap: anywhere;
}
.error-state p {
  margin-bottom: 8px;
}
.error-state small {
  display: block;
  font-size: 0.6875rem;
}
.error-state button {
  margin-top: 16px;
}
.form-error {
  color: var(--danger);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}
.form-error:empty {
  display: none;
}
.form-error p {
  margin: 10px 0;
}
.form-error small {
  display: block;
  margin-bottom: 12px;
}
.field-error {
  color: var(--danger);
  font-weight: 400;
  font-size: 0.8125rem;
}
.field-error:empty {
  display: none;
}
.field-hint {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 600;
}
.field input,
.field select,
.field textarea {
  font-size: 1rem;
  font-weight: 400;
}
.form-fields {
  display: grid;
  gap: 20px;
}
.date-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.date-fields input {
  font-size: 0.875rem;
}
dialog {
  padding: 0;
  border: 0;
  background: transparent;
  max-width: min(560px, calc(100vw - 32px));
  width: 560px;
  max-height: calc(100dvh - 48px);
  border-radius: 12px;
  overscroll-behavior: contain;
}
dialog::backdrop {
  background: oklch(0.18 0.005 355 / 0.5);
}
.dialog__panel {
  background: var(--bg);
  padding: 24px;
}
.dialog__heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.dialog__heading h2 {
  font-size: 1.25rem;
  margin: 0;
}
.dialog__actions {
  display: flex;
  justify-content: end;
  gap: 12px;
  padding-top: 24px;
}
.dialog__actions button {
  flex: 1;
}
.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  margin-bottom: 20px;
  font-size: 0.875rem;
}
.detail-section {
  padding: 26px 0;
  border-top: 1px solid var(--line);
}
.detail-section dl {
  margin: 0;
  display: grid;
  gap: 20px;
}
dt {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 5px;
}
dd {
  margin: 0;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.section-heading h2 {
  margin-bottom: 0;
}
.member-list {
  list-style: none;
  padding: 0;
  margin-bottom: 0;
}
.member-list li {
  padding: 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.member-list strong {
  font-size: 0.9375rem;
  font-weight: 600;
}
.member-list small {
  display: block;
  margin-top: 6px;
}
.history {
  padding: 0 0 0 22px;
  margin-bottom: 0;
}
.history li {
  padding: 0 0 20px 8px;
}
.history li::marker {
  color: var(--muted);
  font-size: 0.8125rem;
}
.history strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
}
.history span {
  display: block;
  color: var(--muted);
  font-size: 0.8125rem;
  margin-top: 5px;
}
.history p {
  margin: 8px 0 0;
  font-size: 0.875rem;
}
.more {
  display: block;
  margin: 24px auto;
}
[hidden] {
  display: none !important;
}
.loading {
  padding: 24px 0;
}
.loading div {
  height: 64px;
  margin: 0 0 16px;
  background: var(--surface);
  border-radius: 6px;
}
.auth-page {
  max-width: 440px;
  min-height: 100dvh;
  padding: 32px 24px;
  margin: auto;
  display: flex;
  flex-direction: column;
}
.auth-intro {
  margin-top: 64px;
  margin-bottom: 28px;
}
.auth-intro h1 {
  font-size: 2.25rem;
  line-height: 1.15;
}
.auth-intro > p:last-child {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-bottom: 0;
}
.auth-form {
  display: grid;
  gap: 24px;
}
.auth-form > .primary {
  margin-top: 8px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 52px;
}
.auth-note {
  color: var(--muted);
  font-size: 0.8125rem;
  margin: 28px 0 0;
  text-align: center;
}
.password-input {
  display: flex;
  position: relative;
}
.password-input input {
  padding-right: 108px;
}
.reveal {
  position: absolute;
  right: 1px;
  top: 1px;
  min-height: 46px;
  padding: 10px 12px;
  font-size: 0.8125rem;
  background: transparent;
  color: var(--primary);
}
@media (min-width: 760px) {
  .app-header {
    padding-left: max(32px, calc((100vw - 960px) / 2));
    padding-right: max(32px, calc((100vw - 960px) / 2));
  }
  main:not(.auth-page) {
    padding-top: 48px;
  }
  h1 {
    font-size: 2.25rem;
  }
  .toolbar {
    flex-wrap: nowrap;
  }
  .detail-section dl {
    grid-template-columns: 1fr 1fr;
  }
  .row-end {
    flex-direction: row;
    gap: 28px;
    align-items: center;
  }
}
@media (max-width: 380px) {
  .app-header {
    padding: 10px 16px;
  }
  .user-chip > span {
    max-width: 60px;
  }
  .wordmark {
    font-size: 0.8125rem;
  }
  .dialog__panel {
    padding: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
