:root {
  --bg-page: #0c0f17;
  --bg-card: #131824;
  --bg-card-hover: #182030;
  --bg-input: #0a0d14;
  --bg-overlay: rgba(5, 8, 15, 0.75);

  --border-subtle: #1e2638;
  --border-focus: #f97316;
  --border-danger: #ef4444;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-orange: #f97316;
  --accent-orange-hover: #ea580c;
  --accent-green: #10b981;
  --accent-red: #ef4444;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

.app-container {
  width: 100%;
  max-width: 660px;
  padding: 36px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 4px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-icon {
  font-size: 1.4rem;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.user-email {
  color: var(--text-main);
  font-weight: 500;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.logout-btn:hover {
  color: var(--accent-red);
}

.settings-trigger-btn {
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.settings-trigger-btn:hover {
  background-color: var(--bg-card);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Auth Screens */
.auth-card-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 0;
}

.auth-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 36px 30px;
  text-align: center;
  max-width: 420px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.auth-icon {
  font-size: 2.2rem;
  margin-bottom: 4px;
}

.auth-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.auth-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.google-signin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 12px 20px;
  margin-top: 10px;
  background-color: #ffffff;
  color: #1f2937;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.google-signin-btn:hover {
  background-color: #f3f4f6;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.google-icon {
  flex-shrink: 0;
}

.auth-hint {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 6px;
}

.auth-hint code {
  color: var(--accent-orange);
  background-color: rgba(249, 115, 22, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.access-denied-card {
  border-color: rgba(239, 68, 68, 0.4);
}

.auth-error-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.switch-account-btn {
  margin-top: 10px;
  width: 100%;
}

/* Account Selector */
.account-selector-wrapper {
  display: flex;
  justify-content: center;
}

.account-segmented-control {
  display: flex;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 4px;
  gap: 4px;
  width: 100%;
  max-width: 440px;
}

.acc-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.acc-tab:hover {
  color: var(--text-main);
}

.acc-tab.active {
  background-color: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.acc-tab.active#btnAccountProd {
  background-color: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.acc-handle {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  opacity: 0.85;
}

/* Main Workspace Card */
.main-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s ease;
}

.main-card:focus-within {
  border-color: rgba(249, 115, 22, 0.4);
}

.workspace-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.workspace-tab {
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-muted);
  padding: 9px 16px;
  font: 600 0.9rem var(--font-sans);
  cursor: pointer;
}

.workspace-tab.active {
  color: var(--text-main);
  border-bottom-color: var(--accent-orange);
}

.composer-premise {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.6;
  padding: 12px 14px;
  background: rgba(10, 13, 20, 0.55);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.composer-premise a {
  color: var(--accent-orange);
  margin-right: 10px;
}

.curation-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.curation-header h2 { font-size: 1.2rem; }
.curation-status { color: var(--text-muted); font-size: 0.82rem; }

.curation-generate-btn {
  background: var(--accent-orange);
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font: 700 0.82rem var(--font-sans);
  cursor: pointer;
}

.curation-generate-btn:disabled { opacity: 0.6; cursor: wait; }
.curation-list { display: grid; gap: 14px; }

.curation-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.curation-post {
  margin: 0;
  color: var(--text-main);
  font-size: 1rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.curation-labels { display: flex; gap: 6px; margin-top: 12px; }
.curation-pill {
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 2px 7px;
  font-size: 0.68rem;
  line-height: 1.2;
}
.curation-sources { margin-top: 9px; color: var(--text-muted); font-size: 0.75rem; }
.curation-sources summary { cursor: pointer; width: fit-content; }
.curation-sources p { margin: 8px 0 5px; }
.curation-sources a { color: var(--accent-orange); margin-right: 10px; }
.curation-sources small { display: block; margin-top: 5px; }

@media (max-width: 560px) {
  .curation-header { align-items: flex-start; }
  .action-bar { flex-direction: column-reverse; }
  .action-btn { width: 100%; }
  .meta-row { gap: 6px; }
  .meta-item { font-size: 0.72rem; }
}

/* Initial State */
.initial-state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 16px;
  gap: 20px;
}

.initial-prompt {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 380px;
}

.big-generate-btn {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  border: none;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 14px 32px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 18px rgba(249, 115, 22, 0.4);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.big-generate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(249, 115, 22, 0.55);
}

.big-generate-btn:active {
  transform: translateY(0);
}

/* Active Editor Section */
.editor-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.textarea-container {
  position: relative;
}

textarea#postContent {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 18px 36px 18px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 1.12rem;
  line-height: 1.55;
  resize: vertical;
  min-height: 140px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea#postContent:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18);
}

.char-counter-tag {
  position: absolute;
  bottom: 12px;
  right: 14px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  pointer-events: none;
}

.char-counter-tag.warn {
  color: #f59e0b;
}

.char-counter-tag.over {
  color: var(--accent-red);
  font-weight: 700;
}

/* Metadata Line */
.metadata-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0 2px;
}

.meta-label {
  color: var(--text-dim);
  font-weight: 500;
}

.meta-val {
  color: #cbd5e1;
  font-weight: 600;
}

.meta-dot {
  color: var(--text-dim);
  margin: 0 4px;
}

/* Composer metadata */
.meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 2px;
}

.meta-item {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  padding: 5px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  background: rgba(10, 13, 20, 0.45);
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.meta-row .meta-label {
  color: var(--text-dim);
  font-weight: 500;
}

.meta-row .meta-val {
  color: #cbd5e1;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.meta-separator { display: none; }

/* Composer actions */
.action-bar {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-top: 2px;
}

.action-btn {
  min-height: 46px;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: 600 0.88rem var(--font-sans);
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.action-btn:focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: 3px;
}

.regen-btn {
  flex: 0 0 auto;
  color: var(--text-main);
  background: #1a2231;
  border: 1px solid #303b50;
}

.regen-btn:hover:not(:disabled) {
  background: #222d40;
  border-color: #46546d;
}

.post-btn {
  flex: 1;
  color: #fff;
  background: var(--accent-orange);
  border: 1px solid var(--accent-orange);
  box-shadow: 0 5px 16px rgba(249, 115, 22, 0.18);
}

.post-btn:hover:not(:disabled) {
  background: var(--accent-orange-hover);
  border-color: var(--accent-orange-hover);
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(249, 115, 22, 0.25);
}

.post-btn.prod-style {
  background: #9f2633;
  border-color: #b63845;
  box-shadow: 0 5px 16px rgba(185, 28, 28, 0.18);
}

.post-btn.prod-style:hover:not(:disabled) {
  background: #b52d3c;
  border-color: #d14452;
}

.action-btn:disabled,
.action-btn.disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Action Row */
.action-row {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  align-items: flex-start;
}

.post-btn-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cred-notice {
  font-size: 0.76rem;
  color: #f87171;
  font-family: var(--font-mono);
  text-align: center;
}

.secondary-action-btn,
.primary-action-btn {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.secondary-action-btn {
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  flex: 0 0 auto;
}

.secondary-action-btn:hover {
  background-color: #162032;
  border-color: rgba(255, 255, 255, 0.15);
}

.primary-action-btn {
  background-color: #f97316;
  border: none;
  color: #ffffff;
  width: 100%;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.3);
}

.primary-action-btn:hover {
  background-color: var(--accent-orange-hover);
  transform: translateY(-1px);
}

.primary-action-btn.prod-style {
  background-color: #b91c1c;
  box-shadow: 0 4px 14px rgba(185, 28, 28, 0.35);
}

.primary-action-btn.prod-style:hover {
  background-color: #991b1b;
}

.primary-action-btn.disabled-creds,
.primary-action-btn:disabled,
.secondary-action-btn:disabled,
.big-generate-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Status / Result Notice */
.status-notice {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-main);
}

.status-notice.success {
  border-color: rgba(16, 185, 129, 0.35);
  background-color: rgba(16, 185, 129, 0.08);
  color: #6ee7b7;
}

.status-notice.error {
  border-color: rgba(239, 68, 68, 0.35);
  background-color: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
}

.status-notice a {
  color: #38bdf8;
  text-decoration: underline;
}

/* Modal Overlay & Card (Shared) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-overlay);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-danger);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fee2e2;
}

.modal-subtext {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.modal-post-preview {
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 0.92rem;
  color: var(--text-main);
  white-space: pre-wrap;
  max-height: 180px;
  overflow-y: auto;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.modal-btn-cancel {
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.modal-btn-cancel:hover {
  background-color: var(--bg-input);
  color: var(--text-main);
}

.modal-btn-confirm {
  background-color: #dc2626;
  border: none;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.modal-btn-confirm:hover {
  background-color: #b91c1c;
}

/* Settings Modal */
.settings-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  justify-content: flex-end;
  background: rgba(5, 8, 15, 0.72);
  backdrop-filter: blur(3px);
}

.settings-drawer {
  width: min(580px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-left: 1px solid var(--border-subtle);
  box-shadow: -16px 0 40px rgba(0, 0, 0, 0.38);
}

.settings-modal {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.settings-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.settings-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.close-btn:hover {
  color: var(--text-main);
}

.close-icon-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: #1a2231;
  color: var(--text-muted);
  font: 500 1.15rem/1 var(--font-sans);
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.close-icon-btn:hover {
  background: #222d40;
  border-color: #46546d;
  color: var(--text-main);
}

.close-icon-btn:focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: 2px;
}

.settings-body {
  flex: 1;
  min-height: 0;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.label-sub {
  font-weight: 400;
  color: var(--text-dim);
  font-size: 0.75rem;
}

.field-hint {
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-top: -3px;
}

.settings-body textarea,
.settings-body input[type="text"] {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.45;
  resize: vertical;
  outline: none;
}

.settings-body textarea:focus,
.settings-body input[type="text"]:focus,
.settings-body input[type="time"]:focus,
.settings-body select:focus {
  border-color: var(--border-focus);
}

.settings-body input[type="time"],
.settings-body select {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  outline: none;
}

/* Schedule Section */
.settings-section-divider {
  border-top: 1px solid var(--border-subtle);
  margin: 6px 0 2px 0;
}

.settings-section-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: 0.02em;
}

.toggle-container {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle-container input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #f97316;
  cursor: pointer;
}

.toggle-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.schedule-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-left: 4px;
}

.schedule-time-list { display: flex; flex-wrap: wrap; gap: 8px; }
.schedule-time-list input { width: 120px; }
.schedule-note { color: var(--text-muted); font-size: 0.82rem; line-height: 1.5; }

.schedule-radios {
  display: flex;
  gap: 20px;
  margin-top: 4px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.83rem;
  font-weight: 500;
  color: #cbd5e1;
}

.radio-label input[type="radio"] {
  accent-color: #f97316;
  cursor: pointer;
}

.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Advanced Section */
.advanced-section {
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}

.advanced-section summary {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  outline: none;
  user-select: none;
  padding: 4px 0;
}

.advanced-section summary:hover {
  color: var(--text-muted);
}

.advanced-content {
  padding-top: 12px;
}

/* Settings Footer */
.settings-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.15);
}

.settings-right-actions {
  display: flex;
  gap: 10px;
}

.text-link-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}

.text-link-btn:hover {
  color: var(--text-muted);
}

.secondary-btn {
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.secondary-btn:hover {
  background-color: var(--bg-input);
  color: var(--text-main);
}

.save-btn {
  background-color: #15803d;
  border: 1px solid #16a34a;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 7px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.save-btn:hover {
  background-color: #16a34a;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 10px 18px;
  border-radius: var(--radius-full);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hidden {
  display: none !important;
}

/* --- Activity --- */

.activity-view {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.activity-header h2 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text-main);
}

.activity-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.activity-filter {
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  padding: 5px 14px;
  font: 600 0.78rem var(--font-sans);
  cursor: pointer;
}

.activity-filter:hover { background-color: var(--bg-card-hover); }

.activity-filter.active {
  color: var(--text-main);
  border-color: var(--accent-orange);
  background-color: var(--bg-card);
}

.activity-status {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.activity-day {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.activity-day-label {
  margin: 0;
  color: var(--text-muted);
  font: 600 0.75rem var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.activity-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.activity-item-error { border-color: rgba(239, 68, 68, 0.4); }

.activity-summary {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px 16px;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.activity-summary:hover { background-color: var(--bg-card-hover); }

.activity-time {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.activity-text {
  margin: 0;
  color: var(--text-main);
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.activity-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.activity-pill {
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  font-size: 0.68rem;
  line-height: 1.4;
}

.activity-pill-published {
  color: var(--accent-green);
  border-color: rgba(16, 185, 129, 0.45);
}

.activity-pill-error {
  color: var(--accent-red);
  border-color: rgba(239, 68, 68, 0.45);
}

.activity-detail {
  border-top: 1px solid var(--border-subtle);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.activity-detail-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.activity-detail-section h4 {
  margin: 0 0 2px;
  color: var(--text-main);
  font: 600 0.75rem var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.activity-detail-row {
  display: flex;
  gap: 12px;
  font-size: 0.82rem;
  line-height: 1.5;
}

.activity-detail-label {
  flex: 0 0 120px;
  color: var(--text-muted);
}

.activity-detail-value {
  color: var(--text-main);
  word-break: break-word;
  min-width: 0;
}

.activity-sources { display: flex; flex-wrap: wrap; gap: 10px; }
.activity-sources a { color: var(--accent-orange); }

.activity-technical {
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}

.activity-technical summary {
  cursor: pointer;
  width: fit-content;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.activity-technical-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 10px;
}

.activity-technical-body .activity-detail-value {
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --- Schedule status summary in Settings --- */

.schedule-status {
  margin: 4px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.schedule-summary {
  margin: 0;
  color: var(--text-main);
  font-size: 0.85rem;
}

.schedule-next {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.schedule-details summary {
  cursor: pointer;
  width: fit-content;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.schedule-details-body { margin-top: 14px; }

.storage-notice {
  margin: 4px 0 0;
  color: var(--accent-orange);
  font-size: 0.75rem;
  line-height: 1.5;
}
