/* Compact project rows in chat. Photo-card CSS stays on .zimla-ai-sandbox__room-card. */

/* Shared answer typography: streamed blocks and saved conversations. */
html .zimla-chat-run__answer .zimla-ai-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: .65rem;
  margin-block: .6rem;
}
html .zimla-chat-run__answer .zimla-ai-card {
  min-width: 0;
  margin-block: .65rem;
  padding: .9rem;
  border: 1px solid #dbe5df;
  border-radius: .8rem;
  background: #fbfdfb;
  box-shadow: none;
  overflow-wrap: anywhere;
}
html .zimla-chat-run__answer .zimla-ai-cards > .zimla-ai-card { margin: 0; }
html .zimla-chat-run__answer .zimla-ai-card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .4rem .75rem;
}
html .zimla-chat-run__answer .zimla-ai-card__title {
  flex: 1 1 9rem;
  margin: 0;
  color: #263d32;
  font-size: 1em;
  font-weight: 500;
  line-height: 1.45;
}
html .zimla-chat-run__answer .zimla-ai-card__meta {
  margin: .25rem 0 .65rem;
  color: #52685c;
  font-size: .88em;
}
html .zimla-chat-run__answer .zimla-ai-card__amount {
  margin: .6rem 0;
  font-size: 1.25em;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
html .zimla-chat-run__answer .zimla-ai-card__facts { margin-top: .6rem; }
html .zimla-chat-run__answer .zimla-ai-card__fact {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: .25rem .75rem;
  padding-block: .45rem;
  border-top: 1px solid #e7eee9;
  font-variant-numeric: tabular-nums;
}
html .zimla-chat-run__answer .zimla-ai-card__fact small { font-size: .9em; color: #52685c; }
html .zimla-chat-run__answer .zimla-ai-card__fact > span { margin-inline-start: auto; text-align: right; }
html .zimla-chat-run__answer .zimla-ai-badge {
  display: inline-flex;
  max-width: 100%;
  padding: .18rem .5rem;
  border-radius: .4rem;
  background: #edf1ee;
  color: #52685c;
  font-size: .8em;
  font-weight: 400;
  line-height: 1.4;
}
html .zimla-chat-run__answer .zimla-ai-badge--success { background: #e4f2e9; color: #236346; }
html .zimla-chat-run__answer .zimla-ai-badge--pending { background: #f8efd9; color: #7a571e; }
html .zimla-chat-run__answer .zimla-ai-card__link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  margin-top: .3rem;
  font-weight: 400;
}

.zimla-chat-run__answer,
.zimla-chat-run__answer .zimla-ai-message__bubble,
.zimla-chat-run__answer [data-chat-message-blocks],
.zimla-chat-run__answer [data-chat-message-block] {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.zimla-chat-run__answer :is(h3, h4) {
  margin: .85rem 0 .35rem;
  font-size: 1em;
  font-weight: 500;
  line-height: 1.4;
}
.zimla-chat-run__answer :is(h3, h4):first-child { margin-top: 0; }
html .zimla-chat-run__answer :is(ul, ol) {
  margin-block: .4rem .85rem;
  padding-inline-start: 1.3em;
}
html .zimla-chat-run__answer ul { list-style: disc outside; }
html .zimla-chat-run__answer ol { list-style: decimal outside; }
html .zimla-chat-run__answer li { padding-inline-start: .2rem; line-height: 1.6; }
html .zimla-chat-run__answer li + li { margin-top: .35rem; }
html .zimla-chat-run__answer li::marker { color: #668477; }
html .zimla-chat-run__answer :is(ul, ol) + p { margin-top: .75rem; }
html .zimla-chat-run__answer :is(h3, h4) {
  margin-block: 1rem .4rem;
  font-size: 1em;
  font-weight: 500;
  color: #263d32;
}
.zimla-chat-run__answer blockquote {
  margin: .5rem 0;
  padding: .25rem .75rem;
  border-inline-start: 2px solid #bed4c7;
  color: #52685c;
}
.zimla-chat-run__answer a {
  color: #087858;
  text-decoration: underline;
  text-underline-offset: .15em;
  overflow-wrap: anywhere;
}
/* I tabeller: bryt inte mitt i ord (anywhere krymper kolumnen under ordets bredd). */
.zimla-chat-run__answer :is(td, th) a { overflow-wrap: break-word; }
.zimla-chat-run__answer code {
  padding: .1em .3em;
  border-radius: .25rem;
  background: #edf3ef;
  font-size: .9em;
}
.zimla-chat-run__answer pre {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre;
  padding: .65rem .75rem;
  border: 1px solid #dbe5df;
  border-radius: .65rem;
  background: #f6faf7;
  line-height: 1.5;
  tab-size: 2;
}
.zimla-chat-run__answer pre code { padding: 0; background: none; }
/* Tabeller i svaret: Zimlas radlista (samma ton som Offert- och rumsraderna) – vit yta, grå versalrubrik,
   jämna rader, namnet i första kolumnen bär länken. Sidledes scroll får kantskugga och fast första kolumn. */
html .zimla-chat-run__answer .zimla-ai-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  margin: .55rem 0 .75rem;
  border: 1px solid #e3e8e2;
  border-radius: .65rem;
  background:
    linear-gradient(to left, #fff 30%, rgba(255, 255, 255, 0)) right / 2rem 100% local no-repeat,
    radial-gradient(farthest-side at 100% 50%, rgba(23, 33, 26, .24), transparent) right / 1rem 100% scroll no-repeat,
    #fff;
  overscroll-behavior-x: contain;
  container-type: inline-size;
}
html .zimla-chat-run__answer table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  text-align: left;
  color: #35493d;
}
html .zimla-chat-run__answer table :is(th, td) {
  padding: .45rem .65rem;
  border-bottom: 1px solid #eef1ec;
  min-width: 0;
  max-width: 24rem;
  vertical-align: middle;
  font-weight: 400;
  overflow-wrap: normal;
  word-break: normal;
}
html .zimla-chat-run__answer table th {
  padding-block: .55rem .45rem;
  border-bottom-color: #e3e8e2;
  background: transparent;
  color: #6b7a70;
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: .06em;
  text-transform: uppercase;
}
/* Bredden går till namnkolumnen; tal- och statuskolumner tar bara vad de behöver. */
html .zimla-chat-run__answer table :is(th, td):first-child:not([align="right"]) { min-width: 7.5rem; }
html .zimla-chat-run__answer table :is(th, td):first-child { position: sticky; left: 0; z-index: 1; background: #fff; }
html .zimla-chat-run__answer table td:first-child { color: #17211a; }
html .zimla-chat-run__answer table [align="right"],
html .zimla-chat-run__answer table [align="center"] { width: 1%; white-space: nowrap; }
html .zimla-chat-run__answer table [align="right"] { text-align: right; }
html .zimla-chat-run__answer table [align="center"] { text-align: center; }
html .zimla-chat-run__answer table [align="right"] + [align="left"] { padding-inline-start: 1rem; }
/* Korta värden hålls på en rad bara när tabellen har plats; i smal panel får de brytas så inget göms bakom sidscroll. */
@container (min-width: 34rem) { html .zimla-chat-run__answer table :is(th, .is-short) { white-space: nowrap; } }
@container (max-width: 26rem) { html .zimla-chat-run__answer table :is(th, td):first-child:not([align="right"]) { min-width: 6rem; } }
html .zimla-chat-run__answer table .is-empty { color: #a3b0a7; }
html .zimla-chat-run__answer table :is(strong, b) { font-weight: 500; }
html .zimla-chat-run__answer table tr:last-child td { border-bottom: 0; }
/* Namnet är vägen in: grönt och understruket så det syns att det går att klicka. */
html .zimla-chat-run__answer table a {
  color: #1f6b52;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: #bed4c7;
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
}
@media (hover: hover) {
  html .zimla-chat-run__answer table a:hover { color: #0d5a42; text-decoration-color: currentColor; }
  html .zimla-chat-run__answer table tr:has(a):hover td { background: #fbfcfb; }
}
/* Touch: ingen hover som visar att namnet är en länk – understruken, och tumvänlig höjd. */
@media (hover: none), (pointer: coarse) {
  html .zimla-chat-run__answer table a { display: block; padding-block: .6rem; text-decoration: underline; text-decoration-color: #bed4c7; text-underline-offset: .2em; }
  html .zimla-chat-run__answer table td:has(a) { padding-block: 0; }
}
@media (max-width: 639px) {
  html .zimla-chat-run__answer table :is(th, td) { padding-inline: .5rem; }
}
.zimla-chat-run__answer :is(a, pre, .zimla-ai-table-scroll):focus-visible {
  outline: 2px solid #087c60;
  outline-offset: 2px;
}

[data-chat-clarification] { min-width: 0; overflow-wrap: anywhere; }
[data-chat-clarification] .zimla-ai-message__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
[data-chat-clarification] button {
  min-height: 2.75rem;
  white-space: normal;
  max-width: 100%;
  font-weight: 400;
}
[data-chat-clarification-form] {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .6rem;
}
[data-chat-clarification-form] input {
  flex: 1 1 10rem;
  min-width: 0;
  min-height: 2.75rem;
  max-width: 100%;
  padding: .5rem .65rem;
  border: 1px solid #dbe5df;
  border-radius: .65rem;
  background: #fff;
  color: inherit;
  font: inherit;
}
[data-chat-clarification] :is(button, input):focus-visible {
  outline: 2px solid #087c60;
  outline-offset: 2px;
}


.zimla-ai-sandbox--thread .zimla-ai-sandbox__catalog {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: visible;
  list-style: none;
}

.zimla-ai-sandbox--thread .zimla-ai-sandbox__catalog > li {
  flex: none;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.zimla-ai-sandbox--thread .zimla-ai-sandbox__catalog .zimla-ai-sandbox__bone {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  box-sizing: border-box;
  width: 100%;
  min-height: 2.75rem;
  gap: 0.2rem 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #e7eee9;
  border-radius: 0.9rem;
  background: #fff;
  text-align: left;
  color: inherit;
}

.zimla-ai-sandbox--thread .zimla-ai-sandbox__catalog .zimla-ai-sandbox__bone:hover {
  background: #fbfcf8;
}

.zimla-ai-sandbox--thread .zimla-ai-sandbox__bone-name {
  overflow: hidden;
  color: #17211a;
  font-size: 0.88rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zimla-ai-sandbox--thread .zimla-ai-sandbox__bone-calc {
  color: #6b776f;
  font-size: 0.72rem;
  font-weight: 500;
  text-align: right;
}

.zimla-ai-sandbox--thread .zimla-ai-sandbox__bone-calc.is-ready {
  color: #2d7a3a;
}

.zimla-ai-sandbox--thread .zimla-ai-sandbox__bone-place,
.zimla-ai-sandbox--thread .zimla-ai-sandbox__bone-rooms {
  overflow: hidden;
  grid-column: 1 / -1;
  color: #6b776f;
  font-size: 0.7rem;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zimla-ai-sandbox--thread .zimla-ai-sandbox__catalog .zimla-ai-sandbox__room-works {
  display: none;
}

.zimla-ai-sandbox--thread .zimla-ai-sandbox__room-card {
  display: flex;
  width: 100%;
  min-height: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #e7eee9;
  border-radius: var(--zimla-room-card-radius);
  background: #fff;
  box-shadow: 0 1px 3px #203d310f;
  text-align: left;
}

.zimla-ai-sandbox--thread [data-room-id].is-selected .zimla-ai-sandbox__room-card {
  border-color: #b7dcc8;
  box-shadow: 0 0 0 1px #b7dcc8;
  background: #fff;
}

.zimla-ai-sandbox--thread .zimla-ai-sandbox__room-card .zimla-ai-sandbox__room-thumb {
  display: flex;
  width: 100%;
  height: var(--zimla-room-photo);
  align-items: center;
  justify-content: center;
  border-radius: 0;
  background: #eaf6ef;
}

.zimla-ai-sandbox--thread .zimla-ai-sandbox__room-card .zimla-ai-sandbox__room-icon {
  font-size: 1.45rem;
}

.zimla-ai-sandbox--thread .zimla-ai-sandbox__room-card .zimla-ai-sandbox__room-copy {
  flex-direction: column;
  align-items: stretch;
  gap: 0.12rem;
  padding: var(--zimla-room-card-pad);
}

.zimla-ai-sandbox--thread .zimla-ai-sandbox__room-card .zimla-ai-sandbox__room-copy > strong {
  overflow: hidden;
  max-width: 100%;
  color: #17211a;
  font-size: var(--zimla-room-name);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 1024px) {
  .zimla-ai-sandbox--thread .zimla-ai-sandbox__room-card:hover {
    background: #fbfcf8;
  }
}

@media (max-width: 1023px) {
  .zimla-ai-sandbox--thread .zimla-ai-sandbox__rooms,
  html.zimla-ai-start-workplace .zimla-ai-sandbox--thread .zimla-ai-sandbox__rooms {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
  }

  .zimla-ai-sandbox--thread .zimla-ai-sandbox__room-card,
  .zimla-ai-sandbox--thread .zimla-ai-sandbox__room-row {
    flex-direction: row;
    align-items: center;
    min-height: 3.4rem;
    gap: 0.5rem;
  }

  .zimla-ai-sandbox--thread .zimla-ai-sandbox__room-card .zimla-ai-sandbox__room-thumb {
    width: 3.4rem;
    height: 3.4rem;
    flex: none;
    border-radius: 0.7rem;
  }

  .zimla-ai-sandbox--thread .zimla-ai-sandbox__room-card .zimla-ai-sandbox__room-copy {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.2rem 0.55rem 0.2rem 0;
  }

  .zimla-ai-sandbox--thread .zimla-ai-sandbox__room-card .zimla-ai-sandbox__room-foot {
    margin-top: 0.15rem;
  }
}

/* Outside Studio, a Studio conversation's results are one pointer, not cards. */
/* Panelen följer med mellan sidor; i Studio är resultaten redan på canvasen. */
html.zimla-ai-start .zimla-chat-studio-ref { display: none !important; }
.zimla-chat-studio-ref {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  margin: .35rem 0 0; padding: .55rem .75rem; border: 1px solid #dce7df; border-radius: .65rem;
  background: #f6faf7; color: #2a3e30; font-size: .78rem; text-decoration: none;
}
.zimla-chat-studio-ref > span:last-child { color: #087858; font-weight: 500; white-space: nowrap; }
.zimla-chat-studio-ref:hover { background: #edf5f0; }

/* Fleruppdrag: planen som en synlig checklista i svaret. Punkterna bockas av med en liten
   rörelse när AI:n är klar med dem; den pågående pulserar. */
.zimla-chat-plan { list-style: none; margin: 0 0 0.5rem; padding: 0.55rem 0.7rem; display: grid; gap: 0.3rem; border-radius: 12px; background: rgba(58, 136, 116, 0.06); border: 1px solid rgba(58, 136, 116, 0.14); }
.zimla-chat-plan li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 0.5rem; align-items: start; font-size: 0.82rem; line-height: 1.35; color: #35493d; transition: color 200ms ease; }
.zimla-chat-plan li > i { position: relative; width: 16px; height: 16px; margin-top: 1px; border-radius: 999px; border: 1.5px solid #9fb3a6; background: #fff; transition: background 220ms ease, border-color 220ms ease, transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.zimla-chat-plan li > i::after { content: ''; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1) 60ms; }
.zimla-chat-plan li[data-state="running"] { color: #17211a; font-weight: 500; }
.zimla-chat-plan li[data-state="running"] > i { border-color: #3a8874; animation: zimla-plan-pulse 1.2s ease-in-out infinite; }
.zimla-chat-plan li[data-state="completed"] { color: #6b7a70; }
.zimla-chat-plan li[data-state="completed"] > i { background: #3a8874; border-color: #3a8874; transform: scale(1.05); }
.zimla-chat-plan li[data-state="completed"] > i::after { transform: rotate(45deg) scale(1); }
.zimla-chat-plan li[data-state="failed"] > i { background: #fdf2f2; border-color: #c0584a; }
.zimla-chat-plan li[data-state="failed"] > i::after { content: '!'; border: 0; transform: none; left: 0; top: -1px; width: 16px; text-align: center; color: #c0584a; font-size: 11px; font-weight: 700; line-height: 16px; }
.zimla-chat-plan li[data-state="cancelled"] { color: #9fb3a6; text-decoration: line-through; }
.zimla-chat-plan li[data-state="cancelled"] > i { border-style: dashed; }
@keyframes zimla-plan-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(58, 136, 116, 0.35); } 50% { box-shadow: 0 0 0 4px rgba(58, 136, 116, 0); } }
@media (prefers-reduced-motion: reduce) { .zimla-chat-plan li > i, .zimla-chat-plan li > i::after { transition: none; } .zimla-chat-plan li[data-state="running"] > i { animation: none; } }
.zimla-chat-plan:empty { display: none; }

/* Planen: metallisk kant i Zimlas grönt, lugn yta, bock i emerald. */
.zimla-chat-plan {
  gap: 0.28rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background:
    linear-gradient(180deg, #fcfdfc 0%, #f3f6f4 100%) padding-box,
    linear-gradient(135deg, rgba(8, 120, 88, 0.42) 0%, rgba(174, 186, 180, 0.55) 34%, rgba(255, 255, 255, 0.95) 52%, rgba(160, 174, 167, 0.55) 70%, rgba(8, 120, 88, 0.32) 100%) border-box;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(25, 28, 33, 0.04);
}
.zimla-chat-plan li { font-size: 0.8rem; }
.zimla-chat-plan li > span > small { display: block; margin-top: 1px; color: #7a867e; font-size: 0.72rem; font-weight: 400; line-height: 1.35; }
.zimla-chat-plan li[data-state="completed"] > i { background: #087858; border-color: #087858; }
.zimla-chat-plan li[data-state="running"] { color: #0d3f2f; }
.zimla-chat-plan li[data-state="running"] > i { border-color: #087858; }

/* Kalkylkortet: antaganden och öppna frågor som en hopfälld rad. */
.zimla-chat-result__checks { margin: 2px 8px 4px; font-size: 11px; color: #5f6d63; }
.zimla-chat-result__checks > summary { display: flex; align-items: center; gap: 4px; min-height: 28px; width: fit-content; cursor: pointer; list-style: none; color: #087858; }
.zimla-chat-result__checks > summary::-webkit-details-marker { display: none; }
.zimla-chat-result__checks > summary::after { content: ""; width: 5px; height: 5px; margin-top: -2px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.zimla-chat-result__checks[open] > summary::after { margin-top: 2px; transform: rotate(-135deg); }
.zimla-chat-result__checks ul { display: grid; gap: 3px; margin: 0 0 4px; padding: 0 0 0 14px; list-style: disc; line-height: 1.4; }
/* Raderna som leder någonstans (komplettera i rummet, momentlistan): kortets vanliga rader, utan punkter. */
.zimla-chat-result__checks ul:has(> li > a), .zimla-chat-result__fold ul { gap: 0; margin: 0 -8px 4px; padding: 0; list-style: none; }

/* Frågan: sist i bubblan, frågan störst, valen som riktiga chips. Eget svar i skrivfältet. */
.zimla-chat-result.zimla-chat-question { margin-top: 0.4rem; border-color: #cfe0d6; background: linear-gradient(180deg, #fbfdfc, #f5f9f6); }
.zimla-chat-question h3 { padding: 10px 12px 0; color: #17211a; font-size: 14px; font-weight: 500; line-height: 1.35; }
.zimla-chat-question > p { margin: 0; padding: 2px 12px 0; color: #6b776f; font-size: 12px; line-height: 1.4; }
.zimla-chat-question > p:empty { display: none; }
.zimla-chat-question__choices { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 12px; }
.zimla-chat-question__choice { display: inline-flex; align-items: center; min-height: 32px; max-width: 100%; padding: 4px 12px; border: 1px solid #c8dbcf; border-radius: 999px; background: #fff; color: #17372a; font-size: 13px; line-height: 1.25; text-align: left; overflow-wrap: anywhere; cursor: pointer; transition: border-color 150ms ease, background 150ms ease; }
.zimla-chat-question__choice:hover { border-color: #087858; background: #f0f7f3; }
.zimla-chat-question__choice:focus-visible { outline: 2px solid #087858; outline-offset: 2px; }
.zimla-chat-question__choice.is-quiet { border-color: transparent; background: transparent; color: #6b776f; font-size: 12px; }
@media (pointer: coarse) { .zimla-chat-question__choice { min-height: 44px; } }
.zimla-chat-question.is-answered { background: #fff; border-color: #e3ebe6; }
.zimla-chat-question.is-answered h3 { padding: 8px 12px 0; color: #6b776f; font-size: 12px; }
.zimla-chat-question.is-answered > p:not([data-chat-clarification-reply]),
.zimla-chat-question.is-answered .zimla-chat-question__choices { display: none; }
.zimla-chat-question__answer { margin: 0; padding: 2px 12px 8px; color: #17211a; font-size: 13px; }
.zimla-chat-question__answer::before { content: "✓ "; color: #087858; }

/* Frågan är det man gör nu (UX-packet 2026-10-08): kortets yta står kvar i panelens platta läge, frågan är
   rubriken, valen hör till frågan. Panelens regel tog bort ram och bakgrund – frågan undantas. */
html:not(.zimla-ai-start) .zimla-ai-panel .zimla-chat-result.zimla-chat-question { border: 1px solid #cfe0d6; border-radius: .65rem; background: linear-gradient(180deg, #fbfdfc, #f5f9f6); }
html:not(.zimla-ai-start) .zimla-ai-panel .zimla-chat-result.zimla-chat-question.is-answered { border-color: #e3ebe6; background: #fff; }
.zimla-chat-question:not(.is-answered) h3 { padding-top: 12px; font-size: 15px; }
.zimla-chat-question:not(.is-answered) > p:not([data-chat-clarification-reply]):not(.zimla-chat-question__error) { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.zimla-chat-question .zimla-chat-question__choice { min-height: 32px; }
.zimla-chat-question--measure .zimla-chat-question__choices { padding: 8px 12px 12px; }
.zimla-chat-question__measure { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px; padding: 10px 12px 0; }
.zimla-chat-question__field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.zimla-chat-question__room { color: #6b776f; font-size: 12px; overflow-wrap: anywhere; }
.zimla-chat-question__box { display: inline-flex; align-items: center; width: 132px; height: 36px; border: 1px solid #cddbd2; border-radius: .55rem; background: #fff; }
.zimla-chat-question__box:focus-within { border-color: #087858; box-shadow: 0 0 0 2px rgba(8, 120, 88, .15); }
.zimla-chat-question__box input { flex: 1; min-width: 0; height: 100%; padding: 0 0 0 10px; border: 0; background: transparent; color: #17211a; font-size: 14px; font-variant-numeric: tabular-nums; outline: none; }
.zimla-chat-question__box input::placeholder { color: #9aa49d; }
.zimla-chat-question__box em { padding: 0 8px 0 4px; color: #6b776f; font-size: 12px; font-style: normal; }
.zimla-chat-question .zimla-chat-question__submit { min-height: 36px; height: 36px; padding: 6px 12px; border: 0; border-radius: .55rem; background: #087858; color: #fff; font-size: 14px; font-weight: 400; cursor: pointer; transition: background 150ms ease, transform 120ms ease; }
.zimla-chat-question .zimla-chat-question__submit:disabled { background: #cfe0d6; cursor: default; }
.zimla-chat-question__submit:not(:disabled):active, .zimla-chat-question__choice:not(:disabled):active { transform: scale(.97); }
.zimla-chat-question .is-pending { opacity: .7; }
.zimla-chat-question__error { margin: 0; padding: 4px 12px 0; color: #9a3b2e; font-size: 12px; }
.zimla-chat-question__error[hidden] { display: none; }
.zimla-chat-question.is-answered .zimla-chat-question__measure,
.zimla-chat-question.is-answered .zimla-chat-question__error { display: none; }
.zimla-chat-question.is-answered .zimla-chat-question__answer { font-variant-numeric: tabular-nums; animation: zimla-question-settle 160ms ease-out; }
@keyframes zimla-question-settle { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) {
  .zimla-chat-question.is-answered .zimla-chat-question__answer { animation: none; }
  .zimla-chat-question__submit:active, .zimla-chat-question__choice:active { transform: none; }
}
@media (pointer: coarse) {
  .zimla-chat-question .zimla-chat-question__choice { min-height: 44px; }
  .zimla-chat-question__box, .zimla-chat-question .zimla-chat-question__submit { height: 44px; }
  .zimla-chat-question__box input { font-size: 16px; }
}
@media (max-width: 640px) {
  .zimla-chat-question__measure { flex-direction: column; align-items: stretch; }
  .zimla-chat-question__box { width: 100%; }
}

/* Rumsfrågan: rummen och våtrummen som val i frågan, ett per grupp; valt val fyllt. */
.zimla-chat-question__layout { display: flex; flex-wrap: wrap; gap: 6px; flex-basis: 100%; }
.zimla-chat-question__layout .zimla-chat-question__choice[aria-pressed="true"] { border-color: #087858; background: #087858; color: #fff; }
.zimla-chat-question--measure:has(.zimla-chat-question__layout) .zimla-chat-question__submit { margin-top: 2px; }
/* Tipset som eget kort efter frågan (ägaren 2026-10-08: "ett kort som lyfter UI"): frågans gröna yta, en lätt
   skugga för lyftet, exemplet i citat och luckorna ([yta]) markerade. Ingen knapp – exemplet gäller nästa gång. */
.zimla-chat-tip { margin: .5rem 0 .35rem; padding: 10px 12px; border: 1px solid #cfe0d6; border-radius: .65rem;
  background: linear-gradient(180deg, #fbfdfc, #f5f9f6); box-shadow: 0 1px 2px rgba(23, 33, 26, .05), 0 6px 16px rgba(8, 120, 88, .07);
  animation: zimla-tip-in 180ms ease-out both; }
.zimla-chat-tip p { margin: 0; }
.zimla-chat-tip__label { color: #087858; font-size: 12px; font-weight: 500; letter-spacing: .01em; }
.zimla-chat-tip__text { margin-top: 4px !important; color: #17211a; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.zimla-chat-tip__gap { padding: 0 4px; border-radius: 4px; background: #e2efe7; color: #0b5c45; font-size: 12px; white-space: nowrap; }
.zimla-chat-tip__note { margin-top: 6px !important; color: #6b776f; font-size: 12px; line-height: 1.4; }
@keyframes zimla-tip-in { from { opacity: 0; transform: translateY(6px); } }
.zimla-chat-run--history .zimla-chat-tip { animation: none; }
.zimla-chat-run--history .zimla-chat-question.is-answered .zimla-chat-question__answer { animation: none; }
/* "Det här ändrades" efter ett svar i måttfrågan: beloppen byts på plats och markeras en gång. */
[data-chat-changes].is-updated { animation: zimla-changes-updated 1.4s ease; }
@keyframes zimla-changes-updated { from { background-color: #e7f4ec; } to { background-color: transparent; } }
@media (prefers-reduced-motion: reduce) {
  .zimla-chat-tip, [data-chat-changes].is-updated { animation: none; }
}

/* Frågan ersätter planen medan den väntar; besvarad fortsätter planen i nästa svar. */
/* Frågan tar planens plats när den syns före svaret (placeClarification); en fråga efter svaret låter planen stå. */
.zimla-chat-run.is-asking .zimla-chat-plan { display: none; }
.zimla-chat-run > .zimla-ai-message__stack .zimla-chat-question,
.zimla-chat-result.zimla-chat-question { margin: 0 0 0.35rem; }
/* Resultatkortens listor i containern ärver inte loggradernas grid (en bokstav per rad). */
.zimla-chat-run__activity-history .zimla-chat-run__work-results ul { display: block; margin: 0; padding: 0; }
.zimla-chat-run__activity-history .zimla-chat-run__work-results li { display: block; }

/* En stoppad körning säger varför, bredvid "Försök igen" (raden visar orsaken i stället för tiden). */
.zimla-ai-message.zimla-chat-run.zimla-chat-run--answered:is([data-chat-state="failed"], [data-chat-state="cancelled"], [data-chat-state="interrupted"]) .zimla-chat-run__activity-history > summary .zimla-chat-run__activity-current { display: inline-flex !important; color: #9a3b2e; }
.zimla-ai-message.zimla-chat-run:is([data-chat-state="failed"], [data-chat-state="cancelled"], [data-chat-state="interrupted"]) .zimla-chat-run__activity-mark { display: none !important; }
.zimla-chat-run__stopped { margin: 0 0 0.35rem; color: #7a867e; font-size: 0.74rem; line-height: 1.4; }
.zimla-chat-run__actions--import { flex-wrap: wrap; }
.zimla-chat-run__actions--import button { flex-shrink: 0; white-space: nowrap; }
/* "Skapa offert" sist i svaret när Zimla är klar (zimla-chat-stream.js placeQuote). */
.zimla-chat-run__quote-end { display: block; margin: 14px 0 4px; }
/* Projektstudio-filmen (docs/product/projektstudio-film.md): kortet i Zimla AI. Bilden är en skärmbild av samma sida
   som inspelningen, 16:10 som filmens ram (dialogen växer ur den). Hela kortet är knappen. */
.zimla-film { display: grid; flex: 1 0 100%; gap: 8px; min-width: 0; }
.zimla-film__say { margin: 0; color: #17211a; font-size: 0.86rem; line-height: 1.45; }
.zimla-film__card { display: grid; gap: 8px; width: 100%; padding: 6px 6px 10px; border: 1px solid #d7e8de; border-radius: 0.6rem; background: #fff; font: inherit; text-align: left; cursor: pointer; }
.zimla-film__card:hover { background: #f6faf7; } .zimla-film__card:focus-visible { outline: 2px solid #0f7a4c; outline-offset: 2px; }
.zimla-film__card.is-loading { transform: scale(0.97); transition: transform 120ms ease-out; }
.zimla-film__thumb { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 10; border-radius: 0.45rem; background: #f9faf8; }
.zimla-film__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.zimla-film__play { position: absolute; right: 10px; bottom: 10px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #0f4a37; color: #fff; font-size: 22px; box-shadow: 0 8px 18px -10px rgb(15 74 55 / 60%); }
.zimla-film__txt { display: grid; gap: 2px; padding: 0 4px; } .zimla-film__txt b { color: #17211a; font-size: 13px; font-weight: 500; } .zimla-film__txt small { color: #6b7a70; font-size: 11.5px; line-height: 1.35; }
@media (max-width: 1023px) { .zimla-film-menu { display: none !important; } } /* filmen är ritad för dator */

/* Zimla AI:s svarskort (etapp 4.4; prototypens form, ägaren 2026-10-13, UX-packens syntes): svaret blir ett kort –
   rummen som rader [ikon | namn + yta · moment · nivå | offertens pris | ›], Ni betalar, modellens text som notis och
   "Se i offerten". DOM:en står kvar (kortet efter svarstexten, zimla-chat-stream.js räknar med det); ordningen är CSS:
   kortets delar blir bubblans egna (display: contents). Datorns täthet här; mobilen i zimla-offertlage-mobile.css. */
.zimla-ai-message__bubble:has(> .zcc) { display: flex !important; flex-direction: column; gap: 0; padding: 12px 14px 12px !important; border: 1px solid #e3e6e1 !important; border-radius: 12px !important; background: #fff !important; box-shadow: none !important; }
.zimla-ai-message__bubble:has(> .zcc) > .zcc { display: contents; }
.zimla-ai-message__bubble:has(> .zcc) > .zcc > :is(.zcc-list, .zcc-all, .zcc-more) { order: 1; }
.zimla-ai-message__bubble:has(> .zcc) > .zcc > .zcc-total { order: 2; }
.zimla-ai-message__bubble:has(> .zcc) > .zimla-chat-run__answer { order: 3; }
.zimla-ai-message__bubble:has(> .zcc) > .zcc > .zcc-go { order: 4; }
.zimla-ai-message__bubble:has(> .zcc) > .zcc ~ * { order: 5; }
/* Notisen: modellens text i en mjuk ruta – bara när det finns text. */
.zimla-ai-message__bubble:has(> .zcc) > .zimla-chat-run__answer:has(p, li, .zimla-chat-run__tail:not([hidden])) {
  padding: 8px 10px; border-radius: 10px; background: #f6f8f4; color: #3f4b43; font-size: 12.5px; line-height: 1.5; }
.zimla-ai-message__bubble:has(> .zcc) > .zimla-chat-run__answer:has(p, li, .zimla-chat-run__tail:not([hidden])),
.zimla-ai-message__bubble:has(> .zcc) > .zcc > .zcc-go { margin-top: 10px; }
.zimla-ai-message__bubble:has(> .zcc) > .zcc > .zcc-total { margin-top: 4px; }
.zimla-ai-message__bubble:has(> .zcc) > .zimla-chat-run__answer :is(p, li) { margin: 0 0 4px; font-size: inherit; line-height: inherit; color: inherit; }
.zimla-ai-message__bubble:has(> .zcc) > .zimla-chat-run__answer :is(p, li):last-child { margin-bottom: 0; }
.zcc ul { list-style: none; margin: 0; padding: 0; }
.zcc .zcc-list > li, .zcc .zcc-rooms > li { border: 0; border-top: 1px solid #eef0ec; }
.zcc .zcc-list > li:first-child { border-top: 0; }
.zcc .zcc-row > a, .zcc .zcc-row > details > summary, .zcc .zcc-row.zcc-other, .zcc .zcc-row.zcc-deleted {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto auto; align-items: center; column-gap: 10px;
  min-height: 44px; padding: 6px 0; color: #1d2420; font-size: 13px; line-height: 1.3; text-decoration: none; }
.zcc .zcc-row > a::after { content: none; }
.zcc .zcc-row > :is(.zcc-ic, .zcc-t, .zcc-kr) { padding: 0; }
.zcc .zcc-row > .zcc-ic { display: inline-flex; }
.zcc .zcc-row > a:hover { background: none; }
.zcc .zcc-row > a:hover .zcc-t b { color: #1f6b4f; }
.zcc .zcc-row > details > summary { list-style: none; cursor: pointer; }
.zcc .zcc-row > details > summary::-webkit-details-marker { display: none; }
.zcc-ic { width: 28px; height: 28px; border-radius: 8px; background: #e6f1ea; color: #1f6b4f; display: inline-flex; align-items: center; justify-content: center; }
.zcc-ic .material-symbols-outlined { font-size: 16px; }
.zcc-row.zcc-deleted .zcc-ic { background: #f1f3ef; color: #8a948d; }
.zcc-t { display: grid; min-width: 0; }
.zcc-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.zcc-t small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; color: #6b746d; font-size: 11.5px; }
.zcc-row.zcc-deleted .zcc-t b { color: #6b746d; text-decoration: line-through; }
.zcc-kr { display: grid; justify-items: end; font: 400 15px/1.2 Newsreader, Georgia, serif; color: #12382b; white-space: nowrap; font-variant-numeric: tabular-nums; }
.zcc-kr small { font: 400 10.5px/1.2 Inter, ui-sans-serif, system-ui, sans-serif; color: #8a948d; }
.zcc-chev { color: #9aa29c; font-size: 18px; transition: transform .15s; }
.zcc-row > details[open] .zcc-chev { transform: rotate(180deg); }
.zcc .zcc-rooms > li > a { display: block; padding: 8px 0 8px 38px; color: #1f6b4f; font-size: 12.5px; text-decoration: none; }
.zcc .zcc-rooms > li > a::after { content: none; }
.zcc-all > summary { min-height: 32px; display: flex; align-items: center; color: #087858; font-size: 12px; cursor: pointer; list-style: none; border-top: 1px solid #eef0ec; }
.zcc-all > summary::-webkit-details-marker { display: none; }
.zcc-more { margin: 0; color: #6b746d; font-size: 12px; }
.zcc-total { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 12px; padding-top: 10px; border-top: 1px solid #e3e6e1; }
.zcc-total-l { display: grid; min-width: 0; color: #4d5951; font-size: 12.5px; }
.zcc-total-l small { color: #8a948d; font-size: 11px; font-variant-numeric: tabular-nums; }
.zcc-total-kr { display: grid; justify-items: end; font: 500 20px/1.15 Newsreader, Georgia, serif; color: #12382b; white-space: nowrap; font-variant-numeric: tabular-nums; }
.zcc-total-kr small { font: 400 11px/1.3 Inter, ui-sans-serif, system-ui, sans-serif; color: #6b746d; }
.zcc-parts { grid-column: 1 / -1; margin: 3px 0 0; color: #6b746d; font-size: 11px; font-variant-numeric: tabular-nums; }
.zcc-parts > span { white-space: nowrap; }
.zcc-go { align-self: flex-start; display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; border-radius: 8px; background: #f1f3ef; color: #12382b; font-size: 12.5px; font-weight: 600; text-decoration: none; }
.zcc-go:hover { background: #e7ebe4; }
.zimla-ai-message__bubble .zcc a.zcc-go, .zimla-ai-message__bubble .zcc a.zcc-go:hover { color: #12382b; text-decoration: none; }
/* Bara det senaste kortet visar Ni betalar och knappen – ett äldre belopp vore inaktuellt efter nästa ändring. */
.zimla-chat-run:has(~ .zimla-chat-run .zcc-total) :is(.zcc-total, .zcc-go) { display: none; }
@media (max-width: 1023px), (pointer: coarse) {
  .zcc .zcc-row > a, .zcc .zcc-row > details > summary { min-height: 48px; }
  .zcc-go { min-height: 36px; }
}

/* "Eget moment tillagt · behöver granskas" visas inte (ägaren 2026-10-14): svarskortets rumsrad visar redan "Tillagt: …". */
:is([data-chat-results], [data-chat-work-results], .zimla-chat-results) > [data-chat-result-tool="calculation.add_moment"][data-chat-review-required="true"],
:is([data-chat-results], [data-chat-work-results], .zimla-chat-results) > [data-chat-fold="review"] { display: none !important; }

/* Receptets val i svaret (ai_recipe_choices.html, normbas/chat.py): platta rader som svarskortet, segment till höger.
   Valt alternativ är markerat; ett tryck blir väntande tills servern svarat. */
.zrc { margin-top: 10px; padding-top: 8px; border-top: 1px solid #eef0ec; font-size: 13px; color: #17372a; }
.zrc-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-bottom: 4px; }
/* Rubriken bryts hellre än klipps: "5 …" dolde antalet val när rumsnamnet var långt. */
.zrc-h b { min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
.zrc-kr { font: 400 15px/1.2 Newsreader, Georgia, serif; color: #12382b; white-space: nowrap; font-variant-numeric: tabular-nums; }
.zrc-list { list-style: none; margin: 0; padding: 0; }
.zrc-q { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; min-height: 38px;
  padding: 5px 0; border-top: 1px solid #eef0ec; }
.zrc-q:first-child { border-top: 0; }
.zrc-p { min-width: 0; flex: 1 1 10rem; overflow-wrap: anywhere; }
/* .zimla-chat-result li > * (app.css) gör radens delar till grid: raden är flex här. */
.zrc .zrc-q > .zrc-p { display: block; }
.zrc .zrc-q > .zrc-opts { display: inline-flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 4px; max-width: 100%; }
/* Ett långt alternativ bryts inom kortet (Fuktskydd på grundmuren 2026-11-03: högerställt och nowrap sköt texten ut till
   vänster). Radien är en rad hög, så en rad är en pill och två rader en rundad ruta. */
.zrc-opt { max-width: 100%; min-height: 28px; padding: 3px 10px; border: 1px solid #d5ddd7; border-radius: 14px; text-align: left; line-height: 1.3; background: #fff; color: #17372a;
  font: inherit; font-size: 12.5px; cursor: pointer; transition: border-color 150ms ease, background 150ms ease; }
.zrc-opt:hover:not(:disabled) { border-color: #087858; }
.zrc-opt[aria-pressed="true"] { border-color: #087858; background: #e6f1ea; color: #0b4d38; }
.zrc-opt:disabled { opacity: .55; cursor: default; }
.zrc-opt small { margin-left: 4px; color: #8a948d; font-size: 11px; }
.zrc-opt:focus-visible, .zrc-undo:focus-visible { outline: 2px solid #087858; outline-offset: 2px; }
.zrc-opt.is-pending { animation: zrc-pending 900ms ease-in-out infinite; }
@keyframes zrc-pending { 50% { opacity: .5; } }
.zrc-note, .zrc-error { margin: 4px 0; color: #8a5a00; font-size: 12px; }
.zrc-error { color: #a33a2a; }
.zrc-receipt { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid #eef0ec; color: #3f4c44; font-size: 12px; }
.zrc-undo { margin-left: 6px; padding: 0; border: 0; background: none; color: #087858; font: inherit; font-size: 12px; cursor: pointer; }
@media (pointer: coarse) {
  .zrc-q { min-height: 52px; }
  .zrc-opt { min-height: 44px; padding: 6px 14px; border-radius: 22px; font-size: 14px; }
  .zrc-undo { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .zrc-opt.is-pending { animation: none; opacity: .6; } }
.zimla-ai-message__bubble:has(> .zcc) > .zcc > .zrc { order: 3; }
/* Chattens svar gör knappar till block med full bredd; valens knappar står i rad. */
.zrc .zrc-opts > .zrc-opt { display: inline-flex; align-items: center; width: auto; flex: 0 1 auto; margin: 0; }
