* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #e4e4e4;
  height: 100vh;
  overflow: hidden;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

header {
  text-align: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

header h1 {
  font-size: 2em;
  margin-bottom: 5px;
}

.subtitle {
  color: #888;
  font-size: 0.9em;
}

.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.message {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 18px;
  word-wrap: break-word;
  animation: fadeIn 0.3s ease;
}

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

.message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

.message.assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.1);
  border-bottom-left-radius: 4px;
}

.input-area {
  display: flex;
  gap: 10px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#text-input {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 16px;
  outline: none;
}

#text-input::placeholder {
  color: #888;
}

.mic-btn, .send-btn {
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.1);
}

.mic-btn:hover, .send-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.mic-btn:active, .send-btn:active {
  transform: scale(0.95);
}

.mic-btn.recording {
  background: #e74c3c;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7); }
  50% { box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
}

.status {
  text-align: center;
  padding: 10px;
  font-size: 0.85em;
  color: #888;
  min-height: 30px;
}

.status.active {
  color: #3498db;
}

.status.error {
  color: #e74c3c;
}

/* Scrollbar styling */
.chat-container::-webkit-scrollbar {
  width: 6px;
}

.chat-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.chat-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

/* Mobile optimizations */
@media (max-width: 600px) {
  header h1 {
    font-size: 1.5em;
  }
  
  .message {
    max-width: 85%;
  }
}

/* --- ZUNO_MEMORY_DASHBOARD_V1 --- */
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-center { flex: 1; text-align: center; }
.header-left, .header-right { width: 48px; }
.header-right { text-align: right; }
#memory-btn {
  background: none;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
  padding: 4px;
}
#memory-btn:hover { opacity: 1; }

.memory-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
}
.memory-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 600px;
  margin: 0 auto;
  background: #16213e;
  border-top: 1px solid rgba(255,255,255,0.15);
  border-radius: 18px 18px 0 0;
  z-index: 101;
  max-height: 75vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.memory-panel.hidden, .memory-overlay.hidden { display: none; }
.memory-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.memory-panel-header h2 { font-size: 1.1em; }
.memory-panel-actions { display: flex; gap: 8px; }
.memory-panel-actions button {
  background: rgba(255,255,255,0.1);
  border: none;
  color: #e4e4e4;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85em;
  transition: background 0.2s;
}
.memory-panel-actions button:hover { background: rgba(255,255,255,0.2); }
.memory-list {
  overflow-y: auto;
  padding: 12px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.memory-loading { color: #888; text-align: center; padding: 20px; }
.memory-empty { color: #888; text-align: center; padding: 20px; font-size: 0.9em; }
.memory-item {
  background: rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  animation: fadeIn 0.2s ease;
}
.memory-item-content { flex: 1; }
.memory-item-text { font-size: 0.9em; line-height: 1.4; }
.memory-item-meta { font-size: 0.75em; color: #888; margin-top: 4px; }
.memory-item-delete {
  background: none;
  border: none;
  color: #e74c3c;
  cursor: pointer;
  font-size: 1em;
  opacity: 0.6;
  transition: opacity 0.2s;
  padding: 2px 4px;
  flex-shrink: 0;
}
.memory-item-delete:hover { opacity: 1; }
.memory-item.decayed { opacity: 0.4; }
.memory-conf-high { color: #2ecc71; }
.memory-conf-low  { color: #f39c12; }
/* --- /ZUNO_MEMORY_DASHBOARD_V1 --- */

/* --- ZUNO_MEMORY_TRUST_INDICATORS_V1 --- */
.memory-conf-mid {
  color: #e6a817;
  font-weight: 600;
  font-size: 0.82em;
}
.memory-conflict-badge {
  font-size: 0.85em;
  margin-left: 2px;
  cursor: default;
}
/* --- /ZUNO_MEMORY_TRUST_INDICATORS_V1 --- */

/* --- ZUNO_MEMORY_EXPLAIN_PANEL_STYLE_V1 --- */
.memory-item-explain {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px 6px;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.memory-item-explain:hover { opacity: 1; }
.memory-explain-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.memory-explain-panel {
  background: var(--surface, #1e1e2e);
  border-radius: 14px;
  padding: 20px 22px;
  max-width: 480px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  color: var(--text, #cdd6f4);
}
.memory-explain-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-muted, #6c7086);
}
.memory-explain-header {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.memory-explain-status {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
.explain-status-winner  { background: #a6e3a1; color: #1e1e2e; }
.explain-status-overridden { background: #f38ba8; color: #1e1e2e; }
.explain-status-unstable { background: #f9e2af; color: #1e1e2e; }
.explain-status-legacy  { background: #45475a; color: #cdd6f4; }
.memory-explain-slotkey {
  font-size: 0.78rem;
  color: var(--text-muted, #6c7086);
  font-family: monospace;
}
.memory-explain-decision {
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--text, #cdd6f4);
}
.memory-explain-diff {
  font-size: 0.8rem;
  color: var(--text-muted, #6c7086);
  margin-bottom: 12px;
}
.memory-explain-section {
  margin-top: 14px;
  font-size: 0.85rem;
}
.memory-explain-section b {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted, #6c7086);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}
.memory-explain-item {
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 6px;
  font-size: 0.88rem;
}
.memory-explain-item.winner     { background: rgba(166,227,161,0.12); border-left: 3px solid #a6e3a1; }
.memory-explain-item.overridden { background: rgba(243,139,168,0.10); border-left: 3px solid #f38ba8; }
.memory-explain-item.unstable   { background: rgba(249,226,175,0.10); border-left: 3px solid #f9e2af; }
.memory-explain-item.legacy     { background: rgba(69,71,90,0.3);     border-left: 3px solid #45475a; }
.memory-explain-meta {
  font-size: 0.78rem;
  color: var(--text-muted, #6c7086);
  margin-top: 4px;
}
.memory-explain-loading, .memory-explain-error {
  text-align: center;
  padding: 24px;
  color: var(--text-muted, #6c7086);
  font-size: 0.9rem;
}
/* --- /ZUNO_MEMORY_EXPLAIN_PANEL_STYLE_V1 --- */

/* --- ZUNO_MEMORY_FORENSIC_PANEL_STYLE_V1 --- */
.memory-item-forensic {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px 6px;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.memory-item-forensic:hover { opacity: 1; }
.memory-forensic-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.memory-forensic-panel {
  background: var(--surface, #1e1e2e);
  border-radius: 14px;
  padding: 20px 22px;
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  color: var(--text, #cdd6f4);
}
.memory-forensic-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-muted, #6c7086);
  letter-spacing: 0.03em;
}
.memory-forensic-timeline {
  font-size: 0.78rem;
  color: var(--text-muted, #6c7086);
  background: rgba(69,71,90,0.3);
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 8px;
  line-height: 1.7;
}
.memory-forensic-conflicts {
  font-size: 0.8rem;
  color: var(--text-muted, #6c7086);
  margin-bottom: 10px;
}
.memory-forensic-conflicts b { color: var(--text, #cdd6f4); }
.memory-explain-item.forensic-focus {
  border-left-width: 4px;
  border-left-color: #89b4fa;
  background: rgba(137,180,250,0.10);
}
/* --- /ZUNO_MEMORY_FORENSIC_PANEL_STYLE_V1 --- */

/* ZUNO_MEMORY_RESOLVE_UI_STYLE_V1 */
.resolve-manual-badge {
  display: inline-block;
  background: #b45309;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 4px;
  padding: 1px 7px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.04em;
}
.resolve-action-bar {
  display: flex;
  gap: 8px;
  margin: 8px 0 4px 0;
  flex-wrap: wrap;
}
.resolve-btn {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s;
}
.resolve-btn:hover { background: #334155; }
.resolve-btn-warn {
  background: #7c2d12;
  border-color: #b45309;
  color: #fef3c7;
}
.resolve-btn-warn:hover { background: #92400e; }
.resolve-btn-sm {
  padding: 2px 8px;
  font-size: 0.72rem;
  margin-top: 4px;
}

/* --- ZUNO_PWA_MEMORY_DASHBOARD_BADGES_V1 --- */
.memory-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.memory-tab {
  background: none;
  border: none;
  color: #888;
  font-size: 0.85em;
  padding: 6px 14px;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition: color 0.2s, background 0.2s;
}
.memory-tab.active {
  color: #fff;
  background: rgba(255,255,255,0.08);
}
.memory-dashboard-view { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
.memory-dashboard-view.hidden { display: none; }
.memory-dashboard-toolbar {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  flex-shrink: 0;
}
.dashboard-search-input {
  flex: 1;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  color: #fff;
  font-size: 0.82em;
  padding: 5px 10px;
}
.dashboard-filter-select {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  color: #fff;
  font-size: 0.8em;
  padding: 5px 6px;
}
.dashboard-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px;
}
.dashboard-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  margin-bottom: 6px;
  border-left: 3px solid transparent;
}
.dashboard-row.has-review { border-left-color: #e67e22; }
.dashboard-row.unstable   { border-left-color: #e74c3c; }
.dashboard-row.no-slot    { opacity: 0.5; }
.dashboard-row-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.dashboard-row-label { font-size: 0.88em; font-weight: 500; flex: 1; }
.dashboard-row-value { font-size: 0.78em; color: #aaa; margin-top: 1px; }
.dashboard-row-actions { display: flex; gap: 4px; margin-top: 4px; }
.dashboard-action-btn {
  font-size: 0.75em;
  padding: 3px 8px;
  background: rgba(255,255,255,0.08);
  border: none;
  border-radius: 5px;
  color: #ccc;
  cursor: pointer;
}
.dashboard-action-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
.dashboard-action-btn.review-btn { color: #e67e22; }
/* Badges */
.db-badge {
  font-size: 0.7em;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.db-badge-manual           { background: #1a472a; color: #2ecc71; }
.db-badge-import           { background: #1a2a47; color: #5dade2; }
.db-badge-session          { background: #2d2d1a; color: #f1c40f; }
.db-badge-unknown          { background: #2d2d2d; color: #888; }
.db-badge-stable           { background: #1a3a1a; color: #2ecc71; }
.db-badge-unstable         { background: #3a1a1a; color: #e74c3c; }
.db-badge-needs-review     { background: #3a2a1a; color: #e67e22; }
.db-badge-status-unknown   { background: #2d2d2d; color: #888; }
.db-badge-open-review      { background: #3a2000; color: #e67e22; border: 1px solid #e67e22; }
/* --- /ZUNO_PWA_MEMORY_DASHBOARD_BADGES_V1 --- */

/* --- ZUNO_PWA_MEMORY_REVIEW_BADGES_V1 --- */
.memory-reviews-view { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
.memory-reviews-view.hidden { display: none; }
.review-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  margin-bottom: 6px;
  border-left: 3px solid #e67e22;
  cursor: pointer;
}
.review-row:hover { background: rgba(255,255,255,0.07); }
.review-row.resolved { border-left-color: #2ecc71; opacity: 0.7; }
.review-row.dismissed { border-left-color: #888; opacity: 0.6; }
.review-row-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.review-row-id { font-size: 0.78em; color: #888; }
.review-row-label { font-size: 0.88em; font-weight: 500; flex: 1; }
.review-row-compare {
  display: flex;
  gap: 8px;
  font-size: 0.78em;
  color: #aaa;
  margin-top: 2px;
}
.review-row-compare .cur { color: #5dade2; }
.review-row-compare .prop { color: #f1c40f; }
.review-row-compare .sep { color: #555; }
.db-badge-open     { background: #3a2000; color: #e67e22; border: 1px solid #e67e22; }
.db-badge-resolved { background: #1a3a1a; color: #2ecc71; }
.db-badge-dismissed{ background: #2d2d2d; color: #888; }
.db-badge-reason   { background: rgba(255,255,255,0.07); color: #bbb; }
/* Detail panel */
.review-detail-panel {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #111;
  overflow-y: auto;
  padding: 12px;
  z-index: 10;
  border-radius: 12px;
}
.review-detail-panel.hidden { display: none; }
.review-detail-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.review-detail-back {
  background: none;
  border: none;
  color: #888;
  font-size: 1.1em;
  cursor: pointer;
  padding: 4px 8px;
}
.review-detail-back:hover { color: #fff; }
.review-detail-title { font-size: 0.95em; font-weight: 600; flex: 1; }
.review-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0;
}
.review-compare-col {
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.82em;
}
.review-compare-col.current  { border-top: 2px solid #5dade2; }
.review-compare-col.proposed { border-top: 2px solid #f1c40f; }
.review-compare-col h4 { font-size: 0.85em; margin: 0 0 6px; color: #aaa; }
.review-compare-col .val { font-size: 0.95em; color: #fff; margin-bottom: 4px; word-break: break-word; }
.review-compare-col .meta { color: #888; font-size: 0.8em; line-height: 1.6; }
.review-detail-section { margin: 10px 0; font-size: 0.82em; }
.review-detail-section h4 { color: #888; font-size: 0.85em; margin: 0 0 4px; }
.review-actions { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.review-note-input {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  color: #fff;
  font-size: 0.82em;
  padding: 6px 10px;
  resize: none;
  box-sizing: border-box;
}
.review-action-btn {
  padding: 7px 12px;
  border: none;
  border-radius: 7px;
  font-size: 0.82em;
  cursor: pointer;
  font-weight: 500;
}
.review-action-btn.approve  { background: #1a472a; color: #2ecc71; }
.review-action-btn.keep     { background: #1a2a47; color: #5dade2; }
.review-action-btn.dismiss  { background: #2d2d2d; color: #aaa; }
.review-action-btn:hover    { filter: brightness(1.3); }
.review-action-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.review-success-msg { color: #2ecc71; font-size: 0.85em; margin-top: 6px; }
.review-error-msg   { color: #e74c3c; font-size: 0.85em; margin-top: 6px; }
.review-links { display: flex; gap: 6px; margin-top: 8px; }
.review-payload-toggle {
  font-size: 0.78em;
  color: #888;
  cursor: pointer;
  margin-top: 8px;
  text-decoration: underline;
}
.review-payload-box {
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  padding: 8px;
  font-size: 0.75em;
  color: #aaa;
  word-break: break-all;
  white-space: pre-wrap;
  margin-top: 4px;
}
/* --- /ZUNO_PWA_MEMORY_REVIEW_BADGES_V1 --- */

/* --- ZUNO_PWA_MEMORY_EDITOR_STYLE_V1 --- */
.memory-editor-panel {
  background: #1e1e2e;
  border-radius: 12px;
  padding: 24px;
  width: 100%;
  max-width: 540px;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  color: #cdd6f4;
}
.memory-editor-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px 14px;
  align-items: start;
  margin: 16px 0;
}
.memory-editor-label {
  font-size: 0.78rem;
  color: #a6adc8;
  padding-top: 8px;
  font-weight: 500;
}
.memory-editor-input {
  background: #313244;
  border: 1px solid #45475a;
  border-radius: 6px;
  color: #cdd6f4;
  padding: 6px 10px;
  font-size: 0.88rem;
  width: 100%;
  box-sizing: border-box;
}
.memory-editor-textarea {
  background: #313244;
  border: 1px solid #45475a;
  border-radius: 6px;
  color: #cdd6f4;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-family: monospace;
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
}
.memory-editor-input:focus,
.memory-editor-textarea:focus {
  outline: none;
  border-color: #89b4fa;
}
.memory-editor-static {
  font-size: 0.85rem;
  padding: 6px 0;
  color: #a6adc8;
}
.memory-editor-static.readonly {
  color: #585b70;
}
.memory-editor-readonly-note {
  font-size: 0.75rem;
  color: #45475a;
}
.memory-editor-err {
  color: #f38ba8;
  font-size: 0.80rem;
  min-height: 1.2em;
  grid-column: 1 / -1;
}
.memory-editor-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  justify-content: flex-end;
}
.memory-editor-save-btn {
  background: #89b4fa;
  color: #1e1e2e;
  border: none;
  border-radius: 7px;
  padding: 8px 20px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
}
.memory-editor-save-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.memory-editor-cancel-btn {
  background: #313244;
  color: #a6adc8;
  border: 1px solid #45475a;
  border-radius: 7px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 0.9rem;
}
.dash-edit-btn {
  background: #313244;
  color: #cdd6f4;
}
.dash-edit-btn:hover {
  background: #45475a;
}
/* --- /ZUNO_PWA_MEMORY_EDITOR_STYLE_V1 --- */

/* --- ZUNO_PWA_MEMORY_EDITOR_CREATE_STYLE_V1 --- */
.dashboard-create-btn {
  background: #a6e3a1;
  color: #1e1e2e;
  border: none;
  border-radius: 7px;
  padding: 6px 14px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
  white-space: nowrap;
}
.dashboard-create-btn:hover {
  background: #94e2d5;
}
/* --- /ZUNO_PWA_MEMORY_EDITOR_CREATE_STYLE_V1 --- */

/* --- ZUNO_PWA_MEMORY_EDITOR_DELETE_STYLE_V1 --- */
.memory-delete-panel {
  background: #1e1e2e;
  border-radius: 12px;
  padding: 28px;
  width: 100%;
  max-width: 420px;
  color: #cdd6f4;
}
.memory-delete-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: #f38ba8;
}
.memory-delete-msg {
  font-size: 0.92rem;
  margin-bottom: 10px;
  line-height: 1.5;
}
.memory-delete-note {
  font-size: 0.78rem;
  color: #a6adc8;
  margin-bottom: 16px;
}
.memory-editor-delete-btn {
  background: #f38ba8;
  color: #1e1e2e;
  border: none;
  border-radius: 7px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
}
.memory-editor-delete-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.dash-delete-btn {
  background: #313244;
  color: #f38ba8;
  border: 1px solid #45475a;
}
.dash-delete-btn:hover {
  background: #f38ba8;
  color: #1e1e2e;
}
/* --- /ZUNO_PWA_MEMORY_EDITOR_DELETE_STYLE_V1 --- */

/* --- ZUNO_PWA_MEMORY_AUDIT_STYLE_V1 --- */
.memory-editor-history-btn {
  margin-left: auto;
  background: #313244;
  color: #89b4fa;
  border: 1px solid #45475a;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.78rem;
  cursor: pointer;
}
.memory-editor-history-btn:hover { background: #45475a; }
.memory-history-section {
  border-top: 1px solid #313244;
  margin-top: 16px;
  padding-top: 14px;
}
.memory-history-list { display: flex; flex-direction: column; gap: 10px; }
.memory-history-entry {
  background: #181825;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.82rem;
}
.memory-history-entry-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.memory-history-badge {
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 0.75rem;
  font-weight: 600;
}
.history-create  { background: #a6e3a1; color: #1e1e2e; }
.history-patch   { background: #89b4fa; color: #1e1e2e; }
.history-delete  { background: #f38ba8; color: #1e1e2e; }
.history-restore { background: #f9e2af; color: #1e1e2e; }
.memory-history-dt { color: #a6adc8; font-size: 0.78rem; }
.memory-history-fields { color: #6c7086; font-size: 0.78rem; margin-bottom: 2px; }
.memory-history-reason { color: #a6adc8; font-size: 0.78rem; font-style: italic; }
.memory-history-actions { display: flex; gap: 8px; margin-top: 6px; }
.memory-history-diff-btn {
  background: #313244; color: #cdd6f4;
  border: 1px solid #45475a; border-radius: 5px;
  padding: 3px 9px; font-size: 0.78rem; cursor: pointer;
}
.memory-history-restore-btn {
  background: #f9e2af; color: #1e1e2e;
  border: none; border-radius: 5px;
  padding: 3px 9px; font-size: 0.78rem; cursor: pointer; font-weight: 600;
}
.memory-history-restore-btn:disabled { opacity: 0.5; }
.memory-history-nodiff { color: #6c7086; font-size: 0.78rem; padding: 4px 0; }
.memory-history-empty  { color: #6c7086; font-size: 0.85rem; padding: 8px 0; }
.memory-diff-table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 0.78rem; }
.memory-diff-table th { color: #a6adc8; text-align: left; padding: 3px 6px; border-bottom: 1px solid #313244; }
.memory-diff-table td { padding: 3px 6px; vertical-align: top; word-break: break-all; }
.diff-before { color: #f38ba8; }
.diff-after  { color: #a6e3a1; }
/* --- /ZUNO_PWA_MEMORY_AUDIT_STYLE_V1 --- */

/* --- ZUNO_PWA_MEMORY_POLICY_STYLE_V1 --- */
/* C31.4 – Policy feedback stílusok */
.policy-blocked {
  color: #c0392b !important;
  background: #fdecea;
  border-left: 3px solid #c0392b;
  padding: 6px 10px;
  border-radius: 4px;
}
.policy-approval {
  color: #b7600a !important;
  background: #fff3e0;
  border-left: 3px solid #e67e22;
  padding: 6px 10px;
  border-radius: 4px;
}
.policy-field-highlight {
  border-color: #e67e22 !important;
  box-shadow: 0 0 0 2px rgba(230,126,34,0.25) !important;
}
.policy-field-warn {
  font-size: 0.82em;
  color: #b7600a;
  margin-top: 3px;
  margin-bottom: 4px;
}
/* --- /ZUNO_PWA_MEMORY_POLICY_STYLE_V1 --- */

/* C42/G — Proposals panel */
#proposals-btn {
  background: none;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
  padding: 4px;
  position: relative;
}
#proposals-btn:hover { opacity: 1; }
#proposals-btn .badge {
  position: absolute;
  top: 0; right: 0;
  background: #e53e3e;
  color: white;
  border-radius: 50%;
  font-size: 0.5em;
  width: 1.4em; height: 1.4em;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.proposals-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
}
.proposals-panel {
  position: fixed;
  top: 0; right: 0;
  width: min(420px, 100vw);
  height: 100vh;
  background: #1a1a2e;
  color: #e0e0e0;
  z-index: 101;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,0.4);
  overflow: hidden;
}
.proposals-panel.hidden, .proposals-overlay.hidden { display: none; }
.proposals-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: linear-gradient(135deg, #667eea, #764ba2);
}
.proposals-panel-header h2 { font-size: 1.1em; margin: 0; }
.proposals-panel-actions { display: flex; gap: 8px; }
.proposals-panel-actions button {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 1em;
}
.proposals-panel-actions button:hover { background: rgba(255,255,255,0.25); }
.proposals-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.proposals-loading {
  text-align: center;
  color: #888;
  padding: 24px;
  font-size: 0.9em;
}
.proposals-empty {
  text-align: center;
  color: #888;
  padding: 32px 16px;
  font-size: 0.9em;
}
.proposal-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.proposal-card.status-accepted { border-color: #48bb78; }
.proposal-card.status-rejected { border-color: #fc8181; opacity: 0.6; }
.proposal-card.status-deferred { border-color: #f6ad55; opacity: 0.7; }
.proposal-message {
  font-size: 0.95em;
  line-height: 1.4;
}
.proposal-meta {
  font-size: 0.75em;
  color: #888;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.proposal-execution {
  font-size: 0.8em;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(72,187,120,0.15);
  color: #68d391;
}
.proposal-execution.failed {
  background: rgba(252,129,129,0.15);
  color: #fc8181;
}
.proposal-execution.skipped {
  background: rgba(246,173,85,0.15);
  color: #f6ad55;
}
.proposal-actions {
  display: flex;
  gap: 8px;
}
.proposal-actions button {
  flex: 1;
  border: none;
  border-radius: 8px;
  padding: 8px;
  font-size: 0.85em;
  cursor: pointer;
  transition: opacity 0.2s;
}
.proposal-actions button:hover { opacity: 0.85; }
.proposal-btn-accept {
  background: #48bb78;
  color: white;
}
.proposal-btn-reject {
  background: rgba(255,255,255,0.1);
  color: #e0e0e0;
}
.proposal-btn-defer {
  background: rgba(255,255,255,0.07);
  color: #aaa;
  font-size: 0.78em !important;
}
