/* ── Base ── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 19.5px; scroll-padding-top: 4rem; }
body {
  font-family: 'Figtree', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.5;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Login is on /v2/login.html — app redirects there if unauthenticated */

/* ── App Shell ── */
#app { display: none; }
#app.ready { display: block; }

.app-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  height: 3.7rem;
  padding: 0 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.header-brand {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.5px;
  width: 10rem;
  flex-shrink: 0;
  white-space: nowrap;
  display: flex;
  align-items: center;
  align-self: stretch;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s;
}
.header-brand.welcome-active {
  border-color: var(--accent);
}
.header-tabs {
  flex: 1;
  display: flex;
  justify-content: center;
  overflow-x: auto;
  overflow-y: hidden;
  align-self: stretch;
  scrollbar-width: none;
}
.header-tabs::-webkit-scrollbar { display: none; }
.header-tabs .tb-bar {
  height: 100%;
}
.header-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
  width: 9rem;
  justify-content: flex-end;
}
.header-actions button {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}
.header-actions button:hover {
  color: var(--accent);
}
.hdr-icon {
  width: 1.05rem;
  height: 1.05rem;
  background: currentColor;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* ── Main Content ── */
.app-main {
  padding: 12px 20px 20px;
  padding-top: calc(3.7rem + 12px); /* clear fixed header */
}

/* ── Stream Sections ── */
.stream-section {
  max-width: 42rem;
  margin: 0 auto;
  padding-bottom: 3rem;
}

/* ── Section Dividers ── */
.section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 6rem;
  opacity: 0.1;
}
.section-divider img {
  width: 64px;
  height: 64px;
  filter: grayscale(1);
}
/* Remove section bottom padding when followed by a divider */
.stream-section:has(+ .section-divider),
.stream-section:has(+ .gate-card) {
  padding-bottom: 0;
}

/* ── Cards ── */
.g-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 16px;
  position: relative;
}
.g-card.accent-card {
  border-left: 3px solid var(--accent);
}

/* ── Card Chat Button ── */
.card-actions {
  position: absolute;
  top: -10px;
  right: 8px;
  display: flex;
  gap: 4px;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.2s;
}
.g-card:hover .card-actions { opacity: 1; }
.card-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.card-action-btn:hover { background: var(--accent); }
.card-action-btn .ca-icon {
  width: 15px;
  height: 15px;
  background: var(--text-dim);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}
.card-action-btn:hover .ca-icon { background: #fff; }

/* ── AI Response Card (inserted after source card) ── */
.ai-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 16px;
  font-size: 0.88rem;
  line-height: 1.6;
  position: relative;
}
.ai-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.75rem;
  color: var(--text-dim);
}
.ai-card-header .ai-icon {
  width: 18px;
  height: 18px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ai-card-header .ai-icon span {
  width: 11px;
  height: 11px;
  background: #fff;
  -webkit-mask-image: url(/assets/chat.svg);
  mask-image: url(/assets/chat.svg);
  -webkit-mask-size: contain;
  mask-size: contain;
  display: block;
}
.ai-card-dismiss {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 2px 4px;
}
.ai-card-dismiss:hover { color: var(--text); }
.ai-card-question {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text);
}
.ai-card-user-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background: var(--text-dim);
  -webkit-mask-image: url(/assets/profile.svg);
  mask-image: url(/assets/profile.svg);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  margin-top: 1px;
}
.ai-card-body p { margin: 0 0 8px; }
.ai-card-body p:last-child { margin-bottom: 0; }
.ai-card-body ul, .ai-card-body ol { margin: 0 0 8px; padding-left: 1.5em; }
.ai-card-body li { margin-bottom: 4px; }
.ai-card-body code { background: rgba(128,128,128,0.15); padding: 1px 5px; border-radius: 3px; font-size: 0.85em; }
.ai-card-body pre { background: var(--bg); padding: 10px 12px; border-radius: 6px; overflow-x: auto; margin: 8px 0; }
.ai-card-body pre code { background: none; padding: 0; }

/* Collapsed chat buttons (bottom edge of source card) */
.collapsed-chats {
  position: absolute;
  bottom: -14px;
  right: 12px;
  display: flex;
  gap: 6px;
  z-index: 3;
}
.collapsed-chat-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: var(--panel);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.collapsed-chat-btn:hover { background: var(--accent); }
.collapsed-chat-btn .ca-icon {
  width: 14px;
  height: 14px;
  background: var(--accent);
}
.collapsed-chat-btn:hover .ca-icon { background: #fff; }

/* AI thinking indicator */
.ai-thinking {
  color: var(--text-dim);
  font-size: 0.85rem;
  animation: aiPulse 1.5s ease-in-out infinite;
}
@keyframes aiPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* ── Section Gates ── */
.stream-section.locked { display: none; }
.gate-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 18px 24px;
  margin-bottom: 16px;
  display: none;
  align-items: center;
  gap: 12px;
  color: var(--text-dim);
  font-size: 0.88rem;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  margin-top: -1rem;
}
.gate-card.active { display: flex; }
.gate-card .gate-icon {
  width: 22px;
  height: 22px;
  background: var(--accent);
  -webkit-mask-image: url(/assets/shield-check.svg);
  mask-image: url(/assets/shield-check.svg);
  -webkit-mask-size: contain;
  mask-size: contain;
  flex-shrink: 0;
}
.gate-card.cleared { display: none; }
.g-card h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.g-card h2::before {
  content: '';
  width: 10px;
  height: 10px;
  background: var(--accent);
  flex-shrink: 0;
}
.g-card .card-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 18px;
  line-height: 1.5;
}
.g-card .card-desc:last-child {
  margin-bottom: 0;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.field-row:last-child { margin-bottom: 0; }
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}
.field:last-child { margin-bottom: 0; }
.field label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ai-help-link {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  white-space: nowrap;
  padding: 1px 8px;
  border: 1px solid var(--accent);
  border-radius: 9999px;
  margin-left: 6px;
  vertical-align: middle;
  line-height: 1.6;
}
.required { color: var(--red, #e55); font-weight: 400; margin-right: auto; }
.field:focus-within .ai-help-link { opacity: 1; }
.ai-help-link:hover { background: var(--accent); color: #fff; text-decoration: none; }
.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(80, 200, 120, 0.12);
}
.field textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}
.field input[readonly],
.field textarea[readonly] {
  border-color: transparent;
  cursor: default;
  resize: none;
}
.field input[readonly]:focus,
.field textarea[readonly]:focus {
  border-color: transparent;
  box-shadow: none;
}
#sec-company .field textarea {
  min-height: 180px;
}

/* ── Buttons ── */
.g-btn {
  padding: 7px 16px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.g-btn:hover { border-color: var(--accent); color: var(--accent); }
.g-btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.g-btn.primary:hover { opacity: 0.85; }
.g-btn.small { padding: 5px 12px; font-size: 0.8rem; }
.g-btn.danger { color: var(--red, #e55); border-color: var(--red, #e55); }
.g-btn.danger:hover { background: var(--red, #e55); color: #fff; }

/* ── Section header cards ── */
.section-card h2 {
  font-size: 2.25rem;
  gap: 14px;
}
.section-card h2::before { display: none; }
.section-card .card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: var(--accent);
  border-radius: 6px;
  flex-shrink: 0;
}
.section-card .card-icon img {
  width: 30px;
  height: 30px;
  filter: brightness(0) invert(1);
}
.section-card .card-desc {
  margin-top: 4px;
  margin-bottom: 0;
}

/* ── Skill pills ── */
.skill-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-size: 0.8rem;
  color: var(--text);
  background: var(--bg);
  white-space: nowrap;
}
.skill-pill.cert {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
}
.skill-pill .skill-x {
  cursor: pointer;
  opacity: 0.4;
  font-size: 0.9rem;
  line-height: 1;
  transition: opacity 0.15s;
}
.skill-pill .skill-x:hover { opacity: 1; color: var(--red, #e55); }

/* ── Opening cards ── */
.opening-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 6px solid var(--accent);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.15s;
}
.opening-card:hover { border-color: var(--accent); box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.opening-card.expanded { border-color: var(--accent); }
.opening-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.opening-info { flex: 1; min-width: 0; }
.opening-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.opening-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 2px;
}
.opening-detail {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(128,128,128,0.1);
  animation: panelIn 0.2s ease both;
}
/* Normalize all buttons/selects in dynamic cards to same height */
.opening-card .g-btn,
.opening-card select,
.candidate-card .g-btn,
.pipeline-card .g-btn,
.pipeline-card select {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* ── Status badges ── */
.status-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
  flex-shrink: 0;
  white-space: nowrap;
}
.status-badge.draft     { background: rgba(128,128,128,0.15); color: var(--text-dim); }
.status-badge.open      { background: rgba(22,163,74,0.15); color: var(--green, #16a34a); }
.status-badge.paused    { background: rgba(202,138,4,0.15); color: var(--yellow, #ca8a04); }
.status-badge.fulfilled { background: rgba(80,200,120,0.15); color: var(--accent); }
.status-badge.withdrawn { background: rgba(238,85,85,0.15); color: var(--red, #e55); }

/* ── Stage badges ── */
.stage-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
  flex-shrink: 0;
  white-space: nowrap;
}
.stage-badge.matched     { background: rgba(128,128,128,0.15); color: var(--text-dim); }
.stage-badge.contacted   { background: rgba(59,130,246,0.15); color: #3b82f6; }
.stage-badge.interviewing { background: rgba(202,138,4,0.15); color: var(--yellow, #ca8a04); }
.stage-badge.offered     { background: rgba(80,200,120,0.15); color: var(--accent); }
.stage-badge.hired       { background: rgba(22,163,74,0.15); color: var(--green, #16a34a); }
.stage-badge.rejected    { background: rgba(238,85,85,0.15); color: var(--red, #e55); }

/* ── Candidate cards ── */
.candidate-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 6px solid var(--accent);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 10px;
}
.candidate-score {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.candidate-score.high { background: rgba(22,163,74,0.15); color: var(--green, #16a34a); }
.candidate-score.mid  { background: rgba(80,200,120,0.15); color: var(--accent, #50C878); }
.candidate-score.low  { background: rgba(238,85,85,0.15); color: var(--red, #e55); }
.candidate-score.none { background: rgba(128,128,128,0.1); color: var(--text-dim); }
.candidate-score.est  { background: none; border: 2px dashed; font-size: 0.75rem; box-sizing: border-box; }
.candidate-score.est.high { border-color: var(--green, #16a34a); color: var(--green, #16a34a); }
.candidate-score.est.mid  { border-color: var(--accent, #50C878); color: var(--accent, #50C878); }
.candidate-score.est.low  { border-color: var(--red, #e55); color: var(--red, #e55); }
.candidate-score.est.none { border-color: var(--text-dim); color: var(--text-dim); }
.cand-bookmark {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-dim);
  opacity: 0.4;
  padding: 2px;
  transition: color 0.2s, opacity 0.2s;
  flex-shrink: 0;
}
.cand-bookmark:hover, .cand-bookmark.active { color: var(--accent); opacity: 1; }
.cand-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  background: rgba(128,128,128,0.08);
  border-radius: 4px;
  font-size: 0.78rem;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  text-transform: capitalize;
}
.cand-tag-key {
  color: var(--text-dim);
  font-weight: 400;
  text-transform: none;
}
.cand-summary {
  font-size: 0.83rem;
  color: var(--text-dim);
  line-height: 1.6;
}
.cand-summary h2 { font-size: 1em; font-weight: 600; color: var(--text); margin: 0.8em 0 0.3em; }
.cand-summary h3 { font-size: 0.95em; font-weight: 600; color: var(--text); margin: 0.6em 0 0.2em; }
.cand-summary p { margin: 0.4em 0; }
.cand-summary strong { color: var(--text); }
.cand-summary ul, .cand-summary ol { padding-left: 1.5em; margin: 0.3em 0; }
.cand-summary li { margin: 2px 0; }
.cand-tag.accent {
  background: rgba(80,200,120,0.1);
}
.cand-tag.accent .cand-tag-key {
  color: var(--accent);
}

/* ── Pipeline cards ── */
.pipeline-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 6px solid var(--accent);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 10px;
}
.pipeline-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pipeline-info { flex: 1; min-width: 0; }
.pipeline-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.pipeline-opening {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 2px;
}
.pipeline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

/* ── Deep search ── */
#sec-deep-search h2::before { display: none; }
#sec-deep-search h2 { font-size: 2.25rem; }

/* ── Collapsible section ── */
.collapsible-header {
  cursor: pointer;
  user-select: none;
}
.collapsible-body {
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.collapsible-body.collapsed {
  max-height: 0;
  overflow: hidden;
}

/* ── Card input bar (inserted after focused card) ── */
#card-input-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 16px;
  margin-bottom: 16px;
  background: var(--accent);
  border: none;
  border-radius: 10px;
}
#card-input-bar textarea {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  resize: none;
  outline: none;
  max-height: 80px;
}
#card-input-bar textarea::placeholder { color: var(--text-dim); }
#card-input-bar textarea:focus { background: var(--panel); }
#card-input-bar button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
#card-input-bar button:hover { opacity: 0.85; }

/* Card glow when focused for chat */
.g-card.card-focused {
  box-shadow: 0 0 0 2px var(--accent), 0 0 16px rgba(var(--accent-rgb, 232,145,58), 0.2);
  transition: box-shadow 0.25s;
}

/* ── Saved indicator ── */
.save-flash {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  color: var(--green, #16a34a);
  opacity: 0;
  animation: flashIn 1.5s ease;
  pointer-events: none;
}
@keyframes flashIn {
  0%   { opacity: 0; }
  15%  { opacity: 1; }
  70%  { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes panelIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes advPulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

/* ── Theme overrides ── */
[data-theme="artistry"] .g-card,
[data-theme="industry"] .g-card { border-radius: 0; }
[data-theme="artistry"] .field input,
[data-theme="artistry"] .field textarea,
[data-theme="artistry"] .field select,
[data-theme="industry"] .field input,
[data-theme="industry"] .field textarea,
[data-theme="industry"] .field select { border-radius: 0; }
[data-theme="artistry"] #ask-input,
[data-theme="artistry"] #ask-send,
[data-theme="industry"] #ask-input,
[data-theme="industry"] #ask-send { border-radius: 0; }
[data-theme="artistry"] .header-actions button,
[data-theme="industry"] .header-actions button { border-radius: 0; }
[data-theme="artistry"] .g-btn,
[data-theme="industry"] .g-btn { border-radius: 0; }
[data-theme="artistry"] .opening-card,
[data-theme="industry"] .opening-card { border-radius: 0; }
[data-theme="artistry"] .candidate-card,
[data-theme="industry"] .candidate-card { border-radius: 0; }
[data-theme="artistry"] .pipeline-card,
[data-theme="industry"] .pipeline-card { border-radius: 0; }
[data-theme="artistry"] .status-badge,
[data-theme="industry"] .status-badge { border-radius: 0; }
[data-theme="artistry"] .stage-badge,
[data-theme="industry"] .stage-badge { border-radius: 0; }
[data-theme="artistry"] .candidate-score,
[data-theme="industry"] .candidate-score { border-radius: 0; }
[data-theme="artistry"] .skill-pill,
[data-theme="industry"] .skill-pill { border-radius: 0; }

/* ── Custom modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 3000;
  display: flex; align-items: center; justify-content: center;
}
.modal-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
  min-width: 340px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.5;
}
.modal-box p { margin: 0 0 1rem; }
.modal-box input[type="text"] {
  width: 100%; box-sizing: border-box;
  padding: 6px 8px; margin-bottom: 1rem;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 4px;
  font-size: 0.85rem;
}
.modal-actions {
  display: flex; justify-content: flex-end; gap: 8px;
}
.modal-actions button {
  padding: 6px 16px; border-radius: 4px;
  font-size: 0.8rem; cursor: pointer; border: 1px solid var(--border);
  background: var(--panel); color: var(--text);
}
.modal-actions button.primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.modal-actions button:hover { filter: brightness(1.15); }

/* ── Account dropdown ── */
.account-menu-wrap { position: relative; }
.account-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.45);
  min-width: 200px;
  z-index: 2500;
  padding: 6px 0;
  font-size: 0.8rem;
}
.account-menu.open { display: block; }
.account-menu-info {
  padding: 8px 14px;
  color: var(--text-dim);
  font-size: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.account-menu-info div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu-item {
  display: block; width: 100%; box-sizing: border-box;
  padding: 8px 14px;
  background: none; border: none;
  color: var(--text); font-size: 0.8rem;
  text-align: left; cursor: pointer;
}
.account-menu-item:hover { background: var(--accent); color: #fff; }
.account-menu-item.danger { color: var(--red); }
.account-menu-item.danger:hover { background: var(--red); color: #fff; }

/* ── Responsive ── */
@media (max-width: 600px) {
  html, body { font-size: 16px; overflow-x: hidden; overscroll-behavior-x: none; width: 100%; }
  #app { overflow-x: hidden; width: 100%; }
  .app-topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 4px 8px 0;
    width: 100%;
    box-sizing: border-box;
  }
  .header-brand { font-size: 1rem; width: auto; flex: 1; min-width: 0; }
  .header-actions { width: auto; flex-shrink: 1; gap: 4px; }
  .header-actions a { font-size: 0.75rem !important; }
  .header-tabs {
    order: 3;
    flex: 0 0 100%;
    overflow-x: auto;
  }
  .tb-btn { padding: 8px 10px 10px !important; font-size: 0 !important; }
  .tb-btn .tb-icon { width: 1.3rem; height: 1.3rem; }
  .field-row { grid-template-columns: 1fr; }
  .app-main { padding: 0; }
  .g-card { padding: 12px; border-radius: 0; margin-bottom: 6px; }
  .stream-section { padding: 4px 0; }
  .modal-box { min-width: auto; max-width: 95vw; }
  .opening-header { flex-wrap: wrap; }
  .candidate-card { padding: 10px; }
  .cand-tag { font-size: 0.7rem; }
}
