:root {
  --bg: #eef1f6;
  --card: #ffffff;
  --border: #e2e6ef;
  --text: #1a2332;
  --muted: #6b7585;
  --primary: #1877f2;
  --primary-hover: #166fe0;
  --success: #31a24c;
  --warn: #d97706;
  --danger: #e74c3c;
  --radius: 12px;
  --nav-active-bg: rgba(24, 119, 242, 0.1);
  --nav-active-bar: #1877f2;
  --sidebar-w: 240px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

.hidden {
  display: none !important;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  margin: 16px 0 16px 16px;
  padding: 18px 12px;
  background: var(--card);
  border-radius: 18px;
  box-shadow: 0 8px 28px rgba(26, 35, 50, 0.08);
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 16px;
  height: calc(100vh - 32px);
  align-self: flex-start;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 8px;
}

.sidebar-brand strong {
  display: block;
  font-size: 1rem;
  color: var(--text);
}

.sidebar-brand small {
  color: var(--muted);
  font-size: 0.75rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 10px 12px 10px 10px;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  box-sizing: border-box;
  position: relative;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
  background: rgba(24, 119, 242, 0.06);
  color: var(--text);
}

.nav-item.active {
  background: var(--nav-active-bg);
  color: #0d1b2a;
  font-weight: 700;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--nav-active-bar);
}

.nav-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #eef4fc;
  color: var(--primary);
  flex-shrink: 0;
}

.nav-item.active .nav-ico {
  background: #fff;
  box-shadow: 0 1px 3px rgba(24, 119, 242, 0.15);
}

.nav-ico svg {
  width: 18px;
  height: 18px;
}

.sidebar-user {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 8px;
  word-break: break-all;
}

.app-main {
  flex: 1;
  min-width: 0;
  padding: 24px 24px 48px;
  max-width: 1100px;
}

.app-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 4px;
}

.page-header h1 {
  font-size: 1.55rem;
  font-weight: 700;
}

.page-header p {
  color: var(--muted);
  font-size: 0.9rem;
}

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

@media (max-width: 860px) {
  .app-shell {
    flex-direction: column;
  }
  .sidebar {
    width: auto;
    margin: 12px;
    height: auto;
    position: static;
  }
  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .nav-item {
    flex: 1 1 auto;
  }
  .nav-item.active::before {
    display: none;
  }
  .app-main {
    padding: 8px 12px 40px;
  }
}

.demo-banner {
  background: rgba(240,173,78,0.12);
  border: 1px solid rgba(240,173,78,0.35);
  color: var(--warn);
  text-align: center;
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  font-weight: 600;
}

.demo-banner.hidden { display: none; }

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.sidebar-brand .logo-icon { font-size: 1.6rem; }
header h1 { font-size: 1.5rem; font-weight: 700; }
header p { color: var(--muted); font-size: 0.9rem; }

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 480px;
  padding: 28px;
}

.login-error {
  color: var(--danger);
  margin-top: 12px;
  font-size: 0.9rem;
}

.login-error.hidden { display: none; }

select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
}

.badge {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}
.badge-ok { background: rgba(49,162,76,0.15); color: var(--success); }
.badge-warn { background: rgba(240,173,78,0.15); color: var(--warn); }
.badge-err { background: rgba(231,76,60,0.15); color: var(--danger); }

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 4px 18px rgba(26, 35, 50, 0.05);
}

.control-panel {
  border-color: rgba(24, 119, 242, 0.35);
  background: linear-gradient(180deg, rgba(24,119,242,0.08), transparent);
}

.control-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.control-header h2 {
  margin-bottom: 4px;
}

.control-header .hint {
  margin-bottom: 0;
}

.power-lamp {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 140px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f5f7fb;
  user-select: none;
}

.power-bulb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.power-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.power-text strong {
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.power-text small {
  color: var(--muted);
  font-size: 0.75rem;
}

.power-lamp.off .power-bulb {
  background: #c5cad6;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.15);
  border-color: #aeb4c2;
}

.power-lamp.off .power-text strong {
  color: var(--muted);
}

.power-lamp.on {
  border-color: rgba(49, 162, 76, 0.55);
  background: rgba(49, 162, 76, 0.12);
}

.power-lamp.on .power-bulb {
  background: #31a24c;
  border-color: #4cd964;
  box-shadow:
    0 0 8px #31a24c,
    0 0 18px rgba(49, 162, 76, 0.7),
    0 0 30px rgba(49, 162, 76, 0.35);
  animation: powerPulse 1.6s ease-in-out infinite;
}

.power-lamp.on .power-text strong {
  color: #4cd964;
}

@keyframes powerPulse {
  0%, 100% {
    box-shadow:
      0 0 8px #31a24c,
      0 0 18px rgba(49, 162, 76, 0.7),
      0 0 28px rgba(49, 162, 76, 0.3);
  }
  50% {
    box-shadow:
      0 0 12px #4cd964,
      0 0 26px rgba(76, 217, 100, 0.85),
      0 0 40px rgba(49, 162, 76, 0.45);
  }
}

.btn-xl {
  width: 100%;
  padding: 16px 20px;
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: 8px;
}

.setup-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.setup-step {
  background: #f5f7fb;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

.setup-step.ok {
  border-color: rgba(49,162,76,0.35);
  color: var(--success);
}

.advanced-panel summary {
  cursor: pointer;
  font-weight: 600;
  padding: 4px 0 12px;
  color: var(--muted);
}

.advanced-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 8px;
}

.card-wide { grid-column: 1 / -1; }

.card h2 {
  font-size: 1.05rem;
  margin-bottom: 16px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

input[type="text"],
input[type="url"],
input[type="datetime-local"],
textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  width: 100%;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
}

button, .btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

button:hover { background: var(--primary-hover); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.file-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9rem;
}

.file-label input { display: none; }

.checkboxes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 160px;
  overflow-y: auto;
  padding: 8px 0;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

.checkbox-item input { width: 18px; height: 18px; accent-color: var(--primary); }

.schedule-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--muted);
}

.list { list-style: none; margin-top: 16px; }

.list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  gap: 10px;
}

.list li.group-item {
  display: block;
  padding: 14px 0;
}

.list li small { color: var(--muted); display: block; word-break: break-all; }

.queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.queue-header h2 {
  margin: 0;
  font-size: 1.15rem;
}

/* ===== Post schedule card ===== */
.schedule-card {
  max-width: 720px;
  padding: 22px 24px 24px;
}

.schedule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.schedule-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.schedule-title h1 {
  font-size: 1.15rem;
  font-weight: 650;
  margin: 0;
}

.schedule-head-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.schedule-status {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
}

.schedule-status.is-running {
  color: #16a34a;
}

.schedule-hint {
  margin: 0 0 14px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.schedule-mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 0.92rem;
}

.schedule-mode-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text);
}

.schedule-table-wrap {
  overflow-x: auto;
  border: 1px solid #d0d7e2;
  border-radius: 10px;
  background: #fff;
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.schedule-table th {
  text-align: left;
  padding: 10px 12px;
  background: #eef1f5;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid #d0d7e2;
}

.schedule-table td {
  padding: 8px 10px;
  vertical-align: top;
  border-bottom: 1px solid #e8ecf1;
}

.schedule-table tr:last-child td {
  border-bottom: none;
}

.sched-num {
  width: 36px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}

.schedule-table textarea,
.schedule-table input[type="url"] {
  width: 100%;
  min-width: 120px;
  padding: 8px 10px;
  border: 1px solid #d0d7e2;
  border-radius: 8px;
  font: inherit;
  font-size: 0.88rem;
  background: #fff;
}

.schedule-table textarea {
  min-height: 56px;
  resize: vertical;
}

.sched-image-col {
  min-width: 180px;
}

.sched-img-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.sched-img-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid #d0d7e2;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 1rem;
}

.sched-img-preview {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #d0d7e2;
}

.sched-file-btn {
  cursor: pointer;
  margin: 0;
}

.sched-file-name {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--muted);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sched-row-remove {
  background: transparent;
  border: none;
  color: #ef4444;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

.sched-row-remove:hover {
  color: #dc2626;
}

.schedule-table-host {
  margin-top: 12px;
}

.schedule-table .sched-actions {
  width: 44px;
  text-align: center;
  vertical-align: middle;
}

.schedule-table-row.is-queued {
  background: #fafbfc;
}

.schedule-table-row.is-queued.is-rejected {
  background: rgba(239, 68, 68, 0.05);
}

.schedule-table-row.is-draft {
  background: #fff;
}

.sched-readonly {
  min-height: 56px;
  padding: 8px 10px;
  border: 1px solid #e8ecf1;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 0.88rem;
  line-height: 1.45;
  word-break: break-word;
}

.sched-readonly-url {
  min-height: 38px;
  display: flex;
  align-items: center;
}

.sched-readonly-url a {
  color: var(--primary);
  word-break: break-all;
  font-size: 0.85rem;
}

.sched-readonly-text {
  white-space: pre-wrap;
}

.schedule-table th.sched-image-col,
.schedule-table td.sched-image-col {
  width: 220px;
}

.schedule-table th:nth-child(2),
.schedule-table td:nth-child(2) {
  min-width: 200px;
}

.schedule-table th:nth-child(4),
.schedule-table td:nth-child(4) {
  min-width: 160px;
}

.sched-reject-hint {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--danger);
  max-width: 220px;
  line-height: 1.3;
}

.hist-sched-status.is-rejected {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
}

.hist-sched-status.is-processing,
.hist-sched-status.is-next {
  background: rgba(59, 130, 246, 0.15);
  color: #1d4ed8;
}

.np-ico-clock {
  background: #2563eb;
  color: #fff;
}

.schedule-empty {
  margin: 0;
  padding: 36px 16px;
  text-align: center;
  background: #f3f5f8;
  border: 1px dashed #c9d2de;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.schedule-queue,
.schedule-drafts {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.schedule-drafts:empty,
.schedule-queue.hidden-when-empty:empty {
  display: none;
}

.schedule-drafts:not(:empty) {
  margin-top: 12px;
}

.schedule-mid-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.schedule-mid-actions .btn-secondary {
  background: #fff;
  border: 1px solid #d0d7e2;
  color: var(--text);
  padding: 8px 14px;
  font-weight: 500;
  border-radius: 8px;
}

.schedule-interval-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 16px;
  font-size: 0.95rem;
  color: var(--text);
}

.schedule-interval-row input {
  width: 72px;
  padding: 8px 10px;
  border: 1px solid #d0d7e2;
  border-radius: 8px;
  background: #fff;
  font-size: 0.95rem;
}

.schedule-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.btn-start,
.btn-stop {
  border: none;
  color: #fff;
  font-weight: 650;
  font-size: 0.95rem;
  padding: 10px 22px;
  border-radius: 8px;
  cursor: pointer;
}

.btn-start {
  background: #22c55e;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);
}

.btn-start:hover {
  background: #16a34a;
}

.btn-stop {
  background: #ef4444;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.btn-stop:hover {
  background: #dc2626;
}

.schedule-controls .btn-secondary {
  background: #fff;
  border: 1px solid #d0d7e2;
  color: var(--text);
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 500;
}

.schedule-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.btn-link-refresh {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 6px;
}

.btn-link-refresh:hover {
  color: var(--primary);
}

.schedule-draft {
  background: #fff;
  border: 1px solid #d0d7e2;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.schedule-draft textarea,
.schedule-draft input {
  width: 100%;
  border: 1px solid #d0d7e2;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
}

.schedule-draft textarea {
  min-height: 64px;
  resize: vertical;
}

.schedule-draft-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.schedule-draft-remove {
  background: transparent;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 4px;
}

.schedule-alert {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(231, 76, 60, 0.45);
  background: rgba(231, 76, 60, 0.1);
  color: var(--danger);
  font-size: 0.9rem;
  line-height: 1.4;
  white-space: pre-wrap;
}

.schedule-alert.hidden {
  display: none;
}

.queue-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}

.queue-item.is-rejected {
  border-color: rgba(231, 76, 60, 0.4);
  background: rgba(231, 76, 60, 0.06);
}

.queue-reject-reason {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--danger);
  line-height: 1.35;
}

.queue-item.is-running {
  border-color: rgba(24, 119, 242, 0.45);
  background: rgba(24, 119, 242, 0.06);
}

.queue-item-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.88rem;
}

.queue-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #e8ecf3;
  color: var(--muted);
}

.queue-badge.queue-next {
  background: rgba(24, 119, 242, 0.15);
  color: var(--primary);
}

.queue-badge.queue-running {
  background: rgba(49, 162, 76, 0.15);
  color: var(--success);
}

.queue-meta {
  color: var(--muted);
}

.queue-time {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.82rem;
}

.queue-text {
  font-size: 0.92rem;
  margin-bottom: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}

.queue-progress {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.queue-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.group-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.group-profiles {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.group-profiles-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.group-avatar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 16px;
  align-items: flex-start;
}

.group-avatar {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 76px;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.group-avatar-ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, #5ec8d8, #3aa8c0);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(90, 190, 210, 0.45);
}

.group-avatar.ok .group-avatar-ring {
  background: linear-gradient(135deg, #5ec8d8, #2bbbad);
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(49, 162, 76, 0.35);
}

.group-avatar.bad .group-avatar-ring {
  background: linear-gradient(135deg, #f07178, #e74c3c);
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(231, 76, 60, 0.35);
}

.group-avatar.offline .group-avatar-ring {
  background: linear-gradient(135deg, #c5cad6, #9aa3b2);
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(140, 140, 160, 0.3);
  opacity: 0.85;
}

.group-avatar-face {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: hsl(var(--av-hue, 200) 42% 42%);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
  border: 2px solid #fff;
}

.group-avatar-badge {
  position: absolute;
  top: -2px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  z-index: 1;
}

.group-avatar.ok .group-avatar-badge {
  background: #31a24c;
}

.group-avatar.bad .group-avatar-badge {
  background: #e74c3c;
}

.group-avatar-name {
  font-size: 0.72rem;
  color: var(--text);
  font-weight: 550;
  max-width: 76px;
  line-height: 1.25;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.group-avatar.no-name .group-avatar-name {
  color: var(--muted);
  font-style: italic;
  font-weight: 400;
}

.group-profile-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.group-profile-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.accounts-grid-nested {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.accounts-orphan-wrap {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.accounts-orphan-wrap h3 {
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.accounts-count-inline {
  color: var(--muted);
  font-size: 0.85rem;
  align-self: center;
}

.accounts-add-bar {
  margin-bottom: 14px;
  align-items: center;
}

.sheet-mode-banner {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(217, 119, 6, 0.1);
  border: 1px solid rgba(217, 119, 6, 0.35);
  color: #9a6700;
  font-size: 0.9rem;
}

.sheet-mode-banner.hidden {
  display: none !important;
}

.manual-schedule-at input {
  margin-top: 4px;
  min-width: 180px;
}

.group-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.group-delete-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.group-card-title {
  min-width: 0;
}

.group-card-title strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.group-card-title small {
  color: var(--muted);
  display: block;
  word-break: break-all;
  font-size: 0.75rem;
}

.group-item-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.group-posters-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.group-roles-panel {
  margin-top: 0;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 8px;
  flex: 1;
}

.group-role-row {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 8px;
  align-items: start;
}

.group-role-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted);
  padding-top: 4px;
}

.group-role-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.group-role-empty {
  color: var(--muted);
  font-size: 0.82rem;
}

.hist-chip.role-admin {
  border-color: rgba(49, 162, 76, 0.45);
  color: #1f7a3a;
}

.hist-chip.role-mod {
  border-color: rgba(240, 173, 78, 0.45);
  color: #9a6700;
}

.hist-chip.role-post {
  border-color: rgba(24, 119, 242, 0.45);
  color: #166fe0;
}

.group-posters-picker {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.group-poster-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 8px;
}

.group-poster-item {
  font-size: 0.85rem;
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.btn-sm {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 4px 10px;
  font-size: 0.8rem;
  border-radius: 6px;
}

.btn-sm:hover { border-color: var(--danger); color: var(--danger); background: transparent; }

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-secondary:hover { border-color: var(--primary); color: var(--primary); background: transparent; }

.btn-danger {
  background: rgba(231, 76, 60, 0.12);
  border: 1px solid rgba(231, 76, 60, 0.45);
  color: var(--danger);
}

.btn-danger:hover {
  background: rgba(231, 76, 60, 0.22);
  border-color: var(--danger);
  color: #fff;
}

.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.profiles-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  width: 100%;
}

.profiles-card {
  border-color: rgba(24, 119, 242, 0.28);
  background: linear-gradient(180deg, rgba(24, 119, 242, 0.05), transparent);
}

.profiles-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 4px;
}

.profiles-card-head h2 {
  margin-bottom: 4px;
}

.profiles-card-head .hint {
  margin-bottom: 0;
}

.profiles-card .account-card {
  background: #fff;
  border: 1.5px solid #c5cad6;
  border-radius: 12px;
  padding: 14px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 100%;
}

.profiles-card .account-card .post-actions {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.profiles-card .account-card .posts-stat span {
  background: #f5f7fb;
}

.group-role-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.account-card {
  background: var(--bg);
  border: 1.5px solid #c5cad6;
  border-radius: 8px;
  padding: 12px;
  font-size: 0.85rem;
}

.account-card .name { font-weight: 600; margin-bottom: 6px; }

.account-card .meta { color: var(--muted); font-size: 0.78rem; line-height: 1.5; }

.account-status {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.account-status-active { background: rgba(49,162,76,0.15); color: var(--success); }
.account-status-cooldown { background: rgba(240,173,78,0.15); color: var(--warn); }
.account-status-sus { background: rgba(255,140,0,0.22); color: #ff9800; font-weight: 700; }
.account-status-disabled { background: rgba(231,76,60,0.2); color: #ff6b6b; }
.account-status-offline { background: rgba(140,140,160,0.2); color: var(--muted); }

.account-card.disabled {
  border-color: #e74c3c;
  background: rgba(231, 76, 60, 0.08);
  box-shadow: inset 0 0 0 1px rgba(231, 76, 60, 0.35);
}

.account-card .posts-stat {
  display: flex;
  gap: 10px;
  margin: 8px 0 4px;
  flex-wrap: wrap;
}

.account-card .posts-stat span {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.75rem;
}

.account-card .posts-stat strong {
  color: var(--text);
  font-weight: 700;
}

.account-card .error-line {
  color: #ff6b6b;
  font-size: 0.72rem;
  margin-top: 6px;
  line-height: 1.35;
}

.closed-alert {
  background: rgba(231, 76, 60, 0.08);
  border: 1px solid rgba(231, 76, 60, 0.35);
  color: #c0392b;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 10px 0 14px;
  font-size: 0.9rem;
  font-weight: 600;
}

.closed-alert.hidden { display: none; }

.auto-card {
  border-color: var(--primary);
  background: linear-gradient(135deg, #f7faff 0%, #eef4fc 100%);
}

.auto-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.auto-row .schedule-label { flex: 1; min-width: 120px; }

.auto-toggle {
  padding-bottom: 12px;
  color: var(--text);
}

.auto-status {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
}

.auto-status strong { color: var(--text); }

.live-activity {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.live-now,
.live-last {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.45;
  background: var(--bg);
  border: 1px solid transparent;
}

.live-now.active {
  border-color: rgba(49, 162, 76, 0.45);
  background: rgba(49, 162, 76, 0.1);
}

.live-last.ok {
  border-color: rgba(49, 162, 76, 0.3);
}

.live-last.fail {
  border-color: rgba(231, 76, 60, 0.35);
  background: rgba(231, 76, 60, 0.08);
}

.live-label {
  font-weight: 700;
  margin-right: 8px;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.live-groups-panel {
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid rgba(49, 162, 76, 0.25);
}

.live-groups-panel.hidden {
  display: none;
}

.live-groups-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.live-groups-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.live-group-item {
  display: grid;
  grid-template-columns: 1.4em 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 0.88rem;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
}

.live-group-item.status-running {
  background: rgba(49, 162, 76, 0.12);
  border: 1px solid rgba(49, 162, 76, 0.3);
}

.live-group-item.status-done {
  opacity: 0.85;
}

.live-group-item.status-failed {
  background: rgba(231, 76, 60, 0.1);
}

.live-group-name {
  font-weight: 600;
  color: var(--text);
}

.live-group-meta {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: right;
}
  display: inline-block;
  min-width: 72px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.hint-block {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

.hint-block code {
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
}

.row-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.control-btns { margin-top: 4px; }

.hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 14px;
}

.sheet-panel {
  border-color: rgba(49, 162, 76, 0.35);
  background: linear-gradient(180deg, rgba(49,162,76,0.06), transparent);
}

.source-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
  flex-wrap: wrap;
}

.source-tab {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}

.source-tab.active {
  background: rgba(49, 162, 76, 0.2);
  border-color: rgba(49, 162, 76, 0.55);
  color: var(--text);
}

#manualTableBody input,
#manualTableBody textarea {
  width: 100%;
  min-width: 120px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 6px 8px;
  font: inherit;
  font-size: 0.82rem;
  resize: vertical;
}

#manualTableBody textarea {
  min-height: 52px;
}

.manual-image-cell {
  min-width: 180px;
}

.manual-image-cell .manual-file-label {
  display: block;
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--muted);
}

.manual-image-cell .manual-file-label input[type="file"] {
  display: none;
}

.manual-image-cell .manual-file-label span {
  display: inline-block;
  padding: 6px 10px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-image-cell .manual-file-label:hover span {
  border-color: var(--primary);
  color: var(--text);
}

.manual-row-done input,
.manual-row-done textarea {
  opacity: 0.55;
}

.apps-script-help {
  margin: 12px 0;
  padding: 12px 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
}

.apps-script-help summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
}

.help-steps {
  margin: 10px 0 8px 18px;
  color: var(--muted);
}

.help-steps li { margin-bottom: 6px; }

.sheet-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.sheet-summary.hidden { display: none; }

.sheet-stat {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.85rem;
}

.sheet-stat strong { display: block; font-size: 1.2rem; margin-bottom: 2px; }

.sheet-stat-done strong { color: var(--success); }
.sheet-stat-queued strong { color: var(--primary); }
.sheet-stat-new strong { color: var(--warn); }
.sheet-stat-deleted strong { color: var(--muted); }
.sheet-stat-failed strong { color: var(--danger); }

.sync-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.sync-done { background: rgba(49,162,76,0.15); color: var(--success); }
.sync-queued { background: rgba(24,119,242,0.15); color: var(--primary); }
.sync-new { background: rgba(240,173,78,0.15); color: var(--warn); }
.sync-deleted { background: rgba(139,147,167,0.15); color: var(--muted); }
.sync-failed { background: rgba(231,76,60,0.15); color: var(--danger); }

.sheet-editor {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--primary);
  border-radius: 8px;
}

.sheet-editor.hidden { display: none; }

.sheet-editor h3 { margin: 0 0 8px; font-size: 1rem; }

.sheet-editor-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

.sheet-editor textarea,
.sheet-editor input[readonly] {
  width: 100%;
  margin-bottom: 10px;
  background: #12151c;
  opacity: 0.95;
}

.btn-post-row {
  background: rgba(24, 119, 242, 0.15);
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 4px 10px;
  font-size: 0.78rem;
  border-radius: 6px;
  cursor: pointer;
}

.btn-post-row:hover { background: var(--primary); color: #fff; }

.btn-post-row:disabled { opacity: 0.4; cursor: not-allowed; }

.sheet-preview {
  margin-top: 16px;
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  overflow-x: auto;
  max-height: 480px;
  overflow-y: auto;
}

.sheet-preview.hidden { display: none; }

.sheet-preview table,
.sheet-full-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 0.82rem;
  min-width: 640px;
}

.sheet-preview th,
.sheet-preview td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  max-width: 220px;
  word-break: break-word;
}

.sheet-preview th {
  color: var(--muted);
  font-weight: 600;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
}

.sheet-row-done {
  opacity: 0.55;
}

.posts { display: flex; flex-direction: column; gap: 12px; }

.post-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}

.post-item .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.status {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
}

.status-pending { background: rgba(240,173,78,0.15); color: var(--warn); }
.status-processing { background: rgba(24,119,242,0.15); color: var(--primary); }
.status-done { background: rgba(49,162,76,0.15); color: var(--success); }
.status-failed { background: rgba(231,76,60,0.15); color: var(--danger); }
.status-partial { background: rgba(240,173,78,0.15); color: var(--warn); }

.post-text {
  font-size: 0.9rem;
  white-space: pre-wrap;
  margin-bottom: 8px;
}

.post-groups { font-size: 0.8rem; color: var(--muted); }

.hist-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.hist-flag {
  font-size: 0.75rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
}

.hist-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hist-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.hist-chip {
  font-size: 0.78rem;
  border-radius: 6px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.hist-profile { color: #7eb6ff; }
.hist-group { color: #b8a0ff; }
.hist-status { font-weight: 600; }
.hist-time { color: #9ad7b0; }
.hist-row .muted,
.hist-chip.muted { color: var(--muted); opacity: 0.8; }

.hist-error {
  width: 100%;
  font-size: 0.75rem;
  color: var(--danger);
  margin-top: 2px;
}

.history-schedule-wrap {
  margin-top: 4px;
}

.history-schedule-table .hist-sched-text {
  max-width: 360px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.88rem;
  line-height: 1.4;
}

.history-schedule-table .hist-sched-url a {
  color: var(--primary);
  font-size: 0.82rem;
  word-break: break-all;
}

.hist-sched-status {
  display: inline-block;
  min-width: 72px;
  text-align: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: lowercase;
}

.hist-sched-status.is-done {
  background: rgba(34, 197, 94, 0.15);
  color: #15803d;
}

.hist-sched-status.is-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

.hist-sched-status.is-rejected {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
}

.hist-sched-status.is-processing {
  background: rgba(59, 130, 246, 0.15);
  color: #1d4ed8;
}

.hist-sched-status.is-partial {
  background: rgba(168, 85, 247, 0.15);
  color: #7c3aed;
}

.post-actions { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }

.btn-disconnect {
  border-color: rgba(231, 76, 60, 0.45) !important;
  color: var(--danger) !important;
}

.btn-disconnect:hover {
  background: rgba(231, 76, 60, 0.12) !important;
  border-color: var(--danger) !important;
}

.help {
  margin-top: 0;
}

.help h3 { margin-bottom: 12px; font-size: 0.95rem; }
.help ol { padding-left: 20px; color: var(--muted); font-size: 0.9rem; }
.help ol li { margin-bottom: 6px; }
.help code {
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
}
.help .warn {
  margin-top: 14px;
  padding: 12px;
  background: rgba(240,173,78,0.08);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--warn);
}

/* ===== New post (instant) composer ===== */
.new-post-card {
  max-width: 720px;
  padding: 22px 24px 28px;
}

.new-post-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.new-post-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.new-post-title h1 {
  font-size: 1.15rem;
  font-weight: 650;
  margin: 0;
}

.np-soft {
  color: var(--muted);
  font-weight: 500;
}

.np-groups-badge {
  color: var(--muted);
  font-size: 0.88rem;
}

.np-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
}

.np-ico svg {
  width: 16px;
  height: 16px;
}

.np-ico-edit {
  background: rgba(24, 119, 242, 0.12);
  color: #1877f2;
}

.np-ico-text {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}

.np-ico-image {
  background: rgba(249, 115, 22, 0.12);
  color: #f97316;
}

.np-ico-comment {
  background: rgba(20, 184, 166, 0.14);
  color: #0d9488;
}

.np-ico-link {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.np-ico-link svg {
  width: 14px;
  height: 14px;
}

.new-post-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.np-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.np-section-label.np-sub {
  margin-top: 4px;
  font-weight: 550;
  font-size: 0.9rem;
}

.np-hint-inline {
  margin-left: 4px;
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--muted);
}

.new-post-form textarea,
.new-post-form input[type="url"],
.new-post-form input[type="datetime-local"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  background: #fff;
  resize: vertical;
}

.new-post-form textarea:focus,
.new-post-form input:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.12);
}

.np-field-label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.np-dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 88px;
  border: 1.5px dashed #c5cad6;
  border-radius: 12px;
  background: #f7f8fb;
  color: var(--muted);
  font-size: 0.92rem;
  cursor: pointer;
  padding: 16px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.np-dropzone:hover,
.np-dropzone.dragover {
  border-color: #93c5fd;
  background: rgba(24, 119, 242, 0.04);
  color: var(--text);
}

.np-or {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 10px 0;
}

.np-comment-box {
  background: rgba(20, 184, 166, 0.06);
  border: 1px solid rgba(20, 184, 166, 0.22);
  border-radius: 12px;
  padding: 14px 14px 16px;
}

.np-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.np-btn-post {
  background: var(--success) !important;
  border-color: var(--success) !important;
}

.np-btn-post:hover {
  filter: brightness(0.95);
}

.np-schedule-at {
  margin-top: 4px;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 100;
  transition: opacity 0.3s;
}
.toast.hidden { opacity: 0; pointer-events: none; }

.vnc-panel {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.vnc-panel.hidden { display: none; }
.vnc-panel-inner {
  width: min(1200px, 100%);
  height: min(90vh, 900px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  position: relative;
}
.vnc-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.vnc-panel-head h3 { margin: 0; font-size: 1.05rem; }
.vnc-close {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
}
.vnc-close:hover { color: var(--text); }
.vnc-panel-msg { margin: 0; font-size: 0.9rem; color: var(--muted); }
.vnc-frame {
  flex: 1;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #000;
  min-height: 420px;
}
.vnc-hint { margin: 0; font-size: 0.82rem; color: var(--muted); }

.empty { color: var(--muted); font-size: 0.9rem; padding: 12px 0; }

@media (max-width: 768px) {
  .grid { grid-template-columns: 1fr; }
}
