/* Minimal iframe-friendly styling */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  color: #1a1a1a;
  background: #fff;
  padding: 4px 10px 8px 0;
  margin: 0;
}

.app-container {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
  min-height: calc(100vh - 12px);
}

.title {
  font-size: 16px;
  font-weight: 600;
  color: #111;
  margin-bottom: 1px;
  transition: color 0.15s;
}

.helper-text {
  font-size: 14px;
  color: #666;
  margin-bottom: 6px;
  transition: color 0.15s;
}

.search-box {
  position: relative;
}

.postcode-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#search-input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  font-size: 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

#find-address-btn {
  padding: 8px 14px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  color: #fff;
  background: #0066cc;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, opacity 0.15s;
}

#find-address-btn:hover:not(:disabled) {
  background: #004a99;
}

#find-address-btn:focus {
  outline: 2px solid rgba(0, 102, 204, 0.4);
  outline-offset: 2px;
}

#search-input:focus {
  border-color: #0066cc;
  box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.15);
}

#search-input.input-selected {
  border-color: #34a853;
  background: #f0faf0;
  color: #1a1a1a;
  cursor: default;
}

#search-input.input-selected:focus {
  border-color: #34a853;
  box-shadow: 0 0 0 2px rgba(52, 168, 83, 0.15);
}

/* Status */
#status {
  padding: 8px 10px;
  font-size: 13px;
  color: #555;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 6px;
  margin-top: 6px;
}

#status.error {
  color: #c00;
  background: #fff5f5;
  border-color: #fcc;
}

#status.searching {
  color: #555;
}

/* Results list */
#results {
  list-style: none;
  border: 1px solid #ddd;
  border-radius: 6px;
  max-height: 340px;
  overflow-y: auto;
  margin-top: 6px;
}

#results li {
  padding: 8px 10px;
  cursor: pointer;
  border-bottom: 1px solid #e5e7eb;
  font-size: 15px;
  line-height: 1.4;
  transition: background 0.1s;
}

#results li:nth-child(even) {
  background: #f0f2f5;
}

#results li:hover,
#results li:focus {
  background: #d0e0f7;
  outline: none;
}

#results li:active {
  background: #b8d0f0;
}

#results li:last-child {
  border-bottom: none;
}

/* Selected address confirmation */
#selected-address {
  margin-top: 4px;
}

.selected-address-text {
  font-size: 15px;
  line-height: 1.4;
  color: #1a1a1a;
  margin-bottom: 6px;
  word-wrap: break-word;
}

/* Manual entry guidance */
#manual-guidance {
  padding: 4px 0;
}

.manual-guidance-text {
  font-size: 15px;
  color: #555;
  margin-bottom: 6px;
}

/* Manual entry fallback */
#manual-entry {
  margin-top: 10px;
  padding: 0;
  text-align: center;
}

#manual-entry:not([hidden]) {
  display: block;
}

.manual-heading {
  font-size: 14px;
  font-weight: 600;
  color: #444;
  margin-bottom: 8px;
}

.manual-btn {
  display: inline-block;
  padding: 8px 18px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  color: #0066cc;
  background: #fff;
  border: 1px solid #0066cc;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.manual-btn:hover {
  background: #0066cc;
  color: #fff;
}

.manual-btn:focus {
  outline: 2px solid rgba(0, 102, 204, 0.4);
  outline-offset: 2px;
}

.change-link {
  display: inline-block;
  font-size: 14px;
  color: #0066cc;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
}

.change-link:hover {
  color: #004a99;
}

.change-link:focus {
  outline: 2px solid rgba(0, 102, 204, 0.4);
  outline-offset: 2px;
  border-radius: 2px;
}
