* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: #0f1115;
  color: #e7e9ee;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: #161923;
  border-bottom: 1px solid #262a36;
}
.topbar h1 { font-size: 18px; margin: 0; }
.token-box { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.token-box input {
  background: #0f1115; border: 1px solid #2c313f; color: #e7e9ee;
  padding: 6px 8px; border-radius: 6px; width: 220px;
}

.layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  padding: 16px;
}
.panel {
  background: #161923;
  border: 1px solid #262a36;
  border-radius: 10px;
  padding: 14px;
}
.panel h2 { margin-top: 0; font-size: 15px; }
.hint { color: #8a8fa3; font-size: 13px; }

.inline-form { display: flex; gap: 8px; margin-bottom: 12px; }
.inline-form input {
  flex: 1; background: #0f1115; border: 1px solid #2c313f; color: #e7e9ee;
  padding: 8px; border-radius: 6px;
}
button {
  background: #4b6bfb; color: white; border: none; border-radius: 6px;
  padding: 8px 12px; cursor: pointer; font-size: 13px;
}
button:hover { background: #3d59d6; }
button:disabled { opacity: .5; cursor: default; }

.keyboard-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.keyboard-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; border-radius: 6px; cursor: pointer;
  border: 1px solid transparent; font-size: 13px;
}
.keyboard-item:hover { background: #1d2130; }
.keyboard-item.active { border-color: #4b6bfb; background: #1d2130; }

.status { font-size: 10px; text-transform: uppercase; padding: 2px 6px; border-radius: 10px; }
.status-draft, .status-badge.status-draft { background: #3a3f52; }
.status-processing, .status-badge.status-processing { background: #8a6d1e; }
.status-ready, .status-badge.status-ready { background: #1e8a4c; }
.status-error, .status-badge.status-error { background: #b8283f; }
.status-badge { font-size: 11px; padding: 3px 8px; border-radius: 10px; }

.detail-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.detail-header h2 { margin: 0; font-size: 18px; }

.upload-block { margin-bottom: 20px; }
.photoForm { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; align-items: end; }
.photo-role { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.photo-role input { background: #0f1115; border: 1px solid #2c313f; border-radius: 6px; padding: 6px; color: #e7e9ee; }
.photoForm button { grid-column: 1 / -1; width: fit-content; margin-top: 6px; }

.photoGrid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.photo-card { width: 110px; background: #0f1115; border: 1px solid #2c313f; border-radius: 8px; overflow: hidden; }
.photo-card img { width: 100%; height: 80px; object-fit: cover; display: block; }
.photo-meta { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px; font-size: 10px; }
.photo-role-tag { color: #8a8fa3; }
.deletePhotoBtn { background: transparent; color: #b8283f; padding: 0 4px; font-size: 12px; }
.deletePhotoBtn:hover { background: transparent; color: #ff6b7f; }

.generate-block { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.genStatus { font-size: 12px; color: #8a8fa3; }

.schemeTabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.scheme-tab {
  background: #1d2130; border: 1px solid #2c313f; color: #e7e9ee;
  padding: 6px 10px; border-radius: 6px; font-size: 12px;
}
.scheme-tab.active { background: #4b6bfb; border-color: #4b6bfb; }

.scheme-grid {
  display: grid;
  gap: 4px;
  background: #0f1115;
  border: 1px solid #2c313f;
  border-radius: 8px;
  padding: 10px;
  overflow-x: auto;
}
.key {
  border-radius: 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 12px; text-align: center; padding: 2px; overflow: hidden;
}
.key-char { background: #262a36; }
.key-action { background: #2c3b5c; }
.key-layer { background: #5c3b2c; }
.key-lang-switch { outline: 2px solid #ffb020; }
.key-default { box-shadow: inset 0 0 0 2px #4b6bfb; }
.key-label { font-weight: 600; }
.key-seq { font-size: 9px; color: #d8b98a; margin-top: 2px; }
