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

:root {
  --gm-blue: #ef8b1e;
  --gm-blue-hover: #d97b16;
  --gm-text: #2f2a24;
  --gm-muted: #6f655b;
  --gm-border: #dbc9b4;
  --gm-surface: #fff8f0;
  --gm-danger: #d93025;
  --font-display: 'Google Sans', 'Roboto', Arial, sans-serif;
  --font-body: 'Roboto', Arial, sans-serif;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: #f6efe6;
  color: var(--gm-text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
}

.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  background: #fffdf9;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 10px 12px;
  border-bottom: 0;
  position: sticky;
  top: 0;
  background: #fffdf9;
  z-index: 10;
}

.top-bar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 100%;
}

.top-bar-deco {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gm-blue);
  opacity: 0.92;
}

.top-bar-icon {
  display: block;
}

.top-bar-title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-display);
  font-size: clamp(15px, 4.2vw, 18px);
  font-weight: 700;
  letter-spacing: 0.15px;
  line-height: 1.25;
  text-align: center;
}

.brand-banner {
  margin: 10px 16px 0;
  padding: clamp(10px, 3vw, 12px) clamp(6px, 1.8vw, 10px) clamp(10px, 3vw, 12px) clamp(10px, 3vw, 14px);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(10px, 4vw, 60px);
  border: 1px solid #ead9c7;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff8ef, #fffdf9);
  min-height: clamp(128px, 32vw, 158px);
}

.brand-side-logo {
  width: 100%;
  height: auto;
  display: block;
  align-self: center;
  justify-self: center;
}

.brand-question-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(8px, 2.4vw, 12px);
  padding: 2px 0;
  text-align: left;
}

.brand-spotlight {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 6.2vw, 1.75rem);
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #a65e4e;
}

.brand-line {
  display: block;
  width: 100%;
}

.brand-heart {
  display: inline-block;
  font-size: clamp(1.05rem, 4.8vw, 1.35rem);
  line-height: 1;
  vertical-align: -0.05em;
}

.brand-cta {
  margin: 0;
  font-size: clamp(0.88rem, 3.6vw, 1.02rem);
  line-height: 1.32;
  font-weight: 700;
  color: #1f1a16;
  text-wrap: balance;
}

.brand-star {
  font-size: clamp(0.82rem, 3.2vw, 0.95rem);
  white-space: nowrap;
}

@media (max-width: 360px) {
  .brand-banner {
    gap: clamp(8px, 2.5vw, 12px);
  }

  .brand-spotlight {
    font-size: clamp(1.2rem, 5.6vw, 1.45rem);
  }
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: 50%;
  color: var(--gm-muted);
  cursor: pointer;
}

.icon-btn:active {
  background: var(--gm-surface);
}

.content {
  flex: 1;
  padding: 20px 16px 24px;
}

.view {
  animation: fadeIn 0.22s ease;
}

.view.hidden {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.place-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 28px;
}

.place-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--gm-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.place-name {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.3;
}

.place-subtitle,
.muted {
  margin: 0;
  color: var(--gm-muted);
  font-size: 14px;
  line-height: 1.5;
}

.section-label {
  display: block;
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gm-text);
}

.section-label.optional {
  margin-top: 20px;
  font-weight: 400;
  color: var(--gm-muted);
}

.rating-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.rating-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 76px;
  padding: 10px 4px 8px;
  border: 1.5px solid var(--gm-border);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff 0%, #fffaf4 100%);
  color: var(--gm-text);
  font-family: var(--font-display);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(47, 42, 36, 0.06);
  transition:
    border-color 0.15s,
    background 0.15s,
    color 0.15s,
    transform 0.1s,
    box-shadow 0.15s;
}

.rating-btn[data-score='1'] {
  background: linear-gradient(180deg, #fff 0%, #fff6f4 100%);
}

.rating-btn[data-score='2'] {
  background: linear-gradient(180deg, #fff 0%, #fff8f4 100%);
}

.rating-btn[data-score='3'] {
  background: linear-gradient(180deg, #fff 0%, #fff9f2 100%);
}

.rating-btn[data-score='4'] {
  background: linear-gradient(180deg, #fff 0%, #fff7eb 100%);
  border-color: #e8cdb0;
}

.rating-btn[data-score='5'] {
  background: linear-gradient(180deg, #fffef8 0%, #fff3df 100%);
  border-color: #e5c89a;
  box-shadow: 0 2px 6px rgba(239, 139, 30, 0.12);
}

.rating-btn-num {
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

.rating-btn-stars {
  font-size: 8px;
  line-height: 1;
  letter-spacing: 0.5px;
  color: #e09a1a;
  white-space: nowrap;
}

.rating-btn:hover {
  border-color: var(--gm-blue);
  box-shadow: 0 3px 10px rgba(239, 139, 30, 0.18);
  transform: translateY(-1px);
}

.rating-btn:active {
  transform: translateY(0) scale(0.98);
}

.rating-btn.selected,
.rating-btn:focus-visible {
  background: linear-gradient(180deg, #f5a84a 0%, var(--gm-blue) 100%);
  border-color: var(--gm-blue);
  color: #fff;
  box-shadow: 0 4px 12px rgba(239, 139, 30, 0.35);
}

.rating-btn.selected .rating-btn-stars,
.rating-btn:focus-visible .rating-btn-stars {
  color: #fff8e8;
}

.hint {
  margin: 0;
  font-size: 13px;
  color: var(--gm-muted);
  text-align: center;
}

.score-summary {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--gm-surface);
  border-radius: 12px;
  border: 1px solid #f0ddc8;
}

.no-score-summary {
  gap: 0;
}

.score-badge {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--gm-blue);
  color: var(--gm-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
}

.score-summary-title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
}

.score-summary-sub {
  margin: 0;
  font-size: 13px;
  color: var(--gm-muted);
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.category-rating-group {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

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

.category-label {
  min-width: 88px;
  font-size: 14px;
  color: var(--gm-text);
}

.mini-rating-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  flex: 1;
}

.mini-rating-btn {
  border: 1px solid var(--gm-border);
  border-radius: 16px;
  background: #fff;
  color: var(--gm-text);
  font-size: 13px;
  padding: 6px 0;
  cursor: pointer;
}

.mini-rating-btn.selected {
  border-color: var(--gm-blue);
  background: #e8f0fe;
  color: var(--gm-blue);
  font-weight: 500;
}

.chip {
  border: 1px solid var(--gm-border);
  background: #fff;
  color: var(--gm-text);
  border-radius: 18px;
  padding: 8px 16px;
  font-size: 14px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.chip.selected {
  background: #e8f0fe;
  border-color: var(--gm-blue);
  color: var(--gm-blue);
  font-weight: 500;
}

.comment-input,
.text-input {
  width: 100%;
  border: 1px solid var(--gm-border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: var(--font-body);
  color: var(--gm-text);
  background: #fff;
  resize: vertical;
}

.comment-input:focus,
.text-input:focus {
  outline: none;
  border-color: var(--gm-blue);
  box-shadow: 0 0 0 1px var(--gm-blue);
}

.primary-btn {
  width: 100%;
  margin-top: 20px;
  border: none;
  border-radius: 12px;
  background: var(--gm-blue);
  color: #fff;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  padding: 14px 24px;
  cursor: pointer;
  transition: background 0.15s;
}

.primary-btn:hover {
  background: var(--gm-blue-hover);
}

.primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.copy-status {
  margin-top: 12px;
}

.result-note {
  margin-top: 10px;
}

.google-encourage {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #e8f4fd;
  border: 1px solid #c2d9f0;
  color: #1a4d7a;
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}

.google-encourage strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 600;
}

.google-encourage p {
  margin: 0;
}

.happy-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff3df;
  border: 1px solid #f3d4aa;
  color: #8b5a19;
  font-size: 13px;
  font-weight: 500;
}

.form-error {
  margin: 12px 0 0;
  color: var(--gm-danger);
  font-size: 13px;
}

.form-error.hidden {
  display: none;
}

.thanks-card,
.error-card {
  text-align: center;
  padding: 32px 12px;
  background: var(--gm-surface);
  border: 1px solid #f0ddc8;
  border-radius: 12px;
}

.thanks-card h2 {
  margin: 16px 0 8px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
}

.thanks-icon {
  display: flex;
  justify-content: center;
}

.loader {
  width: 36px;
  height: 36px;
  margin: 0 auto 16px;
  border: 3px solid var(--gm-border);
  border-top-color: var(--gm-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.tiny-google-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 10px;
  color: #9aa0a6;
  text-decoration: underline;
}

@media (min-width: 481px) {
  .app {
    border-left: 1px solid var(--gm-border);
    border-right: 1px solid var(--gm-border);
  }
}
