:root {
  color-scheme: light;
  --bg: #f7f7f4;
  --paper: #ffffff;
  --paper-warm: #fbfbf8;
  --ink: #171717;
  --muted: #6b6b63;
  --line: #deded8;
  --soft-line: #ecece6;
  --accent: #1f6b57;
  --accent-strong: #13483a;
  --accent-soft: #e3f1ec;
  --accent-line: #9dc8ba;
  --shadow: 0 18px 50px rgba(30, 32, 28, 0.08);
  --article-shadow: 0 24px 70px rgba(25, 34, 30, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #ffffff 0, var(--bg) 270px),
    var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  line-height: 1.75;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  border: 1px solid var(--soft-line);
  border-radius: 5px;
  background: #fafaf8;
  padding: 0.05em 0.35em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.nav {
  display: flex;
  gap: 4px;
  align-items: center;
  overflow-x: auto;
  border-bottom: 1px solid var(--soft-line);
  padding: 10px max(20px, calc((100vw - 1120px) / 2));
  white-space: nowrap;
}

.nav a {
  border-radius: 7px;
  padding: 7px 11px;
  color: var(--muted);
  font-size: 0.88rem;
}

.nav a:hover,
.nav a.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px 20px 46px;
}

.site-name {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 700;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.14;
  letter-spacing: 0;
}

.lead {
  max-width: 650px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  gap: 28px;
  width: min(1120px, calc(100% - 40px));
  margin: 32px auto 56px;
  align-items: start;
}

.sidebar,
.article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.sidebar {
  position: sticky;
  top: 20px;
  padding: 18px;
}

.summary {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.88rem;
}

.search-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper-warm);
  padding: 10px 11px;
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
}

.search:focus {
  border-color: var(--accent);
  outline: 3px solid var(--accent-soft);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 16px 0 18px;
}

.tag-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  padding: 5px 9px;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
}

.tag-button:hover,
.tag-button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.entry-list {
  display: grid;
  gap: 8px;
}

.entry-button {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 11px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.entry-button:hover,
.entry-button.active {
  border-color: var(--line);
  background: var(--paper-warm);
}

.entry-date {
  display: block;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
}

.entry-title {
  display: block;
  margin-top: 2px;
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.entry-excerpt {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.article {
  min-height: 560px;
  padding: clamp(24px, 4vw, 48px);
  background:
    linear-gradient(90deg, rgba(31, 107, 87, 0.055), transparent 120px),
    var(--paper);
  box-shadow: var(--article-shadow);
}

.article-header {
  border-bottom: 1px solid var(--soft-line);
  margin-bottom: 28px;
  padding-bottom: 22px;
  position: relative;
}

.article-header::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 72px;
  height: 2px;
  background: var(--accent);
}

.article-date {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
}

.article h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.25;
  letter-spacing: 0;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.article-tag {
  border-radius: 999px;
  background: var(--accent-soft);
  padding: 4px 9px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
}

.article-body {
  max-width: 760px;
  color: #22231f;
  font-size: 1.01rem;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.article-body h1 {
  display: none;
}

.article-body h2 {
  display: flex;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--soft-line);
  margin: 38px 0 14px;
  padding-top: 26px;
  color: var(--accent-strong);
  font-size: 1.34rem;
  line-height: 1.45;
}

.article-body h2::before {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 1.25em;
  border-radius: 999px;
  background: var(--accent);
}

.article-body h2:first-child {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.article-body h3 {
  margin: 28px 0 10px;
  color: #30332d;
  font-size: 1.08rem;
}

.article-body p {
  margin: 0 0 16px;
}

.article-body p code:only-child {
  display: block;
  max-width: 100%;
  margin: 6px 0 18px;
  padding: 10px 12px;
  white-space: normal;
}

.article-body ul,
.article-body ol {
  margin: 4px 0 22px;
  padding-left: 0;
  list-style: none;
}

.article-body ol {
  counter-reset: article-step;
}

.article-body li {
  position: relative;
  margin-bottom: 8px;
  padding-left: 1.5rem;
}

.article-body ul li::before {
  content: "";
  position: absolute;
  top: 0.85em;
  left: 0.38rem;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent-line);
}

.article-body ol li {
  counter-increment: article-step;
  padding-left: 2.1rem;
}

.article-body ol li::before {
  content: counter(article-step);
  position: absolute;
  top: 0.23em;
  left: 0;
  display: grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  border: 1px solid #c9ddd5;
  border-radius: 999px;
  background: #f6faf8;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
}

.article-body .task-list-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid #e2e9e5;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  margin-bottom: 8px;
  padding: 9px 11px;
}

.article-body .task-list-item::before {
  content: none;
}

.task-box {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--accent-line);
  border-radius: 5px;
  background: #fff;
  margin-top: 0.38em;
}

.task-list-item.checked .task-box {
  border-color: var(--accent);
  background: var(--accent);
}

.task-list-item.checked .task-box::after {
  content: "";
  display: block;
  width: 8px;
  height: 4px;
  border-bottom: 2px solid #fff;
  border-left: 2px solid #fff;
  margin: 4px 0 0 4px;
  transform: rotate(-45deg);
}

.inline-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: #a6cabe;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.inline-link:hover {
  color: var(--accent-strong);
  text-decoration-color: currentColor;
}

.settings-test-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  margin-bottom: 10px;
}

.settings-test-link {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 36px;
  border: 1px solid #cfded8;
  border-radius: 7px;
  background: #f6faf8;
  padding: 7px 11px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-align: center;
  white-space: normal;
}

.settings-test-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.settings-test-note {
  color: var(--muted);
  font-size: 0.88rem;
}

.device-model-check {
  margin: 22px 0;
}

.device-model-check h3 {
  margin-top: 0;
}

.device-model-check-lead {
  color: var(--muted);
}

.device-model-check-lead:empty {
  display: none;
}

.device-model-check-result {
  margin-top: 12px;
}

.device-model-check-lead:empty + .device-model-check-result {
  margin-top: 0;
}

.device-model-result-card {
  border: 1px solid #dbe5e0;
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.device-model-result-card strong {
  display: block;
  margin: 2px 0 8px;
  font-size: 1.16rem;
  line-height: 1.35;
}

.device-model-label {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
}

.device-model-shortcut-card {
  max-width: 560px;
  border: 1px solid #dbe5e0;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.device-model-shortcut-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.device-model-ios-actions {
  display: grid;
  gap: 10px;
}

@media (min-width: 620px) {
  .device-model-ios-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.device-model-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-align: center;
  transition: background 160ms ease, transform 160ms ease;
}

.device-model-action.primary {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}

.device-model-action.primary:hover {
  background: #185544;
  transform: translateY(-1px);
}

.device-model-action.primary:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 2px;
}

.device-model-action.secondary {
  border: 1px solid #cfded8;
  background: #f6faf8;
  color: var(--accent);
}

.device-model-action.secondary:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.device-model-fallback-link {
  display: inline-flex;
  border-bottom: 1px solid currentColor;
  color: var(--accent);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.device-model-check-small {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.media-frame {
  margin: 28px 0;
}

.media-frame img,
.media-frame video {
  display: block;
  width: 100%;
  max-height: 72vh;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111;
  object-fit: contain;
}

.media-frame img {
  background: #f2f2ee;
}

.media-frame figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.media-file-link {
  display: inline-flex;
  max-width: 100%;
  border-bottom: 1px solid currentColor;
  color: var(--accent);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.source-link {
  display: inline-flex;
  max-width: 100%;
  margin-top: 28px;
  border-bottom: 1px solid currentColor;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.empty {
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 22px 20px;
  color: var(--muted);
  text-align: center;
  font-size: 0.84rem;
}

@media (max-width: 820px) {
  .layout {
    display: block;
    width: min(100% - 28px, 720px);
  }

  .sidebar {
    position: static;
    margin-bottom: 18px;
  }

  .article {
    min-height: 420px;
  }
}

@media (max-width: 560px) {
  .header-inner {
    padding: 42px 16px 34px;
  }

  .layout {
    width: calc(100% - 24px);
    margin-top: 20px;
  }

  .article,
  .sidebar {
    padding: 16px;
  }

  .article-body {
    max-width: none;
  }

  .summary {
    display: block;
  }

  #latest-date {
    display: block;
    margin-top: 3px;
  }
}
