:root {
  --bg: #f5f7fa;
  --text: #2c3e50;
  --accent: #3498db;
  --success: #27ae60;
  --warning: #e67e22;
  --danger: #e74c3c;
  --changed: #fff3cd;
  --border: #ddd;
}

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

body {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding-top: 80px;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #fff;
  z-index: 999;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .1);
  padding: 10px 30px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
}

.header-top h1 {
  margin-right: auto;
  font-size: 22px;
}

#statusMessage {
  flex: 1;
  text-align: center;
  font-weight: 500;
  color: #5d6d7e;
}

.header-top.has-changes #statusMessage {
  color: var(--warning);
  font-weight: bold;
}

.header-top.success #statusMessage {
  color: var(--success);
}

.header-top.error #statusMessage {
  color: var(--danger);
}

button {
  background: var(--success);
  color: #fff;
  border: none;
  padding: 8px 18px;
  font: bold 14px/1 'Segoe UI';
  border-radius: 6px;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}

button:disabled {
  background: #95a5a6;
  cursor: not-allowed;
}

button:hover:not(:disabled) {
  background: #219653;
  transform: translateY(-1px);
}

/* Table */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1px 30px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .1);
}

th,
td {
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  position: sticky;
  z-index: 100;
  font-size: 14px;
  padding: 12px;
}

.key {
  background: #ecf0f1;
  font-weight: bold;
  width: 250px;
  font-size: 13px;
  padding: 12px;
  vertical-align: middle;
}

.text-cell {
  padding: 10px;
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  background: transparent;
  outline: none;
  border: none;
  display: block;
}

.text-cell:focus {
  outline: 2px solid var(--accent);
  border-radius: 4px;
  background: #fff;
}

.text-cell.changed {
  background: var(--changed) !important;
}

/* Loading Overlay */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.loading-overlay.active {
  display: flex;
}

.loading-content {
  background: #fff;
  padding: 30px 40px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  min-width: 200px;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--accent);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#loadingText {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}

footer {
  text-align: center;
  color: #7f8c8d;
  font-size: 14px;
  padding: 20px 0;
}