body {
  font-family: Arial;
  background: #f5f5f5;
  margin: 0;
}

header {
  background: #2c3e50;
  color: white;
  padding: 15px;
  text-align: center;
  font-size: 24px;
}

h3 {
  margin-bottom: 2rem;
}

.nav {
  display: flex;
  gap: 10px;
  padding: 15px;
  justify-content: center;
  background: #ecf0f1;
}

.nav button {
  width: auto;
  padding: 10px 20px;
}

.container {
  padding: 20px;
  max-width: 900px;
  margin: auto;
}

.form-box {
  background: white;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.file-label {
  font-weight: bold;
  display: block;
  margin-top: 10px;
}

.file-input {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: white;
  cursor: pointer;
}

.text-input {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: white;
}

.file-input:hover {
  border-color: #3498db;
}

.file-name {
  font-size: 13px;
  color: #555;
  margin-top: 5px;
}

.styled-select {
  appearance: none; /* remove default arrow */
  -webkit-appearance: none;
  -moz-appearance: none;
  background: white url('data:image/svg+xml;utf8,<svg fill="gray" height="12" viewBox="0 0 24 24" width="12" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>') no-repeat right 10px center;
  background-size: 12px;
  cursor: pointer;
  padding: 8px 30px 8px 8px; /* space for arrow */
}

.styled-select:focus {
  border-color: #3498db;
  outline: none;
}

.styled-select option {
  padding: 8px;
}

input,
button {
  padding: 10px;
  margin-top: 10px;
  width: 100%;
}

button {
  background: #3498db;
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 6px;
}

button:hover {
  background: #2980b9;
}

.card {
  background: white;
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 10px;
  background: #ecf0f1;
  border-radius: 6px;
  margin-bottom: 8px;
  font-weight: bold;
}

.card-details {
  padding-top: 10px;
  transition: all 0.3s ease;
}

.card.collapsed .card-details.hidden {
  display: none;
}

.box {
  background: #f9f9f9;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 15px;
  border-left: 4px solid #3498db;
}

.feedback-box {
  background: #f9f9f9;
  padding: 16px;
  border-radius: 6px;
  margin-bottom: 15px;
  border-left: 6px solid #3498db;
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

/* Container for the buttons */
.actions {
  display: flex;
  justify-content: flex-end; /* Aligns them to the right */
  align-items: center;      /* Vertically centers them to each other */
  gap: 12px;               /* Space between them */
  margin-bottom: 15px;
}

/* Base style for both buttons to ensure they match */
.copy-btn, 
.pdf-btn {
  /* Reset global button styles */
  width: auto !important;   
  margin-top: 0 !important; 
  
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;            /* Fixed height for perfect alignment */
  padding: 0 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

/* Specific Style: Copy Button */
.copy-btn {
  background: #ffffff;
  border: 1px solid #dcdfe6;
  color: #606266;
}

.copy-btn:hover {
  background: #f5f7fa;
  border-color: #3498db;
  color: #3498db;
}

/* Specific Style: PDF Button */
.pdf-btn {
  background: #e74c3c; /* PDF Red */
  color: white;
}

.pdf-btn:hover {
  background: #c0392b;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Success state for Copy */
.copy-btn.success {
  background: #27ae60;
  color: white;
  border-color: #27ae60;
}

.type-badge {
  background: #3498db;
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.title {
  font-weight: bold;
  margin-bottom: 6px;
}

.scrollable {
  flex-grow: 1;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-size: 0.95rem;
  line-height: 1.5;
  padding-right: 5px;
}

.scrollable::-webkit-scrollbar {
  width: 6px;
}
.scrollable::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 10px;
}

.box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.collapsible {
  cursor: pointer;
}

.preview::after {
  content: " ... (click to expand)";
  color: #3498db;
  font-size: 12px;
}
.preview {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #555;
}

.full {
  white-space: pre-wrap;
}

.hidden {
  display: none;
}

.toggle-btn {
  margin-top: 8px;
  background: none;
  border: none;
  color: black;
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  padding: 0;
}

.toggle-btn:hover {
  text-decoration: underline;
}

.audio-container {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.audio-container audio {
  flex: 1;
  max-width: 80%;
  outline: none;
}

.download-btn.small-btn {
  padding: 6px 10px;
  font-size: 12px;
}

.download-btn {
  display: inline-block;
  padding: 8px 12px;
  background: #27ae60;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-size: 14px;
}

.download-btn:hover {
  background: #1e8449;
}

.loading {
  color: orange;
}
footer {
  text-align: center;
  padding: 15px;
  font-size: 13px;
  color: #777;
}

.delete-btn {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 10px;
  width: 100%;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 10px;
}

.delete-btn:hover {
  background: #c0392b;
}


.stage-card {
  background: var(--color-background-primary, #fff);
  border: 0.5px solid var(--color-border-tertiary, #e0e0e0);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.stage-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary, #888);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 4px;
}
.stage-title {
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 4px;
}
.stage-hint {
  font-size: 14px;
  color: var(--color-text-secondary, #888);
  margin: 0 0 14px;
}
.plain-editor {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  border: 0.5px solid var(--color-border-tertiary, #e0e0e0);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.7;
  font-family: monospace;
  background: var(--color-background-primary, #fff);
  color: var(--color-text-primary, #111);
}
.plain-editor:focus { outline: none; border-color: #aaa; }

/* Feedback rich editor */
.editor-toolbar {
  display: flex;
  gap: 4px;
  padding: 6px 8px;
  background: var(--color-background-secondary, #f5f5f5);
  border: 0.5px solid var(--color-border-tertiary, #e0e0e0);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
}
.toolbar-btn {
  background: transparent;
  border: 0.5px solid transparent;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 13px;
  color: var(--color-text-secondary, #888);
  cursor: pointer;
}
.toolbar-btn:hover {
  background: var(--color-background-primary, #fff);
  border-color: var(--color-border-secondary, #ccc);
  color: var(--color-text-primary, #111);
}
.toolbar-sep {
  width: 0.5px;
  background: var(--color-border-tertiary, #e0e0e0);
  margin: 4px 2px;
}
.rich-editor {
  min-height: 280px;
  max-height: 480px;
  overflow-y: auto;
  border: 0.5px solid var(--color-border-tertiary, #e0e0e0);
  border-radius: 0 0 8px 8px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-text-primary, #111);
  background: var(--color-background-primary, #fff);
  outline: none;
}
.rich-editor:focus { border-color: #aaa; }

.stage-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.save-status {
  font-size: 13px;
  color: green;
  margin-right: auto;
}
.btn-secondary {
  background: transparent;
  border: 0.5px solid #ccc;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
}
.btn-primary {
  background: #111;
  border: none;
  border-radius: 8px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
}
.btn-primary:hover {
  opacity: 0.85;
}

.lab-checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 14px 0;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background-color: #f9f9f9;
  cursor: pointer;
}

.lab-checkbox-wrapper input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #3498db;
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;          /* ✅ remove any default browser margin */
  vertical-align: middle; /* ✅ fix browser default misalignment */
}

.lab-checkbox-wrapper label {
  font-size: 14px;
  color: #2c3e50;
  cursor: pointer;
  margin: 0;          /* ✅ ensure no top/bottom margin pushing it off */
  line-height: 1;     /* ✅ collapse extra line height */
}

/* ─── Help Section ─────────────────────────────────────────────────────────── */

.help-section {
  margin-bottom: 20px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #dce3ea;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.help-toggle {
  width: 100%;
  background: #f0f4f8;
  border: none;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #2c3e50;
  margin: 0;
  border-radius: 0;
  text-align: left;
  transition: background 0.2s;
}

.help-toggle:hover {
  background: #e3eaf1;
}

.help-arrow {
  font-size: 11px;
  color: #888;
  transition: transform 0.25s ease;
}

.help-arrow.open {
  transform: rotate(180deg);
}

.help-content {
  padding: 20px;
  border-top: 1px solid #dce3ea;
}

.help-content.hidden {
  display: none;
}

.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

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

.help-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #f9fbfc;
  border: 1px solid #e8eef3;
  border-radius: 8px;
  padding: 12px 14px;
}

.help-step-number {
  background: #3498db;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.help-step-body {
  flex: 1;
}

.help-step-title {
  font-size: 13px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 4px;
}

.help-step-desc {
  font-size: 13px;
  color: #555;
  line-height: 1.55;
}

.help-step-desc a {
  color: #3498db;
  text-decoration: none;
}

.help-step-desc a:hover {
  text-decoration: underline;
}

.help-tips {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.help-tip {
  font-size: 13px;
  color: #555;
  background: #fffbea;
  border: 1px solid #f0e08a;
  border-radius: 6px;
  padding: 8px 12px;
  line-height: 1.5;
}

.summary-box {
  background: #eef6fb;
  border: 1px solid #cfe3f2;
  border-left: 4px solid #3498db;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.summary-label {
  font-size: 13px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 6px;
}
.summary-note {
  font-weight: 400;
  color: #888;
  font-size: 12px;
}
.summary-text {
  font-size: 14px;
  line-height: 1.6;
  color: #333;
  margin: 0;
}

.login-card {
  background: #fff;
  max-width: 400px;
  margin: 60px auto;
  padding: 40px 32px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  text-align: center;
  border: 1px solid #e8eef3;
}
.login-logo {
  font-size: 40px;
  margin-bottom: 12px;
}
.login-card h3 {
  margin: 0 0 8px;
  color: #2c3e50;
}
.login-card p {
  color: #666;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 24px;
}
.login-btn {
  width: 100%;
  background: #2c3e50;
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.login-btn:hover {
  background: #1a252f;
}

#appHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
}
.header-title {
  font-size: 22px;
  font-weight: 600;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.welcome-text {
  font-size: 14px;
  font-weight: normal;
  opacity: 0.9;
  white-space: nowrap;
}
.logout-btn {
  width: auto;
  margin: 0;
  padding: 6px 16px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.logout-btn:hover {
  background: rgba(255,255,255,0.25);
}