:root {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: #e8eaef;
  background: #0f1115;
}

body {
  margin: 0;
  min-height: 100vh;
}

.muted {
  color: #8b919d;
  font-size: 0.9rem;
}

.err {
  color: #f5a8a8;
}

.warn {
  color: #f0d090;
  font-size: 0.85rem;
  max-width: 56rem;
}

.app-header {
  padding: 1rem 1.25rem 0;
}

.app-brand {
  margin-bottom: 1rem;
  text-align: center;
}

.app-logo {
  display: block;
  margin: 0 auto;
  max-width: min(100%, 240px);
  height: auto;
}

.project-name {
  margin: 0.5rem 0 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #c9ced8;
}

.app-header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
  font-weight: 600;
}

.toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #252a33;
}

.toolbar-filters .filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: flex-end;
}

.toolbar-selection {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid #2a3038;
}

.toolbar-selection .bulk {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.75rem;
  color: #8b919d;
}

.filters .search-field input {
  min-width: 14rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid #353b47;
  background: #181c24;
  color: #e8eaef;
}

#btn-clear-filters {
  align-self: flex-end;
}

.parts .vendor-pn-link {
  color: #7eb8ff;
  text-decoration: underline;
}

.parts .sub-qty-cell {
  max-width: 14rem;
  line-height: 1.35;
}

select {
  min-width: 10rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid #353b47;
  background: #181c24;
  color: #e8eaef;
}

button {
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  border: 1px solid #353b47;
  background: #1e232d;
  color: #e8eaef;
  cursor: pointer;
  font-size: 0.85rem;
}

button:hover {
  background: #262c38;
}

button.primary {
  background: #2d4a7a;
  border-color: #3d5c94;
}

button.primary:hover {
  background: #35568a;
}

button.btn-purchase {
  background: #1a5c4a;
  border-color: #2a7d66;
  color: #e8f5f0;
}

button.btn-purchase:hover {
  background: #236f5a;
  border-color: #349473;
}

.export-qty-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: #b4bac6;
  cursor: pointer;
  user-select: none;
  margin-right: 0.25rem;
}

.export-qty-toggle input {
  cursor: pointer;
}

.filter-selected-only {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: #8b919d;
  cursor: pointer;
  user-select: none;
}

.filter-selected-only input {
  cursor: pointer;
}

.table-wrap {
  overflow: auto;
  padding: 0 1rem 2rem;
}

table.parts {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.parts th,
.parts td {
  border-bottom: 1px solid #252a33;
  padding: 0.45rem 0.5rem;
  text-align: left;
  vertical-align: middle;
}

.parts th {
  position: sticky;
  top: 0;
  background: #141820;
  z-index: 1;
  font-weight: 600;
  color: #b4bac6;
}

.parts th.asset-col-head {
  text-align: center;
  vertical-align: middle;
  width: 2.75rem;
  line-height: 0;
}

.parts th.asset-col-head img {
  display: inline-block;
  vertical-align: middle;
  margin: 0;
  width: 1.375rem;
  height: 1.375rem;
  object-fit: contain;
  background: transparent;
}

.parts .asset-cell {
  text-align: center;
  vertical-align: middle;
  width: 2.75rem;
  line-height: 0;
}

.parts .asset-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  box-sizing: border-box;
  line-height: 0;
  vertical-align: middle;
}

.parts a.step-tab-link {
  text-decoration: none;
  color: inherit;
}

.parts a.step-tab-link:hover {
  opacity: 0.9;
}

.parts .asset-icon {
  display: block;
  flex-shrink: 0;
  width: 1.375rem;
  height: 1.375rem;
  margin: 0;
  object-fit: contain;
  background: transparent;
  border-radius: 4px;
}

.parts .step-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
  line-height: 0;
  vertical-align: middle;
}

.parts .step-icon-btn:hover {
  background: #252a33;
}

.parts .step-icon-btn:focus-visible {
  outline: 2px solid #4a7dbd;
  outline-offset: 1px;
}

.parts .td-order-qty {
  white-space: nowrap;
}

.parts .td-order-qty-readonly {
  color: #d8dce6;
}

.parts .qty-input {
  width: 4.25rem;
  min-width: 3.5rem;
  padding: 0.25rem 0.35rem;
  border-radius: 4px;
  border: 1px solid #353b47;
  background: #181c24;
  color: #e8eaef;
  font-size: 0.8rem;
}

.parts .chk {
  width: 2rem;
}

.parts .thumb {
  width: 4.5rem;
}

.parts .thumb img {
  width: 4rem;
  height: 4rem;
  object-fit: contain;
  background: #181c24;
  border-radius: 4px;
}

.parts .ph {
  font-size: 0.65rem;
  color: #6a707c;
}

.parts .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.parts .num {
  text-align: right;
}

.parts .small {
  font-size: 0.75rem;
  color: #9aa3b2;
  max-width: 10rem;
}

.parts .nowrap {
  white-space: nowrap;
}

.parts a {
  color: #7eb8ff;
}

.viewer-shell {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
}

.viewer-shell .msg {
  padding: 0.75rem 1rem;
  background: #141820;
  border-bottom: 1px solid #252a33;
}

.viewer-shell #cv {
  flex: 1;
  width: 100%;
  display: block;
}

.splash {
  max-width: 42rem;
  margin: 2.5rem auto;
  padding: 0 1.25rem;
}

.splash h1 {
  margin-top: 0;
}

.splash code {
  font-size: 0.9em;
  color: #c8d0e0;
}

.linklike {
  background: none;
  border: none;
  color: #7eb8ff;
  cursor: pointer;
  text-decoration: underline;
  font: inherit;
  padding: 0;
}

.linklike:hover {
  color: #a8d2ff;
}

.parts .linklike {
  text-align: left;
}

.step-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
}

.step-overlay-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #0f1115;
  margin: 0 auto;
  width: 100%;
  max-width: 100%;
}

.step-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #252a33;
  flex-shrink: 0;
}

.step-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.step-close {
  padding: 0.35rem 0.75rem;
}

.step-msg {
  padding: 0.5rem 1rem;
  min-height: 1.25rem;
  flex-shrink: 0;
}

#step-cv {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: block;
}
