:root {
  --page-bg: #cfcfcf;
  --panel: #eeeeee;
  --line-dark: #606060;
  --line-light: #ffffff;
  --blue: #003399;
  --red: #8b1a1a;
  --green: #0a5a2a;
  --text: #111111;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

a {
  color: var(--blue);
  display: block;
  margin: 8px 0;
  text-decoration: underline;
}

.page-shell {
  width: min(1180px, calc(100vw - 16px));
  margin: 8px auto;
  border-top: 2px solid var(--line-light);
  border-left: 2px solid var(--line-light);
  border-right: 2px solid var(--line-dark);
  border-bottom: 2px solid var(--line-dark);
  background: #dedede;
}

.topbar {
  padding: 10px 12px;
  background: #0b3d91;
  color: white;
  border-bottom: 3px solid #9c9c9c;
}

.brand {
  font-family: "Times New Roman", Times, serif;
  font-size: 24px;
  font-weight: bold;
}

.host {
  float: right;
  padding-top: 7px;
  font-size: 12px;
}

.sidebar {
  width: 190px;
  background: #d7d7d7;
  border-right: 2px solid #8c8c8c;
  padding: 12px;
}

.nav-title {
  margin: 12px 0 6px;
  padding: 4px;
  color: white;
  background: #707070;
  font-weight: bold;
  border-top: 1px solid white;
  border-left: 1px solid white;
  border-right: 1px solid #333;
  border-bottom: 1px solid #333;
}

.status-box {
  min-height: 70px;
  padding: 7px;
  background: #efefef;
  border: 1px inset #aaaaaa;
  font-size: 12px;
  line-height: 1.45;
}

.content {
  padding: 12px;
}

.hero {
  min-height: 150px;
  padding: 18px;
  border-top: 2px solid white;
  border-left: 2px solid white;
  border-right: 2px solid #777;
  border-bottom: 2px solid #777;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.7), rgba(255,255,255,0.25)),
    repeating-linear-gradient(0deg, #f7f7f7 0, #f7f7f7 22px, #e9e9e9 22px, #e9e9e9 23px);
}

h1 {
  margin: 0 0 8px;
  font-family: "Times New Roman", Times, serif;
  font-size: 38px;
  line-height: 1.05;
}

.hero p {
  max-width: 760px;
  margin: 0;
  font-size: 16px;
}

section {
  margin-top: 14px;
}

.section-title {
  width: 100%;
  margin-bottom: 0;
  color: white;
  background: #666666;
  border-top: 1px solid white;
  border-left: 1px solid white;
  border-right: 1px solid #222;
  border-bottom: 1px solid #222;
  font-weight: bold;
}

.section-title td {
  padding: 5px 8px;
}

.right {
  text-align: right;
  font-weight: normal;
  font-size: 12px;
}

.table-wrap,
.panel,
.method-box,
.result-box {
  border: 1px inset #999999;
  background: var(--panel);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 7px 8px;
  border: 1px solid #9a9a9a;
  vertical-align: top;
}

.data-table th {
  background: #d0d0d0;
  text-align: left;
}

.model-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.model-icon {
  display: inline-flex;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  align-items: center;
  justify-content: center;
  color: white;
  background: #0b3d91;
  border-top: 1px solid #7fa0d8;
  border-left: 1px solid #7fa0d8;
  border-right: 1px solid #001f4d;
  border-bottom: 1px solid #001f4d;
  font-size: 11px;
  font-weight: bold;
}

.model-icon img {
  display: block;
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.select-cell {
  text-align: center;
}

.select-cell input {
  width: auto;
}

.scorebar {
  width: 100%;
  min-width: 90px;
  height: 16px;
  background: white;
  border: 1px solid #777;
}

.scorebar span {
  display: block;
  height: 100%;
  background: #1e6b3a;
}

.dimension-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  background: #e6e6e6;
  border: 1px inset #999999;
}

.dim-card {
  padding: 9px;
  background: #f2f2f2;
  border-top: 1px solid white;
  border-left: 1px solid white;
  border-right: 1px solid #777;
  border-bottom: 1px solid #777;
}

.dim-card h3 {
  margin: 0 0 5px;
  font-size: 15px;
}

.dim-card p,
.dim-card ul {
  margin: 5px 0;
  line-height: 1.45;
}

.dim-card ul {
  padding-left: 20px;
}

.panel {
  padding: 10px;
}

.admin-shell {
  width: min(1240px, calc(100vw - 16px));
}

.admin-hero {
  min-height: 120px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  background: #e6e6e6;
  border: 1px inset #999999;
}

.metric-card {
  min-height: 86px;
  padding: 10px;
  background: #f2f2f2;
  border-top: 1px solid white;
  border-left: 1px solid white;
  border-right: 1px solid #777;
  border-bottom: 1px solid #777;
}

.metric-label {
  font-weight: bold;
}

.metric-value {
  margin: 6px 0;
  font-family: "Times New Roman", Times, serif;
  font-size: 30px;
  line-height: 1;
}

.metric-note {
  color: #333333;
  font-size: 12px;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 120px;
  gap: 10px;
  align-items: end;
}

.model-picker {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(150px, 1fr) 130px 100px 130px;
  gap: 10px;
  align-items: end;
}

.compact-box {
  padding: 8px 10px;
  margin: 0;
}

.muted {
  color: #666666;
}

.task-form {
  grid-template-columns: repeat(3, minmax(0, 1fr)) 120px;
}

.mini-button {
  width: 100%;
  min-height: 26px;
  padding: 3px 6px;
  font-size: 12px;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.wide {
  grid-column: 1 / -1;
}

label {
  display: block;
  margin-bottom: 4px;
  font-weight: bold;
}

textarea,
input,
select {
  width: 100%;
  padding: 7px;
  border: 1px inset #888888;
  background: white;
  font: inherit;
}

.form-row {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) 120px;
  gap: 8px;
  align-items: end;
  margin-top: 10px;
}

button {
  min-height: 33px;
  padding: 6px 12px;
  border-top: 2px solid white;
  border-left: 2px solid white;
  border-right: 2px solid #555;
  border-bottom: 2px solid #555;
  background: #d8d8d8;
  font-weight: bold;
  cursor: pointer;
}

button:active {
  border-top-color: #555;
  border-left-color: #555;
  border-right-color: white;
  border-bottom-color: white;
}

.hint {
  margin-top: 8px;
  color: #333333;
  font-size: 12px;
}

.method-box {
  padding: 10px;
  line-height: 1.55;
}

.result-box {
  min-height: 120px;
  margin: 0;
  padding: 10px;
  white-space: pre-wrap;
  overflow: auto;
}

.footer {
  padding: 8px 12px;
  color: #333333;
  background: #c2c2c2;
  border-top: 1px solid #888888;
  font-size: 12px;
}

.good {
  color: var(--green);
  font-weight: bold;
}

.bad {
  color: var(--red);
  font-weight: bold;
}

@media (max-width: 760px) {
  .page-shell,
  .page-shell tbody,
  .page-shell tr,
  .page-shell td {
    display: block;
    width: 100%;
  }

  .host {
    float: none;
    display: block;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 2px solid #8c8c8c;
  }

  .dimension-grid,
  .two-col,
  .metric-grid,
  .admin-form,
  .task-form,
  .model-picker {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 30px;
  }
}
