/* === Reset & Base === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --teal: #0D9488;
  --teal-light: #2DD4BF;
  --charcoal: #1F2937;
  --charcoal-light: #242A3A;
  --charcoal-lighter: #2D3548;
  --white: #F1F5F9;
  --grey: #94A3B8;
  --grey-dark: #3a3f4e;
  --green: #22C55E;
  --green-hover: #16A34A;
  --amber: #F59E0B;
  --amber-hover: #D97706;
  --red: #EF4444;
  --red-hover: #DC2626;
  --font: 'Inter', -apple-system, 'Segoe UI', sans-serif;
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--charcoal);
  color: var(--white);
  overflow: hidden;
}

/* === Header === */
.header {
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  background: var(--charcoal);
  border-bottom: 1px solid var(--grey-dark);
}

.header-logo {
  height: 28px;
  width: auto;
}

/* === Main Layout === */
.main {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 48px);
  padding: 12px;
  gap: 12px;
}

.top-row {
  display: flex;
  gap: 12px;
  flex: 0 0 auto;
}

/* === Panels === */
.panel {
  background: var(--charcoal-light);
  border: 2px solid var(--teal);
  border-radius: 8px;
  overflow: hidden;
}

.panel-cards {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.panel-dashboard {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.panel-conversation {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

/* === Card Container === */
.card-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.card-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* === Action Card === */
.action-card {
  width: 100%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: rgba(13, 148, 136, 0.3);
  border-radius: 6px;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--white);
  line-height: 1.3;
}

.card-context {
  font-size: 14px;
  color: var(--grey);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-buttons {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.card-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

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

.card-btn-go {
  background: var(--green);
  color: var(--charcoal);
}
.card-btn-go:hover:not(:disabled) {
  background: var(--green-hover);
}

.card-btn-snooze {
  background: var(--amber);
  color: var(--charcoal);
}
.card-btn-snooze:hover:not(:disabled) {
  background: var(--amber-hover);
}

.card-btn-discuss {
  background: var(--red);
  color: var(--white);
}
.card-btn-discuss:hover:not(:disabled) {
  background: var(--red-hover);
}

/* === Undo State === */
.card-undo {
  width: 100%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.undo-progress {
  width: 100%;
  height: 4px;
  background: var(--grey-dark);
  border-radius: 2px;
  overflow: hidden;
}

.undo-progress-bar {
  height: 100%;
  background: var(--green);
  border-radius: 2px;
  transition: width 0.1s linear;
}

.btn-undo {
  padding: 10px 24px;
  background: var(--charcoal-lighter);
  border: 1px solid var(--grey-dark);
  border-radius: 6px;
  color: var(--white);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-undo:hover {
  background: var(--grey-dark);
}

/* === Panel Titles === */
.panel-title {
  background: rgba(13, 148, 136, 0.3);
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* === Watermarks === */
.watermark {
  font-size: 24px;
  font-weight: 500;
  color: var(--grey-dark);
  user-select: none;
}

.dashboard-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.placeholder-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.watermark-sub {
  font-size: 13px;
  color: var(--grey-dark);
  user-select: none;
}

/* === Chat Messages === */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.chat-messages::-webkit-scrollbar {
  width: 8px;
}
.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: var(--grey-dark);
  border-radius: 4px;
}

.msg {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
  flex-shrink: 0;
}

.msg-user {
  align-self: flex-end;
  background: var(--teal);
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.msg-anna {
  align-self: flex-start;
  background: var(--charcoal-lighter);
  color: var(--white);
  border-bottom-left-radius: 4px;
}

.msg-anna p { margin: 0 0 8px 0; }
.msg-anna p:last-child { margin-bottom: 0; }
.msg-anna ul, .msg-anna ol { margin: 4px 0 8px 20px; padding: 0; }
.msg-anna li { margin-bottom: 4px; }
.msg-anna strong { color: var(--white); }
.msg-anna h1, .msg-anna h2, .msg-anna h3 { font-size: 15px; font-weight: 700; margin: 8px 0 4px 0; }
.msg-anna code { background: rgba(255,255,255,0.1); padding: 2px 5px; border-radius: 3px; font-size: 13px; }
.msg-anna pre { background: rgba(0,0,0,0.3); padding: 10px; border-radius: 4px; overflow-x: auto; margin: 8px 0; }
.msg-anna pre code { background: none; padding: 0; }
.msg-anna table { border-collapse: collapse; margin: 8px 0; width: 100%; font-size: 13px; }
.msg-anna th, .msg-anna td { border: 1px solid var(--grey-dark); padding: 6px 10px; text-align: left; }
.msg-anna th { background: rgba(255,255,255,0.05); font-weight: 600; }

.msg-system {
  align-self: center;
  background: transparent;
  color: var(--grey);
  font-style: italic;
  font-size: 13px;
  padding: 4px 12px;
}

/* === Chat Input === */
.chat-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--grey-dark);
}

.chat-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--charcoal-lighter);
  border: 1px solid var(--grey-dark);
  border-radius: 8px;
  padding: 8px 12px;
}

#chatInput {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--white);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  max-height: 120px;
}

#chatInput::placeholder {
  color: var(--grey);
}

.btn-upload, .btn-send {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  transition: opacity 0.2s ease;
  line-height: 1;
}

.btn-upload {
  opacity: 0.5;
}
.btn-upload:hover {
  opacity: 0.8;
}

.btn-send {
  color: var(--teal);
  opacity: 0.7;
}
.btn-send:hover {
  opacity: 1;
}
