:root {
  color-scheme: light;
  --navy: #17324d;
  --ink: #1f2d3d;
  --muted: #657383;
  --border: #d8e0e7;
  --surface: #ffffff;
  --soft: #f4f7fa;
  --blue: #2368a2;
  --blue-dark: #194e7a;
  --green: #176b53;
  --warning: #8a5a00;
  font-family: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: #edf2f6;
}

button, select, textarea { font: inherit; }
button { cursor: pointer; }

.communicator-shell {
  width: min(100% - 32px, 760px);
  margin: 0 auto;
  padding: 32px 0 48px;
}

.page-header { margin-bottom: 20px; }
.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; color: var(--navy); font-size: clamp(2rem, 7vw, 3.1rem); line-height: 1.05; }
h2 { color: var(--navy); font-size: 1.18rem; }
.intro { margin-bottom: 0; color: var(--muted); font-size: 1.08rem; }

.communicator-card, .saved-phrases, .privacy-note {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(28, 47, 65, .07);
}
.communicator-card { padding: clamp(18px, 4vw, 30px); }

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.settings-row label { color: var(--muted); font-size: .95rem; font-weight: 700; }
select {
  max-width: 60%;
  padding: 11px 36px 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--ink);
  background: var(--soft);
}

textarea {
  display: block;
  width: 100%;
  min-height: 180px;
  resize: vertical;
  padding: 20px;
  border: 2px solid var(--border);
  border-radius: 14px;
  color: var(--ink);
  background: #fff;
  font-size: clamp(1.35rem, 4vw, 1.8rem);
  line-height: 1.7;
}
textarea:focus, select:focus, button:focus-visible {
  outline: 4px solid rgba(35, 104, 162, .2);
  outline-offset: 2px;
}
textarea:focus { border-color: var(--blue); }
textarea::placeholder { color: #9aa7b3; }
.input-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 38px;
  color: var(--muted);
  font-size: .82rem;
}
.text-button, .secondary-button {
  border: 0;
  color: var(--blue-dark);
  background: transparent;
  font-weight: 700;
}
.text-button { padding: 8px 0; }
.text-button:hover, .secondary-button:hover { text-decoration: underline; }

.action-grid { display: grid; gap: 10px; }
.action-button {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 16px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--blue);
  font-size: 1.08rem;
  font-weight: 700;
}
.action-button:hover { background: var(--blue-dark); }
.action-button:disabled { cursor: wait; opacity: .55; }
.arabic-action { background: var(--green); }
.arabic-action:hover { background: #10523f; }
.english-action { background: var(--navy); }
.english-action:hover { background: #0e2538; }
.action-icon { font-size: 1.35rem; }

.status { min-height: 24px; margin-top: 16px; color: var(--muted); font-size: .95rem; }
.status.error { color: #a32f2f; font-weight: 700; }
.status.success { color: var(--green); }

.translation-panel {
  margin-top: 8px;
  padding: 18px;
  border: 1px solid #c9d9e7;
  border-radius: 14px;
  background: #f5f9fc;
}
.panel-heading, .section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.panel-heading h2 { margin-bottom: 10px; }
.translation-panel p {
  margin-bottom: 14px;
  font-size: clamp(1.3rem, 4vw, 1.7rem);
  line-height: 1.5;
}
.secondary-button { padding: 0; }
.review-badge {
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--warning);
  background: #fff1c9;
  font-size: .75rem;
  font-weight: 700;
}

.privacy-note {
  margin-top: 16px;
  padding: 14px 16px;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.5;
  box-shadow: none;
}
.privacy-note strong { color: var(--ink); }

.saved-phrases { margin-top: 16px; padding: 20px; box-shadow: none; }
.section-heading { align-items: start; margin-bottom: 16px; }
.section-heading h2 { margin-bottom: 0; }
.section-heading > p { max-width: 260px; margin-bottom: 0; color: var(--muted); font-size: .88rem; text-align: right; }
.phrase-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.phrase-grid button {
  min-height: 52px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--ink);
  background: var(--soft);
  font-size: .95rem;
  font-weight: 700;
}
.phrase-grid button:hover { border-color: var(--blue); background: #eaf3fa; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 560px) {
  .communicator-shell { width: min(100% - 20px, 760px); padding-top: 20px; }
  .settings-row { align-items: flex-start; flex-direction: column; }
  select { width: 100%; max-width: none; }
  .phrase-grid { grid-template-columns: 1fr; }
  .section-heading { flex-direction: column; }
  .section-heading > p { max-width: none; text-align: left; }
}
