:root {
  color-scheme: light;
  font-family:
    "Leelawadee UI", "Noto Sans Thai", "Noto Sans Lao", system-ui, sans-serif;
  color: #152238;
  background: #f4f6fa;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  line-height: 1.5;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 10px max(20px, calc((100vw - 1060px) / 2));
  background: #162034;
  color: #fff;
}
.topbar a {
  color: #dbe7ff;
  text-decoration: none;
}
.brand {
  font-weight: 800;
  letter-spacing: 0.02em;
}
.module {
  margin-left: auto;
  color: #ccd6e6;
}
.shell {
  max-width: 1060px;
  margin: auto;
  padding: 28px 20px 60px;
}
.intro,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.intro {
  margin-bottom: 20px;
}
.intro h1 {
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 3px;
}
.intro p {
  margin: 0;
  color: #59677a;
}
.intro .eyebrow {
  font-size: 12px;
  letter-spacing: 0.13em;
  color: #ab2030;
  font-weight: 700;
  margin-bottom: 4px;
}
.panel {
  background: #fff;
  border: 1px solid #e0e5ec;
  border-radius: 18px;
  padding: 22px;
  margin: 18px 0;
  box-shadow: 0 8px 28px rgba(22, 32, 52, 0.04);
}
.panel[hidden],
button[hidden] {
  display: none !important;
}
.section-head {
  margin-bottom: 14px;
}
.section-head h2 {
  font-size: 20px;
  margin: 0;
}
.message {
  border-radius: 12px;
  background: #eaf0fb;
  color: #193a69;
  padding: 12px 16px;
}
.message.error {
  background: #fff0ef;
  color: #ad2332;
}
.message.success {
  background: #eaf7ef;
  color: #126446;
}
.hint {
  background: #f5f7fa;
  border-left: 3px solid #325a92;
  padding: 10px 12px;
  border-radius: 4px;
  color: #48576b;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
label {
  display: block;
  font-weight: 650;
  margin: 13px 0;
  color: #233149;
}
input,
textarea,
select {
  font: inherit;
  width: 100%;
  border: 1px solid #bdc8d7;
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 5px;
  background: #fff;
  color: #152238;
}
textarea {
  resize: vertical;
}
input:focus,
textarea:focus,
select:focus {
  outline: 3px solid #bcd7ff;
  border-color: #3472c4;
}
button {
  font: inherit;
  cursor: pointer;
  border-radius: 10px;
  padding: 10px 16px;
  border: 1px solid transparent;
  font-weight: 700;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.primary {
  background: #a71325;
  color: #fff;
}
.primary:hover:not(:disabled) {
  background: #8e0f1f;
}
.secondary {
  background: #fff;
  border-color: #bbc7d5;
  color: #203c64;
}
.secondary:hover:not(:disabled) {
  background: #f1f5fa;
}
.actions a.secondary {
  border: 1px solid #bbc7d5;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 700;
  line-height: 1.5;
}
.text-button {
  padding: 4px 0;
  background: transparent;
  color: #245a96;
}
.danger {
  background: #fff0ef;
  color: #aa1930;
  border-color: #f3bfca;
}
.selection {
  margin: 4px 0;
  color: #59677a;
}
.selection.selected {
  color: #145c4b;
  font-weight: 700;
}
.search-results {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.search-results button {
  border-color: #d1dbe7;
  background: #f8fafc;
  text-align: left;
  font-weight: 500;
}
.case-list {
  display: grid;
  gap: 8px;
}
.case-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  background: #fff;
  border: 1px solid #e2e7ed;
  text-align: left;
}
.case-card:hover {
  border-color: #6485b1;
  background: #f8fbff;
}
.case-card strong,
.case-card small {
  display: block;
}
.case-card small {
  color: #697789;
  margin-top: 2px;
}
.status {
  display: inline-block;
  white-space: nowrap;
  border-radius: 99px;
  padding: 4px 9px;
  font-size: 12px;
  background: #e9eef7;
  color: #345477;
}
.status.issued,
.status.acknowledged {
  background: #e3f5eb;
  color: #11633e;
}
.status.rejected,
.status.voided {
  background: #fff0ef;
  color: #a72331;
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 20px;
}
.info-grid p {
  margin: 4px 0;
  overflow-wrap: anywhere;
}
.info-grid span {
  display: block;
  color: #637083;
  font-size: 13px;
}
.facts {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid #e3e8ef;
  background: #f8fafc;
  border-radius: 10px;
  padding: 14px;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 18px 0;
}
.evidence-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.evidence-list a {
  color: #245a96;
}
.hr-form {
  border-top: 1px solid #e4e9ef;
  margin-top: 22px;
  padding-top: 10px;
}
.hr-form h3 {
  margin: 8px 0;
}
.preview-panel {
  border: 1px solid #cbd5e2;
  border-radius: 12px;
  padding: 12px;
  margin-top: 12px;
  background: #f7f9fc;
}
.preview-panel[hidden] {
  display: none;
}
.preview-panel iframe {
  display: block;
  width: 100%;
  height: 620px;
  border: 1px solid #d4dbe5;
  border-radius: 8px;
  background: #fff;
}
.notice {
  font-size: 13px;
  color: #6b5360;
}
.empty {
  color: #6d798a;
  padding: 18px 0;
}
@media (max-width: 640px) {
  .topbar {
    padding: 12px 16px;
  }
  .shell {
    padding: 20px 12px 45px;
  }
  .panel {
    padding: 16px;
    border-radius: 14px;
  }
  .intro {
    align-items: flex-start;
  }
  .intro .primary {
    white-space: nowrap;
    padding: 8px 11px;
  }
  .form-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }
  .case-card {
    align-items: flex-start;
  }
  .case-card .status {
    max-width: 90px;
    white-space: normal;
    text-align: center;
  }
  .preview-panel iframe {
    height: 540px;
  }
}
