/* Memo + Regulatory tab styles. Memo is designed to also print cleanly. */

/* ── Memo container ────────────────────────────────────────── */

.memo {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 40px;
  box-shadow: var(--shadow-md);
}

@media (max-width: 640px) {
  .memo { padding: 24px 20px; }
}

.memo-header {
  text-align: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}

.memo-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.memo-subtitle {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.memo-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
}

.memo-section {
  margin-bottom: 28px;
}

.memo-section-heading {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

/* Employee info table */
.info-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}

.info-row:last-child { border-bottom: none; }

.info-row .label {
  font-weight: 500;
  color: var(--text-secondary);
}

.info-row .value {
  color: var(--text);
}

@media (max-width: 640px) {
  .info-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* Classification recommendation box */
.recommendation-box {
  border: 2px solid var(--accent);
  background: var(--accent-light);
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 8px;
}

.recommendation-heading {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  margin-bottom: 8px;
}

.recommendation-body {
  font-size: 15px;
  color: var(--text);
  line-height: 1.55;
  white-space: pre-wrap;
}

.recommendation-body strong { font-weight: 700; }

/* Exemption analysis blocks */
.exemption-block {
  padding: 14px 16px;
  border-radius: 7px;
  border-left: 3px solid;
  margin-bottom: 10px;
}

.exemption-block.pass {
  background: var(--green-bg);
  border-left-color: var(--green);
}
.exemption-block.fail {
  background: var(--red-bg);
  border-left-color: var(--red);
}
.exemption-block.warn {
  background: var(--amber-bg);
  border-left-color: var(--amber);
}
.exemption-block.skip {
  background: var(--skip-bg);
  border-left-color: var(--skip);
}

.exemption-header {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.exemption-block.pass .exemption-header { color: var(--green); }
.exemption-block.fail .exemption-header { color: var(--red); }
.exemption-block.warn .exemption-header { color: var(--amber); }
.exemption-block.skip .exemption-header { color: var(--skip); }

.exemption-summary {
  font-size: 14px;
  color: var(--text);
  line-height: 1.55;
  margin-bottom: 8px;
}

.exemption-details {
  list-style: none;
  padding-left: 18px;
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.exemption-details li {
  padding: 2px 0;
  position: relative;
}

.exemption-details li::before {
  content: "•";
  position: absolute;
  left: -14px;
  color: var(--text-muted);
}

/* Overtime rules */
.ot-section {
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

.ot-section strong { color: var(--text); font-weight: 700; }

/* Confidence indicator (inside the recommendation box) */
.confidence-row {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
  background: var(--surface);
  border: 1px solid var(--line);
}

.confidence-row.confidence-high {
  background: var(--green-bg);
  border-color: var(--green-border);
}
.confidence-row.confidence-medium {
  background: var(--amber-bg);
  border-color: var(--amber-border);
}
.confidence-row.confidence-low {
  background: var(--red-bg);
  border-color: var(--red-border);
}

.confidence-label {
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 6px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 10px;
}

.confidence-value {
  font-weight: 700;
  color: var(--text);
}

.confidence-row.confidence-high .confidence-value { color: var(--green); }
.confidence-row.confidence-medium .confidence-value { color: var(--amber); }
.confidence-row.confidence-low .confidence-value { color: var(--red); }

.confidence-reasons {
  margin: 6px 0 0 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--text-secondary);
  list-style: disc;
}

.confidence-reasons li { padding: 1px 0; }

/* Risk flag blocks (now with severity tiers) */
.risk-block {
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-bottom: 10px;
  border-left: 3px solid var(--amber);
  background: var(--amber-bg);
}

.risk-block.sev-critical {
  background: var(--red-bg);
  border-left-color: var(--red);
}
.risk-block.sev-high {
  background: var(--amber-bg);
  border-left-color: var(--amber);
}
.risk-block.sev-medium {
  background: color-mix(in srgb, var(--amber-bg) 70%, transparent);
  border-left-color: var(--amber);
}
.risk-block.sev-low {
  background: var(--skip-bg);
  border-left-color: var(--skip);
}

.risk-block-header {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.risk-severity {
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(125,125,125,0.18);
  color: var(--text);
}

.risk-severity.sev-critical {
  background: var(--red);
  color: #fff;
}
.risk-severity.sev-high {
  background: var(--amber);
  color: #fff;
}
.risk-severity.sev-medium {
  background: color-mix(in srgb, var(--amber) 22%, transparent);
  color: var(--amber);
}
.risk-severity.sev-low {
  background: color-mix(in srgb, var(--skip) 22%, transparent);
  color: var(--skip);
}

.risk-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
}

.risk-body {
  color: var(--text-secondary);
}

/* Reclassification helper section */
.reclass-section .reclass-block {
  padding: 16px 18px;
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
}

.reclass-title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.reclass-steps {
  margin: 0;
  padding-left: 22px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.reclass-steps li { margin-bottom: 6px; }

/* Questionnaire responses (audit trail) */
.answer-group {
  margin-bottom: 16px;
}

.answer-group:last-child { margin-bottom: 0; }

.answer-group-title {
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 6px;
}

.answer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
}

.answer-list li {
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}

.answer-list li:last-child { border-bottom: none; }

.answer-legend {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 12px;
  font-style: italic;
  line-height: 1.5;
}

.answer-legend strong {
  color: var(--text-secondary);
  font-style: normal;
  font-weight: 600;
}

.answer-q {
  color: var(--text-secondary);
  line-height: 1.5;
}

.answer-a {
  color: var(--text);
  padding-left: 16px;
  line-height: 1.5;
  margin-top: 2px;
}

.answer-source {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: 1px;
}

.answer-source.user {
  background: color-mix(in srgb, var(--green) 14%, transparent);
  color: var(--green);
}

.answer-source.auto {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Disclaimer */
.disclaimer {
  padding-top: 20px;
  margin-top: 28px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.6;
}

.disclaimer.privacy {
  padding-top: 8px;
  margin-top: 6px;
  border-top: none;
  font-style: normal;
}

/* ── Regulatory tab ────────────────────────────────────────── */

.reg-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.reg-panel-heading {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -0.005em;
}

.reg-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.reg-item:last-child { border-bottom: none; }
.reg-item:first-child { padding-top: 0; }

.reg-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.reg-item-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Threshold reference table */
.threshold-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.threshold-table th,
.threshold-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.threshold-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.threshold-table td.mono {
  font-family: "JetBrains Mono", monospace;
}

.threshold-table td.notes {
  font-size: 12px;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .threshold-table th,
  .threshold-table td {
    padding: 8px 6px;
    font-size: 12px;
  }
}

/* ── Print overrides for memo ──────────────────────────────── */

@media print {
  .memo {
    background: #fff !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    color: #000 !important;
  }
  .memo * { color: #000 !important; }
  .memo-header,
  .memo-section-heading,
  .info-row,
  .disclaimer {
    border-color: #999 !important;
  }
  .recommendation-box {
    background: #fff !important;
    border: 1px solid #000 !important;
  }
  .exemption-block.pass { background: #fff !important; border-left: 2px solid #000 !important; }
  .exemption-block.fail { background: #fff !important; border-left: 2px solid #000 !important; }
  .exemption-block.warn { background: #f4f4f4 !important; border-left: 2px solid #000 !important; }
  .exemption-block.skip { background: #fff !important; border-left: 2px solid #666 !important; }
  .risk-block { background: #f4f4f4 !important; border-left: 2px solid #000 !important; }
  .risk-block.sev-critical { background: #f4f4f4 !important; border-left: 3px solid #000 !important; }
  .risk-severity { background: #fff !important; color: #000 !important; border: 1px solid #000 !important; }
  .confidence-row { background: #fff !important; border: 1px solid #000 !important; }
  .reclass-block { background: #fff !important; border-left: 2px solid #000 !important; }
  .answer-list li { border-bottom-color: #999 !important; }
  .exemption-header { color: #000 !important; }
}
