:root {
  --bg: #eef3f7;
  --surface: #ffffff;
  --surface-soft: #f7fafc;
  --line: #d7e0e8;
  --text: #162338;
  --muted: #647689;
  --brand: #0d8c8b;
  --brand-deep: #0a6d6c;
  --brand-soft: #e1f5f4;
  --accent: #f0c24f;
  --shadow: 0 18px 40px rgba(22, 35, 56, 0.08);
  --success-bg: #ecf9f0;
  --success-text: #17603d;
  --error-bg: #feeeee;
  --error-text: #9a2f2f;
  --shell-pad-x: 24px;
  --shell-pad-bottom: 24px;
  --panel-pad: 22px;
  --panel-radius: 22px;
  --toolbar-gap: 8px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(13, 140, 139, 0.08), transparent 26%),
    linear-gradient(180deg, #f8fafc 0%, var(--bg) 100%);
  overscroll-behavior-y: contain;
}

body.login-page {
  background:
    linear-gradient(145deg, rgba(6, 18, 42, 0.96) 0%, rgba(8, 31, 55, 0.92) 34%, rgba(11, 60, 112, 0.88) 68%, rgba(11, 203, 227, 0.78) 100%),
    url("/static/login_backdrop.svg") center center / cover no-repeat,
    #091a31;
}

.auth-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  padding: 28px 18px;
}

.auth-bg-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.04) 12%, transparent 12.5%, transparent 31%, rgba(255, 255, 255, 0.04) 31.5%, rgba(255, 255, 255, 0.04) 44%, transparent 44.5%, transparent 63%, rgba(255, 255, 255, 0.04) 63.5%, rgba(255, 255, 255, 0.04) 76%, transparent 76.5%),
    linear-gradient(25deg, rgba(255, 255, 255, 0.05) 10%, transparent 10.5%, transparent 35%, rgba(255, 255, 255, 0.05) 35.5%, rgba(255, 255, 255, 0.05) 54%, transparent 54.5%, transparent 82%, rgba(255, 255, 255, 0.05) 82.5%);
  opacity: 0.85;
  pointer-events: none;
}

.auth-decor {
  position: absolute;
  border-radius: 999px;
  filter: blur(18px);
  pointer-events: none;
}

.auth-decor-left {
  width: 300px;
  height: 300px;
  top: 40px;
  left: clamp(-120px, -4vw, -40px);
  background: radial-gradient(circle, rgba(199, 109, 255, 0.26) 0%, rgba(199, 109, 255, 0) 72%);
}

.auth-decor-right {
  width: 340px;
  height: 340px;
  right: clamp(-130px, -5vw, -36px);
  bottom: 32px;
  background: radial-gradient(circle, rgba(11, 203, 227, 0.3) 0%, rgba(11, 203, 227, 0) 74%);
}

.auth-center-card {
  position: relative;
  z-index: 1;
  width: min(380px, 100%);
  padding: 26px 24px 24px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(8, 18, 36, 0.74) 0%, rgba(7, 18, 32, 0.64) 100%);
  box-shadow:
    0 28px 60px rgba(3, 10, 24, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
}

.auth-avatar-ring {
  width: 86px;
  height: 86px;
  margin: 0 auto;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.08) 100%);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.auth-avatar-core {
  width: 66px;
  height: 66px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(13, 25, 48, 0.92) 0%, rgba(10, 23, 41, 0.88) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.auth-avatar-core img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  display: block;
}

.auth-copy {
  margin-top: 18px;
  text-align: center;
}

.auth-topline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-copy h1 {
  margin: 14px 0 0;
  font-size: clamp(1.72rem, 3vw, 2rem);
  line-height: 1.1;
  color: #ffffff;
}

.auth-copy p {
  margin: 10px 0 0;
  color: rgba(230, 238, 246, 0.76);
  font-size: 0.96rem;
  line-height: 1.55;
}

.auth-message {
  margin-top: 18px;
  padding: 13px 14px;
  border-radius: 16px;
  font-size: 0.96rem;
  font-weight: 700;
}

.auth-message.is-error {
  background: var(--error-bg);
  color: var(--error-text);
}

.auth-message.is-success {
  background: var(--success-bg);
  color: var(--success-text);
}

.auth-form {
  margin-top: 20px;
  display: grid;
  gap: 14px;
}

.auth-field {
  display: block;
}

.auth-field input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(7, 16, 31, 0.38);
  padding: 14px 16px;
  color: #ffffff;
  caret-color: #ffffff;
  font: inherit;
  font-size: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.auth-field input:focus {
  outline: 2px solid rgba(11, 203, 227, 0.22);
  border-color: rgba(11, 203, 227, 0.55);
  background: #ffffff;
  color: #0f2940;
  caret-color: #0f2940;
  box-shadow: 0 0 0 4px rgba(11, 203, 227, 0.08);
}

.auth-field input::placeholder {
  color: rgba(220, 229, 239, 0.58);
}

.auth-field input:focus::placeholder {
  color: #7c8a99;
}

.auth-support-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
}

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(230, 238, 246, 0.82);
  font-size: 0.86rem;
}

.auth-check input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #ff2f92;
}

.auth-help-link {
  color: rgba(230, 238, 246, 0.72);
  font-size: 0.86rem;
}

.auth-submit {
  margin-top: 6px;
  min-height: 46px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff2f92 0%, #d6177b 100%);
  color: #ffffff;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 16px 26px rgba(214, 23, 123, 0.28);
}

button,
input,
textarea,
select,
a {
  touch-action: manipulation;
}

.page-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--shell-pad-x) var(--shell-pad-bottom);
}

.login-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
}

.login-card {
  width: min(420px, 100%);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px 24px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-brand-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text);
}

.login-brand-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.96rem;
}

.login-message {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 0.96rem;
  font-weight: 600;
}

.login-message.is-error {
  background: var(--error-bg);
  color: var(--error-text);
}

.login-message.is-success {
  background: var(--success-bg);
  color: var(--success-text);
}

.login-form {
  margin-top: 20px;
  display: grid;
  gap: 14px;
}

.login-field {
  display: grid;
  gap: 8px;
  font-weight: 700;
  color: var(--text);
}

.login-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  font: inherit;
  color: var(--text);
  background: #ffffff;
}

.login-field input:focus {
  outline: 2px solid rgba(13, 140, 139, 0.16);
  border-color: rgba(13, 140, 139, 0.5);
}

.login-submit {
  border: none;
  border-radius: 16px;
  padding: 14px 18px;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 calc(-1 * var(--shell-pad-x)) 16px;
  padding: clamp(14px, 2.4vw, 18px) var(--shell-pad-x);
  background: linear-gradient(180deg, #0d8c8b 0%, #0a6d6c 100%);
  color: #fff;
}

.brand-main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.session-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.session-user {
  font-size: 0.92rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
}

.session-logout {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  padding: 10px 14px;
  cursor: pointer;
}

.job-toast {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 60;
  width: min(360px, calc(100vw - 24px));
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, -14px, 0) scale(0.98);
  transition: opacity 180ms ease, transform 220ms ease;
}

.job-toast.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.job-toast-inner {
  padding: 14px 16px;
  border-radius: 18px;
  color: #fff;
  box-shadow: 0 18px 34px rgba(22, 35, 56, 0.2);
  backdrop-filter: blur(10px);
}

.job-toast.is-running .job-toast-inner {
  background: linear-gradient(180deg, rgba(13, 140, 139, 0.96) 0%, rgba(10, 109, 108, 0.96) 100%);
  animation: toastPulse 1.8s ease-in-out infinite;
}

.job-toast.is-success .job-toast-inner {
  background: linear-gradient(180deg, rgba(240, 194, 79, 0.96) 0%, rgba(230, 177, 58, 0.96) 100%);
  color: #2e2300;
}

.job-toast.is-error .job-toast-inner {
  background: linear-gradient(180deg, rgba(230, 75, 75, 0.96) 0%, rgba(191, 47, 47, 0.96) 100%);
}

.job-toast-title {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.job-toast-meta {
  margin-top: 6px;
  font-size: 0.9rem;
  line-height: 1.45;
  opacity: 0.95;
}

.scene-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.scene-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.scene-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 20, 35, 0.42);
  backdrop-filter: blur(6px);
}

.scene-modal-card {
  position: relative;
  width: min(520px, calc(100vw - 28px));
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 24px 48px rgba(22, 35, 56, 0.2);
  padding: 18px;
  transform: translateY(16px) scale(0.98);
  transition: transform 220ms ease;
}

.scene-modal.is-open .scene-modal-card {
  transform: translateY(0) scale(1);
}

.scene-modal-head h3 {
  margin: 0;
  font-size: 1.08rem;
}

.scene-modal-body {
  margin-top: 14px;
}

.scene-input {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  line-height: 1.5;
}

.scene-input:focus {
  outline: 2px solid rgba(13, 140, 139, 0.16);
  border-color: rgba(13, 140, 139, 0.55);
}

.scene-modal-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@keyframes toastPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 18px 34px rgba(22, 35, 56, 0.2);
  }
  50% {
    transform: scale(1.015);
    box-shadow: 0 22px 40px rgba(13, 140, 139, 0.28);
  }
}

.brand-badge {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-badge img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block;
}

.brand-text {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.main-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
  align-items: stretch;
  position: relative;
  z-index: 260;
  overflow: visible;
}

.main-tabs > * {
  width: 100%;
  align-self: stretch;
}

.queue-marquee {
  display: none;
  align-items: center;
  overflow: hidden;
  margin: -6px 0 16px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(13, 140, 139, 0.18);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(13, 140, 139, 0.08) 0%, rgba(13, 140, 139, 0.03) 100%);
  color: #0f766e;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.queue-marquee.is-visible {
  display: flex;
}

.queue-marquee-track {
  display: inline-flex;
  gap: 48px;
  min-width: max-content;
  white-space: nowrap;
  font-size: 0.94rem;
  font-weight: 700;
  animation: queue-marquee-scroll 18s linear infinite;
}

.queue-marquee:hover .queue-marquee-track {
  animation-play-state: paused;
}

@keyframes queue-marquee-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.tab-button {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  border: 1px solid rgba(13, 140, 139, 0.75);
  border-radius: 16px;
  padding: 13px 18px;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(13, 140, 139, 0.16);
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.expand-toggle-wrap {
  width: 100%;
  min-width: 0;
  display: flex;
}

.main-tabs .action-menu-toggle {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  height: 100%;
  padding: 13px 18px;
  border: 1px solid rgba(13, 140, 139, 0.75);
  border-radius: 16px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.expand-drawer {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease, max-height 180ms ease, margin-top 180ms ease;
  margin-top: -4px;
  position: relative;
  z-index: 1200;
}

.expand-drawer.is-open {
  max-height: 120px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  margin-top: 2px;
}

.expand-drawer button {
  min-height: 48px;
  background: linear-gradient(180deg, var(--accent) 0%, #e6b13a 100%);
  color: #2e2300;
  border: 1px solid rgba(230, 177, 58, 0.85);
  font-weight: 800;
  border-radius: 14px;
  box-shadow: 0 12px 24px rgba(240, 194, 79, 0.18);
  cursor: pointer;
}

.social-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.social-icon-button svg {
  width: 24px;
  height: 24px;
  display: block;
}

.social-service-panel {
  margin: -4px 0 18px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: max-height 180ms ease, opacity 180ms ease, transform 180ms ease, margin-bottom 180ms ease;
}

.social-service-panel[hidden],
.social-service-status[hidden],
.social-service-result[hidden],
.social-result-thumb-wrap[hidden] {
  display: none !important;
}

.social-service-panel.is-open {
  max-height: min(72vh, 640px);
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.social-service-card {
  padding: 16px 18px;
  border-color: rgba(13, 140, 139, 0.22);
  max-height: min(72vh, 640px);
  max-width: 760px;
  margin: 0 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  position: relative;
  isolation: isolate;
}

.social-service-card.is-youtube {
  border-color: rgba(217, 48, 37, 0.72);
  box-shadow: 0 18px 34px rgba(217, 48, 37, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 250, 250, 0.96) 0%, rgba(255, 255, 255, 0.93) 100%);
}

.social-service-card.is-youtube .social-service-kicker {
  background: rgba(217, 48, 37, 0.12);
  color: #b42318;
}

.social-service-card.is-youtube .social-service-title {
  color: #8f1d14;
}

.social-service-card.is-youtube::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("/static/youtube_watermark.svg");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: min(50%, 320px) auto;
  opacity: 0.28;
  pointer-events: none;
}

.social-service-card.is-tiktok {
  border-color: rgba(17, 17, 17, 0.72);
  box-shadow: 0 18px 34px rgba(10, 15, 23, 0.14);
  background:
    linear-gradient(180deg, rgba(249, 252, 255, 0.97) 0%, rgba(255, 255, 255, 0.94) 100%);
}

.social-service-card.is-tiktok .social-service-kicker {
  background: rgba(10, 15, 23, 0.1);
  color: #101820;
}

.social-service-card.is-tiktok .social-service-title {
  color: #101820;
}

.social-service-card.is-tiktok::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("/static/tiktok_watermark.svg");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: min(48%, 300px) auto;
  opacity: 0.22;
  pointer-events: none;
}

.social-service-card.is-facebook {
  border-color: rgba(24, 119, 242, 0.62);
  box-shadow: 0 18px 34px rgba(24, 119, 242, 0.12);
  background:
    linear-gradient(180deg, rgba(248, 251, 255, 0.97) 0%, rgba(255, 255, 255, 0.94) 100%);
}

.social-service-card.is-facebook .social-service-kicker {
  background: rgba(24, 119, 242, 0.12);
  color: #165fc4;
}

.social-service-card.is-facebook .social-service-title {
  color: #165fc4;
}

.social-service-card.is-facebook::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("/static/facebook_watermark.svg");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: min(48%, 300px) auto;
  opacity: 0.18;
  pointer-events: none;
}

.social-service-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.social-service-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(13, 140, 139, 0.12);
  color: var(--brand-deep);
  font-weight: 800;
  margin-bottom: 10px;
}

.social-service-title {
  margin: 0 0 6px;
  font-size: 1.08rem;
}

.social-service-subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  max-width: 560px;
  font-size: 0.96rem;
}

.social-service-close {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(13, 140, 139, 0.18);
  background: rgba(13, 140, 139, 0.08);
  color: var(--brand-deep);
  font-size: 1.35rem;
  font-weight: 700;
  cursor: pointer;
}

.social-service-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  max-width: 560px;
}

.social-link-input-wrap {
  position: relative;
  min-width: 0;
}

.social-link-input {
  width: 100%;
  min-height: 52px;
  border-radius: 16px;
  border: 2px solid #0b6f75;
  background: #fff;
  padding: 0 52px 0 16px;
  font: inherit;
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(7, 74, 84, 0.08);
}

.social-link-input:focus {
  outline: none;
  border-color: #085f65;
  box-shadow: 0 0 0 4px rgba(11, 111, 117, 0.14);
}

.social-link-clear {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 999px;
  background: rgba(11, 111, 117, 0.12);
  color: #085f65;
  font-size: 1rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.social-link-clear:hover {
  background: rgba(11, 111, 117, 0.2);
}

.social-service-status {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 700;
}

.social-service-status.is-info {
  background: rgba(13, 140, 139, 0.09);
  color: var(--brand-deep);
}

.social-service-status.is-success {
  background: var(--success-bg);
  color: var(--success-text);
}

.social-service-status.is-error {
  background: var(--error-bg);
  color: var(--error-text);
}

.social-service-result {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-radius: 18px;
  background: rgba(244, 248, 250, 0.95);
  border: 1px solid rgba(13, 140, 139, 0.12);
}

.social-service-result.is-compact {
  grid-template-columns: 1fr;
}

.social-result-thumb-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 16px;
  background: #dfe8ec;
}

.social-result-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.social-result-body {
  min-width: 0;
}

.social-result-title {
  font-size: 1.04rem;
  font-weight: 800;
  line-height: 1.45;
}

.social-result-meta {
  margin-top: 8px;
  color: var(--muted);
}

.social-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.secondary-action {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid rgba(13, 140, 139, 0.2);
  background: rgba(13, 140, 139, 0.1);
  color: var(--brand-deep);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.secondary-action:disabled,
.upload-accent:disabled,
.social-link-input:disabled {
  opacity: 0.7;
  cursor: wait;
}

.tab-button.is-active {
  background: linear-gradient(180deg, var(--accent) 0%, #e6b13a 100%);
  border-color: rgba(230, 177, 58, 0.85);
  color: #2e2300;
  box-shadow: 0 12px 24px rgba(240, 194, 79, 0.18);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.flash {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 16px;
  font-weight: 700;
}

.flash-success {
  background: var(--success-bg);
  color: var(--success-text);
}

.flash-error {
  background: var(--error-bg);
  color: var(--error-text);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.9fr);
  gap: 18px;
}

#tab-upload .workspace-grid {
  grid-template-columns: 1fr;
}

.stack,
.media-stack {
  display: grid;
  gap: 18px;
}

.panel {
  padding: var(--panel-pad);
  border: 1px solid rgba(215, 224, 232, 0.95);
  border-radius: var(--panel-radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.section-panel {
  overflow: visible;
}

.section-head {
  margin-bottom: 18px;
}

.section-head-inline,
.media-block-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.upload-toolbar {
  align-items: center;
  margin-bottom: 10px;
}

.compact-toolbar {
  margin-bottom: 12px;
}

.compact-tools {
  gap: var(--toolbar-gap);
}

.section-kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--brand);
}

.panel h2,
.media-block h3,
.guide-panel h3 {
  margin: 8px 0 0;
}

.section-head p,
.selected-files,
.guide-list,
.image-folder,
.image-time,
.empty-state {
  color: var(--muted);
  line-height: 1.7;
}

.upload-form {
  display: grid;
  gap: 16px;
}

.simple-upload-form {
  display: flex;
}

.upload-tools {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.file-input-hidden {
  display: none;
}

.action-menu {
  position: relative;
  z-index: 60;
}

.action-menu-toggle {
  padding: 12px 16px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(13, 140, 139, 0.16);
  -webkit-tap-highlight-color: transparent;
}

.action-menu-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 18px 34px rgba(22, 35, 56, 0.12);
  z-index: 120;
  opacity: 0;
  transform: translateY(-8px);
  max-height: 0;
  overflow-x: visible;
  overflow-y: auto;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease, max-height 180ms ease;
}

.action-menu.is-open .action-menu-list {
  opacity: 1;
  transform: translateY(0);
  max-height: min(70vh, 420px);
  pointer-events: auto;
}

.action-menu.is-open .action-menu-toggle {
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}

.action-menu-list button {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  text-align: left;
  box-shadow: none;
  min-height: 48px;
}

.dropzone {
  position: relative;
  min-height: 200px;
  padding: 26px;
  border: 2px dashed rgba(13, 140, 139, 0.34);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(225, 245, 244, 0.78) 0%, rgba(247, 250, 252, 1) 100%);
  display: grid;
  place-items: center;
  text-align: center;
  cursor: pointer;
  transition: border-color 120ms ease, transform 120ms ease;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--brand);
  transform: translateY(-1px);
}

.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone-icon {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #fff;
  font-size: 1.8rem;
  box-shadow: 0 12px 24px rgba(13, 140, 139, 0.16);
}

.dropzone-title {
  display: block;
  margin-top: 16px;
  font-size: 1.08rem;
  font-weight: 700;
}

.dropzone-subtitle {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-group label {
  font-weight: 700;
}

input[type="text"] {
  width: 100%;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
}

input[type="text"]:focus {
  outline: 2px solid rgba(13, 140, 139, 0.16);
  border-color: rgba(13, 140, 139, 0.55);
}

.selected-files {
  min-height: 28px;
}

.form-actions {
  display: flex;
  justify-content: flex-start;
}

button {
  border: none;
  border-radius: 16px;
  padding: 12px 18px;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(13, 140, 139, 0.16);
}

.upload-accent {
  background: linear-gradient(180deg, var(--accent) 0%, #e6b13a 100%);
  color: #2e2300;
  box-shadow: 0 14px 28px rgba(240, 194, 79, 0.22);
}

.delete-action {
  background: linear-gradient(180deg, #e64b4b 0%, #bf2f2f 100%);
  color: #fff;
  box-shadow: 0 14px 28px rgba(191, 47, 47, 0.2);
}

.mini-stats {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.mini-stat {
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.mini-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.mini-stat strong {
  display: block;
  margin-top: 6px;
  font-size: 1.3rem;
}

.guide-panel {
  background: linear-gradient(180deg, #12233a 0%, #183553 100%);
  color: #fff;
}

.guide-panel .section-kicker,
.guide-panel h3 {
  color: #fff;
}

.guide-list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: rgba(255, 255, 255, 0.78);
}

.library-count,
.media-block-head span {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-weight: 700;
}

.hidden-form {
  display: none;
}

.upload-list-shell {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: #fcfeff;
}

body[data-device="phone"] {
  --shell-pad-x: 12px;
  --shell-pad-bottom: 14px;
  --panel-pad: 14px;
  --panel-radius: 16px;
  --toolbar-gap: 6px;
}

body[data-device="tablet"] {
  --shell-pad-x: 18px;
  --shell-pad-bottom: 18px;
  --panel-pad: 18px;
  --panel-radius: 18px;
}

body[data-device="desktop"] {
  --shell-pad-x: 24px;
  --shell-pad-bottom: 24px;
  --panel-pad: 22px;
  --panel-radius: 22px;
}

body[data-device="phone"][data-orientation="landscape"] {
  --shell-pad-x: 10px;
  --shell-pad-bottom: 12px;
  --panel-pad: 12px;
}

body[data-input="touch"] .tab-button,
body[data-input="touch"] .upload-accent,
body[data-input="touch"] .action-menu-toggle,
body[data-input="touch"] .scene-modal-actions button,
body[data-input="touch"] .action-menu-list button {
  min-height: 46px;
}

body[data-input="touch"] .thumb-check {
  width: 30px;
  height: 30px;
  border-radius: 10px;
}

body[data-input="touch"] .thumb-check input {
  width: 20px;
  height: 20px;
}

body[data-input="touch"] .upload-row-thumb,
body[data-input="touch"] .tab-button,
body[data-input="touch"] .action-menu-toggle {
  user-select: none;
}

.upload-list-head,
.upload-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1.8fr) minmax(140px, 0.9fr) 160px;
  gap: 14px;
  align-items: center;
}

.upload-list-head {
  padding: 12px 16px;
  background: #f3f7fa;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.upload-list-body {
  max-height: 560px;
  overflow-y: auto;
}

.upload-group-label {
  padding: 12px 16px 8px;
  color: var(--brand-deep);
  font-size: 0.9rem;
  font-weight: 800;
  background: #fcfeff;
}

.upload-day-divider {
  position: relative;
  padding: 14px 16px;
  text-align: center;
  background: #fcfeff;
}

.upload-day-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 16px;
  right: 16px;
  height: 1px;
  background: var(--line);
}

.upload-day-divider span {
  position: relative;
  padding: 0 12px;
  background: #fcfeff;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.upload-row {
  padding: 12px 16px;
  border-bottom: 1px solid #edf2f6;
  transition: background 120ms ease;
}

.upload-row:last-child {
  border-bottom: none;
}

.upload-row:hover {
  background: #f6fafc;
}

.upload-thumb-wrap {
  position: relative;
  width: 84px;
  height: 84px;
}

.thumb-check {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 16px rgba(22, 35, 56, 0.16);
  -webkit-tap-highlight-color: transparent;
}

.thumb-check input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.upload-row-thumb {
  width: 100%;
  height: 100%;
  display: block;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #eaf0f4;
}

.upload-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.upload-row-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #eaf0f4;
}

.video-play-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(14, 32, 44, 0.78);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(10, 22, 34, 0.24);
  pointer-events: none;
}

.video-play-badge.is-audio {
  min-width: 34px;
  padding: 0 10px;
}

.upload-row-name,
.upload-row-folder,
.upload-row-time {
  min-width: 0;
}

.upload-row-name {
  font-weight: 700;
  word-break: break-word;
}

.upload-row-folder,
.upload-row-time {
  color: var(--muted);
}

.gallery-grid,
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
  gap: 16px;
}

.image-card,
.video-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfdff;
}

.thumb {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  background: #eaf0f4;
}

.video-thumb {
  display: block;
  aspect-ratio: 16 / 10;
  background: #eaf0f4;
}

.thumb img,
.video-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.new-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  padding: 5px 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent) 0%, #e6b13a 100%);
  color: #2e2300;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.image-meta,
.video-meta {
  padding: 14px;
}

.image-name {
  font-weight: 700;
  word-break: break-word;
}

.empty-state {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
  text-align: center;
}

.compact-empty {
  margin: 12px;
  padding: 18px 14px;
}

@media (max-width: 980px) {
  .auth-shell {
    padding: 18px 16px;
  }

  .auth-center-card {
    width: min(420px, 100%);
    padding: 24px 20px 22px;
  }
}

@media (max-width: 980px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .section-head-inline,
  .media-block-head {
    flex-direction: column;
    align-items: stretch;
  }

  .upload-list-head,
  .upload-row {
    grid-template-columns: 90px minmax(0, 1fr);
  }

  .upload-thumb-wrap {
    width: 90px;
    height: 90px;
  }

  .upload-list-head > :nth-child(3),
  .upload-list-head > :nth-child(4),
  .upload-row-folder,
  .upload-row-time {
    display: none;
  }
}

@media (max-width: 720px) {
  .auth-shell {
    padding: 12px;
  }

  .auth-decor-left {
    width: 220px;
    height: 220px;
    top: 36px;
    left: -72px;
  }

  .auth-decor-right {
    width: 220px;
    height: 220px;
    right: -80px;
    bottom: 30px;
  }

  .auth-center-card {
    width: min(360px, 100%);
    padding: 20px 16px 18px;
    border-radius: 24px;
  }

  .auth-topline {
    padding: 7px 12px;
    font-size: 0.72rem;
  }

  .auth-avatar-ring {
    width: 78px;
    height: 78px;
  }

  .auth-avatar-core {
    width: 60px;
    height: 60px;
  }

  .auth-avatar-core img {
    width: 34px;
    height: 34px;
  }

  .auth-copy {
    margin-top: 16px;
  }

  .auth-copy h1 {
    font-size: 1.75rem;
  }

  .auth-copy p {
    margin-top: 10px;
    font-size: 0.94rem;
    line-height: 1.6;
  }

  .auth-field input {
    padding: 15px 16px;
    border-radius: 999px;
  }

  .auth-submit {
    min-height: 48px;
    border-radius: 999px;
  }

  .job-toast {
    top: 10px;
    right: 10px;
    width: min(320px, calc(100vw - 16px));
  }

  .job-toast-inner {
    padding: 12px 14px;
    border-radius: 14px;
  }

  .scene-modal {
    padding: 12px;
  }

  .scene-modal-card {
    width: min(100%, calc(100vw - 12px));
    border-radius: 18px;
    padding: 14px;
  }

  .scene-modal-actions {
    flex-direction: column;
  }

  .scene-modal-actions button {
    width: 100%;
  }

  .flash {
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.95rem;
  }

  .main-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .queue-marquee {
    min-height: 34px;
    margin: -2px 0 12px;
    padding: 0 12px;
  }

  .queue-marquee-track {
    gap: 30px;
    font-size: 0.82rem;
  }

  .tab-button,
  .main-tabs .action-menu-toggle {
    min-width: 0;
    min-height: 46px;
    height: 100%;
    padding: 10px 6px;
    font-size: 0.84rem;
    line-height: 1.2;
    text-align: center;
  }

  .expand-drawer {
    gap: 6px;
  }

  .expand-drawer button {
    min-height: 42px;
    padding: 8px 6px;
    font-size: 0.8rem;
    line-height: 1.15;
  }

  .social-service-card {
    padding: 16px;
    max-height: min(68vh, 560px);
    max-width: none;
  }

  .social-service-head {
    gap: 10px;
  }

  .social-service-form {
    grid-template-columns: 1fr;
  }

  .social-link-input,
  .social-service-form .upload-accent,
  .social-result-actions > * {
    width: 100%;
  }

  .social-service-result {
    grid-template-columns: 1fr;
  }

  .social-result-thumb-wrap {
    aspect-ratio: 16 / 10;
  }

  .upload-toolbar {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .upload-tools {
    width: auto;
    align-items: center;
    gap: 6px;
  }

  .simple-upload-form {
    width: auto;
  }

  .library-count {
    padding: 4px 10px;
    font-size: 0.92rem;
  }

  .simple-upload-form button,
  .action-menu-toggle {
    width: auto;
    text-align: center;
    padding: 10px 12px;
    border-radius: 12px;
  }

  .action-menu-list {
    left: 0;
    right: 0;
    min-width: 0;
  }

  .upload-row {
    padding: 10px 12px;
    gap: 12px;
  }

  .upload-row-name {
    font-size: 0.96rem;
    line-height: 1.35;
  }

  .upload-list-body {
    max-height: calc(100dvh - 270px);
  }

  .gallery-grid,
  .video-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 420px) {
  .auth-center-card {
    padding: 18px 14px 16px;
    border-radius: 20px;
  }

  .auth-avatar-ring {
    width: 72px;
    height: 72px;
  }

  .auth-avatar-core {
    width: 56px;
    height: 56px;
  }

  .auth-avatar-core img {
    width: 31px;
    height: 31px;
  }

  .auth-copy h1 {
    font-size: 1.48rem;
  }

  .auth-copy p {
    font-size: 0.9rem;
  }

  .auth-support-row {
    flex-wrap: wrap;
  }

  .auth-field input {
    font-size: 0.96rem;
  }

  .brand-badge {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .brand-badge img {
    width: 30px;
    height: 30px;
  }

  .brand-text {
    font-size: 1.2rem;
    letter-spacing: 0.05em;
  }

  .upload-thumb-wrap {
    width: 82px;
    height: 82px;
  }

  .upload-list-head,
  .upload-row {
    grid-template-columns: 82px minmax(0, 1fr);
  }
}
