/* Atelier outils — espace de découpe repris de TK02. */
.tickets-page main {
  max-width: 1460px;
}
.back-link {
  display: inline-block;
  margin-bottom: 24px;
  color: #874326;
  text-underline-offset: 4px;
  font-size: 0.9375rem;
}
.tickets-intro {
  max-width: 840px;
  margin-bottom: 24px;
}
.tickets-intro > p:last-child {
  color: var(--muted);
}
.tickets-page .layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 24px;
  margin-top: 24px;
  align-items: start;
}
.tickets-page .panel {
  padding: 22px;
}
.tickets-page h2 {
  font-size: 1.3rem;
  margin-top: 0;
}
.tickets-page .toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 16px;
}
.tickets-page button,
.tickets-page .upload {
  font: inherit;
  font-size: 0.875rem;
  padding: 11px 14px;
  border: 1px solid #c9bba6;
  border-radius: 9px;
  background: #fffefa;
  color: #584c3c;
  cursor: pointer;
}
.tickets-page button:hover:enabled {
  background: #faead9;
}
.tickets-page button.primary,
.tickets-page .upload {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.tickets-page button.primary:hover:enabled,
.tickets-page .upload:hover {
  background: #8a321a;
}
.tickets-page .primary:disabled {
  opacity: 0.45;
}
.tickets-page .upload {
  position: relative;
}
.tickets-page #ticket-file {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.tickets-page .upload:focus-within {
  outline: 3px solid #ad4527;
  outline-offset: 4px;
}
.sample-link {
  color: #874326;
  font-size: 0.875rem;
  text-underline-offset: 4px;
}
.tickets-page .muted {
  color: var(--muted);
  font-size: 0.9375rem;
}
.tickets-page #ticket-status {
  min-height: 26px;
  padding: 10px 0;
  white-space: pre-line;
}
.tickets-page .stage {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 350px;
  padding: 15px;
  background: #eee7dc;
  border-radius: 12px;
}
.tickets-page #ticket-view {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  touch-action: none;
  background: white;
  cursor: crosshair;
  box-shadow: 0 4px 18px #60472d18;
}
.tickets-page #ticket-view:focus-visible {
  outline: 3px solid #ad4527;
  outline-offset: 4px;
}
.tickets-page .empty {
  align-self: center;
  text-align: center;
  padding: 45px 12px;
  line-height: 1.7;
}
.tickets-page .empty b {
  display: block;
  font-family: Georgia, serif;
  font-size: 1.6rem;
  margin-bottom: 12px;
  font-weight: 400;
}
.tickets-page .help {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.65;
}
.tickets-page .pages {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tickets-page #ticket-pageNote {
  background: #edf2e9;
  color: #466052;
  padding: 12px;
  border-radius: 9px;
}
#ticket-pageChoices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}
.pageChoice {
  border: 2px solid #e7ded0;
  border-radius: 13px;
  padding: 12px;
  background: #fcf8f1;
}
.pageChoice.selected {
  border-color: #aa4222;
  background: #fff1e1;
}
.pageChoice img {
  display: block;
  width: 100%;
  height: 135px;
  object-fit: contain;
  margin: 10px 0;
  background: #eae3d8;
}
.pageChoice label {
  display: block;
  font-size: 0.875rem;
  margin: 9px 0;
}
.pageChoice input[type="number"],
.pageChoice select {
  width: 100%;
  padding: 9px;
  border: 1px solid #c9bba6;
  border-radius: 7px;
  background: #fffefa;
  color: var(--ink);
  font: inherit;
}
.pageChoice input[type="checkbox"] {
  width: 19px;
  height: 19px;
  vertical-align: middle;
  margin-right: 8px;
  accent-color: var(--accent);
}
.pageChoice button {
  width: 100%;
}
#ticket-selectionSummary,
#ticket-exportSummary {
  white-space: pre-line;
}
.tickets-page #ticket-list {
  max-height: 680px;
  overflow: auto;
  padding-right: 5px;
}
.ticket {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.ticket > strong {
  font-size: 0.9375rem;
}
.ticket img {
  max-width: 100%;
  height: 110px;
  object-fit: contain;
  background: #f3eee4;
  display: block;
  margin: 10px 0;
}
.ticket input {
  width: 100%;
  padding: 8px;
  border: 1px solid #c9bba6;
  border-radius: 6px;
  margin: 5px 0;
  font: inherit;
  background: #fffefa;
}
.ticket .actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.ticket .actions button {
  padding: 9px;
  font-size: 0.8125rem;
}
.coords {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.coords label {
  font-size: 0.8125rem;
}
.coords input {
  font-size: 0.875rem;
  padding: 7px 4px;
}
.tickets-page #ticket-folder,
.tickets-page #ticket-zip {
  width: 100%;
  margin-top: 10px;
}
.tickets-page footer {
  display: block;
  font-size: 0.875rem;
  line-height: 1.65;
  max-width: 1000px;
}
@media (max-width: 960px) {
  .tickets-page .layout {
    grid-template-columns: 1fr;
  }
  .tickets-page #ticket-list {
    max-height: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
  }
}
@media (max-width: 520px) {
  .tickets-page .panel {
    padding: 16px;
  }
  .tickets-page .stage {
    padding: 4px;
  }
  .tickets-page #ticket-pageChoices {
    grid-template-columns: 1fr;
  }
  .tickets-page .toolbar {
    align-items: stretch;
  }
  .tickets-page #ticket-list {
    grid-template-columns: 1fr;
  }
}

/* Intégration dans le panneau commun, à côté du menu des outils. */
#tickets-workspace {
  min-width: 0;
}
#tickets-workspace .layout {
  grid-template-columns: minmax(0, 1fr);
}
#tickets-workspace .tickets-intro {
  margin-bottom: 20px;
}
#tickets-workspace #ticket-list {
  max-height: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 16px;
}
#tickets-workspace footer {
  margin-top: 24px;
}

/* AO30 — aperçu et réglages côte à côte sur grand écran. */
#tickets-workspace .panel { box-shadow: none; border-radius: 14px; }
@media (min-width: 1080px) {
  #tickets-workspace .layout { grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; }
  #tickets-workspace .layout > .panel { padding: 16px; }
  #tickets-workspace #ticket-list { grid-template-columns: minmax(0, 1fr); }
}
