/* suggestions.css — the mark an AI suggestion wears until it is kept or dropped.
   A dashed ink line round the item and a scrap of tape above it. The tape sits outside the
   item's box, so it never covers the words or the photo it is marking. */

.overlay-element.ai-suggested:not(.selected) {
  outline: 2px dashed rgba(22, 22, 26, 0.7); /* --ink-carbon */
  outline-offset: 4px;
  border-radius: 2px;
}
.overlay-element.ai-suggested.selected {
  outline-style: dashed;
}

/* Her item that the helper would take away: still there, faded, until she decides. */
.overlay-element.ai-remove {
  opacity: 0.35 !important;
}

.overlay-element .ai-tab {
  position: absolute;
  left: 6px;
  bottom: calc(100% + 6px);
  z-index: 2;
  padding: 3px 12px 4px;
  white-space: nowrap;
  font: 700 11px/1.1 'Courier Prime', monospace;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: #16161a;
  background: url('assets/desk/duct-strip.png') center / 100% 100% no-repeat, rgba(246, 236, 205, 0.92);
  /* torn ends, like the tape on the empty page card */
  clip-path: polygon(0 12%, 4% 0, 9% 10%, 15% 2%, 85% 2%, 91% 10%, 96% 0, 100% 14%,
                     98% 50%, 100% 88%, 95% 100%, 89% 90%, 83% 98%, 16% 98%, 10% 90%, 4% 100%, 0 86%, 2% 50%);
  transform: rotate(-2deg);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
/* An item at the very top of the page: the tape goes under it instead, so it is not cut off. */
.overlay-element .ai-tab.ai-tab-below {
  bottom: auto;
  top: calc(100% + 6px);
}

/* The tab is the way in to one decision: tap it for keep / drop. */
.ai-chip {
  position: fixed;
  z-index: 1200;
  display: flex;
  gap: 6px;
  padding: 6px 8px 7px;
  background: #f6eccd;
  color: #16161a;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.28);
  transform: rotate(-1deg);
  clip-path: polygon(0 6%, 3% 0, 97% 2%, 100% 8%, 99% 94%, 96% 100%, 4% 98%, 1% 92%);
}
.ai-chip[hidden] { display: none; }

/* While anything is still suggested: a strip of tape across the top of the workbench. */
.ai-suggest-bar {
  position: absolute;
  top: 10px;
  left: 50%;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 32px);
  padding: 6px 16px 7px;
  white-space: nowrap;
  font: 700 12px/1.1 'Courier Prime', monospace;
  color: #16161a;
  background: url('assets/desk/duct-strip.png') center / 100% 100% no-repeat, rgba(246, 236, 205, 0.95);
  clip-path: polygon(0 10%, 3% 0, 8% 8%, 92% 2%, 97% 10%, 100% 4%, 99% 50%, 100% 92%, 96% 100%, 90% 92%, 10% 98%, 4% 90%, 0 96%, 1% 50%);
  transform: translateX(-50%) rotate(-0.6deg);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}
.ai-suggest-bar[hidden] { display: none; }
.ai-suggest-bar .ai-bar-dot { opacity: 0.55; }

/* Page-level suggestions (a Look, the page order...) have no item to carry a tab: one line each,
   written under the count on the same strip of tape. */
.ai-suggest-bar { flex-wrap: wrap; justify-content: center; }
.ai-suggest-bar .ai-bar-lines { order: 2; flex-basis: 100%; display: flex; flex-direction: column; align-items: center; gap: 0; border-top: 1px dashed rgba(22, 22, 26, 0.35); margin-top: 2px; padding-top: 2px; }
.ai-suggest-bar .ai-bar-lines[hidden] { display: none; }
.ai-suggest-bar .ai-bar-line { display: flex; align-items: center; gap: 4px; }
.ai-suggest-bar .ai-bar-what { font-weight: 400; font-style: italic; }

.ai-chip button,
.ai-suggest-bar button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 4px 6px;
  min-height: 28px;
  font: 700 12px/1 'Courier Prime', monospace;
  color: #16161a;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  cursor: pointer;
}
.ai-chip button:hover,
.ai-suggest-bar button:hover { text-decoration-style: solid; }

/* Before an export: a scrap of paper asking her to settle what is still suggested. */
.ai-export-sheet {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(22, 22, 26, 0.35);
}
.ai-export-sheet[hidden] { display: none; }
.ai-export-card {
  max-width: 340px;
  width: 100%;
  padding: 18px 18px 14px;
  background: #f6eccd;
  color: #16161a;
  font: 400 15px/1.35 'Courier Prime', monospace;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.3);
  transform: rotate(-0.8deg);
  clip-path: polygon(0 3%, 3% 0, 97% 1%, 100% 4%, 99% 96%, 96% 100%, 4% 99%, 1% 95%);
  position: relative;
}
.ai-export-card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 50%;
  width: 120px;
  height: 22px;
  transform: translateX(-50%) rotate(-3deg);
  background: url('assets/desk/duct-strip.png') center / 100% 100% no-repeat;
  opacity: 0.9;
}
.ai-export-msg { margin: 6px 0 12px; font-weight: 700; text-align: center; }
.ai-export-row { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; }
.ai-export-row button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  min-height: 40px;
  font: 700 14px/1 'Courier Prime', monospace;
  color: #16161a;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  cursor: pointer;
}
.ai-export-row button:hover { text-decoration-style: solid; }

/* The caption box in the export modal: her caption, her sources, ready to paste. */
.export-caption-box[hidden] { display: none; }
.export-caption-box { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.export-caption-title,
.export-caption-sources-title { font: 700 12px/1.2 'Courier Prime', monospace; letter-spacing: 0.04em; text-transform: uppercase; }
.export-caption-sources-title[hidden] { display: none; }
.export-caption-text {
  width: 100%;
  box-sizing: border-box;
  min-height: 84px;
  padding: 8px 10px;
  font: 400 16px/1.35 'Courier Prime', monospace; /* 16px: iOS does not zoom into the field */
  color: #16161a;
  background: #fbf6e6;
  border: 1px solid rgba(22, 22, 26, 0.35);
  border-radius: 2px;
  resize: vertical;
}
.export-caption-pending[hidden] { display: none; }
.export-caption-pending {
  position: relative;
  padding: 14px 10px 6px;
  background: #f6eccd;
  color: #16161a;
  outline: 2px dashed rgba(22, 22, 26, 0.7);
  outline-offset: -2px;
}
.export-caption-pending-tab {
  position: absolute;
  top: -8px;
  left: 8px;
  padding: 2px 10px 3px;
  font: 700 11px/1.1 'Courier Prime', monospace;
  background: url('assets/desk/duct-strip.png') center / 100% 100% no-repeat, rgba(246, 236, 205, 0.92);
  transform: rotate(-2deg);
}
.export-caption-pending-text { margin: 0 0 4px; font: 400 14px/1.35 'Courier Prime', monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.export-caption-pending-actions { display: flex; gap: 4px; justify-content: flex-end; }
.export-caption-pending-actions button {
  appearance: none; border: 0; background: transparent; padding: 4px 8px; min-height: 32px;
  font: 700 12px/1 'Courier Prime', monospace; color: #16161a;
  text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; cursor: pointer;
}
.export-caption-sources[hidden] { display: none; }
.export-caption-sources {
  margin: 0;
  padding: 6px 8px;
  max-height: 120px;
  overflow: auto;
  font: 400 12px/1.4 'Courier Prime', monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #16161a;
  background: #fbf6e6;
  border: 1px dashed rgba(22, 22, 26, 0.3);
}
.export-caption-row { display: flex; gap: 8px; flex-wrap: wrap; }
.export-caption-row .btn { flex: 1 1 120px; min-width: 0; margin-top: 0; }
