:root {
  --accent: #7B9E89;
  --accent-dark: #5f8470;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --border: #e5e5e5;
  --bg: #ffffff;
  --card-hover: #f7f9f8;
  --radius: 12px;
  --tap: 44px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 32px 20px 40px;
  padding-top: max(32px, env(safe-area-inset-top));
  padding-bottom: max(40px, env(safe-area-inset-bottom));
}

.app-header {
  text-align: center;
  margin-bottom: 44px;
}

.app-header h1 {
  font-size: 30px;
  font-weight: 700;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

.app-subtitle {
  font-size: 17px;
  line-height: 1.45;
  color: var(--text-muted);
  margin: 0;
  font-weight: 400;
}

@media (min-width: 480px) {
  .app-header h1 {
    font-size: 36px;
  }
  .app-subtitle {
    font-size: 19px;
  }
}

.view.hidden {
  display: none;
}

/* --- Search view --- */

.search-bar {
  position: sticky;
  top: 0;
  background: var(--bg);
  padding: 4px 0 12px;
  z-index: 1;
}

#search-input {
  width: 100%;
  height: 56px;
  padding: 0 18px;
  font-size: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

#search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(123, 158, 137, 0.18);
}

.status {
  padding: 16px 4px;
  color: var(--text-muted);
  font-size: 15px;
}

.status.error {
  color: #b3261e;
}

.results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guest-card {
  min-height: 52px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  font-size: 17px;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, transform 0.05s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  color: inherit;
  font-family: inherit;
}

.guest-card .guest-name {
  font-weight: 500;
}

.guest-card .guest-hint {
  font-size: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}

@media (hover: hover) {
  .guest-card:hover {
    background: var(--card-hover);
    border-color: #d4d4d4;
  }
}

.guest-card:active {
  background: var(--card-hover);
  transform: scale(0.995);
}

/* --- Result view --- */

.back-button {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 10px 16px;
  margin-bottom: 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--accent-dark);
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.back-button:active {
  background: var(--card-hover);
}

@media (hover: hover) {
  .back-button:hover {
    background: var(--card-hover);
  }
}

.result-name {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 20px 0 16px;
  line-height: 1.15;
}

.result-group {
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
  word-break: break-word;
}

.result-group .group-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 6px;
}

.result-group .group-value {
  display: block;
  font-size: 32px;
  line-height: 1.1;
}

.result-details {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result-details .detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.result-details .detail-row:last-child {
  border-bottom: none;
}

.result-details dt {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
  margin: 0;
  flex-shrink: 0;
}

.result-details dd {
  margin: 0;
  font-size: 16px;
  color: var(--text);
  text-align: right;
  word-break: break-word;
}
