* {
  box-sizing: border-box;
}
body {
  margin: 0;
  --ui-accent: #bb512f;
  --ui-accent-hover: #a14425;
  font-size: 14px;
  line-height: 1.6;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--ui-border);
  border-radius: 3px;
  color: var(--ui-text);
  background: white;
  font-weight: 600;
  cursor: pointer;
}
button:hover:not(:disabled) {
  background: #f3f4f6;
  border-color: #adb6c4;
}
button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
a {
  color: inherit;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h2 {
  font-size: 14px;
}
svg.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.icon-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
[hidden] {
  display: none !important;
}
main {
  max-width: 1320px;
  margin: auto;
  padding: 20px 32px 40px;
  min-height: calc(100dvh - 118px);
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 288px;
  align-items: start;
  gap: 20px;
}
.files-panel,
.settings-panel {
  background: white;
  border: 1px solid var(--ui-border);
  border-radius: 3px;
  min-width: 0;
}
.files-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.files-panel > .drop-zone {
  flex: 1;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  border-bottom: 1px solid var(--ui-border);
  gap: 10px;
  min-height: 60px;
}
.panel-heading h2 {
  display: flex;
  align-items: center;
  gap: 9px;
}
.count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef1f4;
  color: #545f73;
  font-size: 12px;
  min-width: 23px;
  height: 22px;
  border-radius: 3px;
  font-weight: 500;
}
.heading-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.small-button {
  min-height: 33px;
  padding: 5px 11px;
  font-size: 12px;
}
.text-button {
  border: 0;
  background: transparent !important;
  color: var(--ui-muted);
  font-size: 12px;
  padding: 5px;
  min-height: 32px;
  font-weight: 400;
}
.text-button:hover:not(:disabled) {
  color: var(--ui-accent);
  text-decoration: underline;
}
.muted {
  color: var(--ui-muted);
  font-size: 12px;
}
.drop-zone {
  margin: 18px;
  border: 1px dashed #c3cad6;
  border-radius: 3px;
  background-color: #f3f4f7;
  background-image: radial-gradient(#d3d9e2 1px, transparent 1.2px);
  background-size: 20px 20px;
  background-position: 10px 10px;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.drop-zone.dragging {
  background: #fff2e8;
  border-color: var(--ui-accent);
  outline: 2px solid #bb512f33;
}
/* With images, the list sits on the shared dot-grid desk. */
.drop-zone.has-files {
  margin: 0;
  border: 0;
  background-color: #f3f4f7;
  background-image: radial-gradient(#d3d9e2 1px, transparent 1.2px);
  background-size: 20px 20px;
  background-position: 10px 10px;
}
.file-art {
  position: relative;
  width: 88px;
  height: 76px;
  margin: 0 auto 26px;
}
.art-back {
  position: absolute;
  width: 61px;
  height: 64px;
  left: 7px;
  top: 2px;
  border: 1px solid #d4c2b5;
  border-radius: 3px;
  background: #f2e8de;
  transform: rotate(-12deg);
}
.art-front {
  position: absolute;
  width: 61px;
  height: 64px;
  left: 20px;
  top: 8px;
  border: 1px solid #d3bbab;
  border-radius: 3px;
  background: #fff9f2;
  display: grid;
  place-items: center;
  transform: rotate(7deg);
}
.art-front svg.icon {
  width: 35px;
  height: 35px;
  color: #b47a57;
  stroke-width: 1.15;
}
.art-plus {
  position: absolute;
  right: -3px;
  bottom: -2px;
  background: var(--ui-accent);
  color: white;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  font-size: 21px;
  display: grid;
  place-items: center;
  line-height: 1;
  border: 3px solid #fcfcfd;
}
#empty {
  text-align: center;
  padding: 72px 16px 64px;
}
.material-picker-button {
  gap: 10px;
}
.sample-bar {
  margin: 0 18px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.sample-thumbs {
  display: flex;
  padding-left: 3px;
}
.sample-thumbs img {
  width: 31px;
  height: 37px;
  object-fit: cover;
  border: 2px solid white;
  border-radius: 2px;
  margin-left: -3px;
}
.sample-thumbs img:first-child {
  transform: rotate(-9deg);
}
.sample-thumbs img:last-child {
  transform: rotate(9deg);
  background: #eee9e3;
}
.settings-panel {
  overflow: hidden;
}
/* Settings: one row per setting, so opening an option adds as little as possible. */
.format-section {
  display: grid;
  gap: 12px;
  padding: 14px 18px;
}
.format-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
}
select {
  width: 100%;
  min-height: 37px;
  padding: 6px 26px 6px 9px;
  border: 1px solid #cdd4dd;
  border-radius: 3px;
  background: white;
  color: var(--ui-text);
  font-size: 12px;
}
.optional-section {
  border-top: 1px solid var(--ui-border);
}
.option-heading {
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 13px 18px;
  font-size: 13px;
  font-weight: 600;
}
.option-heading > input {
  position: absolute;
  right: 16px;
  width: 38px;
  height: 30px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.switch {
  margin-left: auto;
  width: 32px;
  height: 19px;
  background: #cbd1d9;
  border-radius: 12px;
  position: relative;
  flex-shrink: 0;
}
.switch:after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: white;
  transition: transform 0.15s;
}
.option-heading input:checked + .switch {
  background: var(--ui-accent);
}
.option-heading input:checked + .switch:after {
  transform: translateX(13px);
}
.option-heading input:focus-visible + .switch {
  outline: 3px solid var(--ui-accent);
  outline-offset: 4px;
}
.option-body {
  padding: 0 18px 14px;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 13px;
  font-size: 12px;
}
.setting-row select {
  width: 145px;
}
input[type="number"] {
  min-width: 0;
  width: 100%;
  min-height: 35px;
  padding: 6px 8px;
  border: 1px solid #cdd4dd;
  border-radius: 3px;
  color: var(--ui-text);
  background: white;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}
.input-unit {
  display: flex;
  align-items: center;
}
.input-unit input {
  border-radius: 3px 0 0 3px;
  flex: 1;
}
.input-unit select {
  width: 88px;
  min-height: 35px;
  border-left: 0;
  border-radius: 0 3px 3px 0;
}
.input-unit > span {
  font-size: 12px;
  height: 35px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  background: #f7f8fa;
  border: 1px solid #cdd4dd;
  border-left: 0;
  border-radius: 0 3px 3px 0;
  color: var(--ui-muted);
}
/* Width and height read as one row: 幅 [ ] × 高さ [ ]. */
.dimension-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}
.dimension-fields label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--ui-muted);
  white-space: nowrap;
}
.dimension-fields .input-unit {
  flex: 1;
  min-width: 0;
}
/* Tight enough that a five-digit size still shows in the 272px settings column. */
.dimension-fields input {
  padding-inline: 6px;
}
.dimension-fields .input-unit > span {
  padding: 0 5px;
}
.dimension-times {
  font-size: 12px;
  color: #6f7a8c;
  text-align: center;
}
.check-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  margin-top: 11px;
  cursor: pointer;
}
input[type="checkbox"] {
  accent-color: var(--ui-accent);
  width: 14px;
  height: 14px;
  margin: 0;
}
/* Quality: label, slider and number on one row. */
.range-label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 57px;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.range-label input[type="number"] {
  width: 57px;
  min-height: 29px;
  padding: 3px 5px;
  text-align: right;
}
input[type="range"] {
  appearance: none;
  width: 100%;
  height: 4px;
  margin: 0;
  border-radius: 2px;
  background: linear-gradient(
    to right,
    var(--ui-accent) var(--quality-progress, 78%),
    #dce1e8 var(--quality-progress, 78%)
  );
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 0;
  background: var(--ui-accent);
}
input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 0;
  background: var(--ui-accent);
}
input[type="range"]:disabled {
  cursor: default;
}
.inactive {
  opacity: 0.45;
}
.field-note {
  font-size: 12px;
  color: var(--ui-muted);
}
#advanced {
  border-top: 1px solid #edf0f3;
  margin-top: 15px;
  padding-top: 11px;
}
/* Opens like Qraft's settings: the row's chevron at its right turns over. */
#advanced summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--ui-muted);
  list-style: none;
}
#advanced summary::-webkit-details-marker {
  display: none;
}
#advanced summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.2s ease;
}
#advanced[open] summary::after {
  transform: translateY(2px) rotate(225deg);
}
.sub-control {
  margin-top: 10px;
}
.background-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  font-size: 12px;
}
.background-setting > div {
  display: flex;
  align-items: center;
  gap: 5px;
}
.background-setting input {
  width: 23px;
  height: 23px;
  padding: 0;
  border: 1px solid #ddd;
  background: none;
  cursor: pointer;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* The total sits by "save all": the result of the whole batch, in one line. */
.result-actions .size-summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  white-space: nowrap;
}
.result-actions .size-summary[hidden] {
  display: none;
}
.result-actions .size-summary-heading {
  flex: none;
  margin: 0;
  color: var(--ui-muted);
  font-size: 12px;
}
.result-actions .size-comparison {
  display: flex;
  flex: none;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 6px;
  margin: 0;
  color: var(--ui-muted);
  font-size: 12px;
}
.result-actions .size-comparison strong {
  color: var(--ui-text);
  font-size: 16px;
  font-weight: 700;
}
.result-actions .size-change {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
}
#save-all.is-done {
  opacity: 1;
}
.save-file.is-saved {
  border-color: #b9d6c8;
  color: #2f6d55;
}
/* PC: the list keeps room for the fully open settings, so opening them never grows the page. */
@media (min-width: 761px) {
  .workspace {
    align-items: stretch;
  }
  .files-panel {
    min-height: 620px;
  }
}
.settings-panel .panel-heading .reset {
  margin-right: auto;
  margin-left: 4px;
}
.settings-bottom {
  padding: 16px 18px 12px;
  border-top: 1px solid var(--ui-border);
}
.size-summary {
  margin-bottom: 16px;
  font-variant-numeric: tabular-nums;
}
.size-summary-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ui-muted);
  font-size: 12px;
}
.size-comparison {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-top: 5px;
  color: var(--ui-muted);
  font-size: 12px;
}
.size-comparison strong {
  color: var(--ui-text);
  font-size: 22px;
  font-weight: 650;
}
.size-change {
  color: var(--ui-muted);
  font-size: 12px;
  margin-top: 2px;
}
.size-change[data-direction="decrease"] {
  color: #378064;
}
.size-change[data-direction="increase"] {
  color: #8a5d1f;
}
.reset {
  display: flex;
  margin: 5px auto -5px;
  color: #606c80;
  font-size: 12px;
}
.file-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}
.file-card {
  min-width: 0;
  border: 1px solid var(--ui-border);
  border-radius: 3px;
  overflow: hidden;
  background: #fff;
  container-type: inline-size;
}
/* Size meter: the track is the original file, the fill is the output. */
.size-meter {
  height: 4px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 2px;
  background: #edf0f3;
}
.size-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #c5ccd6;
  transform: scaleX(var(--ratio, 1));
  transform-origin: left;
}
.size-meter:not([data-direction]) span {
  transform: scaleX(0);
}
.size-meter[data-direction="decrease"] span {
  background: #378064;
}
.size-meter[data-direction="increase"] span {
  background: #c27a1c;
}
/* A new result: the fill shrinks from the original size to the output (or grows when larger).
   Both ends are explicit so the scale interpolates. */
.size-meter.is-fresh span {
  animation: meter-shrink 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: var(--meter-delay, 0ms);
}
.size-meter.is-fresh[data-direction="increase"] span,
.size-meter.is-fresh[data-direction="same"] span {
  animation-name: meter-grow;
}
@keyframes meter-shrink {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(var(--ratio));
  }
}
@keyframes meter-grow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(var(--ratio));
  }
}
.thumbnail {
  position: relative;
  aspect-ratio: 1 / 1;
  background: repeating-conic-gradient(#eef0f2 0% 25%, #fff 0% 50%) 50% / 14px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.thumbnail > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: absolute;
}
.remove-file {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #fffef9;
  min-height: 27px;
  width: 27px;
  padding: 4px;
  border-color: #dfe2e6;
}
.remove-file .icon {
  width: 13px;
  height: 13px;
}
.format-badge {
  position: absolute;
  bottom: 7px;
  left: 7px;
  padding: 2px 6px;
  background: #ffffffec;
  border: 1px solid #e2e5e9;
  font-size: 12px;
  border-radius: 2px;
}
.file-info {
  padding: 12px;
}
.filename {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dimensions {
  font-size: 12px;
  color: var(--ui-muted);
  margin: 4px 0 10px;
  min-height: 16px;
}
.file-size {
  font-size: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}
.file-size .old-size {
  color: var(--ui-muted);
  font-size: 12px;
}
/* Two lines are kept for the state so a longer message never changes the card height. */
.file-state {
  min-height: calc(2 * 1.5em + 6px);
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
}
.file-status {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--ui-muted);
  min-height: 17px;
}
.file-status .icon {
  width: 12px;
  height: 12px;
}
.file-status.done {
  color: #378064;
}
.file-status.stale,
.file-status.increase {
  color: #8a5d1f;
}
.card-actions {
  display: flex;
  gap: 5px;
  border-top: 1px solid #edf0f3;
  padding: 8px 10px;
}
.card-actions :is(button, a) {
  flex: 1;
  gap: 5px;
  font-size: 12px;
  min-height: 32px;
  padding: 3px 5px;
  white-space: nowrap;
}
@media (max-width: 460px) {
  .card-actions .icon {
    display: none;
  }
}
.card-actions .icon {
  width: 16px;
  height: 16px;
}
/* Narrow cards stack the two buttons, so "ダウンロード済み" keeps its words inside the card. */
@container (max-width: 239px) {
  .card-actions {
    flex-direction: column;
  }
}
.drop-more {
  text-align: center;
  margin: 0 18px 18px;
  padding: 13px;
  border: 1px dashed #dce1e8;
  color: #929ba7;
  font-size: 12px;
  border-radius: 3px;
}
#compare {
  border: 1px solid var(--ui-border);
  border-radius: 3px;
  width: min(960px, calc(100vw - 32px));
  max-height: 90dvh;
  padding: 24px;
  color: var(--ui-text);
}
#compare::backdrop {
  background: #18233488;
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dialog-heading h2 {
  font-size: 18px;
}
.icon-button {
  width: 34px;
  min-height: 34px;
  padding: 5px;
}
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0;
}
.compare-label {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  gap: 5px;
  margin-bottom: 8px;
}
.compare-label span {
  font-weight: 400;
  color: var(--ui-muted);
  font-size: 12px;
}
.compare-image {
  height: 310px;
  border: 1px solid var(--ui-border);
  background: repeating-conic-gradient(#eef0f2 0% 25%, #fff 0% 50%) 50% / 18px 18px;
  display: grid;
  place-items: center;
}
.compare-image img {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.dialog-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  font-size: 12px;
}
.dialog-bottom > span {
  overflow-wrap: anywhere;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  width: max-content;
  background: #273247;
  color: white;
  padding: 12px 20px;
  border-radius: 3px;
  font-size: 12px;
  z-index: 20;
}
.processing .file-status {
  color: var(--ui-accent);
}
@media (max-width: 1050px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 272px;
    gap: 16px;
  }
  .file-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  main {
    padding: 16px 16px 28px;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .file-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 14px;
  }
  #empty {
    padding: 38px 16px;
  }
  .settings-panel {
    grid-row: 2;
  }
  .setting-row select {
    width: 160px;
  }
  .compare-grid {
    grid-template-columns: 1fr;
  }
  .compare-image {
    height: 230px;
  }
  #compare {
    padding: 18px;
  }
}
@media (max-width: 600px) {
  .file-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 460px) {
  .file-info {
    padding: 10px;
  }
  .filename {
    font-size: 12px;
  }
  .file-size {
    font-size: 14px;
  }
  .panel-heading {
    padding-inline: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
  }
}

/* Unsupported browser: a standing notice above the work area (it does not appear on use). */
#browser-error {
  border: 1px solid #ebcfab;
  background: #fff8ed;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 12px;
}
/* Files that could not be read float over the top of the list instead of pushing it down. */
.drop-zone {
  position: relative;
}
#input-errors {
  position: absolute;
  top: 12px;
  right: 12px;
  left: 12px;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 14px;
  border: 1px solid #ebcfab;
  border-left: 3px solid #b0641a;
  border-radius: 3px;
  background: #fffaf2;
  color: #6f430f;
  font-size: 12px;
}
#input-errors[hidden] {
  display: none;
}
#input-errors .text-button {
  flex: none;
  min-height: 24px;
  padding: 0 4px;
  color: #6f430f;
}
.input-errors ul {
  margin: 0;
  padding-left: 18px;
}
.file-error {
  display: -webkit-box;
  overflow: hidden;
  color: #a14425;
  font-size: 12px;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}
.compare-zoom {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 12px;
}
.compare-zoom select {
  width: 160px;
}
.compare-image {
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.compare-image img {
  min-width: 0;
  min-height: 0;
}
.actual-size .compare-image {
  display: block;
}
.actual-size .compare-image img {
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
}

.save-file {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--ui-border);
  border-radius: 3px;
  font-weight: 600;
  text-decoration: none;
}
.save-file:hover {
  background: #f3f4f6;
  border-color: #adb6c4;
}

/* The list heading keeps fixed rows. The total changes length ("計算中…", the saving)
   without wrapping, so a conversion never moves the images below it. */
.files-panel {
  container-type: inline-size;
}
.file-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  grid-template-areas: "title summary save add clear";
  gap: 0 12px;
}
.file-heading > .heading-actions,
.file-heading > .heading-actions > .result-actions:not([hidden]) {
  display: contents;
}
#files-title {
  grid-area: title;
  white-space: nowrap;
}
.file-heading .size-summary {
  grid-area: summary;
  justify-self: end;
  max-width: 100%;
  overflow: hidden;
}
.file-heading .size-change {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
#save-all {
  grid-area: save;
}
#add {
  grid-area: add;
}
#clear {
  grid-area: clear;
}
/* Narrower lists: the buttons stay on the title row and the total takes its own row. */
@container (max-width: 659px) {
  .file-heading {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    grid-template-areas:
      "title save add clear"
      "summary summary summary summary";
    column-gap: 8px;
  }
  .file-heading .size-summary {
    justify-self: start;
    margin-top: 8px;
  }
}
/* Phones: "まとめてダウンロード" takes its own row, so the title keeps its line. */
@container (max-width: 419px) {
  .file-heading {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "title add clear"
      "summary summary summary"
      "save save save";
  }
  #save-all {
    margin-top: 8px;
  }
}
.result-status {
  font-size: 12px;
  color: var(--ui-muted);
}
.result-status strong {
  font-weight: 500;
}
.result-status p {
  font-size: 12px;
}
.result-actions .icon {
  width: 16px;
  height: 16px;
}
#spotlight {
  position: fixed;
  z-index: 30;
  pointer-events: none;
  box-shadow: 0 0 0 9999px #27324766;
  border-radius: 3px;
}
#tour {
  position: fixed;
  z-index: 31;
  width: min(360px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--ui-border);
  border-radius: 3px;
}
#tour-count {
  color: var(--ui-muted);
  font-size: 12px;
}
#tour h2 {
  margin: 8px 0;
  font-size: 18px;
}
#tour-description {
  font-size: 13px;
}
#tour .dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
#tour button {
  font-size: 12px;
}
