/* Warm-palette UI chrome (amber/orange/stone) */

.brand {
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.brand-title {
  color: #92400e;
  font-size: 20px;
  line-height: 1.1;
  font-weight: 700;
}
.brand-subtitle {
  margin-top: 3px;
  color: #78716c;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}
.brand:hover .brand-title {
  color: #78350f;
}
@media (max-width: 640px) {
  .brand-title {
    font-size: 18px;
  }
  .brand-subtitle {
    display: none;
  }
}

.filter-btn {
  padding: 4px 10px;
  border-radius: 4px;
  color: #78716c;
  background: transparent;
  cursor: pointer;
}
.filter-btn:hover { background: #fff7ed; }
.filter-btn.active {
  background: #b45309;
  color: white;
}

.topic-item {
  padding: 12px 16px;
  border-bottom: 1px solid #fef3c7;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.topic-item:hover { background: #fffbeb; }
.topic-item.active { background: #fef3c7; }
.topic-item .title { font-size: 14px; font-weight: 500; color: #44403c; line-height: 1.4; }
.topic-item .meta { font-size: 11px; color: #a8a29e; display: flex; gap: 8px; }

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #fef3c7;
  color: #92400e;
}
.badge.draft     { background: #fef3c7; color: #92400e; }
.badge.writing   { background: #fed7aa; color: #9a3412; }
.badge.done      { background: #d9f99d; color: #3f6212; }
.badge.discarded { background: #fecaca; color: #991b1b; }

.section-card {
  background: white;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 16px;
}
.section-card h3 {
  font-size: 13px;
  font-weight: 600;
  color: #92400e;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.section-card textarea {
  width: 100%;
  min-height: 200px;
  border: 1px solid #fde68a;
  border-radius: 4px;
  padding: 8px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #44403c;
}
.section-card textarea:focus { outline: 2px solid #fbbf24; outline-offset: -1px; }

.btn {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid #fde68a;
  background: white;
  color: #44403c;
}
.btn:hover { background: #fffbeb; }
.btn-primary {
  background: #d97706;
  color: white;
  border-color: #d97706;
}
.btn-primary:hover { background: #b45309; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.mode-btn.active { background: #d97706; color: white; border-color: #d97706; }

.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid #fde68a;
  border-top-color: #b45309;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.generation-progress {
  margin: -2px 0 10px;
  border: 1px solid #fde68a;
  border-radius: 6px;
  background: #fffbeb;
  overflow: hidden;
}
.generation-progress-bar {
  height: 6px;
  overflow: hidden;
  background: #fef3c7;
}
.generation-progress .progress-stripe {
  height: 100%;
}
.generation-progress-label {
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.4;
  color: #92400e;
}

/* TOC (heading outline in fullscreen draft editor) */
#draft-modal-toc li {
  padding: 4px 12px;
  cursor: pointer;
  color: #57534e;
  font-size: 13px;
  line-height: 1.4;
  border-left: 2px solid transparent;
}
#draft-modal-toc li:hover { background: #fffbeb; border-left-color: #fbbf24; }
#draft-modal-toc li.level-1 { font-weight: 600; color: #44403c; padding-left: 12px; }
#draft-modal-toc li.level-2 { padding-left: 24px; }
#draft-modal-toc li.level-3 { padding-left: 36px; font-size: 12px; color: #78716c; }
#draft-modal-toc li.level-4,
#draft-modal-toc li.level-5,
#draft-modal-toc li.level-6 { padding-left: 48px; font-size: 12px; color: #a8a29e; }
#draft-modal-toc .empty { padding: 12px; color: #a8a29e; font-size: 12px; }

/* indeterminate striped progress bar */
.progress-stripe {
  width: 200%;
  background: repeating-linear-gradient(
    -45deg,
    #f59e0b 0 12px,
    #fbbf24 12px 24px
  );
  animation: progress-slide 1.1s linear infinite;
}
@keyframes progress-slide {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

/* dimmed overlay while busy */
.busy-dim { position: relative; }
.busy-dim::after {
  content: "";
  position: absolute; inset: 0;
  background: rgba(255,251,235,0.5);
  pointer-events: none;
}

/* misc form elements */
input[type="text"]:focus, select:focus, textarea:focus { outline: 2px solid #fbbf24; outline-offset: -1px; }

/* scrollbar (subtle warm) */
* { scrollbar-color: #fde68a transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #fde68a; border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: #fbbf24; }
