#twinks-admin {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
  font: 15px/1.5 system-ui, sans-serif;
  background: var(--fishes);
  border-radius: 20px;
  color: rgb(var(--text));
}

#audit-all {
  width: 200px !important;
}

/* ===== header / grid ===== */

.twinks-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1em;
}

.twinks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px 30px;
}

/* ===== main blocks ===== */

.main-block {
  background: rgb(var(--pun), .5);
  border-radius: 10px;
  padding: 12px 16px;
  transition: background .2s ease;
}

.main-block:hover {
  background: rgb(var(--pun), .7);
}

.main-block.highlight {
  outline: 2px solid rgb(var(--acc1));
  border-radius: 8px;
  background: rgba(108, 192, 255, 0.08);
  transition: background 0.4s ease;
}

#twinks-list {
    max-height: 900px;
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.main-name a {
  font-weight: 600;
  color: rgb(var(--acc1));
  text-decoration: none;
}

.main-name a:hover {
  text-decoration: underline;
}

/* ===== edit button ===== */

.edit-btn {
  opacity: 0;
  transition: opacity .2s ease;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: rgb(var(--acc1));
}

.main-block:hover .edit-btn {
  opacity: 1;
}

/* ===== twinks list ===== */

.twinks-list {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.twink-name {
  position: relative;
  padding-left: 10px;
  font-size: 14px;
  color: rgb(var(--text));
  text-decoration: none;
}

.twink-name::before {
  position: absolute;
  left: 0;
  color: rgb(var(--acc1));
}

.twink-name:hover {
  text-decoration: underline;
}

/* дополнения */

.twink-name {
  font-size: 12px;
  margin-left: 6px;
  user-select: none;
  color: rgb(var(--acc1));
}

/* ===== buttons ===== */

.primary {
  background: rgb(var(--acc1));
  color: rgb(var(--pun));
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .2s ease;
}

.primary:hover {
  background: rgb(var(--acc2));
}

.danger {
  background: #515151;
  color: rgb(var(--pun));
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}

/* ===== modal ===== */

#twinks-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.5);
  z-index: 9999;
  opacity: 0;
  transition: opacity .25s ease;
}

#twinks-modal.visible {
  display: flex;
  opacity: 1;
}

.twinks-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.25s;
}

.twinks-backdrop.visible {
  display: flex;
  opacity: 1;
}

/* ===== modal inner ===== */

.twinks-modal-inner {
  background: rgb(var(--pun));
  color: rgb(var(--text));
  padding: 20px;
  border-radius: 12px;
  width: 400px;
  max-width: 90%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow:
    0 8px 32px rgba(0,0,0,.25),
    0 4px 20px rgba(0,0,0,.4);
}

.twinks-modal-inner input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid rgb(var(--pun), .5);
  border-radius: 6px;
  margin-bottom: 8px;
}

.twinks-modal-inner button {
  padding: 6px 10px !important;
}

/* ===== rows ===== */

.twink-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0;
}

.twink-row input {
  flex: 1;
}

.twinks-modal-btns {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

/* ===== input + hint ===== */

.twink-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.twink-hint {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 10001;
  display: none;
  flex-direction: column;
  max-height: 180px;
  overflow: auto;
  width: 100%;
  padding: 4px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  background: rgb(var(--pun), 0.5);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.twink-hint.visible {
  display: flex;
  opacity: 1;
}

.twink-hint div {
  padding: 4px 6px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s;
}

.twink-hint div:hover {
  background: rgba(255, 255, 255, 0.1);
}