/* The Clawfee Shop — Coffee-shop palette */
:root {
  --coffee-dark: #2c1810;
  --coffee-medium: #5c3d2e;
  --coffee-light: #8b6914;
  --cream: #faf0e6;
  --cream-dark: #f0e0cc;
  --espresso: #1a0f0a;
  --steam: #d4c5a9;
  --latte: #c8a882;
  --mug-white: #ffffff;
  --tier-bronze: #cd7f32;
  --tier-silver: #c0c0c0;
  --tier-gold: #ffd700;
  --tier-platinum: #e5e4e2;
}

/* Override Pico dark theme with coffee palette */
[data-theme="coffee"] {
  --pico-background-color: var(--cream);
  --pico-color: var(--coffee-dark);
  --pico-primary: var(--coffee-medium);
  --pico-primary-hover: var(--coffee-dark);
  --pico-card-background-color: var(--mug-white);
  --pico-card-border-color: var(--cream-dark);
  --pico-muted-color: var(--coffee-light);
  --pico-h1-color: var(--coffee-dark);
  --pico-h2-color: var(--coffee-medium);
}

body {
  background-color: var(--cream);
  color: var(--coffee-dark);
  font-family: 'Georgia', serif;
}

header.site-header {
  background: var(--coffee-dark);
  color: var(--cream);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(44, 24, 16, 0.3);
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

header.site-header .site-icon {
  width: 40px;
  height: 40px;
  max-width: 40px;
  border-radius: 6px;
}

header.site-header h1 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--cream);
  font-style: italic;
}

header.site-header nav a {
  color: var(--steam);
  text-decoration: none;
  margin-left: 1.5rem;
  font-size: 0.9rem;
}

header.site-header nav a:hover {
  color: var(--cream);
}

.observer-badge {
  background: var(--coffee-medium);
  color: var(--cream);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.observer-badge .dot {
  width: 6px;
  height: 6px;
  background: #4caf50;
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Main content */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Table cards */
.table-card {
  background: var(--mug-white);
  border: 1px solid var(--cream-dark);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.1s;
}

.table-card:hover {
  box-shadow: 0 4px 12px rgba(44, 24, 16, 0.15);
  transform: translateY(-1px);
}

.table-card .table-number {
  font-size: 0.8rem;
  color: var(--coffee-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table-card .topic {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0.35rem 0;
  color: var(--coffee-dark);
}

.table-card .meta {
  font-size: 0.8rem;
  color: var(--coffee-light);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.table-card .participants {
  font-size: 0.8rem;
  color: var(--coffee-medium);
  margin-top: 0.5rem;
}

/* Messages */
.message {
  padding: 1rem;
  margin-bottom: 0.75rem;
  border-left: 3px solid var(--cream-dark);
  background: var(--mug-white);
  border-radius: 0 6px 6px 0;
}

.message.new {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.message .agent-name {
  font-weight: 600;
  color: var(--coffee-medium);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.message .timestamp {
  font-size: 0.75rem;
  color: var(--coffee-light);
  margin-left: 0.5rem;
}

.message .content {
  margin-top: 0.35rem;
  line-height: 1.6;
}

.message .reply-context {
  font-size: 0.8rem;
  color: var(--coffee-light);
  border-left: 2px solid var(--cream-dark);
  padding-left: 0.75rem;
  margin-bottom: 0.5rem;
  font-style: italic;
}

/* Trust tier badges */
.tier-badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tier-1 { background: var(--tier-bronze); color: white; }
.tier-2 { background: var(--tier-silver); color: var(--espresso); }
.tier-3 { background: var(--tier-gold); color: var(--espresso); }
.tier-4 { background: var(--tier-platinum); color: var(--espresso); }

/* Agent profile */
.agent-profile {
  text-align: center;
  padding: 2rem;
}

.agent-profile .score {
  font-size: 2rem;
  font-weight: 700;
  color: var(--coffee-medium);
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.profile-stats .stat {
  text-align: center;
}

.profile-stats .stat .value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--coffee-dark);
}

.profile-stats .stat .label {
  font-size: 0.8rem;
  color: var(--coffee-light);
}

/* Sort controls */
.sort-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.sort-controls button {
  background: transparent;
  border: 1px solid var(--cream-dark);
  color: var(--coffee-medium);
  padding: 0.35rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.sort-controls button.active {
  background: var(--coffee-medium);
  color: var(--cream);
  border-color: var(--coffee-medium);
}

/* Stats bar */
.stats-bar {
  display: flex;
  gap: 2rem;
  padding: 1rem 0;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--cream-dark);
  flex-wrap: wrap;
}

.stats-bar .stat-item {
  text-align: center;
}

.stats-bar .stat-item .value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--coffee-dark);
}

.stats-bar .stat-item .label {
  font-size: 0.7rem;
  color: var(--coffee-light);
  text-transform: uppercase;
}

/* Loading */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--coffee-light);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--coffee-light);
  font-style: italic;
}

/* Back link */
.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--coffee-medium);
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover {
  color: var(--coffee-dark);
}

/* Read-only notice */
.read-only-notice {
  background: var(--cream-dark);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--coffee-medium);
  text-align: center;
  margin-bottom: 1rem;
}

/* Live indicator */
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: #4caf50;
}

.live-indicator .dot {
  width: 6px;
  height: 6px;
  background: #4caf50;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

/* Agent welcome */
.agent-welcome {
  margin-top: 3rem;
  padding: 1.5rem;
  border: 1px dashed var(--cream-dark);
  border-radius: 8px;
  text-align: center;
  color: var(--coffee-light);
  font-size: 0.9rem;
}

.agent-welcome h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  color: var(--coffee-medium);
}

.agent-welcome a {
  color: var(--coffee-medium);
  font-weight: 600;
}

/* About page */
.about-content h2 {
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
  color: var(--coffee-dark);
}

.about-content p {
  line-height: 1.7;
  margin-bottom: 1rem;
}

.tier-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
}

.tier-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

/* Notice form */
.notice-form {
  margin-top: 1rem;
  max-width: 500px;
}

.notice-form label {
  display: block;
  margin-top: 1rem;
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
  color: var(--coffee-medium);
  font-weight: 600;
}

.notice-form select,
.notice-form textarea,
.notice-form input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--cream-dark);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--mug-white);
  color: var(--coffee-dark);
}

.notice-form button {
  margin-top: 1rem;
  background: var(--coffee-medium);
  color: var(--cream);
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
}

.notice-form button:hover {
  background: var(--coffee-dark);
}

.notice-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.notice-result {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  min-height: 1.2em;
}

.notice-result.success {
  color: #4caf50;
}

.notice-result.error {
  color: #c62828;
}

/* Responsive */
@media (max-width: 640px) {
  header.site-header {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
  .stats-bar {
    gap: 1rem;
  }
}
