html,
body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  min-height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #2d3748;
}

.content-wrapper {
  width: 100%;
  min-height: 100%;
  padding: 16px;
  box-sizing: border-box;
  max-width: 768px;
  margin: 0 auto;
}

.header-section {
  margin-bottom: 24px;
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.1),
    0 2px 4px rgba(0, 0, 0, 0.06);
}

.controls {
  margin: 20px 0 0 0;
  display: flex;
  gap: 12px;
}

.controls button {
  flex: 1;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.4);
  min-height: 48px;
}

.controls button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.5);
}

.controls button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  background: linear-gradient(135deg, #a0aec0 0%, #718096 100%);
  box-shadow: none;
}

.controls button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(102, 126, 234, 0.3);
}

.result-display {
  margin-top: 16px;
  padding: 16px;
  font-size: 18px;
  font-weight: 700;
  color: #2d3748;
  min-height: 30px;
  background: linear-gradient(135deg, #f6f8fb 0%, #e9ecf1 100%);
  border-radius: 12px;
  text-align: center;
  border: 2px solid #e2e8f0;
}

.result-display:not(:empty) {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.tables-section {
  width: 100%;
}

h1 {
  color: #2d3748;
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 16px 0;
  text-align: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  color: white;
  font-size: 20px;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 8px;
  padding: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px 12px 0 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

p {
  color: #4a5568;
  margin: 0;
  padding: 12px 16px 16px 16px;
  font-size: 14px;
  line-height: 1.5;
  background: white;
  border-radius: 0 0 12px 12px;
  margin-bottom: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#touchEventsTable {
  width: 100%;
  height: 200px;
  border-collapse: collapse;
  margin-top: 0;
  margin-bottom: 24px;
  overflow-y: auto;
  overflow-x: hidden;
  display: block;
  box-sizing: border-box;
  background: white;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#touchEventsTable thead {
  display: table;
  width: 100%;
  table-layout: fixed;
  box-sizing: border-box;
}

#touchEventsTable tbody {
  display: block;
  max-height: 150px;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  box-sizing: border-box;
}

#touchEventsTable thead tr,
#touchEventsTable tbody tr {
  display: table;
  width: 100%;
  table-layout: fixed;
  box-sizing: border-box;
}

#touchEventsTable th,
#touchEventsTable td {
  padding: 10px 8px;
  text-align: left;
  border: none;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
}

#touchEventsTable th {
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
  color: #4a5568;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

#touchEventsTable tbody tr {
  transition: background-color 0.2s ease;
}

#touchEventsTable tbody tr:nth-child(even) {
  background-color: #f7fafc;
}

#touchEventsTable tbody tr:hover {
  background-color: #edf2f7;
}

#deviceEventsTable {
  width: 100%;
  height: 200px;
  border-collapse: collapse;
  margin-top: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: block;
  box-sizing: border-box;
  background: white;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 24px;
}

#deviceEventsTable thead {
  display: table;
  width: 100%;
  table-layout: fixed;
  box-sizing: border-box;
}

#deviceEventsTable tbody {
  display: block;
  max-height: 150px;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  box-sizing: border-box;
}

#deviceEventsTable thead tr,
#deviceEventsTable tbody tr {
  display: table;
  width: 100%;
  table-layout: fixed;
  box-sizing: border-box;
}

#deviceEventsTable th,
#deviceEventsTable td {
  padding: 10px 8px;
  text-align: left;
  border: none;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
}

#deviceEventsTable th {
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
  color: #4a5568;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

#deviceEventsTable tbody tr {
  transition: background-color 0.2s ease;
}

#deviceEventsTable tbody tr:nth-child(even) {
  background-color: #f7fafc;
}

#deviceEventsTable tbody tr:hover {
  background-color: #edf2f7;
}

#deviceEventsTable td:nth-child(3) {
  font-family: "SF Mono", "Monaco", "Consolas", monospace;
  font-size: 11px;
  word-break: break-all;
  color: #5a67d8;
}
