* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f4f6f8;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.window {
  width: min(1100px, 100%);
  background: white;
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(0,0,0,0.12);
  overflow: hidden;
  border: 1px solid #dfe5eb;
}

.titlebar {
  padding: 14px 18px;
  background: #eef2f6;
  border-bottom: 1px solid #d9e0e7;
  font-weight: 700;
  color: #22303c;
}

.content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 560px;
}

.panel {
  padding: 24px;
}

.left-panel {
  border-right: 1px solid #e3e8ee;
  background: #fbfcfd;
}

.right-panel {
  display: grid;
  grid-template-rows: auto auto;
  gap: 18px;
}

.section-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #667788;
  margin-bottom: 10px;
  font-weight: 700;
}

.card {
  background: white;
  border: 1px solid #dce3ea;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.04);
}

.rx-line {
  margin-bottom: 12px;
  color: #1f2a35;
  line-height: 1.5;
}

.rx-line strong {
  display: inline-block;
  min-width: 98px;
  color: #44515d;
}

textarea {
  width: 100%;
  height: 180px;
  resize: none;
  border: 1px solid #cbd5df;
  border-radius: 12px;
  padding: 14px;
  font-size: 16px;
  line-height: 1.5;
  outline: none;
}

textarea:focus {
  border-color: #4b88ff;
  box-shadow: 0 0 0 4px rgba(75,136,255,0.12);
}

.translation-box {
  text-transform: uppercase;
  min-height: 180px;
  border: 1px solid #d6dee7;
  border-radius: 12px;
  padding: 14px;
  background: #fafcff;
  color: #21303b;
  line-height: 1.6;
  font-size: 16px;
  white-space: pre-wrap;
}

.muted {
  color: #7b8794;
}

.toolbar {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

button {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  background: #1f6feb;
  color: white;
  font-weight: 700;
}

#checkBtn,
#clearBtn {
  background: #e9eef5;
  color: #22303c;
}

.status {
  margin-top: 12px;
  font-size: 14px;
  min-height: 20px;
  color: #2a5f2d;
  font-weight: 700;
}

.hint {
  margin-top: 12px;
  font-size: 13px;
  color: #687684;
}

/* Lock screen */
#lockScreen {
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 40, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  backdrop-filter: blur(4px);
}

.lock-box {
  background: white;
  border-radius: 18px;
  padding: 36px 40px;
  width: min(420px, 90vw);
  box-shadow: 0 24px 60px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lock-title {
  font-size: 20px;
  font-weight: 700;
  color: #22303c;
}

.lock-sub {
  margin: 0;
  font-size: 14px;
  color: #667788;
}

.lock-box input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #cbd5df;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
}

.lock-box input[type="password"]:focus {
  border-color: #4b88ff;
  box-shadow: 0 0 0 3px rgba(75,136,255,0.12);
}

.lock-box button {
  width: 100%;
  padding: 11px;
  font-size: 15px;
  border-radius: 10px;
}

.lock-error {
  font-size: 13px;
  color: #b42318;
  min-height: 18px;
}

/* API key bar */
.api-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: #f4f7fb;
  border-bottom: 1px solid #dfe5eb;
  flex-wrap: wrap;
}

.api-label {
  font-size: 13px;
  color: #44515d;
  font-weight: 600;
  white-space: nowrap;
}

.api-bar input[type="password"] {
  flex: 1;
  min-width: 200px;
  padding: 6px 10px;
  border: 1px solid #cbd5df;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
}

.api-bar input[type="password"]:focus {
  border-color: #4b88ff;
  box-shadow: 0 0 0 3px rgba(75,136,255,0.12);
}

#saveKeyBtn {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 8px;
  font-weight: 600;
}

.key-status {
  font-size: 12px;
  color: #1a7f37;
  font-weight: 600;
}

/* Verdict colors */
.verdict-correct   { color: #1a7f37; }
.verdict-acceptable { color: #0969da; }
.verdict-ambiguous { color: #9a6700; }
.verdict-incorrect { color: #b42318; }

/* Loading shimmer on prescription card */
.loading-card {
  opacity: 0.5;
  font-style: italic;
  color: #667788;
}

#checkBtn.checking {
  opacity: 0.6;
  cursor: wait;
}

#giveUpBtn {
  background: #e9eef5;
  color: #22303c;
}

.attempts {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #9a6700;
  min-height: 18px;
}

.sample-sig {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #0969da;
}

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

  .left-panel {
    border-right: none;
    border-bottom: 1px solid #e3e8ee;
  }
}