/* Development notes stay readable as native details when JavaScript is unavailable. */
#works .work-guide-note {
  margin: 16px 0;
  min-width: 0;
  font-size: .86rem;
  line-height: 1.85;
}

#works .work-guide-note > summary {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 32px;
  padding: 4px 28px 4px 10px;
  border: 1px solid #d9c7ab;
  border-radius: 6px;
  background: #fff9ef;
  color: #634a2b;
  list-style: none;
  cursor: pointer;
  touch-action: manipulation;
  font-size: .78rem;
  line-height: 1.5;
}

#works .work-guide-note > summary::-webkit-details-marker { display: none; }
#works .work-guide-note > summary::marker { content: ''; }
#works .work-guide-note > summary > span { font-weight: 600; }
#works .work-guide-note > summary > small { display: none; }
#works .work-guide-note > summary::after {
  content: '＋';
  position: absolute;
  top: 50%;
  right: 8px;
  font-size: .9rem;
  transform: translateY(-50%);
}
#works .work-guide-note[open] > summary::after { content: '−'; }
#works .work-guide-note > summary:hover { background: #fff1d9; }
#works .work-guide-note[open] > summary { border-color: #9d7c4e; }

@media (hover: none), (pointer: coarse) {
  #works .work-guide-note > summary { min-height: 44px; }
}

#works .work-guide-note > summary:focus-visible,
#works .guide-close:focus-visible,
#works .guide-content a:focus-visible {
  outline: 3px solid #4a7dff;
  outline-offset: 3px;
}

#works .works-guide { display: none; }
#works .works-guide[hidden],
#works .dev-story-inline[hidden] { display: none; }

#works .dev-story-inline { margin-top: 16px; min-width: 0; }
#works .guide-avatar-home {
  width: 72px;
  height: 72px;
  margin: 0 0 12px 14px;
}
#works .guide-avatar-home img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#works .guide-speech {
  position: relative;
  min-width: 0;
  padding: 20px 18px;
  border: 1px solid #e5d9c5;
  border-radius: 16px;
  background: #fffdf7;
  box-shadow: 0 4px 16px rgb(70 48 15 / 5%);
  font-size: .86rem;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

#works .guide-speech::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 40px;
  width: 12px;
  height: 12px;
  border-top: 1px solid #e5d9c5;
  border-left: 1px solid #e5d9c5;
  background: #fffdf7;
  transform: rotate(45deg);
}

#works .guide-speech .guide-eyebrow {
  margin: 0 25px 10px 0;
  color: #80603a;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
}

#works .guide-speech .guide-title {
  margin: 0 0 14px;
  color: #36302a;
  font-size: 1rem;
  line-height: 1.65;
}
#works .guide-title:focus { outline: none; }

#works .guide-close {
  position: absolute;
  top: 7px;
  right: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #735b3e;
  font: inherit;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}
#works .guide-close:hover { background: #f2e8d6; }
#works .guide-close[hidden] { display: none; }

#works .dev-story-content { min-width: 0; overflow-wrap: anywhere; }
#works .dev-story-content .dev-story-draft {
  display: inline-block;
  margin: 0 0 10px;
  padding: 2px 9px;
  border-radius: 5px;
  background: #f2e8d6;
  color: #634a2b;
  font-size: .72rem;
  font-weight: 700;
}
#works .work-guide-note > .dev-story-content { margin-top: 14px; }
#works .dev-story-content .dev-story-role {
  margin: 0 0 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eadfcd;
  color: #79654b;
  font-size: .75rem;
  line-height: 1.8;
}
#works .dev-story-content .dev-story-lead,
#works .guide-welcome .dev-story-lead {
  margin: 0 0 16px;
  color: #40372c;
  font-size: .87rem;
  font-weight: 600;
  line-height: 1.85;
}
#works .dev-story-body { margin: 0; }
#works .dev-story-body > div + div { margin-top: 14px; }
#works .dev-story-body dt {
  margin-bottom: 3px;
  color: #80603a;
  font-size: .75rem;
  font-weight: 700;
}
#works .dev-story-body dd {
  margin: 0;
  color: #4e463c;
  font-size: .84rem;
  line-height: 1.9;
}

@media (min-width: 1180px) and (min-height: 600px) {
  #works.has-dev-guide { max-width: 1240px; }

  #works.has-dev-guide > .works-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    align-items: start;
  }

  #works.has-dev-guide > .works-layout > .works-grid {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    align-items: start;
  }

  #works.has-dev-guide .works-guide {
    position: sticky;
    top: calc(var(--guide-nav-offset, 54px) + 16px);
    grid-column: 2;
    grid-row: 1;
    display: block;
    width: 320px;
    max-height: calc(100vh - var(--guide-nav-offset, 54px) - 32px);
    max-height: calc(100dvh - var(--guide-nav-offset, 54px) - 32px);
    padding: 4px;
    overflow-y: auto;
    scrollbar-width: thin;
    overscroll-behavior-y: contain;
  }

  #works.has-dev-guide .works-guide[hidden] { display: none; }
  #works .works-guide > .guide-avatar-home { width: 96px; height: 96px; }
  #works .works-guide .guide-speech { padding: 22px 20px; }
}

@media (max-width: 600px) {
  #works .guide-avatar-home { width: 64px; height: 64px; }
  #works .guide-speech { padding: 18px 15px; }
  #works .has-open-dev-story:hover { transform: none; }
}
