:root {
  color-scheme: light;
  --brand: #e41d24;
  --action: #b61921;
  --ink: #241d20;
  --muted: #665e61;
  --line: #ded9da;
  --surface: #fff;
  --paper: #f8f7f5;
  --tint: #fae8e6;
}
[data-bs-theme="dark"] {
  color-scheme: dark;
  --action: #ff858b;
  --ink: #f6f0ed;
  --muted: #c9bbbf;
  --line: #4c4044;
  --surface: #211d20;
  --paper: #161316;
  --tint: #382429;
}
[data-bs-theme="light"] {
  color-scheme: light;
}
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
}
.container {
  max-width: 1248px;
  padding-inline: clamp(16px, 4vw, 48px);
}
.masthead {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.nav-shell,
.top-controls,
.pagination-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-shell {
  min-height: 76px;
  justify-content: space-between;
}
.identity img {
  display: block;
  object-fit: contain;
}
.identity .logo-night,
[data-bs-theme="dark"] .logo-day {
  display: none;
}
[data-bs-theme="dark"] .logo-night {
  display: block;
}
.compact-select,
.theme-control {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
  border-radius: 8px;
  min-height: 38px;
  padding: 4px 10px;
}
.theme-control {
  width: 40px;
  font-size: 1.25rem;
  line-height: 1;
}
.top-controls .btn {
  padding: 8px 18px;
}
.page {
  min-height: 78vh;
  padding-block: 28px 52px;
}
h1,
h2,
h3 {
  text-wrap: balance;
  overflow-wrap: break-word;
}
.hero {
  isolation: isolate;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: #6e101a;
  color: #fff9f6;
}
.hero-copy {
  position: relative;
  z-index: 1;
  padding: clamp(32px, 4.6vw, 68px);
  background: linear-gradient(118deg, #4e1019, #921822);
}
.institution {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: #ffe2dd;
  font-weight: 600;
}
.institution span {
  opacity: 0.65;
}
.hero h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.99;
  font-size: clamp(3rem, 5.4vw, 5.1rem);
  margin: 22px 0 16px;
}
.hero p {
  font-size: 1rem;
  line-height: 1.55;
  color: #ffe4e1;
  max-width: 42ch;
  margin-bottom: 26px;
  text-wrap: pretty;
}
.hero-button {
  display: inline-flex;
  align-items: center;
  gap: 25px;
  padding: 11px 18px;
  background: #fff8f3;
  color: #59121b;
  border-radius: 7px;
  font-weight: 650;
  text-decoration: none;
}
.hero-button:hover {
  background: #ffddd9;
  color: #361015;
}
.hero figure {
  overflow: hidden;
  margin: 0;
  position: relative;
  min-width: 0;
  min-height: 225px;
  background: #2b2426;
}
.hero figure::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #16090d99, transparent 42%);
  pointer-events: none;
}
.hero img {
  width: 100%;
  height: 100%;
  position: absolute;
  object-fit: cover;
  object-position: center 45%;
}
.hero figcaption {
  z-index: 1;
  position: absolute;
  left: 22px;
  bottom: 16px;
  color: white;
  background: #24181bd9;
  padding: 4px 9px;
  border-radius: 3px;
  font-size: 0.72rem;
}
#catalog {
  padding-block: 46px 8px;
  scroll-margin-top: 20px;
}
.catalog-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
#catalog h2,
.desk-heading {
  font:
    500 clamp(2rem, 3.6vw, 3rem)/1.08 Georgia,
    serif;
  letter-spacing: -0.05em;
  margin: 0;
}
.catalog-count {
  color: var(--muted);
  margin: 6px 0 0;
  font-size: 0.9rem;
}
.catalog-filters {
  display: flex;
  gap: 8px;
}
.catalog-filters input {
  width: 15rem;
}
.catalog-filters select {
  width: 11rem;
}
.source {
  color: var(--muted);
  text-underline-offset: 0.18em;
  font-size: 0.85rem;
}
.source:hover {
  color: var(--action);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.hero-actions a {
  color: #fff;
  text-underline-offset: 0.25rem;
  font-weight: 550;
}
.hero-button {
  border: 0;
}
.catalog-scroll,
.item-scroll {
  max-width: 100%;
  overflow-x: auto;
}
.catalog-scroll {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--surface);
}
.directory,
.item-breakdown {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.directory {
  min-width: 48rem;
  table-layout: fixed;
}
.directory .name-column {
  width: 34%;
}
.directory .function-column {
  width: 28%;
}
.directory .price-column {
  width: 14%;
}
.directory .detail-column {
  width: 10%;
}
.directory th,
.directory td {
  padding: 0.95rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}
.directory thead th {
  color: var(--muted);
  background: var(--paper);
  font-size: 0.8rem;
  white-space: nowrap;
}
.directory tbody th {
  background: var(--surface);
  line-height: 1.3;
  font-weight: 620;
}
.directory tbody th small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  margin-top: 0.3rem;
}
.directory tbody td:nth-child(2) {
  font-size: 0.91rem;
  color: var(--muted);
}
.directory .price,
.directory thead th:nth-child(3),
.directory thead th:nth-child(4) {
  text-align: end;
  white-space: nowrap;
}
.directory tbody tr:last-child > :is(th, td) {
  border-bottom: 0;
}
.directory thead th:first-child,
.directory tbody th {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
}
.directory td:last-child {
  text-align: center;
}
.order-lines {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 0.7rem;
}
.order-line {
  display: grid;
  grid-template-columns:
    minmax(10rem, 2fr) 5rem minmax(5.5rem, 1fr) minmax(5.5rem, 1fr)
    auto;
  align-items: end;
  gap: 0.7rem;
  min-width: 0;
  padding: 0.85rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0.6rem;
}
.order-line label,
.line-amount small {
  display: block;
  font-size: 0.8rem;
  font-weight: 550;
  color: var(--muted);
}
.order-line :is(input, select) {
  margin-top: 0.25rem;
}
.line-amount {
  align-self: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.remove-line {
  align-self: center;
  color: var(--action);
  border: 0;
  background: transparent;
  font-size: 0.85rem;
  font-weight: 600;
}
.remove-line:disabled {
  opacity: 0.5;
}
.order-summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  margin: 0.5rem 0 1rem;
  border-bottom: 1px solid var(--line);
}
.order-total {
  font-weight: 700;
  color: var(--action);
}
.item-breakdown {
  margin: 0.8rem 0;
}
.item-breakdown :is(th, td) {
  padding: 0.5rem;
  border-bottom: 1px solid var(--line);
  text-align: end;
}
.item-breakdown :is(th, td):first-child {
  text-align: start;
}
.item-breakdown td {
  white-space: nowrap;
}
@media (max-width: 800px) {
  .order-line {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  }
  .order-service {
    grid-column: span 2;
  }
  .order-line .form-select {
    width: 100%;
    min-width: 0;
  }
}
@media (max-width: 450px) {
  .directory tbody th,
  .directory thead th:first-child {
    position: static;
  }
  .order-line {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .order-service {
    grid-column: 1 / -1;
  }
  .remove-line {
    justify-self: start;
  }
}
.pagination-bar {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-block: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.page-settings,
.page-settings label,
.page-buttons {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.page-settings {
  flex-wrap: wrap;
  gap: 1rem;
}
.page-settings select,
.page-buttons button {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
}
.page-settings select {
  padding: 0.35rem 0.4rem;
}
.page-buttons {
  gap: 0.22rem;
}
.page-buttons button {
  min-width: 2.15rem;
  min-height: 2.15rem;
  font-variant-numeric: tabular-nums;
}
.page-buttons button:not(:disabled):hover {
  border-color: var(--action);
}
.page-buttons button[aria-current] {
  color: white;
  background: #a81620;
  border-color: #a81620;
  font-weight: 650;
}
.page-buttons button:disabled {
  opacity: 0.4;
}
.pager-gap {
  padding-inline: 0.15rem;
}
.instrument-sheet {
  color: var(--ink);
}
.instrument-purpose {
  color: var(--muted);
  margin: 0 0 1rem;
}
.instrument-rates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 2rem;
  padding: 1rem 0;
  border-block: 1px solid var(--line);
}
.instrument-rates dt,
.instrument-facts dt {
  font-size: 0.83rem;
  color: var(--muted);
  font-weight: 500;
}
.instrument-rates dd,
.instrument-facts dd {
  margin: 0;
}
.instrument-rates dd {
  font-weight: 650;
}
.instrument-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
  gap: 0.8rem 1.25rem;
}
.instrument-note {
  margin: 1.2rem 0;
}
.instrument-note h3 {
  font-size: 1rem;
  font-weight: 650;
}
.instrument-note p {
  white-space: pre-line;
  line-height: 1.6;
  margin: 0;
}
.instrument-photos img {
  max-width: 100%;
  max-height: 19rem;
  object-fit: contain;
  border-radius: 0.35rem;
}
.instrument-actions:not(:empty) {
  margin-top: 1.2rem;
}
@media (max-width: 520px) {
  .page-buttons {
    gap: 0.15rem;
    flex-wrap: wrap;
  }
  .page-buttons button {
    min-width: 1.95rem;
  }
  .pagination-bar {
    align-items: start;
    flex-direction: column;
  }
}
.btn {
  border-radius: 7px;
  font-weight: 600;
}
.btn-primary {
  --bs-btn-bg: #b61921;
  --bs-btn-border-color: #b61921;
  --bs-btn-hover-bg: #91121a;
  --bs-btn-hover-border-color: #91121a;
  --bs-btn-active-bg: #791019;
  --bs-btn-active-border-color: #791019;
}
.btn-outline-primary {
  --bs-btn-color: var(--action);
  --bs-btn-border-color: var(--line);
  --bs-btn-hover-bg: #a81620;
  --bs-btn-hover-border-color: #a81620;
  --bs-btn-active-bg: #791019;
  --bs-btn-active-border-color: #791019;
  --bs-btn-disabled-color: var(--muted);
  --bs-btn-disabled-border-color: var(--line);
}
:focus-visible {
  outline: 3px solid var(--action);
  outline-offset: 3px;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--action);
  box-shadow: 0 0 0 0.18rem color-mix(in srgb, var(--brand) 20%, transparent);
}
.form-control,
.form-select,
.modal-content,
.card {
  background-color: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
.form-label {
  font-weight: 600;
}
.form-label :is(input, select, textarea) {
  margin-top: 0.3rem;
}
#notice {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 92vw;
  z-index: 1500;
}
#notice:empty {
  display: none;
}
.role-label,
.request-status {
  display: inline-block;
  color: var(--action);
  font-weight: 650;
}
.stat {
  background: var(--surface);
  border-radius: 12px;
}
.stat strong {
  font-size: 1.8rem;
}
.table {
  --bs-table-bg: var(--surface);
  --bs-table-color: var(--ink);
}
.table th {
  font-size: 0.83rem;
  color: var(--muted);
}
.table th,
.table td {
  padding: 0.85rem;
}
.timeline {
  border-inline-start: 2px solid var(--line);
  padding-inline-start: 1rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.timeline > div {
  margin: 0.6rem 0;
}
.invoice {
  padding: 20px;
  margin: 16px 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.invoice header {
  display: flex;
  justify-content: space-between;
  color: var(--action);
}
.invoice h3 {
  font-size: 1.2rem;
  margin: 12px 0;
}
.invoice dl > div,
.request-info > div {
  display: grid;
  grid-template-columns: minmax(95px, 1fr) 2fr;
  gap: 14px;
  padding: 5px 0;
}
.invoice dt,
.request-info dt {
  color: var(--muted);
  font-size: 0.9rem;
}
.invoice dd,
.request-info dd {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.action-form {
  margin-top: 16px;
}

.order-chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 0 0.9rem;
}
.results-panel {
  margin: 1.2rem 0;
}
.results-panel h3 {
  font-size: 1.05rem;
}
.file-hint,
.file-box p,
.file-progress {
  font-size: 0.84rem;
  color: var(--muted);
}
.file-boxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  gap: 0.65rem;
}
.file-box {
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  padding: 0.85rem;
  min-width: 0;
}
.file-box h4 {
  font-size: 0.95rem;
  font-weight: 650;
}
.file-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.file-box li {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.35rem 0;
}
.file-box a {
  color: var(--action);
  overflow-wrap: anywhere;
  text-underline-offset: 0.15rem;
}
.file-box small {
  color: var(--muted);
}
.file-picker {
  display: grid;
  gap: 0.3rem;
  font-size: 0.84rem;
  margin-top: 0.5rem;
}
.file-picker input {
  width: 100%;
  font-size: 0.78rem;
}
.file-picker input::file-selector-button,
.file-remove {
  border: 1px solid var(--line);
  color: var(--action);
  border-radius: 5px;
  background: var(--surface);
  padding: 0.25rem 0.5rem;
}
.file-remove {
  font-size: 0.75rem;
}
footer {
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-block: 22px;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .catalog-heading {
    align-items: stretch;
    flex-direction: column;
  }
  .catalog-filters input {
    flex: 1;
    min-width: 0;
  }
}
@media (max-width: 620px) {
  .nav-shell {
    min-height: 62px;
  }
  .top-controls {
    gap: 5px;
  }
  .top-controls .btn {
    padding-inline: 10px;
  }
  .identity img {
    width: 92px;
    height: auto;
  }
  #account .small {
    display: none;
  }
  .page {
    padding-block-start: 16px;
  }
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-copy {
    padding: 28px 22px;
  }
  .hero figure {
    min-height: 158px;
  }
  #catalog {
    padding-block-start: 30px;
  }
  .catalog-filters {
    flex-wrap: wrap;
  }
  .catalog-filters input,
  .catalog-filters select {
    flex: 1 1 10rem;
    width: 100%;
  }
}
@media (pointer: coarse) {
  button,
  .btn,
  .compact-select,
  .form-select,
  .form-control {
    min-height: 44px;
  }
}
@media print {
  body:has(.invoice) > :not(#editor),
  #editor .modal-header,
  #editor .modal-body > :not(.invoice),
  .invoice button {
    display: none !important;
  }
  body:has(.invoice),
  #editor,
  .invoice {
    background: white !important;
    color: black;
    overflow: visible !important;
  }
  #editor {
    position: static;
    height: auto;
  }
  #editor .modal-dialog {
    max-width: none;
    margin: 0;
    transform: none;
  }
  #editor .modal-content {
    border: 0;
  }
}

@media print {
  .invoice .item-scroll {
    overflow: visible;
  }
  .item-breakdown tr {
    break-inside: avoid;
  }
}
