#contact-form .sgqm-counter {
  margin-top: 0.45rem;
  color: var(--text-faint, #8b95a5);
  font-size: 0.78rem;
  text-align: left;
  direction: rtl;
}

#contact-form .sgqm-counter--near-limit {
  color: #d97706;
}

#contact-form .sgqm-upload-toggle-wrap {
  margin: -0.35rem 0 1.1rem;
}

#contact-form .sgqm-upload-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border, #d9dee7);
  border-radius: var(--radius-sm, 8px);
  background: var(--surface);
  color: var(--text) !important;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.5;
  text-align: right;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

#contact-form .sgqm-upload-toggle:hover {
  background: var(--surface-strong);
}

#contact-form .sgqm-upload-toggle:focus-visible {
  outline: 2px solid #ef4056;
  outline-offset: 2px;
}

#contact-form .sgqm-upload-chevron {
  width: 0.45rem;
  height: 0.45rem;
  margin-inline-start: 0.25rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.25s ease;
}

#contact-form .sgqm-upload-toggle-wrap--expanded .sgqm-upload-chevron {
  transform: rotate(225deg);
}

#contact-form .sgqm-upload-collapse {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transition: grid-template-rows 0.28s ease, opacity 0.2s ease, visibility 0s linear 0.28s;
}

#contact-form .sgqm-upload-toggle-wrap--expanded .sgqm-upload-collapse {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  transition: grid-template-rows 0.28s ease, opacity 0.2s ease, visibility 0s;
}

#contact-form .sgqm-upload-collapse-inner {
  min-height: 0;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  #contact-form .sgqm-upload-toggle,
  #contact-form .sgqm-upload-chevron,
  #contact-form .sgqm-upload-collapse {
    transition: none;
  }
}

#contact-form .sgqm-uploads {
  margin: 0.75rem 0 0;
  padding: 0.85rem;
  border: 1px dashed var(--border, #d9dee7);
  border-radius: var(--radius-sm, 8px);
  background: rgba(127, 127, 127, 0.035);
}

#contact-form .sgqm-upload-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
  margin-bottom: 0.7rem;
  font-size: 0.83rem;
}

#contact-form .sgqm-upload-head span {
  color: var(--text-faint, #8b95a5);
  font-size: 0.75rem;
}

#contact-form .sgqm-file-button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: auto !important;
  margin: 0 !important;
  padding: 0.55rem 0.9rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm, 8px);
  background: var(--surface);
  color: var(--text) !important;
  cursor: pointer;
  font-size: 0.82rem !important;
  font-weight: 600;
  line-height: 1.5;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, filter 0.2s ease;
}

#contact-form .sgqm-file-button:hover {
  background: var(--surface-strong);
  color: var(--text) !important;
  filter: none;
}

#contact-form .sgqm-file-button:focus-visible,
#contact-form .sgqm-file-button:focus-within {
  outline: 2px solid #ef4056;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(201, 47, 69, 0.35);
}

#contact-form .sgqm-file-button:active {
  background: var(--surface-strong);
  color: var(--text) !important;
}

#contact-form .sgqm-file-button:disabled,
#contact-form .sgqm-file-button:has(input:disabled) {
  background: #6b7280;
  border-color: #6b7280;
  color: #fff !important;
  cursor: not-allowed;
  opacity: 0.72;
}

html[data-theme="night"] #contact-form .sgqm-file-button {
  background: var(--surface);
  border-color: #e45568;
  color: var(--text) !important;
}

html[data-theme="night"] #contact-form .sgqm-file-button:hover {
  background: var(--surface-strong);
  color: var(--text) !important;
}

html[data-theme="night"] #contact-form .sgqm-file-button:focus-visible,
html[data-theme="night"] #contact-form .sgqm-file-button:focus-within {
  outline-color: #fff;
  box-shadow: 0 0 0 4px rgba(233, 85, 104, 0.55);
}

html[data-theme="night"] #contact-form .sgqm-file-button:active {
  background: var(--surface-strong);
  color: var(--text) !important;
}

html[data-theme="night"] #contact-form .sgqm-file-button:disabled,
html[data-theme="night"] #contact-form .sgqm-file-button:has(input:disabled) {
  background: #4b5563;
  border-color: #6b7280;
  color: #fff !important;
}

#contact-form .sgqm-file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#contact-form .sgqm-file-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

#contact-form .sgqm-file-list:empty {
  display: none;
}

#contact-form .sgqm-file {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem;
  border-radius: var(--radius-sm, 8px);
  background: rgba(127, 127, 127, 0.07);
}

#contact-form .sgqm-file img {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 5px;
}

#contact-form .sgqm-file span {
  min-width: 0;
  overflow: hidden;
  color: var(--text-muted, #667085);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#contact-form .sgqm-file button {
  padding: 0.25rem 0.55rem;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #dc2626;
  cursor: pointer;
  font-size: 0.78rem;
}

#contact-form .sgqm-file button:hover {
  background: rgba(220, 38, 38, 0.08);
}

#contact-form .form-note.error {
  color: #dc2626;
  font-weight: 600;
}

#contact-form button[type="submit"]:disabled {
  cursor: wait;
  opacity: 0.65;
}
