:root {
  --bg: #fffdf7;
  --paper: #ffffff;
  --ink: #272522;
  --muted: #6f6961;
  --line: #e7dece;
  --blue: #6aa7d8;
  --red: #dd7466;
  --olive: #8b965f;
  --yellow: #f2dc86;
  --cream: #fff8dc;
  --shadow: 0 10px 30px rgba(69, 57, 38, 0.08);
  font-family: "Hiragino Maru Gothic ProN", "Yu Gothic", "Yu Gothic UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 255, 255, 0.45) 1px, transparent 1px) 0 0 / 100% 34px,
    var(--bg);
  line-height: 1.75;
  letter-spacing: 0;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.handbook {
  width: min(1040px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 80px;
}

.cover {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 44%);
  gap: 18px;
  align-items: center;
  min-height: 330px;
  padding: 28px 0 12px;
}

.cover-deco {
  display: none;
}

.kicker,
.updated,
.tag,
.section-title span {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  width: fit-content;
  margin-bottom: 8px;
  font-size: clamp(2.4rem, 6.5vw, 4.2rem);
  font-weight: 500;
  line-height: 1.08;
  white-space: nowrap;
  border-bottom: 3px solid var(--blue);
}

.intro {
  max-width: 640px;
  color: var(--muted);
  font-size: 1.08rem;
  margin-bottom: 0;
}

.cover-picture {
  width: 100%;
  height: 300px;
  justify-self: end;
  display: block;
  overflow: hidden;
}

.cover-art {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% 50%;
  opacity: 0.95;
}

.toc {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 0;
  background: rgba(255, 253, 247, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.toc a,
.utility button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(69, 57, 38, 0.05);
  font-weight: 700;
}

.utility {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 12px;
}

.search {
  flex: 1;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.search span {
  color: var(--olive);
  font-weight: 800;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.utility button {
  cursor: pointer;
}

.section {
  padding-top: 46px;
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

.section-title span {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
}

.section-title h2 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.22;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hospital-grid {
  align-items: stretch;
}

.grid.compact {
  margin-top: 16px;
}

.card-stack {
  display: grid;
  gap: 16px;
  align-content: start;
}

.card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.card.important {
  background: linear-gradient(180deg, #fff, #fffdf1);
}

.card.warn {
  background: #fffaf0;
}

.card h3 {
  margin-bottom: 8px;
  font-size: 1.28rem;
  line-height: 1.35;
}

.card p,
.card li,
.card dd,
.notice {
  color: var(--muted);
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

.card-head p {
  margin-bottom: 8px;
  color: var(--red);
  font-weight: 800;
}

dl {
  margin: 0;
}

dl div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid #f0e8dc;
}

dt {
  color: var(--muted);
  font-weight: 800;
}

dd {
  margin: 0;
}

ol,
ul {
  margin: 0;
  padding-left: 1.3rem;
}

li + li {
  margin-top: 6px;
}

.checklist {
  display: grid;
  gap: 10px;
}

.checklist label {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid #f0e8dc;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.checklist input {
  width: 20px;
  height: 20px;
  accent-color: var(--olive);
  flex: 0 0 auto;
}

.tag {
  width: fit-content;
  margin-bottom: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #edf6fb;
  color: #477ea8;
}

.contact {
  display: flex;
  flex-direction: column;
}

.tel {
  width: fit-content;
  margin: 8px 0 12px;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
}

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

.link-row a,
.disabled-link {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fffdf7;
  color: var(--olive);
  text-decoration: none;
  font-weight: 800;
  font-size: 0.9rem;
}

.disabled-link {
  color: var(--muted);
  background: #f8f4ec;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0;
}

th,
td {
  padding: 7px 4px;
  border-bottom: 1px solid #f0e8dc;
  text-align: left;
  vertical-align: top;
}

th {
  width: 96px;
  color: var(--muted);
  font-size: 0.9rem;
}

.notice {
  margin: 14px 0 0;
  padding: 12px;
  border-left: 4px solid var(--red);
  background: #fff4ef;
}

.hidden-by-search {
  display: none !important;
}

.empty-state {
  margin-top: 18px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--paper);
}

@media (max-width: 820px) {
  .cover {
    grid-template-columns: minmax(0, 1fr) 210px;
    gap: 12px;
    min-height: 260px;
    padding-top: 18px;
  }

  .cover-picture {
    width: 100%;
    height: 235px;
  }

  .utility {
    align-items: stretch;
    flex-direction: column;
  }

  .utility button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .handbook {
    width: min(100% - 22px, 1040px);
    padding-top: 12px;
  }

  h1 {
    font-size: clamp(1.95rem, 9.2vw, 2.45rem);
    border-bottom-width: 2px;
  }

  .cover {
    grid-template-columns: minmax(0, 1fr) 132px;
    gap: 8px;
    align-items: start;
    min-height: 215px;
    padding-top: 10px;
  }

  .cover-picture {
    position: relative;
    z-index: 1;
    width: 132px;
    height: 214px;
    margin-top: 0;
  }

  .cover-art {
    object-fit: contain;
    object-position: 50% 50%;
    opacity: 0.9;
  }

  .cover-text {
    position: relative;
    z-index: 1;
  }

  .kicker,
  .updated,
  .tag,
  .section-title span {
    font-size: 0.72rem;
  }

  .updated {
    margin-bottom: 6px;
  }

  .intro {
    max-width: 100%;
    font-size: 0.82rem;
    line-height: 1.65;
  }

  .toc {
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 4px;
    padding: 9px 0 10px;
  }

  .toc a {
    min-height: 32px;
    padding: 5px 7px;
    font-size: 0.72rem;
    white-space: nowrap;
  }

  .utility {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-top: 12px;
  }

  .search {
    min-height: 40px;
    gap: 7px;
    padding: 0 10px;
  }

  .search span {
    font-size: 0.72rem;
  }

  .search input {
    font-size: 0.78rem;
  }

  .utility button {
    width: auto;
    min-height: 40px;
    padding: 7px 10px;
    font-size: 0.76rem;
    white-space: nowrap;
  }

  .section {
    padding-top: 32px;
  }

  .section-title {
    gap: 8px;
    margin-bottom: 12px;
  }

  .section-title span {
    width: 27px;
    height: 27px;
  }

  .section-title h2 {
    font-size: 1.55rem;
  }

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

  .grid.compact {
    margin-top: 10px;
  }

  .card {
    padding: 11px;
  }

  .card h3 {
    margin-bottom: 6px;
    font-size: 0.98rem;
  }

  .card p,
  .card li,
  .card dd,
  .notice {
    font-size: 0.76rem;
  }

  .card-head {
    margin-bottom: 9px;
  }

  .checklist {
    gap: 7px;
  }

  .checklist label {
    min-height: 34px;
    gap: 8px;
    padding: 6px 7px;
    font-size: 0.72rem;
    line-height: 1.55;
  }

  .checklist input {
    width: 16px;
    height: 16px;
  }

  dl div {
    grid-template-columns: 54px 1fr;
    gap: 6px;
    padding: 5px 0;
  }

  dt,
  th {
    font-size: 0.7rem;
  }

  th {
    width: 54px;
  }

  td {
    font-size: 0.72rem;
    line-height: 1.55;
  }

  th,
  td {
    padding: 5px 3px;
  }

  .tel {
    margin: 6px 0 9px;
    padding: 5px 10px;
    font-size: 0.86rem;
  }

  .link-row {
    gap: 6px;
    margin-bottom: 9px;
  }

  .link-row a,
  .disabled-link {
    min-height: 29px;
    padding: 4px 9px;
    font-size: 0.78rem;
  }

  .notice {
    margin-top: 10px;
    padding: 10px;
  }
}
