*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f2f5;
  color: #1a1a1a;
  line-height: 1.5;
  min-height: 100vh;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

header {
  text-align: center;
  margin-bottom: 20px;
}

h1 {
  font-size: 1.4rem;
  color: #1a73e8;
}

.step {
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 12px;
  padding: 18px 16px;
  margin-bottom: 16px;
}

.step-title {
  font-size: 1rem;
  color: #1a73e8;
  margin-bottom: 12px;
}

.instruction {
  font-size: 0.9rem;
  color: #5f6368;
  margin-bottom: 12px;
}

/* Form */
textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #dadce0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}

textarea:focus {
  border-color: #1a73e8;
}

.form-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.form-row input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #dadce0;
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
}

.form-row input:focus {
  border-color: #1a73e8;
}

.form-row button {
  padding: 10px 20px;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.form-row button:hover {
  background: #1557b0;
}

.error-msg {
  background: #fce8e6;
  color: #c5221f;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-top: 10px;
}

.loading {
  text-align: center;
  padding: 12px;
  color: #5f6368;
  font-size: 0.9rem;
  margin-top: 10px;
}

/* Result */
.result-box {
  background: #fff;
  border: 2px solid #34a853;
  border-radius: 12px;
  padding: 24px 20px;
  margin-bottom: 16px;
  text-align: center;
}

.result-box h2 {
  color: #34a853;
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.result-info {
  margin-bottom: 12px;
}

.result-info strong {
  font-size: 1rem;
}

.link-row {
  display: flex;
  gap: 8px;
}

.link-row input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #dadce0;
  border-radius: 8px;
  font-size: 0.8rem;
  background: #f8f9fa;
  color: #1a1a1a;
}

#copy-btn {
  padding: 10px 18px;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

#copy-btn:hover {
  background: #1557b0;
}

#copy-btn.copied {
  background: #34a853;
}

.copy-ok {
  color: #34a853;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 4px 0 8px;
}

.btn-test {
  display: inline-block;
  margin: 10px 0;
  padding: 10px 24px;
  background: #1a73e8;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.btn-test:hover {
  background: #1557b0;
}

.result-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 10px 0;
}

.btn-maps {
  display: inline-block;
  padding: 10px 24px;
  background: #34a853;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.btn-maps:hover {
  background: #2d8e47;
}

.qr-section {
  margin-top: 16px;
}

#qr-preview {
  width: 200px;
  height: 200px;
  border: 1px solid #dadce0;
  border-radius: 8px;
}

.btn-download {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 24px;
  background: #34a853;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.btn-download:hover {
  background: #2d8e47;
}

.btn-custom-qr {
  display: inline-block;
  margin-top: 8px;
  padding: 10px 24px;
  background: #1a73e8;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.btn-custom-qr:hover {
  background: #1557b0;
}

/* QR Builder promo section */
.qr-builder-promo {
  text-align: center;
  border: 2px solid #1a73e8;
  background: linear-gradient(135deg, #e8f0fe 0%, #fff 100%);
}

.btn-qr-builder {
  display: inline-block;
  margin-top: 12px;
  padding: 12px 32px;
  background: #1a73e8;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.2s;
}

.btn-qr-builder:hover {
  background: #1557b0;
}

.hidden {
  display: none !important;
}

/* History */
.history-card {
  background: #f8f9fa;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.history-header strong {
  font-size: 0.95rem;
  color: #1a73e8;
}

.btn-delete {
  background: none;
  border: none;
  color: #ea4335;
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}

.btn-delete:hover {
  background: #fce8e6;
}

.history-detail {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.8rem;
  line-height: 1.4;
}

.history-label {
  color: #5f6368;
  white-space: nowrap;
  min-width: 90px;
  font-weight: 600;
}

.history-value {
  color: #1a1a1a;
  word-break: break-all;
  font-family: monospace;
  font-size: 0.75rem;
}

.history-link {
  color: #1a73e8;
}

.history-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.btn-small {
  padding: 6px 12px;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-small:hover {
  background: #1557b0;
}

.btn-small.btn-outline {
  background: transparent;
  border: 1px solid #1a73e8;
  color: #1a73e8;
}

.btn-small.btn-outline:hover {
  background: #e8f0fe;
}

.btn-small.copied {
  background: #34a853;
  border-color: #34a853;
  color: #fff;
}

.btn-maps-small {
  background: #34a853 !important;
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-maps-small:hover {
  background: #2d8e47 !important;
}

.btn-danger {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 8px;
  background: transparent;
  border: 1px solid #ea4335;
  color: #ea4335;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-danger:hover {
  background: #fce8e6;
}

@media (max-width: 480px) {
  .form-row {
    flex-direction: column;
  }
  .link-row {
    flex-direction: column;
  }
  .history-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .history-actions {
    margin-top: 6px;
  }
}
