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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Google Sans', sans-serif;
  background: #fbfbfd;
  color: #1d1d1f;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  background: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.8);
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.header h1 {
  font-size: 22px;
  font-weight: 500;
  color: #1d1d1f;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.5px;
}

.header-nav {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-left: auto;
}

.header-nav a {
  color: #5f6368;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s;
  padding: 6px 12px;
  border-radius: 6px;
}

.header-nav a:hover {
  color: #1d1d1f;
  background: rgba(0, 0, 0, 0.04);
}

/* Coffee button - subtle design */
.coffee-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #5f6368 !important;
  font-size: 13px !important;
  padding: 6px 12px !important;
  border-radius: 8px;
  transition: all 0.2s;
  background: transparent;
}

.coffee-btn:hover {
  color: #1d1d1f !important;
  background: rgba(0, 0, 0, 0.04) !important;
}

.coffee-btn svg {
  opacity: 0.8;
  transition: opacity 0.2s;
}

.coffee-btn:hover svg {
  opacity: 1;
}

/* Buy Me a Coffee image button - responsive */
#coffeeBtnHeader img {
  height: 40px !important;
  width: 145px !important;
  display: block;
  transition: opacity 0.2s;
}

#coffeeBtnHeader:hover img {
  opacity: 0.9;
}

/* Help button - in connection section */
.help-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #5f6368;
  font-size: 14px;
  padding: 6px;
  border-radius: 4px;
  transition: all 0.2s;
  background: transparent;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.help-btn:hover {
  color: #1d1d1f;
  background: rgba(0, 0, 0, 0.04);
}

.help-btn.active {
  color: #007aff;
  background: rgba(0, 122, 255, 0.1);
}

.help-btn svg {
  opacity: 0.8;
  transition: opacity 0.2s;
  width: 18px;
  height: 18px;
}

.help-btn:hover svg,
.help-btn.active svg {
  opacity: 1;
}

/* Main wrapper with side ads */
.main-wrapper {
  display: flex;
  width: 100%;
  max-width: 1600px; /* Max width to contain everything nicely */
  margin: 0 auto;
  gap: 24px; /* Space between ads and main content */
  padding: 0 24px; /* Space from viewport edges */
  min-height: calc(100vh - 200px);
}

@media (max-width: 900px) {
  .main-wrapper {
    padding: 0;
    gap: 0;
  }
}

/* Side ad bars - full length vertical */
.ad-sidebar {
  width: 160px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: sticky;
  top: 60px;
  height: fit-content;
  max-height: calc(100vh - 80px);
}

/* Ad banner spots */
.ad-banner {
  background: #f5f5f7;
  border: 1px solid #e5e5e7;
  text-align: center;
  padding: 20px;
  color: #86868b;
  font-size: 11px;
  border-radius: 8px;
}

.ad-banner-vertical {
  width: 160px;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 80px;
}

/* Horizontal ads (mobile/tablet only) */
.ad-horizontal {
  display: none; /* Hidden by default, shown on mobile/tablet */
  width: 100%;
  margin: 0 auto 24px;
  max-width: 728px;
}

.ad-horizontal-top {
  margin-bottom: 24px;
}

.ad-horizontal-bottom {
  margin-top: 24px;
  margin-bottom: 0;
}

.ad-banner-horizontal {
  width: 100%;
  min-height: 90px;
  max-width: 728px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Main container */
.main-container {
  flex: 1;
  padding: 32px 24px;
  width: 100%;
  min-width: 0; /* Allows flex item to shrink below content size */
  max-width: 1000px; /* Reasonable max width for comfortable reading/writing */
  margin: 0 auto; /* Center the container */
}

.content-area {
  display: flex;
  flex-direction: column;
}

/* App container */
/* Info Section - Subtle (no card) */
.info-section-subtle {
  margin-bottom: 20px;
  display: block;
}

.info-header-subtle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  user-select: none;
  gap: 12px;
  cursor: pointer;
  margin-bottom: 8px;
}

.info-header-subtle h2 {
  font-size: 16px;
  font-weight: 600;
  color: #1d1d1f;
  margin: 0;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  flex-shrink: 0;
}

.info-header h2 {
  font-size: 15px;
  font-weight: 600;
  color: #1d1d1f;
  margin: 0;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  flex-shrink: 0;
}

.info-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #86868b;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.info-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #1d1d1f;
}

.info-toggle-btn svg {
  width: 18px;
  height: 18px;
  transition: opacity 0.2s;
  display: inline-block;
}

.info-content-subtle {
  padding: 0;
  max-height: 1000px;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out, opacity 0.3s ease-out;
  opacity: 1;
}

.info-section-subtle.collapsed .info-content-subtle {
  max-height: 0;
  padding: 0;
  opacity: 0;
}

.info-content-subtle p {
  color: #5f6368;
  line-height: 1.6;
  margin-bottom: 16px;
  font-size: 15px;
}

.help-link-btn {
  background: none;
  border: none;
  color: #007aff;
  cursor: pointer;
  font-size: 13px;
  padding: 0;
  text-decoration: underline;
  transition: color 0.2s;
  font-family: inherit;
}

.help-link-btn:hover {
  color: #0051d5;
}

.info-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.info-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1d1d1f;
  font-size: 14px;
}

.info-feature svg {
  color: #34a853;
  flex-shrink: 0;
}

.info-how-it-works {
  background: #f5f5f7;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.info-how-it-works h3 {
  font-size: 16px;
  font-weight: 600;
  color: #1d1d1f;
  margin: 0 0 12px 0;
  font-family: 'Inter', sans-serif;
}

.info-how-it-works ol {
  margin: 0;
  padding-left: 20px;
}

/* Help Section (How it works) */
/* Help Prompt Notification */
.help-prompt-notification {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f5f5f7;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 24px;
  transition: all 0.3s ease-out;
  opacity: 1;
  transform: translateY(0);
}

.help-prompt-content {
  flex: 1;
}

.help-prompt-content p {
  margin: 0;
  font-size: 13px;
  color: #5f6368;
  line-height: 1.5;
}

.help-prompt-close {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #86868b;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  margin-left: 12px;
}

.help-prompt-close:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #1d1d1f;
}

.help-prompt-close svg {
  width: 16px;
  height: 16px;
}

/* Help Section (How it works) - Match notification style */
.help-section {
  background: #f5f5f7;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 0;
  margin-bottom: 24px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.help-section.hidden {
  display: none;
}

.help-section.fade-in {
  opacity: 1;
  transform: translateY(0);
}

.help-section.fade-out {
  opacity: 0;
  transform: translateY(-10px);
}

.help-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
}

.help-header h2 {
  font-size: 15px;
  font-weight: 600;
  color: #1d1d1f;
  margin: 0;
  font-family: 'Inter', sans-serif;
}

.help-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #86868b;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  margin-left: 12px;
}

.help-close-btn:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #1d1d1f;
}

.help-close-btn svg {
  width: 16px;
  height: 16px;
}

.help-content {
  padding: 0;
}

.help-content .help-header {
  padding: 12px 16px;
  margin-bottom: 0;
}

.help-content .help-steps {
  padding: 0px 16px 12px 26px;
  margin-top: 0;
  margin-left: 20;
}

.help-steps {
  margin: 0;
  padding-left: 28px;
  margin-left: 4px;
  color: #5f6368;
  line-height: 1.6;
  font-size: 13px;
}

.help-steps li {
  margin-bottom: 8px;
}

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

.help-steps strong {
  color: #1d1d1f;
  font-weight: 600;
}

.info-how-it-works li {
  margin-bottom: 8px;
  font-size: 14px;
}

.info-how-it-works strong {
  color: #1d1d1f;
  font-weight: 600;
}

.info-legal {
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 13px;
  color: #86868b;
  text-align: center;
}

.info-legal a {
  color: #007aff;
  text-decoration: none;
}

.info-legal a:hover {
  text-decoration: underline;
}

.app-container {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 40px;
  margin-bottom: 24px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.connection-section {
  margin-bottom: 24px;
  position: relative;
}

.connection-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #86868b;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.connected {
  background: #34a853;
  box-shadow: 0 0 0 2px rgba(52, 168, 83, 0.2);
}

.status-dot.connecting {
  background: #fbbc04;
  box-shadow: 0 0 0 2px rgba(251, 188, 4, 0.2);
  animation: pulse 1.5s infinite;
}

.status-dot.disconnected {
  background: #ea4335;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.code-section {
  margin-bottom: 16px;
}

.input-group {
  display: flex;
  gap: 6px;
  margin-bottom: 0;
  align-items: center;
  flex-wrap: wrap; /* Allow wrapping on mobile */
  width: 100%; /* Span full width */
  max-width: 100%;
}

@media (min-width: 769px) {
  .input-group {
    flex-wrap: nowrap !important; /* Force single line on laptop+ */
    width: 100% !important; /* Span full width */
    max-width: 100% !important; /* Prevent overflow */
  }
  
  .input-group input {
    flex: 0 0 160px !important; /* Fixed width for input on laptop */
    min-width: 160px !important;
    max-width: 160px !important;
  }
  
  .input-group .btn {
    flex: 0 0 auto !important; /* Don't grow or shrink, auto width */
    flex-shrink: 0 !important; /* Prevent buttons from shrinking */
    width: auto !important; /* Auto width based on content */
    min-width: auto !important;
    max-width: none !important;
    height: 44px !important; /* Match input and copy button height */
  }
  
  .input-group .btn-icon-code {
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    width: auto !important;
  }
}

.input-group input {
  flex: 1;
  min-width: 200px; /* Minimum width for mobile */
  padding: 12px 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  font-size: 15px;
  font-family: 'Roboto Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 3px;
  text-align: center;
  font-weight: 500;
  transition: all 0.2s;
  background: #ffffff;
  color: #1d1d1f;
  height: 44px; /* Match copy button height */
  box-sizing: border-box; /* Include padding and border in height */
}

.input-group input:focus {
  outline: none;
  border-color: #007aff;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.btn-icon-code {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  cursor: pointer;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5f6368;
  transition: all 0.2s;
  min-width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.btn-icon-code:hover {
  background: #f5f5f7;
  color: #1d1d1f;
  border-color: rgba(0, 0, 0, 0.2);
}

.btn-icon-code.hidden {
  display: none;
}

.divider {
  text-align: center;
  margin: 20px 0;
  position: relative;
  color: #86868b;
  font-size: 12px;
  font-weight: 400;
}

.divider::before,
.divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 45%;
  height: 1px;
  background: #e8eaed;
}

.divider::before {
  left: 0;
}

.divider::after {
  right: 0;
}

.btn {
  padding: 12px 14px;
  border: none;
  border-radius: 8px; /* Match input border radius */
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap; /* Prevent button text from wrapping */
  flex: 0 0 auto; /* Don't grow or shrink, auto width */
  flex-shrink: 0; /* Prevent buttons from shrinking */
  width: auto; /* Auto width based on content */
  height: 44px; /* Match input and copy button height */
  box-sizing: border-box; /* Include padding and border in height */
  display: flex; /* Use flexbox for alignment */
  align-items: center; /* Center content vertically */
  justify-content: center; /* Center content horizontally */
}

@media (min-width: 769px) {
  .input-group {
    flex-wrap: nowrap; /* Force single line on laptop+ */
  }
  
  .btn {
    padding: 12px 16px; /* Slightly more padding on laptop */
    flex: 0 0 auto !important; /* Don't grow, auto width */
    width: auto !important; /* Auto width based on content */
    height: 44px !important; /* Match input and copy button height */
  }
  
  .btn-secondary {
    padding: 12px 14px; /* "Create New Pad" can be slightly smaller */
  }
}

.btn-primary {
  background: #007aff;
  color: white;
  border-radius: 8px;
}

.btn-primary:hover {
  background: #0051d5;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.btn-secondary {
  background: #f5f5f7;
  color: #1d1d1f;
  border-radius: 8px;
}

.btn-secondary:hover {
  background: #e8e8ed;
}

.btn-danger {
  background: #ea4335;
  color: white;
}

.btn-danger:hover {
  background: #c5221f;
}

.btn-link {
  background: transparent;
  color: #007aff;
  text-decoration: underline;
  padding: 8px 0;
}

.btn-link:hover {
  color: #0051d5;
}

.btn.hidden {
  display: none;
}

.notepad-section {
  margin-top: 24px;
}

.notepad-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f5f5f7;
  border-radius: 8px 8px 0 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  min-width: 0;
}

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

.btn-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  color: #5f6368;
  font-size: 14px;
  transition: all 0.2s;
}

.btn-toolbar:hover {
  background: #e8eaed;
  color: #202124;
}

.btn-toolbar:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  min-width: 0;
}

.text-size-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #5f6368;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 1;
  min-width: 0;
  white-space: nowrap;
}

.participants-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #5f6368;
  font-size: 14px;
  flex-shrink: 1;
  min-width: 0;
  white-space: nowrap;
}

#notepad {
  width: 100%;
  min-height: 500px;
  padding: 24px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-top: none;
  border-radius: 0;
  font-family: 'Roboto Mono', monospace;
  font-size: 15px;
  line-height: 1.7;
  resize: vertical;
  background: #ffffff;
  color: #1d1d1f;
}

#notepad:focus {
  outline: none;
  border-color: #007aff;
}

#notepad:disabled {
  background: #f8f9fa;
  cursor: not-allowed;
}

.files-container {
  margin-top: 16px;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: none;
}

.files-container.has-files {
  display: block;
}

/* Legal text at bottom of pad */
.pad-legal {
  padding: 12px 24px;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-top: none;
  background: #f8f9fa;
  border-radius: 0 0 8px 8px;
}

.pad-legal p {
  margin: 0;
  font-size: 12px;
  color: #86868b;
  line-height: 1.5;
}

.pad-legal a {
  color: #007aff;
  text-decoration: none;
  transition: color 0.2s;
}

.pad-legal a:hover {
  color: #0051d5;
  text-decoration: underline;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.file-item:last-child {
  margin-bottom: 0;
}

.file-preview {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 4px;
  object-fit: cover;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.file-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

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

.file-name {
  font-size: 14px;
  font-weight: 500;
  color: #1d1d1f;
  margin-bottom: 4px;
  word-break: break-word;
}

.file-size {
  font-size: 12px;
  color: #5f6368;
}

.file-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  width: 100%;
  margin-top: 8px;
}

@media (min-width: 481px) {
  .file-actions {
    width: auto;
    margin-top: 0;
  }
}

.btn-file-action {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  color: #5f6368;
  transition: all 0.2s;
}

.btn-file-action:hover {
  background: #f0f0f0;
  border-color: rgba(0, 0, 0, 0.2);
  color: #1d1d1f;
}

.btn-file-delete {
  color: #d32f2f;
  border-color: #d32f2f;
}

.btn-file-delete:hover {
  background: #ffebee;
}

.footer {
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  margin-top: 16px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.footer-legal {
  width: 100%;
  text-align: center;
  margin-top: 12px;
  padding-top: 12px;
  font-size: 11px;
  color: #86868b;
}

.footer-legal p {
  margin: 0;
  line-height: 1.5;
}

.footer-legal a {
  color: #007aff;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-legal a:hover {
  color: #0051d5;
  text-decoration: underline;
}

.footer-left {
  display: flex;
  gap: 12px;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #5f6368;
  font-size: 12px;
}

/* Responsive */
@media (max-width: 1200px) {
  .ad-sidebar {
    display: none;
  }
  
  /* Show horizontal ads on tablet/mobile when vertical ads are hidden */
  .ad-horizontal {
    display: block;
  }
  
  .main-wrapper {
    padding: 0 !important;
    gap: 0 !important;
  }
  
  .main-container {
    padding: 20px 14px;
    max-width: 100% !important;
    margin: 0 !important;
  }
  
  .connection-section {
    margin-bottom: 18px;
  }
  
  .notepad-section {
    margin-top: 18px;
  }
  
  #notepad {
    padding: 18px;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 8px 10px;
  }
  
  .header-content {
    flex-wrap: nowrap;
    gap: 4px;
  }
  
  .coffee-btn {
    padding: 4px 8px !important;
  }
  
  .coffee-btn span {
    display: none;
  }
  
  .coffee-btn svg {
    width: 18px;
    height: 18px;
  }
  
  /* Responsive Buy Me a Coffee button - tablet */
  #coffeeBtnHeader img {
    height: 35px !important;
    width: 127px !important;
  }
  
  /* Shrink logo on smaller screens */
  #logoContainer {
    gap: 6px !important;
  }
  
  #logoContainer img {
    max-height: 28px !important;
    max-width: 120px !important;
  }
  
  #brandNameContainer {
    left: 50% !important;
    transform: translateX(-50%) !important;
  }
  
  #brandNameContainer h1 {
    font-size: 16px !important;
    font-weight: 600 !important;
  }
  
  .info-section-subtle {
    margin-bottom: 10px;
  }
  
  .info-header-subtle {
    padding: 6px 0;
    margin-bottom: 4px;
  }
  
  .info-header-subtle h2 {
    font-size: 15px !important;
  }
  
  .info-content-subtle {
    font-size: 13px;
  }
  
  .info-content-subtle p {
    margin-bottom: 12px;
    font-size: 13px;
  }
  
  .info-section {
    margin-bottom: 10px;
  }
  
  .info-header {
    padding: 10px;
  }
  
  .info-content {
    padding: 0 10px 10px 10px;
  }
  
  .info-section.collapsed .info-content {
    padding: 0 10px;
  }
  
  .info-features {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 16px;
  }
  
  .info-feature {
    font-size: 13px;
  }
  
  .info-how-it-works {
    padding: 10px;
  }
  
  .app-container {
    padding: 10px;
  }
  
  /* Reduce spacing for pad sections on mobile */
  .connection-section {
    margin-bottom: 12px;
  }
  
  .connection-section-header {
    margin-bottom: 10px;
  }
  
  .notepad-section {
    margin-top: 12px;
  }
  
  .notepad-toolbar {
    padding: 8px 10px;
    flex-wrap: wrap;
    gap: 6px;
  }
  
  .btn-toolbar {
    padding: 6px 10px;
    font-size: 12px;
  }
  
  .toolbar-left {
    flex: 1;
    min-width: 0;
  }
  
  .toolbar-right {
    gap: 8px;
    flex-wrap: wrap;
    display: flex !important;
    align-items: center;
  }
  
  .text-size-badge {
    font-size: 12px;
    display: flex !important;
    align-items: center;
    white-space: nowrap;
  }
  
  .participants-badge {
    font-size: 12px;
    display: flex !important;
    align-items: center;
    white-space: nowrap;
  }
  
  .text-size-badge span,
  .participants-badge span {
    display: inline !important;
  }
  
  #notepad {
    padding: 12px;
    min-height: 350px;
    font-size: 16px; /* Prevent mobile zoom on focus */
  }
  
  .file-item {
    padding: 10px;
    gap: 10px;
  }
  
  .file-preview {
    width: 50px;
    height: 50px;
  }
  
  .files-container {
    padding: 12px;
  }
}

/* Progressive logo shrinking for medium screens */
@media (max-width: 1000px) {
  #logoContainer img {
    max-height: 36px !important;
    max-width: 180px !important;
  }
}

@media (max-width: 900px) {
  #logoContainer img {
    max-height: 32px !important;
    max-width: 160px !important;
  }
  
  #brandNameContainer h1 {
    font-size: 20px !important;
  }
}

@media (max-width: 600px) {
  #logoContainer img {
    max-height: 28px !important;
    max-width: 120px !important;
  }
  
  #brandNameContainer h1 {
    font-size: 16px !important;
  }
  
  /* Responsive Buy Me a Coffee button - small mobile */
  #coffeeBtnHeader img {
    height: 32px !important;
    width: 116px !important;
  }
  
  .main-wrapper {
    padding: 0 !important;
    gap: 0 !important;
  }
  
  .main-container {
    padding: 16px 12px;
    max-width: 100% !important;
    margin: 0 !important;
  }
  
  .connection-section {
    margin-bottom: 14px;
  }
  
  .notepad-section {
    margin-top: 14px;
  }
  
  #notepad {
    padding: 14px;
  }
}

@media (max-width: 480px) {
  #logoContainer img {
    max-height: 22px !important;
    max-width: 90px !important;
  }
  
  #brandNameContainer h1 {
    font-size: 15px !important;
  }
  
  .header {
    padding: 6px 8px;
  }
  
  .header-content {
    gap: 2px;
  }
  
  .coffee-btn {
    padding: 3px 6px !important;
  }
  
  .coffee-btn svg {
    width: 16px;
    height: 16px;
  }
  
  /* Responsive Buy Me a Coffee button - mobile */
  #coffeeBtnHeader img {
    height: 28px !important;
    width: 102px !important;
  }
  
  .app-container {
    padding: 8px;
  }
  
  .main-wrapper {
    padding: 0 !important;
    gap: 0 !important;
  }
  
  .main-container {
    padding: 10px 8px;
    max-width: 100% !important;
    margin: 0 !important;
  }
  
  .connection-section {
    margin-bottom: 10px;
  }
  
  .connection-section-header {
    margin-bottom: 8px;
  }
  
  .status-indicator {
    gap: 6px;
    font-size: 12px;
  }
  
  .status-dot {
    width: 8px;
    height: 8px;
  }
  
  .notepad-section {
    margin-top: 10px;
  }
  
  .info-section-subtle {
    margin-bottom: 8px;
  }
  
  .info-header-subtle {
    padding: 4px 0;
    margin-bottom: 2px;
  }
  
  .info-header-subtle h2 {
    font-size: 14px !important;
  }
  
  .info-content-subtle p {
    margin-bottom: 10px;
    font-size: 12px;
  }
  
  .info-features {
    gap: 6px;
    margin-bottom: 12px;
  }
  
  .info-feature {
    font-size: 12px;
    gap: 6px;
  }
  
  .help-prompt-notification {
    padding: 8px 10px;
    font-size: 12px;
  }
  
  .notepad-toolbar {
    padding: 6px 8px;
    flex-wrap: wrap;
    gap: 4px;
  }
  
  .toolbar-left {
    flex: 1 1 100%;
    min-width: 0;
    order: 2;
  }
  
  .toolbar-right {
    flex: 1 1 100%;
    gap: 4px;
    justify-content: space-between;
    order: 1;
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
  }
  
  .text-size-badge {
    font-size: 10px;
    gap: 3px;
    display: flex !important;
    align-items: center;
    white-space: nowrap;
  }
  
  .participants-badge {
    font-size: 10px;
    gap: 3px;
    display: flex !important;
    align-items: center;
    white-space: nowrap;
  }
  
  .participants-badge svg {
    width: 14px;
    height: 14px;
  }
  
  .text-size-badge span,
  .participants-badge span {
    display: inline !important;
  }
  
  .btn-toolbar {
    padding: 5px 8px;
    font-size: 11px;
    gap: 4px;
  }
  
  #notepad {
    padding: 10px;
    min-height: 300px;
    font-size: 16px; /* Prevent mobile zoom on focus */
  }
  
  .file-item {
    padding: 6px;
    gap: 6px;
  }
  
  .file-preview {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
  
  .file-name {
    font-size: 12px;
  }
  
  .file-size {
    font-size: 10px;
  }
  
  .file-actions {
    gap: 4px;
    margin-top: 6px;
  }
  
  .btn-file-action {
    padding: 4px 8px;
    font-size: 10px;
  }
  
  .files-container {
    padding: 8px;
  }
  
  .footer {
    padding: 12px 0;
    margin-top: 12px;
  }
  
  .footer-legal {
    margin-top: 8px;
    padding-top: 8px;
    font-size: 10px;
  }
  
  .info-section-subtle {
    margin-bottom: 12px;
  }
  
  .info-header-subtle {
    padding: 6px 0;
    margin-bottom: 6px;
  }
  
  .input-group {
    flex-wrap: wrap;
    align-items: stretch;
    gap: 4px;
  }
  
  /* Keep input and copy button on same line */
  .input-group input {
    flex: 1;
    min-width: 0;
    width: auto;
    margin-bottom: 0;
    padding: 8px 10px;
    font-size: 16px; /* Prevent mobile zoom on focus */
  }
  
  .input-group .btn-icon-code {
    flex-shrink: 0;
    width: auto;
    margin-bottom: 0;
    padding: 8px 10px;
  }
  
  /* Make buttons full width and stack below on mobile only */
  .input-group .btn {
    width: 100%;
    justify-content: center;
    margin-top: 0;
    flex-shrink: 1; /* Allow buttons to shrink on mobile */
    padding: 8px 10px;
    font-size: 12px;
  }
  
  /* Smaller horizontal ads on mobile */
  .ad-banner-horizontal {
    min-height: 50px;
    max-width: 100%;
  }
  
  .ad-horizontal {
    margin-bottom: 12px;
  }
  
  .page-footer {
    padding: 24px 12px;
  }
}

/* Footer */
.page-footer {
  background: #ffffff;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding: 32px 24px;
  margin-top: auto;
  text-align: center;
  color: #86868b;
  font-size: 12px;
}

.page-footer a {
  color: #007aff;
  text-decoration: none;
  margin: 0 8px;
  transition: color 0.2s;
}

.page-footer a:hover {
  color: #0051d5;
  text-decoration: underline;
}

/* Notifications */
.notification-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  pointer-events: none;
}

.notification {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  border-left: 4px solid #007aff;
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
  animation: slideInRight 0.3s ease-out;
  min-width: 300px;
}

.notification.error {
  border-left-color: #ea4335;
}

.notification.success {
  border-left-color: #34a853;
}

.notification.warning {
  border-left-color: #fbbc04;
}

.notification.info {
  border-left-color: #007aff;
}

.notification-content {
  flex: 1;
}

.notification-title {
  font-weight: 500;
  font-size: 14px;
  color: #1d1d1f;
  margin-bottom: 4px;
}

.notification-message {
  font-size: 13px;
  color: #86868b;
  line-height: 1.4;
}

.notification-close {
  background: transparent;
  border: none;
  color: #86868b;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.notification-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #1d1d1f;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.notification.hiding {
  animation: slideOutRight 0.3s ease-in forwards;
}

@media (max-width: 768px) {
  .notification-container {
    top: 60px;
    right: 16px;
    left: 16px;
    max-width: none;
  }
  
  .notification {
    min-width: auto;
  }
}

.page-footer a {
  color: #007aff;
  text-decoration: none;
  transition: color 0.2s;
}

.page-footer a:hover {
  color: #0051d5;
  text-decoration: underline;
}

/* Donation Prompt */
.donation-prompt {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #f5f5f7;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 340px;
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.donation-prompt-content {
  flex: 1;
}

.donation-prompt-content p {
  margin: 0;
  font-size: 13px;
  color: #5f6368;
  line-height: 1.5;
}

.donation-link {
  color: #007aff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.donation-link:hover {
  color: #0051d5;
  text-decoration: underline;
}

.donation-prompt-close {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #86868b;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.donation-prompt-close:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #1d1d1f;
}

.donation-prompt-close svg {
  width: 14px;
  height: 14px;
}

@media (max-width: 768px) {
  .donation-prompt {
    bottom: 16px;
    right: 16px;
    left: 16px;
    max-width: none;
  }
}

