:root {
  --bg:#ffffff;
  --app-max:1100px;
  --primary:#1a73e8;
  --primary-hover:#1558b8;
  --border:#dadce0;
  --soft:#f1f3f4;
  --radius:12px;
}

* { box-sizing:border-box; }

body {
  margin:0;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background: var(--bg);
  color:#202124;
  -webkit-font-smoothing: antialiased;
}

header {
  padding:14px clamp(12px,3vw,40px);
  border-bottom:1px solid var(--border);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  flex-wrap:wrap;
}

header h1 {
  font-size:18px;
  margin:0;
  font-weight:600;
  letter-spacing:.5px;
}

/* Language selection and controls */
.lang-bar {
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

select {
  appearance:none;
  min-width:120px;
  padding:10px 36px 10px 14px;
  font-size:14px;
  line-height:1.2;
  border:1px solid var(--border);
  border-radius:8px;
  background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'%3E%3C/path%3E%3C/svg%3E") no-repeat right 8px center;
  cursor:pointer;
  position:relative;
}

select:focus {
  outline:none;
  border-color: var(--primary);
  box-shadow:0 0 0 3px rgba(26,115,232,.25);
}

/* Buttons */
button.icon-btn {
  width:40px;
  height:40px;
  border:1px solid var(--border);
  background:#fff;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
  cursor:pointer;
  color:#1f1f1f;
  transition:.2s;
}

button.icon-btn:hover { background: var(--soft); }

button.primary {
  background: var(--primary);
  color:#fff;
  border:none;
  padding:12px 34px;
  font-size:14px;
  font-weight:500;
  border-radius:24px;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:6px;
  letter-spacing:.25px;
  transition:.25s;
}

button.primary:hover:not(:disabled){ background: var(--primary-hover); }
button.primary:disabled { opacity:.55; cursor:not-allowed; }

button.soft {
  background:#fff;
  color:#444;
  border:1px solid var(--border);
  padding:12px 22px;
  font-size:14px;
  border-radius:24px;
  cursor:pointer;
  transition:.2s;
}

button.soft:hover { background: var(--soft); }

/* Layout */
.panes-wrapper {
  max-width: var(--app-max);
  margin:24px auto 0;
  padding:0 clamp(12px,3vw,40px);
}

.panes {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}

@media (max-width:900px){
  .panes { grid-template-columns:1fr; }
}

/* Translation panes */
.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background-color: var(--soft);
  border-radius: var(--radius) var(--radius) 0 0;
}

.pane-header.output {
  background-color: #edf3fd;
}

.pane-title {
  font-size: 14px;
  font-weight: 500;
  color: #5f6368;
}

.pane {
  border:1px solid var(--border);
  border-radius: var(--radius);
  background:#fff;
  min-height:240px;
  position:relative;
  display:flex;
  flex-direction:column;
}

.pane.output { background: var(--soft); }

textarea {
  flex:1;
  width:100%;
  border:none;
  outline:none;
  resize:none;
  padding:14px;
  background:transparent;
  font:400 16px/1.4 "Segoe UI", Arial, sans-serif;
  color:#202124;
  min-height: 180px;
}

textarea::placeholder { color:#6e6e73; }

.pane .bottom-strip {
  padding:8px 12px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  border-top: 1px solid var(--border);
}

.pane .bottom-strip button {
  background:transparent;
  border:none;
  font-size:13px;
  padding:6px 10px;
  border-radius:6px;
  cursor:pointer;
  color:#444;
  transition:.2s;
}

.pane .bottom-strip button:hover {
  background:rgba(60,64,67,.08);
}

/* Status and utility classes */
.kwl-representation {
  font-size: 12px;
  color: #0b57d0;
  font-weight: 500;
  padding-left: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
}

.kwl-representation:empty {
  display: none;
}

.actions-row {
  display:flex;
  align-items: center;
  gap:12px;
  flex-wrap:wrap;
  margin:18px auto 4px;
  justify-content:center;
  max-width: var(--app-max);
  padding:0 clamp(12px,3vw,40px);
}

.auto-translate-badge {
  font-size: 12px;
  color: #5f6368;
  background: var(--soft);
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
}

.auto-translate-badge.active {
  background: #e8f0fe;
  color: var(--primary);
  font-weight: 500;
}

#status {
  text-align:center;
  font-size:13px;
  color:#5f6368;
  min-height:18px;
  margin:10px 0 20px;
}

#status.error { color:#b3261e; }

.note {
  font-size:11px;
  color:#6d6f73;
  text-align:center;
  margin-top:4px;
  letter-spacing:.3px;
}

.feedback-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: var(--primary);
  color: white;
  border: none;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 500;
}