:root {
  --bg: #0b0b10;
  --panel: #13131a;
  --muted: #8b8ca3;
  --text: #e7e7f0;
  --accent: #7c8cff;
  --border: #272833;
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #0b0b10, #0e0e14);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Inter, Ubuntu,
    sans-serif;
}

.wrap {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.card {
  width: min(960px, 100%);
  background: color-mix(in oklab, var(--panel) 90%, #000);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px 24px 28px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

h1 {
  margin: 0 0 8px;
  font-size: 28px;
  letter-spacing: -0.01em;
}

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

.hidden {
  display: none !important;
}

.banner {
  font-size: 0.8rem;
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--text);
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 880px) {
  .grid {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

.drop {
  border: 1px dashed var(--border);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
}

.drop.drop-disabled {
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.drop.dragging {
  border-color: var(--accent);
  background: rgba(124, 140, 255, 0.14);
}

.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.actions {
  margin-top: 12px;
  display: flex;
}

.actions .btn {
  flex: 1;
}

button,
.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: #1a1b24;
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
}

button:hover,
.btn:hover {
  border-color: #3a3b4e;
}

.btn-callout {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 140, 255, 0.18);
  background: #20223a;
}

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

.btn.icon {
  padding: 0 12px;
  font-size: 22px;
  line-height: 1;
  background: transparent;
}

.btn.accent {
  border-color: var(--accent);
  background: rgba(124, 140, 255, 0.18);
}

.btn.accent:hover {
  border-color: var(--accent);
  background: rgba(124, 140, 255, 0.26);
}

button:focus-visible,
.btn:focus-visible,
input:focus-visible,
a:focus-visible,
.code:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(124, 140, 255, 0.2);
}

input[type='text'],
input[type='file'] {
  width: 100%;
  border: 1px solid var(--border);
  background: #0f1016;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
}

input[type='text'].field-invalid {
  border-color: #ff7575;
  box-shadow: 0 0 0 2px rgba(255, 117, 117, 0.2);
}

.preview {
  width: 160px;
  height: 160px;
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f1016;
  overflow: hidden;
  position: relative;
}

.preview-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 160px;
  margin: 0 auto;
}

.preview img {
  transition: filter 160ms ease, transform 160ms ease;
}

.preview img.is-blurred {
  filter: blur(18px);
  transform: scale(1.05);
}

.preview-mask {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(12, 13, 20, 0.78);
  border-radius: inherit;
  pointer-events: none;
}

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

.panel .field + .field {
  margin-top: 12px;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.label-row .muted {
  text-transform: none;
  letter-spacing: normal;
  font-size: 12px;
}

.label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas,
    'Liberation Mono', monospace;
}

.detail-list {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(15, 16, 22, 0.8);
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-list.is-placeholder {
  color: var(--muted);
  font-size: 13px;
}

.detail-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.detail-row:first-child {
  padding-top: 0;
}

.detail-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.detail-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-value {
  color: var(--text);
  font-size: 15px;
  white-space: pre-wrap;
  word-break: break-word;
}

.generic-raw {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #0f1016;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 240px;
  overflow: auto;
}

.cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 880px) {
  .cols {
    grid-template-columns: 1fr 1fr;
  }
}

.panel {
  border: 1px solid var(--border);
  background: #12131b;
  border-radius: 18px;
  padding: 16px;
}

.panel-full {
  grid-column: 1 / -1;
}

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

.secret-value {
  word-break: break-all;
}

.secret-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.code {
  font-size: 48px;
  text-align: center;
  font-weight: 700;
  transition: filter 160ms ease;
}

.code.is-blurred {
  filter: blur(16px);
}

.code-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}

.code-mask {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(12, 13, 20, 0.82);
  border-radius: 12px;
  pointer-events: none;
}

.small {
  font-size: 13px;
}

.footer {
  margin-top: 32px;
  display: flex;
  justify-content: center;
}

.footer a {
  color: var(--muted);
  text-decoration: none;
}

.footer a:hover {
  color: var(--accent);
}

.camera-modal {
  position: fixed;
  inset: 0;
  background: rgba(6, 7, 12, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 400;
}

.camera-modal.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.camera-content {
  width: min(480px, 100%);
  background: rgba(16, 17, 24, 0.95);
  border: 1px solid rgba(124, 140, 255, 0.24);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 32px 56px rgba(6, 7, 12, 0.6);
}

.camera-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.camera-header h2 {
  margin: 0;
  font-size: 18px;
}

.camera-body {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #0f1016;
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.camera-body video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#camera-permission {
  position: absolute;
  text-align: center;
  padding: 12px;
}

.camera-controls {
  display: flex;
  gap: 12px;
}

.camera-controls .btn {
  flex: 1;
  justify-content: center;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(320px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(25, 27, 40, 0.92);
  color: var(--text);
  border: 1px solid rgba(124, 140, 255, 0.35);
  box-shadow: 0 18px 40px rgba(6, 7, 12, 0.55);
  font-size: 14px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 500;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}
