/* Scoped add-on. Uses existing theme tokens only. */
.ir-cta {
  position: fixed;
  z-index: 35;
  inset-inline-start: max(12px, env(safe-area-inset-left));
  bottom: calc(12px + var(--ir-cta-lift, 0px) + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right));
  min-height: 44px;
  margin: 0;
  padding: 8px 14px;
  border: 1px solid color-mix(in srgb, var(--ud-brand, #7c3aed) 35%, var(--ud-border, #ececef));
  border-radius: 999px;
  background: color-mix(in srgb, var(--ud-brand, #7c3aed) 12%, var(--ud-canvas, #fff));
  color: var(--ud-brand, #7c3aed);
  font-family: var(--font-sans, Vazirmatn, Tahoma, sans-serif);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  box-shadow: 0 8px 24px var(--ud-shadow, rgb(15 23 42 / 0.06));
  overflow: hidden;
}

.ir-cta__action {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--ud-brand, #7c3aed);
  color: #fff;
  white-space: nowrap;
}

.ir-cta__prompt {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 420px) {
  .ir-cta__prompt {
    display: none;
  }
}

.ir-form-page {
  margin: 0;
  min-height: 100vh;
  background: var(--ud-canvas, #fff);
  color: var(--ud-text, #0b1220);
  font-family: var(--font-sans, Vazirmatn, Tahoma, sans-serif);
}

.ir-form-top {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 0 16px;
  border-bottom: 1px solid var(--ud-border, #ececef);
}

.ir-form-top a {
  color: var(--ud-text, #0b1220);
  font-weight: 800;
  text-decoration: none;
}

.ir-form-wrap {
  box-sizing: border-box;
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.ir-form-wrap h1 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.ir-form-lead {
  margin: 0 0 20px;
  color: var(--ud-text-muted, #5a6478);
  font-size: 0.95rem;
}

.ir-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 16px;
}

.ir-field span,
.ir-field legend {
  font-size: 0.95rem;
  font-weight: 700;
}

.ir-field input,
.ir-field select,
.ir-field textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--ud-border, #ececef);
  border-radius: 12px;
  background: var(--ud-input-bg, #fff);
  color: var(--ud-text, #0b1220);
  font: inherit;
  font-size: 16px;
}

.ir-field textarea {
  min-height: 140px;
  resize: vertical;
}

.ir-date {
  display: grid;
  grid-template-columns: 1.2fr 1.4fr 1fr;
  gap: 8px;
}

.ir-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.ir-choices label {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--ud-border, #ececef);
  border-radius: 999px;
  background: var(--ud-surface, #fafafb);
  font-size: 16px;
}

.ir-choices input {
  width: auto;
  min-height: 0;
  margin-inline-end: 6px;
}

.ir-error {
  margin: 0;
  color: var(--ud-danger, #dc2626);
  font-size: 0.9rem;
}

.ir-submit {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: var(--ud-brand, #7c3aed);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.ir-submit:disabled {
  opacity: 0.7;
  cursor: progress;
}

.ir-success a {
  color: var(--ud-brand, #7c3aed);
  font-weight: 800;
}

.ir-detail {
  display: grid;
  gap: 10px;
  margin: 0;
}

.ir-detail div {
  padding: 12px;
  border: 1px solid var(--ud-border, #ececef);
  border-radius: 12px;
  background: var(--ud-surface, #fafafb);
}

.ir-detail dt {
  color: var(--ud-text-muted, #5a6478);
  font-size: 0.85rem;
}

.ir-detail dd {
  margin: 4px 0 0;
  font-size: 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ir-proposals {
  display: grid;
  gap: 12px;
  margin: 20px 0 0;
}

.ir-proposals__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.ir-proposals__empty {
  margin: 0;
  color: var(--ud-text-muted, #5a6478);
  font-size: 0.95rem;
}

.ir-proposal {
  padding: 14px;
  border: 1px solid var(--ud-border, #ececef);
  border-radius: 12px;
  background: var(--ud-surface, #fafafb);
}

.ir-proposal__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
  font-weight: 800;
}

.ir-proposal__meta {
  margin: 0 0 6px;
  color: var(--ud-text-muted, #5a6478);
  font-size: 0.92rem;
}

.ir-proposal__message {
  margin: 0 0 12px;
  font-size: 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ir-proposal__select {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: var(--ud-brand, #7c3aed);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.ir-proposal__select:disabled {
  opacity: 0.7;
  cursor: progress;
}

.ir-proposal__badge {
  color: var(--ud-brand, #7c3aed);
  font-size: 0.9rem;
  font-weight: 800;
}
