html,
body {
  background: #14161c;
  color: var(--text-main);
}

.app-header {
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.app-header h1 {
  margin: 0;
  font-size: 20px;
}

.app-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel {
  background: #1b1e27;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 18px 20px;
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 16px;
  color: var(--text-main);
}

.panel-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel-header-row h2 {
  margin: 0;
}

.panel-hint {
  margin: -6px 0 10px;
  font-size: 13px;
  color: var(--text-dim);
}

.panel-hint code {
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
}

/* ---- Form -------------------------------------------------------------- */

.item-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.field-row {
  display: flex;
  gap: 14px;
}

label {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 600;
}

input[type='text'],
input[type='number'],
textarea {
  background: #10121a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 14px;
  outline: none;
  width: 100%;
}

input[type='text']:focus,
input[type='number']:focus,
textarea:focus {
  border-color: var(--accent);
}

.image-picker {
  display: flex;
  align-items: center;
  gap: 14px;
}

.image-preview {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.form-actions {
  display: flex;
  gap: 10px;
}

/* ---- Buttons ------------------------------------------------------------ */

.btn {
  border: none;
  border-radius: 9px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: #1a1206;
}

.btn-secondary {
  background: #2b2f3b;
  color: var(--text-main);
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-danger {
  background: rgba(255, 107, 107, 0.15);
  color: #ff8a8a;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

.btn:hover:not(:disabled) {
  filter: brightness(1.1);
}

.file-btn {
  display: inline-flex;
  align-items: center;
}

.btn-spin {
  width: 100%;
  padding: 18px;
  font-size: 22px;
  letter-spacing: 2px;
  background: linear-gradient(180deg, #ffe98a, var(--accent));
  color: #1a1206;
  box-shadow: 0 6px 18px rgba(255, 212, 71, 0.35);
}

.panel-spin {
  text-align: center;
}

.spin-status {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--text-dim);
}

/* ---- Item list ----------------------------------------------------------- */

.item-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #14161e;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 8px 10px;
}

.item-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: #2a2f3a;
  flex-shrink: 0;
}

.item-thumb--empty {
  visibility: hidden;
}

.item-info {
  flex: 1;
  min-width: 0;
}

.item-name {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-meta {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

.item-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.empty-hint {
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
  padding: 10px 0 0;
}

.empty-hint[hidden] {
  display: none;
}

/* ---- Import -------------------------------------------------------------- */

.import-textarea {
  resize: vertical;
  margin-bottom: 10px;
  font-family: 'Consolas', monospace;
  font-size: 13px;
}

/* ---- Settings ------------------------------------------------------------ */

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-main);
  font-weight: 500;
  cursor: pointer;
}

.checkbox-row input {
  width: 16px;
  height: 16px;
}

/* ---- History --------------------------------------------------------------- */

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #14161e;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 8px 10px;
}

.history-meta {
  min-width: 170px;
}

.history-title {
  font-size: 13px;
  font-weight: 700;
}

.history-time {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

.history-note {
  flex: 1;
}
