/* Marian GPT — layout 3 coloane */

:root {
  --gpt-green: #0b6e4f;
  --gpt-green-dark: #085a40;
  --gpt-bg: #e8f0ec;
  --gpt-thread: #f4f7f5;
  --gpt-text: #122017;
  --gpt-muted: #5c6b63;
  --gpt-danger: #c0392b;
  --gpt-panel: #ffffff;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  height: 100dvh;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--gpt-text);
  background: var(--gpt-bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.gpt-login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  min-height: 100dvh;
  padding: 24px;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  background: linear-gradient(160deg, #cfe8dc 0%, #e8f0ec 50%, #f5f7fa 100%);
  box-sizing: border-box;
}

.gpt-login-box {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: 0 8px 32px rgba(11, 110, 79, 0.12);
}

.gpt-login-box h1 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.gpt-muted {
  color: var(--gpt-muted);
  margin: 0 0 18px;
  font-size: 0.95rem;
}

.gpt-alert {
  background: #fde8ec;
  color: var(--gpt-danger);
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 0.9rem;
}

.gpt-login-box label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: var(--gpt-muted);
}

.gpt-login-box input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ccd0d5;
  border-radius: 10px;
  font-size: 16px; /* iOS: fără zoom la focus */
  margin-bottom: 14px;
  box-sizing: border-box;
}

.gpt-btn {
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 1rem;
  cursor: pointer;
  font-weight: 600;
}

.gpt-btn-primary {
  width: 100%;
  background: var(--gpt-green);
  color: #fff;
}

.gpt-btn-primary:hover {
  background: var(--gpt-green-dark);
}

/* App shell */
.gpt-app {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 300px;
  height: 100%;
  height: 100dvh;
  max-width: 1400px;
  margin: 0 auto;
  background: var(--gpt-thread);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  overflow: hidden;
}

.gpt-back-list {
  display: none;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: 1px solid #d0d5d2;
  border-radius: 10px;
  background: #fff;
  color: var(--gpt-text);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.gpt-back-list:active {
  background: #e8f0ec;
}

.gpt-header-text {
  min-width: 0;
  flex: 1;
}

.gpt-sidebar {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  min-height: 0;
}

.gpt-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.gpt-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.gpt-mode-btn {
  border: 1px solid #c5d5cc;
  background: #f7faf8;
  color: var(--gpt-muted, #5a6b63);
  border-radius: 8px;
  padding: 7px 4px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.gpt-mode-btn:hover {
  background: #eef5f1;
  color: var(--gpt-text, #1a3d32);
}

.gpt-mode-btn.is-active {
  background: var(--gpt-green, #0b6e4f);
  border-color: var(--gpt-green, #0b6e4f);
  color: #fff;
}

.gpt-mode-btn[data-mode="auto"].is-active {
  background: #0a5a8a;
  border-color: #0a5a8a;
}

.gpt-mode-btn[data-mode="manual"].is-active {
  background: #b7791f;
  border-color: #b7791f;
}

.gpt-idle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.78rem;
  color: var(--gpt-muted, #5a6b63);
}

.gpt-idle-row label {
  font-weight: 600;
  color: var(--gpt-text, #1a3d32);
}

.gpt-idle-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.gpt-idle-row input[type="number"] {
  width: 4.2rem;
  border: 1px solid #c5d5cc;
  border-radius: 8px;
  padding: 5px 6px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  background: #fff;
  color: var(--gpt-text, #1a3d32);
}

.gpt-idle-unit {
  font-size: 0.72rem;
  font-weight: 600;
}

.gpt-scope-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 10px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.gpt-day-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 14px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.78rem;
  color: var(--gpt-muted);
  background: linear-gradient(180deg, #f3faf6 0%, #fff 100%);
}

.gpt-day-stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.gpt-day-stats strong {
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  color: var(--gpt-green);
  line-height: 1;
}

.gpt-day-stat-wrote strong {
  color: #0a5c8a;
}

.gpt-day-stats-suffix {
  margin-left: auto;
  font-size: 0.72rem;
  opacity: 0.8;
}

.gpt-queue-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.78rem;
  color: var(--gpt-muted);
  background: #fff;
}

.gpt-queue-stats strong {
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  color: #b45309;
  line-height: 1;
}

.gpt-queue-stats.is-empty strong {
  color: var(--gpt-green);
}

.gpt-queue-detail {
  flex: 1 1 100%;
  font-size: 0.7rem;
  opacity: 0.9;
}

.gpt-scan-day-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}

.gpt-btn-scan-day {
  width: 100%;
  border: 1px solid #0b6e4f;
  background: #0b6e4f;
  color: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.gpt-header-actions .gpt-btn-scan-day {
  width: auto;
  white-space: nowrap;
  padding: 7px 12px;
  font-size: 0.78rem;
  flex-shrink: 0;
}

.gpt-btn-scan-day:hover:not(:disabled) {
  background: #095c42;
}

.gpt-btn-scan-day:disabled {
  opacity: 0.55;
  cursor: wait;
}

.gpt-scan-day-status {
  font-size: 0.72rem;
  color: var(--gpt-muted);
  line-height: 1.35;
}

.gpt-window-timer {
  display: inline-block;
  margin-top: 2px;
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--gpt-green);
}

.gpt-window-timer.is-warn {
  color: #b7791f;
}

.gpt-window-timer.is-danger {
  color: var(--gpt-danger);
}

.gpt-window-timer.is-closed {
  color: var(--gpt-muted);
  font-weight: 600;
}

.gpt-conv-list .w {
  display: block;
  margin-top: 3px;
  font-size: 0.7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gpt-green);
}

.gpt-conv-list .w.is-warn {
  color: #b7791f;
}

.gpt-conv-list .w.is-danger {
  color: var(--gpt-danger);
}

.gpt-conv-list .w.is-closed {
  color: var(--gpt-muted);
  font-weight: 600;
}

.gpt-scope-btn {
  border: 1px solid #c5d5cc;
  background: #f7faf8;
  color: var(--gpt-muted, #5a6b63);
  border-radius: 8px;
  padding: 6px 8px;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  flex: 1 1 auto;
  min-width: 3.2rem;
  text-align: center;
}

.gpt-scope-btn:hover {
  background: #eef5f1;
  color: var(--gpt-text, #1a3d32);
}

.gpt-scope-btn.is-active {
  background: #1a3d32;
  border-color: #1a3d32;
  color: #fff;
}

.gpt-conv-gpt-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #1a3d32;
  cursor: pointer;
  user-select: none;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid #c5d5cc;
  background: #f7faf8;
}

.gpt-conv-gpt-toggle input {
  margin: 0;
  accent-color: #0b6e4f;
}

.gpt-btn-hide {
  font-size: 0.72rem !important;
  font-weight: 600;
  padding: 4px 8px !important;
  border-radius: 8px;
  border: 1px solid #d4b5b5;
  background: #faf6f6;
  color: #8a3a3a;
  cursor: pointer;
  line-height: 1.2;
}

.gpt-btn-hide:hover {
  background: #f3e4e4;
  border-color: #c48a8a;
}

.gpt-conv-hide {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border: 1px solid #d0d5d2;
  border-radius: 6px;
  background: #fff;
  color: #6b7280;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  opacity: 0.55;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gpt-conv-list li:hover .gpt-conv-hide,
.gpt-conv-list li.is-active .gpt-conv-hide {
  opacity: 1;
}

.gpt-conv-hide:hover {
  background: #f3e4e4;
  border-color: #c48a8a;
  color: #8a3a3a;
}

.gpt-conv-list li.gpt-off .t {
  color: #b7791f;
}

body.gpt-mode-auto .gpt-composer {
  opacity: 1;
}

.gpt-conv-list li.has-unread .t {
  color: #0b6e4f;
}

.gpt-conv-list li.is-comment .t {
  color: #0a5c8a;
}

.gpt-conv-list li.is-outreach .t {
  color: #5a6b3a;
}

.gpt-conv-list li.is-scanned .t {
  color: #1a5c45;
}

.gpt-conv-list li.has-unread .s {
  font-weight: 600;
}

.gpt-conv-list .gpt-list-loader {
  opacity: 0.55;
  font-size: 0.78rem;
  pointer-events: none;
  text-align: center;
  padding: 0.65rem 0.75rem;
  cursor: default;
}

.gpt-conv-list .gpt-list-loader:hover {
  background: transparent;
}

.gpt-conv-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  flex: 1;
}

.gpt-conv-list li {
  padding: 10px 12px;
  padding-right: 56px;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 4px;
  border: 1px solid transparent;
  position: relative;
}

.gpt-conv-list li:hover {
  background: #f0f5f2;
}

.gpt-conv-list li.is-active {
  background: #e3f2eb;
  border-color: #b7d9c8;
}

.gpt-conv-list .t {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gpt-conv-list .s {
  display: block;
  font-size: 0.72rem;
  color: var(--gpt-muted);
  margin-top: 2px;
}

.gpt-sidebar-foot {
  padding: 10px 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.gpt-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  position: relative;
}

.gpt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.gpt-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.gpt-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0b6e4f, #2bb673);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gpt-header-info strong,
.gpt-title-link {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: inherit;
  text-decoration: none;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gpt-title-link.is-link:hover {
  color: var(--gpt-green);
  text-decoration: underline;
  cursor: pointer;
}

.gpt-ext-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 2px;
}

.gpt-ext-link {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gpt-green);
  text-decoration: none;
}

.gpt-ext-link:hover {
  text-decoration: underline;
}

.gpt-conv-ext {
  position: absolute;
  right: 28px;
  top: 8px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid rgba(11, 110, 79, 0.35);
  background: #fff;
  color: var(--gpt-green);
  font-size: 0.85rem;
  line-height: 20px;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
}

.gpt-conv-ext:hover {
  background: #e8f5ef;
}

.gpt-status {
  display: block;
  font-size: 0.75rem;
  color: var(--gpt-muted);
}

.gpt-status.is-error {
  color: var(--gpt-danger);
}

.gpt-status.is-rec {
  color: var(--gpt-danger);
  font-weight: 600;
}

.gpt-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.gpt-channel-toggle {
  display: inline-flex;
  gap: 3px;
  padding: 2px;
  border-radius: 10px;
  background: #f0f2f5;
}

.gpt-channel-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--gpt-muted, #5a6b63);
  border-radius: 8px;
  padding: 7px 10px;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  min-width: 2.4rem;
}

.gpt-channel-btn:hover {
  background: #e4e6eb;
  color: var(--gpt-text, #1a3d32);
}

.gpt-channel-btn.is-active {
  background: #1a3d32;
  color: #fff;
}

.gpt-reply-toggle {
  display: flex;
  gap: 4px;
  padding: 8px 10px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}

.gpt-reply-btn {
  appearance: none;
  flex: 1;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #f0f2f5;
  color: var(--gpt-muted, #5a6b63);
  border-radius: 8px;
  padding: 8px 6px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.2;
}

.gpt-reply-btn:hover {
  background: #e4e6eb;
  color: var(--gpt-text, #1a3d32);
}

.gpt-reply-btn.is-active {
  background: #0b6e4f;
  border-color: #0b6e4f;
  color: #fff;
}

.gpt-reply-btn[data-reply="replied"].is-active {
  background: #1a3d32;
  border-color: #1a3d32;
}

.gpt-reply-count {
  display: inline-block;
  margin-left: 4px;
  min-width: 1.4em;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.12);
  font-size: 0.72rem;
  font-weight: 800;
  vertical-align: middle;
}

.gpt-reply-btn.is-active .gpt-reply-count {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.gpt-sort-toggle {
  display: flex;
  gap: 4px;
  padding: 0 10px 10px;
  flex-shrink: 0;
}

.gpt-sort-btn {
  appearance: none;
  flex: 1;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff;
  color: var(--gpt-muted, #5a6b63);
  border-radius: 8px;
  padding: 6px 8px;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.gpt-sort-btn:hover {
  background: #f0f2f5;
  color: var(--gpt-text, #1a3d32);
}

.gpt-sort-btn.is-active {
  background: #2c5282;
  border-color: #2c5282;
  color: #fff;
}

.gpt-icon-btn {
  appearance: none;
  border: none;
  background: #f0f2f5;
  color: var(--gpt-text);
  font-size: 0.8rem;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}

.gpt-icon-btn:hover {
  background: #e4e6eb;
}

.gpt-thread {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gpt-empty {
  margin: auto;
  text-align: center;
  color: var(--gpt-muted);
  padding: 24px;
}

.gpt-row {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.gpt-bubble {
  width: 100%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.35;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #fff;
}

.gpt-bubble-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 3px;
}

.gpt-meta-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gpt-green);
}

.gpt-row-out .gpt-meta-name {
  color: #1b7a3d;
}

.gpt-meta-time {
  font-size: 0.7rem;
  color: var(--gpt-muted);
  font-variant-numeric: tabular-nums;
}

.gpt-meta-tag {
  font-size: 0.65rem;
  font-weight: 600;
  color: #5a6b63;
  background: #e8f0ec;
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
}

.gpt-bubble-fb-comment {
  border-style: dashed;
  background: #f7fbf8;
}

.gpt-bubble-head {
  flex-wrap: wrap;
  align-items: center;
}

.gpt-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px calc(10px + var(--safe-bottom));
  background: #fff;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

#gpt-input {
  flex: 1;
  resize: none;
  border: none;
  background: #f0f2f5;
  border-radius: 20px;
  padding: 10px 14px;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.35;
  max-height: 120px;
  min-height: 42px;
  outline: none;
}

.gpt-mic,
.gpt-send {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  background: var(--gpt-green);
}

.gpt-mic.is-rec {
  background: var(--gpt-danger);
  animation: gpt-pulse 1.2s ease-in-out infinite;
}

.gpt-mic:disabled,
.gpt-send:disabled,
#gpt-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@keyframes gpt-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

.gpt-handover-banner {
  background: #fff3cd;
  color: #664d03;
  padding: 10px 14px;
  font-size: 0.85rem;
  border-top: 1px solid #ffe69c;
  text-align: center;
}

/* Panel */
.gpt-panel {
  background: var(--gpt-panel);
  border-left: 1px solid rgba(0, 0, 0, 0.08);
  padding: 14px;
  overflow-y: auto;
  min-height: 0;
}

.gpt-panel h2 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.gpt-panel-hint {
  margin: 0 0 12px;
  font-size: 0.75rem;
  color: var(--gpt-muted);
  line-height: 1.35;
}

.gpt-panel-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0 0 12px;
}

.gpt-btn-scan,
.gpt-btn-draft {
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 6px;
  border-radius: 8px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.gpt-btn-scan {
  border: 1px solid #0a5a8a;
  background: #e8f4fb;
  color: #0a5a8a;
}

.gpt-btn-scan:hover:not(:disabled) {
  background: #0a5a8a;
  color: #fff;
}

.gpt-btn-draft {
  border: 1px solid #0b6e4f;
  background: #e8f5f0;
  color: #0b6e4f;
}

.gpt-btn-draft:hover:not(:disabled) {
  background: #0b6e4f;
  color: #fff;
}

.gpt-btn-scan:disabled,
.gpt-btn-draft:disabled {
  opacity: 0.55;
  cursor: wait;
}

.gpt-btn-year-scan {
  display: block;
  width: 100%;
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 1px solid #7a3e0c;
  border-radius: 8px;
  background: #fff4e8;
  color: #7a3e0c;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.gpt-btn-year-scan:hover:not(:disabled) {
  background: #7a3e0c;
  color: #fff;
}

.gpt-btn-year-scan:disabled {
  opacity: 0.55;
  cursor: wait;
}

.gpt-year-stats {
  padding: 4px 12px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #1a3d32;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.gpt-year-scan-progress {
  margin: 0 0 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f3f6f4;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #1a3d32;
  white-space: pre-line;
}

.gpt-panel h3 {
  margin: 16px 0 6px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gpt-muted);
}

.gpt-panel-meta {
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
}

.gpt-k {
  color: var(--gpt-muted);
  display: inline-block;
  min-width: 72px;
}

.gpt-progress-bar {
  height: 6px;
  background: #e8ece9;
  border-radius: 99px;
  margin: 12px 0;
  overflow: hidden;
}

.gpt-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gpt-green);
  transition: width 0.25s ease;
}

.gpt-panel-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.gpt-editable {
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.12s;
}

.gpt-editable:hover {
  background: #e8f3ed;
}

.gpt-editable.is-editing {
  background: #fff;
  padding: 0;
  cursor: text;
}

.gpt-item-val {
  color: #5c6b63;
  text-align: right;
  max-width: 58%;
  word-break: break-word;
}

.gpt-inline-input {
  width: 100%;
  font-family: inherit;
  font-size: 0.85rem;
  border: 1px solid var(--gpt-green);
  border-radius: 6px;
  padding: 6px 8px;
  background: #fff;
  color: var(--gpt-text);
  box-sizing: border-box;
}

textarea.gpt-inline-input {
  min-height: 80px;
  resize: vertical;
  line-height: 1.35;
}

.gpt-panel-items li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f2f0;
  font-size: 0.85rem;
}

.gpt-panel-items li.gpt-item-problem {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.gpt-item-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.gpt-problem-meter {
  width: 100%;
}

.gpt-problem-meter-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.72rem;
  color: var(--gpt-muted);
}

.gpt-problem-meter-head strong {
  font-variant-numeric: tabular-nums;
  color: var(--gpt-green);
  font-size: 0.8rem;
}

.gpt-problem-meter-head strong.is-full {
  color: #0a5c42;
}

.gpt-problem-bar {
  height: 8px;
  background: #e4ebe7;
  border-radius: 99px;
  overflow: hidden;
}

.gpt-problem-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2bb673, #0b6e4f);
  border-radius: 99px;
  transition: width 0.3s ease;
}

.gpt-panel-items li.is-current {
  background: #e3f2eb;
  margin: 0 -8px;
  padding: 8px;
  border-radius: 8px;
  border-bottom-color: transparent;
}

.gpt-panel-items .ok {
  color: var(--gpt-green);
  font-weight: 700;
}

.gpt-panel-items .no {
  color: var(--gpt-muted);
}

.gpt-summary,
.gpt-problem {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.gpt-talk-style {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 8px;
  padding: 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.4;
  resize: vertical;
  min-height: 96px;
  background: #fff;
}

.gpt-talk-style:disabled {
  opacity: 0.55;
  background: #f7faf8;
}

#p-talk-style-save {
  margin: 0 0 14px;
  width: 100%;
}

.gpt-idle-user-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
}

.gpt-idle-user-input {
  width: 96px;
  padding: 8px 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  font: inherit;
  font-size: 0.85rem;
}

.gpt-idle-user-input:disabled {
  opacity: 0.55;
  background: #f7faf8;
}

#p-idle-save {
  margin: 0;
  flex: 1;
}

.gpt-base-prompt {
  margin: 0 0 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: #f7faf8;
  padding: 8px 10px;
}

.gpt-base-prompt summary {
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1a3d32;
}

.gpt-base-prompt-text {
  margin: 8px 0 0;
  padding: 8px;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.7rem;
  line-height: 1.35;
  color: #334;
  background: #fff;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.gpt-problem {
  background: #f7faf8;
  padding: 10px;
  border-radius: 8px;
  max-height: 180px;
  overflow: auto;
  font-family: inherit;
}

.gpt-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.gpt-tag {
  background: #e3f2eb;
  color: var(--gpt-green-dark);
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 99px;
}

/* Comentarii FB — jos în panoul din dreapta */
.gpt-comments-box {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.gpt-comments-box > summary {
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--gpt-green);
  list-style: none;
}

.gpt-comments-box > summary::-webkit-details-marker {
  display: none;
}

.gpt-comments-box > summary::before {
  content: '▸ ';
  color: var(--gpt-muted);
}

.gpt-comments-box[open] > summary::before {
  content: '▾ ';
}

.gpt-comments-box .gpt-panel-hint {
  margin-top: 8px;
}

.gpt-comments-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  margin: 0 0 10px;
  cursor: pointer;
}

.gpt-comments-modes {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 8px 10px 4px;
  margin: 0 0 10px;
}

.gpt-comments-modes legend {
  padding: 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gpt-green);
}

.gpt-comments-radio {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 2px;
  cursor: pointer;
  font-size: 0.8rem;
}

.gpt-comments-field {
  margin-bottom: 10px;
}

.gpt-comments-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.gpt-comments-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #c5d5cc;
  border-radius: 8px;
  font: inherit;
  font-size: 0.8rem;
  line-height: 1.35;
  resize: vertical;
  min-height: 64px;
  background: #fbfdfc;
}

.gpt-comments-field.is-dimmed {
  opacity: 0.45;
  pointer-events: none;
}

.gpt-comments-posts {
  margin: 6px 0 8px;
  max-height: 180px;
  overflow: auto;
  padding: 4px 2px;
}

.gpt-comments-posts.is-dimmed {
  opacity: 0.4;
  pointer-events: none;
}

.gpt-comments-post {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 5px 2px;
  font-size: 0.76rem;
  cursor: pointer;
}

.gpt-comments-post input {
  margin-top: 2px;
}

.gpt-comments-post .meta {
  color: var(--gpt-muted);
  font-size: 0.7rem;
}

.gpt-comments-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.gpt-comments-actions .gpt-btn-primary {
  background: var(--gpt-green);
  color: #fff;
  border-color: var(--gpt-green);
}

.gpt-comments-status {
  font-size: 0.75rem;
  color: var(--gpt-muted);
}

.gpt-comments-status.is-ok {
  color: var(--gpt-green);
  font-weight: 600;
}

.gpt-comments-status.is-err {
  color: var(--gpt-danger);
  font-weight: 600;
}

@media (max-width: 960px) {
  .gpt-app {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 40vh) minmax(0, 1fr) minmax(0, auto);
  }

  .gpt-sidebar {
    max-height: none;
    min-height: 0;
    border-right: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }

  .gpt-header-actions {
    flex-wrap: wrap;
    gap: 6px;
  }

  .gpt-header-actions .gpt-btn-scan-day {
    order: -1;
    width: 100%;
  }

  .gpt-panel {
    border-left: none;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    max-height: min(36vh, 280px);
  }
}

/* iPhone / telefoane înguste (~iPhone 17 = ~402 CSS px) */
@media (max-width: 520px) {
  .gpt-app {
    grid-template-rows: minmax(0, 1fr) 0 0;
    max-width: none;
  }

  /* Implicit: lista pe tot ecranul */
  .gpt-sidebar {
    max-height: none;
    grid-row: 1;
  }

  .gpt-main,
  .gpt-panel {
    display: none;
    min-height: 0;
  }

  /* Chat deschis: ascunde lista, arată firul + dosar compact */
  body.gpt-app.gpt-mobile-chat {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(0, 34vh);
  }

  body.gpt-app.gpt-mobile-chat .gpt-sidebar {
    display: none;
  }

  body.gpt-app.gpt-mobile-chat .gpt-main {
    display: flex;
    flex-direction: column;
    grid-row: 1;
    min-height: 0;
  }

  body.gpt-app.gpt-mobile-chat .gpt-panel {
    display: flex;
    flex-direction: column;
    grid-row: 2;
    max-height: none;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.gpt-app.gpt-mobile-chat .gpt-back-list {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Controale mai compacte în listă */
  .gpt-sidebar-head,
  .gpt-idle-row,
  .gpt-day-stats,
  .gpt-queue-stats,
  .gpt-scan-day-row,
  .gpt-mode-toggle,
  .gpt-scope-toggle,
  .gpt-reply-toggle,
  .gpt-sort-toggle {
    padding-left: 10px;
    padding-right: 10px;
  }

  .gpt-idle-row {
    padding-top: 6px;
    padding-bottom: 6px;
    font-size: 0.78rem;
  }

  .gpt-idle-controls input {
    font-size: 16px; /* iOS: evită zoom la focus */
    min-height: 36px;
  }

  .gpt-queue-detail {
    font-size: 0.65rem;
    line-height: 1.3;
  }

  .gpt-mode-btn,
  .gpt-scope-btn,
  .gpt-reply-btn,
  .gpt-sort-btn,
  .gpt-channel-btn {
    min-height: 36px;
    font-size: 0.78rem;
  }

  .gpt-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 8px 10px;
  }

  .gpt-header-info {
    width: 100%;
  }

  .gpt-header-actions {
    width: 100%;
  }

  /* Scanare e deja în sidebar — nu dubla pe header pe telefon */
  .gpt-header-actions .gpt-btn-scan-day {
    display: none;
  }

  .gpt-channel-toggle {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }

  .gpt-composer {
    padding: 8px 10px;
    padding-bottom: calc(8px + var(--safe-bottom));
    gap: 8px;
  }

  .gpt-composer textarea {
    font-size: 16px; /* iOS: fără zoom */
    min-height: 40px;
    max-height: 120px;
  }

  .gpt-send,
  .gpt-mic {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }

  .gpt-thread {
    padding: 10px;
  }

  .gpt-bubble {
    max-width: 88%;
  }

  .gpt-panel {
    padding: 10px;
  }

  .gpt-panel h2 {
    font-size: 0.95rem;
  }

  .gpt-panel-hint {
    font-size: 0.7rem;
  }

  .gpt-sidebar-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .gpt-sidebar-foot .gpt-icon-btn {
    flex: 1 1 auto;
    text-align: center;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .gpt-conv-list li {
    padding: 12px 52px 12px 12px;
  }

  .gpt-ext-links {
    gap: 10px;
  }

  .gpt-ext-link {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
  }
}


.gpt-comments-outreach-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
}
.gpt-comments-outreach-grid div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.gpt-comments-outreach-grid strong {
  font-size: 1.15rem;
  line-height: 1.1;
}
.gpt-comments-outreach-grid span {
  font-size: 0.72rem;
  opacity: 0.75;
}
.gpt-comments-outreach-detail {
  margin: 0.55rem 0 0;
  font-size: 0.8rem;
  opacity: 0.85;
  line-height: 1.35;
}
@media (max-width: 900px) {
  .gpt-comments-outreach-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}



.gpt-day-stats-outreach {
  background: linear-gradient(180deg, #f3faf6 0%, #fff 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.gpt-day-stats-outreach .gpt-day-stats-suffix {
  max-width: 100%;
  flex-basis: 100%;
  margin-left: 0;
  margin-top: 2px;
  white-space: normal;
  line-height: 1.25;
}

.gpt-outreach-queue-row {
  padding-top: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: #f7fbf8;
}
.gpt-btn-outreach-queue {
  background: #0b6e4f !important;
  color: #fff !important;
  border-color: #0b6e4f !important;
}
.gpt-btn-outreach-queue:hover:not(:disabled) {
  background: #095c42 !important;
}
