.workspace-intro {
  padding: 54px 0 34px;
  border-bottom: 1px solid var(--line);
}

.workspace-intro h1 {
  margin: 20px 0 12px;
}

.content-panel {
  padding-top: 34px;
}

.content-panel[hidden] {
  display: none;
}

.category-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #eceee7;
}

.category-tabs button {
  min-width: 88px;
  min-height: 38px;
  padding: 8px 20px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}

.category-tabs button[aria-selected="true"] {
  background: var(--ink);
  color: white;
  box-shadow: 0 2px 8px #23332c1c;
}

.category-tabs button:hover {
  background: #dfe4d8;
}

.category-tabs button[aria-selected="true"]:hover {
  background: #405740;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.entry-card {
  min-height: 168px;
  border: 1px solid #d5ddc8;
  border-radius: 12px;
  padding: 22px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 17px;
  align-items: start;
  transition: transform .18s, box-shadow .18s;
}

.entry-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px #23332c0d;
}

.entry-tools { background: #e9f0dc; }
.entry-games { background: #f1e9de; border-color: #e3d8c8; }

.entry-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #23332c24;
  border-radius: 10px;
  font-size: 22px;
}

.entry-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
}

.entry-copy strong {
  font-size: 18px;
  font-weight: 600;
}

.entry-copy > span:last-child {
  font-size: 12px;
  line-height: 1.65;
  color: #58635b;
}

.entry-side {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.entry-status {
  white-space: nowrap;
  font-size: 10px;
  color: #58635b;
}

.entry-status i {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #62864c;
  margin-right: 4px;
}

.entry-status.is-waiting {
  border: 1px solid #d7cbbb;
  border-radius: 20px;
  padding: 4px 8px;
}

.entry-arrow { font-size: 19px; }

.detail-wrap {
  scroll-margin-top: 25px;
  margin-top: 18px;
}

.detail-label {
  margin: 0 0 9px 3px;
  font-size: 9px;
  letter-spacing: 1.4px;
  color: #7b837c;
}

@media (max-width: 800px) {
  .entry-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .entry-card {
    min-height: 158px;
    padding: 18px;
    grid-template-columns: auto 1fr;
  }

  .entry-side {
    grid-column: 1 / -1;
    height: auto;
    flex-direction: row;
    align-items: center;
  }
}

@media (max-width: 560px) {
  .header { flex-wrap: wrap; height: auto; padding: 18px 0; gap: 14px; }
  .category-tabs { order: 3; width: 100%; }
  .category-tabs button { flex: 1; }
  .workspace-intro { padding: 35px 0 25px; }
  .entry-grid { grid-template-columns: 1fr; }
  .entry-card { min-height: 145px; }
}

@media (prefers-reduced-motion: reduce) {
  .entry-card { transition: none; }
}

/* Developer tool interfaces */
.entry-card[aria-current="true"] {
  border-color: #708866;
  box-shadow: 0 0 0 2px #70886622;
}

.tool-detail[hidden] {
  display: none;
}

.tool-description code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #edf0e8;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
}

.field,
.tool-workspace select {
  width: 100%;
  min-height: 43px;
  border: 1px solid #d9ded3;
  border-radius: 7px;
  background: #f8f9f4;
  padding: 9px 12px;
  color: var(--ink);
  font: inherit;
}

.field:focus-visible,
.tool-workspace select:focus-visible {
  outline: 3px solid #42664a;
  outline-offset: 3px;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(130px, 1fr);
  gap: 12px;
}

.field-row label,
.tool-workspace > label {
  display: grid;
  gap: 8px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.button-primary {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.button-primary:hover {
  background: #405740;
}

button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.field-message {
  min-height: 20px;
  padding-top: 6px;
  color: #a23e32;
  font-size: 11px;
}

.field-message:not(.is-error):empty {
  min-height: 0;
  padding: 0;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.result-grid > span {
  min-width: 0;
  padding: 13px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.result-grid small,
.result-grid strong {
  display: block;
}

.result-grid small {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 9px;
}

.result-grid strong {
  overflow-wrap: anywhere;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 15px;
}

.result-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
}

.result-list > div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
}

.result-list dt {
  color: var(--muted);
  font-size: 10px;
}

.result-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.code-results dd,
.hex-editor,
.binary-preview {
  font-family: Consolas, "SFMono-Regular", monospace;
}

.code-results dd {
  line-height: 1.7;
}

.file-field {
  padding: 7px;
}

.file-field::file-selector-button {
  margin-right: 10px;
  border: 0;
  border-radius: 5px;
  background: var(--ink);
  padding: 7px 10px;
  color: white;
}

.hex-editor {
  min-height: 185px;
  margin-top: 8px;
  white-space: pre;
}

.binary-preview {
  min-height: 48px;
  margin: 8px 0 0;
  padding: 12px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: #556158;
  font-size: 11px;
  line-height: 1.6;
}

@media (max-width: 800px) {
  .result-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-list > div { grid-template-columns: 72px minmax(0, 1fr); }
}
