* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f3f6f9; color: #1f2937; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }

.topbar {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%); color: white; padding: 20px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; background: rgba(255,255,255,.18); border-radius: 50%;
  font-size: 26px; font-weight: 700;
}
.brand h1 { margin: 0; font-size: 20px; font-weight: 600; }
.brand p { margin: 0; font-size: 13px; opacity: .85; }

main.wrap { padding-top: 20px; padding-bottom: 60px; }

.info-card {
  background: white; border-radius: 12px; padding: 16px 20px; margin-bottom: 20px;
  border-left: 4px solid #16a34a; box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.info-card strong { display: block; margin-bottom: 8px; color: #15803d; }
.info-card ol { margin: 0; padding-left: 20px; font-size: 14px; }
.info-card li { margin-bottom: 4px; }

.meds { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }

.med-row {
  background: white; border-radius: 12px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.med-row-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.med-row-header .med-no { color: #16a34a; font-size: 15px; }
.med-row label {
  display: block; font-size: 13px; font-weight: 500; color: #4b5563; margin: 10px 0 4px;
}
.med-row input, .med-row select, .med-row textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px;
  font-size: 15px; font-family: inherit; background: #f9fafb; color: #1f2937;
}
.med-row input:focus, .med-row select:focus, .med-row textarea:focus {
  outline: none; border-color: #16a34a; background: white; box-shadow: 0 0 0 3px rgba(22,163,74,.1);
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.btn-remove {
  background: transparent; border: 1px solid #fca5a5; color: #dc2626; padding: 4px 10px;
  border-radius: 6px; font-size: 12px; cursor: pointer;
}
.btn-remove:hover { background: #fef2f2; }

.btn-add {
  width: 100%; background: white; border: 2px dashed #16a34a; color: #16a34a;
  padding: 14px; border-radius: 12px; font-size: 15px; font-weight: 500; cursor: pointer;
  margin-bottom: 16px; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-add:hover { background: #f0fdf4; }
.btn-add span { font-size: 22px; line-height: 1; }

.btn-primary, .btn-secondary {
  width: 100%; padding: 14px; border-radius: 12px; font-size: 16px; font-weight: 600;
  cursor: pointer; border: none; transition: all .15s;
}
.btn-primary {
  background: #16a34a; color: white; box-shadow: 0 2px 6px rgba(22,163,74,.3);
}
.btn-primary:hover:not(:disabled) { background: #15803d; }
.btn-primary:disabled { background: #9ca3af; cursor: not-allowed; box-shadow: none; }
.btn-secondary { background: white; color: #16a34a; border: 1.5px solid #16a34a; }
.btn-secondary:hover { background: #f0fdf4; }

.footer-note { text-align: center; padding: 16px 0; color: #6b7280; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 16px;
}
.modal {
  background: white; border-radius: 16px; padding: 24px; max-width: 420px; width: 100%;
  text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.modal h2 { margin: 0 0 8px; color: #15803d; }
.muted { color: #6b7280; font-size: 13px; margin: 0 0 16px; }

.token-box {
  font-family: 'SF Mono', 'Roboto Mono', Consolas, monospace;
  font-size: 44px; font-weight: 700; letter-spacing: 8px; color: #16a34a;
  background: #f0fdf4; border: 2px dashed #86efac; border-radius: 12px;
  padding: 24px; margin: 16px 0;
}

.token-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.token-actions .btn-secondary { padding: 10px; font-size: 14px; }

.qr-area { margin: 16px 0; }
.qr-area img { max-width: 200px; border: 1px solid #e5e7eb; padding: 8px; background: white; border-radius: 8px; }

@media (max-width: 480px) {
  .grid-2 { grid-template-columns: 1fr; }
  .token-box { font-size: 36px; letter-spacing: 6px; padding: 18px; }
  .topbar { padding: 16px 0; }
  .brand h1 { font-size: 17px; }
}
