:root {
  --bg: #0f172a;
  --panel: #111827;
  --panel2: #1f2937;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --blue: #2563eb;
  --green: #16a34a;
  --red: #dc2626;
  --yellow: #ca8a04;
  --border: rgba(255,255,255,.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, system-ui, Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(37,99,235,.18), transparent 32rem),
    radial-gradient(circle at bottom right, rgba(22,163,74,.12), transparent 28rem),
    var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card, .panel, .stat-card, .topbar {
  background: rgba(17,24,39,.78);
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
  backdrop-filter: blur(12px);
}

.auth-card {
  width: min(420px, 100%);
  padding: 28px;
  border-radius: 24px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 24px;
}

.brand h1, .brand p { margin: 0; }
.brand p, .brand span { color: var(--muted); font-size: 14px; }

.logo {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--blue), #7c3aed);
  font-weight: 800;
}

.form, .create-form {
  display: grid;
  gap: 12px;
}

label { color: var(--muted); font-size: 14px; }

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(15,23,42,.9);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
}

textarea {
  min-height: 90px;
  resize: vertical;
  font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(37,99,235,.8);
}

input[type="file"] {
  cursor: pointer;
}

.btn {
  border: 0;
  border-radius: 14px;
  padding: 11px 16px;
  color: white;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  background: var(--panel2);
}

.btn.primary { background: var(--blue); }
.btn.danger { background: var(--red); }
.btn.warning { background: var(--yellow); }
.btn.success { background: var(--green); }
.btn.ghost { background: rgba(255,255,255,.06); border: 1px solid var(--border); }
.btn.danger-outline { background: transparent; border: 1px solid rgba(220,38,38,.5); color: #fecaca; }
.btn.small { padding: 8px 10px; border-radius: 10px; font-size: 12px; }
.btn.icon-btn {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  padding: 0;
}

.icon-btn .bi {
  font-size: 16px;
  line-height: 1;
}

.alert {
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 16px;
}
.alert.error { background: rgba(220,38,38,.15); border: 1px solid rgba(220,38,38,.35); }
.alert.success { background: rgba(22,163,74,.15); border: 1px solid rgba(22,163,74,.35); }

.callback-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.callback-card h1,
.callback-card p {
  margin: 0;
}

.callback-card p {
  color: var(--muted);
  line-height: 1.5;
}

.callback-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-size: 30px;
}

.callback-icon.success {
  color: #bbf7d0;
  background: rgba(22,163,74,.16);
  border: 1px solid rgba(22,163,74,.35);
}

.callback-icon.error {
  color: #fecaca;
  background: rgba(220,38,38,.16);
  border: 1px solid rgba(220,38,38,.35);
}

.callback-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 14px 22px;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  align-items: center;
}

.brand.mini { margin-bottom: 0; }
.brand.mini .logo { width: 40px; height: 40px; border-radius: 14px; }

.header-menu {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(15,23,42,.62);
}

.header-menu-item {
  min-height: 38px;
  border: 0;
  border-radius: 12px;
  padding: 0 13px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}

.header-menu-item:hover,
.header-menu-item:focus-visible,
.header-menu-item.active {
  background: rgba(255,255,255,.08);
  color: var(--text);
  outline: none;
}

.header-menu-item.active {
  background: rgba(37,99,235,.22);
  color: #bfdbfe;
}

.nav-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav-actions form {
  display: flex;
  margin: 0;
}

.nav-actions .btn,
.nav-actions button {
  min-height: 42px;
  padding: 0 16px;
  line-height: 1;
  white-space: nowrap;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 60px;
}

.dashboard-container {
  display: grid;
  gap: 16px;
}

.dashboard-container .panel {
  margin-bottom: 0;
}

.dashboard-container .stats-grid {
  margin-bottom: 0;
}

.keys-page .stat-card,
.keys-page .panel {
  border-radius: 18px;
}

.keys-create-panel {
  padding: 18px;
}

.keys-list-panel {
  width: 100%;
}

.dashboard-section {
  scroll-margin-top: 96px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.stat-card {
  border-radius: 22px;
  padding: 18px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.stat-card strong.stat-storage {
  font-size: 18px;
  line-height: 1.25;
}

.stat-card strong.stat-updated {
  animation: statPulse .42s ease;
}

@keyframes statPulse {
  0% { color: #bfdbfe; transform: translateY(-1px); }
  100% { color: var(--text); transform: translateY(0); }
}

.panel {
  border-radius: 24px;
  padding: 20px;
  margin-bottom: 16px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.panel h2, .panel p { margin: 0; }
.panel p { color: var(--muted); margin-top: 4px; }

.search { max-width: 280px; }

.datatable-toolbar,
.datatable-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.datatable-footer {
  margin-top: 14px;
  margin-bottom: 0;
}

.datatable-length {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.datatable-length select {
  border: 1px solid var(--border);
  background: rgba(15,23,42,.9);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 10px;
  outline: none;
}

.datatable-info,
.datatable-page {
  color: var(--muted);
  font-size: 13px;
}

.datatable-pagination {
  display: flex;
  gap: 8px;
  align-items: center;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.license-table {
  min-width: 1080px;
}

.col-name { width: 22%; }
.col-key { width: 25%; }
.col-status { width: 10%; }
.col-device { width: 16%; }
.col-date { width: 15%; }
.col-count { width: 8%; }
.col-action { width: 104px; text-align: right; }

.license-table .col-license-name { width: 17%; }
.license-table .col-license-owner { width: 17%; }
.license-table .col-key { width: 22%; }
.license-table .col-count { width: 72px; }
.license-table .col-date { width: 13%; }
.license-table .col-status { width: 92px; }
.license-table .col-action { width: 104px; text-align: right; }

th {
  color: var(--muted);
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

th.sortable::after {
  content: "^";
  color: rgba(148,163,184,.55);
  margin-left: 8px;
  font-size: 11px;
}

th.sort-asc::after {
  content: "^";
  color: var(--text);
}

th.sort-desc::after {
  content: "v";
  color: var(--text);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.confirm-modal,
.account-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(2,6,23,.68);
  backdrop-filter: blur(8px);
}

.confirm-modal.show,
.account-modal.show {
  display: grid;
}

.confirm-dialog,
.account-dialog {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(17,24,39,.96);
  box-shadow: 0 24px 70px rgba(0,0,0,.42);
}

.confirm-dialog {
  grid-template-columns: 44px 1fr;
}

.account-dialog {
  width: min(520px, 100%);
}

.modal-head {
  margin-bottom: 0;
}

.account-form {
  display: grid;
  gap: 12px;
}

.account-page .panel {
  width: 100%;
}

.account-panel {
  margin-top: 8px;
}

.account-stats {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: stretch;
}

.account-stats .stat-card {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.account-stats .stat-card strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-table {
  min-width: 920px;
  table-layout: fixed;
}

.account-table .col-name {
  width: 30%;
}

.account-table .col-role {
  width: 110px;
}

.account-table .col-key {
  width: 22%;
}

.account-table .col-action {
  width: 96px;
}

.account-row-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.account-identity,
.account-password-fields {
  display: flex;
  gap: 8px;
  align-items: center;
}

.account-identity input,
.account-password-fields input,
.account-role-select {
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
}

.account-role-select {
  width: 100%;
}

.account-password-fields input {
  width: 100%;
}

.account-password-fields {
  grid-column: 1 / -1;
}

.account-row-form .btn {
  align-self: stretch;
  min-width: 64px;
}

.account-form > div {
  display: grid;
  gap: 8px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.confirm-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fde68a;
  background: rgba(202,138,4,.16);
}

.confirm-icon .bi {
  font-size: 20px;
}

.confirm-content h3,
.confirm-content p {
  margin: 0;
}

.confirm-content h3 {
  font-size: 17px;
}

.confirm-content p {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.confirm-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

#toast-container > div {
  border-radius: 12px;
  box-shadow: 0 16px 42px rgba(0,0,0,.32);
  opacity: 1;
}

#toast-container > .toast-success {
  background-color: #16a34a;
}

#toast-container > .toast-error {
  background-color: #dc2626;
}

#toast-container > .toast-warning {
  background-color: #ca8a04;
}

td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: rgba(255,255,255,.025);
}

tbody tr.heartbeat-online {
  background: rgba(22,163,74,.08);
}

tbody tr.heartbeat-online:hover {
  background: rgba(22,163,74,.12);
}

tbody tr.heartbeat-online td:first-child {
  box-shadow: inset 3px 0 0 rgba(22,163,74,.85);
}

code {
  background: rgba(255,255,255,.06);
  padding: 5px 7px;
  border-radius: 8px;
  word-break: break-all;
}

.copy-key {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: copy;
  text-align: left;
  min-width: 0;
}

.license-key,
.device-id,
.api-key {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.copy-key.copied .license-key,
.copy-key.copied .api-key {
  background: rgba(22,163,74,.22);
  color: #bbf7d0;
}

.device-id {
  color: #cbd5e1;
}

.date-value,
.muted-value {
  color: var(--muted);
}

.count-value {
  display: inline-flex;
  min-width: 28px;
  justify-content: center;
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(255,255,255,.06);
  color: #cbd5e1;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.badge.green { color: #bbf7d0; background: rgba(22,163,74,.18); }
.badge.red { color: #fecaca; background: rgba(220,38,38,.18); }
.badge.yellow { color: #fde68a; background: rgba(202,138,4,.18); }

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

@media (max-width: 800px) {
  .topbar, .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .header-menu {
    width: 100%;
    justify-content: stretch;
  }

  .header-menu-item {
    flex: 1 1 0;
  }

  .nav-actions {
    width: 100%;
  }

  .nav-actions .btn,
  .nav-actions form,
  .nav-actions button {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .search { max-width: 100%; }

  .datatable-toolbar,
  .datatable-footer,
  .datatable-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .datatable-length,
  .datatable-length select,
  .datatable-pagination .btn {
    width: 100%;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-actions .btn {
    width: 100%;
  }

  table, thead, tbody, th, td, tr {
    display: block;
  }

  table {
    table-layout: auto;
  }

  thead { display: none; }

  tr {
    background: rgba(255,255,255,.03);
    border: 1px solid var(--border);
    border-radius: 16px;
    margin-bottom: 12px;
    padding: 12px;
  }

  td {
    border-bottom: 0;
    padding: 8px 0;
  }

  td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 4px;
  }

  .actions .btn, .actions form {
    width: 100%;
  }

  .actions {
    justify-content: stretch;
  }

  .actions .icon-btn {
    width: 100%;
    flex-basis: auto;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .account-stats {
    grid-template-columns: 1fr;
  }

  .container {
    width: min(100% - 20px, 1180px);
  }

  .auth-card, .panel {
    border-radius: 18px;
    padding: 16px;
  }
}


.form-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  align-items: end;
}

.form-row > div {
  display: grid;
  gap: 8px;
}

.hint {
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 700px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}


.form-row.three {
  grid-template-columns: minmax(220px, 1fr) 160px minmax(180px, 240px);
}

.form-row.four {
  grid-template-columns: 1fr 1fr 160px 180px;
}

.form-row.two {
  grid-template-columns: 160px 1fr;
}

.patch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.release-grid {
  grid-template-columns: minmax(0, 1fr);
}

.release-layout {
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.release-panel .panel-head .btn {
  min-width: 110px;
}

.release-form {
  position: sticky;
  top: 88px;
}

.public-patch-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.public-patch-channel {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(17,24,39,.62);
  box-shadow: 0 18px 44px rgba(0,0,0,.18);
}

.home-container {
  display: grid;
  gap: 16px;
  max-width: 1040px;
}

.home-hero {
  min-height: 220px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(37,99,235,.26), rgba(22,163,74,.12)),
    rgba(17,24,39,.72);
  box-shadow: 0 24px 70px rgba(0,0,0,.26);
}

.home-kicker {
  display: inline-flex;
  margin-bottom: 10px;
  color: #bfdbfe;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.home-hero h1 {
  margin: 0;
  font-size: 52px;
  line-height: 1;
  overflow-wrap: anywhere;
}

.home-hero p {
  max-width: 580px;
  margin: 14px 0 0;
  color: #dbeafe;
  font-size: 17px;
  line-height: 1.55;
}

.home-summary {
  display: grid;
  grid-template-columns: 140px;
  gap: 12px;
  justify-items: stretch;
}

.home-summary div {
  padding: 16px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  background: rgba(15,23,42,.58);
}

.home-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.home-summary strong {
  display: block;
  margin-top: 8px;
  font-size: 34px;
}

.home-summary .btn {
  justify-content: center;
  width: 100%;
}

.channel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.channel-head h2 {
  margin: 9px 0 0;
  font-size: 20px;
}

.latest-patch-card {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(37,99,235,.28);
  border-radius: 14px;
  background: rgba(37,99,235,.10);
}

.latest-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(37,99,235,.22);
  color: #bfdbfe;
}

.latest-icon .bi {
  font-size: 24px;
}

.latest-content {
  min-width: 0;
}

.latest-content span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.latest-content h3 {
  margin: 3px 0;
  font-size: 28px;
}

.latest-content p {
  margin: 8px 0;
  color: var(--muted);
  line-height: 1.45;
}

.release-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.release-meta span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
}

.patch-history-title {
  padding-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.home-empty {
  min-height: 132px;
  display: grid;
  place-items: center;
}

.patch-channel {
  display: grid;
  gap: 12px;
  align-content: start;
}

.patch-form {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,.025);
}

.patch-form.is-uploading {
  border-color: rgba(37,99,235,.45);
}

.file-field {
  min-height: 46px;
  display: flex;
  min-width: 0;
  gap: 10px;
  align-items: center;
  border: 1px dashed rgba(148,163,184,.45);
  border-radius: 14px;
  padding: 11px 13px;
  background: rgba(15,23,42,.72);
  color: var(--text);
  cursor: pointer;
}

.file-field:hover,
.file-field:focus-within {
  border-color: rgba(37,99,235,.8);
  background: rgba(37,99,235,.10);
}

.file-field span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-progress {
  display: none;
  gap: 8px;
}

.upload-progress[aria-hidden="false"] {
  display: grid;
}

.upload-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.upload-progress-head strong {
  color: #bfdbfe;
}

.upload-progress-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.upload-progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}

.upload-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #16a34a);
  transition: width .18s ease;
}

.patch-title {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
}

.patch-title h3,
.patch-list-head h3 {
  margin: 8px 0 0;
  font-size: 16px;
}

.patch-state {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.patch-state.active {
  color: #bbf7d0;
}

.patch-link {
  display: inline-flex;
  min-width: 0;
  gap: 8px;
  align-items: center;
  color: #bfdbfe;
  font-size: 13px;
  font-weight: 700;
}

.patch-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.patch-link.muted {
  color: var(--muted);
}

.patch-list {
  display: grid;
  gap: 10px;
}

.release-list-section .patch-list {
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148,163,184,.45) transparent;
}

.release-list-section .patch-list::-webkit-scrollbar {
  width: 8px;
}

.release-list-section .patch-list::-webkit-scrollbar-track {
  background: transparent;
}

.release-list-section .patch-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(148,163,184,.38);
}

.release-list-section {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.patch-list-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  min-height: 36px;
}

.patch-list-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.patch-empty,
.patch-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.025);
}

.patch-empty {
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
}

.patch-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px;
  align-items: start;
}

.public-patch-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.025);
}

.patch-meta {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.patch-version {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.patch-version span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.patch-version .badge {
  font-size: 11px;
}

.patch-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.patch-actions {
  display: flex;
  gap: 8px;
  align-items: start;
}

.inline-name-form {
  display: flex;
  align-items: center;
  min-width: 0;
  width: 100%;
}

.inline-name-form input,
.inline-name-form select {
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  width: 100%;
}

.auto-save-form.is-saving {
  opacity: .72;
  pointer-events: none;
}

.owner-id {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .form-row.three {
    grid-template-columns: 1fr;
  }

  .form-row.four,
  .form-row.two,
  .patch-grid,
  .release-layout,
  .public-patch-grid {
    grid-template-columns: 1fr;
  }

  .release-form {
    position: static;
  }

  .patch-item,
  .public-patch-item {
    grid-template-columns: 1fr;
  }

  .home-hero,
  .latest-patch-card {
    grid-template-columns: 1fr;
  }

  .home-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-hero {
    padding: 24px;
  }

  .home-hero h1 {
    font-size: 38px;
  }

  .patch-actions {
    align-items: stretch;
  }

  .patch-actions form,
  .patch-actions .btn {
    width: 100%;
  }

  .patch-list-head {
    align-items: start;
    flex-direction: column;
  }

  .inline-name-form {
    min-width: 0;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .account-row-form {
    min-width: 0;
    grid-template-columns: 1fr;
  }

  .account-identity,
  .account-password-fields {
    align-items: stretch;
    flex-direction: column;
  }

  .account-password-fields input {
    width: 100%;
  }

  .account-row-form .btn {
    width: 100%;
  }
}
