.community-publisher-section {
  --converter-night: #22201d;
  --converter-muted: #a9a49b;
}

.community-profile {
  min-height: 112px;
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(320px, 1.15fr);
  align-items: center;
  gap: 30px;
  margin-bottom: 22px;
  padding: 22px 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(242, 240, 234, 0.52);
}

.community-profile-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 15px;
}

.community-profile-avatar {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: hsl(var(--avatar-hue, 22) 62% 47%);
  color: #fff;
  font-size: 14px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.community-profile h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.025em;
}

.community-profile-identity p:last-child {
  margin: 4px 0 0;
  color: var(--ink-muted);
  font-size: 10px;
  line-height: 1.55;
}

.community-profile-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.community-profile-editor label span {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-muted);
  font-size: 9px;
  font-weight: 750;
}

.community-profile-editor input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  outline: none;
}

.community-profile-editor input:focus {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(229, 108, 63, 0.12);
}

.community-profile-editor button {
  height: 40px;
  padding: 0 15px;
  border: 0;
  border-radius: 10px;
  background: var(--night);
  color: var(--white);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.community-profile-editor button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.community-profile-editor > p {
  min-height: 16px;
  grid-column: 1 / -1;
  margin: 0;
  color: #337455;
  font-size: 9px;
}

.community-profile-editor > p.is-error {
  color: #a83f2d;
}

.account-converter {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  background: var(--converter-night);
  color: var(--white);
  box-shadow: 0 24px 58px rgba(38, 32, 24, 0.18);
}

.account-converter-heading {
  min-height: 116px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 26px 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.community-kicker {
  margin: 0 0 6px;
  color: #ef9a73;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.account-converter-heading h2,
.history-heading h2 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 21px;
  letter-spacing: -0.025em;
}

.service-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  color: #d0ccc4;
  font-size: 10px;
  font-weight: 700;
}

.service-state span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #48b982;
  box-shadow: 0 0 0 4px rgba(72, 185, 130, 0.12);
}

.community-publisher-section .converter-form {
  display: grid;
  gap: 17px;
  padding: 28px 30px 32px;
}

.community-publisher-section .file-drop {
  min-height: 142px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 22px;
  border: 1px dashed rgba(255, 255, 255, 0.28);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    transform 180ms ease;
}

.community-publisher-section .file-drop:hover,
.community-publisher-section .file-drop.is-dragging {
  border-color: #ef9a73;
  background: rgba(239, 154, 115, 0.09);
}

.community-publisher-section .file-drop:active {
  transform: scale(0.997);
}
.community-publisher-section .file-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.community-publisher-section .file-drop-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: #ef9a73;
  font-size: 24px;
}
.community-publisher-section .file-drop-copy {
  min-width: 0;
}
.community-publisher-section .file-drop-copy strong {
  display: block;
  overflow: hidden;
  margin-bottom: 5px;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.community-publisher-section .file-drop-copy small {
  display: block;
  color: var(--converter-muted);
  font-size: 10px;
}
.community-publisher-section .file-choose {
  min-width: 92px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
}

.community-publisher-section .field-row {
  min-height: 60px;
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 0 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.community-publisher-section .field-row > span {
  color: #c3beb5;
  font-size: 11px;
  font-weight: 700;
}
.community-publisher-section .field-row input {
  width: 100%;
  height: 38px;
  border: 0;
  border-radius: 9px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.09);
  color: var(--white);
  outline: none;
}
.community-publisher-section .field-row input::placeholder {
  color: #7d7870;
}
.community-publisher-section .field-row input:focus {
  box-shadow: 0 0 0 2px #ef9a73;
}

.community-publisher-section .publish-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--converter-muted);
  font-size: 10px;
  line-height: 1.55;
  cursor: pointer;
}
.community-publisher-section .publish-consent input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}
.community-publisher-section .form-feedback {
  min-height: 19px;
  color: #8ed7b3;
  font-size: 11px;
}
.community-publisher-section .form-feedback.is-error {
  color: #ffad96;
}

.community-publisher-section .submit-template {
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 19px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #251a15;
  font-weight: 800;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    transform 180ms ease,
    opacity 180ms ease;
}

.community-publisher-section .submit-template:hover:not(:disabled) {
  background: #ef9a73;
}
.community-publisher-section .submit-template:active:not(:disabled) {
  transform: scale(0.992);
}
.community-publisher-section .submit-template:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.community-publisher-section .community-publications {
  margin-top: 24px;
  padding: 26px 28px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(242, 240, 234, 0.52);
}

.community-publisher-section .community-publisher {
  margin-top: 24px;
  padding: 27px 28px 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(242, 240, 234, 0.52);
}

.community-publisher-section .community-publish-form {
  display: grid;
  gap: 15px;
}

.community-publisher-section .community-file-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.community-publisher-section .community-file-card {
  min-height: 88px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--paper);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.community-publisher-section .community-file-card:hover {
  border-color: var(--accent-dark);
  background: #fffaf6;
}

.community-publisher-section .community-file-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.community-publisher-section .community-file-card > i {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 18px;
}

.community-publisher-section .community-file-card strong,
.community-publisher-section .community-file-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-publisher-section .community-file-card strong {
  margin-bottom: 4px;
  font-size: 12px;
}

.community-publisher-section .community-file-card small {
  color: var(--ink-muted);
  font-size: 9px;
}

.community-publisher-section .community-name-field {
  min-height: 58px;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.community-publisher-section .community-name-field > span {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
}

.community-publisher-section .community-name-field input,
.community-publisher-section .community-name-field textarea {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8f6f1;
  color: var(--ink);
  outline: none;
}

.community-publisher-section .community-name-field input:focus,
.community-publisher-section .community-name-field textarea:focus {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(229, 108, 63, 0.1);
}

.community-publisher-section .community-description-field {
  align-items: start;
  padding-top: 14px;
  padding-bottom: 14px;
}

.community-publisher-section .community-description-field > span {
  padding-top: 10px;
}

.community-publisher-section .community-description-field textarea {
  min-height: 90px;
  height: auto;
  padding-top: 9px;
  padding-bottom: 9px;
  font: inherit;
  line-height: 1.65;
  resize: vertical;
}

.community-publisher-section .publication-description {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.community-publisher-section .community-consent {
  color: var(--ink-muted);
}

.community-publisher-section .community-feedback {
  color: #337455;
}

.community-publisher-section .community-submit {
  background: var(--night);
  color: var(--white);
}

.community-publisher-section .community-submit:hover:not(:disabled) {
  background: var(--accent-dark);
}

.community-publisher-section .community-publications {
  margin-bottom: 14px;
}

.community-publisher-section .publication-list {
  border-top: 1px solid var(--line);
}

.community-publisher-section .publication-item {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line);
}

.community-publisher-section .publication-files {
  display: flex;
  align-items: center;
  gap: 6px;
}

.community-publisher-section .publication-files button {
  max-width: 190px;
  overflow: hidden;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.community-publisher-section .publication-files button:hover:not(:disabled) {
  border-color: var(--accent-dark);
  color: var(--accent-dark);
}

.community-publisher-section .publication-files button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.community-publisher-section .publication-delete {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid #e5b4a8;
  border-radius: 9px;
  background: #fff4f1;
  color: #a33f2d;
  font-size: 9px;
  font-weight: 750;
  cursor: pointer;
}

.community-publisher-section .publication-delete:disabled {
  opacity: 0.5;
  cursor: wait;
}

.community-publisher-section .history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}
.community-publisher-section .history-heading p {
  margin: 5px 0 0;
  color: var(--ink-muted);
  font-size: 10px;
}
.community-publisher-section .refresh-history {
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.community-publisher-section .refresh-history:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}
.community-publisher-section .history-list {
  border-top: 1px solid var(--line);
}
.community-publisher-section .history-item {
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(110px, 0.55fr) auto;
  align-items: center;
  gap: 18px;
  padding: 13px 2px;
  border-bottom: 1px solid var(--line);
}
.community-publisher-section .history-name {
  min-width: 0;
}
.community-publisher-section .history-name strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.community-publisher-section .history-name small,
.community-publisher-section .history-meta small {
  display: block;
  color: var(--ink-muted);
  font-size: 9px;
}
.community-publisher-section .history-meta strong {
  display: block;
  margin-bottom: 2px;
  font-size: 11px;
}
.community-publisher-section .history-state {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e8e5de;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
}
.community-publisher-section .history-state.is-succeeded {
  background: #dceee4;
  color: #276b4b;
}
.community-publisher-section .history-state.is-failed {
  background: #f4ded8;
  color: #9c3d2b;
}
.community-publisher-section .history-state.is-processing {
  background: #f2e6d4;
  color: #9a5a1d;
}
.community-publisher-section .history-download {
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--night);
  color: var(--white);
  font-size: 10px;
  font-weight: 800;
  border: 0;
  cursor: pointer;
}
.community-publisher-section .history-download:hover {
  background: var(--accent-dark);
}
.community-publisher-section .history-download:disabled {
  cursor: wait;
  opacity: 0.58;
}
.community-publisher-section .history-message {
  padding: 34px 0;
  color: var(--ink-muted);
  text-align: center;
  font-size: 11px;
}
.community-publisher-section .history-loading {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.community-publisher-section .history-loading span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-muted);
  animation: converter-loading 1.2s ease-in-out infinite;
}
.community-publisher-section .history-loading span:nth-child(2) {
  animation-delay: 120ms;
}
.community-publisher-section .history-loading span:nth-child(3) {
  animation-delay: 240ms;
}

@keyframes converter-loading {
  50% {
    opacity: 0.25;
    transform: translateY(-3px);
  }
}

@media (max-width: 820px) {
  .community-profile {
    grid-template-columns: 1fr;
  }
  .community-publisher-section .history-item {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }
  .community-publisher-section .history-meta {
    display: none;
  }
}

@media (max-width: 620px) {
  .community-profile {
    padding: 19px;
  }
  .community-profile-editor {
    grid-template-columns: 1fr;
  }
  .account-converter-heading,
  .community-publisher-section .history-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .community-publisher-section .converter-form {
    padding: 22px 18px 24px;
  }
  .community-publisher-section .file-drop {
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 132px;
    padding: 18px 15px;
  }
  .community-publisher-section .file-choose {
    display: none;
  }
  .community-publisher-section .field-row {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 13px 0;
  }
  .community-publisher-section .community-publications {
    padding: 22px 16px 15px;
  }
  .community-publisher-section .community-publisher {
    padding: 22px 16px;
  }
  .community-publisher-section .community-file-grid {
    grid-template-columns: 1fr;
  }
  .community-publisher-section .community-name-field {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 12px;
  }
  .community-publisher-section .publication-item {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .community-publisher-section .publication-files {
    display: none;
  }
  .community-publisher-section .history-item {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }
  .community-publisher-section .history-state {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .community-publisher-section .history-loading span {
    animation: none;
  }
}
