:root {
  --tt-navy: #0e3a45;
  --tt-navy-deep: #0a2830;
  --tt-sand: #f6efe1;
  --tt-sand-dim: #ece1cb;
  --tt-coral: #e2653b;
  --tt-coral-dim: #f7ded2;
  --tt-teal: #2f9e8f;
  --tt-teal-dim: #dcf0ec;
  --tt-ink: #1c2b2e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--tt-sand);
  color: var(--tt-ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  border-bottom: 1px solid rgba(14, 58, 69, 0.15);
  padding: 32px 0;
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--tt-teal);
}

h1 {
  margin: 8px 0 0;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--tt-navy);
}

.intro {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(28, 43, 46, 0.75);
}

main.wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 32px;
  padding-bottom: 48px;
}

.card {
  border: 1px solid rgba(14, 58, 69, 0.15);
  background: rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  padding: 20px;
}

.card.muted {
  opacity: 1;
  transition: opacity 0.15s ease;
}

.card.muted.disabled {
  opacity: 0.5;
}

.card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--tt-navy);
}

.row-between {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.hint-text {
  margin: 4px 0 0;
  font-size: 12px;
  color: rgba(28, 43, 46, 0.6);
}

.status-text {
  margin: 12px 0 0;
  font-size: 14px;
  color: rgba(28, 43, 46, 0.6);
}

.error-text {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--tt-coral);
}

.fine-print {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(28, 43, 46, 0.5);
}

/* --- Chips (frequent items) --- */

.chip-row {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1px solid rgba(47, 158, 143, 0.4);
  background: var(--tt-teal-dim);
  color: var(--tt-navy);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

/* --- Add-item choices --- */

.choice-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.choice-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(14, 58, 69, 0.2);
  background: transparent;
  border-radius: 12px;
  padding: 12px 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--tt-navy);
  cursor: pointer;
}

.choice-icon {
  font-size: 20px;
}

/* --- Draft form --- */

.draft-form {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--tt-sand-dim);
  border-radius: 12px;
  padding: 16px;
}

.field-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--tt-navy);
}

.field-label input {
  border: 1px solid rgba(14, 58, 69, 0.2);
  background: white;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--tt-ink);
}

.btn-row {
  display: flex;
  gap: 8px;
}

/* --- Buttons --- */

.btn {
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

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

.btn-primary {
  background: var(--tt-navy);
  color: var(--tt-sand);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(14, 58, 69, 0.3);
  color: var(--tt-navy);
}

.btn-block {
  display: block;
  width: 100%;
  margin-top: 16px;
}

.link-btn {
  border: none;
  background: none;
  color: var(--tt-coral);
  font-size: 12px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  padding: 0;
}

/* --- Ticket list --- */

.ticket-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.ticket-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(14, 58, 69, 0.1);
  font-size: 14px;
}

.ticket-list li:first-child {
  border-top: none;
}

.ticket-item-price {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- Receipt photo slot --- */

.photo-slot {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 2px dashed rgba(14, 58, 69, 0.3);
  border-radius: 16px;
  background: var(--tt-sand-dim);
  cursor: pointer;
  overflow: hidden;
  padding: 0;
}

.photo-slot:disabled {
  cursor: not-allowed;
}

.photo-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  text-align: center;
  font-size: 14px;
  color: rgba(28, 43, 46, 0.7);
}

/* --- Result --- */

.result-summary {
  border-radius: 16px;
  padding: 20px;
  border: 1px solid;
}

.result-summary.ok {
  border-color: rgba(47, 158, 143, 0.4);
  background: var(--tt-teal-dim);
}

.result-summary.mismatch {
  border-color: rgba(226, 101, 59, 0.4);
  background: var(--tt-coral-dim);
}

.result-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--tt-navy);
}

.result-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(14, 58, 69, 0.1);
  font-size: 14px;
}

.result-line:first-child {
  border-top: none;
}

.result-line .amounts {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.status-match {
  color: var(--tt-teal);
  font-weight: 600;
}

.status-mismatch {
  color: var(--tt-coral);
  font-weight: 600;
}

.status-inconclusive {
  color: rgba(28, 43, 46, 0.6);
  font-weight: 600;
}

/* --- History --- */

.history-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.history-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(14, 58, 69, 0.1);
  font-size: 14px;
}

.history-list li:first-child {
  border-top: none;
}

/* --- Ad slots: neutral placeholders, styled minimally so any network's embed
     drops in cleanly. Hidden by default (see index.html); unhide once wired. --- */

.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  border-radius: 12px;
  background: rgba(14, 58, 69, 0.05);
  color: rgba(28, 43, 46, 0.4);
  font-size: 12px;
}

.ad-slot-header {
  max-width: 640px;
  margin: 20px auto 0;
}

.ad-slot-content {
  margin-top: 4px;
}
