:root {
  --brand-ink: #071E3F;
  --brand-deep: #144C77;
  --brand-primary: #257EA2;
  --brand-secondary: #36B3CB;
  --brand-light: #67EAED;
  --text-primary: #1a3a4f;
  --surface: #ffffff;
  --muted: #eaf3fa;
}

/* Shared buttons using palette */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 16px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 1px 2px 6px #0001;
  transition: background 0.2s, color 0.2s, opacity 0.2s;
}
.btn-primary { background: var(--brand-primary); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); }
.btn-secondary { background: var(--brand-secondary); color: #fff; }
.btn-secondary:hover { background: var(--brand-primary); }
.btn-dark { background: var(--brand-ink); color: #fff; }
.btn-dark:hover { opacity: 0.9; }
.btn-light { background: var(--brand-light); color: var(--brand-ink); }
.btn-light:hover { background: var(--brand-secondary); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--brand-deep); color: var(--brand-deep); }
.btn-outline:hover { background: var(--brand-light); }

/* Library-specific action button class retained for backward compatibility */
.publish-btn { background: var(--brand-primary) !important; color: #fff !important; border-radius: 18px; padding: 8px 16px; font-size: 0.9rem; font-weight: 600; text-decoration: none; transition: background 0.2s; margin-left: 10px; }
.publish-btn:hover { background: var(--brand-deep) !important; }
.btn-edit { background: var(--brand-secondary) !important; color: #fff !important; border-radius: 16px; padding: 6px 12px; margin-left: 10px; border: none !important; }
.btn-edit:hover { background: var(--brand-primary) !important; }
.btn-delete { background: var(--brand-ink) !important; color: #fff !important; border-radius: 16px; padding: 6px 12px; margin-left: 10px; opacity: 0.95; }
.btn-delete:hover { opacity: 1 !important; }

/* Icon-only buttons */
.icon-btn {
  background: transparent;
  border: none;
  color: var(--brand-deep);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.icon-btn:hover { background: var(--muted); color: var(--brand-ink); }
.icon-btn.danger { color: var(--brand-ink); }
.icon-btn.danger:hover { background: #f3f6fa; color: var(--brand-ink); }

.login-container {
  max-width: 400px;
  margin: 40px auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 2px 4px 12px #0001;
  padding: 32px 32px 24px 32px;
  position: relative;
}
.login-container h2 {
  text-align: center;
  color: #1a3a4f;
  margin-bottom: 18px;
}
.google-btn {
  width: 100%;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 24px;
  padding: 10px;
  margin-bottom: 18px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}
.img-placeholder {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}
label {
  display: block;
  margin-bottom: 4px;
  color: #1a3a4f;
  font-weight: 500;
}
input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"] {
  width: 100%;
  padding: 8px 12px;
  margin-bottom: 14px;
  border: 1.5px solid #1a3a4f;
  border-radius: 18px;
  font-size: 1rem;
}
.sign-in-btn {
  width: 100%;
  background: #1a3a4f;
  color: #fff;
  border: none;
  border-radius: 18px;
  padding: 10px;
  font-size: 1.1rem;
  margin-top: 8px;
  cursor: pointer;
  box-shadow: 1px 2px 6px #0001;
}
.forgot {
  display: block;
  text-align: right;
  margin-bottom: 10px;
  color: #1a3a4f;
  text-decoration: none;
  font-size: 0.95rem;
}
.signup-link {
  text-align: center;
  margin-top: 16px;
  font-size: 1rem;
}
.signup-link a {
  color: #1a3a4f;
  text-decoration: underline;
}
.error {
  color: #c00;
  margin-bottom: 10px;
  text-align: center;
}
.auth-modal {
  max-width: 600px;
  margin: 40px auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 2px 4px 12px #0001;
  padding: 32px;
}
.auth-flex {
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-logo {
  flex: 0 0 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 24px;
}
.auth-form {
  flex: 1;
  min-width: 250px;
}
.divider {
  border-bottom: 1.5px dotted #ccc;
  margin: 16px 0 18px 0;
}
.full-width {
  width: 100%;
  box-sizing: border-box;
}
.password-wrapper {
  display: flex;
  align-items: center;
  position: relative;
}
.password-wrapper input[type="password"],
.password-wrapper input[type="text"] {
  flex: 1;
  margin-bottom: 0;
  padding-right: 38px;
}
.eye-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #888;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  z-index: 2;
}
.sign-in-btn.full-width {
  width: 100%;
}
input[type="email"].full-width,
input[type="text"].full-width,
input[type="password"].full-width {
  width: 100%;
}
.show-password {
  margin-left: 8px;
  background: #f3f6fa;
  border: 1px solid #1a3a4f;
  border-radius: 12px;
  padding: 5px 12px;
  font-size: 0.95rem;
  cursor: pointer;
  color: #1a3a4f;
  transition: background 0.2s;
}
.show-password:hover {
  background: #e0e7ef;
}
.dashboard-container {
  display: flex;
  min-height: 100vh;
  background: #f7fafc;
}
.sidebar {
  width: 220px;
  background: #fff;
  border-radius: 24px;
  margin: 24px 0 24px 24px;
  box-shadow: 2px 4px 12px #0001;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 0 16px 0;
}
.sidebar nav ul {
  list-style: none;
  padding: 0 0 0 0;
  margin: 0;
}
.sidebar nav ul li {
  margin-bottom: 18px;
}
.sidebar nav ul li a {
  display: flex;
  align-items: center;
  color: #1a3a4f;
  text-decoration: none;
  font-size: 1.18rem;
  padding: 8px 24px;
  border-radius: 12px 0 0 12px;
  transition: background 0.2s;
}
.sidebar nav ul li a.active, .sidebar nav ul li a:hover {
  background: #eaf3fa;
  font-weight: bold;
}
.sidebar-icon {
  margin-right: 12px;
  font-size: 1.3em;
}
.sidebar-user {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 32px;
}
.sidebar-user-img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin-bottom: 8px;
  background: #eaf3fa;
}
.sidebar-username {
  font-size: 1.12rem;
  color: #1a3a4f;
  margin-bottom: 6px;
}
.sidebar-signout {
  color: #1a3a4f;
  font-size: 1rem;
  text-decoration: underline;
  margin-top: 4px;
}
.dashboard-main {
  flex: 1;
  padding: 36px 36px 36px 0;
  display: flex;
  flex-direction: column;
  margin-left: 32px;
}
.campaign-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 32px;
}
.campaign-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 2px 4px 12px #0001;
  padding: 18px 18px 12px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 220px;
}
.campaign-img {
  width: 100%;
  max-width: 180px;
  border-radius: 12px 12px 0 0;
  margin-bottom: 10px;
  background: #eaf3fa;
}
.campaign-title {
  font-size: 1.22rem;
  font-weight: bold;
  color: #1a3a4f;
  margin-bottom: 8px;
  text-align: center;
}
.campaign-meta {
  font-size: 1.08rem;
  color: #1a3a4f;
  text-align: center;
}
.campaign-actions {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  justify-content: center;
}
.campaign-action-link {
  color: #1a3a4f;
  background: #eaf3fa;
  border-radius: 8px;
  padding: 5px 14px;
  text-decoration: none;
  font-size: 1.08rem;
  transition: background 0.2s, color 0.2s;
}
.campaign-action-link:hover {
  background: #d1e7f7;
  color: #0d2233;
}
.campaign-thumbnails {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 10px;
}
.campaign-thumb {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: #eaf3fa;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px #0001;
}
.campaign-form-container {
  max-width: 520px;
  margin: 40px auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 2px 4px 12px #0001;
  padding: 36px 36px 28px 36px;
}
.campaign-form h2 {
  text-align: center;
  color: #1a3a4f;
  margin-bottom: 18px;
  font-size: 1.65rem;
}
.campaign-form label {
  display: block;
  margin-bottom: 6px;
  color: #1a3a4f;
  font-weight: 500;
  font-size: 1.13rem;
}
.campaign-form input[type="text"] {
  width: 100%;
  padding: 10px 18px;
  margin-bottom: 18px;
  border: 1.5px solid #1a3a4f;
  border-radius: 18px;
  font-size: 1.08rem;
}
.campaign-form-section {
  margin-bottom: 18px;
}
.campaign-form-label {
  font-weight: 500;
  color: #1a3a4f;
  margin-bottom: 8px;
  font-size: 1.13rem;
}
.campaign-video-options {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}
.video-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1.15rem;
}
.video-option input[type="radio"] {
  margin-bottom: 4px;
  width: 22px;
  height: 22px;
}
.campaign-type-options {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 24px;
  margin-top: 8px;
}
.campaign-type-options label {
  font-weight: 400;
  font-size: 1.15rem;
  color: #1a3a4f;
  display: flex;
  align-items: center;
  gap: 6px;
}
body {
  font-size: 1.08rem;
}
input, button, select, textarea {
  font-size: 1.08rem;
}
.campaign-status {
  margin: 6px 0 4px 0;
  font-size: 1.04em;
  font-weight: 600;
  text-transform: capitalize;
  padding: 2px 12px;
  border-radius: 12px;
  display: inline-block;
  background: #eaf3fa;
  color: #1a3a4f;
}
.campaign-status.draft { background: #fffbe6; color: #bfa100; }
.campaign-status.active { background: #e6fff0; color: #1a7f3c; }
.campaign-status.completed { background: #e6f0ff; color: #1a3a4f; }
.campaign-status.archived { background: #f3f3f3; color: #888; }
.campaign-thumb-empty {
  background: #eaf3fa;
  border: 2px dashed #c3d6e6;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-block;
}
.scripts-container {
  max-width: 1100px;
  width: 100%;
  margin: 40px auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 2px 4px 12px #0001;
  padding: 36px 48px 28px 48px;
}
.scripts-tabs {
  display: flex;
  gap: 18px;
  margin-bottom: 18px;
}
.scripts-tab {
  padding: 8px 28px;
  border-radius: 18px 18px 0 0;
  background: #eaf3fa;
  color: #1a3a4f;
  text-decoration: none;
  font-weight: 500;
  font-size: 1.13rem;
  transition: background 0.2s;
}
.scripts-tab.active, .scripts-tab:hover {
  background: #fff;
  border-bottom: 2px solid #1a3a4f;
}
.scripts-list {
  margin-bottom: 12px;
  width: 100%;
}
.script-row {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 12px;
  background: #f7f7fa;
  border-radius: 18px;
  padding: 12px 24px;
  box-shadow: 1px 4px 6px #cccccc;
}
.script-num {
  font-weight: bold;
  color: #1a3a4f;
  font-size: 1.18rem;
  min-width: 38px;
  text-align: right;
  display: flex;
  align-items: center;
  height: 44px;
}
.script-input {
  flex: 1;
  border: 1.5px solid #1a3a4f;
  background: #fff;
  font-size: 1.08rem;
  color: #1a3a4f;
  padding: 10px 18px;
  border-radius: 18px;
  outline: none;
  min-width: 0;
  box-shadow: 0 2px 8px #0001;
  display: flex;
  align-items: center;
  margin-bottom: 0 !important;
}
.record-btn-styled, .upload-btn {
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 18px;
}
.script-input:focus {
  background: #eaf3fa;
  border-color: #174a6c;
}
.script-rec {
  color: #c00;
  font-weight: bold;
  font-size: 1.08rem;
  margin-left: 8px;
  display: flex;
  align-items: center;
}
.scripts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.ai-generate-btn {
  background: #174a6c;
  color: #fff;
  border: none;
  border-radius: 18px;
  padding: 10px 24px;
  font-size: 1.08rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 1px 2px 6px #0001;
  transition: background 0.2s;
  margin-left: 18px;
}
.ai-generate-btn:hover {
  background: #1a3a4f;
}
.ai-gen-form {
  max-width: 900px;
  margin: 40px auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 2px 4px 12px #0001;
  padding: 36px 48px 28px 48px;
}
.ai-gen-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px 48px;
  margin-bottom: 18px;
}
.ai-gen-label {
  font-weight: 600;
  color: #1a3a4f;
  margin-bottom: 6px;
  margin-top: 12px;
}
.ai-gen-input {
  width: 100%;
  padding: 12px 18px;
  margin-bottom: 14px;
  border: 1.5px solid #1a3a4f;
  border-radius: 18px;
  background: #f7f7fa;
  font-size: 1.08rem;
  color: #1a3a4f;
  outline: none;
  box-sizing: border-box;
}
.ai-gen-input:focus {
  background: #eaf3fa;
}
.ai-gen-options {
  margin-top: 10px;
  margin-bottom: 10px;
  font-size: 1.08rem;
}
.auto-expand {
  min-height: 60px;
  resize: none;
}
.profile-container {
  width: 100%;
  max-width: 520px;
  margin: 40px auto;
  background: #fff;
  border-radius: 18px;
  box-sizing: border-box;
  box-shadow: 2px 4px 12px #0001;
  padding: 36px 36px 28px 36px;
}
.profile-container h2 {
  text-align: center;
  color: #1a3a4f;
  margin-bottom: 18px;
  font-size: 1.65rem;
}
.profile-form {
  display: flex;
  flex-direction: column;
}
.profile-form label {
  display: block;
  margin-bottom: 6px;
  color: #1a3a4f;
  font-weight: 500;
  font-size: 1.13rem;
}
.billing-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #f7f9fc;
  border: 1px solid #e2e8f0;
  padding: 12px 16px;
  border-radius: 8px;
  margin: 12px 0 20px 0;
}
.billing-summary .btn-upgrade, .billing-summary .btn-manage {
  background: #174a6c;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
}
.billing-summary .btn-upgrade {
  background: #28a745;
}

/* Modal styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.modal {
  background: #fff;
  border-radius: 12px;
  width: 92%;
  max-width: 820px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #eef2f7;
}
.modal-header h3 {
  margin: 0;
  color: #174a6c;
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
}
.modal-body {
  padding: 16px 18px;
}
.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.plan-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f9fbfd;
  cursor: pointer;
}
.plan-card input[type="radio"] {
  margin-bottom: 6px;
}
.plan-title { font-weight: 700; color: #174a6c; }
.plan-price { color: #0d2233; }
.plan-credits { color: #375a6b; font-size: 0.95rem; }
.modal-footer {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.btn-cancel {
  background: #f3f6fa;
  color: #174a6c;
  border: 1px solid #e2e8f0;
  padding: 8px 12px;
  border-radius: 6px;
}
.btn-confirm {
  background: #174a6c;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
}

@media (max-width: 768px) {
  .plan-grid { grid-template-columns: 1fr; }
}
.profile-form input[type="text"],
.profile-form input[type="date"] {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 10px 18px;
  margin-bottom: 18px;
  border: 1.5px solid #1a3a4f;
  border-radius: 18px;
  font-size: 1.08rem;
}
.clickable-card:hover {
  box-shadow: 0 6px 24px #174a6c22;
  transform: translateY(-2px) scale(1.01);
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
}
.clickable-card {
  transition: box-shadow 0.2s, transform 0.2s;
}
.device-selectors {
  display: flex;
  gap: 24px;
  margin-bottom: 18px;
  align-items: center;
  background: #f7f7fa;
  border-radius: 14px;
  box-shadow: 1px 2px 8px #0001;
  padding: 14px 24px;
}
.device-selectors label {
  font-weight: 500;
  color: #1a3a4f;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.device-selectors select {
  border: 1.5px solid #1a3a4f;
  border-radius: 12px;
  padding: 7px 16px;
  font-size: 1.08rem;
  background: #fff;
  color: #1a3a4f;
  box-shadow: 0 2px 8px #0001;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.device-selectors select:focus {
  border-color: #174a6c;
  background: #eaf3fa;
}

/* Modern Mobile Navigation Styles */
.profile-dropdown {
  position: relative;
}

.profile-trigger {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 8px;
  border-radius: 12px;
  transition: background 0.2s;
}

.profile-trigger .sidebar-username {
  display: none !important;
}

.profile-trigger:hover {
  background: #eaf3fa;
}

.dropdown-arrow {
  font-size: 0.8rem;
  color: #666;
  transition: transform 0.2s;
}

.profile-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  min-width: 220px;
  max-width: 260px;
  width: 240px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  border: 1px solid #e0e7ef;
}

.profile-dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  padding: 16px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.dropdown-user-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #eaf3fa;
}

.dropdown-user-info {
  flex: 1;
  min-width: 0;
}

.dropdown-username,
.dropdown-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  max-width: 170px;
}

.dropdown-username {
  font-weight: 600;
  color: #1a3a4f;
  font-size: 0.95rem;
}

.dropdown-email {
  color: #666;
  font-size: 0.85rem;
  margin-top: 2px;
}

.dropdown-divider {
  height: 1px;
  background: #f0f0f0;
  margin: 8px 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #1a3a4f;
  text-decoration: none;
  transition: background 0.2s;
  font-size: 0.9rem;
}

.dropdown-item:hover {
  background: #f7f7fa;
}

.dropdown-icon {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

/* Mobile Responsive Styles for Auth Pages */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
  }
  .scripts-container {
    max-width: 100vw;
    box-sizing: border-box;
    padding-left: 2vw;
    padding-right: 2vw;
  }
  .auth-modal {
    max-width: 95%;
    margin: 20px auto;
    padding: 24px 20px;
    border-radius: 16px;
  }
  
  .auth-flex {
    flex-direction: column;
    gap: 24px;
  }
  
  .auth-logo {
    flex: none;
    margin-right: 0;
    margin-bottom: 0;
  }
  
  .auth-logo img {
    width: 140px !important;
  }
  
  .auth-form {
    min-width: auto;
    width: 100%;
  }
  
  .auth-form h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
  }
  
  .google-btn {
    padding: 12px 16px;
    font-size: 1rem;
    border-radius: 20px;
  }
  
  .sign-in-btn {
    padding: 12px 16px;
    font-size: 1.1rem;
    border-radius: 20px;
  }
  
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="date"] {
    padding: 12px 16px;
    font-size: 1rem;
    border-radius: 16px;
  }
  
  .password-wrapper input[type="password"],
  .password-wrapper input[type="text"] {
    padding: 12px 16px;
    padding-right: 44px;
  }
  
  .eye-icon {
    right: 12px;
  }
  
  .forgot {
    font-size: 0.9rem;
    margin-bottom: 12px;
  }
  
  .signup-link {
    margin-top: 20px;
    font-size: 0.95rem;
  }
  
  .divider {
    margin: 20px 0;
  }
}

@media (max-width: 480px) {
  .auth-modal {
    max-width: 98%;
    margin: 16px auto;
    padding: 20px 16px;
  }
  
  .auth-logo img {
    width: 120px !important;
  }
  
  .auth-form h2 {
    font-size: 1.6rem;
    margin-bottom: 18px;
  }
  
  .google-btn {
    padding: 10px 14px;
    font-size: 0.95rem;
  }
  
  .sign-in-btn {
    padding: 10px 14px;
    font-size: 1rem;
  }
  
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="date"] {
    padding: 10px 14px;
    font-size: 0.95rem;
  }
  
  .password-wrapper input[type="password"],
  .password-wrapper input[type="text"] {
    padding: 10px 14px;
    padding-right: 40px;
  }
  
  label {
    font-size: 0.95rem;
    margin-bottom: 6px;
  }
}

/* Mobile Responsive Styles for Dashboard and Sidebar */
@media (max-width: 768px) {
  .dashboard-container {
    flex-direction: column;
    min-height: auto;
  }
  
  .sidebar {
    width: 100%;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    border-bottom: 1px solid #e0e7ef;
    padding: 12px 16px;
    position: relative;
    z-index: 1000;
    background: #fff;
  }
  
  .sidebar nav ul {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    background: #f7f7fa;
    border-radius: 12px;
    padding: 4px;
  }
  
  .sidebar nav ul li {
    margin-bottom: 0;
    flex: 1;
  }
  
  .sidebar nav ul li a {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    white-space: nowrap;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
    background: transparent;
  }
  
  .sidebar nav ul li a.active {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: #1a3a4f;
    font-weight: 600;
  }
  
  .sidebar nav ul li a:hover {
    background: rgba(255, 255, 255, 0.7);
  }
  
  .sidebar-icon {
    font-size: 1rem;
    margin-right: 0;
  }
  
  .sidebar-user {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
  }
  
  .profile-trigger {
    padding: 6px 10px;
    border-radius: 20px;
    background: #f7f7fa;
    border: 1px solid #e0e7ef;
  }
  
  .sidebar-user-img {
    width: 32px;
    height: 32px;
    margin-bottom: 0;
    margin-right: 0;
  }
  
  .sidebar-username {
    font-size: 0.85rem;
    margin-bottom: 0;
    color: #1a3a4f;
    font-weight: 500;
  }
  
  .dropdown-arrow {
    font-size: 0.7rem;
  }
  
  .profile-dropdown-menu {
    right: 0;
    left: auto;
    min-width: 180px;
    margin-top: 8px;
  }
  
  .dashboard-main {
    padding: 20px 16px;
    margin-left: 0;
  }
  
  .campaign-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .campaign-card {
    min-width: auto;
    padding: 16px;
  }
  
  .campaign-title {
    font-size: 1.1rem;
  }
  
  .campaign-meta {
    font-size: 0.9rem;
    line-height: 1.4;
  }
  
  .campaign-actions {
    gap: 12px;
  }
  
  .campaign-action-link {
    font-size: 0.9rem;
    padding: 6px 12px;
  }
  
  .campaign-thumbnails {
    gap: 6px;
    margin-bottom: 12px;
  }
  
  .campaign-thumb {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 480px) {
  .sidebar {
    padding: 10px 12px;
  }
  
  .sidebar nav ul {
    padding: 3px;
  }
  
  .sidebar nav ul li a {
    padding: 8px 12px;
    font-size: 0.85rem;
    gap: 4px;
  }
  
  .sidebar-icon {
    font-size: 0.9rem;
  }
  
  .profile-trigger {
    padding: 5px 8px;
  }
  
  .sidebar-user-img {
    width: 28px;
    height: 28px;
  }
  
  .sidebar-username {
    font-size: 0.8rem;
  }
  
  .dropdown-arrow {
    font-size: 0.6rem;
  }
  
  .profile-dropdown-menu {
    min-width: 160px;
  }
  
  .dropdown-header {
    padding: 12px;
    gap: 10px;
  }
  
  .dropdown-user-img {
    width: 36px;
    height: 36px;
  }
  
  .dropdown-username {
    font-size: 0.9rem;
  }
  
  .dropdown-email {
    font-size: 0.8rem;
  }
  
  .dropdown-item {
    padding: 10px 12px;
    font-size: 0.85rem;
    gap: 10px;
  }
  
  .dashboard-main {
    padding: 16px 12px;
  }
  
  .campaign-card {
    padding: 12px;
  }
  
  .campaign-title {
    font-size: 1rem;
  }
  
  .campaign-meta {
    font-size: 0.85rem;
  }
  
  .campaign-actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .campaign-action-link {
    font-size: 0.85rem;
    padding: 8px 12px;
    text-align: center;
  }
  
  .campaign-thumbnails {
    gap: 4px;
  }
  
  .campaign-thumb {
    width: 28px;
    height: 28px;
  }
}

@media (max-width: 360px) {
  .sidebar-user {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
  
  .sidebar-username {
    display: none;
  }
  
  .sidebar-signout {
    margin-left: 0;
  }
}

/* Profile visibility by screen size */
.desktop-profile { display: flex; align-items: center; gap: 14px; }
.mobile-profile { display: none; }

@media (max-width: 768px) {
  .desktop-profile { display: none !important; }
  .mobile-profile { display: flex !important; align-items: center; justify-content: flex-end; width: 100%; }
  .sidebar-user { width: auto; }
  .sidebar { flex-direction: column; }
  .sidebar nav ul { flex: 1 1 auto; min-width: 0; }
  .ai-gen-grid {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
  }
  .device-selectors {
    display: block !important;
    margin: 12px 0;
  }
  .device-selectors label {
    display: inline-block;
    margin-right: 12px;
  }
}

@media (min-width: 769px) {
  .desktop-profile { display: flex !important; }
  .mobile-profile { display: none !important; }
}

.sidebar-user-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-username {
  font-weight: 600;
  color: #1a3a4f;
  font-size: 1rem;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-email {
  color: #666;
  font-size: 0.9rem;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-profile-link {
  color: #174a6c;
  font-size: 0.95rem;
  text-decoration: underline;
  margin-top: 4px;
  margin-bottom: 2px;
}
.sidebar-profile-link:hover {
  text-decoration: none;
}
.sidebar-signout {
  color: #c00;
  font-size: 0.95rem;
  text-decoration: underline;
  margin-top: 2px;
}
.sidebar-signout:hover {
  text-decoration: none;
}
/* Ensure mobile menu bar stays on one line */
@media (max-width: 768px) {
  .sidebar { flex-direction: column; }
  .sidebar nav ul { flex-wrap: nowrap; overflow-x: auto; }
  .sidebar-user.mobile-profile { flex: none; margin-left: auto; }
}

@media (max-width: 768px) {
  .sidebar-top-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    gap: 0;
    height: 40px;
    min-height: 0;
    background: transparent;
  }
  .sidebar-top-row nav {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    display: flex;
    align-items: center;
  }
  .sidebar-top-row nav ul {
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
    margin-bottom: 0;
    height: 100%;
    display: flex;
    align-items: center;
    min-height: 0;
  }
  .sidebar-top-row nav ul li a {
    height: 40px;
    display: flex;
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
  }
  .sidebar-user.mobile-profile {
    flex: 0 0 auto;
    margin-left: 8px;
    margin-right: 4px;
    display: flex !important;
    align-items: center;
    height: 24px;
  }
  .profile-trigger {
    height: 36px;
    display: flex;
    align-items: center;
    padding: 0 8px;
  }
  .sidebar-user-img {
    height: 32px;
    width: 32px;
    object-fit: cover;
    display: block;
  }
}

@media (max-width: 768px) {
  .scripts-container {
    padding: 18px 4vw 18px 4vw;
  }
  .script-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 8px;
  }
  .script-num {
    text-align: left;
    height: auto;
    margin-bottom: 2px;
  }
  .script-input {
    width: 100%;
    min-width: 0;
    font-size: 1rem;
    padding: 10px 12px;
    border-radius: 14px;
    box-sizing: border-box;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    resize: vertical;
    min-height: 44px;
    max-width: 100%;
    display: block;
  }
  .button-stack {
    flex-direction: row;
    gap: 10px;
    justify-content: flex-start;
    align-items: center;
    margin-top: 0;
    margin-bottom: 0;
    width: 100%;
    flex-wrap: nowrap !important;
    overflow-x: auto;
  }
  .record-btn-styled, .upload-btn {
    width: 28%;
    min-width: 90px;
    max-width: 180px;
    flex-shrink: 1;
    padding: 8px 0;
    font-size: 0.98rem;
    margin: 0;
    border-radius: 14px;
    text-align: center;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    flex-grow: 1;
  }
  .video-controls {
    margin-top: 6px;
    margin-bottom: 0;
  }
}

/* For desktop and mobile, allow .script-input to expand vertically for hooks (input[type=text]) */
.script-input.hook-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  resize: vertical;
  min-height: 44px;
  max-width: 100%;
  display: block;
}

.video-preview-large {
  aspect-ratio: 9 / 16;
  width: 100%;
  max-width: 320px;
  height: auto;
  background: #222;
  border-radius: 12px;
  display: block;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .video-wrapper {
    width: 100%;
    max-width: 100vw;
    height: auto;
    background: #222;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
  }
  .video-preview-large {
    width: auto;
    max-width: 100vw;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    background: #222;
    border-radius: 12px;
    display: block;
    margin: 0 auto;
  }
}

.table-scroll-x {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  box-shadow: 0 2px 8px #0001;
  margin-bottom: 12px;
}

@media (max-width: 768px) {
  .table-scroll-x {
    width: 100%;
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 2px 8px #0001;
    background: #fff;
    margin: 0;
    padding: 0;
  }
  .merged-table {
    min-width: 600px;
    width: auto;
    display: table;
    font-size: 0.95rem;
    box-shadow: none;
    position: static;
  }
}

@media (max-width: 768px) {
  .profile-container {
    padding: 18px 4vw 18px 4vw;
    max-width: 98vw;
  }
  .profile-container h2 {
    font-size: 1.25rem;
    margin-bottom: 12px;
  }
  .profile-form input[type="text"],
  .profile-form input[type="date"] {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    font-size: 1rem;
    padding: 10px 12px;
    border-radius: 14px;
  }
  .profile-form label {
    font-size: 1rem;
  }
} 