.key-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.keys-title,
.key-actions,
.key-command {
  display: flex;
  align-items: center;
  gap: 8px;
}
.keys-title {
  gap: 10px;
}
.keys-title > .key-icon {
  width: 20px;
  height: 20px;
  color: #646d70;
}
.key-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  background: transparent;
  border-color: transparent;
}
.key-icon-button:hover {
  background: #eef1f0;
}
.key-icon-button[data-copied] {
  color: #117d68;
}
.key-icon-button[data-copy-error] {
  color: #ba3f46;
}
.key-icon-button:disabled,
.key-command:disabled,
#key-group:disabled {
  cursor: default;
}
.key-delete-action {
  color: #73797c;
}
.key-delete-action:hover {
  color: #ba3f46;
  background: #fff0f0;
}
.key-filters {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(120px, 170px) minmax(120px, 140px);
  gap: 12px;
  margin-bottom: 24px;
}
.key-search {
  position: relative;
}
.key-search > .key-icon {
  position: absolute;
  left: 12px;
  top: 12px;
  color: #73797c;
  pointer-events: none;
}
.key-search input {
  padding-left: 36px;
}
.key-filters select,
.key-create-form select {
  font: inherit;
  color: inherit;
  width: 100%;
  min-width: 0;
  border: 1px solid #d8dddd;
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
  min-height: 40px;
}
.key-filters label {
  min-width: 0;
}
.keys-table {
  table-layout: fixed;
  white-space: normal;
}
.keys-table th:first-child {
  width: 31%;
}
.keys-table th:nth-child(2) {
  width: 16%;
}
.keys-table th:nth-child(3) {
  width: 12%;
}
.keys-table th:nth-child(4) {
  width: 20%;
}
.keys-table th:last-child {
  width: 185px;
}
.keys-table td,
.keys-table th {
  padding: 10px 12px;
  overflow-wrap: anywhere;
}
.keys-table th {
  background: #f7f8f8;
  padding-block: 10px;
}
.keys-table tr:hover td {
  background: #fbfcfc;
}
.keys-table tr.key-highlight {
  outline: none;
}
.keys-table tr.key-highlight td {
  animation: key-highlight 3s ease-out forwards;
}
.keys-table tr.key-highlight td:first-child {
  box-shadow: inset 3px 0 0 #117d68;
}
@keyframes key-highlight {
  from {
    background-color: #d5efe6;
  }
  70% {
    background-color: #e9f6f1;
  }
  to {
    background-color: transparent;
  }
}
.keys-table .key-actions-heading {
  text-align: right;
  padding-right: 50px;
}
.keys-table .key-actions {
  justify-content: flex-end;
  gap: 6px;
}
.key-identity {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 3px;
  min-width: 0;
}
.key-identity-copy {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  max-width: 100%;
}
.key-name {
  display: block;
  margin-bottom: 2px;
  font-weight: 600;
}
.key-credentials {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  max-width: 100%;
}
.key-credential-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  grid-column: 2;
  grid-row: 1;
  align-self: center;
}
.key-credential-actions .key-icon-button {
  width: 28px;
  height: 28px;
  min-height: 28px;
}
.key-value {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  color: #6c7377;
  font-size: 12px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  scrollbar-width: thin;
}
.key-group-badge {
  display: inline-block;
  color: #466a87;
  background: #eef4f8;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 12px;
}
.key-status {
  color: #6c7377;
  font-size: 12px;
}
.key-status::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 1px;
}
.key-status[data-status='active'] {
  color: #117d68;
}
.key-status[data-status='expired'],
.key-status[data-status='quota_exhausted'] {
  color: #ba3f46;
}
.key-dates span,
.key-dates small {
  display: block;
}
.key-dates small {
  color: #73797c;
  font-size: 11px;
  margin-top: 1px;
}
.key-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  color: #73797c;
  font-size: 12px;
}
#key-page {
  min-width: 42px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.keys-empty {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #eff1f0;
  color: #73797c;
  gap: 12px;
}
.keys-empty > .key-icon {
  width: 28px;
  height: 28px;
}
.keys-empty p {
  margin: 0;
}
.key-message {
  border-left: 2px solid #16836b;
  padding: 10px 12px;
  margin: 0 0 16px;
  background: #eff7f3;
  color: #20624f;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.key-message[data-error='true'] {
  border-color: #ba3f46;
  color: #a13940;
  background: #fff2f2;
}
.key-message[data-note='true'] {
  border-color: #b7791f;
  color: #7a4f0c;
  background: #fdf6e7;
}
.key-dialog {
  border: 1px solid #d8dddd;
  border-radius: 8px;
  padding: 24px;
  color: #25282a;
  background: #fff;
  width: 460px;
  max-width: calc(100% - 32px);
  max-height: calc(100dvh - 32px);
  box-shadow: 0 20px 70px #00000026;
}
.key-dialog::backdrop {
  background: #1b232866;
}
body:has(.key-dialog[open]) {
  overflow: hidden;
}
.key-dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.key-dialog-heading h2 {
  font-size: 18px;
  line-height: 1.5;
  margin-top: 3px;
}
.key-dialog-heading > div {
  min-width: 0;
}
.key-dialog-heading .key-field-note {
  margin-top: 4px;
  margin-bottom: 0;
}
.key-create-form {
  display: grid;
  gap: 20px;
}
.key-field-note {
  color: #73797c;
  font-size: 12px;
  overflow-wrap: anywhere;
}
#key-group-detail {
  margin: -10px 0 0;
}
.key-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid #e5e7e7;
  padding-top: 20px;
  margin-top: 4px;
}
.key-guide-dialog {
  width: 740px;
}
.key-guide-dialog[open] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.key-guide-dialog .key-dialog-heading,
.key-guide-dialog .key-dialog-footer {
  flex-shrink: 0;
}
.key-guide-body {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}
.key-guide-secret {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 34px;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
}
.key-guide-secret code {
  overflow-wrap: anywhere;
  font-size: 12px;
}
.key-guide-details {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  margin: 0 0 24px;
  padding-top: 16px;
  border-top: 1px solid #e5e7e7;
}
.key-guide-details dt {
  color: #73797c;
  font-size: 12px;
  margin-bottom: 4px;
}
.key-guide-details dd {
  margin: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.key-platform {
  border: 0;
  display: flex;
  padding: 0;
  margin: 0 0 4px;
  border-bottom: 1px solid #e5e7e7;
}
.key-platform label {
  position: relative;
  display: block;
  cursor: pointer;
  margin-bottom: -1px;
}
.key-platform input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.key-platform span {
  display: block;
  padding: 8px 14px 10px;
  color: #555e62;
  border-bottom: 2px solid transparent;
}
.key-platform input:checked + span {
  color: #168f78;
  border-bottom-color: #168f78;
}
.key-platform input:focus-visible + span {
  outline: 2px solid #168f78;
  outline-offset: -2px;
}
.key-auth-mode {
  margin: 0 0 20px;
  padding: 16px;
  border: 1px solid #e5e7e7;
  border-radius: 8px;
}
.key-auth-mode-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 500;
}
.key-auth-mode .key-field-note {
  margin: 0 0 12px;
}
.key-mode-switch {
  border: 0;
  display: flex;
  padding: 4px;
  margin: 0;
  border-radius: 8px;
  background: #eef1f0;
}
.key-mode-switch label {
  position: relative;
  display: block;
  flex: 1;
  cursor: pointer;
}
.key-mode-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.key-mode-switch span {
  display: block;
  padding: 8px 14px;
  border-radius: 6px;
  text-align: center;
  color: #555e62;
}
.key-mode-switch input:checked + span {
  color: #168f78;
  background: #fff;
  box-shadow: 0 1px 3px #00000012;
}
.key-mode-switch input:focus-visible + span {
  outline: 2px solid #168f78;
  outline-offset: 1px;
}
.key-guide-instruction {
  margin: 16px 0 20px;
  font-size: 13px;
  color: #555e62;
}
.key-file {
  margin-bottom: 20px;
}
.key-file-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7e7;
  background: #f0f3f2;
}
.key-file-heading strong {
  font-size: 13px;
  font-weight: 600;
}
.key-file-heading code {
  display: block;
  color: #73797c;
  font-size: 11px;
  overflow-wrap: anywhere;
}
.key-file pre {
  margin: 0;
  padding: 14px;
  background: #f7f8f8;
  color: #3a4b55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.8;
}
.key-file code,
.key-value,
.key-guide-secret code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.key-delete-warning {
  margin: 0 0 16px;
  color: #5c6468;
}
#key-delete-name {
  display: block;
  overflow-wrap: anywhere;
  margin-bottom: 24px;
}
button.key-danger {
  background: #b54047;
  border-color: #b54047;
  color: #fff;
}
button.key-danger:hover {
  background: #9d343b;
}
@media (max-width: 800px) {
  .keys-table,
  .keys-table tbody {
    display: block;
  }
  .keys-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .keys-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px 8px;
    padding: 20px 0;
    border-top: 1px solid #e5e7e7;
  }
  .keys-table td {
    border: 0;
    padding: 0;
    min-width: 0;
  }
  .keys-table td:first-child {
    grid-column: 1 / -1;
  }
  .keys-table td:nth-child(3) {
    text-align: right;
  }
  .key-identity {
    width: 100%;
  }
  .key-credential-actions .key-icon-button {
    width: 34px;
    height: 34px;
  }
  .key-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .key-search {
    grid-column: 1 / -1;
  }
}
@media (max-width: 480px) {
  .keys-heading {
    gap: 8px;
  }
  .keys-title > .key-icon {
    display: none;
  }
  .keys-heading .key-actions {
    gap: 4px;
  }
  .key-dialog {
    padding: 20px;
    max-width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
  }
  .key-guide-details {
    grid-template-columns: minmax(0, 1fr);
  }
  .key-guide-secret {
    grid-template-columns: minmax(0, 1fr) 34px;
  }
  .key-guide-secret > span {
    grid-column: 1 / -1;
  }
}
