.channel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 26px;
}
.channel-header h1 {
  margin: 6px 0 9px;
  font-size: 30px;
  letter-spacing: -0.8px;
}
.channel-header p,
.channel-header small {
  color: var(--muted, #727873);
}
.channel-header small {
  letter-spacing: 1px;
}
.channel-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.channel-metric {
  border: 1px solid var(--line, #e5e8e5);
  background: white;
  border-radius: 14px;
  padding: 20px;
  display: grid;
  gap: 9px;
}
.channel-metric span,
.channel-metric small {
  color: #727873;
  font-size: 12px;
}
.channel-metric b {
  font-size: 29px;
  letter-spacing: -0.8px;
}
.channel-metric.attention {
  background: #fff9ee;
  border-color: #f1e6cb;
}
.channel-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 1fr);
  gap: 20px;
  align-items: start;
}
.channel-stack {
  display: grid;
  gap: 20px;
  min-width: 0;
}
.channel-panel {
  padding: 22px;
  background: white;
  border: 1px solid var(--line, #e5e8e5);
  border-radius: 16px;
  min-width: 0;
}
.channel-panel h2 {
  font-size: 17px;
  margin: 0 0 16px;
}
.channel-panel p {
  overflow-wrap: anywhere;
}
.channel-row {
  padding: 15px 0;
  border-top: 1px solid #edf0ed;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.channel-row:first-of-type {
  border-top: 0;
}
.channel-row > div {
  min-width: 0;
}
.channel-row > div + div {
  flex-shrink: 0;
  text-align: right;
}
.channel-row > div + div strong,
.channel-row > div + div small {
  white-space: nowrap;
}
.channel-row strong,
.channel-row small {
  display: block;
}
.channel-row strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}
.channel-row small {
  font-size: 12px;
  color: #798079;
  margin-top: 6px;
}
.channel-row p {
  margin: 6px 0;
  font-size: 13px;
  color: #626b64;
  line-height: 1.65;
  white-space: pre-wrap;
}
.channel-row .btn {
  flex-shrink: 0;
}
.channel-due {
  font-size: 12px;
  color: #9b6f26;
  white-space: nowrap;
}
.channel-partners {
  margin-top: 24px;
}
.channel-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.channel-toolbar h2 {
  margin: 0;
  font-size: 18px;
}
.channel-toolbar input {
  max-width: 300px;
  margin: 0;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid #dde4dd;
  border-radius: 10px;
  background: white;
  font: inherit;
  font-size: 13px;
}
.channel-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.channel-card {
  padding: 20px;
  border: 1px solid #e1e7e1;
  border-radius: 14px;
  background: white;
  display: block;
  color: inherit;
}
.channel-card:hover {
  border-color: #9ab4a3;
  background: #fbfdfb;
}
.channel-card[hidden] {
  display: none;
}
.channel-card h3 {
  font-size: 17px;
  margin: 14px 0 10px;
  overflow-wrap: anywhere;
}
.channel-card p {
  color: #788078;
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  margin: 6px 0;
}
.channel-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.channel-card footer {
  border-top: 1px solid #eef0ee;
  padding-top: 14px;
  margin-top: 16px;
  font-size: 12px;
  color: #466451;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.channel-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 22px 0;
  padding-bottom: 4px;
}
.channel-tabs button {
  white-space: nowrap;
  border: 1px solid #e2e7e2;
  background: white;
  padding: 10px 16px;
  border-radius: 9px;
}
.channel-tabs button.selected {
  color: #315442;
  background: #eaf2ec;
  border-color: #c9dccf;
}
.channel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.channel-kv {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;
  font-size: 14px;
  line-height: 1.7;
  margin: 0;
}
.channel-kv dt {
  color: #7d857e;
}
.channel-kv dd {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.channel-samples {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.channel-sample {
  border: 1px solid #e2e7e2;
  border-radius: 14px;
  overflow: hidden;
  background: white;
}
.channel-sample img {
  display: block;
  width: 100%;
  height: 210px;
  object-fit: contain;
  background: #f0f3ef;
}
.channel-sample .sample-placeholder {
  height: 100px;
  display: grid;
  place-items: center;
  color: #899387;
  background: #f2f5f0;
  font-size: 13px;
}
.channel-sample > div:last-child {
  padding: 18px;
}
.channel-sample h3 {
  margin: 10px 0 8px;
  font-size: 17px;
}
.channel-sample p {
  font-size: 13px;
  color: #6e786e;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.channel-sample .channel-actions {
  margin-top: 16px;
}
.channel-history summary {
  cursor: pointer;
  font-size: 13px;
  color: #718071;
}
.channel-empty {
  color: #788078;
  padding: 22px 0;
  font-size: 14px;
  line-height: 1.8;
}
.channel-note {
  font-size: 12px;
  line-height: 1.7;
  color: #7c847b;
  margin: 12px 0 0;
}
.channel-photo-preview {
  display: block;
  max-width: 100%;
  max-height: 280px;
  margin: 16px auto;
}
.channel-direct-detail h3 {
  margin-top: 28px;
}
.channel-direct-detail .channel-metric b {
  font-size: clamp(17px, 2vw, 24px);
  overflow-wrap: anywhere;
}
.channel-material-input {
  border: 1px solid #dce5de;
  border-radius: 12px;
  margin: 16px 0;
  padding: 14px;
  min-width: 0;
}
.channel-material-input legend {
  font-size: 13px;
  color: #52715f;
}
.channel-product-results {
  max-height: 230px;
  overflow-y: auto;
  display: grid;
  gap: 6px;
}
.channel-product-option {
  display: grid;
  gap: 4px;
  padding: 12px;
  background: #f6f9f6;
  border: 1px solid #e0e8e1;
  border-radius: 8px;
  text-align: left;
  width: 100%;
}
.channel-product-option:hover {
  background: #e9f2ec;
}
.channel-product-option small {
  color: #6b796e;
  overflow-wrap: anywhere;
}
.channel-selected-price {
  color: #356950;
  font-size: 13px;
}
#channelMaterials[hidden],
#channelSummaryAmount[hidden] {
  display: none;
}
@media (max-width: 1100px) {
  .channel-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 800px) {
  .channel-header {
    margin-bottom: 18px;
    align-items: center;
  }
  .channel-header h1 {
    font-size: 26px;
  }
  .channel-header p {
    font-size: 13px;
    line-height: 1.6;
  }
  .channel-header .btn {
    flex-shrink: 0;
  }
  .channel-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .channel-metric {
    padding: 16px;
    gap: 6px;
  }
  .channel-metric b {
    font-size: 26px;
  }
  .channel-layout,
  .channel-cards,
  .channel-samples {
    grid-template-columns: minmax(0, 1fr);
  }
  .channel-panel {
    padding: 18px;
  }
  .channel-toolbar {
    flex-wrap: wrap;
  }
  .channel-toolbar input {
    max-width: none;
    width: 100%;
  }
  .channel-tabs {
    margin: 18px -3px;
    gap: 4px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .channel-tabs button {
    min-height: 44px;
    flex: 1;
    min-width: 0;
    padding: 10px 4px;
    font-size: 13px;
  }
  .channel-kv {
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 10px;
  }
  .channel-actions .btn {
    min-height: 44px;
  }
  .channel-row {
    align-items: flex-start;
  }
  .channel-row .btn {
    max-width: 118px;
    white-space: normal;
    text-align: center;
  }
}

.channel-checkin-form {
  margin: 0 0 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  min-width: 0;
}
.channel-checkin-form legend {
  padding: 0 6px;
  font-weight: 600;
}
.channel-photo-input {
  margin-top: 16px;
}

.sample-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
}
.project-photo-grid,
.photo-queue {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0;
}
.project-photo-grid a,
.photo-queue > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 180px;
}
.project-photo-grid img,
.photo-queue img {
  width: 160px;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
}
.space-drawings {
  margin-top: 20px;
  border-top: 1px solid var(--line, #e5e8e5);
  padding-top: 12px;
}
.quote-line-preview {
  max-height: 280px;
  overflow: auto;
}
.modal footer {
  flex-wrap: wrap;
}
.space-panel .section-head .actions {
  flex-wrap: wrap;
  flex-shrink: 1;
  min-width: 0;
}

.quote-price-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 8px 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line, #e5e5e5);
}
.quote-price-row small {
  display: block;
  margin-top: 5px;
}
.quote-price-row label {
  font-size: 12px;
}
.quote-price-row input {
  width: 100%;
}
.quote-price-row [data-line-limit] {
  grid-column: 1/-1;
}
.quote-over-limit {
  color: #a63823;
  font-weight: 600;
}
.quote-fees {
  margin: 24px 0;
}
.quote-charge-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.3fr auto;
  gap: 8px;
  align-items: end;
  margin: 12px 0;
}
.quote-charge-row label {
  min-width: 0;
  font-size: 12px;
}
.quote-charge-row input {
  width: 100%;
}
@media (max-width: 600px) {
  .quote-charge-row {
    grid-template-columns: 1fr 1fr;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line, #eee);
  }
  .quote-charge-row label:first-child {
    grid-column: 1/-1;
  }
}

/* Camera controls must stay hidden until a live preview is ready. */
.channel-checkin-form [hidden] {
  display: none !important;
}

.channel-dashboard-details > summary { cursor: pointer; padding: 10px 0 16px; color: var(--accent); font-size: 13px; }
.channel-dashboard-details[open] > summary { margin-bottom: 6px; border-bottom: 1px solid var(--line); }
