/* Instagram Auto Poster - Modern SaaS style */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Surfaces */
  --bg: #f1f5f9;
  --bg-elevated: #ffffff;
  --sidebar-bg: #ffffff;
  --sidebar-bg-hover: #eff6ff;
  --sidebar-bg-active: #dbeafe;
  --sidebar-border: #dbe3ef;

  /* Text */
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --sidebar-text: #64748b;
  --sidebar-text-active: #2563eb;

  /* Brand & Actions */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-muted: rgba(99, 102, 241, 0.12);
  --border: #e2e8f0;
  --border-focus: #6366f1;

  /* Semantic */
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-muted: #fef2f2;
  --success: #22c55e;
  --success-muted: #f0fdf4;
  --warn: #f59e0b;
  --warn-muted: #fffbeb;
  --info: #3b82f6;
  --info-muted: #eff6ff;

  /* Effects */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --transition: 0.15s ease;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ----- Layout ----- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 82px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: visible;
  border-right: 1px solid var(--sidebar-border);
  box-shadow: 8px 0 24px rgba(15, 23, 42, 0.06);
  z-index: 30;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4.25rem;
  padding: 0;
  font-weight: 700;
  font-size: 0;
  letter-spacing: -0.02em;
  color: var(--sidebar-text-active);
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar-brand::before {
  content: 'AP';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #ef4444, #2563eb);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.22);
}

.sidebar-tenant {
  display: flex;
  justify-content: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
  background: #f8fafc;
}

.sidebar-tenant-label {
  display: none;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.35rem;
}

.sidebar-tenant-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}

.sidebar-tenant-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 14px;
  background: #e0f2fe;
  color: #0ea5e9;
  flex-shrink: 0;
}

.sidebar-tenant-icon svg {
  width: 18px;
  height: 18px;
}

.sidebar-tenant-current .sidebar-tenant-name {
  display: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--sidebar-text-active);
  flex: 1;
  min-width: 0;
  line-height: 1.4;
}

.sidebar-tenant-badge {
  display: none;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
  white-space: nowrap;
}

.sidebar-tenant-switch {
  display: none;
  margin-top: 0.75rem;
  padding: 0.5rem 0;
  font-size: 0.8rem;
  color: #a5b4fc;
  text-decoration: none;
  border-top: 1px solid var(--sidebar-border);
  transition: color var(--transition);
}

.sidebar-tenant-switch:hover {
  color: var(--sidebar-text-active);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 0;
  flex: 1;
  min-height: 0;
  overflow: visible;
}

.sidebar-nav a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 2.85rem;
  min-height: 2.85rem;
  padding: 0;
  margin: 0.18rem auto;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 14px;
  transition: background var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.sidebar-nav a:hover {
  background: var(--sidebar-bg-hover);
  color: var(--sidebar-text-active);
  transform: translateY(-1px);
  box-shadow: 0 8px 14px rgba(37, 99, 235, 0.12);
}

.sidebar-nav a.active {
  background: var(--sidebar-bg-active);
  color: var(--sidebar-text-active);
  font-weight: 700;
  border-left: 0;
  margin-left: auto;
  padding-left: 0;
  box-shadow: inset 0 -3px 0 rgba(37, 99, 235, 0.24), 0 8px 14px rgba(37, 99, 235, 0.12);
}

.sidebar-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3rem;
  height: 1.3rem;
  flex: 0 0 1.3rem;
  color: currentColor;
}

.sidebar-nav-icon svg {
  width: 1.2rem;
  height: 1.2rem;
}

.sidebar-nav-text {
  position: absolute;
  left: calc(100% + 0.55rem);
  top: 50%;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  min-width: max-content;
  min-height: 2.15rem;
  padding: 0.42rem 0.72rem;
  overflow: hidden;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-0.45rem, -50%);
  transition: opacity var(--transition), visibility var(--transition), transform var(--transition);
}

.sidebar-nav a:hover > .sidebar-nav-text,
.sidebar-nav a:focus-visible > .sidebar-nav-text,
.sidebar-nav-group-label:hover > .sidebar-nav-text,
.sidebar-nav-group-label:focus-visible > .sidebar-nav-text,
.sidebar-admin-section a:hover > .sidebar-nav-text,
.sidebar-admin-section a:focus-visible > .sidebar-nav-text,
.sidebar-footer a:hover > .sidebar-nav-text,
.sidebar-footer a:focus-visible > .sidebar-nav-text {
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%);
}

/* 顧客管理＋SNS接続のサブメニュー */
.sidebar-nav-group {
  margin: 0.18rem 0;
  border-radius: 14px;
  overflow: visible;
}

.sidebar-nav-group-label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 2.85rem;
  min-height: 2.85rem;
  padding: 0;
  margin: 0 auto;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 14px;
  transition: background var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
  font-weight: 500;
}

.sidebar-nav-group-label:hover {
  background: var(--sidebar-bg-hover);
  color: var(--sidebar-text-active);
  transform: translateY(-1px);
  box-shadow: 0 8px 14px rgba(37, 99, 235, 0.12);
}

.sidebar-nav-group-label.active,
.sidebar-nav-group.is-open .sidebar-nav-group-label {
  background: var(--sidebar-bg-active);
  color: var(--sidebar-text-active);
}

.sidebar-nav-group-label.active {
  border-left: 0;
  padding-left: 0;
}

.sidebar-nav-sub {
  list-style: none;
  margin: 0;
  padding: 0.1rem 0 0.25rem;
  border-left: 0;
}

.sidebar-nav-sub li {
  margin: 0;
}

.sidebar-nav-sub a {
  display: flex;
  align-items: center;
  gap: 0;
  width: 2.35rem;
  min-height: 2.35rem;
  padding: 0;
  margin: 0.12rem auto;
  font-size: 0.9rem;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 12px;
  transition: background var(--transition), color var(--transition);
}

.sidebar-nav-sub a:hover {
  background: var(--sidebar-bg-hover);
  color: var(--sidebar-text-active);
}

.sidebar-nav-sub a.active {
  background: var(--sidebar-bg-active);
  color: var(--sidebar-text-active);
  font-weight: 500;
  border-left: 0;
  margin-left: auto;
  padding-left: 0;
}

/* アコーディオングループ：サブメニューは is-open のときのみ表示 */
.sidebar-nav-group--toggle .sidebar-nav-sub {
  display: none;
}

.sidebar-nav-group--toggle.is-open .sidebar-nav-sub {
  display: block;
}

/* ボタンをリンクと同じ見た目にリセット */
button.sidebar-nav-group-label {
  width: 2.85rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

/* シェブロン（▾）アイコン */
.sidebar-nav-group-toggle::after {
  display: none;
}

.sidebar-nav-group--toggle.is-open .sidebar-nav-group-toggle::after {
  transform: rotate(-135deg) translateY(-2px);
}

.sidebar-footer {
  margin-top: auto;
  align-items: center;
  padding: 0.75rem 0;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-footer-email {
  display: none;
}

.sidebar-footer a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 2.85rem;
  min-height: 2.85rem;
  padding: 0;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.85rem;
  border-radius: 14px;
  opacity: 1;
  transition: background var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.sidebar-footer a:hover {
  background: var(--sidebar-bg-hover);
  color: var(--sidebar-text-active);
  transform: translateY(-1px);
  box-shadow: 0 8px 14px rgba(37, 99, 235, 0.12);
}

.sidebar-admin-section {
  margin: auto 0 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--sidebar-border);
}

.sidebar-admin-section-label {
  display: none;
}

.sidebar-admin-section a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 2.85rem;
  min-height: 2.85rem;
  padding: 0;
  margin: 0.18rem auto;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 14px;
  transition: background var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.sidebar-admin-section a:hover {
  background: var(--sidebar-bg-hover);
  color: var(--sidebar-text-active);
  transform: translateY(-1px);
  box-shadow: 0 8px 14px rgba(37, 99, 235, 0.12);
}

.sidebar-admin-section a.active {
  background: var(--sidebar-bg-active);
  color: var(--sidebar-text-active);
  font-weight: 500;
  border-left: 0;
  padding-left: 0;
}

.main {
  flex: 1;
  padding: 1.75rem 2rem;
  overflow: auto;
}

.page-title {
  margin: 0 0 1.5rem;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* ----- Mobile navigation (hamburger) ----- */
.mobile-topbar,
.sidebar-backdrop {
  display: none;
}

@media (max-width: 767px) {
  body.sidebar-nav-open {
    overflow: hidden;
  }

  .mobile-topbar {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 220;
    height: 3.25rem;
    padding: 0 0.85rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
  }

  .mobile-topbar-title {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-toggle:hover {
    background: var(--primary-muted);
    color: var(--primary);
  }

  .mobile-nav-toggle-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: 5px;
    width: 1.125rem;
  }

  .mobile-nav-toggle-line {
    display: block;
    height: 2px;
    border-radius: 1px;
    background: currentColor;
    transition: transform 0.2s ease, opacity 0.2s ease;
    transform-origin: center;
  }

  .app.sidebar-open .mobile-nav-toggle-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .app.sidebar-open .mobile-nav-toggle-line:nth-child(2) {
    opacity: 0;
  }

  .app.sidebar-open .mobile-nav-toggle-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* 接続管理・接続方法は PC 想定のためスマホでは非表示 */
  .sidebar-nav-group--desktop-only {
    display: none !important;
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }

  .app.sidebar-open .sidebar-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .app .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(280px, 88vw);
    height: 100vh;
    height: 100dvh;
    z-index: 210;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: none;
  }

  .app.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.22);
  }

  .main {
    padding: calc(3.25rem + 1rem) 1.25rem 1.5rem;
  }

  .page-title {
    font-size: 1.15rem;
  }
}

@media (max-width: 991px) {
  body.sidebar-nav-open {
    overflow: auto;
  }

  .mobile-topbar,
  .sidebar-backdrop {
    display: none !important;
  }

  .app {
    display: flex;
    min-height: 100vh;
  }

  .app .sidebar {
    position: sticky;
    top: 0;
    left: auto;
    bottom: auto;
    width: 72px;
    height: 100vh;
    height: 100dvh;
    z-index: 30;
    transform: none !important;
    overflow: visible;
    box-shadow: none !important;
    transition: width var(--transition);
  }

  .app.sidebar-open .sidebar {
    transform: none !important;
    box-shadow: none !important;
  }

  .sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 4.25rem;
    padding: 0;
    font-size: 0;
  }

  .sidebar-brand::before {
    content: 'AP';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0;
  }

  .sidebar-tenant {
    display: flex;
    justify-content: center;
    padding: 0.75rem 0;
  }

  .sidebar-tenant-label,
  .sidebar-tenant-name,
  .sidebar-tenant-badge,
  .sidebar-tenant-switch {
    display: none !important;
  }

  .sidebar-tenant-row {
    justify-content: center;
    gap: 0;
  }

  .sidebar-tenant-icon {
    width: 2.25rem;
    height: 2.25rem;
  }

  .sidebar-nav {
    padding: 0.65rem 0;
  }

  .sidebar-nav a,
  .sidebar-nav-group-label,
  .sidebar-admin-section a,
  .sidebar-footer a {
    justify-content: center;
    gap: 0;
    width: 2.75rem;
    min-height: 2.75rem;
    padding: 0;
    margin: 0.15rem auto;
    border-radius: 12px;
  }

  .sidebar-nav a.active,
  .sidebar-nav-sub a.active,
  .sidebar-admin-section a.active {
    border-left: 0;
    margin-left: auto;
    padding-left: 0;
    box-shadow: inset 3px 0 0 var(--primary);
  }

  .sidebar-admin-section-label,
  .sidebar-footer-email,
  .sidebar-nav-group-toggle::after {
    display: none !important;
  }

  .sidebar-nav-icon {
    width: 1.3rem;
    height: 1.3rem;
    flex-basis: 1.3rem;
  }

  .sidebar-nav-icon svg {
    width: 1.2rem;
    height: 1.2rem;
  }

  .sidebar-nav-group {
    margin: 0.15rem 0;
  }

  .sidebar-nav-group--desktop-only {
    display: block !important;
  }

  .sidebar-nav-sub {
    margin: 0;
    padding: 0.1rem 0 0.2rem;
    border-left: 0;
  }

  .sidebar-nav-sub a {
    width: 2.35rem;
    min-height: 2.35rem;
    padding: 0;
    margin: 0.12rem auto;
  }

  .sidebar-nav-sub .sidebar-nav-icon {
    width: 1.05rem;
    height: 1.05rem;
    flex-basis: 1.05rem;
  }

  .sidebar-nav-sub .sidebar-nav-icon svg {
    width: 1rem;
    height: 1rem;
  }

  .sidebar-admin-section {
    margin: auto 0 0;
    padding-top: 0.45rem;
  }

  .sidebar-footer {
    align-items: center;
    padding: 0.75rem 0;
  }

  .main {
    min-width: 0;
    padding: 1.25rem 1.25rem 1.5rem;
  }

  .page-title {
    font-size: 1.2rem;
  }
}

.sidebar-nav a:hover,
.sidebar-nav a:focus-visible,
.sidebar-nav-group-label:hover,
.sidebar-nav-group-label:focus-visible,
.sidebar-admin-section a:hover,
.sidebar-admin-section a:focus-visible,
.sidebar-footer a:hover,
.sidebar-footer a:focus-visible {
  z-index: 90;
  justify-content: center;
  gap: 0;
  background: #dff1ff;
  color: #2563eb;
  transform: translateY(-1px);
  box-shadow:
    0 8px 16px rgba(96, 165, 250, 0.26),
    inset 0 -2px 0 rgba(96, 165, 250, 0.18);
}

.sidebar-nav a:hover > .sidebar-nav-icon,
.sidebar-nav a:focus-visible > .sidebar-nav-icon,
.sidebar-nav-group-label:hover > .sidebar-nav-icon,
.sidebar-nav-group-label:focus-visible > .sidebar-nav-icon,
.sidebar-admin-section a:hover > .sidebar-nav-icon,
.sidebar-admin-section a:focus-visible > .sidebar-nav-icon,
.sidebar-footer a:hover > .sidebar-nav-icon,
.sidebar-footer a:focus-visible > .sidebar-nav-icon {
  color: #2563eb;
}

.sidebar-nav a:hover > .sidebar-nav-text,
.sidebar-nav a:focus-visible > .sidebar-nav-text,
.sidebar-nav-group-label:hover > .sidebar-nav-text,
.sidebar-nav-group-label:focus-visible > .sidebar-nav-text,
.sidebar-admin-section a:hover > .sidebar-nav-text,
.sidebar-admin-section a:focus-visible > .sidebar-nav-text,
.sidebar-footer a:hover > .sidebar-nav-text,
.sidebar-footer a:focus-visible > .sidebar-nav-text {
  display: inline-flex;
  min-width: max-content;
  min-height: 2.15rem;
  padding: 0.42rem 0.72rem;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.1;
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%);
}

/* ----- Cards ----- */
.dashboard-switch-home {
  position: relative;
  overflow: hidden;
  margin-bottom: 1rem;
  padding: 1.45rem 2rem 1.15rem;
  border: 1px solid #d7dde7;
  border-radius: 22px;
  background: #f7f7f8;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.dashboard-switch-selected {
  margin: 0 0 0.7rem;
  min-height: 4.1rem;
}

.dashboard-switch-selected span {
  display: block;
  color: #2563eb;
  font-weight: 700;
  font-size: 0.9rem;
}

.dashboard-switch-selected strong {
  display: block;
  margin-top: 0.25rem;
  color: #111827;
  font-size: 1.35rem;
  line-height: 1.25;
}

.dashboard-switch-selected p {
  max-width: 48rem;
  margin: 0.3rem 0 0;
  color: #64748b;
  font-size: 0.86rem;
}

.dashboard-switch-carousel {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.35rem 0.25rem 1.25rem 0;
  scroll-snap-type: x proximity;
}

.dashboard-switch-carousel::-webkit-scrollbar {
  height: 0.45rem;
}

.dashboard-switch-carousel::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 999px;
}

.dashboard-switch-tile {
  position: relative;
  display: grid;
  flex: 0 0 clamp(13.5rem, 16vw, 22rem);
  grid-template-rows: minmax(clamp(7.2rem, 10.5vw, 14rem), auto) auto;
  overflow: visible;
  border: 3px solid transparent;
  border-radius: 16px;
  background: #ffffff;
  color: #111827;
  text-decoration: none;
  scroll-snap-align: start;
  box-shadow: 0 7px 18px rgba(15, 23, 42, 0.1);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.dashboard-switch-tile:hover,
.dashboard-switch-tile:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(147, 197, 253, 0.92);
  box-shadow:
    0 0 0 4px rgba(96, 165, 250, 0.16),
    0 0 22px rgba(96, 165, 250, 0.34),
    0 15px 28px rgba(15, 23, 42, 0.16);
}

.dashboard-switch-tile.is-selected {
  border-color: transparent;
  box-shadow: 0 7px 18px rgba(15, 23, 42, 0.1);
}

.dashboard-switch-tile__art {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.66), transparent 30%),
    linear-gradient(135deg, var(--tile-a), var(--tile-b));
}

.dashboard-switch-tile__art::before,
.dashboard-switch-tile__art::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
}

.dashboard-switch-tile__art::before {
  width: clamp(5.4rem, 6.5vw, 8.5rem);
  height: clamp(5.4rem, 6.5vw, 8.5rem);
  left: clamp(-2.4rem, -1.6vw, -1.6rem);
  bottom: clamp(-2.8rem, -1.8vw, -1.8rem);
}

.dashboard-switch-tile__art::after {
  width: clamp(3.4rem, 4.4vw, 5.8rem);
  height: clamp(3.4rem, 4.4vw, 5.8rem);
  right: clamp(-1.3rem, -0.8vw, -0.8rem);
  top: clamp(-1.4rem, -0.9vw, -0.9rem);
}

.dashboard-switch-tile__art strong {
  position: relative;
  z-index: 1;
  color: #ffffff;
  font-size: clamp(2.4rem, 3.4vw, 4.4rem);
  font-weight: 900;
  text-shadow: 0 3px 12px rgba(15, 23, 42, 0.28);
}

.dashboard-switch-tile__text {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
  padding: clamp(0.65rem, 0.82vw, 1rem) clamp(0.75rem, 0.95vw, 1.15rem) clamp(0.75rem, 1vw, 1.2rem);
}

.dashboard-switch-tile__text strong,
.dashboard-switch-tile__text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-switch-tile__text strong {
  color: #111827;
  font-size: clamp(0.92rem, 0.9vw, 1.15rem);
}

.dashboard-switch-tile__text small {
  color: #64748b;
  font-size: clamp(0.78rem, 0.78vw, 0.95rem);
}

.dashboard-switch-tile--red { --tile-a: #ef4444; --tile-b: #f97316; }
.dashboard-switch-tile--orange { --tile-a: #f97316; --tile-b: #facc15; }
.dashboard-switch-tile--blue { --tile-a: #0ea5e9; --tile-b: #2563eb; }
.dashboard-switch-tile--green { --tile-a: #14b8a6; --tile-b: #22c55e; }
.dashboard-switch-tile--purple { --tile-a: #8b5cf6; --tile-b: #ec4899; }

.dashboard-switch-dock {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 1.1rem;
  padding: 0.72rem 1.1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.dashboard-switch-dock a {
  display: inline-grid;
  place-items: center;
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 999px;
  border: 2px solid #e5e7eb;
  background: #ffffff;
  color: #64748b;
  text-decoration: none;
  font-weight: 900;
  transition: transform var(--transition), border-color var(--transition), color var(--transition);
}

.dashboard-switch-dock a:hover,
.dashboard-switch-dock a:focus {
  transform: translateY(-2px);
  border-color: #2563eb;
  color: #2563eb;
}

.dashboard-switch-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  color: #111827;
  font-size: 0.82rem;
  font-weight: 700;
}

.dashboard-command {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1rem;
  align-items: stretch;
  margin-bottom: 1rem;
}

.dashboard-command__main,
.dashboard-command__side,
.dashboard-panel,
.dashboard-action-card {
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.dashboard-command__main {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(239, 68, 68, 0.94), rgba(14, 165, 233, 0.92) 52%, rgba(250, 204, 21, 0.9)),
    #0f172a;
  color: #ffffff;
}

.dashboard-command__main::after {
  content: "";
  position: absolute;
  inset: 1.25rem 1.25rem auto auto;
  width: 186px;
  height: 118px;
  border-radius: 28px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  background:
    radial-gradient(circle at 74% 40%, rgba(255, 255, 255, 0.85) 0 8px, transparent 9px),
    radial-gradient(circle at 86% 58%, rgba(255, 255, 255, 0.7) 0 7px, transparent 8px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 20px 48px rgba(15, 23, 42, 0.16);
  transform: rotate(-5deg);
}

.dashboard-command__eyebrow,
.dashboard-panel__label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
  color: #0f172a;
  background: #ffffff;
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

.dashboard-command__main h2 {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0.8rem 0 0.5rem;
  font-size: 1.8rem;
  line-height: 1.18;
  letter-spacing: 0;
}

.dashboard-command__main p {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
}

.dashboard-command__meta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}

.dashboard-command__meta span {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.dashboard-command__actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.dashboard-command__side {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.7rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, #ffffff, #f8fafc);
  text-align: center;
}

.dashboard-rank-card {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #dbe3ef;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(250, 204, 21, 0.24), rgba(255, 255, 255, 0.94));
}

.dashboard-rank-card span,
.dashboard-rank-card small {
  display: block;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0;
}

.dashboard-rank-card strong {
  display: block;
  margin: 0.12rem 0;
  color: #ef4444;
  font-size: 2.4rem;
  line-height: 1;
}

.dashboard-command__side strong {
  display: block;
  font-size: 1rem;
}

.dashboard-command__side p {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.dashboard-health-meter {
  width: 112px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, var(--bg-elevated) 58%, transparent 59%),
    conic-gradient(#22c55e var(--score), #e2e8f0 0);
  box-shadow: 0 12px 26px rgba(34, 197, 94, 0.16);
}

.dashboard-health-meter span {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text);
}

.dashboard-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.dashboard-action-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 92px;
  padding: 1rem;
  border-radius: 18px;
  background: #ffffff;
  color: var(--text);
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition);
}

.dashboard-action-card::after {
  content: "";
  position: absolute;
  inset: auto -32px -42px auto;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: var(--tile-glow, rgba(99, 102, 241, 0.14));
  pointer-events: none;
}

.dashboard-action-card:hover,
.dashboard-action-card:focus {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.12);
  border-color: #cbd5e1;
}

.dashboard-action-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  flex: 0 0 auto;
  font-weight: 800;
  font-size: 1.05rem;
  color: #fff;
  box-shadow: inset 0 -3px 0 rgba(15, 23, 42, 0.18), 0 8px 14px rgba(15, 23, 42, 0.12);
}

.dashboard-action-card em {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--text-muted);
  font-style: normal;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0;
}

.dashboard-action-card strong {
  display: block;
  font-size: 0.98rem;
}

.dashboard-action-card small {
  display: block;
  margin-top: 0.2rem;
  color: var(--text-muted);
}

.dashboard-action-card--create { --tile-glow: rgba(239, 68, 68, 0.18); }
.dashboard-action-card--draft { --tile-glow: rgba(249, 115, 22, 0.2); }
.dashboard-action-card--queue { --tile-glow: rgba(14, 165, 233, 0.2); }
.dashboard-action-card--check { --tile-glow: rgba(20, 184, 166, 0.2); }
.dashboard-action-card--create .dashboard-action-card__icon { background: #ef4444; }
.dashboard-action-card--draft .dashboard-action-card__icon { background: #f97316; }
.dashboard-action-card--queue .dashboard-action-card__icon { background: #0ea5e9; }
.dashboard-action-card--check .dashboard-action-card__icon { background: #14b8a6; }

.dashboard-live-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.dashboard-panel {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border-radius: 18px;
  padding: 1.2rem;
}

.dashboard-panel__head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.dashboard-panel__head h2 {
  margin: 0.5rem 0 0;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.dashboard-next-post {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(255, 255, 255, 0.9));
  border: 1px solid #dbe3ef;
}

.dashboard-next-post strong,
.dashboard-next-post span {
  display: block;
}

.dashboard-next-post span {
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.dashboard-next-post time {
  flex: 0 0 auto;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0ea5e9;
}

.dashboard-upcoming-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.dashboard-upcoming-list li {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #edf2f7;
}

.dashboard-upcoming-list time {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.dashboard-upcoming-list a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-upcoming-list span {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.dashboard-empty-state {
  padding: 1.25rem;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius);
  background: #f8fafc;
}

.dashboard-empty-state p {
  margin: 0.3rem 0 0;
  color: var(--text-muted);
}

.dashboard-flow-bars {
  display: grid;
  gap: 1rem;
}

.dashboard-flow-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem 0.75rem;
  align-items: center;
}

.dashboard-flow-row span {
  color: var(--text-secondary);
  font-weight: 600;
}

.dashboard-flow-row strong {
  font-size: 1.1rem;
}

.dashboard-flow-row i {
  grid-column: 1 / -1;
  height: 9px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, #0ea5e9 var(--w), #e2e8f0 0);
}

.dashboard-flow-row:nth-child(2) i {
  background: linear-gradient(90deg, #f97316 var(--w), #e2e8f0 0);
}

.dashboard-flow-row--danger i {
  background: linear-gradient(90deg, #ef4444 var(--w), #e2e8f0 0);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

@media (max-width: 980px) {
  .dashboard-switch-selected {
    margin-left: 0;
  }

  .dashboard-switch-carousel {
    padding-left: 0.25rem;
  }

  .dashboard-command,
  .dashboard-live-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .dashboard-switch-home {
    padding: 1rem;
    border-radius: 18px;
  }

  .dashboard-switch-selected {
    min-height: 0;
  }

  .dashboard-switch-selected strong {
    font-size: 1.08rem;
  }

  .dashboard-switch-carousel {
    gap: 0.65rem;
  }

  .dashboard-switch-tile {
    flex-basis: 11.8rem;
    grid-template-rows: minmax(6.35rem, auto) auto;
  }

  .dashboard-switch-dock {
    justify-content: flex-start;
    width: 100%;
    border-radius: 18px;
    gap: 0.55rem;
  }

  .dashboard-switch-footer {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.45rem 0.8rem;
  }

  .dashboard-command__main {
    min-height: auto;
    padding: 1.15rem;
  }

  .dashboard-command__main h2 {
    font-size: 1.35rem;
  }

  .dashboard-command__main::after {
    display: none;
  }

  .dashboard-action-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-next-post,
  .dashboard-panel__head {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-next-post time {
    font-size: 1.1rem;
  }

  .dashboard-upcoming-list li {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .dashboard-upcoming-list span {
    grid-column: 2;
  }
}

.card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.35rem;
  border: 1px solid var(--border);
  transition: box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(0, 0, 0, 0.06);
}

.card-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.card-value {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card-value.success { color: var(--success); }
.card-value.danger { color: var(--danger); }
.card-value.warn { color: var(--warn); }

.card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* ----- Dashboard: multi-SNS connection overview ----- */
.card--sns-overview {
  grid-column: 1 / -1;
  overflow: hidden;
  padding: 1.15rem 0 1.25rem 1.2rem;
  border: 0;
  border-radius: 18px;
  background: #f3f4f6;
  box-shadow: none;
}

/* ----- Dashboard: post summary card ----- */
.card--post-summary {
  grid-column: 1 / -1;
  border-radius: 18px;
  background:
    linear-gradient(135deg, #ffffff, #f8fafc);
}

.post-summary-row {
  display: flex;
  gap: 0;
  margin-top: 0.5rem;
}

.post-summary-item {
  flex: 1;
  padding: 0.25rem 1.5rem;
  border-right: 1px solid var(--border);
}

.post-summary-item:first-child {
  padding-left: 0;
}

.post-summary-item:last-child {
  border-right: none;
}

.post-summary-item__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 0.4rem;
  font-weight: 600;
}

.post-summary-item__value {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #0ea5e9;
}

.post-summary-item__value.success { color: var(--success); }
.post-summary-item__value.danger  { color: var(--danger); }
.post-summary-item__value.warn    { color: var(--warn); }

.post-summary-item__meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

@media (max-width: 640px) {
  .post-summary-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 0;
  }

  .post-summary-item {
    padding: 0.5rem 0.75rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .post-summary-item:nth-child(odd) {
    border-right: 1px solid var(--border);
  }

  .post-summary-item:last-child,
  .post-summary-item:nth-last-child(2):nth-child(odd) {
    border-bottom: none;
  }
}

.dashboard-sns-grid {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0;
  padding: 0.25rem 1.2rem 0.45rem 0;
  scroll-snap-type: x proximity;
}

.dashboard-sns-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.2rem 0.75rem 0;
}

.dashboard-sns-head h2 {
  margin: 0.15rem 0 0;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.2;
}

.dashboard-sns-head > strong {
  display: inline-grid;
  place-items: center;
  min-width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.95rem;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.dashboard-sns-grid::-webkit-scrollbar {
  height: 0.45rem;
}

.dashboard-sns-grid::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 999px;
}

.dashboard-sns-cell {
  position: relative;
  overflow: hidden;
  display: grid;
  flex: 0 0 clamp(10.5rem, 15vw, 13rem);
  min-height: 13rem;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 0.45rem;
  padding: 0.45rem;
  border: 3px solid rgba(255, 255, 255, 0.86);
  border-radius: 14px;
  background: #ffffff;
  color: var(--text);
  text-decoration: none;
  scroll-snap-align: start;
  box-shadow:
    inset 0 0 0 1px rgba(15, 23, 42, 0.04),
    0 5px 12px rgba(15, 23, 42, 0.05);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.dashboard-sns-cell:hover,
.dashboard-sns-cell:focus {
  transform: translateY(-2px);
  border-color: #60a5fa;
  box-shadow:
    0 0 0 3px rgba(96, 165, 250, 0.32),
    0 12px 22px rgba(15, 23, 42, 0.12);
}

.dashboard-sns-cover {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 7rem;
  overflow: hidden;
  border-radius: 10px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.58), transparent 28%),
    linear-gradient(135deg, #0ea5e9, #2563eb);
  box-shadow: none;
}

.dashboard-sns-cell--success .dashboard-sns-cover {
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.58), transparent 28%),
    linear-gradient(135deg, #14b8a6, #22c55e);
}

.dashboard-sns-cell--instagram .dashboard-sns-cover {
  background:
    radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.58), transparent 30%),
    linear-gradient(135deg, #f58529, #dd2a7b 52%, #8134af);
}

.dashboard-sns-cell--facebook .dashboard-sns-cover {
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.58), transparent 28%),
    linear-gradient(135deg, #60a5fa, #1877f2);
}

.dashboard-sns-cell--threads .dashboard-sns-cover,
.dashboard-sns-cell--x .dashboard-sns-cover,
.dashboard-sns-cell--tiktok .dashboard-sns-cover {
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.35), transparent 28%),
    linear-gradient(135deg, #111827, #374151);
}

.dashboard-sns-cell--youtube .dashboard-sns-cover {
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.58), transparent 28%),
    linear-gradient(135deg, #ef4444, #dc2626);
}

.dashboard-sns-cell--warn .dashboard-sns-cover {
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.58), transparent 28%),
    linear-gradient(135deg, #f97316, #facc15);
}

.dashboard-sns-cell--danger .dashboard-sns-cover {
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.58), transparent 28%),
    linear-gradient(135deg, #ef4444, #8b5cf6);
}

.dashboard-sns-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dashboard-sns-cover > span {
  color: #ffffff;
  font-size: clamp(2rem, 8vw, 3.4rem);
  font-weight: 900;
  text-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
}

.dashboard-sns-cell .dashboard-sns-name {
  display: block;
  min-width: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
}

.dashboard-sns-cell .dashboard-sns-value {
  display: -webkit-box;
  overflow: hidden;
  min-width: 0;
  min-height: 2.55em;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.dashboard-sns-cell .dashboard-sns-value.success { color: var(--success); }
.dashboard-sns-cell .dashboard-sns-value.danger { color: var(--danger); }
.dashboard-sns-cell .dashboard-sns-value.warn { color: var(--warn); }

.dashboard-sns-cell .dashboard-sns-meta {
  position: relative;
  z-index: 1;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: -0.1rem;
}

.dashboard-sns-cell--empty {
  pointer-events: none;
  background: #ffffff;
  border-color: rgba(255, 255, 255, 0.9);
}

.dashboard-sns-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1rem;
}

.dashboard-sns-empty {
  margin: 0;
  padding: 1rem;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  background: #f8fafc;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* ----- Tables ----- */
.table-wrap {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

.posts-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
}

.posts-table-wrap table {
  min-width: 1280px;
}

.posts-list-count {
  display: flex;
  align-items: center;
  width: fit-content;
  margin: 0 0 0.65rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
}

.posts-date-range-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 700;
}

.posts-table-wrap .col-account-icon {
  width: 4.25rem;
  text-align: center;
}

.posts-table-wrap .col-target-count {
  width: 6rem;
  min-width: 6rem;
  text-align: center;
}

.posts-table-wrap .col-status {
  width: 11.5rem;
  min-width: 11.5rem;
}

.posts-title-cell {
  min-width: 14rem;
  max-width: 26rem;
  white-space: normal;
  word-break: break-word;
}

.posts-row.is-detail-clickable {
  cursor: pointer;
}

.posts-row.is-detail-clickable:hover td,
.posts-row.is-detail-clickable:focus-visible td {
  background: var(--bg-elevated);
}

.posts-row.is-detail-clickable:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.posts-title-inline {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) auto;
  align-items: center;
  gap: 0.45rem 0.75rem;
}

.posts-title-text {
  font-weight: 800;
  color: var(--text);
}

.posts-title-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.posts-title-caption-button {
  flex: 0 0 auto;
  width: 6.4rem;
  min-height: 2rem;
  padding: 0.28rem 0.65rem;
  justify-content: center;
}

.posts-title-detail-button {
  flex: 0 0 auto;
  width: 4rem;
  min-height: 2rem;
  padding: 0.28rem 0.65rem;
  justify-content: center;
  border-color: rgba(79, 99, 255, 0.28);
  color: var(--primary);
}

.posts-target-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.35rem;
  min-height: 2rem;
  padding: 0 0.65rem;
  border: 1px solid rgba(79, 99, 255, 0.22);
  border-radius: 999px;
  background: #f6f8ff;
  color: #334155;
  font-size: 0.86rem;
  font-weight: 900;
  white-space: nowrap;
}

.posts-status-cell {
  min-width: 11.5rem;
  vertical-align: top;
}

.posts-status-cell .status {
  display: inline-flex;
  white-space: nowrap;
}

.posts-status-error {
  display: block;
  margin-top: 0.35rem;
  max-width: 15rem;
  color: #b91c1c;
  font-size: 0.76rem;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.posts-account-icon {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-inline: auto;
}

.posts-account-icon .sns-avatar {
  width: 28px;
  height: 28px;
}

.posts-account-icon__fallback,
.posts-account-icon--empty {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.schedule-view-tabs {
  display: inline-flex;
  gap: 0.35rem;
  margin: 0 0 1.1rem;
  padding: 0.32rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.schedule-view-tab {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0 0.95rem;
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.schedule-view-tab:hover,
.schedule-view-tab:focus {
  color: var(--primary);
  background: var(--bg);
}

.schedule-view-tab.is-active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(79, 99, 255, 0.22);
}

table { width: 100%; border-collapse: collapse; }

th, td {
  padding: 0.85rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: #f8fafc;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.col-check { width: 2.5rem; text-align: center; }

tbody tr {
  transition: background var(--transition);
}

tbody tr:hover {
  background: #f8fafc;
}

/* 顧客一覧：表示中（アクティブ）の行を背景色で強調 */
tbody tr.tenant-row-current {
  background: var(--success-muted);
  box-shadow: inset 3px 0 0 var(--success);
}
tbody tr.tenant-row-current:hover {
  background: #dcfce7;
}

/* 顧客一覧：行クリックで切り替えできるようにする */
tbody tr.tenant-row-clickable,
tbody tr.tenant-row-clickable td {
  cursor: pointer;
}
tbody tr.tenant-row-clickable:hover {
  background: #eff6ff;
}
tbody tr.tenant-row-clickable:focus,
tbody tr.tenant-row-clickable:focus-visible {
  outline: 2px solid var(--primary, #2563eb);
  outline-offset: -2px;
}

tr:last-child td { border-bottom: 0; }

/* Status badges */
.status {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.status.connected { background: var(--success-muted); color: #15803d; }
.status.expired { background: var(--warn-muted); color: #b45309; }
.status.error { background: var(--danger-muted); color: #b91c1c; }
.status.draft { background: #f1f5f9; color: var(--text-secondary); }
.status.scheduled { background: var(--info-muted); color: #1d4ed8; }
.status.posted { background: var(--success-muted); color: #15803d; }
.status.failed { background: var(--danger-muted); color: #b91c1c; }
.status.processing { background: var(--info-muted); color: #1d4ed8; }
.status.canceled { background: #f1f5f9; color: var(--text-muted); }
.status.info { background: var(--info-muted); color: #1d4ed8; }
.status.warn { background: var(--warn-muted); color: #b45309; }
.status.running { background: var(--info-muted); color: #1d4ed8; }
.status.idle { background: var(--success-muted); color: #15803d; }

/* ----- Buttons & Forms ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), transform 0.12s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

a.btn { color: inherit; }
a.btn:visited, a.btn:hover, a.btn:focus { color: inherit; }

.btn-primary {
  background: var(--primary);
  color: #fff !important;
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
  color: #fff !important;
}

a.btn-primary, a.btn-primary:visited, a.btn-primary:hover, a.btn-primary:focus {
  color: #fff !important;
}

.btn-secondary {
  background: #f8fafc;
  color: var(--text);
  border-color: #cbd5e1;
}

.btn-secondary:hover {
  background: #eef2ff;
  border-color: var(--primary);
  color: var(--primary);
}

a.btn-secondary,
a.btn-secondary:visited,
a.btn-secondary:focus {
  color: var(--text) !important;
}

a.btn-secondary:hover {
  color: var(--primary) !important;
}

.btn-danger {
  background: var(--danger);
  color: #fff !important;
  font-weight: 600;
}

.btn-danger:hover {
  background: var(--danger-hover);
  color: #fff !important;
}

a.btn-danger, a.btn-danger:visited, a.btn-danger:hover, a.btn-danger:focus {
  color: #fff !important;
}

.btn-sm, .btn-small {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

.btn-delete-ig, .btn-delete-fb { white-space: nowrap; }

td.actions { white-space: nowrap; }
td.actions form { display: inline; margin-right: 0.25rem; }

td.action-menu-cell {
  position: relative;
  width: 3.25rem;
  text-align: center;
  overflow: visible;
}

.row-action-menu {
  position: relative;
  display: inline-block;
}

.row-action-menu[open] {
  z-index: 20;
}

.row-action-menu__toggle {
  display: inline-grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  list-style: none;
  box-shadow: var(--shadow-sm);
}

.row-action-menu__toggle::-webkit-details-marker {
  display: none;
}

.row-action-menu__toggle::marker {
  content: '';
}

.row-action-menu__toggle span,
.row-action-menu__toggle span::before,
.row-action-menu__toggle span::after {
  display: block;
  width: 1.05rem;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.row-action-menu__toggle span {
  position: relative;
}

.row-action-menu__toggle span::before,
.row-action-menu__toggle span::after {
  content: '';
  position: absolute;
  left: 0;
}

.row-action-menu__toggle span::before {
  top: -0.36rem;
}

.row-action-menu__toggle span::after {
  top: 0.36rem;
}

.row-action-menu__toggle:hover,
.row-action-menu[open] .row-action-menu__toggle {
  border-color: var(--primary);
  color: var(--primary);
}

.row-action-menu__toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.row-action-menu__panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 9rem;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-md);
  text-align: left;
}

.row-action-menu.is-positioned .row-action-menu__panel {
  position: fixed;
  top: var(--row-action-menu-top);
  left: var(--row-action-menu-left);
  right: auto;
  z-index: 1200;
}

.row-action-menu__panel form {
  display: block;
  margin: 0;
}

.row-action-menu__item {
  display: flex;
  width: 100%;
  align-items: center;
  min-height: 2.2rem;
  padding: 0.45rem 0.65rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
}

.row-action-menu__item:hover,
.row-action-menu__item:focus-visible {
  background: var(--bg);
  color: var(--primary);
  outline: none;
}

.row-action-menu__item--danger {
  color: var(--danger);
}

.row-action-menu__item--danger:hover,
.row-action-menu__item--danger:focus-visible {
  background: var(--danger-muted);
  color: var(--danger);
}

/* Form */
.form-group { margin-bottom: 1.15rem; }

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  color: var(--text);
  font-size: 0.875rem;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 0.35rem;
}

.form-control {
  width: 100%;
  max-width: 400px;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-control.is-over-limit {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.form-control::placeholder {
  color: var(--text-muted);
}

.media-file-input,
.media-file-input.is-media-selected,
.media-file-input.is-carousel-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.media-file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

textarea.form-control {
  min-height: 80px;
  resize: vertical;
}

/* ----- Login ----- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 50%, #334155 100%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-elevated);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  padding: 2.25rem;
  border: 1px solid var(--border);
}

.login-card h1 {
  margin: 0 0 1.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.02em;
  color: var(--text);
}

.login-card .error {
  background: var(--danger-muted);
  color: #b91c1c;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  border: 1px solid #fecaca;
}

.login-card .form-group { margin-bottom: 1.25rem; }

.login-card .form-control { max-width: none; }

.post-title-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.post-title-field .form-control {
  flex: 1 1 18rem;
}

.post-title-field .btn {
  flex: 0 0 auto;
}

.password-field {
  position: relative;
}

.password-field .form-control {
  padding-right: 3rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  border-color: var(--border);
  background: var(--bg-elevated);
  color: var(--primary);
}

.password-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.password-toggle__icon {
  position: relative;
  display: block;
  width: 1.25rem;
  height: 0.8rem;
  border: 2px solid currentColor;
  border-radius: 70% 70% 55% 55%;
  transform: rotate(-8deg);
}

.password-toggle__icon::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.34rem;
  height: 0.34rem;
  border-radius: 50%;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.password-toggle__icon::after {
  content: '';
  position: absolute;
  left: -0.18rem;
  right: -0.18rem;
  top: 50%;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0;
  transform: rotate(45deg);
}

.password-toggle.is-visible .password-toggle__icon::after {
  opacity: 1;
}

.login-card .btn {
  width: 100%;
  padding: 0.7rem;
  margin-top: 0.5rem;
  font-size: 1rem;
}

/* ----- Alerts ----- */
.alert {
  padding: 0.9rem 1.15rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.875rem;
  border: 1px solid transparent;
}

.alert-info {
  background: var(--info-muted);
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.alert-warn {
  background: var(--warn-muted);
  color: #b45309;
  border-color: #fde68a;
}

.alert-danger {
  background: var(--danger-muted);
  color: #b91c1c;
  border-color: #fecaca;
}

.alert-success {
  background: var(--success-muted);
  color: #15803d;
  border-color: #bbf7d0;
}

/* ----- Settings ----- */
.settings-section { margin-bottom: 1.75rem; }

.settings-section-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  color: var(--text);
}

.settings-section-desc {
  color: var(--text-muted);
  margin: 0 0 1rem;
  font-size: 0.875rem;
  line-height: 1.55;
}

.settings-section-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.client-switch-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 1rem;
  margin-bottom: 1rem;
}

.client-switch-current,
.client-switch-health,
.client-switch-main,
.client-switch-side .card {
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.client-switch-current {
  display: grid;
  gap: 1rem;
  padding: 1.35rem;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.96)),
    var(--bg-elevated);
}

.client-switch-eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: #ecfeff;
  color: #0e7490;
  font-size: 0.72rem;
  font-weight: 700;
}

.client-switch-current__main {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  min-width: 0;
}

.client-switch-avatar {
  display: inline-grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  flex: 0 0 auto;
  border-radius: 14px;
  background: linear-gradient(135deg, #4f46e5, #0ea5e9);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
}

.client-switch-avatar--small {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 10px;
  font-size: 1rem;
}

.client-switch-current h2,
.client-card h3 {
  margin: 0;
  color: var(--text);
  line-height: 1.25;
}

.client-switch-current h2 {
  font-size: 1.4rem;
}

.client-switch-current p,
.client-card__head p {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.client-switch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.client-switch-health {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
}

.client-switch-health__item {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
  padding: 0.8rem;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  background: #f8fafc;
}

.client-switch-health__item span {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.client-switch-health__item strong {
  overflow: hidden;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-switch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1rem;
  align-items: start;
}

.client-switch-tools {
  display: grid;
  gap: 0.65rem;
  justify-items: end;
  min-width: min(100%, 420px);
}

.client-search {
  width: 100%;
}

.client-filter-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.22rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8fafc;
}

.client-filter-tab {
  min-height: 2rem;
  padding: 0 0.7rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
}

.client-filter-tab.is-active {
  background: var(--bg-elevated);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.client-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.85rem;
}

.client-card {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.client-card:hover {
  transform: translateY(-1px);
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.client-card.is-current {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #eff6ff, #ffffff);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
}

.client-card[hidden] {
  display: none;
}

.client-card__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: center;
}

.client-card h3 {
  overflow: hidden;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-status,
.client-current-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 1.55rem;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.client-status--active {
  background: var(--success-muted);
  color: #15803d;
}

.client-status--ready {
  background: #ecfeff;
  color: #0e7490;
}

.client-status--warn {
  background: var(--warn-muted);
  color: #b45309;
}

.client-status--idle {
  background: #f1f5f9;
  color: var(--text-muted);
}

.client-card__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.client-card__metrics span {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
  padding: 0.55rem;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  color: var(--text-muted);
  font-size: 0.76rem;
}

.client-card__metrics strong {
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
}

.client-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.client-platform {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 1.75rem;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 800;
}

.client-platform strong {
  color: inherit;
}

.client-platform--ig { background: #fdf2f8; color: #be185d; }
.client-platform--fb { background: #eff6ff; color: #1d4ed8; }
.client-platform--th,
.client-platform--x { background: #f1f5f9; color: #111827; }
.client-platform--tk { background: #ecfeff; color: #0e7490; }
.client-platform--yt { background: #fef2f2; color: #b91c1c; }

.client-card__next {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.client-card__next strong {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-card__actions {
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
  align-items: center;
}

.client-current-label {
  background: #dbeafe;
  color: #1d4ed8;
}

.client-card-empty {
  margin: 1rem 0 0;
  padding: 1rem;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius);
  color: var(--text-muted);
  text-align: center;
}

.client-side-platforms {
  display: grid;
  gap: 0.55rem;
}

.client-side-platform {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.55rem;
  align-items: center;
  padding: 0.65rem;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  background: #f8fafc;
}

.client-side-platform strong,
.client-side-platform small {
  display: block;
}

.client-side-platform strong {
  color: var(--text);
}

.client-side-platform small {
  color: var(--text-muted);
  font-size: 0.78rem;
}

@media (max-width: 1120px) {
  .client-switch-hero,
  .client-switch-layout {
    grid-template-columns: 1fr;
  }

  .client-switch-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (max-width: 760px) {
  .settings-section-head,
  .client-card__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .client-switch-tools {
    justify-items: stretch;
    min-width: 0;
  }

  .client-switch-health,
  .client-switch-side {
    grid-template-columns: 1fr;
  }

  .client-card-grid {
    grid-template-columns: 1fr;
  }
}

.settings-note {
  font-size: 0.875rem;
  margin-top: 1rem;
  margin-bottom: 0;
}

/* 設定ページ（運用先の投稿内容）— スタートアップ系 SaaS 風の余白・カード */
.settings-page {
  max-width: 46rem;
  margin: 0 auto;
  padding-bottom: 2.5rem;
}

.settings-page__intro {
  margin: 0 0 1.75rem;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.settings-page__alert {
  margin-bottom: 1.25rem;
}

.settings-page__form {
  margin: 0;
}

.settings-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.settings-card__header {
  padding: 1.35rem 1.5rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.65) 0%, var(--bg-elevated) 100%);
}

.settings-card__title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.settings-card__lede {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.settings-card__body {
  padding: 1.5rem 1.5rem 1.65rem;
}

.settings-card__body--flush {
  padding: 0;
}

.settings-card__footer-note {
  margin: 0;
  padding: 0.85rem 1.5rem 1.15rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.settings-field {
  margin-bottom: 1.85rem;
}

.settings-field:last-child {
  margin-bottom: 0;
}

.settings-field--divider {
  margin-top: 0.25rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
  margin-bottom: 0;
}

.settings-field__label {
  display: block;
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
}

.settings-field__hint {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.settings-field__foot {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.settings-field__control {
  max-width: 100%;
  width: 100%;
}

.settings-field__control--narrow {
  max-width: min(100%, 28rem);
}

.settings-empty {
  margin: 0;
  padding: 1rem 1.1rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.settings-sns-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.settings-sns-row {
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--border);
}

.settings-sns-row:first-child {
  padding-top: 0;
}

.settings-sns-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

@media (min-width: 640px) {
  .settings-sns-row {
    display: grid;
    grid-template-columns: minmax(7.5rem, 10.5rem) minmax(0, 1fr);
    gap: 0.35rem 1.75rem;
    align-items: start;
    padding: 1.5rem 0;
  }

  .settings-sns-row:first-child {
    padding-top: 0;
  }

  .settings-sns-row__select {
    max-width: 22rem;
  }
}

.settings-sns-row__title {
  display: block;
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

@media (min-width: 640px) {
  .settings-sns-row__title {
    margin: 0.35rem 0 0;
  }
}

.settings-sns-row__select {
  width: 100%;
  max-width: 100%;
}

.settings-sns-row__desc {
  margin: 0.65rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.settings-x-tweet {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.65rem;
}

@media (min-width: 520px) {
  .settings-x-tweet {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.25rem;
  }
}

.settings-x-tweet__modes {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

@media (min-width: 520px) {
  .settings-x-tweet__modes {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem 1.25rem;
  }
}

.settings-x-tweet__select {
  max-width: min(100%, 17rem);
  flex-shrink: 0;
}

.settings-radio {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.875rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.settings-radio input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
}

.settings-form-actions {
  margin: 0 0 1.75rem;
  padding-top: 0.25rem;
}

.settings-cron-table.table-wrap {
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.settings-cron-table table {
  margin: 0;
}

.settings-card--cron .settings-card__header {
  border-bottom-color: var(--border);
}

@media (max-width: 639px) {
  .settings-page {
    max-width: none;
    margin: 0;
  }

  .settings-card__header,
  .settings-card__body {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }

  .settings-card__footer-note {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }
}

.text-muted { color: var(--text-muted); }
.text-warn { color: var(--warn); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.code-sm { font-size: 0.8rem; }

.cell-truncate {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-nowrap { white-space: nowrap; }

/* ----- Connect steps ----- */
.connect-steps { margin: 0 0 0 1.25rem; padding-left: 0.5rem; }
.connect-steps li { margin-bottom: 1rem; line-height: 1.6; }
.connect-steps li:last-child { margin-bottom: 0; }

/* 接続方法2つを同等のカードで表示 */
.connect-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 0.5rem;
}

.connect-option {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.connect-option-title {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.connect-option-desc {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
  flex: 1;
}

.connect-option-action {
  margin-top: 1.25rem;
}

.connect-option-action form { margin: 0; }

.connect-option-help {
  margin-top: 1rem;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
}

.connect-option-help summary {
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  color: var(--text-muted);
  list-style: none;
}

.connect-option-help summary::-webkit-details-marker { display: none; }

.connect-option-help summary::before {
  content: '▸ ';
  display: inline-block;
  transition: transform 0.15s ease;
}

.connect-option-help[open] summary::before {
  transform: rotate(90deg);
}

.connect-option-help-body {
  padding: 0 0.75rem 0.75rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
}

.connect-option-help-body ul {
  margin: 0.35rem 0 0 1.25rem;
  padding: 0;
}

.connect-block {
  margin-top: 1rem;
  padding: 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
}

.connect-block--user { background: var(--bg-elevated); }
.connect-block--admin { margin-top: 1rem; }

.connect-block--admin summary {
  cursor: pointer;
  list-style: none;
  padding: 0.5rem 0;
}

.connect-block--admin summary::-webkit-details-marker { display: none; }

.connect-block-title { margin: 0; font-size: 0.95rem; font-weight: 600; }

.connect-steps code { font-size: 0.85em; }

.step-sublist { margin: 0 0 0 1.25rem; padding-left: 0.5rem; }
.step-sublist li { margin-bottom: 0.35rem; }

/* ----- Guide pages（各種 接続方法） ----- */
.guide-page-intro {
  color: var(--text-muted);
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  line-height: 1.55;
}

.guide-summary { margin-bottom: 1.25rem; }

.guide-summary-title {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

.guide-summary table {
  width: 100%;
  font-size: 0.8125rem;
  border-collapse: collapse;
}

.guide-summary th,
.guide-summary td {
  padding: 0.4rem 0.5rem 0.4rem 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.guide-summary thead th {
  color: var(--text-muted);
  font-weight: 600;
  padding-right: 0.75rem;
  white-space: nowrap;
}

.guide-summary tbody td:first-child {
  width: 38%;
  max-width: 12rem;
}

.guide-summary tbody tr:last-child td {
  border-bottom: 0;
}

.alert-info.guide-summary th,
.alert-info.guide-summary td {
  border-bottom-color: rgba(29, 78, 216, 0.12);
}

.guide-section .settings-section-title {
  margin-bottom: 0.2rem;
}

.guide-lead {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.guide-steps {
  margin: 0;
  padding-left: 1.2rem;
  list-style: decimal;
}

.guide-steps > li {
  margin-bottom: 0.7rem;
  padding-left: 0.35rem;
}

.guide-steps > li:last-child {
  margin-bottom: 0;
}

.guide-step-title {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.guide-step-body {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.guide-substeps {
  margin: 0.45rem 0 0;
  padding-left: 1.1rem;
  list-style: disc;
}

.guide-substeps > li {
  margin-bottom: 0.35rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.guide-substeps > li:last-child {
  margin-bottom: 0;
}

.guide-aside {
  margin: 0.85rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.guide-inline-label {
  margin: 0.75rem 0 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

.copy-url-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  flex-wrap: wrap;
}

.guide-section .guide-steps + .copy-url-row {
  margin-top: 0.25rem;
}

.code-block {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.45rem 0.65rem;
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  word-break: break-all;
}

.ui-label {
  padding: 0.2rem 0.45rem;
  background: #e2e8f0;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.85em;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  font-weight: normal;
  white-space: nowrap;
}

/* ----- Calendar ----- */
.calendar-wrap {
  padding: 0.65rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
  overflow: auto;
}

.calendar-table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0.48rem;
  table-layout: fixed;
}

.calendar-table thead th {
  padding: 0.5rem 0.25rem 0.35rem;
  font-size: 0.75rem;
  font-weight: 900;
  color: var(--text-muted);
  text-align: center;
  border: 0;
  background: transparent;
}

.calendar-table tbody td {
  vertical-align: top;
  height: 156px;
  padding: 0.55rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.calendar-table tbody td:not(.calendar-cell--blank):hover {
  border-color: rgba(79, 99, 255, 0.3);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.calendar-cell--drop-target {
  border-color: rgba(79, 99, 255, 0.82) !important;
  background: #f6f8ff !important;
  box-shadow: 0 0 0 3px rgba(79, 99, 255, 0.14), 0 14px 30px rgba(79, 99, 255, 0.12) !important;
}

.calendar-cell { font-size: 0.85rem; }

.calendar-cell--blank {
  border-style: dashed !important;
  background: rgba(248, 250, 252, 0.58) !important;
  box-shadow: none !important;
}

.calendar-cell--past {
  background: #f8fafc !important;
}

.calendar-cell--sun {
  background: #fff5f5 !important;
}

.calendar-cell--sat {
  background: #f5f8ff !important;
}

.calendar-cell--past.calendar-cell--sun {
  background: #fff8f8 !important;
}

.calendar-cell--past.calendar-cell--sat {
  background: #f8faff !important;
}

.calendar-cell--past .calendar-event {
  opacity: 0.82;
}

.calendar-cell--today {
  border-color: rgba(245, 158, 11, 0.8) !important;
  background: #fffaf0 !important;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.18), 0 14px 30px rgba(245, 158, 11, 0.12) !important;
}

.calendar-cell--sun .calendar-day-num { color: var(--danger); }
.calendar-cell--sat .calendar-day-num { color: var(--primary); }

.calendar-day-num {
  font-weight: 900;
  margin-bottom: 0.25rem;
  font-size: 0.92rem;
}

/* カレンダー上部: 月ナビ＋アクション */
.calendar-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.calendar-nav {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.calendar-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 12px;
  color: var(--text-muted);
  text-decoration: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform 0.12s ease;
}
.calendar-nav-btn:hover {
  background: var(--primary-muted);
  color: var(--primary-hover);
  border-color: var(--primary);
  transform: translateY(-1px);
}
.calendar-title {
  margin: 0;
  min-width: 132px;
  font-size: 1.18rem;
  font-weight: 900;
  text-align: center;
  color: var(--text);
}
.calendar-actions-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.calendar-event {
  display: block;
  padding: 0.45rem 0.5rem;
  margin-bottom: 0.35rem;
  border-radius: 10px;
  font-size: 0.75rem;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(79, 99, 255, 0.18);
  border-left: 4px solid var(--primary);
  background: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  transition: background var(--transition), border-color var(--transition), transform 0.12s ease;
}

.calendar-event:hover {
  border-color: rgba(79, 99, 255, 0.34);
  background: #f8fbff;
  transform: translateY(-1px);
}

.calendar-event.is-draggable {
  cursor: grab;
}

.calendar-event.is-draggable:active,
.calendar-event.is-dragging {
  cursor: grabbing;
}

.calendar-event.is-dragging {
  opacity: 0.55;
}

.calendar-event.status-draft { border-color: #cbd5e1; border-left-color: #94a3b8; background: #f8fafc; }
.calendar-event.status-scheduled { border-color: #dbeafe; border-left-color: var(--primary); background: #fff; }
.calendar-event.status-posted { border-color: #bbf7d0; border-left-color: var(--success); background: #f7fef9; }
.calendar-event.status-failed { border-color: #fecaca; border-left-color: var(--danger); background: #fff7f7; }
.calendar-event.status-processing { border-color: #ddd6fe; border-left-color: #8b5cf6; background: #fbfaff; }
.calendar-event.status-canceled {
  border-color: #cbd5e1;
  border-left-color: var(--text-muted);
  background: #f8fafc;
  opacity: 0.85;
}

.calendar-event-head {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}

.calendar-event-status {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  margin-bottom: 0.15rem;
  background: rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}

.calendar-event-count {
  display: inline-flex;
  align-items: center;
  min-height: 1.15rem;
  padding: 0.05rem 0.3rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.65rem;
  font-weight: 900;
  line-height: 1;
}

.calendar-event.status-scheduled .calendar-event-status { background: rgba(99, 102, 241, 0.2); color: var(--primary-hover); }
.calendar-event.status-posted .calendar-event-status { background: rgba(34, 197, 94, 0.2); color: #15803d; }
.calendar-event.status-failed .calendar-event-status { background: rgba(239, 68, 68, 0.2); color: #b91c1c; }
.calendar-event.status-canceled .calendar-event-status { background: rgba(100, 116, 139, 0.2); color: var(--text-muted); }

.calendar-event-time {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 0.1rem;
}

.calendar-event-caption {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event-account {
  display: block;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 日付セル: ホバーで「新規投稿を追加」を表示・クリックで実行 */
.calendar-cell-add {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  width: fit-content;
  min-height: 2rem;
  margin-bottom: 0.55rem;
  padding: 0.26rem 0.34rem 0.26rem 0.28rem;
  font-size: 0.85rem;
  color: var(--primary-hover);
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid rgba(79, 99, 255, 0.16);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 7px 16px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), transform 0.14s ease;
}
.calendar-cell-add:hover {
  background: #fff;
  border-color: rgba(79, 99, 255, 0.38);
  color: var(--primary-hover);
  box-shadow: 0 10px 22px rgba(79, 99, 255, 0.14);
  transform: translateY(-1px);
}
.calendar-cell-add .calendar-day-num {
  font-weight: 900;
  margin-bottom: 0;
  font-size: 0.9rem;
}
.calendar-cell-add-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  border: 1px solid rgba(79, 99, 255, 0.22);
  border-radius: 999px;
  background: linear-gradient(135deg, #eff6ff, #eef2ff);
  color: var(--primary-hover);
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.calendar-cell-add:hover .calendar-cell-add-icon {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.calendar-cell-add-label {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 800;
  transition: max-width 0.2s ease, opacity 0.15s ease;
}
.calendar-cell-add:hover .calendar-cell-add-label {
  max-width: 8em;
  opacity: 1;
}

/* 週表示カレンダーも月表示と同じ質感に揃える */
.schedule-actions--week {
  align-items: center;
}

.schedule-actions--week .schedule-nav {
  flex: 1;
  justify-content: center;
}

.schedule-title {
  min-width: 220px;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 900;
  text-align: center;
}

.schedule-filter-form {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.schedule-filter-form label {
  margin: 0;
}

.schedule-filter-form .form-control {
  width: min(340px, 70vw);
  min-height: 2.55rem;
  border-radius: 12px;
  background: #fff;
}

.schedule-timeline-wrap {
  padding: 0.65rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.schedule-timeline {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0.48rem;
  table-layout: fixed;
  font-size: 0.85rem;
}

.schedule-timeline th,
.schedule-timeline td {
  vertical-align: top;
  border: 0;
}

.schedule-timeline tbody td {
  height: 320px;
  padding: 0.55rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.schedule-timeline tbody td:not(.calendar-cell--blank):hover {
  border-color: rgba(79, 99, 255, 0.3);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.schedule-timeline thead th {
  padding: 0.5rem 0.45rem 0.55rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.78);
  color: var(--text);
  font-size: 0.83rem;
  font-weight: 900;
  text-align: left;
}

.schedule-timeline thead th.calendar-cell--sun {
  background: #fff5f5 !important;
}

.schedule-timeline thead th.calendar-cell--sat {
  background: #f5f8ff !important;
}

.schedule-day-col {
  min-width: 140px;
  width: 14.28%;
}

.schedule-day-count {
  display: block;
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.schedule-slot {
  height: 320px;
  min-height: 320px;
  cursor: pointer;
}

.schedule-slot .schedule-slot-add {
  margin-top: 0.15rem;
  margin-bottom: 0.85rem;
}

.schedule-slot .calendar-cell-add-label {
  max-width: 5.5em;
  opacity: 1;
}

.schedule-day-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.schedule-event {
  display: block;
  padding: 0.5rem;
  border: 1px solid rgba(79, 99, 255, 0.18);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  transition: border-color var(--transition), box-shadow var(--transition), transform 0.12s ease;
}

.schedule-event:hover {
  border-color: rgba(79, 99, 255, 0.34);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.09);
  transform: translateY(-1px);
}

.schedule-event.status-draft { border-color: #cbd5e1; border-left-color: #94a3b8; background: #f8fafc; }
.schedule-event.status-scheduled { border-color: #dbeafe; border-left-color: var(--primary); background: #fff; }
.schedule-event.status-posted { border-color: #bbf7d0; border-left-color: var(--success); background: #f7fef9; }
.schedule-event.status-failed { border-color: #fecaca; border-left-color: var(--danger); background: #fff7f7; }
.schedule-event.status-processing { border-color: #ddd6fe; border-left-color: #8b5cf6; background: #fbfaff; }
.schedule-event.status-canceled { border-color: #cbd5e1; border-left-color: var(--text-muted); background: #f8fafc; opacity: 0.85; }

.schedule-event-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.schedule-event-head {
  display: flex;
  align-items: center;
  margin-bottom: 0.15rem;
}

.schedule-event-time {
  display: block;
  margin-bottom: 0.1rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 900;
}

.schedule-event-account,
.schedule-event-caption {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-event-account {
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
}

.schedule-event-caption {
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 800;
}

.schedule-event-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.schedule-event-form .form-control-small {
  width: 100%;
  min-height: 2rem;
  padding: 0.25rem 0.45rem;
  font-size: 0.72rem;
  border-radius: 8px;
}

.schedule-exception-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.schedule-exception-panel {
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.07);
}

.schedule-exception-head {
  margin-bottom: 0.75rem;
}

.schedule-exception-head h2 {
  margin: 0 0 0.35rem;
  color: var(--text);
  font-size: 1rem;
  font-weight: 900;
}

.schedule-exception-head p,
.schedule-exception-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.schedule-unscheduled-list {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.schedule-exception-item {
  display: grid;
  grid-template-columns: auto minmax(9rem, 0.8fr) minmax(8rem, 0.9fr) minmax(10rem, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.7rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: #fff;
}

.schedule-exception-date,
.schedule-exception-account,
.schedule-exception-caption {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-exception-date {
  color: var(--text);
  font-weight: 800;
}

.schedule-exception-account,
.schedule-exception-caption {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.schedule-exception-form {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.schedule-exception-form .form-control {
  width: 190px;
}

@media (max-width: 720px) {
  .schedule-actions--week {
    align-items: stretch;
  }

  .schedule-actions--week .schedule-nav {
    order: -1;
    flex-basis: 100%;
  }

  .schedule-title {
    min-width: 0;
    font-size: 0.95rem;
  }

  .schedule-filter-form {
    align-items: stretch;
    flex-direction: column;
  }

  .schedule-filter-form .form-control {
    width: 100%;
  }

  .schedule-exception-grid {
    grid-template-columns: 1fr;
  }

  .schedule-exception-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .schedule-exception-form .form-control {
    width: 100%;
  }
}

/* ----- Screen reader only ----- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ----- Post create wizard ----- */
.post-create-wizard {
  max-width: 640px;
  margin: 0 auto;
}

.post-create-wizard .wizard-panels {
  position: relative;
  min-height: 200px;
}

.wizard-panel {
  display: none;
  animation: wizardFadeIn 0.25s ease;
}

.wizard-panel.is-active {
  display: block;
}

@keyframes wizardFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.wizard-panel-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.wizard-panel .form-control {
  max-width: 100%;
}

.wizard-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.wizard-actions .btn-primary { min-width: 120px; }

.wizard-actions .btn-secondary:first-of-type { margin-right: auto; }

.post-create-wizard--linear {
  width: 100%;
  max-width: none;
  margin: 0;
  padding-bottom: 5.5rem;
}

.post-create-wizard--linear .wizard-panels {
  display: grid;
  gap: 2rem;
  min-height: 0;
}

.post-create-wizard--linear .wizard-panel,
.post-create-wizard--linear .wizard-panel.is-active {
  display: block;
  scroll-margin-top: 1rem;
  animation: none;
}

.post-create-wizard--linear .wizard-panel-title {
  margin-top: 0;
}

.post-create-wizard--linear .form-control,
.post-editor-form .form-control {
  max-width: 100%;
}

.post-create-wizard--linear #wizard-panel-1 .wizard-actions {
  display: none;
}

.post-create-wizard--linear #wizard-panel-2 .wizard-actions {
  justify-content: flex-start;
  margin-top: 1.25rem;
}

/* PCでは少し広めに。各ステップは常に1画面=1ステップで表示 */
@media (min-width: 1024px) {
  .post-create-wizard {
    max-width: none;
  }

  .post-create-wizard--linear {
    max-width: none;
  }
}

/* ----- 途中保存（自動保存）バナー / インジケーター ----- */
.draft-restore-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  background: var(--info-muted, rgba(59, 130, 246, 0.1));
  border: 1px solid var(--info, #3b82f6);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.875rem;
}

.draft-restore-banner[hidden] { display: none; }

.draft-restore-banner .draft-restore-message {
  flex: 1;
  min-width: 200px;
  line-height: 1.4;
}

.draft-restore-banner .draft-restore-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.draft-autosave-indicator {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: -0.75rem 0 1rem;
  transition: color var(--transition), opacity var(--transition);
}

.draft-autosave-indicator[hidden] { display: none; }

/* ----- 選択中の投稿先 ----- */
.selected-accounts-summary {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  min-height: 5rem;
  padding: 1.1rem 1rem 1rem;
  margin-bottom: 1rem;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid #dbe3ef;
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  font-size: 0.825rem;
}

.selected-accounts-summary::before,
.platform-adjustments::before,
.common-post-settings::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.55), rgba(14, 165, 233, 0.32), transparent 78%);
  pointer-events: none;
}

.selected-accounts-summary--account {
  margin-bottom: 0.85rem;
}

.platform-adjustments {
  position: relative;
  margin-top: 1.25rem;
  min-height: 5rem;
  padding: 1.1rem 1rem 1rem;
  overflow: hidden;
  border: 1px solid #dbe3ef;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.platform-adjustments[hidden] {
  display: none;
}

.common-post-settings {
  position: relative;
  margin-top: 1rem;
  min-height: 5rem;
  padding: 1.1rem 1rem 1rem;
  overflow: hidden;
  border: 1px solid #dbe3ef;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.common-post-settings.is-collapsed {
  cursor: pointer;
}

.common-post-settings.is-expanded .common-post-settings__head {
  cursor: pointer;
}

.common-post-settings.is-collapsed:hover {
  border-color: #cbd5e1;
  background: linear-gradient(180deg, #ffffff, #f9fbff);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.common-post-settings__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
}

.common-post-settings__head h3 {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
}

.common-post-settings__head .form-hint {
  margin-bottom: 0;
}

.common-settings-note {
  color: var(--danger);
}

.common-post-settings__toggle {
  flex: 0 0 auto;
}

.common-post-settings__body {
  height: auto;
  margin-top: 0.85rem;
  overflow: hidden;
  opacity: 1;
}

.common-post-settings.is-ready .common-post-settings__body {
  transition: height 0.3s ease, opacity 0.2s ease, margin-top 0.2s ease;
}

.common-post-settings.is-collapsed .common-post-settings__body {
  height: 0;
  margin-top: 0;
  opacity: 0;
  pointer-events: none;
}

.schedule-field {
  max-width: 100%;
}

.schedule-native-input {
  display: none;
}

.schedule-control {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(10rem, 14rem);
  align-items: stretch;
  gap: 0.85rem;
  max-width: 48rem;
}

.post-create-wizard--linear .common-post-settings .schedule-control {
  max-width: 54rem;
}

.post-editor-form .schedule-control {
  max-width: none;
}

.schedule-date-input {
  width: 100%;
  min-height: 3.2rem;
  padding: 1.15rem 0.95rem 0.55rem;
}

.schedule-time-select {
  width: 100%;
  min-height: 3.2rem;
  padding: 1.15rem 0.95rem 0.55rem;
}

.platform-adjustment-card .schedule-control {
  max-width: 100%;
}

.schedule-control .schedule-slot {
  position: relative;
  isolation: isolate;
  min-width: 0;
  height: auto;
  min-height: 3.35rem;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid rgba(99, 102, 241, 0.32);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.9)),
    radial-gradient(circle at 0 0, rgba(34, 211, 238, 0.18), transparent 42%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -10px 18px rgba(59, 130, 246, 0.055),
    0 3px 0 rgba(99, 102, 241, 0.28),
    0 12px 20px rgba(15, 23, 42, 0.06);
  transition: border-color var(--transition), box-shadow var(--transition), transform 0.14s ease;
}

.schedule-control .schedule-slot::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(120deg, transparent 0 34%, rgba(255, 255, 255, 0.7) 38% 45%, transparent 49% 100%),
    repeating-linear-gradient(0deg, rgba(99, 102, 241, 0.035) 0 1px, transparent 1px 5px);
  opacity: 0.75;
}

.schedule-control .schedule-slot::after {
  content: "";
  position: absolute;
  right: 0.7rem;
  top: 0.7rem;
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16), 0 0 12px rgba(34, 197, 94, 0.45);
}

.schedule-control .schedule-slot:focus-within {
  border-color: rgba(99, 102, 241, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -10px 18px rgba(79, 70, 229, 0.08),
    0 4px 0 #6366f1,
    0 16px 26px rgba(79, 70, 229, 0.14);
}

.schedule-control .schedule-slot__label {
  position: absolute;
  left: 0.85rem;
  top: 0.42rem;
  z-index: 1;
  color: #4f46e5;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  pointer-events: none;
}

.schedule-control .schedule-slot .schedule-date-input,
.schedule-control .schedule-slot .schedule-time-select {
  position: relative;
  z-index: 1;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  cursor: pointer;
  font-size: 1.08rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.2;
}

.schedule-control .schedule-slot .schedule-date-input:focus,
.schedule-control .schedule-slot .schedule-time-select:focus {
  outline: none;
  border-color: transparent;
  box-shadow: none;
}

@media (max-width: 640px) {
  .common-post-settings__head,
  .platform-adjustments-head {
    flex-direction: column;
    align-items: stretch;
  }

  .common-post-settings__toggle,
  .platform-adjustments__toggle {
    width: 100%;
  }

  .schedule-native-input {
    display: block;
    min-height: 3rem;
    padding: 0.75rem 0.95rem;
  }

  .schedule-control {
    display: none;
  }
}

.platform-adjustments-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.platform-adjustments-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
}

.platform-adjustments__toggle {
  flex: 0 0 auto;
}

.platform-adjustments__body {
  height: auto;
  margin-top: 0.85rem;
  overflow: hidden;
  opacity: 1;
}

.platform-adjustments.is-ready .platform-adjustments__body {
  transition: height 0.3s ease, opacity 0.2s ease, margin-top 0.2s ease;
}

.platform-adjustments.is-collapsed .platform-adjustments__body {
  height: 0;
  margin-top: 0;
  opacity: 0;
  pointer-events: none;
}

.preview-mode-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin: 0.8rem 0 1rem;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.preview-mode-toolbar__label {
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 700;
}

.preview-mode-toggle {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  padding: 0.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.preview-mode-toggle__button {
  min-height: 2.1rem;
  padding: 0 0.7rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
}

.preview-mode-toggle__button:hover,
.preview-mode-toggle__button:focus-visible {
  color: var(--primary);
}

.preview-mode-toggle__button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.preview-mode-toggle__button.is-active {
  background: var(--bg-elevated);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.preview-mode-toolbar--live {
  width: min(100%, 430px);
  margin: 0.55rem auto 0.7rem;
  padding: 0.45rem;
  background: #f8fafc;
}

.preview-mode-toolbar--live .preview-mode-toolbar__label {
  font-size: 0.76rem;
}

.preview-mode-toolbar--live .preview-mode-toggle {
  flex: 1 1 auto;
  flex-wrap: wrap;
}

.preview-mode-toolbar--live .preview-mode-toggle__button {
  flex: 1 1 auto;
  min-height: 1.9rem;
  padding: 0 0.45rem;
  font-size: 0.74rem;
}

.platform-adjustment-list,
.post-preview-grid {
  display: grid;
  gap: 0.75rem;
}

.platform-adjustment-card {
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.platform-adjustment-preview-top {
  display: none;
}

.platform-adjustment-card[data-platform="instagram"] {
  max-width: 430px;
  margin-inline: auto;
  padding: 0;
  overflow: hidden;
  border-color: #111827;
  border-radius: 0;
  background: #080b10;
  color: #f8fafc;
  box-shadow: 0 16px 34px rgba(2, 6, 23, 0.18);
}

.platform-adjustment-card[data-platform="instagram"] .platform-adjustment-preview-top {
  display: grid;
  place-items: center;
  min-height: 4.15rem;
  padding: 0.65rem 3rem 0.6rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.17);
  line-height: 1.2;
  text-align: center;
}

.platform-adjustment-card[data-platform="instagram"] .platform-adjustment-preview-top strong {
  font-size: 1.08rem;
  font-weight: 800;
}

.platform-adjustment-card[data-platform="instagram"] .platform-adjustment-preview-top small {
  display: block;
  max-width: 100%;
  margin-top: 0.18rem;
  overflow: hidden;
  color: #e5e7eb;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-adjustment-card[data-platform="instagram"] .platform-adjustment-title {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0.9rem 0.95rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.platform-adjustment-card[data-platform="instagram"] .platform-adjustment-avatar .sns-avatar {
  width: 2.55rem !important;
  height: 2.55rem !important;
  border: 2px solid #fff;
}

.platform-adjustment-card[data-platform="instagram"] .platform-adjustment-title strong,
.platform-adjustment-card[data-platform="instagram"] .platform-adjustment-title small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-adjustment-card[data-platform="instagram"] .platform-adjustment-title strong {
  color: #f8fafc;
  font-size: 0.9rem;
  font-weight: 700;
}

.platform-adjustment-card[data-platform="instagram"] .platform-adjustment-title small {
  color: #d1d5db;
  font-size: 0.75rem;
}

.platform-adjustment-card[data-platform="instagram"] > label,
.platform-adjustment-card[data-platform="instagram"] > .target-media-picker {
  display: block;
  margin: 0;
  padding: 0.95rem;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  color: #d1d5db;
}

.platform-adjustment-card[data-platform="instagram"] > label:first-of-type {
  border-top: 0;
}

.platform-adjustment-card[data-platform="instagram"] .form-hint,
.platform-adjustment-card[data-platform="instagram"] .caption-counter,
.platform-adjustment-card[data-platform="instagram"] .text-muted {
  color: #9ca3af !important;
}

.platform-adjustment-card[data-platform="instagram"] .target-template-preview {
  border-color: rgba(148, 163, 184, 0.28);
  background: #111827;
}

.platform-adjustment-card[data-platform="instagram"] .target-template-preview summary,
.platform-adjustment-card[data-platform="instagram"] .target-template-preview pre {
  color: #e5e7eb;
}

.platform-adjustment-card[data-platform="instagram"] .form-control,
.platform-adjustment-card[data-platform="instagram"] .schedule-date-input,
.platform-adjustment-card[data-platform="instagram"] .schedule-time-select {
  border-color: rgba(148, 163, 184, 0.35);
  background: #f8fafc;
  color: #111827;
}

.platform-adjustment-card[data-platform="instagram"] .target-media-preview {
  min-height: 180px;
  margin-top: 0.65rem;
  border: 0;
  border-radius: 0;
  background: #111827;
  color: #cbd5e1;
}

.platform-adjustment-card[data-platform="instagram"] .target-media-preview img,
.platform-adjustment-card[data-platform="instagram"] .target-media-preview video {
  width: 100%;
  max-width: none;
  max-height: 320px;
  object-fit: cover;
}

.platform-adjustment-card:not([data-platform="instagram"]) {
  overflow: hidden;
  padding: 0;
}

.platform-adjustment-card:not([data-platform="instagram"]) .platform-adjustment-title {
  margin: 0;
  padding: 0.85rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.platform-adjustment-card:not([data-platform="instagram"]) > label,
.platform-adjustment-card:not([data-platform="instagram"]) > .target-media-picker {
  display: block;
  margin: 0;
  padding: 0.85rem;
  border-top: 1px solid var(--border);
}

.platform-adjustment-card:not([data-platform="instagram"]) > label:first-of-type {
  border-top: 0;
}

.platform-adjustment-card[hidden] {
  display: none !important;
}

.platform-adjustment-card.is-focus-edit {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.platform-adjustment-title,
.post-preview-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.platform-adjustment-title > span:nth-child(2) {
  min-width: 0;
  flex: 1 1 auto;
}

.platform-adjustment-title-text {
  min-width: 0;
}

.platform-adjustment-title-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
  margin-left: auto;
}

.platform-adjustment-edit-button[disabled] {
  cursor: default;
  opacity: 0.75;
  transform: none;
}

.platform-preview-modal-button {
  flex: 0 0 auto;
}

.post-preview-head {
  justify-content: space-between;
}

.platform-adjustment-title strong,
.post-preview-title strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
}

.platform-adjustment-title small,
.post-preview-title small {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.3;
}

.platform-adjustment-card label {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.platform-adjustment-card label .form-control {
  margin-top: 0.35rem;
  font-weight: 400;
}

.platform-adjustment-card {
  display: flex;
  flex-direction: column;
}

.platform-adjustment-card:not(.is-edit-open) {
  display: block;
  cursor: pointer;
}

.platform-adjustment-card:not(.is-edit-open):hover {
  border-color: #cbd5e1;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.platform-adjustment-card:not(.is-edit-open) > .platform-adjustment-live-preview,
.platform-adjustment-card:not(.is-edit-open) > .platform-adjustment-field,
.platform-adjustment-card:not(.is-edit-open) > .target-media-picker {
  display: none !important;
}

.platform-adjustment-card:not(.is-edit-open) .platform-adjustment-title,
.platform-adjustment-card[data-platform="instagram"]:not(.is-edit-open) .platform-adjustment-title,
.platform-adjustment-card:not([data-platform="instagram"]):not(.is-edit-open) .platform-adjustment-title {
  margin: 0;
  border-bottom: 0;
}

.platform-adjustment-field {
  --field-accent: var(--primary);
  --field-accent-bg: var(--primary-muted);
  position: relative;
  border-left: 4px solid var(--field-accent) !important;
}

.platform-adjustment-field__label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 1.6rem;
  margin-bottom: 0.45rem;
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--field-accent);
  border-radius: 999px;
  background: var(--field-accent-bg);
  color: var(--field-accent);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.2;
}

.platform-adjustment-field--schedule {
  --field-accent: #2563eb;
  --field-accent-bg: #eff6ff;
  order: 1;
}

.platform-adjustment-field--media-type {
  --field-accent: #7c3aed;
  --field-accent-bg: #f5f3ff;
  order: 2;
}

.platform-adjustment-field--media {
  --field-accent: #0891b2;
  --field-accent-bg: #ecfeff;
  order: 3;
}

.platform-adjustment-field--caption {
  --field-accent: #16a34a;
  --field-accent-bg: #f0fdf4;
  order: 4;
}

.target-template-preview {
  margin-top: 0.45rem;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  font-weight: 400;
}

.target-template-preview summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 600;
}

.target-template-preview pre {
  margin: 0.55rem 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  font: inherit;
  line-height: 1.55;
}

.target-media-picker {
  margin-top: 0.75rem;
}

.target-media-picker__control {
  display: block;
}

.target-media-preview {
  display: none;
  margin-top: 0.5rem;
  min-height: 72px;
}

.platform-adjustment-live-preview {
  padding: 0.85rem;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

.platform-adjustment-live-preview__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  color: var(--text);
  font-size: 0.82rem;
}

.platform-adjustment-live-preview__head strong {
  font-size: 0.92rem;
}

.platform-adjustment-live-preview__head span {
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.platform-adjustment-live-preview__device {
  width: 100%;
  max-width: 330px;
}

.platform-adjustment-live-preview__schedule {
  max-width: 330px;
  margin-inline: auto;
}

.platform-adjustment-live-preview__fallback,
.platform-adjustment-live-preview:empty::before {
  display: grid;
  place-items: center;
  min-height: 18rem;
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.84rem;
  text-align: center;
}

.platform-adjustment-live-preview:empty::before {
  content: 'プレビューを準備中です';
}

@media (max-width: 1023px) {
  .platform-adjustment-card,
  .platform-adjustment-card[data-platform="instagram"],
  .platform-adjustment-card:not([data-platform="instagram"]) {
    max-width: none;
    margin-inline: 0;
    overflow: hidden;
    border-color: var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    box-shadow: var(--shadow-sm);
  }

  .platform-adjustment-card > .platform-adjustment-live-preview {
    display: none;
  }

  .platform-adjustment-card > .platform-adjustment-preview-top {
    display: none !important;
  }

  .platform-adjustment-card[data-platform="instagram"] .platform-adjustment-title {
    grid-template-columns: auto minmax(0, 1fr) auto;
    margin: 0;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
  }

  .platform-adjustment-card[data-platform="instagram"] .platform-adjustment-title strong {
    color: var(--text);
  }

  .platform-adjustment-card[data-platform="instagram"] .platform-adjustment-title small,
  .platform-adjustment-card[data-platform="instagram"] .form-hint,
  .platform-adjustment-card[data-platform="instagram"] .caption-counter,
  .platform-adjustment-card[data-platform="instagram"] .text-muted {
    color: var(--text-muted) !important;
  }

  .platform-adjustment-card[data-platform="instagram"] > label,
  .platform-adjustment-card[data-platform="instagram"] > .target-media-picker {
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
  }

  .platform-adjustment-card[data-platform="instagram"] .target-template-preview {
    border-color: var(--border);
    background: var(--bg-elevated);
  }

  .platform-adjustment-card[data-platform="instagram"] .target-template-preview summary,
  .platform-adjustment-card[data-platform="instagram"] .target-template-preview pre {
    color: var(--text);
  }

  .platform-adjustment-card[data-platform="instagram"] .form-control,
  .platform-adjustment-card[data-platform="instagram"] .schedule-date-input,
  .platform-adjustment-card[data-platform="instagram"] .schedule-time-select {
    border-color: var(--border);
    background: var(--bg);
    color: var(--text);
  }
}

@media (min-width: 1024px) {
  .platform-adjustment-card,
  .platform-adjustment-card[data-platform="instagram"],
  .platform-adjustment-card:not([data-platform="instagram"]) {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    align-items: start;
    max-width: none;
    margin-inline: 0;
    overflow: hidden;
    border-color: var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    box-shadow: var(--shadow-sm);
  }

  .platform-adjustment-card:not(.is-edit-open),
  .platform-adjustment-card[data-platform="instagram"]:not(.is-edit-open),
  .platform-adjustment-card:not([data-platform="instagram"]):not(.is-edit-open) {
    display: block;
  }

  .platform-adjustment-card:not(.is-edit-open) > .platform-adjustment-title {
    grid-column: auto;
  }

  .platform-adjustment-card > .platform-adjustment-preview-top {
    display: none !important;
  }

  .platform-adjustment-card > .platform-adjustment-live-preview {
    grid-column: 1;
    grid-row: 2 / span 20;
    align-self: stretch;
    min-height: 100%;
    padding: 1rem;
    border-top: 0;
    border-right: 1px solid var(--border);
    background: var(--bg-elevated);
  }

  .platform-preview-modal-button {
    display: none;
  }

  .platform-adjustment-card > :not(.platform-adjustment-live-preview) {
    grid-column: 2;
  }

  .platform-adjustment-card[data-platform="instagram"] .platform-adjustment-title {
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
  }

  .platform-adjustment-card[data-platform="instagram"] .platform-adjustment-title strong {
    color: var(--text);
  }

  .platform-adjustment-card[data-platform="instagram"] .platform-adjustment-title small,
  .platform-adjustment-card[data-platform="instagram"] .form-hint,
  .platform-adjustment-card[data-platform="instagram"] .caption-counter,
  .platform-adjustment-card[data-platform="instagram"] .text-muted {
    color: var(--text-muted) !important;
  }

  .platform-adjustment-card[data-platform="instagram"] > label,
  .platform-adjustment-card[data-platform="instagram"] > .target-media-picker {
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
  }

  .platform-adjustment-card[data-platform="instagram"] .target-template-preview {
    border-color: var(--border);
    background: var(--bg-elevated);
  }

  .platform-adjustment-card[data-platform="instagram"] .target-template-preview summary,
  .platform-adjustment-card[data-platform="instagram"] .target-template-preview pre {
    color: var(--text);
  }

  .platform-adjustment-card[data-platform="instagram"] .form-control,
  .platform-adjustment-card[data-platform="instagram"] .schedule-date-input,
  .platform-adjustment-card[data-platform="instagram"] .schedule-time-select {
    border-color: var(--border);
    background: var(--bg);
    color: var(--text);
  }
}

.platform-adjustment-card .platform-adjustment-title,
.platform-adjustment-card[data-platform="instagram"] .platform-adjustment-title,
.platform-adjustment-card:not([data-platform="instagram"]) .platform-adjustment-title {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.75rem;
}

.platform-adjustment-card:not(.is-edit-open) .platform-adjustment-title,
.platform-adjustment-card[data-platform="instagram"]:not(.is-edit-open) .platform-adjustment-title,
.platform-adjustment-card:not([data-platform="instagram"]):not(.is-edit-open) .platform-adjustment-title {
  min-height: 4.5rem;
  padding: 0.8rem 0.95rem;
}

.platform-adjustment-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
}

.platform-adjustment-card .platform-adjustment-avatar .sns-avatar,
.platform-adjustment-card[data-platform="instagram"] .platform-adjustment-avatar .sns-avatar {
  width: 2.25rem !important;
  height: 2.25rem !important;
  border: 0 !important;
}

.platform-adjustment-title-text,
.platform-adjustment-title-text strong,
.platform-adjustment-title-text small {
  display: block;
  min-width: 0;
  overflow: hidden;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-adjustment-title-text strong {
  font-size: 0.9rem;
}

.platform-adjustment-title-text small {
  margin-top: 0.1rem;
  font-size: 0.76rem;
}

.platform-adjustment-title-actions {
  align-self: center;
}

.carousel-media-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
  max-width: 620px;
  margin-top: 0.75rem;
}

.carousel-media-grid[hidden] {
  display: none;
}

.carousel-media-slot {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  width: 100%;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
}

.carousel-media-slot:hover,
.carousel-media-slot:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
  outline: none;
}

.carousel-media-slot.has-media {
  border-style: solid;
  background: #111827;
}

.carousel-media-slot img,
.carousel-media-slot video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-media-slot__plus {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
}

.carousel-media-slot__order,
.carousel-media-slot__remove {
  position: absolute;
  display: inline-grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.carousel-media-slot__order {
  left: 0.35rem;
  top: 0.35rem;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.25rem;
  border-radius: 999px;
}

.carousel-media-slot__remove {
  right: 0.35rem;
  top: 0.35rem;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
}

@media (max-width: 640px) {
  .carousel-media-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.auto-resize-textarea {
  min-height: 96px;
  overflow: hidden;
  resize: vertical;
}

#caption.auto-resize-textarea {
  min-height: 140px;
}

.common-hashtags-group {
  margin-top: 0.85rem;
}

.common-field-emphasis {
  color: var(--primary);
  font-weight: 800;
}

.common-hashtags-input.auto-resize-textarea {
  min-height: 72px;
}

.caption-counter {
  display: inline-block;
  margin-top: 0.35rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.caption-counter.is-over-limit {
  color: var(--danger);
}

.caption-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.caption-label-row label {
  margin-bottom: 0;
}

.target-caption-toggle {
  margin: 0.45rem 0;
}

.platform-adjustment-card.is-caption-collapsed .target-caption {
  height: 7.25rem !important;
  min-height: 7.25rem;
  overflow: hidden;
}

.media-type-hint {
  display: block;
  margin-top: 0.75rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #dbe3ef;
  border-radius: var(--radius);
  background: #f8fafc;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.6;
}

.media-type-choice-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.media-type-choice-fieldset legend {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  color: var(--text);
}

.media-type-choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
  margin-top: 0.75rem;
  max-width: none;
}

.media-type-choice-grid--target {
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.55rem;
}

@media (min-width: 760px) {
  .media-type-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .post-create-wizard--linear .media-type-choice-grid,
  .post-editor-form .media-type-choice-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.media-type-choice {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  width: 100%;
  min-height: 7.2rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.media-type-choice--compact {
  grid-template-columns: 2.65rem minmax(0, 1fr);
  min-height: 5.75rem;
  padding: 0.7rem;
  gap: 0.65rem;
}

.media-type-choice:hover {
  border-color: var(--primary);
  background: #f8fafc;
}

.media-type-choice:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.media-type-choice:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.media-type-choice.is-active {
  border-color: var(--primary);
  background: var(--primary-muted);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.16);
}

.media-type-choice__icon {
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--primary);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
}

.media-type-choice.is-active .media-type-choice__icon {
  border-color: var(--primary);
  background: var(--bg-elevated);
}

.media-type-choice__body {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.media-type-choice__label {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
}

.media-type-choice__code {
  display: inline-flex;
  width: fit-content;
  padding: 0.08rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.25;
}

.media-type-choice__description {
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.45;
}

.media-type-choice__hint {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.media-type-choice--compact .media-type-choice__icon {
  width: 2.65rem;
  height: 2.65rem;
  font-size: 0.82rem;
}

.media-type-choice--compact .media-type-choice__description {
  font-size: 0.78rem;
}

.target-media-picker .media-file-actions {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
}

.carousel-media-grid--target {
  max-width: none;
}

.edit-preview-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.edit-preview-actions .form-hint {
  margin: 0;
}

.floating-ops-menu {
  position: fixed;
  right: 1.35rem;
  bottom: 1.35rem;
  z-index: 65;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.7rem;
}

.floating-ops-menu__panel {
  width: min(220px, calc(100vw - 2rem));
  padding: 0.55rem;
  border: 1px solid rgba(79, 99, 255, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(14px);
  display: grid;
  gap: 0.4rem;
}

.floating-ops-menu__panel[hidden] {
  display: none;
}

.floating-ops-menu__item {
  width: 100%;
  min-height: 2.75rem;
  padding: 0 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
}

.floating-ops-menu__item:hover,
.floating-ops-menu__item:focus-visible {
  border-color: rgba(79, 99, 255, 0.42);
  background: #f6f8ff;
}

.floating-ops-menu__item--primary {
  border-color: rgba(79, 99, 255, 0.42);
  background: #4f63ff;
  color: #fff;
}

.floating-ops-menu__item--primary:hover,
.floating-ops-menu__item--primary:focus-visible {
  background: #3f51db;
  color: #fff;
}

.floating-ops-menu__toggle {
  width: 3.55rem;
  height: 3.55rem;
  border: 1px solid rgba(79, 99, 255, 0.38);
  border-radius: 999px;
  background: #4f63ff;
  color: #fff;
  box-shadow: 0 16px 34px rgba(79, 99, 255, 0.3);
  font: inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
  gap: 0;
}

.floating-ops-menu__toggle:hover,
.floating-ops-menu__toggle:focus-visible {
  background: #3f51db;
}

.floating-ops-menu__toggle:focus-visible,
.floating-ops-menu__item:focus-visible {
  outline: 3px solid rgba(79, 99, 255, 0.32);
  outline-offset: 3px;
}

.floating-ops-menu__bar {
  display: block;
  width: 1.45rem;
  height: 2px;
  margin: 2px 0;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.floating-ops-menu.is-open .floating-ops-menu__bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.floating-ops-menu.is-open .floating-ops-menu__bar:nth-child(2) {
  opacity: 0;
}

.floating-ops-menu.is-open .floating-ops-menu__bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 640px) {
  .floating-ops-menu {
    right: 0.85rem;
    bottom: 0.85rem;
  }

  .floating-ops-menu__toggle {
    width: 3.25rem;
    height: 3.25rem;
  }

  .wizard-actions {
    align-items: stretch;
  }

  .wizard-actions .btn,
  .wizard-actions a.btn {
    flex: 1 1 10rem;
    justify-content: center;
  }
}

.edit-preview-modal[hidden] {
  display: none;
}

.edit-preview-modal {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.edit-preview-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
}

.edit-preview-modal__panel {
  position: relative;
  width: min(100%, 760px);
  max-height: min(92vh, 920px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
}

.edit-preview-modal__head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.edit-preview-modal__head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.edit-preview-modal__head .form-hint {
  margin: 0.25rem 0 0;
}

.edit-preview-modal__body {
  padding: 1rem;
}

.platform-preview-modal__panel {
  width: min(100%, 460px);
}

.platform-preview-modal__content {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
}

.platform-preview-modal__content .platform-adjustment-live-preview__head,
.platform-preview-modal__content .platform-adjustment-live-preview__schedule {
  width: min(100%, 360px);
}

.platform-preview-modal__content .platform-adjustment-live-preview__device {
  max-width: 360px;
}

.edit-preview-grid {
  grid-template-columns: minmax(0, 1fr);
}

.edit-preview-avatar {
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
  background: #4f63ff;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
}

.ig-preview-avatar .edit-preview-avatar {
  width: 2.55rem;
  height: 2.55rem;
  border: 2px solid #fff;
}

.ig-recommend-avatar-button .edit-preview-avatar {
  width: 100%;
  height: 100%;
  border: 0;
}

body.edit-preview-open {
  overflow: hidden;
}

.post-preview-card {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.post-preview-device {
  display: flex;
  flex-direction: column;
  width: min(100%, 390px);
  max-width: 390px;
  aspect-ratio: 9 / 16;
  height: auto;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 0.7rem;
  overflow: hidden;
  border: 10px solid #111827;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
}

.post-preview-device::before {
  content: '';
  display: block;
  flex: 0 0 auto;
  width: 4.5rem;
  height: 0.28rem;
  margin: 0 auto 0.65rem;
  border-radius: 999px;
  background: #111827;
  opacity: 0.9;
}

.post-preview-device > .post-preview-head,
.post-preview-device > .post-preview-media-type {
  flex: 0 0 auto;
}

.post-preview-device > .post-preview-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.post-preview-device--instagram {
  width: min(100%, 390px);
  max-width: 390px;
  padding: 0;
  border: 10px solid #111827;
  border-radius: 28px;
  background: #080b10;
  color: #f8fafc;
  box-shadow: 0 16px 34px rgba(2, 6, 23, 0.22);
  overflow: hidden;
}

.post-preview-device--instagram::before {
  display: none;
}

.ig-preview-topbar {
  position: relative;
  display: grid;
  grid-template-columns: 3rem 1fr 3rem;
  align-items: center;
  min-height: 4.45rem;
  padding: 0.7rem 0.35rem 0.65rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.17);
}

.ig-preview-back {
  width: 1.55rem;
  height: 1.55rem;
  margin-left: 0.75rem;
  border-left: 4px solid #fff;
  border-bottom: 4px solid #fff;
  transform: rotate(45deg);
}

.ig-preview-topbar-text {
  display: grid;
  justify-items: center;
  min-width: 0;
  line-height: 1.2;
}

.ig-preview-topbar-text strong {
  font-size: 1.2rem;
  font-weight: 800;
}

.ig-preview-topbar-text small {
  display: block;
  max-width: 100%;
  margin-top: 0.18rem;
  overflow: hidden;
  color: #e5e7eb;
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ig-preview-account-row {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) 2.1rem;
  align-items: center;
  gap: 0.55rem;
  padding: 0.9rem 0.95rem;
}

.ig-preview-avatar {
  display: grid;
  place-items: center;
}

.ig-preview-avatar .sns-avatar {
  width: 2.55rem !important;
  height: 2.55rem !important;
  border: 2px solid #fff;
}

.ig-preview-account-text {
  min-width: 0;
}

.ig-preview-account-text strong,
.ig-preview-account-text small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ig-preview-account-text strong {
  font-size: 1rem;
  font-weight: 800;
}

.ig-preview-account-text small {
  margin-top: 0.12rem;
  color: #d1d5db;
  font-size: 0.86rem;
}

.ig-preview-menu {
  justify-self: end;
  padding: 0.2rem 0;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1;
}

.ig-preview-menu:focus-visible {
  outline: 2px solid #4f63ff;
  outline-offset: 3px;
  border-radius: 0.25rem;
}

.post-preview-device--instagram .post-preview-media {
  min-height: 300px;
  margin: 0;
  background: #111827;
}

.post-preview-device--instagram .post-preview-media img,
.post-preview-device--instagram .post-preview-media video {
  width: 100%;
  max-width: none;
  height: auto;
  max-height: 520px;
  object-fit: cover;
}

.post-preview-device--instagram .post-preview-media video {
  aspect-ratio: 4 / 5;
}

.post-preview-device--instagram .post-preview-media span:not(.post-preview-media-count) {
  padding: 4rem 1rem;
  color: #cbd5e1;
}

.ig-preview-promote-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.85rem 1rem 0.8rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.ig-preview-insight {
  min-width: 0;
  overflow: hidden;
  color: #6f8dff;
  font-weight: 800;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ig-preview-promote {
  flex-shrink: 0;
  min-height: 2.7rem;
  padding: 0 1rem;
  border: 0;
  border-radius: 0.55rem;
  background: #4f63ff;
  color: #fff;
  font: inherit;
  font-weight: 800;
}

.ig-preview-dots {
  display: flex;
  justify-content: center;
  gap: 0.38rem;
  padding: 0.75rem 0 0.45rem;
}

.ig-preview-dots span {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 999px;
  background: #4b5563;
}

.ig-preview-dots .is-active {
  background: #4f63ff;
}

.ig-preview-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1rem 0.3rem;
}

.ig-preview-actions-left {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.ig-preview-action {
  position: relative;
  display: inline-block;
  width: 1.9rem;
  height: 1.9rem;
  color: #fff;
}

.ig-preview-action--heart::before,
.ig-preview-action--heart::after {
  content: '';
  position: absolute;
}

.ig-preview-action--heart::before {
  content: '♥';
  inset: auto;
  left: 0;
  top: -0.28rem;
  color: #ef4444;
  background: transparent;
  font-size: 2.35rem;
  line-height: 1;
  transform: none;
}

.ig-preview-action--heart::after {
  display: none;
}

.ig-preview-action--comment::before {
  content: '';
  position: absolute;
  inset: 0.22rem 0.22rem 0.34rem;
  border: 3px solid currentColor;
  border-radius: 50%;
}

.ig-preview-action--comment::after {
  content: '';
  position: absolute;
  left: 1.12rem;
  bottom: 0.22rem;
  width: 0.42rem;
  height: 0.42rem;
  border-left: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  background: #080b10;
  transform: rotate(-20deg);
}

.ig-preview-action--share::before {
  content: '➤';
  position: absolute;
  left: -0.02rem;
  top: -0.16rem;
  font-size: 2rem;
  line-height: 1;
  transform: rotate(-22deg);
}

.ig-preview-action--share::after {
  display: none;
}

.ig-preview-action--save::before {
  content: '';
  position: absolute;
  inset: 0.18rem 0.3rem;
  border: 3px solid currentColor;
  border-bottom: 0;
}

.ig-preview-action--save::after {
  content: '';
  position: absolute;
  left: 0.59rem;
  right: 0.59rem;
  bottom: 0.18rem;
  height: 0.82rem;
  border-left: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: rotate(-45deg);
}

.ig-preview-caption {
  margin: 0;
  padding: 0.4rem 1rem 1.25rem;
  color: #f8fafc;
  font-size: 0.98rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.ig-preview-caption strong {
  font-weight: 800;
}

.post-preview-device--instagram-recommend {
  width: min(100%, 390px);
  max-width: 390px;
  aspect-ratio: 9 / 16;
  border-radius: 28px;
  background: #05070a;
}

.ig-recommend-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: #05070a;
}

.ig-recommend-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.36), transparent 28%, transparent 54%, rgba(0, 0, 0, 0.78));
  pointer-events: none;
}

.post-preview-device--instagram-recommend .post-preview-media {
  position: absolute;
  inset: 0;
  min-height: 100%;
  margin: 0;
  background: #111827;
}

.post-preview-device--instagram-recommend .post-preview-media img,
.post-preview-device--instagram-recommend .post-preview-media video {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
}

.post-preview-device--instagram-recommend .post-preview-media > span:not(.post-preview-media-count) {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  padding: 1rem;
}

.ig-recommend-topbar {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 4.3rem;
  padding: 1rem 1rem 0.7rem;
  color: #fff;
}

.ig-recommend-topbar strong {
  font-size: 1rem;
  font-weight: 800;
}

.ig-recommend-topbar span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.86rem;
  font-weight: 700;
}

.ig-recommend-camera {
  justify-self: end;
  position: relative;
  width: 1.45rem;
  height: 1.05rem;
  border: 2px solid #fff;
  border-radius: 0.25rem;
}

.ig-recommend-camera::before {
  content: '';
  position: absolute;
  top: 0.26rem;
  left: 0.42rem;
  width: 0.35rem;
  height: 0.35rem;
  border: 2px solid #fff;
  border-radius: 50%;
}

.ig-recommend-side-actions {
  position: absolute;
  z-index: 3;
  right: 0.78rem;
  bottom: 7.2rem;
  display: grid;
  justify-items: center;
  gap: 0.78rem;
  color: #fff;
}

.ig-recommend-avatar-button {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #111827;
  cursor: pointer;
  overflow: hidden;
}

.ig-recommend-avatar-button .sns-avatar {
  width: 100% !important;
  height: 100% !important;
}

.ig-recommend-action-stack {
  display: grid;
  justify-items: center;
  gap: 0.12rem;
  min-width: 2.3rem;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

.ig-recommend-action-stack .ig-preview-action {
  width: 2.05rem;
  height: 2.05rem;
}

.ig-recommend-action-stack small {
  min-height: 0.9rem;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
}

.ig-recommend-bottom {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 4.15rem;
  bottom: 0;
  display: grid;
  gap: 0.45rem;
  padding: 0 1rem 1.2rem;
  color: #fff;
}

.ig-recommend-account {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.ig-recommend-account strong {
  overflow: hidden;
  font-size: 0.95rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ig-recommend-account span {
  flex-shrink: 0;
  padding: 0.18rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 800;
}

.ig-recommend-caption {
  display: -webkit-box;
  max-height: 4.3rem;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 0.86rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.ig-recommend-audio {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.78rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-preview-device--instagram-discover,
.post-preview-device--instagram-profile {
  width: min(100%, 390px);
  max-width: 390px;
  aspect-ratio: 9 / 16;
  min-height: 0;
  border-radius: 28px;
  background: #ffffff;
  color: #111827;
  box-shadow: 0 16px 34px rgba(2, 6, 23, 0.18);
}

.ig-discover-topbar,
.ig-profile-topbar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 3.65rem;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
}

.ig-discover-search {
  flex: 1 1 auto;
  min-height: 2.2rem;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.88rem;
  font-weight: 700;
}

.ig-discover-icon {
  position: relative;
  width: 1.55rem;
  height: 1.55rem;
  flex: 0 0 auto;
}

.ig-discover-icon::before {
  content: '';
  position: absolute;
  inset: 0.2rem 0.35rem 0.4rem 0.15rem;
  border: 2px solid #111827;
  border-radius: 50%;
}

.ig-discover-icon::after {
  content: '';
  position: absolute;
  right: 0.18rem;
  bottom: 0.26rem;
  width: 0.58rem;
  height: 2px;
  border-radius: 999px;
  background: #111827;
  transform: rotate(45deg);
}

.ig-discover-grid,
.ig-profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  background: #e5e7eb;
}

.ig-discover-grid {
  grid-auto-rows: 118px;
}

.ig-profile-grid {
  grid-auto-rows: 112px;
}

.ig-preview-grid-tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #f8fafc;
}

.ig-preview-grid-tile.is-primary {
  grid-row: span 2;
  grid-column: span 2;
}

.ig-preview-grid-tile .post-preview-media {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #111827;
}

.ig-preview-grid-tile .post-preview-media img,
.ig-preview-grid-tile .post-preview-media video {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
}

.ig-preview-grid-tile .post-preview-media > span:not(.post-preview-media-count) {
  display: grid;
  height: 100%;
  place-items: center;
  padding: 0.5rem;
  color: #cbd5e1;
  font-size: 0.76rem;
  text-align: center;
}

.ig-preview-grid-tile--placeholder {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(14, 165, 233, 0.08)),
    #f8fafc;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
}

.ig-discover-note {
  display: grid;
  gap: 0.18rem;
  padding: 0.75rem 0.85rem 0.95rem;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
}

.ig-discover-note strong,
.ig-discover-note span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ig-discover-note strong {
  font-size: 0.9rem;
  font-weight: 800;
}

.ig-discover-note span {
  color: #64748b;
  font-size: 0.78rem;
}

.ig-profile-topbar {
  justify-content: space-between;
}

.ig-profile-topbar strong {
  min-width: 0;
  overflow: hidden;
  font-size: 1rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ig-profile-topbar span {
  font-size: 1.3rem;
  font-weight: 900;
}

.ig-profile-head {
  display: grid;
  grid-template-columns: 5.2rem minmax(0, 1fr);
  gap: 0.85rem;
  align-items: center;
  padding: 0.95rem 0.85rem 0.65rem;
  background: #ffffff;
}

.ig-profile-avatar {
  display: grid;
  place-items: center;
}

.ig-profile-avatar .sns-avatar {
  width: 4.6rem !important;
  height: 4.6rem !important;
  border: 3px solid #e5e7eb;
}

.ig-profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  text-align: center;
}

.ig-profile-stats strong,
.ig-profile-stats small {
  display: block;
}

.ig-profile-stats strong {
  font-size: 0.96rem;
  font-weight: 900;
}

.ig-profile-stats small {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 700;
}

.ig-profile-bio {
  display: -webkit-box;
  max-height: 3.9rem;
  margin: 0;
  overflow: hidden;
  padding: 0 0.85rem 0.75rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: #334155;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.ig-profile-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  padding: 0 0.85rem 0.8rem;
}

.ig-profile-actions span {
  display: grid;
  min-height: 2rem;
  place-items: center;
  border-radius: 8px;
  background: #f1f5f9;
  color: #111827;
  font-size: 0.78rem;
  font-weight: 800;
}

.ig-profile-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
}

.ig-profile-tabs span {
  display: grid;
  min-height: 2.35rem;
  place-items: center;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 900;
}

.ig-profile-tabs .is-active {
  color: #111827;
  box-shadow: inset 0 -2px 0 #111827;
}

.post-preview-device--facebook {
  padding: 0;
  background: #f0f2f5;
  color: #111827;
}

.fb-preview-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.85rem;
  background: #ffffff;
}

.fb-preview-topbar strong {
  color: #1877f2;
  font-size: 1.25rem;
  font-weight: 900;
}

.fb-preview-topbar span {
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  background: #f0f2f5;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
}

.fb-preview-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #ffffff;
  border-bottom: 1px solid #dbe3ef;
}

.fb-preview-tabs span {
  display: grid;
  min-height: 2.4rem;
  place-items: center;
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 800;
}

.fb-preview-tabs .is-active {
  color: #1877f2;
  box-shadow: inset 0 -3px 0 #1877f2;
}

.fb-preview-post {
  margin: 0.7rem;
  overflow: hidden;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.fb-preview-post-head {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.75rem;
}

.fb-preview-avatar .sns-avatar,
.threads-preview-avatar .sns-avatar,
.yt-preview-avatar .sns-avatar,
.tt-preview-avatar .sns-avatar {
  width: 2.35rem !important;
  height: 2.35rem !important;
}

.fb-preview-post-head strong,
.fb-preview-post-head small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fb-preview-post-head strong {
  font-size: 0.88rem;
  font-weight: 900;
}

.fb-preview-post-head small {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
}

.fb-preview-menu {
  color: #64748b;
  font-size: 1.3rem;
  font-weight: 900;
}

.fb-preview-caption {
  margin: 0;
  padding: 0 0.75rem 0.75rem;
  color: #111827;
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.fb-preview-media {
  min-height: 220px;
  margin: 0;
  border-radius: 0;
  background: #e5e7eb;
}

.fb-preview-media img,
.fb-preview-media video {
  width: 100%;
  max-width: none;
  max-height: 320px;
  object-fit: cover;
}

.fb-preview-stats,
.fb-preview-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0.75rem;
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 700;
}

.fb-preview-stats {
  padding: 0.65rem 0 0.55rem;
  border-bottom: 1px solid #e5e7eb;
}

.fb-preview-actions {
  padding: 0.58rem 0;
}

.post-preview-device--threads {
  padding: 0;
  background: #ffffff;
  color: #111827;
}

.threads-preview-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.4rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid #e5e7eb;
}

.threads-preview-topbar strong {
  font-size: 1.05rem;
  font-weight: 900;
}

.threads-preview-topbar span {
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 800;
}

.threads-preview-thread {
  display: grid;
  grid-template-columns: 2.7rem minmax(0, 1fr);
  gap: 0.6rem;
  padding: 0.95rem 0.85rem;
}

.threads-preview-avatar-col {
  display: grid;
  justify-items: center;
  grid-template-rows: auto 1fr;
  gap: 0.45rem;
}

.threads-preview-line {
  width: 2px;
  min-height: 12rem;
  border-radius: 999px;
  background: #dbe3ef;
}

.threads-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.threads-preview-head strong {
  min-width: 0;
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.threads-preview-head span {
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 700;
}

.threads-preview-caption {
  margin: 0.35rem 0 0.7rem;
  font-size: 0.92rem;
  line-height: 1.48;
  white-space: pre-wrap;
  word-break: break-word;
}

.threads-preview-media {
  min-height: 210px;
  margin: 0 0 0.65rem;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #f8fafc;
}

.threads-preview-media img,
.threads-preview-media video {
  width: 100%;
  max-width: none;
  max-height: 300px;
  object-fit: cover;
}

.threads-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 800;
}

.threads-preview-reply {
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid #eef2f7;
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 700;
}

.post-preview-device--youtube {
  padding: 0;
  background: #ffffff;
  color: #0f0f0f;
}

.yt-preview-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.35rem;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid #e5e7eb;
}

.yt-preview-topbar strong {
  color: #ff0000;
  font-size: 1.05rem;
  font-weight: 900;
}

.yt-preview-topbar span {
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 800;
}

.yt-preview-player {
  position: relative;
  min-height: 220px;
  margin: 0;
  border-radius: 0;
  background: #0f0f0f;
}

.yt-preview-player img,
.yt-preview-player video {
  width: 100%;
  max-width: none;
  max-height: 280px;
  object-fit: cover;
}

.yt-preview-player > span:not(.post-preview-media-count):not(.yt-preview-player-meta) {
  color: #e5e7eb;
}

.yt-preview-player-meta {
  position: absolute;
  right: 0.55rem;
  bottom: 0.55rem;
  padding: 0.18rem 0.45rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.76);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.yt-preview-title {
  display: -webkit-box;
  margin: 0;
  padding: 0.85rem 0.85rem 0.35rem;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 0.98rem;
  line-height: 1.35;
}

.yt-preview-stats {
  padding: 0 0.85rem 0.8rem;
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 700;
}

.yt-preview-channel {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.75rem 0.85rem;
  border-top: 1px solid #eef2f7;
  border-bottom: 1px solid #eef2f7;
}

.yt-preview-channel strong,
.yt-preview-channel small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yt-preview-channel strong {
  font-size: 0.88rem;
  font-weight: 900;
}

.yt-preview-channel small {
  color: #64748b;
  font-size: 0.72rem;
}

.yt-preview-channel > span:last-child {
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: #0f0f0f;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 900;
}

.yt-preview-actions {
  display: flex;
  gap: 0.5rem;
  overflow: hidden;
  padding: 0.75rem 0.85rem;
}

.yt-preview-actions span {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.5rem 0.35rem;
  border-radius: 999px;
  background: #f1f5f9;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 900;
}

.yt-preview-description {
  display: -webkit-box;
  margin: 0 0.85rem 0.85rem;
  padding: 0.7rem;
  overflow: hidden;
  border-radius: 10px;
  background: #f8fafc;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  color: #334155;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-preview-device--tiktok {
  padding: 0;
  aspect-ratio: 9 / 16;
  background: #05070a;
  color: #ffffff;
}

.tt-preview-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: #05070a;
}

.tt-preview-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.32), transparent 28%, transparent 58%, rgba(0, 0, 0, 0.84));
  pointer-events: none;
}

.tt-preview-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  border-radius: 0;
  background: #111827;
}

.tt-preview-media img,
.tt-preview-media video {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
}

.tt-preview-media > span:not(.post-preview-media-count) {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  padding: 1rem;
  color: #cbd5e1;
}

.tt-preview-topbar {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 4rem;
  padding: 1rem 0.9rem 0.65rem;
}

.tt-preview-topbar span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.76rem;
  font-weight: 800;
}

.tt-preview-topbar span:last-child {
  justify-self: end;
}

.tt-preview-topbar strong {
  font-size: 0.96rem;
  font-weight: 900;
}

.tt-preview-side {
  position: absolute;
  z-index: 3;
  right: 0.72rem;
  bottom: 7rem;
  display: grid;
  justify-items: center;
  gap: 0.72rem;
}

.tt-preview-side > span:not(.tt-preview-avatar) {
  display: grid;
  place-items: end center;
  width: 2.35rem;
  min-height: 2.35rem;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 900;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

.tt-preview-side > span:not(.tt-preview-avatar)::before {
  content: '';
  display: block;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.1rem;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
}

.tt-preview-avatar {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #111827;
}

.tt-preview-avatar .sns-avatar {
  width: 100% !important;
  height: 100% !important;
}

.tt-preview-bottom {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 4.1rem;
  bottom: 0;
  display: grid;
  gap: 0.4rem;
  padding: 0 0.9rem 1.05rem;
}

.tt-preview-bottom strong {
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tt-preview-bottom p {
  display: -webkit-box;
  max-height: 4.2rem;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.tt-preview-bottom span {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.74rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-preview-body {
  padding: 0.75rem;
  margin-bottom: 0.85rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.post-preview-card[data-platform="x"] .post-preview-body,
.post-preview-card[data-platform="threads"] .post-preview-body,
.post-preview-card[data-platform="facebook"] .post-preview-body {
  background: #fff;
}

.post-preview-card[data-platform="instagram"] .post-preview-body,
.post-preview-card[data-platform="tiktok"] .post-preview-body,
.post-preview-card[data-platform="youtube"] .post-preview-body {
  padding: 0;
  overflow: hidden;
  background: #fff;
}

.post-preview-media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 92px;
  margin-bottom: 0.85rem;
  color: var(--text-muted);
  word-break: break-all;
}

.post-preview-body--text-first .post-preview-media {
  margin: 0.75rem 0 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.post-preview-body--media-first .post-preview-media {
  margin-bottom: 0;
  min-height: 180px;
  background: var(--bg);
}

.post-preview-media[data-media-type="CAROUSEL"] {
  display: grid;
  place-items: center;
}

.post-preview-media img,
.post-preview-media video {
  display: block;
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
}

.post-preview-media .post-preview-demo-media {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
}

.post-preview-caption {
  white-space: pre-wrap;
  margin: 0;
  line-height: 1.55;
}

.post-preview-body--media-first .post-preview-caption {
  padding: 0.85rem;
}

.post-preview-media-count {
  position: absolute;
  right: 0.65rem;
  top: 0.65rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
}

.post-preview-media-type {
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.preview-main-schedule {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.75rem 0 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.media-edit-modal[hidden] {
  display: none;
}

.media-edit-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.media-edit-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.media-edit-modal__panel {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  max-height: min(760px, 90vh);
  overflow: auto;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.media-edit-modal__head,
.media-edit-modal__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.media-edit-modal__head {
  margin-bottom: 0.85rem;
}

.media-edit-modal__head h3 {
  margin: 0;
  font-size: 1rem;
}

.media-edit-list {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.media-edit-empty {
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  background: var(--bg);
}

.media-edit-item {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.media-edit-thumb {
  display: grid;
  place-items: center;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: var(--radius-sm);
  background: #e5e7eb;
  color: var(--text-muted);
  overflow: hidden;
  font-size: 0.75rem;
}

.media-edit-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-edit-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
}

.media-edit-item-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.preview-main-schedule__label {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.selected-accounts-label {
  font-weight: 700;
  color: var(--text);
  font-size: 0.95rem;
  letter-spacing: 0;
  line-height: 1.35;
  white-space: nowrap;
}

.selected-accounts-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  flex: 1;
  min-width: 0;
}

.selected-accounts-empty {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.selected-account-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.15rem 0.55rem 0.15rem 0.2rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.78rem;
  line-height: 1.2;
  color: var(--text);
  max-width: 100%;
}

.selected-account-chip-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.selected-account-chip-avatar .sns-avatar {
  width: 22px !important;
  height: 22px !important;
}

.selected-account-chip-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 10em;
}

.btn-link-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.2;
  min-height: 2rem;
  padding: 0.4rem 0.85rem;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), transform 0.12s ease;
}

.btn-link-inline:hover {
  background: #eef2ff;
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-link-inline:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-link-inline:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

[data-jump-to-step] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.2;
  min-height: 2rem;
  padding: 0.4rem 0.85rem;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), transform 0.12s ease;
}

[data-jump-to-step]:hover {
  background: #eef2ff;
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
  transform: translateY(-1px);
}

.draft-autosave-indicator.is-saving {
  color: var(--text-secondary);
}

.draft-autosave-indicator.is-saved {
  color: var(--success, #10b981);
}

.draft-autosave-indicator .draft-autosave-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.75;
}

/* ----- Draft list: grouped targets + caption modal ----- */
.drafts-table-wrap table {
  min-width: 1280px;
  table-layout: fixed;
}

.drafts-table-wrap th,
.drafts-table-wrap td {
  word-break: keep-all;
}

.drafts-table-wrap th {
  white-space: nowrap;
}

.drafts-table-wrap .col-draft-id {
  width: 5rem;
  white-space: nowrap;
}

.drafts-table-wrap .col-draft-schedule {
  width: 10rem;
  white-space: nowrap;
}

.drafts-table-wrap .col-draft-actions {
  width: 4.5rem;
}

.draft-group-row td {
  vertical-align: middle;
}

.draft-group-row.is-detail-clickable {
  cursor: pointer;
}

.draft-group-row.is-detail-clickable:hover td,
.draft-group-row.is-detail-clickable:focus-visible td {
  background: var(--bg-elevated);
}

.draft-group-row.is-detail-clickable:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.draft-account-icon-stack {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4rem;
  margin-inline: auto;
}

.draft-account-icon-stack .draft-account-icon {
  margin-left: -0.45rem;
}

.draft-account-icon-stack .draft-account-icon:first-child {
  margin-left: 0;
}

.draft-account-icon-stack .posts-account-icon,
.draft-account-more {
  box-shadow: 0 0 0 2px var(--bg-elevated);
}

.draft-account-more {
  display: inline-grid;
  place-items: center;
  min-width: 1.75rem;
  height: 1.75rem;
  margin-left: -0.35rem;
  padding: 0 0.3rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 800;
}

.draft-title-sub {
  display: block;
  margin-top: 0.22rem;
  color: var(--text-muted);
  font-size: 0.76rem;
}

.draft-target-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
  max-width: 100%;
}

.draft-target-tab {
  display: inline-flex;
  align-items: center;
  max-width: 15rem;
  min-width: 0;
  min-height: 2rem;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem 0.2rem 0.2rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  line-height: 1.2;
}

.draft-target-tab.is-active {
  border-color: var(--primary);
  background: var(--bg-elevated);
  color: var(--primary);
  font-weight: 600;
}

.draft-target-tab .sns-avatar {
  width: 22px !important;
  height: 22px !important;
  flex-shrink: 0;
}

.draft-target-tab span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-target-panel {
  max-width: 28rem;
  white-space: nowrap;
}

.draft-target-panel[hidden] {
  display: none;
}

.draft-target-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.draft-caption-line {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0;
  min-width: 0;
}

.draft-caption-line > span {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-caption-line .btn {
  flex-shrink: 0;
}

.draft-caption-modal[hidden] {
  display: none;
}

.draft-caption-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.draft-caption-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
}

.draft-caption-modal__panel {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  max-height: min(760px, 88vh);
  overflow: auto;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.draft-caption-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.draft-caption-modal__head h3 {
  margin: 0;
  font-size: 1rem;
}

.draft-caption-modal__head .form-hint {
  margin: 0.2rem 0 0;
}

.draft-caption-modal__text {
  max-height: 58vh;
  overflow: auto;
  margin: 0;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.draft-detail-modal[hidden] {
  display: none;
}

.draft-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.draft-detail-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
}

.draft-detail-modal__panel {
  position: relative;
  z-index: 1;
  width: min(90vw, 1180px);
  max-height: min(840px, 90vh);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.draft-detail-modal__head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.draft-detail-modal__head h3 {
  margin: 0;
  font-size: 1rem;
}

.draft-detail-modal__head .form-hint {
  margin: 0.2rem 0 0;
}

.draft-detail-modal__body {
  padding: 1rem;
}

.draft-detail-list {
  display: grid;
  gap: 0.9rem;
}

.draft-detail-post {
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.draft-detail-post__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.draft-detail-post__account {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 0.55rem;
}

.draft-detail-post__account .sns-avatar {
  width: 32px !important;
  height: 32px !important;
  flex-shrink: 0;
}

.draft-detail-post__account strong,
.draft-detail-post__account small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-detail-post__account small {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.draft-detail-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0 0 0.8rem;
}

.draft-detail-meta div {
  min-width: 0;
  padding: 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}

.draft-detail-meta dt {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.draft-detail-meta dd {
  margin: 0.2rem 0 0;
  overflow: hidden;
  color: var(--text);
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-detail-url,
.draft-detail-caption {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.draft-detail-url strong,
.draft-detail-caption strong {
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.draft-detail-url span {
  display: block;
  overflow: hidden;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-detail-caption pre {
  max-height: 18rem;
  overflow: auto;
  margin: 0;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 720px) {
  .draft-detail-post__head {
    flex-direction: column;
  }

  .draft-detail-meta {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ----- Post create: posting mode + account tiles ----- */
.posting-mode-seg {
  display: flex;
  width: 100%;
  max-width: 100%;
  margin: 1rem 0 0.5rem;
  padding: 3px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  gap: 2px;
}

.posting-mode-btn {
  flex: 1;
  margin: 0;
  padding: 0.65rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.posting-mode-btn.is-active {
  background: var(--bg-elevated);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.account-filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 0.7rem;
  width: fit-content;
  margin-bottom: 0.75rem;
  padding: 0.35rem;
  border: 1px solid #dbe3ef;
  border-radius: var(--radius-lg);
  background: #f8fafc;
}

.account-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.account-filter-tab {
  padding: 0.4rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition), box-shadow var(--transition);
}

.account-filter-tab.is-active {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
}

.account-pick-fieldset {
  border: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.account-pick-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 480px) {
  .account-pick-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1180px) {
  .post-create-wizard--linear .account-pick-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1500px) {
  .post-create-wizard--linear .account-pick-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.account-pick-card {
  position: relative;
  border-radius: 14px;
  transition: filter var(--transition), transform 0.14s ease;
}

.account-pick-card:has(.account-pick-radio:checked),
.account-pick-card:has(.account-pick-cb:checked) {
  filter: drop-shadow(0 8px 14px rgba(79, 70, 229, 0.12));
}

.account-pick-face {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 7.25rem;
  padding: 0.95rem 0.85rem 0.85rem;
  margin: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.95)),
    radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.08), transparent 52%);
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 8px 16px rgba(15, 23, 42, 0.04);
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition), transform 0.14s ease;
  -webkit-tap-highlight-color: transparent;
}

.account-pick-face::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 20%, rgba(99, 102, 241, 0.1), transparent 38%);
  opacity: 0;
  transform: none;
  transition: opacity var(--transition);
}

.account-pick-face::after {
  content: "";
  position: absolute;
  right: 0.65rem;
  top: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border: 1px solid rgba(148, 163, 184, 0.55);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 0 0 3px #fff;
}

.account-pick-face:hover {
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 2px 4px rgba(15, 23, 42, 0.05),
    0 12px 20px rgba(15, 23, 42, 0.07);
  transform: translateY(-2px);
}

.account-pick-face:hover::before {
  opacity: 0.8;
}

.account-pick-card:has(.account-pick-radio:checked) .account-pick-face,
.account-pick-card:has(.account-pick-cb:checked) .account-pick-face {
  border-color: rgba(99, 102, 241, 0.7);
  background:
    radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.12), transparent 48%),
    linear-gradient(180deg, #ffffff, #f5f7ff);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    0 0 0 3px rgba(99, 102, 241, 0.08),
    0 10px 18px rgba(79, 70, 229, 0.1);
  transform: translateY(-1px);
}

.account-pick-card:has(.account-pick-radio:checked) .account-pick-face::before,
.account-pick-card:has(.account-pick-cb:checked) .account-pick-face::before {
  opacity: 1;
  transform: none;
}

.account-pick-card:has(.account-pick-radio:checked) .account-pick-face::after,
.account-pick-card:has(.account-pick-cb:checked) .account-pick-face::after {
  content: "✓";
  border-color: rgba(99, 102, 241, 0.3);
  background: #6366f1;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
  box-shadow: 0 4px 8px rgba(79, 70, 229, 0.18);
}

.account-pick-avatar {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(226, 232, 240, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 6px 12px rgba(15, 23, 42, 0.08);
}

.account-pick-avatar .sns-avatar {
  width: 44px !important;
  height: 44px !important;
}

.account-pick-avatar .sns-avatar-badge {
  display: none;
}

.account-platform-icon {
  position: absolute;
  right: -4px;
  bottom: -4px;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.16);
}

.account-platform-icon svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.account-platform-icon--instagram {
  background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af);
}

.account-platform-icon--facebook { background: #1877f2; }
.account-platform-icon--threads { background: #0a0a0a; }
.account-platform-icon--x { background: #0a0a0a; }
.account-platform-icon--tiktok { background: #0f0f0f; }
.account-platform-icon--youtube { background: #ff0000; }

.account-pick-badge {
  flex-shrink: 0;
  min-width: 2.1rem;
  padding: 0.2rem 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  color: #fff;
  border-radius: var(--radius-sm);
  line-height: 1.2;
}

.account-pick-badge--ig { background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af); }
.account-pick-badge--fb { background: #1877f2; }
.account-pick-badge--th { background: #0a0a0a; }
.account-pick-badge--x { background: #0a0a0a; }
.account-pick-badge--tk { background: #0f0f0f; }
.account-pick-badge--yt { background: #ff0000; }

.account-pick-name {
  width: 100%;
  max-width: 100%;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.28;
  text-align: center;
  word-break: break-word;
}

.account-pick-card:has(.account-pick-radio:checked) .account-pick-name,
.account-pick-card:has(.account-pick-cb:checked) .account-pick-name {
  color: #312e81;
}

/* ----- Media preview (post create/edit) ----- */
.media-preview-wrap { margin-top: 0.5rem; }

.media-preview-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.media-preview {
  display: inline-block;
  max-width: 100%;
  padding: 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 80px;
}

.target-media-preview.media-preview {
  display: none !important;
}

.media-preview-placeholder {
  display: block;
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: 1rem;
}

.media-preview img,
.media-preview video { display: block; border-radius: var(--radius-sm); }

.settings-platform-template-grid {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.75rem;
}

@media (min-width: 900px) {
  .settings-platform-template-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.settings-platform-template {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.settings-platform-template__textarea {
  margin-top: 0.35rem;
  min-height: 108px;
}

/* ----- AI Persona ----- */
.persona-form { max-width: 900px; }

.persona-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .persona-grid {
    grid-template-columns: 1fr 1fr;
  }
  .persona-grid > :last-child {
    grid-column: 1 / -1;
  }
}

.persona-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.persona-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.persona-form .form-control { max-width: 100%; }

/* ----- Post Suggestions ----- */
.suggestion-controls {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.suggestion-generate-form {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.suggestion-generate-form .form-group {
  flex: 0 0 auto;
}

.suggestion-generate-form .btn {
  align-self: flex-end;
  margin-bottom: 0.75rem;
  white-space: nowrap;
}

.suggestion-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.suggestion-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.5s ease;
  width: 0%;
}

.suggestion-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}

.suggestion-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.suggestion-card:hover {
  box-shadow: var(--shadow-md);
}

.suggestion-suggested { border-left: 3px solid var(--primary); }
.suggestion-accepted  { border-left: 3px solid var(--success); }
.suggestion-rejected  { border-left: 3px solid var(--text-muted); opacity: 0.7; }

.suggestion-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.suggestion-platform {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--primary-muted);
  color: var(--primary);
  letter-spacing: 0.04em;
}

.suggestion-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
}

.suggestion-topic {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  padding: 0.3rem 0.5rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.suggestion-card-body {
  flex: 1;
  margin-bottom: 1rem;
}

.suggestion-caption {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text);
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.suggestion-hashtags {
  font-size: 0.85rem;
  color: var(--primary);
  margin: 0.5rem 0 0;
  word-break: break-word;
}

.suggestion-card-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.status.suggested { background: var(--primary-muted); color: var(--primary); }
.status.accepted { background: var(--success-muted); color: #15803d; }
.status.rejected { background: #f1f5f9; color: var(--text-muted); }

/* ----- SNS avatar（プロフィール画像/フォールバック文字） ----- */
.sns-avatar {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-elevated, #f3f4f6);
  color: #fff;
  font-weight: 600;
  line-height: 1;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08) inset;
}

.sns-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.sns-avatar-initial {
  display: inline-block;
  font-size: 0.78em;
  color: #fff;
  text-transform: uppercase;
  line-height: 1;
  letter-spacing: 0;
  padding: 0 0.1em;
}

.sns-avatar:not(.sns-avatar--fallback) .sns-avatar-initial {
  display: none;
}

.sns-avatar.sns-avatar--fallback img {
  display: none;
}

/* フォールバック（画像なし）の色をプラットフォームごとに付ける */
.sns-avatar--fallback.sns-avatar--ig { background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af); }
.sns-avatar--fallback.sns-avatar--fb { background: #1877f2; }
.sns-avatar--fallback.sns-avatar--th { background: #0a0a0a; }
.sns-avatar--fallback.sns-avatar--x  { background: #0a0a0a; }
.sns-avatar--fallback.sns-avatar--tk { background: #0f0f0f; }
.sns-avatar--fallback.sns-avatar--yt { background: #ff0000; }

/* 右下の小さいプラットフォーム識別バッジ */
.sns-avatar-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 40%;
  height: 40%;
  min-width: 10px;
  min-height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--bg-elevated, #fff);
  box-sizing: border-box;
  pointer-events: none;
}
.sns-avatar--ig .sns-avatar-badge { background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af); }
.sns-avatar--fb .sns-avatar-badge { background: #1877f2; }
.sns-avatar--th .sns-avatar-badge { background: #0a0a0a; }
.sns-avatar--x  .sns-avatar-badge { background: #0a0a0a; }
.sns-avatar--tk .sns-avatar-badge { background: #0f0f0f; }
.sns-avatar--yt .sns-avatar-badge { background: #ff0000; }

/* 画像 + 右下バッジ の場合、画像が丸く収まるよう調整 */
.sns-avatar:not(.sns-avatar--fallback) {
  background: var(--bg-elevated, #f3f4f6);
}

/* ダッシュボードSNSカード内の簡易アバターリスト */
.dashboard-sns-avatars {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.45rem;
  align-items: center;
}
.dashboard-sns-avatars .sns-avatar { width: 22px; height: 22px; }
.dashboard-sns-avatars .dashboard-sns-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 0.35rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-radius: 999px;
  border: 1px solid var(--border);
}

/* 投稿作成のアカウントカード内にアバターを表示するとき */
.account-pick-face .sns-avatar { width: 32px; height: 32px; }

/* 予約一覧テーブル内のアカウント列 */
.posts-account-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.posts-account-cell .sns-avatar { width: 24px; height: 24px; }
.posts-account-cell .posts-account-cell__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* 設定画面のSNSプラン行にアバターを並べる */
.settings-sns-row__avatars {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.25rem;
}
.settings-sns-row__avatars .sns-avatar { width: 24px; height: 24px; }

/* アカウント一覧ページの avatar 列 */
.account-list-avatar {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.account-list-avatar .sns-avatar { width: 32px; height: 32px; }

/* ----- Connection setup ----- */
.connection-setup-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.connection-setup-summary > div {
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.connection-setup-summary strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 1.05rem;
  word-break: break-word;
}

.connection-setup-summary span {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.connection-flow {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding-left: 1.25rem;
}

.connection-flow li span {
  display: block;
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.connection-section-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.api-credentials-form {
  display: grid;
  gap: 1rem;
}

.api-credential-group {
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.api-credential-group:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.api-credential-group h3 {
  margin: 0 0 0.7rem;
  font-size: 0.95rem;
}

.api-credential-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.85rem;
}

.api-credential-field {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
}

.api-credential-field label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  color: var(--text);
}

.api-credential-field label code {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.api-credential-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.78rem;
}

.api-credential-clear {
  display: inline-flex !important;
  gap: 0.3rem !important;
  align-items: center !important;
  font-weight: 500 !important;
  color: var(--text-muted) !important;
}

.connection-env-template {
  max-width: 100%;
  min-height: 220px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
}

.connection-platform-grid {
  display: grid;
  gap: 1rem;
}

.connection-platform-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.connection-platform-stats,
.connection-platform-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.connection-platform-stats span {
  padding: 0.28rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  font-size: 0.82rem;
}

.connection-env-status,
.connection-callbacks {
  margin-top: 1rem;
}

.connection-env-status h3,
.connection-callbacks h3 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.connection-env-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.86rem;
}

.connection-callback-url {
  display: block;
  margin-bottom: 0.4rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  overflow-wrap: anywhere;
  font-size: 0.82rem;
}

@media (max-width: 640px) {
  .connection-section-head,
  .connection-platform-head {
    display: grid;
  }

  .api-credential-grid {
    grid-template-columns: 1fr;
  }
}
