:root {
  --background: #ffffff;
  --surface: #ffffff;
  --surface-subtle: #f7f7f5;
  --text: #262626;
  --muted: #74746f;
  --line: #e6e6e2;
  --blue: #0f3f9c;
  --blue-soft: #e9f0ff;
  --shadow: 0 12px 32px rgb(20 25 35 / 8%);
  --footer-height: 74px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--surface-subtle);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--surface-subtle);
}

button,
input {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

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

.app-shell {
  width: min(100%, 560px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 16px calc(var(--footer-height) + 24px + env(safe-area-inset-bottom));
  background: var(--background);
}

.site-header {
  padding: 22px 4px 16px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.site-header h1 {
  margin: 0;
  font-size: 1.65rem;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.site-description {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.channel-tabs {
  display: flex;
  gap: 8px;
  margin: 0 -16px;
  padding: 0 16px 13px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
}

.channel-tabs::-webkit-scrollbar {
  display: none;
}

.channel-tab {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 700;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.channel-tab.is-active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.list-summary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 15px 3px 10px;
  color: var(--muted);
  font-size: 0.74rem;
}

.list-summary__rule {
  width: 1px;
  height: 11px;
  background: var(--line);
}

.article-list {
  display: grid;
  gap: 1px;
  margin: 0 -16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.article-card {
  display: grid;
  grid-template-columns: minmax(112px, 34%) minmax(0, 1fr);
  min-height: 102px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  transition: background 140ms ease;
}

.article-card:last-child {
  border-bottom: 0;
}

.article-card:active {
  background: var(--surface-subtle);
}

.article-card[hidden] {
  display: none;
}

.article-card__image-wrap {
  position: relative;
  display: block;
  overflow: hidden;
  background: linear-gradient(135deg, #e7e8eb, #c8ceda);
}

.article-card__image-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card__content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 12px 15px;
}

.article-card__channel {
  margin-bottom: 5px;
  color: var(--blue);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.article-card__title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.article-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.68rem;
}

.article-card__duration {
  color: #555552;
  font-weight: 800;
}

.empty-state {
  margin: 32px 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.88rem;
}

.article-page {
  padding-right: 0;
  padding-left: 0;
}

.article-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 94%);
  backdrop-filter: blur(12px);
}

.back-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  color: var(--blue);
  font-size: 0.88rem;
  font-weight: 800;
}

.article-header__actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.article-header__channel,
.youtube-link {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.68rem;
  font-weight: 800;
}

.youtube-link {
  white-space: nowrap;
}

.article-page article {
  padding: 0 16px;
}

.article-hero {
  aspect-ratio: 16 / 9;
  margin: 16px -16px 0;
  overflow: hidden;
  background: linear-gradient(135deg, #e7e8eb, #c8ceda);
}

.article-hero img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-page h1 {
  margin: 0;
  color: #202020;
  font-size: clamp(1.45rem, 6vw, 2rem);
  letter-spacing: -0.04em;
  line-height: 1.36;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 0.73rem;
}

.article-meta span + span::before {
  margin-right: 12px;
  color: #b0b0ad;
  content: "•";
}

.article-persons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 13px;
}

.article-persons span {
  padding: 5px 8px;
  border-radius: 5px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 700;
}

.markdown-body {
  padding: 28px 0 14px;
  color: #30302d;
  font-size: 0.98rem;
  line-height: 1.93;
  overflow-wrap: anywhere;
}

.markdown-body > :first-child {
  margin-top: 0;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  color: #202020;
  letter-spacing: -0.025em;
  line-height: 1.42;
}

.markdown-body h1 {
  margin: 42px 0 18px;
  font-size: 1.5rem;
}

.markdown-body h2 {
  margin: 42px 0 17px;
  padding: 0 0 10px;
  border-bottom: 2px solid #242424;
  font-size: 1.27rem;
}

.markdown-body h3 {
  margin: 29px 0 12px;
  font-size: 1.08rem;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body pre,
.markdown-body blockquote {
  margin: 0 0 19px;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.45em;
}

.markdown-body li {
  margin: 8px 0;
  padding-left: 2px;
}

.markdown-body a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.markdown-body strong {
  color: #151515;
  font-weight: 800;
}

.markdown-body blockquote {
  padding: 10px 15px;
  border-left: 3px solid var(--blue);
  background: var(--surface-subtle);
  color: #4c4c48;
}

.markdown-body pre {
  overflow-x: auto;
  padding: 15px;
  border-radius: 8px;
  background: #202328;
  color: #eff2f7;
  font-size: 0.78rem;
  line-height: 1.65;
}

.markdown-body code {
  padding: 0.12em 0.3em;
  border-radius: 4px;
  background: #eeeeeb;
  font-size: 0.86em;
}

.markdown-body pre code {
  padding: 0;
  background: transparent;
}

.markdown-body hr {
  height: 1px;
  margin: 32px 0;
  border: 0;
  background: var(--line);
}

.swipe-hint {
  margin: 23px 0 0;
  color: #999994;
  text-align: center;
  font-size: 0.67rem;
}

.tool-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: grid;
  width: min(100%, 560px);
  height: calc(var(--footer-height) + env(safe-area-inset-bottom));
  grid-template-columns: repeat(3, 1fr);
  margin: 0 auto;
  padding: 6px 8px env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(12px);
}

.tool-button {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #555552;
  font-size: 0.68rem;
  font-weight: 700;
}

.tool-button:active,
.tool-button.is-active,
.tool-button.has-filter {
  background: var(--blue-soft);
  color: var(--blue);
}

.tool-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.tool-backdrop {
  position: fixed;
  z-index: 40;
  inset: 0;
  background: rgb(20 25 35 / 28%);
}

.tool-sheet {
  position: fixed;
  z-index: 50;
  right: 0;
  bottom: calc(var(--footer-height) + env(safe-area-inset-bottom));
  left: 0;
  width: min(100%, 560px);
  max-height: min(70dvh, 520px);
  margin: 0 auto;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.tool-sheet__head {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  padding: 0 17px;
  border-bottom: 1px solid var(--line);
}

.tool-sheet__head h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
}

.tool-sheet__body {
  padding: 18px 17px 22px;
}

.field-label {
  display: block;
  margin: 0 0 7px;
  color: #41413f;
  font-size: 0.74rem;
  font-weight: 800;
}

.field-label + .text-input,
.text-input + .field-label {
  margin-top: 15px;
}

.text-input {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid #cbcbc6;
  border-radius: 8px;
  outline: none;
  background: #fff;
  font-size: 0.9rem;
}

.text-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgb(15 63 156 / 12%);
}

.tool-help {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.65;
}

.search-results {
  display: grid;
  gap: 1px;
  margin: 15px -17px -22px;
  border-top: 1px solid var(--line);
}

.search-result {
  display: grid;
  gap: 4px;
  padding: 13px 17px;
  border-bottom: 1px solid var(--line);
}

.search-result span {
  color: var(--blue);
  font-size: 0.65rem;
  font-weight: 800;
}

.search-result strong {
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.45;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.person-tag {
  min-height: 35px;
  padding: 0 11px;
  border: 1px solid #d8d8d3;
  border-radius: 999px;
  background: #fff;
  color: #575752;
  font-size: 0.76rem;
  font-weight: 700;
}

.person-tag.is-active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.submit-button {
  display: block;
  width: 100%;
  min-height: 47px;
  margin-top: 17px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

@media (min-width: 561px) {
  body {
    padding: 22px 0;
  }

  .app-shell {
    min-height: calc(100dvh - 44px);
    border: 1px solid var(--line);
    border-radius: 14px 14px 0 0;
    box-shadow: 0 6px 28px rgb(20 25 35 / 8%);
  }

  .tool-footer {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    border-right: 1px solid var(--line);
    border-left: 1px solid var(--line);
    border-radius: 0 0 14px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
