:root {
  color-scheme: dark;
}

body {
  background-color: #0b1220;
}

.app-bg {
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(232, 160, 23, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(36, 80, 140, 0.25), transparent 50%),
    linear-gradient(180deg, #0b1220 0%, #121a2b 45%, #0b1220 100%);
}

.app-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.role-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(26, 36, 56, 0.95), rgba(18, 26, 43, 0.9));
  border-radius: 1rem;
  padding: 1.5rem 1.25rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.role-card:active,
.role-card:hover {
  transform: translateY(-2px);
  border-color: rgba(232, 160, 23, 0.45);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.field-label {
  display: block;
  font-size: 0.75rem;
  color: #8b9bb8;
  margin-bottom: 0.35rem;
  letter-spacing: 0.02em;
}

.field {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(18, 26, 43, 0.9);
  padding: 0.75rem 0.9rem;
  color: #fff;
  outline: none;
  transition: border-color 0.15s ease;
}

.field:focus {
  border-color: rgba(232, 160, 23, 0.6);
}

.field-file {
  width: 100%;
  font-size: 0.875rem;
  color: #8b9bb8;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  background: linear-gradient(180deg, #f5b942, #e8a017);
  color: #0b1220;
  font-weight: 600;
  padding: 0.85rem 1.25rem;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.btn-primary:active {
  transform: scale(0.98);
  filter: brightness(0.95);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: #fff;
  font-weight: 500;
  padding: 0.85rem 1.25rem;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.65rem;
  border: 1px solid rgba(245, 185, 66, 0.35);
  color: #f5b942;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.85rem;
}

.back-link {
  color: #8b9bb8;
  font-size: 0.875rem;
}

.order-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(18, 26, 43, 0.75);
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  text-align: left;
  width: 100%;
  transition: border-color 0.15s ease;
}

.order-item:hover {
  border-color: rgba(232, 160, 23, 0.35);
}

.status-pill {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f5b942;
  border: 1px solid rgba(245, 185, 66, 0.3);
  border-radius: 0.35rem;
  padding: 0.15rem 0.45rem;
}

.chat-bubble {
  max-width: 85%;
  border-radius: 0.85rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.4;
}

.chat-bubble.mine {
  margin-left: auto;
  background: rgba(232, 160, 23, 0.2);
  border: 1px solid rgba(232, 160, 23, 0.25);
}

.chat-bubble.theirs {
  margin-right: auto;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-bubble.system {
  margin: 0.35rem auto;
  max-width: 95%;
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  color: #9aa8b8;
  font-size: 0.78rem;
}

.chat-bubble.price {
  margin: 0.4rem auto;
  max-width: 92%;
  text-align: center;
  background: rgba(232, 160, 23, 0.12);
  border: 1px solid rgba(232, 160, 23, 0.35);
  color: #f5d089;
  font-weight: 600;
}

.price-panel {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 0.9rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(245, 185, 66, 0.25);
}

.price-panel h3 {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9aa8b8;
  font-weight: 600;
}

.price-panel .deal {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f5b942;
  margin: 0.25rem 0 0.65rem;
}

.price-panel .hint {
  font-size: 0.78rem;
  color: #8b9bb0;
  margin: 0 0 0.75rem;
  line-height: 1.35;
}

.price-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.price-row input {
  flex: 1;
  min-width: 0;
}

.price-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.toast {
  position: fixed;
  left: 1rem;
  right: 1rem;
  top: calc(0.85rem + env(safe-area-inset-top));
  bottom: auto;
  z-index: 200;
  border-radius: 0.85rem;
  background: #fff;
  color: #0f1c16;
  border: 1px solid rgba(14, 159, 99, 0.28);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 10px 28px rgba(12, 40, 28, 0.14);
  animation: fade-up 0.25s ease;
  pointer-events: none;
}
.toast.hidden {
  display: none !important;
}

.animate-fade-up {
  animation: fade-up 0.45s ease both;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.load-bar {
  width: 40%;
  animation: load-slide 1.1s ease-in-out infinite;
}

@keyframes load-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(280%); }
}

.screen.hidden {
  display: none !important;
}
