body {
  margin: 0;
  font-family: 'Inter', Arial, sans-serif;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  color: #222;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  display: flex;
  flex-direction: row;
  flex: 1;              /* grow to fill available space, pushing footer down */
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 0 16px;
  gap: 24px;
  position: relative;
  box-sizing: border-box;
}

.main-content {
  flex: 1;
  max-width: 100%;
  min-width: 0;
}

.main-content>h1.compact-title {
  padding-top: 40px !important;
  margin-top: 0 !important;
  display: block;
}

/* Tool page container */
.tool-container {
  display: flex;
  gap: 30px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  position: relative;
}

.tool-section {
  flex: 1;
  min-width: 0;
}

.tool-sidebar {
  flex: 0 0 320px;
  position: sticky;
  top: 20px;
  height: fit-content;
}

/* Form styles */
.currency-form {
  background: #fff;
  border-radius: 10px;
  padding: 25px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  margin-bottom: 30px;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: flex-end;
}

.form-group {
  flex: 1;
  min-width: 200px;
}

.form-group.amount-group {
  flex: 0 0 200px;
}

.form-group.swap-group {
  flex: 0 0 50px;
  display: flex;
  justify-content: center;
  padding-bottom: 5px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #4a5568;
}

.form-control {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 16px;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Buttons */
.btn-primary,
.btn-secondary {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: #4a90e2;
  color: white;
}

.btn-primary:hover {
  background: #3a7bc8;
}

.btn-secondary {
  background: #f1f5f9;
  color: #4a5568;
}

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

.btn-swap {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-swap:hover {
  background: #f8fafc;
  border-color: #cbd5e0;
}

.btn-swap svg {
  width: 20px;
  height: 20px;
  color: #4a5568;
}

/* Form actions */
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  width: 100%;
}

/* Result section */
.conversion-result {
  background: #fff;
  border-radius: 10px;
  padding: 25px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  margin-bottom: 30px;
}

.result-box {
  text-align: center;
  padding: 20px 0;
}

.amount-display {
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.amount {
  color: #2d3748;
}

.amount.result {
  color: #4a90e2;
}

.currency {
  color: #718096;
  font-size: 1.8rem;
  margin: 0 5px;
}

.equals {
  color: #a0aec0;
  margin: 0 5px;
}

.rate-info {
  background: #f8fafc;
  border-radius: 8px;
  padding: 15px;
  margin: 20px 0;
  font-size: 0.95rem;
  color: #4a5568;
  border: 1px solid #edf2f7;
}

.rate-info p {
  margin: 8px 0;
}

.last-updated {
  color: #718096;
  font-size: 0.85rem;
  margin-top: 15px;
  font-style: italic;
}

/* Error message */
.error-message {
  background: #fff5f5;
  color: #e53e3e;
  padding: 12px 15px;
  border-radius: 6px;
  margin-bottom: 20px;
  border-left: 4px solid #e53e3e;
}

/* Tool info section */
.tool-info-section {
  background: #fff;
  border-radius: 10px;
  padding: 30px;
  margin-top: 40px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.tool-info-section h2 {
  color: #2d3748;
  margin-top: 0;
  margin-bottom: 25px;
  text-align: center;
  font-size: 1.8rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.feature-card {
  background: #f8fafc;
  border-radius: 8px;
  padding: 20px;
  border: 1px solid #e2e8f0;
}

.feature-card h3 {
  color: #2d3748;
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.feature-card p {
  color: #4a5568;
  margin: 0;
  line-height: 1.5;
}

.info-box {
  background: #f0f9ff;
  border-radius: 8px;
  padding: 20px;
  margin: 25px 0;
  border: 1px solid #bae6fd;
}

.info-box h3 {
  margin-top: 0;
  color: #0369a1;
  font-size: 1.1rem;
}

.info-box ol {
  padding-left: 20px;
  margin: 10px 0 0;
}

.info-box li {
  margin-bottom: 8px;
  color: #4a5568;
}

.pro-tip {
  background: #f0fdf4;
  border-radius: 8px;
  padding: 15px 20px;
  margin-top: 25px;
  border: 1px solid #86efac;
  color: #166534;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .tool-container {
    flex-direction: column;
  }

  .tool-sidebar {
    display: none;
    /* Hide sidebar on smaller screens */
  }
}

@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
  }

  .form-group,
  .form-group.amount-group {
    width: 100%;
    flex: 1 1 100%;
  }

  .form-group.swap-group {
    width: 100%;
    margin: 10px 0;
  }

  .amount-display {
    font-size: 1.8rem;
    flex-direction: column;
  }

  .currency {
    font-size: 1.4rem;
  }
}

/* Sidebar styles */
.sidebar {
  flex: 0 0 280px;
  background: #f1f3f6;
  padding: 32px 16px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.sidebar.left {
  border-right: 1px solid #e0e7ef;
}

.sidebar.right {
  border-left: 1px solid #e0e7ef;
  margin-left: auto;
}

.ad-placeholder {
  width: 100%;
  min-height: 250px;
  background: #e0e7ef;
  border: 2px dashed #b0b8c1;
  color: #7a869a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1em;
  border-radius: 10px;
  margin-bottom: 16px;
  position: relative;
}

.ad-placeholder:after {
  content: 'Ad Space';
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.8em;
  color: #7a869a;
  font-weight: 600;
}

.main-content {
  flex: 1;
  padding: 0 16px 36px 16px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0;
}

.main-content h1 {
  margin: 0;
  padding: 0 0 12px 0;
  font-size: 2em;
  color: #209CEE;
  font-weight: 700;
  letter-spacing: 0.5px;
  width: 100%;
  text-align: center;
}

/* Desktop styling for tool pages */
@media (min-width: 1025px) {

  /* Main tool container */
  .main-content>form,
  .main-content>section:first-of-type,
  .tool-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 30px;
    margin: 20px auto;
    max-width: 1100px;
    width: 100%;
    box-sizing: border-box;
  }

  /* Tool page headings */
  section[aria-labelledby$="-title"]>h1:first-child,
  .main-content>h1:first-child,
  .tool-container>h1:first-child,
  .container>h1:first-child,
  .main-content>section>h1:first-child {
    margin: 0 0 25px 0 !important;
    padding: 0;
    text-align: center;
    font-size: 2.2em;
    color: #209CEE;
    position: relative;
    display: block;
  }

  /* Tool descriptions */
  .tool-desc,
  .tool-description,
  p[class*="desc"]:first-of-type,
  .main-content>p:first-of-type {
    margin: 0 auto 30px auto !important;
    max-width: 800px;
    text-align: center;
    color: #4b5563;
    line-height: 1.6;
    font-size: 1.1em;
  }

  /* Form elements */
  .main-content form {
    max-width: 800px;
    margin: 0 auto !important;
  }

  /* Feature boxes */
  .main-content>div[style*="background:"] {
    max-width: 1100px !important;
    margin: 30px auto !important;
    border-radius: 12px !important;
    overflow: hidden;
  }

  /* Main content adjustments */
  .main-content {
    padding: 20px 16px 40px !important;
    margin: 0 auto;
    max-width: 1200px;
  }

  /* Search Page Styles */
  .search-page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 16px 40px;
  }

  .search-container {
    max-width: 900px;
    margin: 0 auto;
  }

  .search-title {
    text-align: center;
    color: #2a4d8f;
    font-size: 2.5em;
    margin-bottom: 1.5rem;
  }

  .search-form {
    margin-bottom: 2.5rem;
  }

  .search-input-group {
    display: flex;
    max-width: 700px;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
  }

  .search-input-group:focus-within {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
  }

  .search-input {
    flex: 1;
    padding: 16px 20px;
    font-size: 1.1em;
    border: 2px solid #e2e8f0;
    border-right: none;
    border-radius: 12px 0 0 12px;
    outline: none;
    transition: all 0.3s ease;
  }

  .search-input:focus {
    border-color: #3b82f6;
  }

  .search-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 24px;
    font-size: 1.1em;
    font-weight: 600;
    color: white;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    border: none;
    border-radius: 0 12px 12px 0;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .search-button:hover {
    background: linear-gradient(90deg, #1d4ed8, #2563eb);
    transform: translateY(-1px);
  }

  .search-button:active {
    transform: translateY(0);
  }

  /* Search Messages */
  .search-message {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    margin: 2rem auto;
    max-width: 600px;
  }

  .search-icon {
    margin-bottom: 1.5rem;
  }

  .search-message h3 {
    color: #2a4d8f;
    font-size: 1.5em;
    margin-bottom: 0.75rem;
  }

  .search-message p {
    color: #64748b;
    font-size: 1.1em;
    line-height: 1.6;
    max-width: 500px;
    margin: 0 auto;
  }

  .search-message.no-results .search-icon svg {
    stroke: #e74c3c;
  }

  /* Search Results */
  .search-results {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    padding: 2rem;
    margin-top: 2rem;
  }

  .search-results-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
  }

  .search-results-header h2 {
    color: #2a4d8f;
    font-size: 1.5em;
    margin: 0;
  }

  .tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
  }

  .tool-card {
    display: block;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    color: #2a4d8f;
    transition: all 0.2s ease;
  }

  .tool-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    border-color: #bfdbfe;
  }

  .tool-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1em;
    color: #2563eb;
  }

  .tool-category {
    display: inline-block;
    font-size: 0.9em;
    color: #64748b;
    background: #e2e8f0;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
  }

  /* Responsive Adjustments */
  @media (max-width: 768px) {
    .search-title {
      font-size: 2em;
    }

    .search-input-group {
      flex-direction: column;
      box-shadow: none;
      gap: 12px;
    }

    .search-input {
      width: 100%;
      border-radius: 8px;
      border: 2px solid #e2e8f0;
    }

    .search-button {
      width: 100%;
      border-radius: 8px;
      justify-content: center;
      padding: 14px;
    }

    .tool-grid {
      grid-template-columns: 1fr;
    }

    .search-results {
      padding: 1.5rem 1rem;
    }
  }
}

.tool-categories {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.tool-categories h2 {
  margin-top: 16px;
  margin-bottom: 12px;
  font-size: 1.35em;
  font-weight: 600;
  color: #209CEE;
  background: linear-gradient(90deg, #e0f2fe 60%, #f0f9ff 100%);
  padding: 10px 18px;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(32, 156, 238, 0.04);
  letter-spacing: 0.5px;
}

.tool-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  padding: 14px 0 8px 0;
  justify-content: center;
  margin: 0 0 32px 0;
  padding: 0;
}

.tool-card {
  background: #f8fafc;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(44, 62, 80, 0.08);
  padding: 36px 24px 28px 24px;
  min-width: 0;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
  color: #2a4d8f;
  font-size: 1.13em;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1.5px solid #e0e7ff;
}

.tool-card:hover {
  transform: translateY(-8px) scale(1.04);
  box-shadow: 0 8px 32px rgba(32, 156, 238, 0.16);
  color: #0c4a6e;
  border: 1.5px solid #209CEE;
  background: #f0f9ff;
}

.tool-card i {
  font-size: 2.7em;
  margin-bottom: 16px;
  color: #209CEE;
  display: block;
}

.tool-card div {
  font-weight: 600;
  font-size: 1.13em;
  margin-bottom: 6px;
}

.tool-card small {
  color: #4f5d75;
  font-size: 0.98em;
  margin-top: 4px;
  display: block;
  line-height: 1.5;
}

form {
  width: 100%;
  max-width: 480px;
  margin: 0 auto 24px auto;
  background: #f8fafc;
  padding: 28px 24px 18px 24px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(44, 62, 80, 0.07);
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

form input[type="text"],
form textarea {
  width: 100%;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #b0b8c1;
  font-size: 1.08em;
  background: #fff;
  transition: border 0.2s;
  box-sizing: border-box;
}

/* Improved form elements for mobile */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="url"],
textarea {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  /* Prevents iOS zoom on focus */
  border: 1px solid #ccc;
  border-radius: 8px;
  margin-bottom: 12px;
}

textarea {
  min-height: 120px;
  line-height: 1.4;
}

form input[type="text"]:focus,
form textarea:focus {
  border: 1.5px solid #209CEE;
  outline: none;
}

form button {
  padding: 13px 18px;
  border: none;
  border-radius: 6px;
  background: linear-gradient(90deg, #209CEE 60%, #0ea5e9 100%);
  color: #fff;
  font-size: 1.08em;
  font-weight: 600;
  cursor: pointer;
  margin-right: 0;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(32, 156, 238, 0.07);
  min-width: 120px;
}

form button:hover {
  background: linear-gradient(90deg, #0c4a6e 60%, #0369a1 100%);
}

form .button-group {
  display: flex;
  gap: 12px;
  width: 100%;
  justify-content: center;
}

.result textarea,
.result pre {
  width: 100%;
  margin-top: 10px;
  font-size: 1em;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #b0b8c1;
  background: #f8f9fa;
  resize: vertical;
}

.error {
  color: #e74c3c;
  background: #fff0f0;
  border: 1px solid #e74c3c;
  border-radius: 6px;
  padding: 10px;
  margin-top: 10px;
  width: 100%;
  max-width: 480px;
}

footer {
  background: linear-gradient(90deg, #209CEE 60%, #0ea5e9 100%);
  color: #fff;
  text-align: center;
  padding: 18px 0;
  font-size: 1em;
  margin-top: 40px;
  border-radius: 0 0 18px 18px;
  box-shadow: 0 -2px 8px rgba(32, 156, 238, 0.07);
}

/* Medium screens */
@media (max-width: 1024px) {
  .container {
    flex-direction: column;
    max-width: 100%;
    padding: 0;
  }

  .sidebar {
    flex: none;
    width: 100%;
    max-width: 100%;
    min-height: auto;
    padding: 16px;
    position: static;
    max-height: none;
  }

  .sidebar.right {
    order: 3;
    border-left: none;
    border-top: 1px solid #e0e7ef;
    margin-left: 0;
  }

  .main-content {
    order: 2;
    padding: 16px;
    width: 100%;
  }

  .tool-categories {
    padding: 0 8px;
    width: calc(100% - 16px);
    margin: 0 auto;
  }

  /* Improve sidebar ad display on medium screens */
  .ad-placeholder {
    width: 45%;
    min-height: 120px;
    display: inline-flex;
    margin: 0 5px;
  }

  /* Show second ad placeholder on medium screens */
  .sidebar.right .ad-placeholder[style*="display: none"] {
    display: inline-flex !important;
  }
}

@media (max-width: 600px) {

  /* Reset container padding for mobile */
  .container {
    padding: 0;
    width: 100%;
    overflow-x: hidden;
  }

  /* Main content adjustments */
  .main-content {
    padding: 0;
    width: 100%;
  }

  .main-content h1 {
    font-size: 1.5em;
    padding: 20px 16px 12px;
  }

  /* Tool categories and cards */
  .tool-categories {
    width: 100%;
    padding: 0 16px;
    box-sizing: border-box;
  }

  .tool-categories h2 {
    font-size: 1.13em;
    padding: 10px 16px;
    margin: 24px 0 12px;
    font-weight: 700;
    background: #e0e7ff;
    border-radius: 8px;
    box-shadow: none;
    color: #2a4d8f;
    display: block;
  }

  .tool-list {
    grid-template-columns: 1fr;
    gap: 16px;
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  .tool-card {
    padding: 16px;
    font-size: 1em;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }

  .tool-card:active {
    transform: translateY(2px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  }

  .container {
    box-shadow: none;
    border-radius: 0;
  }

  /* Ensure no horizontal scroll and proper content containment */
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
    width: 100%;
  }

  /* Fix for internal tool pages */
  section[aria-labelledby$="-title"] {
    width: 100%;
    padding: 0 16px;
    box-sizing: border-box;
  }

  /* Form and content container adjustments */
  form,
  .result,
  .tool-desc {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 8px !important;
    box-sizing: border-box !important;
  }

  /* Fix for textareas and inputs */
  textarea,
  input[type="text"],
  input[type="url"],
  select {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Button group adjustments */
  .button-group {
    width: 100% !important;
    padding: 0 8px !important;
    box-sizing: border-box !important;
  }

  .ad-placeholder {
    min-height: 80px;
    font-size: 0.95em;
  }

  /* Improved button styling for mobile */
  .button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: calc(100% - 20px);
    margin: 10px auto;
    padding: 0 10px;
  }

  .button-group button {
    flex: 1;
    min-width: 90px;
    max-width: calc(100% - 20px);
    padding: 10px 8px;
    font-size: 1em;
    border-radius: 8px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
  }

  form {
    padding: 16px 12px;
    margin-bottom: 16px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  }

  .qr-code-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 0 12px 0;
    width: 100%;
  }

  .qr-code-container img {
    max-width: 90vw;
    height: auto;
    margin: 0 auto;
    display: block;
    box-sizing: border-box;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  /* Improve form elements on small screens */
  form input[type="text"],
  form textarea {
    font-size: 16px;
    /* Prevent iOS zoom on focus */
    padding: 10px;
    border-radius: 8px;
    width: calc(100% - 10px);
    margin-left: 5px;
    margin-right: 5px;
  }

  form button {
    width: calc(100% - 20px);
    margin-top: 8px;
    margin-left: 10px;
    margin-right: 10px;
    padding: 10px 14px;
    height: 42px;
    font-size: 1em;
  }

  form .button-group {
    flex-direction: column;
    width: calc(100% - 20px);
    margin: 10px auto;
    gap: 10px;
  }
}

.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 6px 4vw;
  background: linear-gradient(90deg, #209CEE 60%, #0ea5e9 100%);
  position: relative;
  margin: 0;         /* prevent any browser default margin */
  box-sizing: border-box;
  /* overflow-x: hidden; */
  /* Removed to prevent dropdown clipping */
}

.site-title {
  margin: 0;
  font-size: 2.3em;
  letter-spacing: 1px;
  font-weight: 700;
  flex: 1;
  text-align: left;
  color: #fff;
  text-shadow: 0 2px 8px rgba(44, 62, 80, 0.18);
}

.tool-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  box-shadow: none;
  max-width: 340px;
  width: 100%;
}

.tool-search-bar input[type="text"] {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #b0b8c1;
  font-size: 1em;
  min-width: 160px;
  background: #fff;
  transition: border 0.2s;
  width: 100%;
}

.tool-search-bar input[type="text"]:focus {
  border: 1.5px solid #4f8cff;
  outline: none;
}

.tool-search-bar button {
  background: #4f8cff;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.2s;
}

.tool-search-bar button:hover {
  background: #2a4d8f;
}

@media (max-width: 900px) {
  .main-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 8px 0;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
  }

  .site-title {
    text-align: left;
    font-size: 1.6em;
    padding: 0;
    margin: 0;
  }
}

@media (max-width: 600px) {
  .main-header {
    padding: 8px 0 6px 0;
  }

  .site-title {
    font-size: 1.4em;
    padding: 0 12px;
  }
}

/* ==========================================================================
   Article / Guide Page Styles
   ========================================================================== */

.article-container {
  max-width: 1100px;
  margin: 40px auto;
  padding: 30px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  line-height: 1.8;
}

.article-title {
  font-family: 'Inter', sans-serif;
  font-size: 2.5rem;
  color: #1e293b;
  text-align: center;
  margin-bottom: 1.5rem;
}

.article-intro {
  font-size: 1.2rem;
  color: #475569;
  text-align: center;
  margin-bottom: 3rem;
  line-height: 1.8;
}

.article-section {
  margin-bottom: 4rem;
}

.section-title {
  color: #2563eb;
  font-size: 1.8rem;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.subsection-title {
  color: #0f172a;
  font-size: 1.4rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.text-content {
  line-height: 1.8;
  color: #334155;
  margin-bottom: 1.5rem;
}

.list-content {
  margin-left: 1.5rem;
  color: #475569;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.text-link {
  color: #2563eb;
  text-decoration: underline;
}

.text-link:hover {
  color: #1d4ed8;
}

.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.note-box,
.note-box-success,
.note-box-danger,
.note-box-info {
  padding: 1.5rem;
  border-radius: 8px;
  border-left-width: 4px;
}

.note-box-success {
  background: #f0fdf4;
  border-color: #4ade80;
}

.note-box-success h3 {
  color: #166534;
  margin-top: 0;
}

.note-box-success p {
  color: #14532d;
  font-size: 0.95rem;
}

.note-box-danger {
  background: #fef2f2;
  border-color: #f87171;
}

.note-box-danger h3 {
  color: #991b1b;
  margin-top: 0;
}

.note-box-danger p {
  color: #7f1d1d;
  font-size: 0.95rem;
}

.note-box-info {
  background: #f8fafc;
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.note-box-info ol {
  margin-left: 1.5rem;
  color: #475569;
  line-height: 1.8;
  margin: 0;
}

.footer-note {
  margin-top: 2rem;
  font-size: 0.95rem;
  color: #64748b;
  text-align: center;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

.data-table th,
.data-table td {
  padding: 12px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.data-table th {
  background: #f1f5f9;
  border-bottom-width: 2px;
  border-bottom-color: #cbd5e1;
}

.cta-box {
  background: #f0f9ff;
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  border: 1px solid #bae6fd;
}

.cta-box h3 {
  color: #0369a1;
  margin-top: 0;
}

.cta-box p {
  color: #334155;
  margin-bottom: 1.5rem;
}

.cta-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.cta-button-primary {
  background: #0284c7;
  color: white;
  padding: 12px 24px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s;
}

.cta-button-primary:hover {
  background: #0369a1;
  color: white;
}

.cta-button-secondary {
  background: #fff;
  color: #0284c7;
  border: 1px solid #0284c7;
  padding: 12px 24px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s;
}

.cta-button-secondary:hover {
  background: #f0f9ff;
  color: #0284c7;
}

/* ==========================================================================
   Content Card Styles (used across About, FAQ, Getting Started, etc.)
   ========================================================================== */

.content-section {
  max-width: 1100px;
  margin: 20px auto;
  padding: 0 16px;
}

.content-card {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.content-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* ==========================================================================
   Article/Guide Page Mobile Responsiveness
   ========================================================================== */

@media (max-width: 768px) {

  /* Article container adjustments */
  .article-container,
  section[aria-labelledby*="guide-title"],
  section[aria-labelledby*="title"] {
    margin: 16px auto !important;
    padding: 16px !important;
    border-radius: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-wrap: break-word !important;
  }

  /* Article title scaling */
  .article-title,
  section h1[id*="title"] {
    font-size: 1.6rem !important;
    line-height: 1.3 !important;
    margin-bottom: 1rem !important;
  }

  /* Intro text adjustments */
  .article-intro,
  .tool-desc {
    font-size: 1rem !important;
    margin-bottom: 2rem !important;
  }

  /* Section titles */
  .section-title,
  section h2 {
    font-size: 1.4rem !important;
    padding-bottom: 0.4rem !important;
    margin-bottom: 1rem !important;
  }

  /* Subsection titles */
  .subsection-title,
  section h3 {
    font-size: 1.15rem !important;
    margin-top: 1.5rem !important;
    margin-bottom: 0.75rem !important;
  }

  /* Text content spacing */
  .text-content,
  section p {
    font-size: 0.95rem !important;
    line-height: 1.7 !important;
    margin-bottom: 1rem !important;
  }

  /* List content adjustments */
  .list-content,
  section ul,
  section ol {
    margin-left: 1rem !important;
    padding-left: 0.5rem !important;
    font-size: 0.95rem !important;
  }

  /* Grid layouts - stack on mobile */
  .grid-2-col,
  div[style*="grid-template-columns"] {
    display: block !important;
    grid-template-columns: 1fr !important;
  }

  .grid-2-col>div,
  div[style*="grid-template-columns"]>div {
    margin-bottom: 16px !important;
  }

  /* Note boxes */
  .note-box,
  .note-box-success,
  .note-box-danger,
  .note-box-info,
  div[style*="border-left: 4px"] {
    padding: 1rem !important;
    margin: 1rem 0 !important;
  }

  /* Tables - horizontal scroll wrapper */
  .data-table,
  section table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 0.85rem !important;
  }

  .data-table th,
  .data-table td,
  section table th,
  section table td {
    padding: 8px !important;
    white-space: nowrap;
  }

  /* Code blocks */
  section pre,
  div[style*="background: #f1f5f9"] pre {
    font-size: 0.8rem !important;
    padding: 1rem !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* CTA boxes */
  .cta-box,
  div[style*="background: #f0f9ff"][style*="text-align: center"] {
    padding: 1.5rem 1rem !important;
    margin: 1.5rem 0 !important;
  }

  /* CTA action buttons - stack vertically */
  .cta-actions,
  div[style*="display: flex"][style*="gap: 1rem"][style*="justify-content: center"] {
    flex-direction: column !important;
    gap: 0.75rem !important;
    align-items: stretch !important;
  }

  .cta-actions a,
  .cta-button-primary,
  .cta-button-secondary {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }

  /* Inline style grid overrides for mobile */
  div[style*="display: grid"] {
    display: block !important;
  }

  div[style*="display: flex"][style*="gap: 1rem"][style*="flex-wrap: wrap"] {
    flex-direction: column !important;
  }

  div[style*="display: flex"][style*="gap: 1rem"][style*="flex-wrap: wrap"]>a {
    width: 100% !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }
}

@media (max-width: 480px) {

  .article-container,
  section[aria-labelledby*="title"] {
    margin: 8px !important;
    padding: 12px !important;
  }

  .article-title,
  section h1[id*="title"] {
    font-size: 1.35rem !important;
  }

  .site-title {
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-wrap: break-word !important;
    font-size: 1.5rem !important;
    padding: 0 10px !important;
  }

  .section-title,
  section h2 {
    font-size: 1.2rem !important;
  }

  section pre,
  .code-display pre,
  pre {
    font-size: 0.75rem !important;
    overflow-x: auto !important;
    max-width: 100% !important;
    white-space: pre !important;
    /* Allow scrolling, don't wrap code */
    display: block !important;
  }
}

/* ==========================================================================
   Dark Mode Support for Article/Content Pages
   ========================================================================== */

[data-theme="dark"] .article-container,
[data-theme="dark"] section[aria-labelledby*="title"][style*="background: #fff"],
html[data-theme="dark"] section[style*="background: #fff"] {
  background: #2d3748 !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] .article-title,
[data-theme="dark"] section h1[id*="title"],
html[data-theme="dark"] h1[style*="color: #1e293b"] {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .article-intro,
[data-theme="dark"] .tool-desc,
html[data-theme="dark"] p[style*="color: #475569"] {
  color: #a0aec0 !important;
}

[data-theme="dark"] .section-title,
[data-theme="dark"] section h2[style*="color: #2563eb"],
html[data-theme="dark"] h2[style*="color: #2563eb"] {
  color: #63b3ed !important;
  border-color: #4a5568 !important;
}

[data-theme="dark"] .subsection-title,
[data-theme="dark"] section h3[style*="color: #0f172a"],
html[data-theme="dark"] h3[style*="color: #0f172a"] {
  color: #e2e8f0 !important;
}

[data-theme="dark"] .text-content,
[data-theme="dark"] section p[style*="color: #334155"],
html[data-theme="dark"] p[style*="color: #334155"] {
  color: #cbd5e0 !important;
}

[data-theme="dark"] .list-content,
[data-theme="dark"] section ul[style*="color: #475569"],
[data-theme="dark"] section ol[style*="color: #475569"],
html[data-theme="dark"] ul[style*="color: #475569"],
html[data-theme="dark"] ol[style*="color: #475569"] {
  color: #a0aec0 !important;
}

/* Dark mode note boxes */
[data-theme="dark"] .note-box,
[data-theme="dark"] div[style*="background: #f8fafc"][style*="border-left"] {
  background: #1a202c !important;
}

[data-theme="dark"] .note-box-success,
[data-theme="dark"] div[style*="background: #f0fdf4"] {
  background: #1a332a !important;
}

[data-theme="dark"] .note-box-danger,
[data-theme="dark"] div[style*="background: #fef2f2"] {
  background: #331a1a !important;
}

[data-theme="dark"] .note-box-info,
[data-theme="dark"] div[style*="background: #f8fafc"][style*="border: 1px solid #e2e8f0"] {
  background: #1a202c !important;
  border-color: #4a5568 !important;
}

/* Dark mode code blocks */
[data-theme="dark"] section pre,
[data-theme="dark"] div[style*="background: #f1f5f9"] {
  background: #1a202c !important;
  color: #e2e8f0 !important;
}

/* Dark mode tables */
[data-theme="dark"] .data-table th,
[data-theme="dark"] section table th[style*="background: #f1f5f9"] {
  background: #2d3748 !important;
  color: #e2e8f0 !important;
  border-color: #4a5568 !important;
}

[data-theme="dark"] .data-table td,
[data-theme="dark"] section table td {
  border-color: #4a5568 !important;
  color: #cbd5e0 !important;
}

/* Dark mode CTA boxes */
[data-theme="dark"] .cta-box,
[data-theme="dark"] div[style*="background: #f0f9ff"][style*="text-align: center"] {
  background: #1e3a5f !important;
  border-color: #2d4a6a !important;
}

[data-theme="dark"] .cta-box h3,
html[data-theme="dark"] h3[style*="color: #0369a1"] {
  color: #63b3ed !important;
}

[data-theme="dark"] .cta-box p {
  color: #a0aec0 !important;
}

/* Dark mode content cards */
[data-theme="dark"] .content-card,
[data-theme="dark"] div[style*="background: white"],
html[data-theme="dark"] div[style*="background: white"] {
  background: #2d3748 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .content-card h3,
html[data-theme="dark"] h3[style*="color: #2563eb"],
html[data-theme="dark"] h3[style*="color: #059669"],
html[data-theme="dark"] h3[style*="color: #dc2626"],
html[data-theme="dark"] h3[style*="color: #7c3aed"],
html[data-theme="dark"] h3[style*="color: #0891b2"] {
  color: #63b3ed !important;
}

html[data-theme="dark"] h4[style*="color: #1e293b"] {
  color: #f1f5f9 !important;
}

/* Dark mode gradient backgrounds */
[data-theme="dark"] div[style*="background: linear-gradient(135deg, #f8fafc"] {
  background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%) !important;
  border-color: #4a5568 !important;
}