:root {
  --ink: #14212b;
  --ink-soft: #3a4a57;
  --paper: #f3efe6;
  --paper-2: #e7e0d2;
  --panel: rgba(255, 252, 246, 0.86);
  --line: rgba(20, 33, 43, 0.12);
  --accent: #0f6b5c;
  --accent-2: #c45c26;
  --danger: #9b2c2c;
  --ok: #1f7a4c;
  --shadow: 0 18px 50px rgba(20, 33, 43, 0.12);
  --radius: 18px;
  --font-display: "Newsreader", Georgia, serif;
  --font-body: "Instrument Sans", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(15, 107, 92, 0.18), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(196, 92, 38, 0.14), transparent 50%),
    linear-gradient(165deg, #f7f3ea 0%, #ebe4d6 45%, #e2d8c6 100%);
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  pointer-events: none;
}

.app {
  width: min(1480px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 2.5rem;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.login-screen[hidden] {
  display: none;
}

.login-card {
  width: min(440px, 100%);
  padding: 1.35rem 1.35rem 1.45rem;
  border: 1px solid #e6ebf2;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(30, 41, 59, 0.06);
}

.google-btn {
  width: 100%;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  border: 1px solid #d5deea;
  border-radius: 10px;
  background: #fff;
  color: #2d3a4a;
  font: 700 1.15rem/1 "Instrument Sans", "Segoe UI", sans-serif;
  cursor: pointer;
}

.google-btn svg {
  width: 22px;
  height: 22px;
  flex: none;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 1.35rem 0 1.15rem;
  color: #a0aaba;
  font-size: 0.95rem;
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: #e4e9f0;
}

.login-field {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.95rem;
  color: #2a3544;
  font-size: 1.05rem;
  font-weight: 700;
}

.login-field input {
  height: 48px;
  width: 100%;
  border: 1px solid #d7dee8;
  border-radius: 8px;
  padding: 0 0.85rem;
  font: 500 1rem/1 "Instrument Sans", "Segoe UI", sans-serif;
  color: #243140;
  background: #fff;
}

.login-field input:focus {
  outline: none;
  border-color: #2faf62;
  box-shadow: 0 0 0 1px #2faf62;
}

.login-error {
  margin: 0.75rem 0 0;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 500;
}

.login-submit {
  width: 100%;
  height: 50px;
  margin-top: 1.15rem;
  border: 0;
  border-radius: 8px;
  background: #1f8a45;
  color: #fff;
  font: 700 1.15rem/1 "Instrument Sans", "Segoe UI", sans-serif;
  cursor: pointer;
}

.topbar-side {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.settings-modal {
  width: min(440px, calc(100vw - 2rem));
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.settings-modal::backdrop {
  background: rgba(20, 33, 43, 0.48);
}

.settings-card {
  padding: 1.25rem 1.3rem 1.35rem;
}

.settings-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.settings-head h2,
.settings-card h3 {
  margin: 0;
  font-family: var(--font-display);
}

.settings-card h3 {
  margin-top: 1.15rem;
  font-size: 1.2rem;
}

.settings-lead {
  margin: 0.35rem 0 0.8rem;
  color: var(--ink-soft);
}

.settings-users {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid #e4e9f0;
  border-radius: 10px;
  max-height: 180px;
  overflow: auto;
}

.settings-users li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid #eef2f6;
}

.settings-users li:last-child {
  border-bottom: 0;
}

.settings-users span {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.settings-ok {
  margin: 0.75rem 0 0;
  color: var(--ok);
  font-weight: 600;
}

.account-email {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  animation: rise 0.55s ease both;
}

.brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.tagline {
  margin: 0.35rem 0 0;
  color: var(--ink-soft);
  max-width: 28rem;
}

.status-chip {
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.75);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  white-space: nowrap;
}

.status-chip[data-state="ok"] {
  color: var(--ok);
  border-color: rgba(31, 122, 76, 0.35);
}

.status-chip[data-state="degraded"],
.status-chip[data-state="error"] {
  color: var(--danger);
  border-color: rgba(155, 44, 44, 0.35);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 22rem) minmax(0, 1fr);
  grid-template-areas:
    "upload pdf"
    "result pdf"
    "review pdf";
  gap: 1rem;
  align-items: start;
}

.upload-panel {
  grid-area: upload;
  animation: rise 0.65s ease both;
}

.pdf-panel {
  grid-area: pdf;
  animation: rise 0.7s ease both;
  display: flex;
  flex-direction: column;
  align-self: start;
  position: sticky;
  top: 0.75rem;
  height: calc(100vh - 6.5rem);
  min-height: 28rem;
  max-height: calc(100vh - 6.5rem);
  min-width: 0;
  overflow: hidden;
}

.pdf-panel > .panel-head-row {
  flex-shrink: 0;
}

.result-panel {
  grid-area: result;
  animation: rise 0.75s ease both;
}

#openResultBtn {
  width: 100%;
  margin-top: 0.15rem;
}

.result-panel .panel-head-row {
  flex-direction: column;
}

.result-panel .result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.review-panel {
  grid-area: review;
  animation: rise 0.85s ease both;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem 1.4rem;
  backdrop-filter: blur(10px);
}

.panel h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
}

.panel-lead {
  margin: 0.35rem 0 1rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.panel-head-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.dropzone {
  display: grid;
  place-items: center;
  gap: 0.35rem;
  min-height: 11rem;
  border: 1.5px dashed rgba(20, 33, 43, 0.28);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(243, 239, 230, 0.2));
  cursor: pointer;
  text-align: center;
  padding: 1.25rem;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.pdf-frame-wrap {
  position: relative;
  flex: 1 1 auto;
  /* Bounded box so browser PDF viewer scrolls inside, not clipped */
  min-height: 0;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #1a2229;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.pdf-placeholder {
  margin: 0;
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  color: rgba(255, 252, 246, 0.72);
  font-size: 0.95rem;
  padding: 1.5rem;
  text-align: center;
  pointer-events: none;
}

.pdf-frame {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

a.btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--accent);
  transform: translateY(-1px);
  background: rgba(15, 107, 92, 0.06);
}

.dropzone-mark {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.7rem;
  border: 1.5px solid rgba(15, 107, 92, 0.45);
  background:
    linear-gradient(135deg, rgba(15, 107, 92, 0.18), transparent 60%),
    #fff;
  position: relative;
  margin-bottom: 0.35rem;
}

.dropzone-mark::before,
.dropzone-mark::after {
  content: "";
  position: absolute;
  background: var(--accent);
  border-radius: 2px;
}

.dropzone-mark::before {
  width: 2px;
  height: 0.95rem;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.dropzone-mark::after {
  width: 0.95rem;
  height: 2px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.dropzone-title {
  font-weight: 600;
}

.dropzone-sub {
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.file-row {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.batch-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
  max-height: 18rem;
  overflow: auto;
}

.batch-item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  background: rgba(255, 255, 255, 0.55);
}

.batch-item.is-active {
  border-color: rgba(15, 107, 92, 0.55);
  background: rgba(15, 107, 92, 0.06);
}

.batch-item.has-hard {
  border-color: rgba(196, 92, 38, 0.55);
}

.batch-track {
  margin-top: 0.4rem;
  height: 4px;
  border-radius: 999px;
  background: rgba(20, 33, 43, 0.08);
  overflow: hidden;
}

.batch-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
}

.file-name {
  margin: 0;
  font-weight: 600;
  word-break: break-all;
}

.file-meta {
  margin: 0.15rem 0 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  border-color: transparent;
  color: #f7fffc;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.55);
}

.progress-block {
  margin-top: 1.1rem;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.progress-track {
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(20, 33, 43, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #1d8f7b);
  transition: width 0.35s ease;
}

.job-ids {
  margin: 0.55rem 0 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
  word-break: break-all;
}

.meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  padding: 0.25rem 0.7rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.pill.accent {
  color: var(--accent);
  border-color: rgba(15, 107, 92, 0.3);
}

.pill.warn {
  color: var(--accent-2);
  border-color: rgba(196, 92, 38, 0.35);
}

.result-modal {
  width: min(1120px, calc(100vw - 2.5rem));
  height: min(860px, calc(100vh - 2.5rem));
  max-height: calc(100vh - 2.5rem);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffaf3;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.result-modal::backdrop {
  background: rgba(20, 33, 43, 0.48);
}

.result-modal-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 1.15rem 1.3rem 1.25rem;
}

.result-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}

.result-modal-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
}

.result-modal-head p {
  margin: 0.25rem 0 0;
  color: var(--ink-soft);
}

.result-modal .rme-checklist-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.result-modal .medical-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.result-data {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.result-tablist {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  flex-shrink: 0;
  margin-bottom: 0.7rem;
}

.result-tab {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 0.32rem 0.75rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.result-tab.is-active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.result-tab.has-hard:not(.is-active),
.result-tab.has-risk:not(.is-active) {
  color: var(--accent-2);
  border-color: var(--accent-2);
}

.hard-page-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.hard-page-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  background: rgba(255, 255, 255, 0.55);
}

.hard-page-card h4 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}

.hard-page-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.hard-page-card .snippet {
  margin-top: 0.35rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
}

.hard-page-jump.is-active {
  color: var(--accent);
  border-color: var(--accent);
}

.hard-page-viewer {
  margin-bottom: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.hard-page-viewer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.hard-page-viewer-bar p {
  margin: 0;
  font-weight: 600;
}

.hard-page-viewer iframe {
  display: block;
  width: 100%;
  height: min(520px, 58vh);
  border: 0;
  background: #f4efe6;
}

.claim-risk {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 1.1rem 1.15rem 1.2rem;
}

.claim-risk-kicker {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.claim-risk h3,
.claim-risk h4 {
  margin: 0.15rem 0 0;
}

.claim-risk-scoreline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0 1.15rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.claim-risk-scoreline p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.claim-risk-number {
  margin: 0.15rem 0 0.4rem !important;
  color: var(--ink) !important;
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 650;
  line-height: 1;
}

.claim-risk-number span {
  font-size: 1rem;
  color: var(--ink-soft);
  font-weight: 500;
}

.claim-risk-status {
  margin: 0.2rem 0 0.15rem !important;
  color: var(--ink) !important;
  font-size: 1.25rem !important;
  font-weight: 650;
}

.claim-risk-row {
  margin-top: 0.85rem;
}

.claim-risk-row-label {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
}

.claim-risk-row-label span:last-child {
  color: var(--ink-soft);
  white-space: nowrap;
}

.claim-risk-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(196, 92, 38, 0.12);
  overflow: hidden;
}

.claim-risk-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent-2);
}

.claim-risk-advice {
  margin-top: 1.15rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.claim-risk-advice p {
  margin: 0.35rem 0 0;
  color: var(--ink-soft);
}

.result-panes {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding-right: 0.15rem;
}

.result-pane[hidden] {
  display: none;
}

.tab-empty {
  margin: 0.4rem 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.rme-checklist {
  margin-bottom: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  padding: 0.85rem 0.95rem 1rem;
}

.rme-checklist-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.rme-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.75rem 0.75rem;
  background: rgba(255, 255, 255, 0.55);
}

.rme-group h4 {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.rme-group h4 span {
  color: var(--ink-soft);
  font-weight: 500;
}

.rme-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  margin: 0.2rem 0;
}

.rme-item input {
  accent-color: var(--accent);
  pointer-events: none;
}

.rme-item.is-missing {
  color: var(--ink-soft);
}

.rme-validation {
  margin: 0.85rem 0 0;
  padding: 0.7rem 0.9rem 0.8rem 1.35rem;
  border-radius: 12px;
  background: rgba(196, 92, 38, 0.08);
  font-size: 0.88rem;
}

.rme-validation li {
  margin: 0.2rem 0;
}

.rme-validation li.is-hard {
  color: var(--danger);
  font-weight: 650;
}

@media (max-width: 720px) {
  .rme-checklist-grid {
    grid-template-columns: 1fr;
  }
}

.medical-block {
  margin-bottom: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  padding: 0.85rem 0.95rem 1rem;
}

.medical-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  margin-bottom: 0.75rem;
}

.medical-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
}

.medical-head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.medical-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.medical-field {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  background: rgba(255, 252, 246, 0.8);
}

.medical-field.is-missing {
  border-color: rgba(196, 92, 38, 0.4);
  background: rgba(196, 92, 38, 0.06);
}

.medical-field .label {
  display: block;
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin-bottom: 0.2rem;
}

.medical-field .value,
.medical-field .value-input {
  font-weight: 600;
  font-size: 0.92rem;
  word-break: break-word;
}

.medical-field .value-input {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  padding: 0.2rem 0.35rem;
}

.medical-field .value-input:focus {
  outline: none;
  border-color: rgba(15, 107, 92, 0.45);
  background: #fff;
}

.medical-field .conf {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.rm-block {
  margin-bottom: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  padding: 0.85rem 0.95rem 1rem;
}

.penunjang-summary {
  display: grid;
  gap: 0.45rem;
}

.penunjang-row {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.65rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(20, 33, 43, 0.08);
  font-size: 0.9rem;
}

.penunjang-row:last-child {
  border-bottom: 0;
}

.penunjang-row .k {
  color: var(--ink-soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding-top: 0.15rem;
}

.penunjang-row .v {
  font-weight: 500;
  word-break: break-word;
}

.lab-order {
  margin-bottom: 1rem;
}

.lab-order:last-child {
  margin-bottom: 0;
}

.lab-order-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.lab-order-head strong {
  color: var(--ink);
  font-weight: 600;
}

.rm-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 252, 246, 0.75);
}

.rm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.rm-table th,
.rm-table td {
  padding: 0.4rem 0.55rem;
  text-align: left;
  border-bottom: 1px solid rgba(20, 33, 43, 0.08);
  vertical-align: top;
}

.rm-table th {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: rgba(20, 33, 43, 0.03);
  white-space: nowrap;
}

.section-fields th {
  width: 13rem;
}

.rm-table tr:last-child td {
  border-bottom: 0;
}

.rm-table .flag {
  display: inline-block;
  min-width: 1.4rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.75rem;
}

.rm-table .flag-H,
.rm-table .flag-L,
.rm-table .flag-ABNORMAL {
  color: var(--accent-2);
}

.rm-table .flag-N {
  color: var(--ok);
}

.obat-section {
  margin-bottom: 0.85rem;
}

.obat-section:last-child {
  margin-bottom: 0;
}

.obat-section h4 {
  margin: 0 0 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.obat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.obat-chip {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.4rem 0.6rem;
  background: rgba(255, 252, 246, 0.85);
  font-size: 0.82rem;
  max-width: 100%;
}

.obat-chip strong {
  display: block;
  font-weight: 600;
}

.obat-chip span {
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.rm-empty {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .penunjang-row {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
}

.raw-text-details {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.55rem 0.75rem 0.75rem;
  background: rgba(255, 255, 255, 0.35);
}

.raw-text-details summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 0.55rem;
}

.result-text {
  margin: 0;
  min-height: 8rem;
  max-height: none;
  overflow: visible;
  white-space: pre-wrap;
  word-break: break-word;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(247, 243, 234, 0.55));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  font-family: var(--font-body);
  font-size: 0.98rem;
}

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

.review-list {
  display: grid;
  gap: 0.65rem;
  max-height: 14rem;
  overflow: auto;
}

.review-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.review-item:hover,
.review-item.is-active {
  border-color: rgba(196, 92, 38, 0.45);
  background: rgba(196, 92, 38, 0.06);
}

.review-item.has-hard,
.review-item.has-risk {
  border-color: rgba(196, 92, 38, 0.55);
}

.review-marks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.review-item-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.review-item h3 {
  margin: 0;
  font-size: 0.95rem;
  word-break: break-all;
}

.review-item p {
  margin: 0.25rem 0 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.empty-hint {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.review-form {
  margin-top: 1rem;
  display: grid;
  gap: 0.75rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.field {
  display: grid;
  gap: 0.35rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.8);
}

.field textarea {
  resize: vertical;
  min-height: 8rem;
}

.review-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.footer {
  margin-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
  animation: rise 0.9s ease both;
}

.footer a {
  color: var(--accent);
}

.toast {
  color: var(--ink);
  background: rgba(255, 252, 246, 0.9);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .result-modal .rme-checklist-grid,
  .result-modal .medical-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 1fr;
    grid-template-areas:
      "upload"
      "pdf"
      "result"
      "review";
  }

  .pdf-panel {
    min-height: auto;
    position: static;
    max-height: none;
  }

  .result-modal {
    width: calc(100vw - 1rem);
    height: calc(100vh - 1rem);
    max-height: calc(100vh - 1rem);
  }

  .result-modal .rme-checklist-grid,
  .result-modal .medical-grid {
    grid-template-columns: 1fr;
  }

  .pdf-frame-wrap {
    height: min(65vh, 28rem);
    min-height: 22rem;
  }

  .topbar,
  .panel-head-row,
  .file-row,
  .batch-item,
  .footer {
    flex-direction: column;
    align-items: stretch;
  }

  .result-actions,
  .review-form-actions {
    display: flex;
    gap: 0.5rem;
  }
}
