html {
  scroll-padding-top: 4.6rem;
}
header, main, .lab-nav {
  width: min(68rem, calc(100% - 1.5rem));
  margin-left: auto;
  margin-right: auto;
}
header {
  padding-bottom: 0;
}
header h1 {
  margin-bottom: 0.2rem;
}
#who {
  margin: 0.2rem 0 0.8rem;
  color: #5c564c;
}
.lab-nav {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 auto 0.4rem;
  padding: 0.65rem 0;
  background: rgba(246, 244, 239, 0.94);
}
.lab-nav button {
  flex: 1 1 6.2rem;
  background: #fff;
  color: #1d211c;
  border: 1px solid #e4ddd0;
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  text-align: center;
  white-space: nowrap;
}
.lab-nav button[aria-current="page"] {
  background: #0d5c4d;
  color: #fff;
}
.card, #design-panel {
  scroll-margin-top: 4.6rem;
}
.card h2 {
  margin: 0 0 0.35rem;
}
.note {
  margin: 0.15rem 0 0.85rem;
  color: #5c564c;
}
.choice-group {
  margin: 0.4rem 0 1.1rem;
}
.choice-group h3 {
  margin: 0 0 0.55rem;
  font-size: 1rem;
}
.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
  gap: 0.7rem;
}
.choice-card, .item-card {
  background: #fbfaf6;
  border: 1px solid #e4ddd0;
  border-radius: 8px;
  padding: 0.8rem 0.85rem;
}
.choice-card {
  display: flex;
  flex-direction: column;
}
.choice-card button {
  margin-top: auto;
  align-self: flex-start;
}
.choice-card p, .item-name, .item-meta {
  margin: 0;
}
.choice-card strong, .item-name {
  display: block;
  line-height: 1.35;
}
.choice-card .item-meta, .item-meta {
  margin-top: 0.35rem;
  color: #5c564c;
  line-height: 1.45;
}
.choice-card p {
  margin-bottom: 0.75rem;
}
.item-actions {
  margin-top: 0.75rem;
}
.upload-row {
  justify-content: flex-start;
}
#knowledge-file {
  width: auto;
  max-width: 100%;
}
.item-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
  margin: 0.55rem 0;
}
.item-card.is-current {
  border-color: #0d5c4d;
  background: #f3f8f6;
}
.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0;
  flex: 0 0 auto;
}
.upload-row, .title-row, .mode-switch, .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}
.studio .actions, .mode-switch, .title-row {
  margin-top: 0.85rem;
}
.upload-row {
  margin: 0.3rem 0 0.8rem;
}
label {
  display: block;
  margin-top: 0.85rem;
}
.upload-row label, .title-row label {
  margin: 0;
}
input, select, textarea, button {
  font: inherit;
}
input[type="text"], select, textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d5cec2;
  border-radius: 6px;
  padding: 0.45rem 0.55rem;
  background: #fff;
}
.title-row input {
  width: min(22rem, 100%);
}
select {
  width: auto;
  min-width: 8rem;
}
textarea {
  min-height: 9rem;
  resize: vertical;
}
.code-fold {
  margin-top: 0.55rem;
  border: 1px solid #e4ddd0;
  border-radius: 8px;
  background: #fff;
}
.code-fold summary {
  cursor: pointer;
  padding: 0.65rem 0.8rem;
  font-weight: 600;
}
.code-fold textarea {
  display: block;
  border: 0;
  border-top: 1px solid #e4ddd0;
  border-radius: 0 0 8px 8px;
  min-height: 11rem;
  font-family: ui-monospace, "Noto Sans SC", sans-serif;
  font-size: 0.86rem;
  line-height: 1.45;
}
.studio {
  display: grid;
  gap: 1rem;
}
.preview-pane iframe {
  width: 100%;
  height: 22rem;
  border: 1px solid #e4ddd0;
  border-radius: 8px;
  background: #fff;
}
#bridge-status {
  max-height: 7rem;
  overflow: auto;
  color: #5c564c;
  font-size: 0.92rem;
}
#bridge-status p {
  margin: 0.25rem 0;
}
#design-panel {
  margin-top: 1rem;
}
#design-result p, #design-history p, #skill-preview {
  margin: 0.3rem 0;
  white-space: pre-wrap;
}
#sdk-skill-dialog:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(29, 33, 28, 0.46);
}
.dialog-card {
  width: min(40rem, 100%);
  max-height: min(80vh, 40rem);
  overflow: auto;
  background: #fff;
  border-radius: 10px;
  padding: 1rem 1.1rem 1.1rem;
}
#sdk-skill-preview {
  white-space: pre-wrap;
  max-height: 16rem;
  overflow: auto;
}
button {
  cursor: pointer;
}
@media (min-width: 960px) {
  .studio {
    grid-template-columns: minmax(18rem, 0.86fr) minmax(22rem, 1.14fr);
    align-items: start;
  }
  .preview-pane {
    position: sticky;
    top: 4.2rem;
  }
  .preview-pane iframe {
    height: min(68vh, 34rem);
  }
}
@media (max-width: 720px) {
  .item-card {
    flex-direction: column;
  }
}
