/* =============================================================
   MCR Email Builder — UI Styles (light / cream workspace)
   ============================================================= */

:root {
  /* Brand */
  --ink: #1D120A;
  --orange: #EF492C;
  --orange-hover: #f15a3e;
  --sage: #7B9B8D;
  --sage-2: #6a8b7d;
  --tan: #D4C9B8;

  /* Chrome — warm neutral workspace */
  --bg: #f6f3ee;           /* overall app bg */
  --bg-2: #efeae2;         /* secondary bg (behind preview) */
  --panel: #ffffff;
  --panel-2: #faf7f2;
  --border: #e4ddd0;
  --border-2: #d4ccbb;
  --divider: #eee7db;

  /* Text */
  --text: #241a11;
  --text-2: #5a4a3a;
  --text-muted: #8b7b6a;
  --text-dim: #b0a493;

  /* States */
  --hover: #f0ebe0;
  --selected: #eaf1ed;     /* sage tint */
  --danger: #c84a3a;
  --warn: #c8873a;
  --ok-bg: #e5efe8;
  --warn-bg: #f7ecd8;

  --shadow-sm: 0 1px 2px rgba(29,18,10,0.05);
  --shadow-md: 0 4px 16px rgba(29,18,10,0.08);
  --shadow-lg: 0 12px 40px rgba(29,18,10,0.14);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
input::placeholder, textarea::placeholder { color: var(--text-dim); }

/* ============ APP LAYOUT ============ */
.app {
  display: grid;
  grid-template-rows: 60px 1fr;
  height: 100vh;
  width: 100vw;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  z-index: 10;
  min-width: 0;
  overflow: visible;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: 19px;
  letter-spacing: 2px;
  color: var(--ink);
  padding-right: 10px;
  border-right: 1px solid var(--border);
  margin-right: 2px;
  flex-shrink: 0;
}
@media (max-width: 1400px) { .brand-text { display: none; } .brand { padding-right: 6px; } }
.brand-mark {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--ink);
  display: flex; align-items: center; justify-content: center;
  color: white; font-family: "Bebas Neue", sans-serif;
  font-size: 18px;
  letter-spacing: 0;
}
.campaign-name {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  min-width: 120px;
  max-width: 220px;
  font-weight: 500;
  flex-shrink: 1;
}
@media (max-width: 1280px) { .campaign-name { max-width: 140px; } }
.campaign-name:focus {
  outline: 2px solid var(--sage);
  outline-offset: -1px;
  border-color: var(--sage);
  background: white;
}

.topbar .spacer { flex: 1; }

.save-status {
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--panel-2);
  transition: all 0.2s;
  font-weight: 500;
  flex-shrink: 0;
  white-space: nowrap;
}
@media (max-width: 1200px) { .save-status { display: none; } }
.save-status.saved {
  color: #4a7b58;
  background: var(--ok-bg);
}

.btn {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 11px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.12s;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.btn-compact { padding: 7px 9px; }
@media (max-width: 1280px) {
  .btn-text { display: none; }
  .btn { gap: 0; }
}
.btn-ai {
  background: linear-gradient(135deg, #a855f7, #ec4899) !important;
  color: white !important;
  border-color: transparent !important;
  font-weight: 600 !important;
}
.btn-ai:hover { filter: brightness(1.1); }
.btn:hover { background: var(--hover); border-color: var(--border-2); }
.btn.primary {
  background: var(--orange);
  border-color: var(--orange);
  color: white;
  font-weight: 600;
}
.btn.primary:hover { background: var(--orange-hover); border-color: var(--orange-hover); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--hover); }
.btn.icon { padding: 8px; }

.menu-wrap { position: relative; flex-shrink: 0; }
.menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 4px;
  min-width: 220px;
  z-index: 50;
  display: none;
  flex-direction: column;
}
.menu.show { display: flex; }
.menu button {
  background: transparent;
  border: 0;
  text-align: left;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  border-radius: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
}
.menu button:hover { background: var(--selected); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
.menu-kb {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-dim);
  background: var(--panel-2);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: Menlo, monospace;
}

.seg {
  display: inline-flex;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  padding: 2px;
  flex-shrink: 0;
}
.seg button {
  background: transparent;
  border: 0;
  color: var(--text-2);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
}
.seg button.active { background: white; color: var(--ink); box-shadow: var(--shadow-sm); }

select.preset-sel {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 26px 7px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
  max-width: 150px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238b7b6a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}
select.preset-sel:hover { background-color: var(--hover); }

/* ============ MAIN GRID ============ */
.main {
  display: grid;
  grid-template-columns: 300px 1fr 340px;
  height: 100%;
  overflow: hidden;
  background: var(--bg-2);
}
@media (max-width: 1400px) {
  .main { grid-template-columns: 270px 1fr 300px; }
}
@media (max-width: 1200px) {
  .main { grid-template-columns: 240px 1fr 280px; }
}
@media (max-width: 1024px) {
  .main { grid-template-columns: 220px 1fr 260px; }
}

.panel {
  background: var(--panel);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
}
.panel:last-child { border-right: 0; border-left: 1px solid var(--border); }

/* ============ LEFT: MODULES PANEL ============ */
.subject-block {
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
}
.subject-block .label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.subject-block .count { color: var(--text-dim); font-weight: 500; }
.subject-block .count.warn { color: var(--warn); }
.subject-block .count.bad { color: var(--danger); }
.subject-block input {
  width: 100%;
  background: white;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 5px;
  font-size: 13px;
  margin-bottom: 12px;
}
.subject-block input:focus {
  outline: 2px solid var(--sage);
  outline-offset: -1px;
  border-color: var(--sage);
}

.inbox-preview {
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 11px;
  margin-top: 4px;
}
.inbox-preview .inbox-sender { color: var(--text); font-weight: 600; }
.inbox-preview .inbox-subject { color: var(--text); font-size: 12px; margin: 3px 0 2px; font-weight: 500; }
.inbox-preview .inbox-preheader { color: var(--text-muted); }

.modules-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px 8px;
}
.modules-header h3 {
  margin: 0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  font-weight: 600;
}
.module-list { padding: 4px 10px 12px; }
.module-item {
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 10px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.12s;
}
.module-item:hover { border-color: var(--border-2); background: var(--hover); }
.module-item.selected {
  border-color: var(--sage);
  background: var(--selected);
  box-shadow: 0 0 0 2px rgba(123,155,141,0.15);
}
.module-item.disabled { opacity: 0.45; }
.module-handle {
  color: var(--text-dim);
  cursor: grab;
  user-select: none;
  font-size: 14px;
  line-height: 1;
  letter-spacing: -2px;
}
.module-handle:active { cursor: grabbing; }
.module-icon {
  width: 28px; height: 28px;
  border-radius: 5px;
  background: var(--ink);
  color: var(--tan);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.module-item.selected .module-icon { background: var(--sage); color: white; }
.module-label {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.module-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.12s;
}
.module-item:hover .module-actions,
.module-item.selected .module-actions { opacity: 1; }
.module-action-btn {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  padding: 4px 6px;
  font-size: 13px;
  border-radius: 4px;
  line-height: 1;
}
.module-action-btn:hover { background: white; color: var(--text); box-shadow: var(--shadow-sm); }
.module-action-btn.danger:hover { color: var(--danger); }
.list-empty {
  text-align: center;
  padding: 36px 16px;
  color: var(--text-muted);
}
.list-empty-icon { font-size: 32px; margin-bottom: 10px; }
.list-empty-title { font-size: 14px; color: var(--text); font-weight: 600; margin-bottom: 6px; }
.list-empty-sub { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

.module-item.dragging { opacity: 0.4; }
.module-item.drag-over { border-top: 2px solid var(--orange); }

.add-module-btn {
  width: 100%;
  background: transparent;
  border: 1.5px dashed var(--border-2);
  color: var(--text-muted);
  padding: 10px;
  border-radius: 6px;
  font-size: 13px;
  margin-top: 4px;
  font-weight: 500;
}
.add-module-btn:hover {
  border-color: var(--sage);
  color: var(--sage-2);
  background: var(--panel-2);
}

/* ============ CENTER: PREVIEW ============ */
.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
}
.check-pill {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}
.check-pill.ok { color: #4a7b58; background: var(--ok-bg); border-color: #c9dfd0; }
.check-pill.warn { color: var(--warn); background: var(--warn-bg); border-color: #e8d5b0; }

.preview-wrap {
  background: var(--bg-2);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 30px 20px 60px;
  overflow: auto;
}
.preview-shell {
  background: #fff;
  box-shadow: var(--shadow-lg);
  transition: width 0.2s;
  border-radius: 8px;
  overflow: hidden;
}
.preview-shell.desktop { width: 660px; max-width: 100%; }
.preview-shell.mobile { width: 400px; }
.preview-shell iframe {
  width: 100%;
  border: 0;
  display: block;
  min-height: 600px;
  background: white;
}

/* ============ RIGHT: PROPS PANEL ============ */
.props-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}
.props-empty .icon { font-size: 36px; margin-bottom: 12px; color: var(--text-dim); }

.props-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel-2);
}
.props-header .module-icon { width: 36px; height: 36px; font-size: 15px; background: var(--sage); color: white; }
.props-header h3 {
  margin: 0;
  font-size: 15px;
  color: var(--text);
  flex: 1;
  font-weight: 600;
}
.props-header .props-sub {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}
.props-body { padding: 16px; }

.field { margin-bottom: 16px; }
.field label.field-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.field .hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}
.field input[type=text],
.field input[type=url],
.field textarea,
.field select {
  width: 100%;
  background: white;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 5px;
  font-size: 13px;
  resize: vertical;
}
.field textarea { min-height: 80px; font-family: inherit; line-height: 1.55; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 2px solid var(--sage);
  outline-offset: -1px;
  border-color: var(--sage);
}
.field.toggle { display: flex; align-items: center; gap: 10px; }
.field.toggle label.field-label { margin: 0; flex: 1; }
.toggle-switch {
  width: 36px; height: 20px;
  background: var(--border-2);
  border-radius: 20px;
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}
.toggle-switch::after {
  content: "";
  position: absolute;
  left: 2px; top: 2px;
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.15s;
  box-shadow: var(--shadow-sm);
}
.toggle-switch.on { background: var(--sage); }
.toggle-switch.on::after { transform: translateX(16px); }

.image-preview {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel-2);
  border: 1px dashed var(--border-2);
  border-radius: 5px;
  padding: 6px;
  margin-top: 6px;
  transition: all 0.15s;
}
.image-preview.dragover {
  border-color: var(--sage);
  background: var(--selected);
  transform: scale(1.01);
}
.image-preview img {
  width: 48px; height: 48px;
  object-fit: contain;
  background: var(--hover);
  border-radius: 3px;
  flex-shrink: 0;
}
.image-preview .image-url {
  flex: 1;
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-pick {
  padding: 6px 10px;
  font-size: 11px;
  background: var(--sage);
  color: white;
  border: 0;
  border-radius: 4px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.btn-pick:hover { background: var(--sage-2); }

.list-items { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
}
.list-item-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted); font-weight: 600; margin-bottom: 8px;
}
.list-item-head button {
  background: transparent; border: 0; color: var(--text-muted);
  font-size: 11px; cursor: pointer; padding: 2px 6px; border-radius: 3px;
}
.list-item-head button:hover { color: var(--danger); background: white; }
.list-add-btn {
  background: transparent;
  border: 1.5px dashed var(--border-2);
  color: var(--text-muted);
  padding: 8px;
  border-radius: 5px;
  font-size: 12px;
  width: 100%;
  font-weight: 500;
}
.list-add-btn:hover { border-color: var(--sage); color: var(--sage-2); }

.merge-tags {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px;
}
.merge-tag-chip {
  background: var(--selected);
  border: 1px solid #c6d8ce;
  color: var(--sage-2);
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 10px;
  cursor: pointer;
  font-family: "Menlo", monospace;
  font-weight: 500;
}
.merge-tag-chip:hover { background: var(--sage); color: white; border-color: var(--sage); }

/* ============ MODALS ============ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(29,18,10,0.55);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  backdrop-filter: blur(2px);
}
.modal-backdrop.show { display: flex; }
.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 900px;
  width: 100%;
  max-height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.modal.small { max-width: 560px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
}
.modal-head h2 {
  margin: 0;
  font-size: 18px;
  color: var(--ink);
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 1.5px;
}
.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

.asset-tabs { display: flex; gap: 2px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.asset-tab {
  background: transparent; border: 0;
  color: var(--text-muted);
  padding: 9px 14px;
  font-size: 11px;
  border-bottom: 2px solid transparent;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}
.asset-tab:hover { color: var(--text); }
.asset-tab.active { color: var(--ink); border-bottom-color: var(--orange); }
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.asset-tile {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.12s;
  text-align: center;
}
.asset-tile:hover { border-color: var(--sage); background: white; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.asset-tile.selected { border-color: var(--orange); }
.asset-tile .thumb {
  height: 70px;
  background: var(--ink);
  border-radius: 4px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.asset-tile .thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.asset-tile .asset-name {
  font-size: 11px;
  color: var(--text-2);
  line-height: 1.3;
  word-break: break-word;
  font-weight: 500;
}

/* Send to Hive — restructured */
.hive-primary {
  background: linear-gradient(135deg, #fff4ef, #ffe6db);
  border: 1px solid #f4c8b6;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
}
.hive-primary-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
}
.hive-primary-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px;
  color: #8a3a20; font-weight: 700;
  margin-bottom: 2px;
}
.hive-primary-sub {
  font-size: 12px; color: var(--text-2);
}
.hive-copy-big {
  font-size: 14px !important;
  padding: 12px 22px !important;
  white-space: nowrap;
}
.hive-warn {
  margin-top: 12px;
  background: #fff8eb;
  border: 1px solid #e8c885;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12px;
  color: #8a5a20;
  display: flex; align-items: center;
}
.hive-chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.hive-chip {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.1s;
  overflow: hidden;
}
.hive-chip:hover { border-color: var(--sage); background: white; }
.hive-chip .chip-label {
  display: block;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 2px;
}
.hive-chip .chip-value {
  display: block;
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hive-checklist {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.hive-check-title {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--text-muted); font-weight: 600; margin-bottom: 10px;
}
.hive-checklist label {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 5px 0;
  font-size: 13px; color: var(--text);
  line-height: 1.5;
  cursor: pointer;
}
.hive-checklist input[type="checkbox"] { margin-top: 3px; accent-color: var(--orange); }
.hive-checklist input[type="checkbox"]:checked + span { color: var(--text-muted); text-decoration: line-through; }
.hive-checklist code {
  background: white; border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 3px; font-size: 11px;
  font-family: Menlo, monospace; color: var(--sage-2);
}
.hive-details {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0;
  background: var(--panel-2);
}
.hive-details summary {
  cursor: pointer; padding: 10px 14px;
  font-size: 12px; color: var(--text-2);
  font-weight: 500;
  user-select: none;
}
.hive-details summary:hover { background: white; }
.hive-details ul { margin: 0; padding: 0 14px 14px 30px; }
.hive-details li { font-size: 12px; color: var(--text-2); line-height: 1.8; }
.hive-details code { font-family: Menlo, monospace; font-size: 11px; color: var(--sage-2); background: white; padding: 1px 5px; border-radius: 3px; }

/* Drafts list */
.drafts-list { display: flex; flex-direction: column; gap: 8px; }
.draft-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
}
.draft-row .draft-info { flex: 1; }
.draft-row .draft-name { color: var(--text); font-weight: 600; font-size: 13px; }
.draft-row .draft-meta { color: var(--text-muted); font-size: 11px; margin-top: 3px; }
.draft-row .draft-actions { display: flex; gap: 6px; }

/* Add module grid */
.add-search-wrap { margin-bottom: 16px; }
.add-search {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
}
.add-search:focus { outline: 2px solid var(--sage); outline-offset: -1px; border-color: var(--sage); background: white; }

.add-cat { margin-bottom: 22px; }
.add-cat-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); margin-bottom: 10px; font-weight: 600; }

.add-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.add-tile {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0;
  cursor: pointer;
  text-align: left;
  transition: all 0.12s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.add-tile:hover {
  border-color: var(--sage);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.add-tile .tile-preview {
  background: #fcfaf5;
  height: 130px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
}
.add-tile .tile-meta {
  padding: 10px 12px;
  background: white;
}
.add-tile .tile-label { font-size: 12.5px; color: var(--text); line-height: 1.3; font-weight: 600; }
.add-tile .tile-cat { font-size: 10.5px; color: var(--text-muted); margin-top: 3px; font-weight: 400; line-height: 1.3; }

/* Abstract preview shapes (uses MCR palette) */
.pv-dark { background: #1D120A; border-radius: 3px; padding: 8px 10px; display: flex; flex-direction: column; gap: 5px; }
.pv-footer { margin-top: auto; padding: 6px 10px; }
.pv-logo { width: 40px; height: 10px; background: #D4C9B8; border-radius: 2px; margin: 0 auto; }
.pv-navs { display: flex; gap: 4px; justify-content: center; }
.pv-navs span { width: 14px; height: 3px; background: #7B9B8D; border-radius: 1px; }
.pv-img { background: linear-gradient(135deg, #7B9B8D, #1D120A); height: 36px; border-radius: 2px; margin-bottom: 2px; }
.pv-hero-img { height: 46px; }
.pv-img-half { height: 40px; width: 45%; flex-shrink: 0; }
.pv-h1 { height: 7px; width: 75%; background: #1D120A; border-radius: 2px; margin-top: 2px; }
.pv-h2 { height: 6px; width: 65%; background: #1D120A; border-radius: 2px; }
.pv-h2-center { height: 6px; width: 55%; background: #1D120A; border-radius: 2px; margin: 2px auto; }
.pv-sub { height: 4px; width: 50%; background: #7B9B8D; border-radius: 1px; }
.pv-eyebrow { height: 3px; width: 30%; background: #7B9B8D; border-radius: 1px; }
.pv-eyebrow-orange { height: 3px; width: 35%; background: #EF492C; border-radius: 1px; margin: 0 auto; }
.pv-p { height: 3px; background: #aa9988; border-radius: 1px; width: 100%; }
.pv-p:nth-of-type(3) { width: 80%; }
.pv-link { height: 4px; width: 30%; background: #EF492C; border-radius: 1px; }
.pv-btn { height: 8px; width: 40%; background: #EF492C; border-radius: 2px; margin: 4px auto 0; }
.pv-line { height: 1px; background: #e8e3db; width: 100%; margin: 0 0 4px 0; }
.pv-divider { margin-bottom: 6px; }
.pv-accent-row { display: flex; gap: 6px; align-items: stretch; margin-top: 2px; }
.pv-accent { width: 3px; background: #EF492C; border-radius: 1px; flex-shrink: 0; }
.pv-col { flex: 1; display: flex; flex-direction: column; gap: 3px; justify-content: center; }
.pv-row { display: flex; gap: 8px; align-items: center; }
.pv-bar { display: flex; background: #f8f5f0; border-radius: 3px; padding: 6px; gap: 4px; height: 100%; align-items: center; }
.pv-cell { flex: 1; height: 16px; background: white; border-radius: 2px; border: 1px solid #e8e3db; }
.pv-bullet { display: block; height: 3px; width: 80%; background: #aa9988; border-radius: 1px; position: relative; padding-left: 10px; margin-left: 8px; }
.pv-bullet::before { content: ''; position: absolute; left: -8px; top: 0; width: 4px; height: 3px; background: #EF492C; border-radius: 50%; }
.pv-cards { display: flex; gap: 4px; flex: 1; margin-top: 2px; }
.pv-card { flex: 1; background: white; border: 1px solid #e8e3db; border-radius: 2px; height: 100%; min-height: 30px; }
.pv-stats { display: flex; gap: 8px; margin-top: 4px; justify-content: space-around; }
.pv-stats > div { display: flex; flex-direction: column; gap: 3px; align-items: center; }
.pv-big { width: 20px; height: 14px; background: #EF492C; border-radius: 2px; }
.pv-box { border: 1px solid #e8e3db; border-radius: 3px; overflow: hidden; padding: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; padding: 0 8px 6px; background: white; }
.pv-box-top { height: 3px; background: #EF492C; margin: 0 -8px 4px; }
.pv-quote-mark { font-size: 24px; color: #EF492C; line-height: 0.7; font-family: serif; text-align: center; margin-bottom: 2px; }
.pv-sig { height: 10px; width: 60%; background: #1D120A; border-radius: 2px; margin-top: 4px; }
.pv-partners { display: flex; gap: 3px; margin-top: 4px; flex-wrap: wrap; justify-content: center; }
.pv-partners::before { content: '●●●●●●'; color: #aa9988; font-size: 8px; letter-spacing: 4px; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--ink);
  color: white;
  padding: 11px 20px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 500;
  z-index: 200;
  transition: transform 0.25s;
  box-shadow: var(--shadow-lg);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }

/* Inline preview editor hint banner */
.preview-hint {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: white;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  opacity: 0.85;
  pointer-events: none;
  letter-spacing: 0.3px;
  box-shadow: var(--shadow-md);
}
.preview-hint strong { color: var(--tan); }

/* Command palette */
.palette-modal { overflow: visible; }
.palette-input-wrap {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.palette-input {
  width: 100%;
  background: transparent;
  border: 0;
  padding: 6px 0;
  font-size: 16px;
  color: var(--text);
  outline: none;
  font-family: inherit;
}
.palette-list {
  max-height: 400px;
  overflow-y: auto;
  padding: 6px;
}
.cp-row {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.08s;
}
.cp-row:hover, .cp-row.active { background: var(--selected); }
.cp-icon {
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  background: var(--panel-2);
  border-radius: 5px;
  font-size: 13px;
  color: var(--text-2);
}
.cp-row.active .cp-icon { background: var(--sage); color: white; }
.cp-label { font-size: 13px; color: var(--text); font-weight: 500; }
.cp-group { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: 600; }
.cp-hint {
  font-size: 11px; color: var(--text-dim);
  background: var(--panel-2);
  padding: 2px 6px; border-radius: 3px;
  font-family: Menlo, monospace;
}
.palette-foot {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

/* Shortcuts table */
.shortcut-table { width: 100%; border-collapse: collapse; }
.shortcut-table td { padding: 8px 0; font-size: 13px; color: var(--text); border-bottom: 1px solid var(--border); }
.shortcut-table td:last-child { text-align: right; color: var(--text-muted); }
.shortcut-table .sc-sec {
  padding-top: 18px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-align: left !important;
  border-bottom: 0;
}
kbd {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 12px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  margin: 0 2px;
}

/* Zoom control */
.zoom-ctrl {
  display: inline-flex;
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  padding: 2px;
}
.zoom-ctrl button {
  width: 22px; height: 22px;
  background: transparent;
  border: 0;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
}
.zoom-ctrl button:hover { background: white; color: var(--text); }
.zoom-ctrl span {
  padding: 0 8px;
  font-size: 11px;
  color: var(--text-2);
  font-weight: 500;
  cursor: pointer;
  min-width: 42px;
  text-align: center;
}

.btn[disabled] { opacity: 0.35; cursor: not-allowed; }

/* Test results */
.test-list { display: flex; flex-direction: column; gap: 6px; }
.test-row {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
}
.test-row.ok { background: var(--ok-bg); border-color: #c9dfd0; }
.test-row.fail { background: var(--warn-bg); border-color: #e8d5b0; }
.test-icon {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: white; flex-shrink: 0;
  margin-top: 1px;
}
.test-row.ok .test-icon { background: #4a7b58; }
.test-row.fail .test-icon { background: var(--warn); }
.test-label { font-size: 13px; font-weight: 600; color: var(--text); }
.test-detail { font-size: 12px; color: var(--text-2); margin-top: 2px; line-height: 1.4; }
.test-body { flex: 1; }
.test-fix {
  background: white !important;
  border-color: var(--border-2) !important;
  color: var(--sage-2) !important;
  font-size: 11px !important;
  padding: 6px 10px !important;
  align-self: center;
  white-space: nowrap;
}
.test-fix:hover { background: var(--sage) !important; color: white !important; border-color: var(--sage) !important; }

/* AI — legacy row style (kept for compatibility) */
.ai-suggestion {
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.ai-suggestion-text {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}

/* AI v2 — context-aware assistant */
.ai-context {
  background: linear-gradient(135deg, #faf3fe, #fef1f7);
  border: 1px solid #e8d2f0;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: #6a4682;
  margin-bottom: 12px;
}
.ai-context code {
  background: white;
  border: 1px solid #e8d2f0;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: Menlo, monospace;
  font-size: 11px;
}
.ai-current {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.ai-current-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}
.ai-current-text {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.5;
  white-space: pre-wrap;
}
.ai-quicks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.ai-chip {
  background: white;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 11px;
  border-radius: 18px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.1s;
}
.ai-chip:hover {
  background: linear-gradient(135deg, #a855f7, #ec4899);
  color: white;
  border-color: transparent;
  transform: translateY(-1px);
}
.ai-freeform {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.ai-freeform textarea {
  flex: 1;
  background: white;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  resize: none;
  font-family: inherit;
  line-height: 1.45;
}
.ai-freeform textarea:focus {
  outline: 2px solid #a855f7;
  outline-offset: -1px;
  border-color: #a855f7;
}
.ai-freeform button {
  align-self: stretch;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  border: 0;
  color: white;
  padding: 0 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.ai-freeform button:hover { filter: brightness(1.1); }

.ai-loading {
  padding: 14px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  background: var(--panel-2);
  border-radius: 6px;
  animation: mcr-pulse 1.4s ease-in-out infinite;
}
@keyframes mcr-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.ai-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0 8px;
}
.ai-result-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  font-weight: 700;
}
.ai-result-target {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ai-suggestion-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
  transition: all 0.12s;
}
.ai-suggestion-card:hover {
  border-color: #e8d2f0;
  box-shadow: var(--shadow-sm);
}
.ai-suggestion-body {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 10px;
  white-space: pre-wrap;
}
.ai-suggestion-actions {
  display: flex;
  gap: 6px;
}
.ai-suggestion-actions .btn.primary {
  background: linear-gradient(135deg, #a855f7, #ec4899);
  border: 0;
}
.ai-suggestion-actions .btn.primary:hover { filter: brightness(1.1); }

.ai-footer {
  display: flex;
  align-items: center;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* Scrollbar */
.panel::-webkit-scrollbar, .modal-body::-webkit-scrollbar, .preview-wrap::-webkit-scrollbar { width: 10px; height: 10px; }
.panel::-webkit-scrollbar-track, .modal-body::-webkit-scrollbar-track { background: transparent; }
.panel::-webkit-scrollbar-thumb, .modal-body::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 5px; }
.panel::-webkit-scrollbar-thumb:hover, .modal-body::-webkit-scrollbar-thumb:hover { background: var(--sage); }
