/* UI Patch — professional icons, modern motion, achievement popup */

/* Notification bell */
.bell-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(148,163,184,.18);
  color: #dbe7f6;
  text-decoration: none;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.bell-btn:hover {
  text-decoration: none;
  background: rgba(37,99,235,.18);
  border-color: rgba(96,165,250,.28);
  transform: translateY(-1px);
}
.bell-btn.has-unread { animation: bell-pulse 2.1s ease-in-out infinite; }
@keyframes bell-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
  50%      { box-shadow: 0 0 0 6px rgba(37, 99, 235, .16); }
}
.bell-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: linear-gradient(135deg,#ef4444,#f97316);
  color: #fff;
  font-size: .65rem;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
  border: 2px solid #0f172a;
  line-height: 1;
}
.nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  background: linear-gradient(135deg,#2563eb,#06b6d4);
  color: #fff;
  font-size: .64rem;
  font-weight: 800;
  padding: 0 6px;
  border-radius: 999px;
  margin-left: auto;
}
.nav-link-icon {
  width: 18px;
  text-align: center;
  margin-right: .75rem;
  font-size: .94rem;
}
.brand-logo {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(135deg,#2563eb,#06b6d4);
  color: #fff;
  font-weight: 800;
  font-size: .9rem;
  letter-spacing: .08em;
  box-shadow: 0 14px 30px rgba(37,99,235,.28);
}
.brand-sub {
  color: #8da2c1;
  font-size: .73rem;
  letter-spacing: .04em;
  margin-top: 2px;
}
.nav-user .user-tag i,
.btn-logout i { margin-right: .45rem; }
.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}

/* Alerts */
.alert {
  display: flex;
  align-items: center;
  gap: .65rem;
}
.alert i { font-size: 1rem; }

/* Global motion */
.page-wrap {
  animation: page-enter .35s ease-out;
}
.card,
.stat-card,
.followup-banner,
.modal-box,
.table-wrap table tbody tr,
.search-bar,
.section-tabs {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.card:hover,
.stat-card:hover,
.followup-banner:hover,
.search-bar:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(15,23,42,.10);
}
.table-wrap table tbody tr:hover {
  background: rgba(37,99,235,.035);
}
@keyframes page-enter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-title-icon,
.es-icon,
.notif-icon,
.fu-icon,
.detail-icon,
.section-head-icon,
.inline-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.page-title-icon {
  width: 40px;
  height: 40px;
  margin-right: .7rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(37,99,235,.14), rgba(6,182,212,.12));
  border: 1px solid rgba(37,99,235,.14);
  color: var(--primary);
  box-shadow: 0 10px 24px rgba(37,99,235,.12);
}
.page-title-wrap {
  display: flex;
  align-items: center;
  gap: .1rem;
  flex-wrap: wrap;
}
.page-title-wrap h1 { margin: 0; }

.empty-state {
  padding: 2rem 1rem;
  text-align: center;
}
.es-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto .9rem;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(37,99,235,.12), rgba(6,182,212,.10));
  color: var(--primary);
  border: 1px solid rgba(37,99,235,.12);
  font-size: 1.3rem;
}

.form-section-title {
  display: flex;
  align-items: center;
  gap: .65rem;
}
.form-section-title i { color: var(--primary); }

.followup-banner {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  border: 1px solid rgba(239,68,68,.14);
  background: linear-gradient(135deg, rgba(239,68,68,.06), rgba(245,158,11,.04));
  margin-bottom: .9rem;
}
.fu-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  flex-shrink: 0;
  background: rgba(239,68,68,.12);
  color: #dc2626;
  font-size: 1rem;
}
.fu-title { font-weight: 800; color: var(--text); }
.fu-meta { color: var(--muted); font-size: .82rem; }

.notif-item {
  display:flex;
  align-items:flex-start;
  gap:.85rem;
  padding:1rem 1.2rem;
  border-bottom:1px solid var(--border);
}
.notif-item.unread { background: rgba(37,99,235,.05); }
.notif-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
  background: rgba(37,99,235,.08);
  color: var(--primary);
  font-size: .95rem;
}
.notif-icon.success { background: rgba(16,185,129,.10); color: #059669; }
.notif-icon.warn { background: rgba(245,158,11,.11); color: #d97706; }
.notif-icon.info { background: rgba(14,165,233,.10); color: #0284c7; }
.notif-icon.danger { background: rgba(239,68,68,.10); color: #dc2626; }
.notif-dot {
  display:inline-block;
  width:7px;height:7px;border-radius:50%;
  background:var(--accent);
  margin-left:.45rem;
  box-shadow:0 0 10px var(--accent);
}

.metric-card-accent {
  position: relative;
  overflow: hidden;
}
.metric-card-accent::after {
  content: "";
  position: absolute;
  inset: auto -25% -35% auto;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,.16), transparent 65%);
  pointer-events: none;
}

.card-title {
  display:flex;
  align-items:center;
  gap:.55rem;
}
.card-title i { color: var(--primary); }

.creator-tag i,
.conv-user i,
.meta-icon i { margin-right: .38rem; }
.detail-label {
  display:flex;
  align-items:center;
  gap:.45rem;
}
.detail-label i { color: var(--primary); }

.achievement-pop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(6px);
  animation: achievement-fade-in .2s ease-out;
}
.achievement-pop.closing { animation: achievement-fade-out .24s ease-in forwards; }
.achievement-card {
  position: relative;
  width: min(460px, 100%);
  padding: 1.7rem 1.45rem 1.3rem;
  text-align: center;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.98));
  color: var(--text, #0f172a);
  border: 1px solid rgba(226,232,240,.9);
  box-shadow: 0 30px 100px rgba(15, 23, 42, .24);
  overflow: hidden;
  animation: achievement-pop-in .34s cubic-bezier(.18,.89,.32,1.2);
}
.achievement-card::before,
.achievement-card::after {
  content: '';
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  opacity: .35;
  filter: blur(14px);
  pointer-events: none;
}
.achievement-card::before { top: -80px; left: -70px; background: #60a5fa; }
.achievement-card::after { right: -80px; bottom: -90px; background: #22d3ee; }
.achievement-close {
  position: absolute;
  top: .7rem;
  right: .8rem;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: #eef2f7;
  color: #64748b;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.achievement-close:hover { background: #e2e8f0; color: #0f172a; }
.achievement-icon {
  position: relative;
  z-index: 1;
  width: 78px;
  height: 78px;
  margin: 0 auto .8rem;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: #fff;
  font-size: 2rem;
  box-shadow: 0 18px 40px rgba(37,99,235,.30);
}
.achievement-title {
  position: relative;
  z-index: 1;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent, #2563eb);
  margin-bottom: .5rem;
}
.achievement-message {
  position: relative;
  z-index: 1;
  font-size: clamp(1.3rem, 4vw, 1.9rem);
  font-weight: 800;
  line-height: 1.22;
  margin-bottom: .55rem;
}
.achievement-foot {
  position: relative;
  z-index: 1;
  color: #64748b;
  font-size: .92rem;
}
.achievement-progress {
  position: relative;
  z-index: 1;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-top: 1rem;
}
.achievement-progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg,#2563eb,#06b6d4);
  animation: achievement-progress 5.2s linear forwards;
}
@keyframes achievement-progress {
  from { width: 100%; }
  to { width: 0%; }
}
@keyframes achievement-pop-in {
  from { opacity: 0; transform: translateY(18px) scale(.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes achievement-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes achievement-fade-out { to { opacity: 0; } }

/* Strategy / task helpers */
.strategy-highlight {
  border: 2px solid #10b981 !important;
  background: linear-gradient(180deg, rgba(16,185,129,.05) 0%, transparent 100%);
  box-shadow: 0 0 0 1px rgba(16,185,129,.15), 0 16px 28px rgba(16,185,129,.08);
}
.section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #eff6ff;
  color: var(--primary, #1a56db);
  font-size: .78rem;
  font-weight: 700;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  flex-shrink: 0;
}
.section-num.highlighted { background:#10b981; color:#fff; }

@media (max-width: 768px) {
  .bell-btn { width: 36px; height: 36px; }
  body.nav-open .nav-user { flex-wrap: wrap; }
  .page-title-icon { width: 36px; height: 36px; margin-right: .55rem; }
}
@media (max-width: 520px) {
  .achievement-card { padding: 1.3rem 1rem 1.05rem; }
  .achievement-icon { width: 68px; height: 68px; font-size: 1.65rem; }
}

/* Goals + improved client conversation UX */
.modal-wide { width: min(760px, calc(100vw - 2rem)); max-width: 760px; }
.prospect-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}
.next-action-panel {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(37,99,235,.10), rgba(6,182,212,.06));
  border: 1px solid rgba(37,99,235,.16);
  box-shadow: 0 14px 34px rgba(15,23,42,.07);
  margin-bottom: 1rem;
}
.next-action-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  box-shadow: 0 12px 28px rgba(37,99,235,.22);
}
.next-action-body { flex: 1; min-width: 0; }
.next-action-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  color: var(--primary);
  font-weight: 800;
}
.next-action-text { font-weight: 800; color: var(--text); margin-top: .12rem; }
.next-action-meta { color: var(--muted); font-size: .82rem; margin-top: .15rem; }

.goal-board-card { overflow: hidden; }
.goal-list { display: flex; flex-direction: column; }
.goal-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.05rem 1.2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.45);
}
.goal-row:hover { background: rgba(37,99,235,.035); }
.goal-row:last-child { border-bottom: 0; }
.goal-row.is-overdue { background: rgba(239,68,68,.045); }
.goal-main { min-width: 0; flex: 1; }
.goal-kicker { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .45rem; }
.goal-title {
  display: inline-block;
  color: var(--text);
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: -.02em;
  margin-bottom: .3rem;
}
.goal-next,
.goal-todo {
  color: var(--text-soft, #475569);
  font-size: .88rem;
  margin-top: .25rem;
}
.goal-todo {
  padding: .55rem .7rem;
  background: rgba(15,23,42,.035);
  border: 1px solid rgba(148,163,184,.16);
  border-radius: 12px;
}
.goal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem .9rem;
  margin-top: .65rem;
  color: var(--muted);
  font-size: .78rem;
}
.goal-meta i { margin-right: .28rem; }
.goal-actions { display: flex; gap: .45rem; flex-wrap: wrap; justify-content: flex-end; }
.goal-detail-readonly h2 { margin: .45rem 0 .75rem; line-height: 1.25; }
.mini-goal-list { display: flex; flex-direction: column; gap: .55rem; }
.mini-goal-item {
  display: flex;
  flex-direction: column;
  gap: .18rem;
  padding: .75rem .8rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.62);
  color: var(--text);
}
.mini-goal-item:hover { background: rgba(37,99,235,.055); }
.mini-goal-item span { font-weight: 750; }
.mini-goal-item small { color: var(--muted); }

.conv-timeline { position: relative; }
.conv-enhanced {
  position: relative;
  border-left: 3px solid rgba(37,99,235,.30);
}
.conv-badges { display: flex; flex-wrap: wrap; gap: .35rem; margin: .55rem 0; }
.client-response {
  background: rgba(16,185,129,.045);
  border-color: rgba(16,185,129,.16) !important;
}
.internal-note {
  background: rgba(245,158,11,.045);
  border-color: rgba(245,158,11,.18) !important;
}
.conv-next-step {
  display: flex;
  align-items: flex-start;
  gap: .45rem;
  margin-top: .7rem;
  padding: .7rem .8rem;
  border-radius: 13px;
  border: 1px solid rgba(37,99,235,.16);
  background: rgba(37,99,235,.055);
  color: var(--text);
  font-size: .88rem;
}
.conv-next-step i { color: var(--primary); margin-top: .12rem; }
.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--muted);
  font-size: .86rem;
  cursor: pointer;
}
.checkbox-line input { width: auto; }

@media (max-width: 980px) {
  .prospect-layout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .goal-row,
  .next-action-panel { flex-direction: column; align-items: stretch; }
  .goal-actions { justify-content: flex-start; }
  .modal-wide { width: calc(100vw - 1rem); }
}

/* Prospect sales message generator */
.sales-message-card { margin-bottom: 1rem; }
.sales-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.research-strip,
.research-preview,
.sales-rules-box {
  border: 1px solid rgba(37,99,235,.14);
  background: rgba(37,99,235,.045);
  border-radius: 14px;
  padding: .8rem .9rem;
  color: var(--text);
  font-size: .88rem;
}
.research-strip {
  display: flex;
  gap: .65rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.research-strip i { color: var(--primary); margin-top: .12rem; }
.research-preview {
  display: grid;
  gap: .35rem;
  background: rgba(15,23,42,.025);
  border-color: rgba(148,163,184,.22);
}
.sales-rules-box {
  background: rgba(16,185,129,.055);
  border-color: rgba(16,185,129,.18);
}
.sales-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: .85rem;
}
.sales-template-item {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,.66);
  padding: .95rem;
  box-shadow: 0 12px 26px rgba(15,23,42,.045);
}
.sales-template-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: .65rem;
}
.sales-template-type {
  font-weight: 850;
  color: var(--text);
  letter-spacing: -.02em;
}
.sales-template-meta {
  color: var(--muted);
  font-size: .78rem;
  margin-top: .12rem;
}
.sales-focus {
  border-left: 3px solid rgba(37,99,235,.35);
  background: rgba(37,99,235,.04);
  border-radius: 10px;
  padding: .5rem .65rem;
  font-size: .82rem;
  color: var(--text-soft, #475569);
  margin-bottom: .6rem;
}
.sales-message-text {
  width: 100%;
  min-height: 185px;
  resize: vertical;
  border: 1px solid rgba(148,163,184,.25);
  border-radius: 14px;
  padding: .75rem;
  background: rgba(248,250,252,.82);
  color: var(--text);
  font-size: .88rem;
  line-height: 1.55;
  white-space: pre-wrap;
}
.compact-empty { padding: 1.2rem; }
.copy-done {
  border-color: rgba(16,185,129,.35) !important;
  color: #047857 !important;
}
@media (max-width: 720px) {
  .sales-template-grid { grid-template-columns: 1fr; }
  .sales-template-top { flex-direction: column; }
}

/* Sales template delete controls */
.sales-head-actions,
.sales-template-actions {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.inline-delete-form { margin: 0; }
.sales-head-actions form,
.sales-template-actions form { margin: 0; }
@media (max-width: 720px) {
  .sales-head-actions,
  .sales-template-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Overflow hardening for prospect sales messages + mobile cards */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.app-shell,
.page-wrap,
.card,
.modal-box,
.prospect-layout,
.sales-message-card,
.sales-template-grid,
.sales-template-item,
.sales-template-top,
.sales-head,
.research-strip,
.research-preview,
.sales-rules-box,
.conv-item,
.conv-message,
.goal-row,
.next-action-panel {
  min-width: 0;
}

.page-wrap {
  overflow-x: clip;
}

.card,
.modal-box,
.sales-template-item,
.conv-item,
.research-strip,
.research-preview,
.sales-rules-box,
.next-action-text,
.next-action-meta,
.goal-title,
.goal-next,
.goal-todo,
.detail-value,
.conv-message p,
.sales-focus,
.sales-template-meta,
.form-hint {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sales-message-card {
  overflow: hidden;
}

.sales-template-grid {
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.sales-template-item {
  max-width: 100%;
  overflow: hidden;
}

.sales-template-top > div:first-child,
.sales-head > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}

.sales-template-actions,
.sales-head-actions {
  min-width: 0;
  flex: 0 1 auto;
}

.sales-template-actions .btn,
.sales-head-actions .btn,
.goal-actions .btn,
.table-actions .btn {
  max-width: 100%;
}

.sales-message-text {
  display: block;
  max-width: 100%;
  overflow-x: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.research-preview a,
.research-strip a {
  overflow-wrap: anywhere;
  word-break: break-all;
}

.modal-wide {
  max-width: min(760px, calc(100vw - 2rem));
  overflow-x: hidden;
}

.modal-wide .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 720px) {
  .sales-head,
  .sales-template-top,
  .next-action-panel,
  .goal-row {
    align-items: stretch;
  }

  .sales-head-actions,
  .sales-template-actions,
  .goal-actions,
  .table-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .sales-head-actions form,
  .sales-template-actions form,
  .sales-head-actions .btn,
  .sales-template-actions .btn,
  .goal-actions .btn,
  .table-actions .btn {
    width: 100%;
  }

  .sales-template-actions .btn,
  .sales-head-actions .btn {
    padding-left: .55rem;
    padding-right: .55rem;
  }

  .modal-wide .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .page-wrap { padding-inline: .75rem; }
  .sales-head-actions,
  .sales-template-actions,
  .goal-actions,
  .table-actions {
    grid-template-columns: 1fr;
  }
  .btn { white-space: normal; text-align: center; }
  .modal-overlay { padding: .5rem; }
  .modal-wide { max-width: calc(100vw - 1rem); }
  .sales-message-text { min-height: 160px; }
}

/* Sales generator personalization controls */
.check-row {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  font-size: .92rem;
  color: var(--text, #0f172a);
  cursor: pointer;
  max-width: 100%;
}
.check-row input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin-top: .12rem;
  flex: 0 0 auto;
}
.check-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* API settings admin page */
.settings-grid{
  display:grid;
  grid-template-columns:minmax(0,1.45fr) minmax(280px,.75fr);
  gap:1rem;
  align-items:start;
}
.api-settings-card,.api-help-card{overflow:hidden;max-width:100%;}
.card-head{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start;margin-bottom:1rem;}
.card-head h2{margin:0;font-size:1.15rem;display:flex;gap:.5rem;align-items:center;}
.card-head p{margin:.35rem 0 0;color:var(--muted);font-size:.9rem;}
.ai-status-pill{display:inline-flex;align-items:center;border-radius:999px;padding:.38rem .75rem;font-size:.78rem;font-weight:800;white-space:nowrap;}
.ai-status-pill.ok{background:rgba(16,185,129,.12);color:#047857;border:1px solid rgba(16,185,129,.25);}
.ai-status-pill.warn{background:rgba(245,158,11,.12);color:#92400e;border:1px solid rgba(245,158,11,.25);}
.api-settings-form{display:flex;flex-direction:column;gap:1rem;}
.form-row.two-col{display:grid;grid-template-columns:1fr 1fr;gap:1rem;}
.api-settings-form input[type="password"],.api-settings-form input[type="text"]{max-width:100%;}
.api-settings-form small{display:block;margin-top:.35rem;color:var(--muted);line-height:1.45;word-break:break-word;}
.toggle-line{display:flex;align-items:center;gap:.65rem;padding:.85rem 1rem;border:1px solid var(--border);border-radius:14px;background:rgba(15,23,42,.03);font-weight:700;}
.toggle-line input{width:18px;height:18px;accent-color:var(--primary);}
.api-actions{display:flex;gap:.75rem;flex-wrap:wrap;align-items:center;}
.danger-zone{margin-top:1rem;padding-top:1rem;border-top:1px dashed var(--border);}
.clean-list{margin:.75rem 0 0;padding-left:1.1rem;color:var(--text);line-height:1.7;}
.mini-note{margin-top:1rem;padding:1rem;border-radius:14px;background:rgba(2,29,142,.06);border:1px solid rgba(2,29,142,.12);font-size:.9rem;line-height:1.55;}
@media (max-width: 900px){
  .settings-grid{grid-template-columns:1fr;}
  .form-row.two-col{grid-template-columns:1fr;}
  .card-head{flex-direction:column;}
}

/* Multi AI Provider settings */
.ai-provider-settings-grid{
  align-items:start;
}
.ai-provider-card{
  min-width:0;
}
.ai-provider-card .card-head{
  gap:1rem;
}
.ai-provider-card h2{
  display:flex;
  align-items:center;
  gap:.55rem;
  flex-wrap:wrap;
}
.ai-provider-btn{
  max-width:100%;
  white-space:normal;
  text-align:center;
}
.ai-provider-gemini{ }
.ai-provider-openai{ }
.ai-provider-groq{ }
@media (max-width:640px){
  .generator-action-row .btn,
  .generator-action-row a.btn{
    width:100%;
    justify-content:center;
  }
  .ai-provider-card .card-head{
    flex-direction:column;
    align-items:flex-start;
  }
}

/* Daily Log module */
.nav-count.nav-alert {
  background: linear-gradient(135deg,#f97316,#ef4444);
}
.daily-log-board { overflow: hidden; }
.daily-log-list {
  display: flex;
  flex-direction: column;
}
.daily-log-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.daily-log-row:hover { background: rgba(37,99,235,.035); }
.daily-log-row:last-child { border-bottom: 0; }
.daily-log-main {
  min-width: 0;
  flex: 1;
}
.daily-log-kicker,
.daily-chip-row,
.daily-metrics {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem;
}
.daily-log-kicker {
  margin-bottom: .5rem;
  color: var(--muted);
  font-size: .8rem;
}
.daily-log-title {
  display: block;
  color: var(--text);
  font-weight: 800;
  line-height: 1.35;
  text-decoration: none;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.daily-log-title:hover { color: var(--primary); text-decoration: none; }
.daily-metrics {
  margin-top: .65rem;
}
.daily-metrics span {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .32rem .55rem;
  border: 1px solid rgba(148,163,184,.22);
  background: rgba(248,250,252,.75);
  color: var(--text-soft);
  border-radius: 999px;
  font-size: .76rem;
}
.daily-metrics strong { color: var(--text); }
.daily-blocker,
.daily-next {
  margin-top: .6rem;
  padding: .7rem .8rem;
  border-radius: 14px;
  background: rgba(248,250,252,.78);
  border: 1px solid rgba(148,163,184,.18);
  color: var(--text-soft);
  font-size: .84rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.daily-blocker {
  background: rgba(245,158,11,.08);
  border-color: rgba(245,158,11,.16);
}
.daily-log-actions {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex-shrink: 0;
}
.daily-input-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .8rem;
}
.daily-missing-card { margin-bottom: 1rem; }
.daily-user-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .42rem .65rem;
  border-radius: 999px;
  background: rgba(239,68,68,.07);
  border: 1px solid rgba(239,68,68,.14);
  color: var(--text-soft);
  font-size: .82rem;
  font-weight: 650;
}
.daily-log-required { border-color: rgba(245,158,11,.22); }
.daily-detail-readonly h2 { margin: .45rem 0 .75rem; }
.daily-detail-readonly p {
  color: var(--text-soft);
  line-height: 1.65;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 900px) {
  .daily-input-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .daily-log-row { flex-direction: column; align-items: stretch; }
  .daily-log-actions { justify-content: flex-start; }
}
@media (max-width: 560px) {
  .daily-input-grid { grid-template-columns: 1fr; }
  .daily-log-row { padding: .9rem; }
  .daily-metrics span { width: 100%; justify-content: space-between; }
  .daily-log-actions .btn { flex: 1 1 100%; justify-content: center; }
}
