
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #ffffff;
  color: #252525;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Noto Sans JP",
    sans-serif;
  font-size: 14px;
}

.container {
  width: min(100% - 36px, 620px);
  margin: 65px auto;
}

header {
  text-align: center;
  margin-bottom: 35px;
}

h1 {
  font-size: 27px;
  margin-bottom: 8px;
}

header p {
  color: #888;
  font-size: 13px;
}

.privacy {
  display: inline-block;
  margin-top: 10px;
  padding: 7px 12px;
  border-radius: 30px;
  background: #f0f7f2;
  color: #38815b;
  font-size: 12px;
}

.upload-area {
  border: 1.5px dashed #d7d7d7;
  border-radius: 13px;
  padding: 35px 15px;
  text-align: center;
  transition: .2s;
}

.upload-area.dragover {
  background: #f7f7f7;
  border-color: #555;
}

.upload-icon {
  font-size: 28px;
  color: #777;
  margin-bottom: 10px;
}

.upload-area p,
.upload-area small {
  color: #888;
  font-size: 12px;
}

#fileInput {
  display: none;
}

.select-button {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 20px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  cursor: pointer;
}

#selectedInfo {
  margin-top: 10px;
  color: #888;
  font-size: 12px;
  text-align: center;
}

.section {
  margin-top: 28px;
}

h2 {
  font-size: 14px;
  margin-bottom: 12px;
}

.mode-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mode-card {
  display: block;
  padding: 16px;
  border: 1px solid #e7e7e7;
  border-radius: 12px;
  cursor: pointer;
}

.mode-card:has(input:checked) {
  border-color: #555;
  background: #fafafa;
}

.mode-card input {
  accent-color: #333;
}

.mode-card strong,
.mode-card span {
  display: block;
  margin-top: 8px;
}

.mode-card span {
  font-size: 11px;
  color: #777;
}

.mode-card p {
  font-size: 11px;
  color: #888;
  margin: 7px 0 0;
}

.settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.settings label {
  display: block;
  font-size: 12px;
  color: #777;
  margin-bottom: 8px;
}

select {
  width: 100%;
  padding: 11px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: white;
}

.quality-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.quality-controls input {
  width: 100%;
  accent-color: #333;
}

#qualityValue {
  font-size: 11px;
  color: #888;
}

#compressButton {
  width: 100%;
  margin-top: 28px;
  padding: 15px;
  background: #252525;
  color: white;
  border: none;
  border-radius: 9px;
  font-weight: bold;
  cursor: pointer;
}

#compressButton:disabled {
  opacity: .4;
  cursor: not-allowed;
}

#status {
  text-align: center;
  color: #888;
  font-size: 12px;
  margin-top: 12px;
}

.results {
  display: none;
  margin-top: 35px;
}

.result-card {
  padding: 14px;
  margin-top: 10px;
  border: 1px solid #e8e8e8;
  border-radius: 11px;
}

.result-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.result-thumb {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 7px;
}

.result-info {
  flex: 1;
  min-width: 0;
}

.result-name {
  font-weight: bold;
  overflow-wrap: anywhere;
}

.result-size {
  color: #888;
  font-size: 11px;
  margin-top: 5px;
}

.result-success {
  color: #38815b;
  font-size: 11px;
  margin-top: 4px;
}

.download-button {
  padding: 8px 12px;
  background: white;
  border: 1px solid #e5e5e5;
  border-radius: 7px;
  cursor: pointer;
}

.compare {
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid #eee;
}

.compare summary {
  color: #777;
  font-size: 12px;
  cursor: pointer;
}

.compare-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.compare-images img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #f7f7f7;
  border-radius: 7px;
}

.compare-images small {
  display: block;
  margin-bottom: 5px;
  color: #888;
}

@media (max-width: 520px) {
  .container {
    margin: 38px auto;
  }

  h1 {
    font-size: 23px;
  }

  .mode-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings {
    grid-template-columns: 1fr;
  }
}

/* 選択した画像の一覧 */
.selected-files {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.selected-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
}

.selected-thumb {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 6px;
  background: #f5f5f5;
  flex-shrink: 0;
}

.selected-file-info {
  flex: 1;
  min-width: 0;
}

.selected-file-name {
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.selected-file-size {
  font-size: 11px;
  color: #888;
  margin-top: 4px;
}

.remove-file {
  border: none;
  background: #f4f4f4;
  border-radius: 6px;
  padding: 7px 10px;
  color: #777;
  cursor: pointer;
  flex-shrink: 0;
}

.remove-file:hover {
  background: #eaeaea;
}
