/* Google Maps Design System */
:root {
  --bg: #f1f3f4;
  --card: #ffffff;
  --ink: #202124;
  --dim: #5f6368;
  --line: #dadce0;
  --primary: #1a73e8;
  --primary-hover: #174ea6;
  --star-gold: #fbbc04;
  --star-grey: #dadce0;
  --rating-text: #e7711b;
  --radius-card: 8px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(60, 64, 67, 0.3);
  --shadow-search: 0 1px 6px rgba(32, 33, 36, 0.28);
}
/* Ingest & Quota Styles */
.ingest-card h2 {
  margin-top: 0;
  margin-bottom: 1rem;
}

.ingest-stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
}

.attempts-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.attempt-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 13px;
  flex-wrap: wrap;
  word-break: break-word;
}

.chip-free {
  background: #e6f4ea;
  color: #137333;
}

.chip-metered {
  background: #feefc3;
  color: #b06000;
}

.quota-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.quota-card-item {
  background: #f8f9fa;
  border: 1px solid #e8eaed;
  border-radius: 6px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.quota-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.quota-provider-name {
  font-weight: 500;
  font-size: 13px;
  color: var(--ink);
}

.quota-usage-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.quota-track {
  height: 6px;
  background-color: #e8eaed;
}

.quota-bar {
  background-color: var(--primary);
}

.quota-bar-warning {
  background-color: #e65100;
}

.quota-numbers {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 12px;
  flex-wrap: wrap;
}
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: Roboto, "Google Sans", -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background-color: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* Chrome / Top Bar */
.app-header {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 840px;
  margin: 0 auto;
  padding: 0.6rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}

.brand svg {
  fill: var(--primary);
}

.app-header nav a {
  color: var(--dim);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-pill);
  transition: background 0.2s, color 0.2s;
}

.app-header nav a:hover {
  background: #f8f9fa;
  color: var(--primary);
}

/* Layout */
.app-main {
  max-width: 840px;
  margin: 1.25rem auto;
  padding: 0 1rem 3rem 1rem;
}

@media (max-width: 400px) {
  .app-main {
    padding: 0 0.75rem 2rem 0.75rem;
  }
  .card {
    padding: 0.85rem 0.85rem;
  }
  .search-form {
    padding: 0.35rem;
    gap: 0.35rem;
  }
  .search-form input[type="url"] {
    padding: 0.55rem 0.9rem;
  }
  .header-inner {
    padding: 0.6rem 0.75rem;
  }
}

/* Typography */
h1 {
  font-size: 22px;
  font-weight: 400;
  margin: 0 0 0.5rem 0;
  color: var(--ink);
  letter-spacing: -0.2px;
}

h2 {
  font-size: 16px;
  font-weight: 500;
  margin: 1.5rem 0 0.75rem 0;
  color: var(--ink);
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  color: var(--primary-hover);
}

.dim {
  color: var(--dim);
  font-size: 13px;
}

/* Cards & Surfaces */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

/* Buttons */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 0.5rem 1.25rem;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s, box-shadow 0.2s;
  line-height: 1.4;
}

button:hover, .btn:hover {
  background-color: var(--primary-hover);
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

button:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Forms & Inputs */
.row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.search-form {
  background: #ffffff;
  padding: 0.5rem;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-search);
  border: 1px solid transparent;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  transition: border-color 0.2s;
}

.search-form:focus-within {
  border-color: var(--primary);
}

input[type="url"], input[type="password"] {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: #ffffff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-form input[type="url"] {
  min-width: 0;
  border: none;
  box-shadow: none;
  padding: 0.6rem 1.25rem;
}

input[type="url"]:focus, input[type="password"]:focus {
  border-color: var(--primary);
}

/* Star Rating Component */
.star-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  vertical-align: middle;
}

.rating-val {
  font-weight: 700;
  font-size: 15px;
  color: var(--rating-text);
}

.stars-outer {
  position: relative;
  display: inline-block;
  width: 90px;
  height: 18px;
  line-height: 1;
}

.stars-grey {
  display: flex;
  color: var(--star-grey);
  width: 90px;
}

.stars-gold {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  color: var(--star-gold);
  overflow: hidden;
  white-space: nowrap;
}

.star-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: currentColor;
}

.rating-count {
  color: var(--dim);
  font-size: 13px;
}

/* Rating Histogram & Header Card */
.place-header-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.place-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.place-sub-line {
  color: var(--dim);
  font-size: 13px;
}

/* BLUF Card */
.bluf-card {
  border-left: 4px solid var(--primary);
  background: #f8fafd;
}

.bluf-card h2 {
  margin-top: 0;
  color: var(--primary);
}

.bluf-card p {
  font-size: 15px;
  line-height: 1.6;
}

/* Rating Histogram & Stat Strip */
.histogram-stat-card {
  padding: 1.25rem;
}

.histogram-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(240px, 1fr);
  gap: 1.5rem;
  align-items: center;
}

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

.histogram-rows {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.histogram-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 13px;
}

.hist-label {
  width: 24px;
  text-align: right;
  color: var(--dim);
  font-weight: 500;
}

.hist-track {
  flex: 1;
  height: 8px;
  background-color: #e8eaed;
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.hist-bar {
  height: 100%;
  background-color: var(--star-gold);
  border-radius: var(--radius-pill);
  transition: width 0.3s ease;
}

.hist-count {
  width: 32px;
  font-size: 12px;
  color: var(--dim);
  text-align: right;
}

.stat-strip {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: #f8f9fa;
  padding: 0.9rem 1rem;
  border-radius: 6px;
  border: 1px solid #e8eaed;
}

.stat-item {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.stat-value {
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
}

.stat-label {
  font-size: 13px;
  color: var(--dim);
}

/* Badges & Chips */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.1px;
}

.badge-avoid {
  background: #fce8e6;
  color: #c5221f;
}

.badge-caution {
  background: #feefc3;
  color: #b06000;
}

.badge-ok_with_eyes_open {
  background: #e8f0fe;
  color: #1a73e8;
}

.badge-likely_fine {
  background: #e6f4ea;
  color: #137333;
}

/* Analysis did not run -- deliberately neutral so it never reads as an endorsement. */
.badge-unknown {
  background: #f1f3f4;
  color: #5f6368;
  border: 1px solid #dadce0;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  background: #e8f0fe;
  color: #1a73e8;
}

/* Severity Pill Colors 1 to 5 */
.chip-severity-1 { background: #e8f0fe; color: #1a73e8; }
.chip-severity-2 { background: #feefc3; color: #b06000; }
.chip-severity-3 { background: #ffe0b2; color: #e65100; }
.chip-severity-4 { background: #fce8e6; color: #c5221f; }
.chip-severity-5 { background: #f8d7da; color: #a50e0e; }

.chip-isolated { background: #f1f3f4; color: var(--dim); border: 1px solid var(--line); }

/* Job Status Chips */
.chip-completed { background: #e6f4ea; color: #137333; }
.chip-failed { background: #fce8e6; color: #c5221f; }
.chip-running { background: #feefc3; color: #b06000; }
.chip-partial { background: #ffe0b2; color: #e65100; }

.chip-rating {
  background: #fef7e0;
  color: #b06000;
  font-weight: 700;
}

/* Issues & Quotes */
.issues {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.issue {
  border-left: 3px solid var(--line);
}

.issue-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}

.issue-head strong {
  font-size: 15px;
  font-weight: 500;
}

.quotes {
  list-style: none;
  padding: 0;
  margin: 0.6rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quotes li {
  background: #f8f9fa;
  border: 1px solid #e8eaed;
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
}

.quotes li p {
  margin: 0.3rem 0 0 0;
  font-size: 13px;
  line-height: 1.45;
}

.review-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 12px;
}

/* List & Tables */
.list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.list li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.list li a {
  font-weight: 500;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 0.5rem;
}

th, td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--dim);
  font-weight: 500;
}

summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--primary);
  padding: 0.3rem 0;
}

summary:hover {
  text-decoration: underline;
}

/* Login Form Centered */
.login-container {
  max-width: 380px;
  margin: 3rem auto;
}

.error {
  color: #c5221f;
  background: #fce8e6;
  border: 1px solid #fad2cf;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  font-size: 13px;
}

.fixture-banner {
  border-left: 4px solid #fbbc04;
  background: #fef7e0;
  color: #202124;
}
