:root {
  color-scheme: light;
  --ink: #201f1b;
  --muted: #6c685f;
  --paper: #fffdf7;
  --cream: #f7f1df;
  --yellow: #f5bd35;
  --yellow-dark: #d99808;
  --coral: #ef725f;
  --blue: #8fc8d8;
  --green: #2f7b62;
  --line: #d9d1bf;
  --shadow: 0 24px 70px rgba(54, 43, 18, .12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 10%, rgba(245,189,53,.18), transparent 24rem),
    linear-gradient(180deg, #fffefa 0%, var(--paper) 52%, #f8f2e4 100%);
  font-family: "Yu Gothic", "Hiragino Sans", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

button, select, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.site-header {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px 14px 18px 18px; background: var(--ink); color: var(--yellow); font-weight: 900; transform: rotate(-3deg); }
.brand strong, .brand small { display: block; line-height: 1.15; }
.brand strong { font-size: 1rem; letter-spacing: .04em; }
.brand small { margin-top: 4px; color: var(--muted); font: 700 .7rem/1 system-ui, sans-serif; letter-spacing: .16em; text-transform: uppercase; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.privacy-pill { padding: 8px 13px; border: 1px solid #bcd8ce; border-radius: 999px; background: #eff9f4; color: var(--green); font-size: .82rem; font-weight: 700; }
.privacy-pill > span:first-child { font-size: .55rem; vertical-align: 2px; }
.language-button { min-width: 44px; height: 40px; display: grid; place-items: center; padding: 0 10px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--ink); cursor: pointer; font-weight: 800; text-decoration: none; }

main { width: min(1100px, calc(100% - 40px)); margin: 0 auto; }
.intro { min-height: 300px; display: grid; grid-template-columns: 1fr 300px; align-items: center; gap: 32px; padding: 34px 34px 14px; }
.eyebrow { margin: 0 0 10px; color: var(--yellow-dark); font-size: .78rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
h1 { max-width: 720px; margin: 0; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: clamp(2.3rem, 5vw, 4.8rem); line-height: 1.13; letter-spacing: -.035em; }
.intro-copy { max-width: 690px; margin: 22px 0 0; color: var(--muted); font-size: 1.03rem; }
.cat-mascot { width: 100%; height: auto; align-self: end; filter: drop-shadow(0 16px 22px rgba(49,39,18,.14)); }

.tool-shell { position: relative; padding: 18px; border: 1px solid var(--line); border-radius: 30px; background: rgba(255,255,255,.88); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.drop-zone { min-height: 390px; padding: 44px 24px; display: flex; flex-direction: column; justify-content: center; align-items: center; border: 2px dashed #cabf9f; border-radius: 20px; background: linear-gradient(135deg, #fffdf5, #fbf4df); text-align: center; transition: .2s ease; }
.drop-zone.is-dragging { border-color: var(--yellow-dark); background: #fff6cf; transform: scale(.995); }
.drop-icon { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 24px; background: var(--yellow); transform: rotate(-3deg); }
.drop-icon svg { width: 40px; fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.drop-zone h2 { margin: 22px 0 4px; font-size: 1.5rem; }
.drop-zone p { margin: 0; color: var(--muted); }
.drop-zone small { margin-top: 12px; color: var(--muted); }
.primary-button, .compress-button, .download-button, .download-all-button, .secondary-button, .mini-download { border-radius: 14px; font-weight: 800; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.primary-button { margin-top: 22px; padding: 13px 26px; border: 0; background: var(--ink); color: white; box-shadow: 0 8px 0 #000; }
.primary-button:hover, .compress-button:hover, .download-button:hover, .download-all-button:hover, .mini-download:hover { transform: translateY(-2px); }
.primary-button:active, .compress-button:active, .download-button:active, .download-all-button:active, .mini-download:active { transform: translateY(2px); box-shadow: none; }
.pick-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.pick-actions .primary-button { margin-top: 0; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: 28px; padding: 16px; }
.batch-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.batch-heading strong, .batch-heading span { display: block; }
.batch-heading span { color: var(--muted); font-size: .86rem; }
.file-list { display: grid; gap: 10px; max-height: 520px; overflow: auto; padding-right: 4px; }
.file-card { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 10px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.file-thumb { width: 72px; height: 58px; display: grid; place-items: center; overflow: hidden; border-radius: 10px; background: #ece7da; color: var(--green); font-size: .75rem; font-weight: 900; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-thumb.is-heic { border: 1px dashed #8db6a7; background: #eff9f4; }
.file-info { min-width: 0; }
.file-info strong, .file-info span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-info span { color: var(--muted); font-size: .82rem; }
.remove-button { padding: 7px 9px; border: 0; background: transparent; color: #a13b2b; font-weight: 800; cursor: pointer; }
.preview-frame { min-height: 440px; display: grid; place-items: center; overflow: hidden; border-radius: 18px; background-color: #e7e3da; background-image: linear-gradient(45deg,#d7d3ca 25%,transparent 25%),linear-gradient(-45deg,#d7d3ca 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#d7d3ca 75%),linear-gradient(-45deg,transparent 75%,#d7d3ca 75%); background-size: 24px 24px; background-position: 0 0,0 12px,12px -12px,-12px 0; }
.preview-frame img { display: block; max-width: 100%; max-height: 500px; object-fit: contain; }
.file-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 4px 0; }
.file-row strong, .file-row span { display: block; max-width: 480px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row span { color: var(--muted); font-size: .86rem; }
.text-button { padding: 8px; border: 0; background: transparent; color: var(--green); font-weight: 800; cursor: pointer; white-space: nowrap; }
.controls-panel { align-self: center; padding: 26px; border-radius: 22px; background: var(--cream); }
.control-group + .control-group { margin-top: 30px; }
.control-group > label, .control-heading label { display: block; font-weight: 900; }
.control-heading { display: flex; justify-content: space-between; align-items: center; }
.control-heading output { padding: 3px 9px; border-radius: 8px; background: white; font-weight: 900; }
input[type="range"] { width: 100%; margin: 17px 0 2px; accent-color: var(--coral); }
.range-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: .78rem; }
select { width: 100%; margin-top: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: white; color: var(--ink); }
.field-note { margin: 8px 0 0; color: var(--muted); font-size: .82rem; }
.compress-button { width: 100%; margin-top: 34px; padding: 15px 18px; display: flex; justify-content: space-between; border: 0; background: var(--yellow); color: var(--ink); box-shadow: 0 8px 0 #c98b00; }
.compress-button:disabled { opacity: .65; cursor: progress; }
.status-message { min-height: 1.5em; margin: 16px 0 0; color: #a13b2b; font-size: .88rem; }
.progress-track { height: 8px; margin-top: 18px; overflow: hidden; border-radius: 999px; background: #e2d8be; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--coral); transition: width .2s ease; }

.result { padding: clamp(24px, 5vw, 54px); border-radius: 20px; background: linear-gradient(135deg, #f8f2df 0 58%, #fff 58%); }
.result-topline { display: flex; justify-content: space-between; align-items: start; gap: 24px; }
.result h2 { margin: 0; font: 700 clamp(1.7rem, 4vw, 3rem)/1.2 "Yu Mincho", serif; }
.result-header-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }
.saving-badge { flex: 0 0 auto; padding: 9px 14px; border-radius: 999px; background: var(--green); color: white; font-weight: 900; }
.download-all-button { padding: 10px 16px; border: 0; background: var(--ink); color: white; box-shadow: 0 5px 0 #000; white-space: nowrap; }
.download-all-button:disabled { opacity: .65; cursor: progress; transform: none; }
.size-comparison { margin: 38px 0 32px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.size-comparison > div { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.size-comparison span, .size-comparison strong { display: block; }
.size-comparison span { color: var(--muted); font-size: .82rem; }
.size-comparison strong { margin-top: 4px; font-size: clamp(1.4rem, 3vw, 2.4rem); }
.paw-arrow { font-size: 1.5rem; transform: rotate(18deg); }
.result-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.download-button { padding: 14px 22px; background: var(--ink); color: white; box-shadow: 0 7px 0 #000; text-decoration: none; }
.secondary-button { padding: 14px 22px; border: 1px solid var(--line); background: white; color: var(--ink); }
.sound-note { margin: 26px 0 0; color: var(--muted); font-size: .85rem; }
.result-list { display: grid; gap: 10px; margin: 34px 0 24px; }
.result-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.result-card strong, .result-card span { display: block; }
.result-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-card span { color: var(--muted); font-size: .83rem; }
.result-card.has-error { border-color: #e2aaa1; background: #fff5f3; }
.mini-download { padding: 9px 16px; background: var(--ink); color: white; text-decoration: none; box-shadow: 0 5px 0 #000; }
.iphone-help { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 18px; }
.iphone-help summary { cursor: pointer; color: var(--green); font-weight: 800; }
.iphone-help p { margin: 8px 0 0; color: var(--muted); font-size: .88rem; }

.trust-strip { margin: 28px 0 60px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.trust-strip div { padding: 24px; }
.trust-strip div + div { border-left: 1px solid var(--line); }
.trust-strip strong, .trust-strip span { display: block; }
.trust-strip strong { font-size: 1rem; }
.trust-strip span { color: var(--muted); font-size: .84rem; }
footer { width: min(1100px, calc(100% - 40px)); margin: 0 auto; padding: 24px 0 40px; display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: .82rem; }
footer a { margin-left: 8px; color: var(--green); }
footer p { margin: 0 0 5px; }
footer nav { max-width: 620px; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px 16px; }
footer nav a { margin: 0; }

.ad-wrap { width: min(1100px, calc(100% - 40px)); margin: 22px auto; }
.ad-wrap-header { margin-top: 0; margin-bottom: 14px; }
.ad-slot { min-height: 42px; display: grid; place-items: center; border: 1px dashed #d8d0bd; border-radius: 12px; background: rgba(255,255,255,.55); color: #9a9386; font: 700 .72rem/1 system-ui, sans-serif; letter-spacing: .08em; }
.ad-slot[hidden] { display: none; }

#toolInformation { margin: 10px 0 72px; }
.info-intro { margin: 0 0 24px; padding: 22px 24px; border-left: 5px solid var(--yellow); border-radius: 0 16px 16px 0; background: #fff; }
.info-intro p { margin: 0; font-weight: 700; }
.info-intro span { display: inline-block; margin-top: 8px; color: var(--green); font-size: .86rem; font-weight: 800; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.info-card { margin-top: 18px; padding: clamp(22px, 4vw, 34px); border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.85); }
.info-card h2, .related-tools h2 { margin: 0 0 18px; font: 700 clamp(1.35rem, 3vw, 1.85rem)/1.25 "Yu Mincho", serif; }
.info-card ol { margin: 0; padding-left: 1.4em; }
.info-card li + li { margin-top: 10px; }
.spec-list { margin: 0; }
.spec-list div { display: grid; grid-template-columns: 9em 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid #ece5d5; }
.spec-list div:last-child { border-bottom: 0; }
.spec-list dt { font-weight: 900; }
.spec-list dd { margin: 0; color: var(--muted); }
.faq-list details { padding: 15px 0; border-top: 1px solid #e6dfcf; }
.faq-list details:last-child { border-bottom: 1px solid #e6dfcf; }
.faq-list summary { cursor: pointer; font-weight: 900; }
.faq-list p { margin: 10px 0 0; color: var(--muted); }
.related-tools { margin-top: 46px; }
.section-heading p { margin: 0 0 4px; color: var(--yellow-dark); font-size: .75rem; font-weight: 900; letter-spacing: .15em; }
.related-tool-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.related-tool-card { min-height: 110px; display: flex; flex-direction: column; justify-content: space-between; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.related-tool-card span { color: var(--muted); font-size: .78rem; }

.info-page main { min-height: 65vh; }
.breadcrumb { display: flex; gap: 8px; margin: 20px 0; color: var(--muted); font-size: .84rem; }
.breadcrumb a { color: var(--green); }
.policy-shell { max-width: 850px; margin: 0 auto 70px; padding: clamp(28px, 6vw, 64px); border: 1px solid var(--line); border-radius: 26px; background: rgba(255,255,255,.9); box-shadow: var(--shadow); }
.policy-shell h1 { font-size: clamp(2rem, 5vw, 3.7rem); }
.policy-lead { margin: 20px 0 38px; color: var(--muted); font-size: 1.04rem; }
.policy-section { padding: 24px 0; border-top: 1px solid var(--line); }
.policy-section h2 { margin: 0 0 10px; font-size: 1.25rem; }
.policy-section p { margin: 0; color: var(--muted); }
.report-card { padding-top: 26px; border-top: 1px solid var(--line); }
.report-card form { display: grid; gap: 18px; margin-top: 24px; }
.report-card label { display: grid; gap: 7px; font-weight: 900; }
.report-card input, .report-card textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.report-card textarea { min-height: 110px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.report-submit { justify-self: start; margin-top: 4px; }

button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

@media (max-width: 760px) {
  .site-header, main, footer { width: min(100% - 24px, 1100px); }
  .privacy-pill { display: none; }
  .intro { min-height: auto; grid-template-columns: 1fr 110px; gap: 8px; padding: 30px 8px 18px; }
  .intro-copy { grid-column: 1 / -1; margin-top: 14px; }
  h1 { font-size: clamp(2.1rem, 10vw, 3.4rem); }
  .cat-mascot { align-self: center; }
  .tool-shell { padding: 9px; border-radius: 22px; }
  .drop-zone { min-height: 360px; padding: 34px 18px; }
  .workspace { grid-template-columns: 1fr; padding: 4px; gap: 16px; }
  .file-list { max-height: none; }
  .file-card { grid-template-columns: 58px minmax(0, 1fr) auto; gap: 9px; }
  .file-thumb { width: 58px; height: 50px; }
  .preview-frame { min-height: 280px; }
  .controls-panel { padding: 22px 18px; }
  .result { background: var(--cream); }
  .result-topline { display: block; }
  .result-header-actions { margin-top: 18px; justify-content: space-between; }
  .size-comparison { grid-template-columns: 1fr; gap: 10px; }
  .paw-arrow { text-align: center; transform: rotate(90deg); }
  .result-actions { display: grid; }
  .download-button, .secondary-button { text-align: center; }
  .result-card { grid-template-columns: minmax(0, 1fr); }
  .mini-download { text-align: center; }
  .trust-strip { grid-template-columns: 1fr; }
  .trust-strip div + div { border-left: 0; border-top: 1px solid var(--line); }
  footer { display: block; }
  footer nav { justify-content: flex-start; margin-top: 18px; }
  .ad-wrap { width: min(100% - 24px, 1100px); margin-top: 14px; margin-bottom: 14px; }
  .ad-slot { min-height: 36px; }
  .info-grid, .related-tool-grid, .form-grid { grid-template-columns: 1fr; }
  .spec-list div { grid-template-columns: 1fr; gap: 2px; }
  .policy-shell { border-radius: 20px; }
}

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