:root {
  --bg: #f6f7f9; --card: #ffffff; --text: #1c2330; --sub: #5b6678; --line: #dfe3ea;
  --accent: #2563eb; --accent-text: #ffffff; --ok: #15803d; --warn: #b45309; --err: #b91c1c; --over: #eaf1ff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12161d; --card: #1a202a; --text: #e8ecf3; --sub: #9aa6b8; --line: #2c3544;
    --accent: #5b8def; --accent-text: #0b1220; --ok: #4ade80; --warn: #fbbf24; --err: #f87171; --over: #1d2a44;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.75 system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", "Meiryo", "Segoe UI", sans-serif;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 16px; }
.topbar { display: flex; justify-content: flex-end; font-size: 14px; }
.topbar a { color: var(--sub); }
h1 { font-size: clamp(22px, 5vw, 30px); line-height: 1.35; margin: 8px 0 12px; }
h2 { font-size: 20px; line-height: 1.4; margin: 36px 0 10px; padding-left: 10px; border-left: 4px solid var(--accent); }
.lead { color: var(--sub); margin: 0 0 20px; }
a { color: var(--accent); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }

#hc-drop {
  display: block; text-align: center; cursor: pointer; padding: 34px 14px;
  border: 2px dashed var(--line); border-radius: 12px; transition: background .15s, border-color .15s;
}
#hc-drop:hover, #hc-drop:focus-within, #hc-drop.hc-over { background: var(--over); border-color: var(--accent); }
#hc-drop strong { display: block; font-size: 18px; }
#hc-drop span { color: var(--sub); font-size: 14px; }
#hc-file { position: absolute; width: 1px; height: 1px; opacity: 0; }
#hc-drop:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }

.hc-opts { margin: 18px 0 4px; display: grid; gap: 14px; }
.hc-opts fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 12px; margin: 0; }
.hc-opts legend { font-weight: 700; font-size: 14px; padding: 0 6px; }
.hc-radio { display: block; padding: 6px 0; cursor: pointer; }
.hc-radio small { display: block; color: var(--sub); font-size: 13px; line-height: 1.5; margin-left: 24px; }
.hc-radio input { margin-right: 8px; accent-color: var(--accent); }
.hc-q { display: flex; align-items: center; gap: 12px; }
.hc-q input[type=range] { flex: 1; accent-color: var(--accent); }
.hc-q output { min-width: 2.5em; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.hc-note { font-size: 13px; color: var(--sub); margin: 8px 0 0; line-height: 1.6; }

.hc-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; min-height: 40px; }
.hc-btn {
  appearance: none; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text);
  border-radius: 9px; padding: 8px 16px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
  display: inline-block; line-height: 1.4;
}
.hc-btn.sub { background: transparent; color: var(--accent); }
.hc-btn[hidden], .hc-thumb[hidden] { display: none; }
#hc-status { color: var(--sub); font-size: 14px; margin-left: auto; }
#hc-loadmsg { color: var(--sub); font-size: 13px; min-height: 1.4em; margin-top: 6px; }

#hc-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.hc-item { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.hc-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: var(--line); flex: none; }
.hc-body { flex: 1; min-width: 0; font-size: 14px; line-height: 1.55; }
.hc-name { font-weight: 700; overflow-wrap: anywhere; }
.hc-state { color: var(--sub); }
.hc-state.hc-ok { color: var(--ok); }
.hc-state.hc-err { color: var(--err); }
.hc-meta { color: var(--sub); }
.hc-meta.hc-warn { color: var(--warn); font-weight: 700; }
.hc-exif { color: var(--sub); font-size: 13px; overflow-wrap: anywhere; }
.hc-save { flex: none; }

/* ad slots: size is reserved up front so the page does not jump when the ad loads */
.ad { margin: 30px 0; text-align: center; }
.ad small { display: block; color: var(--sub); font-size: 11px; margin-bottom: 4px; }
.ad-inner { max-width: 100%; min-height: 100px; margin: 0 auto; overflow: hidden; }
.ad-fit { flex: none; width: max-content; max-width: none; transform-origin: top center; }
.ad-inner { display: flex; justify-content: center; }
@media (max-width: 767px) { .ad-inner { min-height: 250px; } }

/* PC only: tall ads in the empty space left and right of the content */
.ad-side { display: none; }
@media (min-width: 1120px) {
  .has-side-ads .ad-side { display: block; position: fixed; top: 90px; width: 160px; min-height: 600px; overflow: hidden; }
  .has-side-ads .ad-left  { left:  calc(50% - 380px - 176px); }
  .has-side-ads .ad-right { left:  calc(50% + 380px + 16px); }
}

/* flashy link to the blog top page */
.blog-link {
  display: block; position: relative; overflow: hidden; margin: 32px 0; padding: 22px 20px; text-align: center;
  text-decoration: none; color: #fff; border-radius: 16px; font-weight: 800; line-height: 1.4;
  background: linear-gradient(120deg, #ff3d81, #ff8a00, #ffd400, #19d3a2, #2563eb, #9b5cff, #ff3d81);
  background-size: 300% 300%; animation: blog-flow 6s linear infinite;
  box-shadow: 0 6px 22px rgba(255, 61, 129, .35); transition: transform .15s, box-shadow .15s;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
}
.blog-link:hover, .blog-link:focus-visible { transform: translateY(-2px) scale(1.015); box-shadow: 0 10px 30px rgba(155, 92, 255, .5); }
.blog-link:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }
.blog-link .bl-small { display: block; font-size: 13px; font-weight: 700; letter-spacing: .08em; opacity: .95; }
.blog-link .bl-main { display: block; font-size: clamp(20px, 5vw, 28px); margin: 4px 0; }
.blog-link .bl-sub { display: block; font-size: 14px; font-weight: 600; }
.blog-link .bl-arrow { display: inline-block; animation: blog-nudge 1.2s ease-in-out infinite; }
.blog-link::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-20deg); animation: blog-shine 3.2s ease-in-out infinite;
}
@keyframes blog-flow { 0% { background-position: 0% 50%; } 100% { background-position: 300% 50%; } }
@keyframes blog-nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(7px); } }
@keyframes blog-shine { 0% { left: -60%; } 55%, 100% { left: 130%; } }
@media (prefers-reduced-motion: reduce) {
  .blog-link, .blog-link::after, .blog-link .bl-arrow { animation: none; }
}
.topbar { gap: 16px; }

.article ul, .article ol { padding-left: 1.4em; }
.article li { margin: 4px 0; }
details { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 10px 0; background: var(--card); }
summary { cursor: pointer; font-weight: 700; }
details p { margin: 8px 0 2px; color: var(--sub); }
footer { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--sub); }
.sr { position: absolute; left: -9999px; }
#hc-drop strong { font-size: clamp(15px, 4.4vw, 18px); text-wrap: balance; }
