/* Demandes — SPECIFICAT.io.
   Jetons repris tels quels de l'app (agent-maker/apps/web/src/index.css) :
   même palette, mêmes polices, même logotype, même clé de thème. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/static/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/static/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Libre Baskerville"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/libre-baskerville-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Libre Baskerville"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/libre-baskerville-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

[data-theme="dark"] {
  color-scheme: dark;
  --am-bg: #121212; --am-surface: #1e1e1e; --am-surface-elevated: #282828;
  --am-border: #333333; --am-border-strong: #444444;
  --am-text: #fafafa; --am-text-muted: #c8c8c8; --am-text-faint: #9a9a9a;
  --am-primary: #38c6c4; --am-primary-hover: #5dd4d2;
  --am-primary-solid: #157573; --am-primary-solid-hover: #126664;
  --am-primary-subtle: rgb(56 198 196 / 0.14); --am-primary-border: rgb(56 198 196 / 0.45);
  --am-link: #8aecea; --am-on-primary: #ffffff;
  --am-accent: #d1a054; --am-accent-subtle: rgb(209 160 84 / 0.14); --am-accent-border: rgb(209 160 84 / 0.4);
  --am-danger-fg: #fecaca; --am-danger-subtle: rgb(239 68 68 / 0.18); --am-danger-border: #f87171;
  --am-warning: #fde68a; --am-warning-subtle: rgb(251 191 36 / 0.18); --am-warning-border: #fbbf24;
  --am-success: #86efac; --am-success-subtle: rgb(52 211 153 / 0.18); --am-success-border: #4ade80;
  --am-info: #93c5fd; --am-info-subtle: rgb(59 130 246 / 0.16); --am-info-border: #60a5fa;
}

[data-theme="light"] {
  color-scheme: light;
  --am-bg: #f9f5f0; --am-surface: #ffffff; --am-surface-elevated: #eee7de;
  --am-border: #c9bfb0; --am-border-strong: #a89885;
  --am-text: #0c0a09; --am-text-muted: #44403c; --am-text-faint: #57534e;
  --am-primary: #157573; --am-primary-hover: #126664;
  --am-primary-solid: #157573; --am-primary-solid-hover: #126664;
  --am-primary-subtle: rgb(56 198 196 / 0.12); --am-primary-border: rgb(42 168 166 / 0.35);
  --am-link: #126664; --am-on-primary: #ffffff;
  --am-accent: #9a6840; --am-accent-subtle: rgb(209 160 84 / 0.18); --am-accent-border: rgb(154 104 64 / 0.45);
  --am-danger-fg: #b91c1c; --am-danger-subtle: rgb(220 38 38 / 0.12); --am-danger-border: #dc2626;
  --am-warning: #92400e; --am-warning-subtle: rgb(180 83 9 / 0.14); --am-warning-border: #b45309;
  --am-success: #047857; --am-success-subtle: rgb(5 150 105 / 0.14); --am-success-border: #059669;
  --am-info: #1d4ed8; --am-info-subtle: rgb(59 130 246 / 0.12); --am-info-border: #2563eb;
}

/* ---- Base ---- */
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--am-bg); color: var(--am-text);
  font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.shell { min-height: 100vh; display: flex; flex-direction: column; }
main { width: 100%; max-width: 920px; margin: 0 auto; padding: 28px 16px 64px; flex: 1; }
a { color: var(--am-link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 4px; }
h2 { font-size: 1.05rem; font-weight: 600; margin: 32px 0 12px; }
:focus-visible { outline: 2px solid var(--am-primary); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--am-text-faint); font-size: 0.8125rem; }
.error { color: var(--am-danger-fg); background: var(--am-danger-subtle); border: 1px solid var(--am-danger-border); border-radius: 0.5rem; padding: 8px 12px; }

.skip-link { position: absolute; left: 1rem; top: -100%; z-index: 100; border-radius: 0.5rem; border: 1px solid var(--am-primary-border);
  background: var(--am-surface); padding: 0.5rem 1rem; font-size: 0.875rem; font-weight: 500; color: var(--am-primary); }
.skip-link:focus { top: 1rem; }

/* ---- En-tête (même gabarit que l'app) ---- */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 16px; border-bottom: 1px solid var(--am-border); background: var(--am-bg); }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; min-width: 0; }
.brand:hover { text-decoration: none; }
.specificat-wordmark { font-family: "Libre Baskerville", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 1.125rem; letter-spacing: 0.02em; line-height: 1; white-space: nowrap; }
.specificat-wordmark-main { color: var(--am-text); }
.specificat-wordmark-io { color: var(--am-accent); }
.product-label { border-left: 1px solid var(--am-border); padding-left: 12px; font-size: 0.65rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--am-text-faint); }
.top-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 0.875rem; }
.top-link { color: var(--am-text-muted); }
.who { font-weight: 500; color: var(--am-text); }
.role { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--am-accent);
  border: 1px solid var(--am-accent-border); border-radius: 999px; padding: 0 6px; margin-left: 4px; }

.segment { display: flex; border: 1px solid var(--am-border-strong); background: var(--am-surface); border-radius: 0.375rem; padding: 2px; font-size: 0.75rem; }
.segment button { background: none; border: 0; color: var(--am-text-muted); padding: 4px 10px; border-radius: 0.25rem; cursor: pointer; font: inherit; }
.segment button:hover { color: var(--am-text); }
.segment button[aria-pressed="true"] { background: var(--am-primary-solid); color: var(--am-on-primary); font-weight: 500; }

/* ---- Pied de page ---- */
.site-footer { border-top: 1px solid var(--am-border); padding: 8px 16px; text-align: center; font-size: 0.75rem; color: var(--am-text-faint); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; }
.site-footer a { color: var(--am-text-faint); }
.site-footer a:hover { color: var(--am-text); }

/* ---- Boutons et champs ---- */
button, .btn { font: inherit; cursor: pointer; }
.btn, main button:not(.segment button):not(.vote button) {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 0.5rem; padding: 7px 16px;
  font-size: 0.875rem; font-weight: 500; border: 1px solid transparent;
  background: var(--am-primary-solid); color: var(--am-on-primary);
}
.btn:hover, main button:not(.segment button):not(.vote button):hover { background: var(--am-primary-solid-hover); text-decoration: none; }
.btn-primary { background: var(--am-primary-solid); color: var(--am-on-primary); }
.btn-ghost { background: transparent; color: var(--am-text-muted); border-color: var(--am-border-strong); padding: 4px 10px; font-size: 0.8125rem; }
.btn-ghost:hover { background: transparent; color: var(--am-text); border-color: var(--am-primary-border); }
button:disabled { opacity: 0.5; cursor: default; }
form.inline { display: inline; }

input, select, textarea {
  font: inherit; font-size: 0.875rem; color: var(--am-text); background: var(--am-surface);
  border: 1px solid var(--am-border-strong); border-radius: 0.5rem; padding: 7px 10px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--am-primary); box-shadow: 0 0 0 3px var(--am-primary-subtle); }
textarea { width: 100%; resize: vertical; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--am-primary-solid); }

/* ---- Liste ---- */
.filters { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.tabs { display: flex; border: 1px solid var(--am-border-strong); background: var(--am-surface); border-radius: 0.5rem; padding: 2px; }
.tabs a { padding: 5px 14px; border-radius: 0.375rem; color: var(--am-text-muted); font-size: 0.875rem; }
.tabs a:hover { color: var(--am-text); text-decoration: none; }
.tabs a.on { background: var(--am-primary-solid); color: var(--am-on-primary); font-weight: 500; }
.search { display: flex; gap: 8px; flex-wrap: wrap; }
.search input[type="search"] { min-width: 220px; }

.tickets { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.tickets li { display: flex; gap: 16px; align-items: center; background: var(--am-surface); border: 1px solid var(--am-border);
  border-radius: 0.5rem; padding: 12px 16px; transition: border-color 120ms; }
.tickets li:hover { border-color: var(--am-primary-border); }
.tickets li.empty { justify-content: center; color: var(--am-text-faint); padding: 40px; }
.title { font-weight: 600; color: var(--am-text); }
.title:hover { color: var(--am-primary); text-decoration: none; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }

/* Pastilles */
.kind, .status, .label { font-size: 0.72rem; font-weight: 500; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--am-border-strong); color: var(--am-text-muted); }
.kind.bug { color: var(--am-danger-fg); background: var(--am-danger-subtle); border-color: transparent; }
.kind.feature { color: var(--am-accent); background: var(--am-accent-subtle); border-color: transparent; }
.status { color: var(--am-primary); background: var(--am-primary-subtle); border-color: transparent; }
.s-planned { color: var(--am-info); background: var(--am-info-subtle); }
.s-in_progress { color: var(--am-warning); background: var(--am-warning-subtle); }
.s-done { color: var(--am-success); background: var(--am-success-subtle); }
.s-rejected, .s-duplicate { color: var(--am-text-faint); background: transparent; border-color: var(--am-border-strong); }

/* Vote */
.vote button { display: flex; flex-direction: column; align-items: center; min-width: 54px; padding: 6px 8px; line-height: 1.15;
  background: var(--am-surface-elevated); color: var(--am-text-muted); border: 1px solid var(--am-border-strong); border-radius: 0.5rem; }
.vote button:hover:not(:disabled) { border-color: var(--am-primary-border); color: var(--am-text); }
.vote.voted button { background: var(--am-primary-subtle); color: var(--am-primary); border-color: var(--am-primary-border); }
.vote .arrow { font-size: 0.65rem; }
.vote .count { font-weight: 700; font-size: 1rem; font-variant-numeric: tabular-nums; }

.pager { display: flex; gap: 16px; justify-content: center; align-items: center; margin-top: 20px; font-size: 0.875rem; }

/* ---- Détail ---- */
.ticket { background: var(--am-surface); border: 1px solid var(--am-border); border-radius: 0.5rem; padding: 20px; margin-top: 12px; }
.ticket .head { display: flex; gap: 16px; align-items: flex-start; }
.text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 12px; color: var(--am-text-muted); }

.triage { margin: 16px 0; background: var(--am-surface); border: 1px dashed var(--am-accent-border); border-radius: 0.5rem; padding: 12px 16px; }
.triage summary { cursor: pointer; font-weight: 500; color: var(--am-accent); }
.triage form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-top: 12px; }
.triage label { display: flex; flex-direction: column; font-size: 0.8125rem; gap: 4px; color: var(--am-text-muted); }

.comment { border-left: 3px solid var(--am-border-strong); padding: 6px 14px; margin: 12px 0; }
.comment.agent { border-color: var(--am-primary); }
.comment.internal { background: var(--am-accent-subtle); border-color: var(--am-accent); border-radius: 0 0.5rem 0.5rem 0; }
.comment .text { margin-top: 4px; }

/* ---- Formulaires ---- */
.stack { display: grid; gap: 14px; margin-top: 16px; }
.stack label { display: grid; gap: 6px; font-size: 0.875rem; font-weight: 500; }
.stack label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.stack button { justify-self: start; }
.kinds { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.kinds label { display: flex; align-items: center; gap: 8px; font-weight: 400; background: var(--am-surface);
  border: 1px solid var(--am-border-strong); border-radius: 0.5rem; padding: 8px 14px; cursor: pointer; }
.kinds label:has(input:checked) { border-color: var(--am-primary); background: var(--am-primary-subtle); }

@media (max-width: 640px) {
  .product-label, .top-link { display: none; }
  .search input[type="search"] { min-width: 0; flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
