:root {
  color-scheme: light;
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #18222d;
  --muted: #607080;
  --line: #d8e0e7;
  --accent: #176c9d;
  --accent-strong: #0d5b86;
  --soft: #edf7fc;
  --warn: #8a5a00;
}

* {
  box-sizing: border-box;
}

body.image-resize-tool {
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  margin: 0;
}

.irt-shell {
  margin: 0 auto;
  max-width: 1120px;
  padding: 1rem;
}

.irt-hero,
.irt-panel,
.irt-controls,
.irt-card,
.irt-comments,
.irt-related,
.irt-return a {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.irt-hero,
.irt-panel,
.irt-controls,
.irt-card,
.irt-comments,
.irt-related {
  padding: 1rem;
}

.irt-hero {
  margin: 1rem 0;
}

.irt-kicker {
  color: var(--accent-strong);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  margin: 0 0 .3rem;
  text-transform: uppercase;
}

h1,
h2,
p,
li,
a,
button,
input,
select {
  overflow-wrap: anywhere;
}

h1 {
  font-size: clamp(1.75rem, 5vw, 2.8rem);
  line-height: 1.18;
  margin: 0 0 .75rem;
}

h2 {
  font-size: 1.25rem;
  line-height: 1.35;
  margin: 0 0 .75rem;
}

.irt-lead,
.irt-note,
.irt-status {
  color: var(--muted);
}

.irt-workspace {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
}

.irt-preview {
  align-items: center;
  background: #eef3f7;
  border: 1px dashed #b7c7d3;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  min-height: 320px;
  overflow: auto;
  padding: .75rem;
}

canvas {
  background: #fff;
  display: block;
  height: auto;
  max-width: 100%;
}

.irt-controls {
  display: grid;
  gap: .85rem;
}

label {
  color: var(--muted);
  display: grid;
  gap: .3rem;
  font-size: .92rem;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  min-height: 2.65rem;
  min-width: 0;
  padding: .55rem .65rem;
  width: 100%;
}

button {
  align-items: center;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 7px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  min-height: 2.6rem;
  min-width: 0;
  padding: .55rem .8rem;
}

button.secondary {
  background: #f8fafc;
  border-color: var(--line);
  color: var(--ink);
}

.irt-two {
  display: grid;
  gap: .7rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.irt-check {
  align-items: center;
  color: var(--ink);
  display: flex;
  gap: .5rem;
}

.irt-check input {
  min-height: auto;
  width: auto;
}

.irt-actions,
.irt-link-grid,
.irt-return {
  display: grid;
  gap: .65rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.irt-actions {
  margin-top: .9rem;
}

.irt-meta {
  display: grid;
  gap: .6rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.irt-meta div,
.irt-link-grid a,
.irt-return a {
  background: var(--soft);
  border-radius: 8px;
  color: var(--ink);
  display: block;
  padding: .75rem;
  text-decoration: none;
}

.irt-meta span,
.irt-link-grid span,
.irt-return span,
.irt-return small {
  color: var(--muted);
  display: block;
}

.irt-status {
  background: #fffaf0;
  border: 1px solid #f0d8a8;
  border-radius: 8px;
  color: var(--warn);
  margin: .85rem 0 0;
  padding: .75rem;
}

.ad-row {
  margin: 1rem 0;
  min-height: 250px;
}

.ad-label {
  color: var(--muted);
  font-size: .75rem;
  text-align: center;
}

.irt-card,
.irt-related,
.irt-comments,
.irt-return {
  margin-top: 1rem;
}

.irt-footer {
  color: var(--muted);
  font-size: .85rem;
  padding: 1rem 0 2rem;
  text-align: center;
}

@media (max-width: 860px) {
  .irt-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .irt-shell {
    padding: .75rem;
  }

  .irt-hero,
  .irt-panel,
  .irt-controls,
  .irt-card,
  .irt-comments,
  .irt-related {
    padding: .85rem;
  }

  .irt-two,
  .irt-meta,
  .irt-actions {
    grid-template-columns: 1fr;
  }
}
