/* ツールのページの見た目。色・寸法は tokens.css の変数を使い、読めなくてもライトの配色で崩れないよう既定値を書く。
   ヘッダー・フッター・広告枠は辞書（dictionary-v2 の static/style.css）と同じ形にそろえる */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--color-text, #1f2328);
  background: var(--color-page, #f5f4f0);
  font-family: var(--font-body, sans-serif);
  font-size: var(--font-size-base, 1rem);
  line-height: var(--line-height, 1.85);
}

a {
  color: var(--color-link, #0b5cad);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
.drop:focus-within {
  outline: 3px solid var(--color-link, #0b5cad);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -999px;
}

.skip-link:focus {
  left: var(--space, 1rem);
  top: var(--space, 1rem);
  z-index: 10;
  background: var(--color-bg, #fff);
  padding: 0.5rem;
}

/* ヘッダー・フッター */
.site-header {
  border-bottom: 1px solid var(--color-border, #d0d7de);
  background: var(--color-bg, #fff);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem var(--space, 1rem);
  max-width: 72rem;
  margin: 0 auto;
}

.site-logo {
  font-weight: 700;
  text-decoration: none;
  color: var(--color-text, #1f2328);
}

.site-sister {
  font-size: 0.875rem;
  white-space: nowrap;
}

.site-sister__note {
  color: var(--color-muted, #59636e);
}

.site-footer {
  border-top: 1px solid var(--color-border, #d0d7de);
  padding: var(--space, 1rem);
  font-size: 0.875rem;
  color: var(--color-muted, #59636e);
  text-align: center;
  background: var(--color-bg, #fff);
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.5rem;
  margin: 0 0 0.5rem;
  padding: 0;
  list-style: none;
}

/* 関連サイト（ブログ・辞書・変換ツール）。ブログ・辞書のフッターと同じ形で、縦に1列に並べる */
.site-footer__related {
  margin: 0 0 1rem;
}

.site-footer__related-title {
  margin: 0 0 0.25rem;
  font-weight: bold;
}

.site-footer__related-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 本文 */
.site-main {
  max-width: 48rem;
  margin: 0 auto;
  padding: var(--space, 1rem);
}

.hero__title {
  margin: 0.5rem 0;
  font-size: 1.5rem;
  line-height: 1.4;
}

.hero__lead {
  margin: 0 0 1rem;
}

/* ツール */
.tool {
  padding: 1rem;
  border: 1px solid var(--color-border-soft, #e4e2dc);
  border-radius: var(--radius-card, 10px);
  background: var(--color-bg, #fff);
  box-shadow: var(--shadow-card, none);
}

.drop {
  position: relative;
  border: 2px dashed var(--color-border, #d0d7de);
  border-radius: var(--radius-card, 10px);
  background: var(--color-surface, #f6f8fa);
  text-align: center;
}

.drop.is-over {
  border-color: var(--color-accent, #8a3b12);
  background: var(--color-accent-soft, #f8eee6);
}

.drop.is-disabled {
  opacity: 0.6;
}

.drop__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop__label {
  display: block;
  padding: 2rem 1rem;
  cursor: pointer;
}

.drop__main {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  border-radius: var(--radius, 6px);
  color: var(--color-on-accent, #fff);
  background: var(--color-accent, #8a3b12);
  font-weight: 700;
}

.drop__sub {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-muted, #59636e);
}

.notice {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--color-notice-border, #d97706);
  background: var(--color-notice-bg, #fff4e5);
}

.pages {
  margin-top: 1rem;
}

.pages__head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
}

.pages__title {
  margin: 0;
  font-size: 1rem;
}

.pages__count {
  font-weight: 400;
  color: var(--color-muted, #59636e);
}

.pages__hint {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.875rem;
  color: var(--color-muted, #59636e);
}

.pages__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.page {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem;
  border-bottom: 1px solid var(--color-border-soft, #e4e2dc);
  background: var(--color-bg, #fff);
}

.page.is-dragging {
  opacity: 0.5;
}

.page__num {
  min-width: 1.75rem;
  font-weight: 700;
  text-align: right;
  color: var(--color-muted, #59636e);
}

.page__thumb {
  flex: none;
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--color-surface, #f6f8fa);
}

.page__meta {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  line-height: 1.4;
}

.page__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page__size {
  font-size: 0.8125rem;
  color: var(--color-muted, #59636e);
}

.page__actions {
  display: flex;
  flex: none;
  gap: 0.25rem;
}

.page__button {
  min-width: 2.75rem;
  min-height: 2.75rem;
  border: 1px solid var(--color-border, #d0d7de);
  border-radius: var(--radius, 6px);
  color: var(--color-text, #1f2328);
  background: var(--color-bg, #fff);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

.page__button:disabled {
  opacity: 0.4;
  cursor: default;
}

.settings {
  margin-top: 1rem;
}

.settings__group {
  margin: 0 0 1rem;
  padding: 0.5rem 1rem 0.75rem;
  border: 1px solid var(--color-border-soft, #e4e2dc);
  border-radius: var(--radius, 6px);
}

.settings__group legend {
  padding: 0 0.25rem;
  font-weight: 700;
}

.choice {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.25rem 0;
  cursor: pointer;
}

.field {
  display: block;
  margin-top: 0.5rem;
}

.field__input {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.5rem;
  border: 1px solid var(--color-border, #d0d7de);
  border-radius: var(--radius, 6px);
  color: var(--color-text, #1f2328);
  background: var(--color-bg, #fff);
  font: inherit;
}

.button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius, 6px);
  font: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button--primary {
  width: 100%;
  color: var(--color-on-accent, #fff);
  background: var(--color-accent, #8a3b12);
}

.button--primary:hover {
  background: var(--color-accent-strong, #6b2c0c);
}

.button--primary:disabled {
  opacity: 0.5;
  cursor: default;
}

.button--plain {
  padding: 0.25rem 0.75rem;
  border-color: var(--color-border, #d0d7de);
  color: var(--color-text, #1f2328);
  background: var(--color-bg, #fff);
  font-weight: 400;
  font-size: 0.875rem;
}

.progress {
  margin-top: 1rem;
}

.progress progress {
  width: 100%;
}

.progress__text {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
}

.result {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius-card, 10px);
  background: var(--color-accent-soft, #f8eee6);
}

.result__title {
  margin: 0;
  font-size: 1.125rem;
}

.result__size {
  margin: 0.25rem 0 0.75rem;
  font-size: 1.125rem;
  font-weight: 700;
}

.result__note {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
}

/* 広告枠（辞書と同じ） */
.ad-slot {
  margin: 2rem 0;
  text-align: center;
}

.ad-slot__label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  color: var(--color-muted, #59636e);
}

.ad-slot__frame {
  max-width: 100%;
  min-height: 250px;
  overflow: hidden;
}

/* ヘッダー直下のバナー（SP 320×100・PC 728×90）。読み込み前から高さを取り、本文がずれないようにする */
.ad-slot--top {
  margin: 0.75rem auto 0;
  padding: 0 var(--space, 1rem);
  max-width: 72rem;
}

.ad-slot--top .ad-slot__frame {
  min-height: 100px;
}

@media (min-width: 48rem) {
  .ad-slot--top .ad-slot__frame {
    min-height: 90px;
  }
}

/* 解説 */
.guide {
  margin-top: 2rem;
  padding: 1rem;
  border-radius: var(--radius-card, 10px);
  background: var(--color-bg, #fff);
}

.guide h2 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.25rem;
  line-height: 1.5;
}

.guide h2:first-child {
  margin-top: 0;
}

.guide__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.guide__table th,
.guide__table td {
  padding: 0.5rem;
  border: 1px solid var(--color-border, #d0d7de);
  text-align: left;
}

.guide__table thead th {
  background: var(--color-surface, #f6f8fa);
}

.guide__faq dt {
  margin-top: 1rem;
  font-weight: 700;
}

.guide__faq dd {
  margin: 0.25rem 0 0;
}

@media (min-width: 48em) {
  .site-main {
    padding: 1.5rem var(--space, 1rem);
  }

  .hero__title {
    font-size: 1.875rem;
  }

  .tool,
  .guide {
    padding: 1.5rem;
  }

  .button--primary {
    width: auto;
    min-width: 16rem;
  }
}
