﻿:root {
  color-scheme: light;
  --ink: #202428;
  --muted: #626d76;
  --line: #dce1e4;
  --panel: #ffffff;
  --paper: #f7f6f2;
  --accent: #ff1010;
  --neon-red: #ff174f;
  --ok: #12784e;
  --caution: #b36b00;
  --low: #b54125;
  --bad: #bb1232;
  --shadow: 0 18px 44px rgba(30, 36, 42, 0.12);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  overflow-y: auto;
  font-family: "Noto Sans JP", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(620px, 1fr) 336px;
  gap: 24px;
  width: min(1360px, calc(100vw - 32px));
  min-height: min(820px, calc(100vh - 32px));
  min-height: 680px;
  margin: 16px auto;
}

.app-shell::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(100% - 336px - 12px);
  width: 1px;
  background: rgba(32, 36, 40, 0.16);
}

.preview-pane {
  display: grid;
  grid-template-rows: 28px auto auto;
  gap: 10px;
  min-width: 0;
  align-self: start;
  width: 100%;
  padding-right: 24px;
  border-right: 0;
}

.stage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stage-toolbar strong { color: var(--accent); }

.image-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 680px);
  aspect-ratio: 1 / 1;
  height: auto;
  margin: 0 auto;
  padding: 16px;
  border: 1px solid rgba(32, 36, 40, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(45deg, #d9dee2 25%, transparent 25%),
    linear-gradient(-45deg, #d9dee2 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d9dee2 75%),
    linear-gradient(-45deg, transparent 75%, #d9dee2 75%),
    #ffffff;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-size: 24px 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

#previewImage {
  display: block;
  position: absolute;
  inset: 16px;
  width: calc(100% - 32px);
  height: calc(100% - 32px);
  max-width: calc(100% - 32px);
  max-height: calc(100% - 32px);
  border-radius: 4px;
  object-fit: contain;
  object-position: center;
}

.empty-preview {
  display: grid;
  gap: 6px;
  padding: 20px;
  border: 1px dashed #9aa8b7;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  text-align: center;
}

.empty-preview strong { color: var(--ink); font-size: 18px; }


.preview-stats {
  width: min(100%, 680px);
  margin: 12px auto 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.preview-stats .panel-title {
  grid-column: 1 / -1;
}
.controls {
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  gap: 12px;
  min-height: 0;
  padding: 0;
  overflow: visible;
}

.brand {
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
}

.brand-logo {
  display: block;
  width: 174px;
  height: 106px;
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.brand-copy {
  display: grid;
  gap: 6px;
}

h1, h2, p { margin: 0; }

h1 {
  font-size: 21px;
  line-height: 1.2;
}

h2 {
  font-size: 13px;
  line-height: 1.2;
}

.brand p,
.hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.notice-button {
  justify-self: center;
  min-height: 34px;
  padding: 0 13px;
  border: 2px solid var(--neon-red);
  border-radius: 8px;
  background: #fff;
  color: var(--neon-red);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 0 0 3px rgba(255, 23, 79, 0.11);
}

.main-tools {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.file-drop {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  justify-items: stretch;
  text-align: left;
  gap: 8px;
  min-height: 118px;
  padding: 12px;
  border: 1px dashed #89949e;
  border-radius: 8px;
  background: #fbfbf7;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.file-drop:hover, .file-drop.dragover { border-color: var(--accent); background: #fff7f7; }

.file-drop input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-icon {
  display: grid;
  place-items: center;
  justify-self: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-size: 26px;
  line-height: 1;
  font-weight: 700;
}


.step-mark {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  vertical-align: middle;
}

.result-label .step-mark {
  width: 20px;
  height: 20px;
  font-size: 11px;
}
.file-title, .file-drop small { display: block; }
.file-title { color: var(--ink); font-size: 13px; font-weight: 900; justify-self: start; }
.file-drop small { margin-top: 0; color: var(--muted); font-size: 11px; line-height: 1.35; }

.panel {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf8;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-title span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.preset-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.preset-row button,
.copy-button {
  min-height: 30px;
  border: 1px solid #cfd6da;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.preset-row button:hover,
.copy-button:not(:disabled):hover { border-color: var(--accent); color: var(--accent); }

.size-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.size-grid label { position: relative; display: grid; gap: 5px; }
.size-grid label > span,
.stats span { color: #424b53; font-size: 11px; font-weight: 800; }

.size-grid input {
  width: 100%;
  min-height: 36px;
  padding: 0 34px 0 9px;
  border: 1px solid #cfd6da;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  outline: none;
}

.size-grid input:focus,
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 16, 16, 0.12); }

.size-grid label small {
  position: absolute;
  right: 9px;
  bottom: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.result-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 2px solid #aab4be;
  border-radius: 8px;
  background: #f7f9fb;
}

.result-card.ok { border-color: var(--ok); background: #ecf8f1; }
.result-card.caution { border-color: var(--caution); background: #fff6e6; }
.result-card.low { border-color: var(--low); background: #fff0eb; }
.result-card.bad { border-color: var(--bad); background: #fff0f3; }

.result-label { color: var(--muted); font-size: 12px; font-weight: 900; }
.result-text { color: var(--ink); font-size: 18px; line-height: 1.25; font-weight: 900; }
.result-detail { color: var(--muted); font-size: 12px; line-height: 1.45; }

.memo-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.memo-card textarea {
  font-size: 10px;
  line-height: 1.32;
}

.memo-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.contact-link {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  background: #fff;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.copy-button {
  height: 42px;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.copy-button:disabled { cursor: not-allowed; opacity: 0.45; }

.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  min-height: 0;
  margin-bottom: 18px;
}

.stats { align-content: start; gap: 8px; }
.stats div {
  display: grid;
  gap: 5px;
  min-width: 0;
  font-size: 11px;
}
.stats strong { color: var(--ink); text-align: left; font-size: 11px; line-height: 1.25; overflow-wrap: anywhere; }

.advice-panel { min-height: 0; padding-bottom: 18px; }
.advice-list {
  display: grid;
  gap: 6px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.advice-list li {
  color: #3f464d;
  font-size: 10px;
  line-height: 1.32;
}

.advice-list li::before {
  content: "•";
  color: var(--accent);
  font-weight: 900;
  margin-right: 5px;
}

.notice-dialog {
  width: min(520px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
}

.notice-dialog::backdrop {
  background: rgba(20, 24, 28, 0.42);
}

.notice-modal {
  display: grid;
  gap: 13px;
  padding: 20px;
  border: 2px solid var(--neon-red);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(20, 24, 28, 0.22);
}

.modal-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--neon-red);
  font-weight: 900;
}

.modal-title button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
}

.notice-modal p {
  color: #3f464d;
  font-size: 13px;
  line-height: 1.7;
}

@media (max-width: 1180px) {
  body { overflow: auto; }
  .app-shell {
    grid-template-columns: 1fr;
    width: min(760px, calc(100vw - 28px));
    height: auto;
    min-height: 0;
    margin: 14px auto;
  }
  .app-shell::after { display: none; }
  .preview-pane { grid-template-rows: 28px auto; padding-right: 0; border-right: 0; }
  .image-stage { width: min(100%, 420px); height: auto; }
}

@media (max-width: 620px) {
  .brand-logo { width: 152px; height: 91px; }
  h1 { font-size: 18px; }
  .main-tools,
  .memo-actions { grid-template-columns: 1fr; }
  .contact-link,
  .copy-button { height: 42px; }
}









[hidden] {
  display: none !important;
}
@media (max-width: 1180px) {
  .app-shell {
    display: flex;
    flex-direction: column;
  }

  .controls {
    display: contents;
  }

  .brand {
    order: 1;
  }

  .notice-button {
    order: 2;
    justify-self: center;
  }

  .main-tools {
    order: 3;
  }

  .preview-pane {
    order: 4;
    width: 100%;
  }

  .result-card {
    order: 5;
  }

  .info-grid {
    order: 6;
  }

  .memo-card {
    order: 7;
  }
}

