:root {
  color-scheme: light;
  --text: #202124;
  --muted: #5f6368;
  --border: #dadce0;
  --surface: #f8f9fa;
  --blue: #0b57d0;
  --blue-hover: #0846ac;
  --blue-light: #eef4ff;
  --warning: #9b391d;
  --success: #146339;
  color: var(--text);
  background: #fff;
  font: 16px/1.6 Roboto, 'Noto Sans JP', 'Yu Gothic', Meiryo, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p, dl, dd { margin: 0; }
button, input, select { font: inherit; }
button, summary { cursor: pointer; }
a { color: var(--blue); text-underline-offset: 0.18em; }
a:hover { color: var(--blue-hover); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.wrap { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--border); }
.masthead {
  min-height: 64px;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
}
.brand {
  color: var(--text);
  font-size: 20px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--text); }
.nav { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; }
.nav a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.nav a:hover, .nav a[aria-current='page'] { color: var(--blue); text-decoration: underline; }

.page-heading { margin: 44px 0 24px; }
h1 { font-size: clamp(26px, 4vw, 34px); font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.page-heading p { margin-top: 6px; color: var(--muted); font-size: 15px; }
h2 { font-size: 18px; font-weight: 600; line-height: 1.45; }
h3 { font-size: 16px; font-weight: 600; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  min-height: 264px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.work-panel { min-width: 0; padding: 22px 24px; }
.work-panel + .work-panel { border-left: 1px solid var(--border); }
.work-panel > h2 { margin-bottom: 16px; }
.upload {
  display: grid;
  gap: 10px;
  padding: 18px 16px;
  border: 1px dashed #b6bbc2;
  border-radius: 5px;
  background: var(--surface);
}
.upload.is-over { border-color: var(--blue); background: var(--blue-light); }
.upload-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.upload p, .file-details { color: var(--muted); font-size: 13px; }
.file-details { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
#file-note { overflow-wrap: anywhere; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 7px 15px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #fff;
  background: var(--blue);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.button:hover { color: #fff; background: var(--blue-hover); }
.file-button { position: relative; cursor: pointer; }
.file-button:focus-within { outline: 2px solid var(--blue); outline-offset: 3px; }
.text-button { color: var(--blue); background: transparent; }
.text-button:hover { color: var(--blue-hover); background: var(--blue-light); }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.settings { margin-top: 15px; border-top: 1px solid #e8eaed; }
summary { width: fit-content; padding: 10px 2px; color: var(--blue); font-size: 14px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 16px; padding-top: 3px; }
.fields label { min-width: 0; color: var(--muted); font-size: 13px; }
select {
  display: block;
  width: 100%;
  min-height: 38px;
  margin-top: 4px;
  padding: 4px 8px;
  border: 1px solid #aeb4bb;
  border-radius: 4px;
  color: var(--text);
  background: #fff;
  font-size: 14px;
}
select:disabled { border-color: var(--border); color: var(--muted); background: var(--surface); }

.status { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.status.warning { color: var(--warning); }
.status.good { color: var(--success); }
.stats { display: flex; flex-wrap: wrap; gap: 0 28px; margin: 14px 0; }
.stat { display: flex; align-items: baseline; gap: 8px; }
.stat dt { color: var(--muted); font-size: 13px; }
.stat dd { font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 10px; border-bottom: 1px solid #e8eaed; text-align: left; vertical-align: top; }
th { white-space: nowrap; color: var(--muted); background: var(--surface); font-weight: 600; }
td { overflow-wrap: anywhere; }
td:nth-child(-n+2) { font-variant-numeric: tabular-nums; white-space: nowrap; }

.privacy-note { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 12px 0 24px; color: var(--muted); font-size: 13px; }
.home-notes { margin-bottom: 40px; }
.requirements { border-top: 1px solid #e8eaed; }
.requirements p { max-width: 68ch; margin: 0 0 8px 14px; color: var(--muted); font-size: 14px; }
.offline-offer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding-top: 14px; border-top: 1px solid #e8eaed; }
.offline-offer p { margin-top: 3px; color: var(--muted); font-size: 14px; }

.prose { width: min(768px, calc(100% - 64px)); margin: 44px auto 0; }
.prose section { margin-top: 28px; }
.prose h1 + p, .prose h2 + p, .prose h3 + p, .prose p + p { margin-top: 9px; }
.prose h3 { margin-top: 20px; }
.prose code { border-radius: 3px; padding: 0.08em 0.24em; background: var(--surface); overflow-wrap: anywhere; }
pre { padding: 14px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); overflow-x: auto; }
.site-footer { margin-top: 44px; border-top: 1px solid var(--border); color: var(--muted); }
.foot-inner { display: flex; flex-wrap: wrap; gap: 8px 20px; padding-block: 16px; font-size: 13px; }
.site-footer a { color: var(--muted); }
.ad-block { margin: 28px 0; text-align: center; color: var(--muted); font-size: 12px; }

.encoding-workspace { grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.45fr); }
.encoding-workspace .privacy-note { margin-bottom: 0; }
.encoding-summary { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 12px 0; padding: 0; list-style: none; color: var(--muted); font-size: 13px; }
.encoding-check td:nth-child(-n+2) { white-space: normal; }
.encoding-check td:first-child { width: 36%; }
.encoding-check td:nth-child(2) { width: 28%; }
.encoding-notes { margin-top: 24px; }
.count-workspace { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.count-input-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.count-input-heading button:disabled { color: var(--muted); background: transparent; cursor: default; opacity: 0.55; }
.count-workspace textarea { display: block; width: 100%; min-height: 170px; padding: 12px; resize: vertical; border: 1px solid var(--border); border-radius: 5px; color: var(--text); font: inherit; }
.count-results > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #e8eaed; }
.count-results dt { color: var(--muted); font-size: 14px; }
.count-results dd { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.count-results + .status { margin-top: 12px; }

@media (max-width: 760px) {
  .wrap, .prose { width: calc(100% - 36px); }
  .masthead { padding-inline: 18px; }
  .page-heading, .prose { margin-top: 28px; }
  .workspace { grid-template-columns: 1fr; }
  .work-panel { padding: 18px; }
  .work-panel + .work-panel { border-top: 1px solid var(--border); border-left: 0; }
  .result { min-height: 94px; }
}

@media (max-width: 430px) {
  .masthead { min-height: 56px; flex-wrap: wrap; gap: 3px 14px; padding-block: 9px; }
  .brand { font-size: 17px; }
  .nav { gap: 5px 13px; font-size: 13px; }
  .upload { padding: 12px; }
  .upload-actions { gap: 4px; }
  .file-details { flex-wrap: wrap; }
}
