:root {
  font:
    15px/1.55 Inter,
    'PingFang SC',
    'Microsoft YaHei',
    system-ui,
    sans-serif;
  color: #183b34;
  background: #edf2ed;
  --line: #ced9d0;
  --green: #1d6050;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
}
a {
  color: var(--green);
}
main {
  max-width: 1500px;
  margin: auto;
  padding: 20px 3vw 30px;
}
.heading,
.board-head,
.bar,
.bar > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.heading {
  margin-bottom: 16px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(27px, 3.2vw, 40px);
  line-height: 1.22;
}
h2 {
  font-size: 19px;
}
h3 {
  font-size: 15px;
}
.heading p,
footer {
  color: #52695e;
}
.heading p {
  margin-top: 5px;
}
button,
select,
input {
  font: inherit;
}
button,
select {
  border-radius: 6px;
  border: 1px solid #b7c9be;
  background: #fff;
  color: #214b3f;
  padding: 6px 10px;
}
button {
  cursor: pointer;
}
button:hover,
select:hover {
  border-color: #377c69;
}
button:disabled {
  opacity: 0.55;
  cursor: default;
}
button.primary {
  background: #21604d;
  border-color: #21604d;
  color: white;
  font-weight: 650;
}
button:focus-visible,
select:focus-visible,
input:focus-visible,
svg:focus-visible,
summary:focus-visible {
  outline: 3px solid #239b83;
  outline-offset: 2px;
}
input[type='checkbox'] {
  accent-color: var(--green);
}
.board,
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.board-head,
.bar {
  padding: 10px 16px;
}
.plates {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: #32463f;
  gap: 1px;
}
.plates article {
  position: relative;
  background: #101915;
  color: #e9f1ec;
  min-width: 0;
  padding: 36px 5px 32px;
}
.plates article.model {
  background: #e7ede6;
  color: #193e34;
}
.plates h3 {
  position: absolute;
  left: 13px;
  top: 7px;
}
.plates small {
  position: absolute;
  bottom: 6px;
  left: 9px;
  right: 9px;
  font-size: 11px;
  line-height: 1.2;
}
.plates svg,
.plates canvas {
  width: 100%;
  height: clamp(335px, 51vh, 600px);
  display: block;
}
.plates svg {
  touch-action: manipulation;
  cursor: crosshair;
}
.plates canvas {
  cursor: grab;
}
.plates #pending {
  position: absolute;
  inset: 36px 0 30px;
  background: #e7ede6;
  display: grid;
  place-items: center;
  text-align: center;
  color: #576e61;
}
.bar,
.bar > div {
  flex-wrap: wrap;
}
.bar > div {
  justify-content: flex-start;
  gap: 7px;
}
.bar span,
.board-head label {
  font-size: 13px;
}
.panels {
  display: grid;
  grid-template-columns: 1fr 1.08fr;
  gap: 15px;
  margin-top: 15px;
}
.panel {
  padding: 15px 18px;
}
.panel > p,
.panel > h2 {
  margin-bottom: 12px;
}
.panel details {
  border-top: 1px solid var(--line);
  padding-block: 10px;
}
.panel details p {
  margin: 7px 0;
  color: #465f53;
}
summary {
  cursor: pointer;
  font-weight: 620;
}
.inner {
  padding: 6px 0 12px;
}
.import-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}
.import-grid > div,
.import-grid label {
  min-width: 0;
  display: grid;
  gap: 6px;
}
.import-grid input {
  width: 100%;
  font-size: 12px;
}
#report strong {
  font-weight: 650;
}
#report p {
  margin: 8px 0;
}
.status {
  font-size: 13px;
  color: #475f53;
  min-height: 1.4em;
}
.status[data-error='true'] {
  color: #9d412c;
}
footer {
  margin-top: 16px;
  font-size: 12px;
}
footer p {
  margin-bottom: 3px;
}
@media (max-width: 760px) {
  main {
    padding: 14px 10px 24px;
  }
  .panels {
    grid-template-columns: 1fr;
  }
  .bar,
  .board-head {
    padding: 8px;
  }
  .heading {
    align-items: flex-start;
  }
  .heading button {
    white-space: nowrap;
  }
  .plates svg,
  .plates canvas {
    height: clamp(245px, 40vh, 450px);
  }
  .plates small {
    font-size: 10px;
  }
  .plates h3 {
    left: 7px;
  }
  .import-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 530px) {
  .plates {
    grid-template-columns: 1fr 1fr;
  }
  .plates .model {
    grid-column: 1/-1;
  }
  .plates .model canvas {
    height: 255px;
  }
  .heading {
    flex-wrap: wrap;
  }
  .board-head {
    align-items: flex-start;
  }
  .board-head h2 {
    font-size: 16px;
  }
  .import-grid {
    grid-template-columns: 1fr;
  }
  .bar span {
    display: none;
  }
  .panel {
    padding: 12px;
  }
  .plates svg {
    height: 315px;
  }
}
.bar button[aria-pressed='true'] {
  background: #235c4b;
  border-color: #235c4b;
  color: #fff;
}
.plates .linked h3 {
  color: #9ce6d3;
}
.link-button {
  border: 0;
  background: transparent;
  padding: 0 0 0 5px;
  text-decoration: underline;
  color: #226551;
  font-size: 13px;
}
.case-actions,
.study-tools,
.edit-actions,
.draft-controls,
.mode-switch {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
#atlasLoad {
  padding: 25px;
}
#atlasLoad progress {
  width: min(100%, 420px);
  margin-top: 10px;
  accent-color: var(--green);
}
#atlasRetry {
  margin-top: 10px;
}
.board[data-loading] > :not(#atlasLoad) {
  display: none;
}
.study-tools,
.edit-actions {
  padding: 8px 16px;
  background: #f1f6f2;
  border-top: 1px solid var(--line);
  color: #355648;
}
.study-tools {
  scroll-margin-top: 80px;
}
.study-tools p,
.edit-actions span {
  font-size: 13px;
}
.mode-switch {
  gap: 0;
  background: #fff;
  border: 1px solid #afc4b7;
  border-radius: 8px;
  padding: 2px;
}
.mode-switch button {
  border: 0;
  padding: 5px 15px;
}
.mode-switch button[aria-pressed='true'] {
  background: #225f4d;
  color: #fff;
}
.plates[data-mode='inspect'] svg {
  cursor: default;
}
.plates[data-mode='inspect'] [data-level] {
  cursor: pointer;
}
.draft-controls select {
  max-width: 100%;
}
.draft-controls label {
  min-width: 0;
}
.panel > details,
.board {
  scroll-margin-top: 80px;
}
#returnToReport {
  margin-left: auto;
}
#draftStatus:empty {
  display: none;
}
@media (min-width: 1060px) {
  main {
    display: grid;
    grid-template-columns: minmax(0, 2.25fr) minmax(330px, 1fr);
    align-items: start;
    gap: 16px;
  }
  .heading,
  footer {
    grid-column: 1 / -1;
    margin: 0;
  }
  .board {
    position: sticky;
    top: 72px;
  }
  .panels {
    margin: 0;
    grid-template-columns: minmax(0, 1fr);
  }
  .import-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .import-grid select {
    width: 100%;
  }
}
.link-button {
  margin: 2px 4px 2px 0;
}
@media (max-width: 760px) {
  .case-actions {
    gap: 5px;
  }
  .case-actions button {
    font-size: 13px;
  }
  .study-tools,
  .edit-actions {
    padding: 8px;
  }
}

.case-actions a {display:inline-flex;align-items:center;min-height:36px;padding:4px 8px;font-size:14px;font-weight:600;text-underline-offset:3px;white-space:nowrap}
