@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  --ink-900: #0f2027;
  --ink-800: #16323b;
  --ink-700: #1f4753;
  --line: rgba(246, 241, 233, 0.14);
  --paper: #f6f1e9;
  --paper-dim: #e8e0d2;
  --pin: #e9692c;
  --pin-dim: #c4551f;
  --moss: #4f7a63;
  --text-on-ink: #ecebe4;
  --text-muted: rgba(236, 235, 228, 0.62);
  --radius-s: 3px;
  --radius-m: 6px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  background: var(--ink-900);
  color: var(--text-on-ink);
  -webkit-font-smoothing: antialiased;
}

button, input, select {
  font-family: inherit;
}

a { color: inherit; }

::selection {
  background: var(--pin);
  color: var(--ink-900);
}

/* ---------- layout ---------- */

.app {
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: 100vh;
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
  }
}

/* ---------- sidebar ---------- */

.sidebar {
  background: linear-gradient(180deg, var(--ink-900), var(--ink-800));
  border-right: 1px solid var(--line);
  padding: 28px 26px 32px;
  position: relative;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}

.brand__mark {
  color: var(--pin);
  font-size: 22px;
  line-height: 1;
}

.brand__name {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 0.2px;
}

.brand__tag {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 2px 0 28px;
  line-height: 1.5;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.field input,
.field select {
  width: 100%;
  background: rgba(246, 241, 233, 0.06);
  border: 1px solid var(--line);
  color: var(--text-on-ink);
  border-radius: var(--radius-s);
  padding: 10px 11px;
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.field input::placeholder {
  color: rgba(236, 235, 228, 0.35);
}

.field input:focus,
.field select:focus {
  border-color: var(--pin);
  background: rgba(246, 241, 233, 0.1);
}

.field-hint {
  font-size: 11.5px;
  color: rgba(236, 235, 228, 0.45);
  margin-top: 6px;
  line-height: 1.5;
}

.field-hint a {
  color: var(--pin);
  text-decoration: none;
  border-bottom: 1px solid rgba(233, 105, 44, 0.4);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-s);
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.985);
}

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

.btn-primary {
  background: var(--pin);
  color: #1a0d05;
  margin-top: 6px;
}

.btn-primary:hover:not(:disabled) {
  background: #f0783a;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text-on-ink);
}

.btn-ghost:hover:not(:disabled) {
  border-color: rgba(246, 241, 233, 0.4);
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 26px 0 22px;
}

.status-line {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 14px;
  line-height: 1.6;
  min-height: 18px;
}

.status-line.is-error {
  color: #e98a5f;
}

.sidebar__footer {
  position: absolute;
  bottom: 22px;
  left: 26px;
  right: 26px;
  font-size: 11px;
  color: rgba(236, 235, 228, 0.35);
  line-height: 1.6;
}

/* ---------- main ---------- */

.main {
  background: var(--paper);
  color: var(--ink-900);
  padding: 32px 40px 60px;
  overflow-y: auto;
}

@media (max-width: 640px) {
  .main {
    padding: 24px 18px 48px;
  }
}

.main__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 22px;
}

.main__title {
  font-family: "Fraunces", serif;
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 4px;
}

.main__subtitle {
  font-size: 13.5px;
  color: rgba(15, 32, 39, 0.6);
  margin: 0;
}

.export-bar {
  display: flex;
  gap: 10px;
}

.export-bar .btn {
  width: auto;
  padding: 10px 16px;
  background: var(--ink-900);
  color: var(--paper);
}

.export-bar .btn:hover:not(:disabled) {
  background: var(--ink-700);
}

.export-bar .btn:disabled {
  background: rgba(15, 32, 39, 0.25);
}

/* results list, styled like index-card entries rather than SaaS cards */

.results-count {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: rgba(15, 32, 39, 0.5);
  margin-bottom: 14px;
}

.results {
  border-top: 1px solid rgba(15, 32, 39, 0.14);
}

.entry {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 18px;
  align-items: start;
  padding: 16px 4px;
  border-bottom: 1px solid rgba(15, 32, 39, 0.14);
}

.entry__index {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: rgba(15, 32, 39, 0.4);
  padding-top: 3px;
}

.entry__name {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 16.5px;
  margin: 0 0 4px;
}

.entry__address {
  font-size: 13.5px;
  color: rgba(15, 32, 39, 0.68);
  margin: 0 0 6px;
  line-height: 1.5;
}

.entry__meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: rgba(15, 32, 39, 0.55);
}

.entry__phone {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13.5px;
  color: var(--ink-900);
  text-align: right;
  white-space: nowrap;
  padding-top: 3px;
}

.entry__phone.is-missing {
  color: rgba(15, 32, 39, 0.32);
  font-style: italic;
}

.entry__rating {
  color: var(--pin-dim);
}

/* empty / loading states */

.state-block {
  padding: 60px 10px;
  text-align: center;
  color: rgba(15, 32, 39, 0.5);
}

.state-block__icon {
  font-size: 30px;
  margin-bottom: 12px;
  color: var(--pin);
}

.state-block h3 {
  font-family: "Fraunces", serif;
  font-size: 18px;
  color: var(--ink-900);
  margin: 0 0 8px;
  font-weight: 600;
}

.state-block p {
  font-size: 13.5px;
  max-width: 380px;
  margin: 0 auto;
  line-height: 1.6;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(26, 13, 5, 0.25);
  border-top-color: #1a0d05;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
