* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f0f1a;
  color: #e0e0e0;
  min-height: 100vh;
}
.header {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  padding: 20px;
  text-align: center;
  border-bottom: 2px solid #0f3460;
}
.header h1 {
  font-size: 1.8em;
  background: linear-gradient(90deg, #00d2ff, #3a7bd5);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.header p {
  color: #888;
  margin-top: 4px;
  font-size: 0.9em;
}
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
}
/* Scanner section */
.scanner-section {
  background: #1a1a2e;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid #2a2a4a;
}
.scanner-section h2 {
  font-size: 1.1em;
  margin-bottom: 12px;
  color: #aaa;
}
#reader {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
}
#reader video {
  border-radius: 8px;
}
/* Scanned cards list */
.cards-section {
  background: #1a1a2e;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid #2a2a4a;
}
.cards-section h2 {
  font-size: 1.1em;
  margin-bottom: 12px;
  color: #aaa;
}
.cards-tip {
  margin: -4px 0 12px;
  color: #9ab3d6;
  font-size: 0.88em;
}
.cards-tip strong {
  color: #c6dbf5;
}
.card-list {
  list-style: none;
}
.card-item {
  background: #16213e;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 64px;
}
.card-item .card-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 8px;
}
.card-item .card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.card-item .card-info .card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: space-between;
}
.card-item .card-title-input {
  background: transparent;
  border: 1px solid #3a3a5a;
  color: #e0e0e0;
  padding: 4px 8px;
  border-radius: 4px;
  width: 100%;
  font-size: 0.9em;
  height: 28px;
}
.card-item .card-data {
  font-family: monospace;
  font-size: 0.8em;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  min-width: 0;
}
.card-item .card-type {
  font-size: 0.7em;
  color: #3a7bd5;
  background: rgba(58, 123, 213, 0.1);
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
  line-height: 1.2;
  flex-shrink: 0;
  margin-left: auto;
}
.card-item .card-preview {
  background: #fff;
  border-radius: 4px;
  max-width: 100%;
  height: auto;
  align-self: center;
  display: none;
}
.card-item .card-preview.visible {
  display: block;
}
.card-item .card-error {
  font-size: 0.75em;
  color: #ff6b6b;
  line-height: 1.2;
}
.card-item .card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-top: 0;
}
.card-item .card-remove {
  background: none;
  border: none;
  color: #ff4757;
  cursor: pointer;
  font-size: 1.2em;
  padding: 4px;
  flex-shrink: 0;
  line-height: 1;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-item .card-color-select {
  background: #16213e;
  border: 1px solid #3a3a5a;
  color: #e0e0e0;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 0.75em;
  flex-shrink: 0;
  height: 28px;
}
.empty-state {
  text-align: center;
  padding: 30px;
  color: #555;
}
.empty-state .icon {
  font-size: 2em;
  margin-bottom: 8px;
}
/* Actions */
.actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.btn {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background: linear-gradient(135deg, #3a7bd5, #00d2ff);
  color: white;
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(58, 123, 213, 0.4);
}
.btn-danger {
  background: #2a2a4a;
  color: #ff4757;
  border: 1px solid #ff4757;
}
/* PIN display */
.pin-section {
  background: #1a1a2e;
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 20px;
  border: 2px solid #3a7bd5;
  text-align: center;
  display: none;
}
.pin-section.visible {
  display: block;
}
.pin-section h2 {
  color: #3a7bd5;
  margin-bottom: 8px;
}
.pin-code {
  font-size: 3em;
  font-weight: 800;
  letter-spacing: 0.15em;
  font-family: "Courier New", monospace;
  background: linear-gradient(90deg, #00d2ff, #3a7bd5);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 16px 0;
  cursor: pointer;
  position: relative;
  display: inline-block;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.15s;
}
.pin-code.imported {
  opacity: 0.3;
}
.pin-code:hover {
  transform: scale(1.04);
}
.pin-code:active {
  transform: scale(0.97);
}
.pin-copy-hint {
  font-size: 0.28em;
  color: #666;
  letter-spacing: 0;
  display: block;
  margin-top: 2px;
  -webkit-text-fill-color: #666;
  font-weight: 400;
  transition: all 0.2s;
}
.pin-copy-hint.copied {
  -webkit-text-fill-color: #00d2ff;
  color: #00d2ff;
}
#pinText {
  display: inline-block;
}
#pinText.imported {
  text-decoration: line-through;
}
.pin-copy-hint.imported {
  -webkit-text-fill-color: #888;
  color: #888;
}
.pin-instructions {
  color: #888;
  font-size: 0.9em;
  line-height: 1.6;
}
.pin-instructions ol {
  text-align: left;
  display: inline-block;
  margin-top: 10px;
}
.pin-instructions li {
  margin-bottom: 4px;
}
.pin-expiry {
  color: #ff4757;
  font-size: 0.8em;
  margin-top: 12px;
}
/* Status messages */
.status {
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 0.9em;
  display: none;
}
.status.error {
  display: block;
  background: rgba(255, 71, 87, 0.1);
  color: #ff4757;
  border: 1px solid rgba(255, 71, 87, 0.3);
}
.status.success {
  display: block;
  background: rgba(0, 210, 255, 0.1);
  color: #00d2ff;
  border: 1px solid rgba(0, 210, 255, 0.3);
}
.status.info {
  display: block;
  background: rgba(255, 200, 0, 0.1);
  color: #ffc800;
  border: 1px solid rgba(255, 200, 0, 0.3);
}
/* Manual entry */
.manual-section {
  background: #1a1a2e;
  border-radius: 12px;
  margin-bottom: 20px;
  border: 1px solid #2a2a4a;
  overflow: hidden;
}
.manual-header {
  padding: 16px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  -webkit-user-select: none;
}
.manual-header:active {
  background: rgba(255, 255, 255, 0.03);
}
.manual-section h2 {
  font-size: 1.1em;
  color: #aaa;
  margin: 0;
}
.manual-chevron {
  color: #666;
  font-size: 0.8em;
  transition: transform 0.2s;
}
.manual-section.expanded .manual-chevron {
  transform: rotate(180deg);
}
.manual-content {
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.3s ease,
    padding 0.3s ease;
  padding: 0 20px;
}
.manual-section.expanded .manual-content {
  max-height: 200px;
  padding: 0 20px 20px;
}
.manual-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.manual-row input,
.manual-row select {
  background: #16213e;
  border: 1px solid #3a3a5a;
  color: #e0e0e0;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.9em;
}
.manual-row input {
  flex: 1;
}
.btn-small {
  padding: 8px 16px;
  font-size: 0.9em;
}
/* Pin section footer links */
.pin-footer {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #2a2a4a;
}
.pin-footer-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid #3a3a5a;
  color: #888;
  font-size: 0.82em;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}
.pin-footer-link:hover {
  border-color: #3a7bd5;
  color: #aac8e8;
  background: rgba(58, 123, 213, 0.08);
}
.pin-footer-link .link-icon {
  font-size: 1.1em;
  line-height: 1;
}
.pin-footer-link.mobile-only {
  display: none;
}
@media (hover: none) and (pointer: coarse) {
  .pin-footer-link.mobile-only {
    display: inline-flex;
  }
}
.pin-store-link {
  color: #3a7bd5;
  text-decoration: underline;
}
.pin-import-status {
  display: none;
}
.pin-import-status.visible {
  display: block;
}
.pin-actions {
  margin-top: 16px;
}
.pin-code.expired {
  opacity: 0.3;
}
.card-color[data-color="16777215"] {
  background: #ffffff;
}
.card-color[data-color="16711680"] {
  background: #ff0000;
}
.card-color[data-color="65280"] {
  background: #00ff00;
}
.card-color[data-color="255"] {
  background: #0000ff;
}
.card-color[data-color="16776960"] {
  background: #ffff00;
}
.card-color[data-color="16711935"] {
  background: #ff00ff;
}
.card-color[data-color="65535"] {
  background: #00ffff;
}
.card-color[data-color="16753920"] {
  background: #ff8c00;
}
.card-color[data-color="8388736"] {
  background: #800080;
}
.card-color[data-color="16761035"] {
  background: #ff69cb;
}
.card-color[data-color="9127187"] {
  background: #8b6914;
}
.card-color[data-color="8421504"] {
  background: #808080;
}
