/* ===== NIKO EagleEye Brand Tokens ===== */
:root {
  --color-violet:      #1A1A1A;
  --color-violet-dark: #0A0A0A;
  --color-blue:        #343434;
  --color-blue-dark:   #242424;
  --color-grey-dark:   #333333;
  --color-grey-mid:    #666666;
  --color-grey-light:  #F4F4F4;
  --color-border:      #E0E0E0;
  --color-white:       #ffffff;
}

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

html, body { height: 100%; }

body {
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--color-grey-dark);
  background: #F5F5F7;
  line-height: 1.55;
}

/* ===== Layout ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Header ===== */
.site-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  height: 72px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

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

.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-app-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--color-violet);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-user-email {
  font-size: 12px;
  color: var(--color-grey-mid);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== Main ===== */
.main-content {
  padding: 28px 0 48px;
  min-height: calc(100vh - 72px);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 20px;
  border-radius: 30px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.2;
}

.btn-primary {
  background: var(--color-violet);
  color: var(--color-white);
  border-color: var(--color-violet);
}
.btn-primary:hover {
  background: var(--color-violet-dark);
  border-color: var(--color-violet-dark);
}

.btn-secondary {
  background: var(--color-blue);
  color: var(--color-white);
  border-color: var(--color-blue);
}
.btn-secondary:hover {
  background: var(--color-blue-dark);
  border-color: var(--color-blue-dark);
}

.btn-ghost {
  background: var(--color-white);
  color: var(--color-violet);
  border-color: var(--color-violet);
}
.btn-ghost:hover {
  background: var(--color-violet);
  color: var(--color-white);
}

.btn-danger {
  background: #ffeaea;
  color: #c0392b;
  border-color: #fecaca;
}
.btn-danger:hover {
  background: #c0392b;
  color: var(--color-white);
  border-color: #c0392b;
}

.btn-sm {
  padding: 5px 14px;
  font-size: 12px;
}

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

/* ===== Page section header ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-grey-dark);
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-grey-mid);
  margin-bottom: 16px;
}

.breadcrumb a {
  color: var(--color-violet);
  text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--color-border); }

/* ===== Topic cards grid ===== */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 900px) {
  .topics-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .topics-grid { grid-template-columns: 1fr; }
  .nav-app-name { display: none; }
  .nav-user-email { max-width: 120px; }
  .header-nav { gap: 12px; }
}

.topic-card {
  background: var(--color-white);
  border-radius: 10px;
  padding: 18px 20px;
  cursor: pointer;
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.04);
  transition: box-shadow 0.15s, transform 0.12s;
}
.topic-card:hover {
  box-shadow: 0 4px 14px rgba(26,26,26,0.12), 0 0 0 1px rgba(26,26,26,0.2);
  transform: translateY(-1px);
}

.topic-card-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.topic-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-grey-dark);
}

.topic-card-desc {
  font-size: 13px;
  color: var(--color-grey-mid);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}

.topic-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ===== Badges ===== */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}
.badge-violet {
  background: rgba(26,26,26,0.08);
  color: var(--color-violet);
}
.badge-blue {
  background: rgba(52,52,52,0.1);
  color: var(--color-blue);
}
.badge-schedule {
  background: rgba(52,52,52,0.08);
  color: var(--color-blue);
}

.topic-card-date {
  font-size: 11px;
  color: var(--color-grey-mid);
}

.topic-card-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}
.topic-card:hover .topic-card-actions { opacity: 1; }
.topic-card:hover .icon-btn { opacity: 1; }

/* ===== Empty state ===== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--color-grey-mid);
}
.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-grey-dark);
}
.empty-state-desc {
  font-size: 13px;
  margin-bottom: 20px;
}

/* ===== Detail view layout ===== */
.detail-header {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--color-border);
}

.detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.detail-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--color-grey-dark);
  margin-bottom: 2px;
}

.detail-desc {
  font-size: 13px;
  color: var(--color-grey-mid);
  margin-top: 4px;
  margin-bottom: 8px;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.detail-title-inline {
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-edit-btn,
.detail-delete-btn {
  opacity: 0.3;
  transition: opacity 0.15s, background 0.1s, color 0.1s;
}

.detail-title-inline:hover .detail-edit-btn,
.detail-title-inline:hover .detail-delete-btn {
  opacity: 1;
}

/* ===== Detail tabs ===== */
.detail-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 4px;
}

.tab-description {
  font-size: 13px;
  color: var(--color-grey-dark);
  margin: 8px 0 16px 2px;
}

.tab-panel-actions {
  margin-top: 20px;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-grey-mid);
  cursor: pointer;
  margin-bottom: -2px;
  transition: color 0.1s, border-color 0.1s;
}

.detail-tab.active {
  color: var(--color-violet);
  border-bottom-color: var(--color-violet);
}

.detail-tab:hover:not(.active) {
  color: var(--color-grey-dark);
}

.tab-separator {
  width: 1px;
  background: var(--color-border);
  margin: 6px 8px;
  align-self: stretch;
}

/* ===== Card section ===== */
.card {
  background: var(--color-white);
  border-radius: 10px;
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.04);
}

.card-header {
  padding: 11px 20px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-grey-mid);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.card-body {
  padding: 0;
}

/* ===== Query list ===== */
.query-list {
  list-style: none;
}

.query-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.query-item:last-child { border-bottom: none; }

.query-text {
  flex: 1;
  font-size: 13px;
  color: var(--color-grey-dark);
  line-height: 1.4;
}

.query-edit-input {
  flex: 1;
  font-family: inherit;
  font-size: 13px;
  border: 1px solid var(--color-violet);
  border-radius: 6px;
  padding: 5px 9px;
  outline: none;
  color: var(--color-grey-dark);
}

.query-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 5px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--color-grey-mid);
  transition: background 0.1s, color 0.1s;
  line-height: 1;
  opacity: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.query-item:hover .icon-btn { opacity: 1; }
.icon-btn:hover { background: var(--color-grey-light); color: var(--color-grey-dark); }
.icon-btn.danger:hover { background: #ffeaea; color: #c0392b; }
.icon-btn.save-btn  { opacity: 1; color: var(--color-violet); }
.icon-btn.save-btn:hover { background: rgba(26,26,26,0.08); }
.icon-btn.cancel-btn { opacity: 1; }

/* ===== Add query row ===== */
.add-query-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-top: 1px solid rgba(0,0,0,0.05);
}

.add-query-input {
  flex: 1;
  font-family: inherit;
  font-size: 13px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 6px 10px;
  outline: none;
  color: var(--color-grey-dark);
  transition: border-color 0.1s;
  background: var(--color-white);
}
.add-query-input:focus { border-color: var(--color-violet); }

/* ===== Reports list ===== */
.report-list {
  list-style: none;
}

.report-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  transition: background 0.1s;
}
.report-item:last-child { border-bottom: none; }
.report-item:hover { background: #FAFAFA; }

.report-item-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.report-title-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-violet);
  text-decoration: none;
  cursor: pointer;
}
.report-title-link:hover { text-decoration: underline; }

.report-date {
  font-size: 11px;
  color: var(--color-grey-mid);
}

.report-pdf-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-blue);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.1s;
}
.report-item:hover .report-pdf-link { opacity: 1; }
.report-pdf-link:hover { text-decoration: underline; }

/* ===== Results tab layout (filter pane + list) ===== */
.results-layout {
  display: flex;
  height: calc(100vh - 280px);
  min-height: 300px;
  overflow: hidden;
}

.results-filter-pane {
  width: 210px;
  flex-shrink: 0;
  border-right: 1px solid var(--color-border);
  padding: 20px 16px 24px;
  height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
}

.results-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.filter-section {
  margin-bottom: 20px;
}

.filter-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-grey-mid);
  margin-bottom: 7px;
}

.filter-input {
  width: 100%;
  box-sizing: border-box;
  font-size: 12px;
  color: var(--color-grey-dark);
  background: var(--color-grey-light);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 6px 9px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.filter-input:focus { border-color: var(--color-violet); background: #fff; }

.filter-date-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-date-btn-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.filter-date-btn {
  flex: 1;
  min-width: 0;
  background: var(--color-grey-light);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 12px;
  color: var(--color-grey-mid);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.filter-date-btn:hover { border-color: var(--color-violet); color: var(--color-grey-dark); }
.filter-date-btn--set { border-color: var(--color-violet); color: var(--color-grey-dark); background: #fff; }

.filter-calendar {
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #fff;
  margin-top: 2px;
  margin-bottom: 2px;
  padding: 8px 6px;
  width: 100%;
  box-sizing: border-box;
}
.cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.cal-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-grey-dark);
}
.cal-nav {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-grey-mid);
  font-size: 16px;
  line-height: 1;
  padding: 1px 5px;
  border-radius: 4px;
  font-family: inherit;
}
.cal-nav:hover { background: var(--color-grey-light); color: var(--color-grey-dark); }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
}
.cal-day-name {
  font-size: 9px;
  font-weight: 600;
  color: var(--color-grey-mid);
  text-align: center;
  padding: 2px 0 4px;
  text-transform: uppercase;
}
.cal-day {
  font-size: 11px;
  text-align: center;
  padding: 4px 1px;
  border-radius: 3px;
  cursor: pointer;
  color: var(--color-grey-dark);
}
.cal-day:hover { background: var(--color-grey-light); }
.cal-day--other-month { color: var(--color-border); cursor: default; }
.cal-day--other-month:hover { background: none; }
.cal-day--today { font-weight: 700; }
.cal-day--selected { background: var(--color-violet) !important; color: #fff; }
.cal-day--selected:hover { background: var(--color-violet-dark) !important; }

.filter-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.filter-input-wrap .filter-input { padding-right: 28px; }

.filter-inline-clear {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--color-grey-mid);
  background: var(--color-grey-light);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: color 0.12s, border-color 0.12s;
}
.filter-inline-clear:hover { color: var(--color-grey-dark); border-color: var(--color-grey-mid); }
.filter-input-wrap .filter-inline-clear { position: absolute; right: 7px; }

.filter-score-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.filter-range {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  background: rgba(26,26,26,0.15);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.filter-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-violet);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.filter-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-violet);
  border: none;
  cursor: pointer;
}
.filter-score-display {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-violet);
  min-width: 28px;
  text-align: right;
}

.filter-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.filter-tag-pill {
  background: var(--color-grey-light);
  border: 1px solid var(--color-border);
  color: var(--color-grey-mid);
  border-radius: 12px;
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  font-family: inherit;
  line-height: 1.4;
}
.filter-tag-pill:hover { border-color: var(--color-violet); color: var(--color-violet); }
.filter-tag-pill.active { background: var(--color-violet); border-color: var(--color-violet); color: #fff; }

.filter-reset-btn {
  margin-top: 20px;
  display: block;
  width: 100%;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-grey-mid);
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 6px 0;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
  text-align: center;
}
.filter-reset-btn:hover { color: var(--color-grey-dark); border-color: var(--color-grey-mid); }

.result-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-grey-mid);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 11px 20px 9px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.result-count:empty { display: none; }

@media (max-width: 700px) {
  .results-layout {
    flex-direction: column;
    height: auto;
  }
  .results-filter-pane {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    position: static;
    padding: 14px 16px;
    height: auto;
    max-height: 340px;
    overflow-y: auto;
  }
  .results-main {
    height: auto;
    max-height: 60vh;
    overflow-y: auto;
    display: block;
  }
}

/* ===== Result list (Relevant Articles tab) ===== */
.result-list { list-style: none; overflow-y: auto; flex: 1; }

.result-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  transition: background 0.15s;
}
.result-item:last-child { border-bottom: none; }
.result-item:hover { background: #FAFAFA; }
.result-discard-btn { opacity: 0; flex-shrink: 0; }
.result-item:hover .result-discard-btn { opacity: 1; }

.result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.result-checkbox {
  flex-shrink: 0;
  margin-top: 3px;
  width: 15px;
  height: 15px;
  accent-color: var(--color-violet);
  cursor: pointer;
}

/* Select-all bar above result list */
.result-select-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 20px;
  font-size: 11px;
  color: var(--color-grey-mid);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
  background: var(--color-grey-light);
}
.result-select-bar button {
  background: none;
  border: none;
  color: var(--color-violet);
  cursor: pointer;
  font-size: 11px;
  padding: 0;
  text-decoration: underline;
}
.result-select-bar button:hover { color: var(--color-violet-dark); }

.result-title-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.result-summary-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-violet);
  text-decoration: none;
  line-height: 1.45;
}
.result-summary-link:hover { text-decoration: underline; }

.result-domain {
  font-size: 11px;
  color: var(--color-grey-mid);
  font-style: italic;
}

/* Auto-search progress */
.auto-search-progress {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 4px;
}

.auto-search-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.auto-search-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-grey-dark);
}

.auto-search-subtitle {
  font-size: 12px;
  color: var(--color-grey-mid);
  margin: 0 0 12px 0;
}

.auto-search-query-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auto-search-query-item {
  font-size: 12px;
  color: var(--color-grey-mid);
  padding: 3px 0 3px 16px;
  position: relative;
}

.auto-search-query-item::before {
  content: '›';
  position: absolute;
  left: 4px;
  color: var(--color-violet);
}

/* AI summary processing banner */
#summary-processing-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 20px;
  font-size: 12px;
  color: var(--color-grey-mid);
  background: rgba(26,26,26,0.03);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

/* Score widget */
.result-score-widget {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.result-score-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-grey-mid);
}

.result-score-bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.result-score-bar {
  width: 52px;
  height: 3px;
  background: rgba(26,26,26,0.1);
  border-radius: 2px;
  overflow: hidden;
}

.result-score-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.result-score-value {
  font-size: 12px;
  font-weight: 700;
  min-width: 28px;
  text-align: right;
}

.result-meta {
  font-size: 11px;
  color: var(--color-grey-mid);
  line-height: 1;
}

.result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.result-tag {
  display: inline-block;
  background: var(--color-grey-light);
  color: var(--color-grey-mid);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ===== Report view ===== */
.report-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}

.report-view-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-grey-dark);
}

.report-content {
  background: var(--color-white);
  border-radius: 10px;
  padding: 28px 32px;
  line-height: 1.75;
  color: var(--color-grey-dark);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.04);
}

/* Markdown rendered content */
.report-content h1 { font-size: 22px; font-weight: 600; margin-bottom: 16px; color: var(--color-violet); }
.report-content h2 { font-size: 17px; font-weight: 600; margin-top: 28px; margin-bottom: 10px; color: var(--color-violet); border-bottom: 1px solid rgba(26,26,26,0.15); padding-bottom: 5px; }
.report-content h3 { font-size: 15px; font-weight: 600; margin-top: 18px; margin-bottom: 7px; color: var(--color-violet); }
.report-content p { margin-bottom: 12px; }
.report-content ul, .report-content ol { padding-left: 22px; margin-bottom: 12px; }
.report-content li { margin-bottom: 5px; }
.report-content a { color: var(--color-blue); }
.report-content a:hover { text-decoration: underline; }
.report-content strong { font-weight: 600; }
.report-content hr { border: none; border-top: 1px solid var(--color-border); margin: 20px 0; }
.report-content code { background: var(--color-grey-light); padding: 1px 4px; border-radius: 3px; font-size: 12px; }
.report-content blockquote { border-left: 3px solid var(--color-violet); padding-left: 14px; color: var(--color-grey-mid); margin: 14px 0; }
.report-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}
.report-content th {
  background: var(--color-violet);
  color: #fff;
  font-weight: 600;
  text-align: left;
  padding: 10px 16px;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.report-content td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
  line-height: 1.5;
}
.report-content tr:last-child td { border-bottom: none; }
.report-content tbody tr:nth-child(even) { background: var(--color-grey-light); }
.report-content tbody tr:hover { background: rgba(26,26,26,0.04); }

/* ===== Modals ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: var(--color-white);
  border-radius: 12px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.14), 0 0 0 1px rgba(0,0,0,0.05);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--color-border);
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-grey-dark);
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--color-grey-mid);
  line-height: 1;
  padding: 2px 5px;
  border-radius: 4px;
  transition: background 0.1s;
}
.modal-close:hover { background: var(--color-grey-light); color: var(--color-grey-dark); }

.form-group {
  padding: 14px 20px 0;
}
.form-group:last-of-type { padding-bottom: 4px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--color-grey-dark);
}

.required { color: var(--color-violet); }
.optional { font-weight: 400; color: var(--color-grey-mid); }
.form-label-optional { font-weight: 400; color: var(--color-grey-mid); }

.schedule-cadence-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.schedule-cadence-prefix,
.schedule-cadence-suffix {
  font-size: 13px;
  color: var(--color-grey-mid);
  white-space: nowrap;
}
.schedule-cadence-input {
  width: 72px;
}
.form-hint {
  font-size: 11px;
  color: var(--color-grey-mid);
  margin: 4px 0 0;
}

.topic-schedule-info {
  display: block;
  font-size: 12px;
  color: var(--color-grey-mid);
  margin-top: 6px;
}

.form-input {
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 8px 10px;
  outline: none;
  color: var(--color-grey-dark);
  transition: border-color 0.1s;
  background: var(--color-white);
}
.form-input:focus { border-color: var(--color-violet); }

.form-textarea {
  resize: vertical;
  min-height: 72px;
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 20px;
}

/* ===== Loading spinner ===== */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}
.spinner-dark {
  border-color: rgba(26,26,26,0.2);
  border-top-color: var(--color-violet);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Toast notifications ===== */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.toast {
  background: rgba(28, 28, 30, 0.92);
  color: var(--color-white);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  animation: slideIn 0.2s ease;
  max-width: 320px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.toast.success { background: rgba(22, 101, 61, 0.92); }
.toast.error   { background: rgba(176, 40, 40, 0.92); }
.toast.info    { background: rgba(52,52,52,0.92); }

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

/* ===== Hidden utility ===== */
.hidden { display: none !important; }

/* ===== Auth screen ===== */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 0;
}

.auth-card {
  background: var(--color-white);
  border-radius: 12px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04);
}

.auth-logo {
  display: block;
  height: 40px;
  width: auto;
  margin: 0 auto 14px;
}

.auth-app-name {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-violet);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 8px 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-grey-mid);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.auth-tab:hover { color: var(--color-violet); }
.auth-tab.active {
  color: var(--color-violet);
  border-bottom-color: var(--color-violet);
}

.auth-form-group {
  margin-bottom: 14px;
}

.auth-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  color: #c0392b;
  margin-bottom: 14px;
}

.auth-submit {
  width: 100%;
  justify-content: center;
  margin-top: 6px;
}

/* ===== Deep Research tab ===== */
.deep-research-list {
  list-style: none;
}

/* Mini / Pro model toggle */
.dr-model-toggle {
  display: flex;
  border: 1px solid var(--color-border);
  border-radius: 30px;
  overflow: hidden;
  width: fit-content;
}
.dr-model-btn {
  padding: 6px 22px;
  border: none;
  background: white;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-grey-dark);
  transition: background 0.15s, color 0.15s;
}
.dr-model-btn.active {
  background: var(--color-violet);
  color: white;
}
.dr-model-btn:not(.active):hover {
  background: var(--color-grey-light);
}

/* PRO badge in deep research list */
.model-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 30px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--color-violet);
  color: white;
  vertical-align: middle;
  margin-left: 6px;
  position: relative;
  top: -1px;
}

.deep-research-instr {
  font-size: 11px;
  color: var(--color-grey-mid);
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Progress panel */
.dr-progress {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--color-border);
}

.dr-progress-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.dr-progress-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-grey-dark);
  flex: 1;
}

.dr-steps-toggle {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 3px 9px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-grey-mid);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.1s, color 0.1s;
}
.dr-steps-toggle:hover {
  background: var(--color-grey-light);
  color: var(--color-grey-dark);
}

.dr-steps-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dr-steps-list.dr-steps-collapsed {
  display: none;
}

.dr-step-item {
  font-size: 12px;
  color: var(--color-grey-mid);
  padding: 3px 0 3px 16px;
  position: relative;
  line-height: 1.45;
  animation: drFadeIn 0.2s ease;
}

.dr-step-item::before {
  content: '›';
  position: absolute;
  left: 4px;
  color: var(--color-violet);
}

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

/* ===== Stories tab ===== */
.tab-experimental {
  font-size: 10px;
  color: var(--color-grey-mid);
  font-weight: 400;
  margin-left: 3px;
}

/* Story select bar */
#story-select-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--color-grey-mid);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
  background: var(--color-grey-light);
}
#story-select-bar button {
  background: none;
  border: none;
  color: var(--color-violet);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  text-decoration: underline;
}
#story-select-bar button:hover { color: var(--color-violet-dark); }

/* Story checkboxes */
.story-checkbox {
  flex-shrink: 0;
  accent-color: var(--color-violet);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.stories-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.story-item {
  border-bottom: 1px solid var(--color-border);
}

.story-item:last-child {
  border-bottom: none;
}

.story-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  cursor: pointer;
  user-select: none;
}

.story-item-header:hover {
  background: var(--color-grey-light);
}
.story-discard-btn { opacity: 0; flex-shrink: 0; }
.story-item-header:hover .story-discard-btn { opacity: 1; }

.story-headline {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-grey-dark);
  flex: 1;
}

.story-meta {
  font-size: 12px;
  color: var(--color-grey-mid);
  white-space: nowrap;
}

.story-expand-icon {
  font-size: 11px;
  color: var(--color-grey-mid);
  transition: transform 0.15s;
}

.story-item.expanded .story-expand-icon {
  transform: rotate(90deg);
}

.story-item-body {
  padding: 0 24px 16px;
  display: none;
}

.story-item.expanded .story-item-body {
  display: block;
}

.story-summary {
  font-size: 13px;
  color: var(--color-grey-dark);
  margin: 0 0 10px;
  line-height: 1.5;
}

.story-entities {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.story-entity-pill {
  background: var(--color-grey-light);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 11px;
  color: var(--color-grey-mid);
}

.story-articles {
  list-style: none;
  padding: 0;
  margin: 0;
}

.story-articles li {
  font-size: 12px;
  color: var(--color-grey-mid);
  padding: 2px 0;
}

.story-articles a {
  color: var(--color-blue);
  text-decoration: none;
}

.story-articles a:hover {
  text-decoration: underline;
}

.story-article-meta {
  display: block;
  font-size: 11px;
  color: var(--color-grey-mid);
  margin-top: 2px;
}

/* ===== Divider label ===== */
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-grey-mid);
}
