/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  background: #f5f5f7;
  color: #1d1d1f;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* App Container */
.app-container {
  display: flex;
  height: 100vh;
  height: calc(var(--vh, 1vh) * 100);
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: #ffffff;
  border-right: 1px solid #e5e5e7;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 16px;
  top: max(16px, env(safe-area-inset-top));
  left: 16px;
  left: max(16px, env(safe-area-inset-left));
  z-index: 1000;
  background: #ffffff;
  border: 1px solid #d2d2d7;
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: all 0.2s ease;
}

.mobile-menu-toggle:active {
  transform: scale(0.95);
  background: #f5f5f7;
}

.mobile-menu-toggle svg {
  display: block;
  width: 24px;
  height: 24px;
  color: #1d1d1f;
}

.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
}

.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid #e5e5e7;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.logo svg {
  color: #1d1d1f;
}

.logo h1 {
  font-size: 18px;
  font-weight: 600;
  color: #1d1d1f;
}

.version {
  font-size: 11px;
  color: #86868b;
  margin-left: 34px;
}

/* Navigation */
.nav-section {
  padding: 12px 12px 0;
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
  color: #86868b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 12px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: #1d1d1f;
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s ease;
  margin-bottom: 4px;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.nav-item:hover {
  background: #f5f5f7;
}

.nav-item:active {
  background: #e8e8ea;
}

.nav-item.active {
  background: #f0f0f2;
  font-weight: 500;
}

.nav-item svg {
  flex-shrink: 0;
  color: #1d1d1f;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid #e5e5e7;
  margin-top: auto;
}

/* User Profile */
.user-profile {
  padding: 16px;
  border-top: 1px solid #e5e5e7;
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f5f5f7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-avatar svg {
  color: #86868b;
}

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

.user-name {
  font-size: 14px;
  font-weight: 500;
  color: #1d1d1f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-plan {
  font-size: 12px;
  color: #86868b;
}

/* Main Content */
.main-content {
  flex: 1;
  overflow-y: auto;
  background: #f5f5f7;
}

/* Pages */
.page {
  display: none;
}

.page.active {
  display: block;
}

.page-header {
  padding: 32px 48px 24px;
  background: #ffffff;
  border-bottom: 1px solid #e5e5e7;
}

.page-title {
  font-size: 28px;
  font-weight: 600;
  color: #1d1d1f;
}

.content-wrapper {
  padding: 32px 48px;
  max-width: 1200px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 10px 20px;
  background: #ffffff;
  border: 1px solid #d2d2d7;
  border-radius: 20px;
  font-size: 14px;
  color: #1d1d1f;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.tab-btn:hover {
  background: #f5f5f7;
  border-color: #1d1d1f;
}

.tab-btn:active {
  transform: scale(0.97);
}

.tab-btn.active {
  background: #1d1d1f;
  color: #ffffff;
  border-color: #1d1d1f;
}

/* Input Section */
.input-section {
  background: #ffffff;
  border: 1px solid #d2d2d7;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.input-section textarea {
  width: 100%;
  min-height: 200px;
  padding: 0;
  border: none;
  font-size: 15px;
  font-family: inherit;
  color: #1d1d1f;
  resize: vertical;
  outline: none;
  touch-action: manipulation;
}

.input-section textarea::placeholder {
  color: #86868b;
}

.input-section textarea:focus {
  outline: none;
}

.char-count {
  font-size: 13px;
  color: #86868b;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e5e7;
}

/* Detector Options */
.detector-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.option-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.option-label {
  font-size: 14px;
  color: #1d1d1f;
  font-weight: 500;
  display: flex;
  align-items: center;
}

.option-select {
  padding: 8px 32px 8px 12px;
  border: 1px solid #d2d2d7;
  border-radius: 8px;
  font-size: 14px;
  color: #1d1d1f;
  background: #ffffff;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%231d1d1f' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  min-width: 120px;
  touch-action: manipulation;
}

.option-select:focus {
  border-color: #1d1d1f;
}

.option-input {
  padding: 8px 12px;
  border: 1px solid #d2d2d7;
  border-radius: 8px;
  font-size: 14px;
  color: #1d1d1f;
  background: #ffffff;
  outline: none;
  width: 100px;
  touch-action: manipulation;
}

.option-input:focus {
  border-color: #1d1d1f;
}

/* Buttons */
.btn-primary {
  padding: 12px 32px;
  background: #1d1d1f;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.btn-primary:hover {
  background: #424245;
}

.btn-primary:active {
  transform: scale(0.98);
}

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

.btn-secondary {
  padding: 12px 24px;
  background: #ffffff;
  color: #1d1d1f;
  border: 1px solid #d2d2d7;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.btn-secondary:hover {
  background: #f5f5f7;
  border-color: #1d1d1f;
}

.btn-secondary:active {
  transform: scale(0.98);
}

/* Model Info */
.model-info {
  font-size: 12px;
  color: #86868b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 24px;
}

/* Humanizer Options */
.humanizer-options {
  margin-bottom: 24px;
}

.option-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.option-row .option-group {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.option-row .option-select,
.option-row .option-input {
  width: 100%;
}

/* Advanced Options */
.advanced-options {
  background: #ffffff;
  border: 1px solid #d2d2d7;
  border-radius: 8px;
  padding: 16px;
  margin-top: 16px;
}

.advanced-options summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #1d1d1f;
  cursor: pointer;
  list-style: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  padding: 4px 0;
}

.advanced-options summary::-webkit-details-marker {
  display: none;
}

.advanced-options summary svg {
  transition: transform 0.2s ease;
}

.advanced-options[open] summary svg {
  transform: rotate(180deg);
}

.advanced-content {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e5e7;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #1d1d1f;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  padding: 4px 0;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  touch-action: manipulation;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

/* Usage Info */
.usage-info {
  font-size: 13px;
  color: #86868b;
  line-height: 1.8;
}

/* Result Card */
.result-card {
  background: #ffffff;
  border: 1px solid #d2d2d7;
  border-radius: 12px;
  padding: 24px;
  margin-top: 24px;
}

.result-card h3 {
  font-size: 18px;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 16px;
}

.result-card h4 {
  font-size: 16px;
  font-weight: 600;
  color: #1d1d1f;
  margin: 20px 0 12px;
}

.result-card details {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e5e5e7;
}

.result-card summary {
  font-size: 14px;
  font-weight: 500;
  color: #1d1d1f;
  cursor: pointer;
  list-style: none;
  padding: 8px 0;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.result-card summary::-webkit-details-marker {
  display: none;
}

.result-card pre {
  background: #f5f5f7;
  padding: 16px;
  border-radius: 8px;
  font-size: 13px;
  overflow-x: auto;
  margin-top: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Detection Result Styles */
.detection-title {
  font-size: 24px;
  font-weight: 600;
  color: #1d1d1f;
  text-align: center;
  margin-bottom: 20px;
}

.detection-message {
  text-align: center;
  color: #86868b;
  font-size: 15px;
  margin-bottom: 32px;
  padding: 16px;
  background: #f5f5f7;
  border-radius: 8px;
}

.detection-chart-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  margin-bottom: 32px;
  padding: 24px;
}

.pie-chart {
  position: relative;
}

.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.legend-item-detection {
  display: flex;
  align-items: center;
  gap: 12px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.human-dot {
  background: #28a745;
}

.ai-dot {
  background: #dc3545;
}

.legend-label {
  font-size: 13px;
  color: #86868b;
}

.legend-value {
  font-size: 20px;
  font-weight: 600;
  color: #1d1d1f;
}

.highlight-toggle {
  display: flex;
  justify-content: flex-start;
  padding: 16px 0;
  border-top: 1px solid #e5e5e7;
  border-bottom: 1px solid #e5e5e7;
  margin-bottom: 24px;
}

.detected-text-container {
  background: #ffffff;
  padding: 24px;
  border-radius: 8px;
  border: 1px solid #e5e5e7;
  margin-bottom: 24px;
  line-height: 1.8;
  font-size: 15px;
}

#detected-text-display {
  white-space: pre-wrap;
  word-break: break-word;
}

#detected-text-display span {
  padding: 2px 4px;
  border-radius: 3px;
}

.detection-legend {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 24px;
  padding: 16px;
  background: #f5f5f7;
  border-radius: 8px;
}

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

.legend-color-box {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid #e5e5e7;
}

.ai-bg {
  background: #f8d7da;
}

.human-bg {
  background: #d4edda;
}

/* Detection Summary */
.detection-summary {
  padding: 16px;
  background: #f5f5f7;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 15px;
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 8px;
}

.badge-green {
  background: #d4edda;
  color: #1b5e20;
}

.badge-red {
  background: #f8d7da;
  color: #8a1c1c;
}

/* Sentence Analysis */
#sentence-analysis {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sentence-block {
  padding: 12px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e5e5e7;
  transition: all 0.2s ease;
}

.sentence-block:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.ai-sentence {
  border-left: 4px solid #dc3545;
}

.human-sentence {
  border-left: 4px solid #28a745;
}

/* Humanized Text */
.humanized-text {
  padding: 16px;
  background: #ffffff;
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
}

.humanized-text span {
  padding: 2px 4px;
  border-radius: 3px;
}

/* Alternatives */
#alts {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.alt-card {
  border: 1px solid #e5e5e7;
  padding: 16px;
  border-radius: 8px;
  background: #ffffff;
}

.alt-original {
  font-weight: 600;
  margin-bottom: 12px;
  color: #1d1d1f;
}

.alt-item {
  padding: 10px 12px;
  border-radius: 6px;
  margin: 8px 0;
  font-size: 14px;
}

.alt-human {
  background: #d4edda;
  color: #1b5e20;
}

.alt-ai {
  background: #f8d7da;
  color: #8a1c1c;
}

/* View Options Header */
.view-options-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: #f5f5f7;
  border: 1px solid #e5e5e7;
  border-radius: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.view-options-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.view-options-title {
  font-size: 14px;
  font-weight: 500;
  color: #86868b;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #1d1d1f;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  padding: 4px 0;
}

.toggle-input {
  width: 40px;
  height: 20px;
  appearance: none;
  background: #d2d2d7;
  border-radius: 20px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s ease;
  flex-shrink: 0;
  touch-action: manipulation;
}

.toggle-input:checked {
  background: #1d1d1f;
}

.toggle-input::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  top: 2px;
  left: 2px;
  transition: transform 0.3s ease;
}

.toggle-input:checked::before {
  transform: translateX(20px);
}

.view-options-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.draft-nav-btn {
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid #d2d2d7;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.draft-nav-btn:hover:not(:disabled) {
  background: #f5f5f7;
  border-color: #1d1d1f;
}

.draft-nav-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.draft-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.draft-counter {
  font-size: 14px;
  font-weight: 500;
  color: #1d1d1f;
  min-width: 60px;
  text-align: center;
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #ffffff;
  border: 1px solid #d2d2d7;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.copy-btn:hover {
  background: #f5f5f7;
  border-color: #1d1d1f;
}

.copy-btn:active {
  transform: scale(0.97);
}

.copy-btn svg {
  flex-shrink: 0;
}

/* Original Text Display */
.original-text-display {
  background: #f5f5f7;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 24px;
}

.original-text-display h4 {
  font-size: 14px;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 12px;
}

#original-text-content {
  font-size: 15px;
  line-height: 1.8;
  color: #1d1d1f;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Humanized Display */
.humanized-display {
  margin-bottom: 20px;
}

.humanized-label {
  font-size: 14px;
  font-weight: 500;
  color: #86868b;
  margin-bottom: 12px;
}

/* Highlighted Text Styles */
.highlight-ai {
  background-color: #f8d7da;
  padding: 2px 0;
}

.highlight-human {
  background-color: #d4edda;
  padding: 2px 0;
}

/* Result Stats */
.result-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid #e5e5e7;
  border-bottom: 1px solid #e5e5e7;
  margin-bottom: 20px;
  font-size: 13px;
  color: #86868b;
}

.color-legend {
  display: flex;
  gap: 16px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #1d1d1f;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 3px;
}

.ai-color {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
}

.human-color {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
}

/* Meta */
.meta {
  font-size: 14px;
  color: #86868b;
  margin-bottom: 16px;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .content-wrapper {
    padding: 24px 32px;
  }

  .page-header {
    padding: 24px 32px 20px;
  }
}

@media (max-width: 768px) {
  /* Show mobile menu toggle */
  .mobile-menu-toggle {
    display: block;
  }

  /* Hide sidebar by default on mobile */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    z-index: 999;
    transform: translateX(-100%);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .mobile-overlay.active {
    display: block;
  }

  /* Adjust main content for mobile menu */
  .main-content {
    margin-left: 0;
    width: 100%;
  }

  .content-wrapper {
    padding: 80px 20px 24px;
  }

  .page-header {
    padding: 80px 20px 20px;
  }

  .page-title {
    font-size: 24px;
  }

  /* Tabs */
  .tabs {
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    padding: 10px 18px;
    font-size: 13px;
  }

  /* Options */
  .option-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .option-select {
    min-width: 100%;
  }

  /* Buttons */
  .action-buttons {
    flex-direction: column;
    gap: 10px;
  }

  .action-buttons .btn-secondary,
  .action-buttons .btn-primary {
    width: 100%;
  }

  .detector-options {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .detector-options .btn-primary {
    width: 100%;
  }

  /* View Options */
  .view-options-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px;
  }

  .view-options-left {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 12px;
  }

  .view-options-right {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }

  .draft-counter {
    order: -1;
    width: 100%;
    text-align: left;
    margin-bottom: 8px;
  }

  /* Result Stats */
  .result-stats {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  /* Detection Chart */
  .detection-chart-container {
    flex-direction: column;
    gap: 24px;
    padding: 16px;
  }

  .pie-chart svg {
    width: 140px;
    height: 140px;
  }

  .detection-legend {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  /* Input Section */
  .input-section textarea {
    font-size: 16px;
    min-height: 180px;
  }

  /* Result Card */
  .result-card {
    padding: 16px;
  }

  /* Increase touch targets */
  .nav-item {
    padding: 12px 14px;
    font-size: 15px;
  }

  .btn-primary,
  .btn-secondary {
    padding: 14px 32px;
    font-size: 16px;
    min-height: 48px;
  }

  .copy-btn {
    padding: 10px 18px;
  }
}

@media (max-width: 480px) {
  .content-wrapper {
    padding: 70px 16px 20px;
  }

  .page-header {
    padding: 70px 16px 16px;
  }

  .page-title {
    font-size: 20px;
  }

  /* Sidebar adjustments for very small screens */
  .sidebar {
    width: 100%;
    max-width: 100vw;
  }

  .logo h1 {
    font-size: 16px;
  }

  .version {
    font-size: 10px;
  }

  /* Input section */
  .input-section {
    padding: 16px;
  }

  .input-section textarea {
    min-height: 150px;
    font-size: 16px;
  }

  /* Tabs - single column stack on very small screens */
  .tabs {
    flex-direction: column;
    width: 100%;
  }

  .tab-btn {
    width: 100%;
    padding: 12px 18px;
    font-size: 14px;
    border-radius: 8px;
  }

  /* Options */
  .option-group {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 8px;
  }

  .option-select,
  .option-input {
    width: 100%;
  }

  /* View options - stack everything */
  .view-options-right {
    flex-direction: column;
  }

  .draft-nav-btn {
    flex: 1;
  }

  .copy-btn {
    width: 100%;
    justify-content: center;
  }

  /* Detection chart - smaller on tiny screens */
  .pie-chart svg {
    width: 120px;
    height: 120px;
  }

  .legend-value {
    font-size: 18px;
  }

  /* Result card */
  .result-card {
    padding: 12px;
  }

  .result-card h3 {
    font-size: 16px;
  }

  .result-card h4 {
    font-size: 14px;
  }

  /* Detection title */
  .detection-title {
    font-size: 20px;
  }

  .detection-message {
    font-size: 14px;
    padding: 12px;
  }

  /* Humanized text */
  .humanized-text,
  .detected-text-container {
    font-size: 14px;
    padding: 16px;
  }

  /* Advanced options */
  .advanced-options {
    padding: 12px;
  }

  /* Sentence blocks */
  .sentence-block {
    padding: 10px;
    font-size: 14px;
  }

  /* Alternative cards */
  .alt-card {
    padding: 12px;
  }

  .alt-item {
    font-size: 13px;
    padding: 8px 10px;
  }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .content-wrapper {
    padding: 70px 20px 20px;
  }

  .page-header {
    padding: 70px 20px 16px;
  }

  .detection-chart-container {
    flex-direction: row;
    gap: 32px;
  }
}

/* Large screens */
@media (min-width: 1400px) {
  .content-wrapper {
    max-width: 1400px;
    padding: 40px 64px;
  }

  .page-header {
    padding: 40px 64px 28px;
  }
}
