/* The Feedback dialog (P169, src/studio/feedback/): Send and Your feedback,
   design "Proposed · P169" ujfKd and F0YI5. Built from the Studio's
   primitives (st-btn, st-seg, st-switch, st-tag, st-icon-btn); this file lays
   them out. Loaded by every page with the rail. */

.fb-dialog {
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 22px 24px 24px;
  border: 0;
  border-radius: 16px;
  outline: 1px solid var(--st-line);
  outline-offset: -0.5px;
  overflow: auto;
  background: var(--st-surface);
  box-shadow: 0 24px 60px color-mix(in srgb, var(--st-shadow) 70%, transparent);
  color: var(--st-text);
  font: 400 13px/1.45 var(--st-font);
}
.fb-dialog::backdrop { background: color-mix(in srgb, #000 55%, transparent); }
.fb-dialog [hidden] { display: none !important; }

.fb-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.fb-title { margin: 0; font: 600 18px/24px var(--st-font); }

/* The tabs wear the segmented control, full width. */
.fb-tabs { display: flex; width: 100%; margin-bottom: 18px; border-radius: 10px; }
.st-seg .fb-tab { display: inline-flex; flex: 1; align-items: center; justify-content: center; gap: 8px; height: 34px; border-radius: 8px; font-size: 13px; }
.fb-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--st-accent);
  color: var(--st-on-accent);
  font: 600 10.5px/18px var(--st-font);
  text-align: center;
}

/* ---- Send ---------------------------------------------------------------------- */

.fb-fields { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.fb-fields:disabled { opacity: 0.5; }
.fb-label { margin: 6px 0 0; color: var(--st-text); font: 500 13px/18px var(--st-font); }
.fb-fields > .fb-label:first-child { margin-top: 0; }
.fb-fields .st-seg { align-self: flex-start; }
.fb-textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  border: 0;
  border-radius: 10px;
  outline: 1px solid var(--st-line);
  outline-offset: -0.5px;
  resize: vertical;
  background: var(--st-panel);
  color: var(--st-text);
  font: 400 13.5px/20px var(--st-font);
}
.fb-textarea::placeholder { color: var(--st-text-faint); }
.fb-textarea[aria-invalid='true'] { outline-color: var(--st-error); }
.fb-under { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-height: 16px; }
.fb-field-error { margin: 0; color: var(--st-error-ink); font-size: 12px; }
.fb-count { margin-left: auto; color: var(--st-text-faint); font: 400 11px/16px var(--st-font-mono); white-space: nowrap; }
.fb-hint { margin: 0; color: var(--st-text-faint); font-size: 12px; }

.fb-images { display: flex; gap: 8px; margin-top: 4px; }
.fb-tile, .fb-add {
  position: relative;
  display: grid;
  place-items: center;
  width: 96px;
  height: 60px;
  border-radius: 8px;
  outline: 1px solid var(--st-line);
  outline-offset: -0.5px;
  overflow: hidden;
  background: var(--st-panel);
}
.fb-add { gap: 2px; padding: 6px 0; border: 0; color: var(--st-text-dim); font: 400 11px/14px var(--st-font); cursor: pointer; }
.fb-add:hover { background: var(--st-surface-2); color: var(--st-text); }
.fb-tile__img { width: 100%; height: 100%; object-fit: cover; }
.fb-tile[data-state='uploading'] .fb-tile__img { opacity: 0.5; }
.fb-tile[data-state='failed'] { outline-color: var(--st-error); }
.fb-tile[data-state='failed'] .fb-tile__img { opacity: 0.35; }
.fb-tile__spin { position: absolute; width: 18px; height: 18px; border: 2px solid var(--st-line-strong); border-top-color: var(--st-accent); border-radius: 50%; animation: st-spin 0.8s linear infinite; }
.fb-tile__failed { position: absolute; color: var(--st-error-ink); }
.fb-tile__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, #000 70%, transparent);
  color: #fff;
  cursor: pointer;
}
.fb-tile__remove .st-icon { width: 12px; height: 12px; }

.fb-switch-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.fb-switch-label { color: var(--st-text); font-weight: 500; cursor: pointer; }
.fb-disclose { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; padding: 4px 0; border: 0; background: none; color: var(--st-text-dim); font: 400 12px/16px var(--st-font); cursor: pointer; }
.fb-disclose .st-icon { width: 14px; height: 14px; transition: transform 0.15s; }
.fb-disclose[aria-expanded='true'] .st-icon { transform: rotate(180deg); }

/* The details box: the same rows the admin sees (admin.css). */
.fb-details, .fb-rows--box { padding: 10px 12px; border-radius: 10px; outline: 1px solid var(--st-line); outline-offset: -0.5px; background: var(--st-panel); }
.fb-rows { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 4px 12px; margin: 0; font-size: 12px; }
.fb-rows dt { color: var(--st-text-faint); }
.fb-rows dd { margin: 0; color: var(--st-text); font-family: var(--st-font-mono); overflow-wrap: anywhere; }
.fb-details__note { margin: 8px 0 0; color: var(--st-text-faint); font-size: 11.5px; }

.fb-error { margin: 12px 0 0; color: var(--st-error-ink); font-size: 12.5px; }
.fb-error:empty { display: none; }
.fb-foot { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.fb-help { flex: 1; margin: 0; color: var(--st-text-faint); font-size: 12px; }
.fb-help a { color: var(--st-text-dim); }
.fb-actions, .fb-discard { display: flex; align-items: center; gap: 8px; }
.fb-discard__text { margin: 0 4px 0 0; color: var(--st-text); font-weight: 500; }

.fb-done { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 8px 4px; text-align: center; }
.fb-done__mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: color-mix(in srgb, var(--st-ok) 14%, transparent); color: var(--st-ok); }
.fb-done__mark .st-icon { width: 22px; height: 22px; }
.fb-done__title { margin: 6px 0 0; font: 600 16px/22px var(--st-font); }
.fb-done__body { max-width: 320px; margin: 0; color: var(--st-text-dim); }
.fb-done__actions { display: flex; gap: 8px; margin-top: 14px; }

.fb-signin { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 12px 8px 4px; text-align: center; }
.fb-signin__copy { max-width: 300px; margin: 0; color: var(--st-text-dim); font-size: 14px; }

/* ---- Your feedback ----------------------------------------------------------------- */

.fb-mine__list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.fb-mine__item { display: flex; flex-direction: column; gap: 6px; padding: 14px 0; border-bottom: 1px solid var(--st-line); }
.fb-mine__item:first-child { padding-top: 0; }
.fb-mine__top { display: flex; align-items: center; gap: 8px; }
.fb-mine__spacer { flex: 1; }
.fb-mine__message { margin: 0; overflow: hidden; color: var(--st-text); font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; }
.fb-mine__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; color: var(--st-text-faint); font-size: 12px; }
.fb-dot { color: var(--st-text-faint); }
.fb-source { display: inline-flex; align-items: center; gap: 4px; }
.fb-source .st-icon { width: 12px; height: 12px; }
/* The reference (D174): muted like the meta line, figures aligned; the copy button sits inside the line's height. */
.fb-ref { display: inline-flex; align-items: center; color: var(--st-text-faint); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fb-ref .st-icon-btn { width: 24px; height: 24px; margin: -6px 0 -6px 2px; }
.fb-ref .st-icon-btn .st-icon { width: 12px; height: 12px; }
.fb-ref__status { margin-left: 2px; color: var(--st-ok); }
.fb-done__ref { margin: 2px 0 0; }
.fb-status { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; outline: 1px solid var(--st-line); outline-offset: -0.5px; color: var(--st-text-dim); font-size: 11.5px; white-space: nowrap; }
.fb-status .st-icon { width: 12px; height: 12px; }
.fb-status--resolved { outline-color: color-mix(in srgb, var(--st-ok) 30%, transparent); background: color-mix(in srgb, var(--st-ok) 8%, transparent); color: var(--st-ok); }
.fb-fresh { width: 7px; height: 7px; border-radius: 50%; background: var(--st-accent); }
.fb-note { padding: 8px 12px; border-radius: 8px; outline: 1px solid var(--st-line); outline-offset: -0.5px; background: var(--st-surface-2); }
.fb-note__title { margin: 0 0 2px; color: var(--st-text-faint); font-size: 11.5px; }
.fb-note__text { margin: 0; color: var(--st-text); font-size: 13px; white-space: pre-wrap; }

.fb-kind { text-transform: none; letter-spacing: 0; font: 500 11.5px/normal var(--st-font); }
.fb-kind .st-icon { width: 12px; height: 12px; }
.fb-kind--problem { --tag-color: var(--st-accent); }
.fb-kind--idea { --tag-color: var(--st-chord-ink); }
.fb-kind--other { --tag-color: var(--st-text-dim); }

.fb-paging { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 16px; }
.fb-paging__count { margin: 0; color: var(--st-text-faint); font-size: 12px; }
.fb-state { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 32px 12px; text-align: center; list-style: none; }
.fb-state__title { margin: 0; color: var(--st-text); font: 600 15px/20px var(--st-font); }
.fb-state__body { margin: 0 0 8px; color: var(--st-text-dim); }
.fb-skeleton { display: flex; flex-direction: column; gap: 12px; list-style: none; }
.fb-skeleton__row { height: 64px; border-radius: 10px; background: var(--st-surface-2); animation: fb-pulse 1.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .fb-skeleton__row, .fb-tile__spin { animation: none; } }
@keyframes fb-pulse { 50% { opacity: 0.5; } }
