/* The request chat (#/make): the chat on the left, the request card on the right (under the chat on a phone). */
.make { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 430px); }
.mk-chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.mk-head { display: flex; gap: 8px; align-items: flex-start; padding: 10px 20px 0; }
.mk-head .btn.small, .mk-card .btn.small, .mk-made .btn.small { padding: 4px 10px; font-size: 13px; }
.mk-to-card { display: none; margin-left: auto; }
.mk-earlier { position: relative; }
.mk-earlier > summary { list-style: none; display: inline-block; }
.mk-earlier > summary::-webkit-details-marker { display: none; }
.mk-earlier-list { position: absolute; z-index: 15; top: calc(100% + 4px); left: 0; width: min(360px, 82vw); max-height: 60vh; overflow-y: auto;
  padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); display: grid; gap: 2px; }
.mk-earlier-row { display: flex; align-items: center; gap: 4px; }
.mk-earlier-row a { flex: 1; min-width: 0; display: grid; padding: 6px 8px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.mk-earlier-row a:hover, .mk-earlier-row a.on { background: var(--soft); }
.mk-earlier-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mk-hero h1 { font-size: 30px; }
.mk-hero p { max-width: 520px; margin: 8px auto 0; }
.mk-says { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 85%; }
.mk-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.mk-quick .btn { border-radius: 99px; border-color: var(--brand); color: var(--brand); background: transparent; }
.mk-quick .btn:hover:not(:disabled) { background: var(--soft); }
.mk-notice { border: 1px solid var(--line); border-left: 4px solid var(--accent); background: var(--panel); border-radius: 10px; padding: 10px 14px; }
.mk-pending .chip { padding: 3px 6px 3px 10px; }
.mk-chip-use { font: inherit; font-size: 12px; color: inherit; border: 0; background: transparent; max-width: 170px; }
.mk-composer .composer-actions { flex-wrap: wrap; justify-content: flex-end; }
.mk-composer .box textarea { flex: 1; min-width: 0; width: auto; }
.mk-composer .mk-target { width: auto; max-width: 180px; background: transparent; }

/* a request that was started: how it is going, then the result */
.mk-made { border: 1px solid var(--line); background: var(--panel); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); display: grid; gap: 8px; }
.mk-made p { margin: 0; }
.mk-state { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.mk-state .thinking { margin: 0; color: var(--ink); }
.mk-state.ok { color: var(--ok); }
.mk-state.bad { color: var(--danger); }
.mk-results { display: flex; flex-wrap: wrap; gap: 12px; }
.mk-result { margin: 0; display: grid; gap: 6px; max-width: min(100%, 320px); }
.mk-result img, .mk-result video { display: block; max-width: 100%; max-height: 420px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.mk-result figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mk-result figcaption .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-result .btn { text-decoration: none; color: var(--ink); flex: none; }
.mk-made .actions .btn { text-decoration: none; }
.mk-made .actions a.btn { color: var(--ink); }
.mk-report > summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.mk-report .md { margin-top: 6px; font-size: 14px; }

/* the request card */
.mk-card { border-left: 1px solid var(--line); background: var(--panel); overflow-y: auto; padding: 18px 18px 28px; }
.mk-card h2 { font-size: 17px; }
.mk-summary { margin: 6px 0 2px; font-weight: 600; }
.mk-intro { margin: 0 0 6px; }
.mk-row { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 4px 10px; padding: 8px 0; border-top: 1px solid var(--line); align-items: start; }
.mk-label { color: var(--muted); font-size: 13px; padding-top: 6px; }
.mk-value { display: grid; gap: 6px; min-width: 0; }
.mk-input, .mk-card input[type=text].mk-input { font: inherit; color: inherit; width: 100%; border: 1px solid transparent; background: var(--soft); border-radius: 8px; padding: 5px 8px; resize: none; }
textarea.mk-input { display: block; overflow-y: auto; }
select.mk-input { cursor: pointer; }
.mk-input:hover:not(:disabled) { border-color: var(--line); }
.mk-input:focus { outline: 2px solid var(--brand); outline-offset: 0; background: var(--panel); }
.mk-input:disabled { opacity: 1; color: var(--ink); background: transparent; cursor: default; -webkit-text-fill-color: var(--ink); }
.mk-input[hidden] { display: none; }
select.mk-input:disabled { appearance: none; -webkit-appearance: none; }
.mk-plain { padding: 6px 8px; }
.mk-checks { display: grid; gap: 2px; }
.mk-check { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.mk-seconds { display: flex; align-items: center; gap: 8px; }
.mk-seconds .mk-input { width: 80px; }
.mk-problem { color: var(--danger); font-size: 13px; }
.mk-problem:empty { display: none; }
.mk-refs { display: grid; gap: 8px; }
.mk-refs:empty { display: none; }
.mk-ref { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.mk-ref img, .mk-ref-file { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--soft); display: grid; place-items: center; color: var(--muted); }
.mk-ref-body { display: grid; gap: 4px; min-width: 0; }
.mk-ref-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-more { border-top: 1px solid var(--line); padding-top: 8px; }
.mk-more > summary { cursor: pointer; color: var(--muted); font-size: 13px; padding-bottom: 8px; }
.mk-foot { position: sticky; bottom: -28px; background: var(--panel); border-top: 1px solid var(--line); padding: 12px 0 16px; margin-top: 4px; display: grid; gap: 4px; }
.mk-make { width: 100%; padding: 10px 14px; font-size: 16px; }
.mk-foot .error:empty { display: none; }

@media (max-width: 900px) {
  .make { display: block; overflow-y: auto; }
  .mk-chat { display: block; }
  .mk-thread { overflow: visible; padding-top: 14px; }
  .mk-head { padding: 10px 14px 0; flex-wrap: wrap; }
  .mk-to-card { display: inline-block; }
  .mk-card { border-left: 0; border-top: 1px solid var(--line); overflow: visible; padding: 16px 14px 24px; }
  .mk-foot { bottom: 0; }
  .mk-hero { padding-top: 4vh; }
  .mk-says { max-width: 100%; }
}
