/* Dialog layout follows the shared white and forest-green UI design. */
#work-details,
#task-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 24px;
  border: 1px solid #d9e2dc;
  border-radius: 18px;
  background: #fff;
  color: #24332a;
  box-shadow: 0 24px 80px #15271b33;
  overflow: auto;
}
#work-details::backdrop,
#task-dialog::backdrop {
  background: #16231c50;
  backdrop-filter: blur(6px);
}
#work-details > header,
#task-dialog > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0;
}
#work-details > header h2,
#task-dialog > header h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.4;
  color: #202d24;
  letter-spacing: -0.4px;
}
#work-details > header button,
#task-dialog > header button {
  display: grid;
  place-items: center;
  flex: none;
  border: 0;
  background: #f3f5f3;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 22px;
  color: #6b786e;
  cursor: pointer;
}
#work-details #task-mode {
  margin: 5px 0 16px;
  font-size: 12px;
  color: #748178;
}
.detail-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #e4e9e5;
  margin: 0 0 20px;
}
.detail-tabs button {
  flex: 1;
  min-height: 42px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #667269;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.detail-tabs button[aria-selected="true"] {
  color: #155c37;
  border-bottom-color: #155c37;
  font-weight: 650;
}
#work-details .handoff-section {
  margin: 0;
  padding: 0;
  border: 0;
}
#work-details .section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 12px;
}
#work-details .section-title h3 {
  font-size: 11px;
  font-weight: 500;
  margin: 0;
  color: #7d8880;
}
#work-details .role-chat-button {
  border: 0;
  background: transparent;
  color: #30724b;
  font-size: 12px;
  padding: 0;
}
.result-product {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  padding: 0 0 16px;
  border-bottom: 1px solid #edf0ed;
}
.product-symbol {
  display: grid;
  place-items: center;
  width: 48px;
  height: 52px;
  border-radius: 12px;
  background: #e9f2ec;
  color: #20623c;
  font-size: 34px;
}
.result-product > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}
#work-details .result-product h3 {
  font-size: 18px;
  margin: 0;
  color: #23372a;
}
.result-product p {
  font-size: 11px;
  color: #8a958d;
  margin: 5px 0 0;
}
.result-state {
  font-size: 10px;
  color: #35754b;
  background: #edf6ee;
  padding: 5px 7px;
  border-radius: 5px;
  white-space: nowrap;
}
#work-details .result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 8px;
}
#work-details .result-header h4 {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  color: #334b3b;
}
#work-details .result-header > span {
  font-size: 11px;
  color: #87938b;
}
#work-details .metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 22px;
  margin: 0 0 20px;
  background: transparent;
}
#work-details .metric {
  border: 0;
  border-bottom: 1px solid #e9eeea;
  border-radius: 0;
  padding: 13px 0;
  background: transparent;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
#work-details .metric span {
  font-size: 12px;
  color: #738078;
}
#work-details .metric strong {
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.6px;
  color: #203e2d;
  line-height: 1.25;
}
#work-details .result-notes {
  background: #f3f6f3;
  border: 1px solid #e6ece7;
  border-radius: 9px;
  padding: 0;
  margin: 0;
}
#work-details .result-notes > summary {
  font-size: 12px;
  padding: 11px 13px;
  color: #536958;
  cursor: pointer;
  border: 0;
}
#work-details .result-notes p {
  font-size: 12px;
  line-height: 1.8;
  margin: 0;
  padding: 0 13px 12px;
  color: #5c6c61;
}
#work-details .detail-json {
  padding: 0 13px 12px;
  font-size: 11px;
  color: #65756b;
}
#work-details .detail-json pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 10px;
  max-height: 220px;
  overflow: auto;
  background: #eaf0eb;
  padding: 10px;
  border-radius: 6px;
}
.detail-footer {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #e9eeea;
}
.detail-footer > .secondary {
  font-size: 11px;
  padding: 6px 9px;
  border: 1px solid #e3e8e3;
  background: #fafbfa;
  color: #727f76;
  border-radius: 6px;
}
.detail-footer .history-menu {
  margin-left: auto;
  font-size: 11px;
  color: #708077;
  max-width: 100%;
}
.detail-footer .history-menu summary {
  cursor: pointer;
}
#work-details .history-row {
  margin: 8px 0 0;
  display: grid;
  gap: 5px;
}
#work-details .history-row select {
  width: 100%;
  font: inherit;
}
#work-details :is(.evidence, .sourcing-panel) {
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
}
#work-details :is(.evidence, .sourcing-panel) > summary {
  display: none;
}
#work-details .evidence :is(p, li) {
  font-size: 12px;
  line-height: 1.85;
  color: #5c6e61;
}
#work-details .evidence ul {
  padding-left: 18px;
}
#work-details .evidence a {
  color: #226d43;
  font-size: 12px;
}
#work-details #sourcing-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px;
  gap: 14px;
  margin: 0;
}
#work-details #sourcing-form label {
  display: grid;
  gap: 7px;
  font-size: 12px;
  color: #5b6f61;
}
#work-details #sourcing-form input {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 8px 10px;
  border: 1px solid #dce5de;
  border-radius: 7px;
  font: inherit;
  color: #294833;
  background: #fafcfb;
}
#work-details #sourcing-submit {
  grid-column: 1/-1;
  border: 0;
  border-radius: 8px;
  background: #185f3b;
  color: white;
  height: 40px;
  font-size: 13px;
  cursor: pointer;
}
#work-details #sourcing-results {
  font-size: 12px;
  line-height: 1.7;
  color: #617169;
  margin-top: 15px;
}
#task-dialog .run-form {
  margin: 22px 0 0;
  gap: 9px;
  display: grid;
}
#task-dialog label {
  font-size: 12px;
  color: #55695d;
}
#task-dialog :is(input, select) {
  width: 100%;
  height: 43px;
  font: inherit;
  font-size: 13px;
  color: #294132;
  background: #fafcfb;
  border: 1px solid #d7e1d9;
  border-radius: 8px;
  padding: 8px 11px;
}
#task-dialog .field-hint {
  font-size: 11px;
  line-height: 1.6;
  color: #8a978e;
  margin: 0 0 11px;
}
#task-dialog .form-row {
  display: block;
  padding: 15px;
  background: #f1f6f2;
  border: 1px solid #e4ece5;
  border-radius: 10px;
}
#task-dialog .form-row label {
  display: block;
  margin-bottom: 7px;
}
#task-dialog #budget {
  font-size: 26px;
  font-weight: 650;
  color: #1d4a2e;
  background: transparent;
  border: 0;
  padding: 0;
  height: 38px;
  box-shadow: none;
}
.advanced-task {
  margin: 7px 0;
  font-size: 12px;
  color: #748478;
}
.advanced-task summary {
  cursor: pointer;
}
.advanced-task label {
  display: block;
  margin: 12px 0 7px;
}
#task-dialog .run-form > .primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #185f3b;
  border: 0;
  border-radius: 9px;
  padding: 13px 16px;
  color: white;
  font-size: 14px;
  min-height: 46px;
  margin-top: 6px;
  cursor: pointer;
}
#task-dialog .run-form > .primary:disabled {
  opacity: 0.5;
  cursor: wait;
}
@media (max-width: 480px) {
  #work-details,
  #task-dialog {
    width: calc(100vw - 24px);
    padding: 18px;
    max-height: calc(100dvh - 30px);
  }
  #work-details > header h2,
  #task-dialog > header h2 {
    font-size: 19px;
  }
  .result-product {
    gap: 9px;
  }
  #work-details .result-product h3 {
    font-size: 16px;
  }
  .result-state {
    display: none;
  }
  #work-details .metric strong {
    font-size: 22px;
  }
}
.product-symbol {
  position: relative;
  flex: none;
  width: 72px;
  height: 84px;
  background: #f6f7f5;
  border-radius: 12px;
  overflow: hidden;
}
.product-symbol:before {
  content: "";
  position: absolute;
  left: 20px;
  top: 26px;
  width: 33px;
  height: 42px;
  background: #a0aea4;
  border-radius: 3px 3px 5px 5px;
  transform: rotate(-5deg);
  box-shadow: 4px 4px 8px #263b2920;
}
.product-symbol i {
  position: absolute;
  left: 27px;
  top: 15px;
  width: 18px;
  height: 22px;
  border: 3px solid #819689;
  border-radius: 12px 12px 0 0;
  transform: rotate(-5deg);
}
.product-symbol.red-dot-bag:before {
  background-color: #c64247;
  background-image: radial-gradient(circle, #fff5ed 0 2px, transparent 2.6px);
  background-size: 12px 12px;
}
.product-symbol.red-dot-bag i {
  border-color: #b4373d;
}
#work-details .section-title {
  justify-content: flex-end;
  margin-bottom: 8px;
}
