/* Asimov Form Styles */

.asimov-form .render-row-error {
  color: var(--color-red);
  font-size: 0.7rem;
}

.asimov-form-problems .form-problems strong,
.asimov-form .problem.error .label-cell {
  color: var(--color-red);
}

.asimov-form {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}

.asimov-form .formative-section {
  display: flex;
  flex-direction: column;
  background: var(--background-8);
  border-radius: 0.5rem;
  width: 100%;
  height: fit-content;
  min-height: 0;
  min-width: 0;
  padding: 0.5rem;
  margin: 0 0 0.5rem 0;
}

@media not screen and (max-width:1100px) {
  .asimov-form .formative-section.half-width {
    width: calc(50% - 0.5rem);
    margin: 0 0.5rem 0.5rem 0;
  }
}

.asimov-form .formative-section-body {
  flex: 1;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  min-height: 0;
  min-width: 0;
  padding: 0;
  margin: 0;
  overflow-x: auto;
}

.asimov-form .formative-section:has(.formative-section-expander:not(.expanded)) .formative-section-body {
  display: none;
}

.asimov-form .formative-section-expander {
  display: flex;
  justify-content: space-between;
}

.asimov-form .formative-section-expander.expanded {
  margin-bottom: 0.5rem;
}

.asimov-form .formative-section-expander .title {
  color: var(--color-1);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.5rem;
  margin: 0;
  padding-left: 1rem;
}

.asimov-form .formative-section-expander:not(.expanded) .collapse {
  display: none;
}

.asimov-form .formative-section-expander.expanded .expand {
  display: none;
}

.asimov-form .formative-section .formative-row {
  width: calc(100% - 1rem);
  height: fit-content;
}

@media not screen and (max-width:1100px) {
  .asimov-form .formative-section.dual-column:not(.half-width) .formative-row:not(.heading-row) {
    width: calc(50% - 1rem);
  }
}

.asimov-form .formative-row:not(.heading-row) {
  padding: 0.5rem 1rem;
  margin: 0.5rem;
  background: var(--background-7);
  border-radius: 0.25rem;
}

.asimov-form .formative-row.heading-row {}

.asimov-form .heading-row h3 {
  color: var(--color-1);
  margin: 0.25rem 0 0.25rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
}

.asimov-form .formative-row.autosave-row,
.asimov-form .formative-row:not(.shown-checked) {
  display: none;
}

.asimov-form .label-cell {
  color: var(--color-2);
  font-size: 0.5rem;
}

.asimov-form .project-selector-input:not(:focus),
.asimov-form .item-selector-input:not(:focus),
.asimov-form .tool-picker-input:not(.table-input):not(:focus),
.asimov-form .textarea-row textarea:not(:focus),
.asimov-form .select-row select:not(:focus),
.asimov-form .url-row input:not(:focus),
.asimov-form .date-row input:not(:focus),
.asimov-form .datetime-select-row input:not(:focus),
.asimov-form .number-row input:not(:focus),
.asimov-form .text-row input:not(:focus) {
  border-color: transparent;
}

.asimov-form .textarea-row textarea,
.asimov-form .select-row select,
.asimov-form .url-row input,
.asimov-form .date-row input,
.asimov-form .datetime-select-row input,
.asimov-form .number-row input,
.asimov-form .text-row input {
  background-color: var(--background-7);
}

.asimov-form .formative-row .input-shell > [type=date]:focus,
.asimov-form .formative-row .input-shell > select:focus {
  border-color: var(--form-element-active-border-color);
}

.asimov-form .formative-row .input-shell > [type=date],
.asimov-form .formative-row .input-shell > select {
  max-width: unset;
}

.asimov-form .formative-row .input-shell > .note {
  color: var(--color-2);
  font-size: 0.6rem;
  font-style: italic;
}

.asimov-form .table-row {
  overflow-x: auto;
}

.asimov-form .dynamic-table-row .row-popup,
.asimov-form .table-row .row-popup {
  font-size: 1rem;
  line-height: 1.5rem;
  text-align: center;
}

.asimov-form .th {
  padding: 0rem 0.5rem;
  margin: 0;
  border-bottom: none;
  font-size: 0.6rem;
}

.asimov-form .td {
  padding: 0;
  margin: 0;
  border-bottom: none;
  font-size: 0.6rem;
}

.asimov-form input:not([type=checkbox],[type=radio]),
.asimov-form textarea {
  font-size: 0.6rem;
  color: var(--color-1);
  width: 100%;
  margin: 0;
}

.asimov-form textarea {
  resize: vertical;
  height: 3rem;
}

.asimov-form select {
  width: 100%;
  margin: 0;
}

.asimov-form article select,
.asimov-form article input:not([type=checkbox],[type=radio]),
.asimov-form article textarea {
  width: unset;
  margin-bottom: 0.25rem;
  margin-right: 0.25rem;
}

.asimov-form .trend svg {
  height: 100%;
  width: 100%;
  max-height: 15rem;
}

.asimov-form .link-row,
.asimov-form .link-post-row {
  font-size: 0.7rem;
}

.asimov-form .info-row .td {
  border: 1px solid var(--border-color);
  border-radius: 0.25rem;
  font-size: 0.5rem;
  padding: 0.25rem;
  color: var(--color-1);
}

.asimov-form .gauge {
  position: relative;
  width: 5rem;
}

.asimov-form .gauge .gauge-value {
  display: block;
  position: absolute;
  top: 2rem;
  left: 0;
  width: 100%;
  text-align: center;
  font-family: var(--font-family-fixed);
  font-size: 0.9rem;
}

.asimov-form .carbon-form {
  position: relative;
}

.asimov-form .carbon-form.popout {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100vw;
  background: var(--color-bg2);
  padding: 1rem;
  border: 0.1rem solid var(--color-border2);
  z-index: 10;
  overflow: auto;
}

.asimov-form .carbon-form .pop-button {
  position: absolute;
  top: -0.8rem;
  right: 0;
}

.asimov-form .carbon-form.popout .pop-button {
  top: 0.5rem;
  right: 1rem;
}

.asimov-form .carbon-form table input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]),
.asimov-form .carbon-form table select {
  font-size: 0.8rem;
  padding: 0.25rem;
  height: 1.8rem;
  margin-bottom: 0.25rem;
}

.asimov-form .carbon-form table {
  border-collapse: collapse;
}

.asimov-form .carbon-form table th {
  /* width: 7.5rem; */
}

.asimov-form .carbon-form table td {
  padding: 0;
}

.asimov-form .attachments-form {
  font-size: 0.6rem;
  display: flex;
  flex-direction: column;
}

.asimov-form .attachments-form .header  {
  color: var(--color-2);
  margin: 0 0.5rem;
}

.asimov-form .attachments-form .body {
  position: relative;
  display: flex;
  /* background: var(--background-color-7); */
  border-radius: 0.25rem;
}

.asimov-form .attachments-form .body .attachment-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 2rem;
  padding: 0.25rem;
}

.asimov-form .attachments-form .body:has(.file-input) .attachment-list {
  margin-right: 4rem;
}

.asimov-form .attachments-form .attachment-item {
  display: flex;
  background: var(--background-color);
  padding: 0 0.5rem;
  margin: 0.1rem;
}

.asimov-form .attachments-form .attachment-item .file-name {
  /* flex: 1; */
  font-size: 0.5rem;
  line-height: 1rem;
  color: var(--color-1);
  margin: 0 0.5rem 0 0;
  padding: 0;
}

.asimov-form .attachments-form .attachment-item .file-btns {
  display: flex;
  margin: 0;
  padding: 0;
}

.asimov-form .attachments-form .attachment-item .icon-button {
  height: 1rem;
  width: 1rem;
}

.asimov-form .attachments-form .attachment-item .icon-button svg {
  height: 0.5rem;
}

.asimov-form .attachments-form .file-input {
  position: absolute;
  top: 50%;
  right: 0.25rem;
  transform: translateY(-50%);
}


.asimov-form .markdown-content {
  /* border: 1px solid var(--border-color); */
  padding: 0.5rem 0.5rem;
  margin-bottom: 0.5rem;
  border-radius: var(--border-radius);
}

.asimov-form .clojure-form,
.asimov-form .markdown-form {
  /* margin-bottom: 0.5rem; */
  border-radius: var(--border-radius);
}

.asimov-form .table-row table {
  margin-bottom: 0;
}

.asimov-form .table-row th {
  /* font-size: 1rem; */
  font-size: 0.6rem;
}

.asimov-form .table-row td select,
.asimov-form .table-row td input {
  margin-bottom: 0;
}

.asimov-form .table-row td pre.plain {
  background: none;
  color: var(--color-1);
  font-size: 0.6rem;
  text-wrap: auto;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 20rem;
}

.asimov-form .table-row td span.rich span.head {
  color: var(--color-2);
}

.asimov-form .table-row td span.rich span.body {
  color: var(--color-1);
}

.asimov-form .toolbar-row [role=button] {
  margin: 0.1rem 0.3rem;
  vertical-align: bottom;
}

.asimov-form .toolbar-row .icon-button {
  margin: 0.1rem 0.3rem;
  font-size: 1rem;
  line-height: 1.5rem;
  text-align: center;
}

.asimov-form .table-row table:not(.popup-table) th.popup-table-only,
.asimov-form .table-row table:not(.popup-table) td.popup-table-only {
  display: none;
}

/* Timeine chart */

.asimov-form .timeline {
  position: relative;
  padding: 0.5rem 0;
}

.asimov-form .timeline .timeline-title {
  color: var(--color-orange);
  margin-bottom: 0;
}

.asimov-form .timeline .timeline-chart {
  min-height: 10rem;
  width: 100%;
  margin-top: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.25rem;
}

.asimov-form .timeline .timeline-x-range {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 10rem;
}

.asimov-form .text-label {
  font-weight: bold;
  width: fit-content;
  border-radius: 0.6rem;
  color: white;
  border: 1px solid var(--color-silver);
  padding: 0 1rem;
  background: none;
}

.asimov-form .url-preview {
  position: relative;
  font-size: 0.7rem;
}

.asimov-form .url-preview:not(:hover) .thumbnail {
  display: none;
}

.asimov-form .url-preview .thumbnail {
  position: absolute;
  top: 50%;
  left: -0.5rem;
  transform: translate(-100%,-50%);
  background: #333;
  padding: 0.5rem;
  width: 10rem;
}

.asimov-form .url-preview .thumbnail img {}

/* Checklist progress */

.asimov-form .item-checklist {
  font-size: 0.6rem;
}

.asimov-form .item-checklist > * {
  margin-top: 0.25rem;
}

.asimov-form .item-checklist .overall {
  display: flex;
  flex-wrap: wrap;
}

.asimov-form .item-checklist .info {
  margin-left: 1rem;
}

.asimov-form .item-checklist .info:first-child {
  margin-left: auto;
}

.asimov-form .item-checklist .overall .info .label {
  padding: 0 0.2rem 0 0;
}

.asimov-form .item-checklist .overall .info .label::after {
  content: ":"
}

.asimov-form .item-checklist .overall .info .value {
  padding: 0;
  color: var(--color-green);
}

.asimov-form .item-checklist .overall .info .value.failed {
  color: var(--color-red);
}

.asimov-form .item-checklist .overall .info .value.pending {
  color: var(--color-orange);
}

.asimov-form .item-checklist .progress-bar {
  position: relative;
  height: 1rem;
  margin: 0.5rem 0;
  background: var(--background-color-2);
  border-radius: var(--border-radius);
}

.asimov-form .item-checklist .progress-bar.complete {
  background: var(--color-green);
  opacity: 40%;
}

.asimov-form .item-checklist .progress-bar .bar {
  position: absolute;
  left: 0;
  background: var(--color-orange);
  height: 100%;
  min-width: 0.25rem;
  border-radius: inherit;
}

.asimov-form .item-checklist .task {
  position: relative;
  display: flex;
  padding: 0.5rem 0.25rem 0.5rem 2rem;
  color: var(--color-1);
}

.asimov-form .item-checklist .task .status {
  margin: 0;
  width: 1rem;
  height: 1rem;
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  border-radius: 50%;
  background-color: var(--background-6);
  z-index: 1;
}

.asimov-form .item-checklist .task .status.complete {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-line-join='round' %3E%3Cpath d='M20 6 9 17l-5-5'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.asimov-form .item-checklist .task .status.failed {
  background-color: var(--color-red);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-line-join='round' %3E%3Cpath d='M6 6 19 19 M6 19 19 6'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.asimov-form .item-checklist .task .status[aria-busy=true] {
  padding-top: 0.12rem;
}

.asimov-form .item-checklist .task:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 1rem;
  top: 50%;
  height: 100%;
  border-left: 1px dashed var(--color-3);
}

.asimov-form .item-checklist .task .title {
  flex: 1;
  margin-left: 0.8rem;
  line-height: 1rem;
}

.asimov-form .item-checklist .task .title div {
  font-size: 0.8em;
  color: var(--color-2);
}

.asimov-form .item-checklist .task .time {
  color: var(--color);
  opacity: 40%;
}

.asimov-form .flashGreen {
  animation-duration: 1s;
  animation-name: flashGreen;
}

@keyframes flashGreen {
  from {
    box-shadow: 0 0 0.5rem 0.5rem var(--color-green);
  }

  to {}
}

.asimov-form .attachments-input {
  background-image: url('/lib_asimov-form/attachments.svg');
  background-repeat: no-repeat;
  background-position: 0.5rem;
  background-size: 0.7rem;
  padding-left: 1.5rem;
  cursor: pointer;
}

.attachments-dialog {}

.attachments-dialog .file-list {
  padding: 0.5rem;
  margin-bottom: 0;
}

.attachments-dialog .file-list .file {
  display: flex;
  padding: 0.125rem;
  border-bottom: 1px solid var(--border-color);
  justify-content: space-between;
}

.attachments-dialog .file-list .remove {
  color: var(--asv-color-red);
  cursor: pointer;
  padding: 0 0.25rem;
  margin-left: 0.5rem;
  border-radius: 0.2rem;
  line-height: 1rem;
  font-weight: 700;
}

.attachments-dialog .file-list .remove:hover {
  background: var(--asv-color-red);
  color: white;
}

.attachments-dialog [role=button] {
  margin: 0 0.25rem;
  width: 6rem;
}


.asimov-form .tool-picker-input,
.asimov-form .project-selector-input,
.asimov-form .item-selector-input {
  background-image: url('/lib_asimov-form/item-selector.svg');
  background-repeat: no-repeat;
  background-position: 0.5rem;
  background-size: 0.7rem;
  padding-left: 1.5rem;
  cursor: pointer;
}

.asimov-form .project-selector:has(.control) .picker-body,
.asimov-form .item-selector:has(.control) .picker-body {
  display: none;
}

.asimov-form .project-selector article,
.asimov-form .item-selector article {
  margin-top: 0;
}

.asimov-form .project-selector:not(.can-create) .create-button,
.asimov-form .item-selector:not(.can-create) .create-button {
  display: none;
}

.asimov-form .transcription {
  position: relative;
}

.asimov-form .transcription .microphone {
  display: flex;
  position: absolute;
  width: fit-content;
  right: 1rem;
  bottom: 0;
  user-select: none;
}

.asimov-form .transcription .microphone * {
  user-select: none;
}

.asimov-form .transcription .microphone .message {
  /* font-size: 0.8em; */
  /* height: 1.3rem; */
  padding: 0.25rem 0.5rem;
  border-radius: var(--border-radius);
  background: #633;
}

.asimov-form .transcription .microphone .message:not(.shown) {
  display: none;
}

.asimov-form .transcription:has(.microphone) input {
  padding-right: 3.5rem!important;
}

.asimov-form .transcription:has(input) .microphone {
  bottom: 0;
}

.asimov-form .transcription:has(.microphone) textarea {
  padding-right: 2.5rem!important;
}

.asimov-form .transcription:has(textarea) .microphone {
  bottom: 0.25rem;
}

.asimov-form .transcription .microphone .icon-button[aria-busy='true'] {
  padding: 0.25rem 0.4rem;
}

.asimov-form .transcription .microphone .icon-button[aria-busy='true'] svg {
  display: none;
}

.asimov-form .icon-button.faicon {
  font-size: 0.8rem;
  line-height: 1.5rem;
  text-align: center;
}

.asimov-form .picker-row {
  display: flex;
}

.asimov-form .open-link.icon-button[href='#'] {
  display: none;
}

/* really small screen like iPhone */

@media screen and (max-width:400px) {
  .asimov-form .formative-section {
    padding: 0.25rem;
    margin: 0 0 0.25rem 0;
  }

  .asimov-form .formative-section .formative-row {
    width: calc(100% - 0.5rem);
  }

  .asimov-form .formative-row:not(.heading-row) {
    padding: 0.25rem 0.5rem;
    margin: 0.25rem;
  }

}
