/* Report and share, and the client view a share link opens (ACQ-IA-13). Role tokens only; the colours live in theme.css. */

/* —— Report and share (the modeller's step page) —— */
.aq-share { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; max-width: 1040px; min-width: 0; }
.aq-share > * { min-width: 0; }
.aq-share > .hx-card { margin: 0; }
.aq-share-card { padding: 16px 20px; }
.aq-share-card .hx-section-label { margin: 0 0 8px; }
.aq-share-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.aq-share-line { margin: 0 0 12px; font-size: 14px; line-height: 1.45; color: var(--ink); max-width: 760px; }
.aq-share-head .aq-share-line { margin: 0; }
.aq-share-mono { font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.aq-share-label { display: block; margin: 0 0 4px; font-size: 12px; font-weight: 600; color: var(--ink); }
.aq-share-hint { display: block; margin: 4px 0 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
.aq-share-muted { color: var(--muted); }
.aq-share-error { margin: 8px 0 0; font-size: 12px; color: var(--danger); }
.aq-share-empty { padding: 40px; text-align: center; font-size: 14px; color: var(--muted); }
.aq-share-empty .aq-client-h1 { color: var(--ink); }

.aq-share-text {
  width: 100%; min-height: 180px; padding: 8px 12px; resize: vertical;
  font: 14px/1.5 var(--font); color: var(--ink);
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: 8px;
}
.aq-share-text:focus-visible, .aq-share .hx-input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-color: var(--accent); }
.aq-share .hx-input { height: 36px; padding: 0 12px; font-size: 14px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); }
.aq-share textarea.hx-input { height: auto; padding: 8px 12px; }
.aq-share-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.aq-share-preview { margin-top: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-size: 14px; line-height: 1.5; max-width: 760px; }
.aq-share-preview p:last-child { margin-bottom: 0; }
.aq-share .hx-btn { height: 36px; padding: 0 14px; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.aq-share .hx-btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.aq-share .hx-btn.secondary:hover:not(:disabled) { background: var(--surface-2); }
.aq-share .hx-btn.quiet { border-color: transparent; background: transparent; }

.aq-share-stamp { display: inline-block; padding: 0 8px; border: 1.5px dashed var(--warn); border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--on-warn); background: var(--warn-soft); }

.aq-share-parts { margin: 0 0 4px; padding: 0; border: 0; display: grid; gap: 8px; }
.aq-share-parts legend { margin-bottom: 8px; }
.aq-share-part { display: flex; gap: 12px; align-items: flex-start; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.aq-share-part:hover { background: var(--surface-2); }
.aq-share-part input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.aq-share-part-name { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.aq-share-part .aq-share-hint { margin: 0; }

.aq-share-new { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-top: 16px; }
.aq-share-field { flex: 1 1 280px; max-width: 420px; }
.aq-share-field .hx-input { width: 100%; }
.aq-share-created { margin-top: 12px; padding: 12px 16px; border-left: 3px solid var(--ok); background: var(--ok-soft); border-radius: 8px; }
.aq-share-copy { display: flex; gap: 8px; flex-wrap: wrap; }
.aq-share-copy .hx-input { flex: 1 1 320px; min-width: 0; }

.aq-share-table-wrap { margin-top: 16px; overflow-x: auto; }
.aq-share-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.aq-share-table th { padding: 8px 12px; text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.aq-share-table td { padding: 8px 12px; height: 40px; border-bottom: 1px solid var(--line); color: var(--ink); vertical-align: middle; }
.aq-share-table tr.is-revoked td { color: var(--muted); }
.aq-share-when { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.aq-share-none { text-align: center; color: var(--muted); padding: 24px 12px; }
.aq-share-row-actions { text-align: right; }
.aq-share-row-actions .hx-btn { height: 28px; padding: 0 12px; }
.aq-share-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.aq-share-chip.is-on { background: var(--ok-soft); color: var(--on-ok); }
.aq-share-chip.is-off { background: var(--surface-2); color: var(--muted); }
.aq-share .hx-btn.aq-share-danger { color: var(--danger); }
.aq-share .hx-btn.aq-share-danger:hover:not(:disabled) { background: var(--danger-soft); }

.aq-share-scrim { position: fixed; inset: 0; z-index: 90; background: var(--scrim); }
.aq-share-dialog {
  position: fixed; z-index: 91; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(440px, calc(100vw - 32px)); padding: 24px; border-radius: 12px;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); border: 1px solid var(--line);
}
.aq-share-dialog h2 { margin: 0 0 8px; font-size: 18px; font-weight: 600; line-height: 1.2; }
.aq-share-dialog p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--muted); }
.aq-share-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.aq-share-dialog .hx-btn { height: 36px; padding: 0 14px; }
.aq-share-dialog .hx-btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.hx-btn.aq-share-danger-fill { background: var(--danger); color: var(--on-danger); border-color: var(--danger); }
.hx-btn.aq-share-danger-fill:hover:not(:disabled) { background: var(--danger); filter: brightness(.92); }

/* —— The client view —— */
.aq-client { min-height: 100vh; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.45; }
.aq-client-bar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 12px;
  height: 60px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.aq-client-brand { display: inline-flex; align-items: center; gap: 8px; font: 600 18px var(--font-display); color: var(--ink); }
.aq-client-shared { font-size: 13px; color: var(--muted); }
.aq-client-spacer { flex: 1; }
.aq-client-stamp {
  display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border: 1.5px dashed var(--warn);
  border-radius: 999px; background: var(--warn-soft); color: var(--on-warn); font-size: 12px; font-weight: 600; letter-spacing: .08em;
}
.aq-client-theme > summary { height: 32px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 12px; color: var(--ink); }
.aq-client-main { max-width: 1280px; margin: 0 auto; padding: 24px; display: grid; gap: 16px; }
.aq-client-head .hx-section-label { margin: 0 0 4px; }
.aq-client-h1 { margin: 0; font: 700 26px/1.2 var(--font-display); color: var(--ink); }
.aq-client-line { margin: 4px 0 0; font-size: 14px; color: var(--muted); }

.aq-client-phases { list-style: none; margin: 0; padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 8px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.aq-client-phases li { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.aq-client-phases li.is-done { color: var(--ink); }
.aq-client-phase-dot {
  width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center; flex: none;
  border: 1.5px solid var(--line-strong); background: var(--surface); font-size: 12px; line-height: 1;
}
.aq-client-phases li.is-done .aq-client-phase-dot { background: var(--ok); border-color: var(--ok); color: var(--surface); }

.aq-client-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.aq-client-tabs [role="tab"] {
  appearance: none; border: 0; background: transparent; padding: 8px 12px; margin-bottom: -1px;
  font: 600 14px var(--font); color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap;
  transition: color 120ms ease, border-color 120ms ease;
}
.aq-client-tabs [role="tab"]:hover { color: var(--ink); }
.aq-client-tabs [role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.aq-client-tabs [role="tab"]:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: 6px 6px 0 0; }
.aq-client-panel { min-width: 0; }
.aq-client-summary { max-width: 760px; padding: 24px; margin: 0; font-size: 15px; line-height: 1.6; }
.aq-client-summary p { margin: 0 0 12px; }
.aq-client-report { max-width: 760px; padding: 20px; margin: 0; }
.aq-client-report p { margin: 0 0 16px; }
.aq-client-report .hx-btn { height: 36px; padding: 0 14px; }
.aq-client-foot { margin: 8px 0 0; font-size: 12px; color: var(--muted); }

@media (max-width: 767px) {
  .aq-client-bar { padding: 0 16px; gap: 8px; }
  .aq-client-shared, .aq-client-theme-name { display: none; }
  .aq-client-main { padding: 16px; }
  .aq-client-h1 { font-size: 22px; }
  .aq-share-card { padding: 16px; }
  .aq-share-head > .hx-btn, .aq-share-new > .hx-btn { width: 100%; }
  .aq-share-field { max-width: none; }
  .aq-share-table .aq-share-made { display: none; }
  .aq-share-table th, .aq-share-table td { padding: 8px; }
  .aq-share-when { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .aq-client-tabs [role="tab"] { transition: none; }
}
