/* Page surfaces for existing Gitea layouts; native controls and data stay intact. */
.page-content:not(.repo-landing):not(.avue-dashboard) {
  padding-bottom: 32px;
}

/* Personal issue and pull-request work queues. */
.page-content.dashboard.issues .flex-container-nav {
  align-self: flex-start;
  padding: 8px;
  border: 1px solid var(--avue-border);
  border-radius: var(--avue-radius);
  background: var(--avue-surface);
}
.page-content.dashboard.issues .flex-container-nav > .ui.menu {
  margin: 0;
}
.page-content.dashboard.issues .flex-container-nav .item {
  border-radius: 8px;
  line-height: 1.5;
}
.page-content.dashboard.issues .flex-container-main {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--avue-border);
  border-radius: var(--avue-radius);
  background: var(--avue-surface);
  box-shadow: var(--avue-shadow);
}
.page-content.dashboard.issues .list-header {
  margin-bottom: 12px;
}
.page-content:is(.dashboard.issues, .repository.issue-list) #issue-list > .flex-item {
  padding-block: 18px;
  border-color: var(--avue-border);
}
.page-content:is(.dashboard.issues, .repository.issue-list) #issue-list .issue-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.65;
}
.page-content:is(.dashboard.issues, .repository.issue-list) #issue-list .flex-item-body {
  margin-top: 5px;
  line-height: 1.65;
}
.page-content.repository.issue-list #issue-list {
  border: 1px solid var(--avue-border);
  border-radius: var(--avue-radius);
  background: var(--avue-surface);
  box-shadow: var(--avue-shadow);
}
.page-content.repository.issue-list #issue-list > .flex-item {
  padding-inline: 18px;
}
.page-content.repository.issue-list #issue-list > .flex-item:last-child {
  border-bottom: 0;
}
.page-content.repository.issue-list .issue-list-toolbar {
  border-color: var(--avue-border);
}

/* Repository header, description, comments and release cards. */
.page-content.repository .repo-description {
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid var(--avue-border);
  border-radius: var(--avue-radius);
  background: var(--avue-surface);
}
.page-content.repository #repo-desc {
  line-height: 1.7;
}
.page-content.repository .repo-button-row {
  margin-block: 16px;
}
.page-content.repository .comment-container > .comment-header {
  padding: 14px 16px;
}
.page-content.repository .comment-container > .comment-body {
  padding: 20px;
}
.page-content.repository .issue-content-right {
  padding: 16px;
  border: 1px solid var(--avue-border);
  border-radius: var(--avue-radius);
  background: var(--avue-surface);
  align-self: flex-start;
}
.page-content.repository.releases #release-list > li.ui.grid {
  margin-block: 20px;
  margin-inline: 0;
  border: 1px solid var(--avue-border);
  border-radius: var(--avue-radius);
  background: var(--avue-surface);
  box-shadow: var(--avue-shadow);
}
.page-content.repository.releases #release-list .meta {
  padding-top: 22px;
}
.page-content.repository.releases #release-list .detail {
  padding: 22px;
  background: transparent;
}
.page-content.repository.releases .release-list-title {
  line-height: 1.5;
}
.page-content.repository.releases details.download > summary {
  color: var(--avue-accent);
  font-weight: 600;
}
/* Branch/tag tables keep their native columns, status labels and dropdown overflow. */
.page-content.repository:is(.branches, .tags) .ui.attached.table.segment {
  border-bottom-left-radius: var(--avue-radius);
  border-bottom-right-radius: var(--avue-radius);
  background: var(--avue-surface);
  box-shadow: var(--avue-shadow);
}
.page-content.repository:is(.branches, .tags) .ui.table > tbody > tr > td,
.page-content.repository.tags #tags-table > tbody > tr > td.tag {
  padding: 16px 18px;
  border-color: var(--avue-border);
}
.page-content.repository.branches .info {
  line-height: 1.65;
}
.page-content.repository.tags .release-tag-name {
  font-size: 18px;
  line-height: 1.5;
}
.page-content.repository.tags .release-tag-name > a {
  overflow-wrap: anywhere;
  white-space: normal;
}
.page-content.repository.tags .tag .download {
  flex-wrap: wrap;
  row-gap: 8px;
  line-height: 1.6;
}
.page-content .milestone-list > .milestone-card {
  margin-bottom: 16px;
  padding: 20px;
  border: 1px solid var(--avue-border);
  border-radius: var(--avue-radius);
  background: var(--avue-surface);
  box-shadow: var(--avue-shadow);
}

/* Profile and organization repository lists share the same row treatment. */
.page-content:is(.user.profile, .organization.profile) .flex-list {
  border: 1px solid var(--avue-border);
  border-radius: var(--avue-radius);
  background: var(--avue-surface);
  box-shadow: var(--avue-shadow);
}
.page-content:is(.user.profile, .organization.profile) .flex-list > .flex-item {
  padding: 20px;
  border-color: var(--avue-border);
}
.page-content:is(.user.profile, .organization.profile) .flex-list > .flex-item:last-child {
  border-bottom: 0;
}
.page-content:is(.user.profile, .organization.profile) .flex-item-body {
  line-height: 1.7;
}
.page-content.user.profile #profile-avatar {
  justify-content: center;
  padding: 24px;
  background: var(--avue-tint);
}
.page-content.user.profile #profile-avatar .image {
  width: 160px;
  max-width: 100%;
}
.page-content.user.profile #profile-avatar-card .content {
  border-color: var(--avue-border);
}
.page-content.user.profile #profile-avatar-card .profile-avatar-name {
  padding: 18px;
}
.page-content.organization.profile > .ui.container.tw-flex {
  margin-bottom: 20px;
  padding: 22px;
  border: 1px solid var(--avue-border);
  border-radius: var(--avue-radius);
  background: linear-gradient(110deg, var(--avue-tint), var(--avue-surface));
}
.page-content.organization.profile #org-info {
  min-width: 0;
}
.page-content.organization.profile #org-info .ui.header {
  flex-wrap: wrap;
  row-gap: 10px;
}

/* Settings preserve all original forms, readonly fields and section order. */
.page-content:is(.user.settings, .repository.settings, .organization.settings) .flex-container-nav .ui.vertical.menu {
  padding: 6px;
  border-radius: var(--avue-radius);
}
.page-content:is(.user.settings, .repository.settings, .organization.settings) .flex-container-nav .ui.vertical.menu > .item {
  border-radius: 7px;
}
.page-content:is(.user.settings, .repository.settings, .organization.settings) .flex-container-main .ui.attached.segment {
  padding: 24px;
}
.page-content.user.settings .user-setting-content > .ui.attached.segment {
  border-bottom-left-radius: var(--avue-radius);
  border-bottom-right-radius: var(--avue-radius);
}
.page-content:is(.repository.settings, .organization.settings) .flex-container-main .ui.attached.segment:not(:has(+ .ui.attached.segment)) {
  border-bottom-left-radius: var(--avue-radius);
  border-bottom-right-radius: var(--avue-radius);
}
.page-content.user.settings :is(#username, #signed-user-email) {
  overflow-wrap: anywhere;
}
.page-content.user.settings .user-setting-content > .ui.top.attached.header:not(:first-child) {
  margin-top: 24px;
}

/* Notification rows remain read-only unless their native actions are used. */
.page-content #notification_table {
  border: 1px solid var(--avue-border);
  border-radius: var(--avue-radius);
  background: var(--avue-surface);
  box-shadow: var(--avue-shadow);
}
.page-content #notification_table .notifications-item {
  border-color: var(--avue-border);
}
.page-content.user.notification #notification_table .notifications-item {
  /* The existing tw-p-2 utility declares padding as important. */
  padding: 16px 18px !important;
}
.page-content.user.notification #notification_table .notifications-item:not(:last-child) {
  border-bottom: 1px solid var(--avue-border);
}
.page-content.user.notification #notification_table .notifications-link {
  row-gap: 4px;
  line-height: 1.6;
}
.page-content #notification_table .notifications-link {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 767px) {
  /* The native mobile form rule otherwise stretches visible checkboxes over labels. */
  body:not(:has(.repo-landing)) .page-content .ui.form .ui.checkbox:not(.toggle, .slider) > input:is([type="checkbox"], [type="radio"]) {
    width: 16px !important;
  }
  .page-content.dashboard.issues .flex-container-main {
    padding: 14px;
  }
  .page-content.dashboard.issues .flex-container-nav {
    width: 100%;
  }
  .page-content.repository .repo-description {
    padding: 14px;
  }
  .page-content.repository .issue-content-right {
    padding: 12px;
  }
  .page-content.repository.releases #release-list .detail {
    padding: 16px;
  }
  .page-content.repository.releases #release-list > li.ui.grid > .column:is(.meta, .detail) {
    width: 100% !important;
    min-width: 0;
  }
  .page-content.repository.releases #release-list .meta {
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--avue-border);
    text-align: left;
    overflow-wrap: anywhere;
  }
  .page-content.repository.branches .info {
    flex-wrap: wrap;
    white-space: normal;
    row-gap: 4px;
  }
  .page-content.repository.branches .info .commit-message {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  .page-content.user.notification #notification_table .notifications-item {
    padding: 14px !important;
  }
  .page-content:is(.user.profile, .organization.profile) .flex-list > .flex-item,
  .page-content .milestone-list > .milestone-card {
    padding: 16px;
  }
  .page-content.user.profile #profile-avatar .image {
    width: 96px;
  }
  .page-content.organization.profile > .ui.container.tw-flex {
    padding: 16px;
  }
  .page-content:is(.user.settings, .repository.settings, .organization.settings) .flex-container-main .ui.attached.segment {
    padding: 16px;
  }
}
