:root {
  color-scheme: dark;
  --bg: #101113;
  --panel: #1a1b1e;
  --input: #131416;
  --line: #333439;
  --ink: #f5f2ed;
  --muted: #b2b0ac;
  --accent: #ff6940;
  --focus: #ffb59f;
  font: 16px/1.65 "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); }
button, input, textarea, select { font: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
p, h1, h2 { margin: 0; }
h2 { font-size: 1.22rem; line-height: 1.4; letter-spacing: .025em; }
h2 + p { margin-top: .35rem; }
p { overflow-wrap: anywhere; }
img { display: block; }
[hidden] { display: none !important; }
.top { border-bottom: 1px solid #28292c; background: #151618; }
.nav {
  max-width: 1256px; margin: auto; min-height: 66px; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: inline-flex; align-items: center; gap: .75rem; font-weight: 850; letter-spacing: .06em; }
.mark { display: inline-flex; gap: 3px; padding: 1px 2px 1px 4px; transform: skew(-23deg); }
.mark i { width: 5px; height: 19px; background: var(--accent); }
.mark i:nth-child(2) { opacity: .70; }
.mark i:nth-child(3) { opacity: .45; }
#page-mode { font-size: .875rem; color: var(--muted); text-align: right; }
.shell { max-width: 1256px; margin: auto; padding: 0 28px; }
.intro { padding: 44px 0 34px; }
.eyebrow { color: #ff8d70; font: 750 .8rem/1.4 system-ui, sans-serif; letter-spacing: .16em; }
.eyebrow span { display: inline-block; width: 21px; height: 2px; margin-right: 7px; background: var(--accent); vertical-align: middle; }
.intro h1 { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.25; margin: 10px 0 12px; font-weight: 900; letter-spacing: .02em; }
.intro h1 span { color: var(--accent); }
.intro p, .muted { color: var(--muted); }
.workspace { display: grid; grid-template-columns: minmax(0, 1.48fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.editor-column, .side-stack { display: grid; gap: 18px; min-width: 0; }
#side { position: sticky; top: 16px; max-height: calc(100dvh - 32px); overflow-y: auto; scrollbar-width: thin; }
.card, .preview-card { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; min-width: 0; }
.card { padding: 23px; }
.small { font-size: .875rem; }
.accent { color: #ff9476; }
.upload {
  position: relative; cursor: pointer; display: grid; justify-items: center; align-content: center;
  min-height: 172px; padding: 14px; gap: 4px; margin-top: 16px;
  border: 1px dashed #865446; border-radius: 9px; background: #201b1b; text-align: center;
}
.upload:hover, .upload.drag, .upload:focus-within { background: #2c211e; border-color: var(--focus); }
.upload input { position: absolute; width: 100%; height: 100%; inset: 0; opacity: 0; cursor: pointer; }
.upload-marker {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px;
  border: 1px solid #664337; color: #ff8967; background: #34231f; font-size: 1.45rem; line-height: 1;
}
#upload-limit { color: var(--muted); font-size: .875rem; }
.upload[aria-busy=true] { cursor: progress; }
.upload-feedback:not(:empty) { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: #25262a; white-space: pre-wrap; overflow-wrap: anywhere; }
.upload-feedback.uploading { display: flex; align-items: center; gap: 10px; color: var(--focus); }
.upload-feedback.uploading::before {
  content: ""; flex: 0 0 1em; height: 1em; border: 2px solid #815443;
  border-top-color: var(--focus); border-radius: 50%; animation: upload-spin .85s linear infinite;
}
.upload-feedback.error { color: #ffc6b5; background: #35201d; }
@keyframes upload-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .upload-feedback.uploading::before { animation: none; } }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.field { display: grid; gap: 5px; margin-top: 12px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field > span { font-size: .875rem; font-weight: 700; }
.field input:not([type=range]), .field select, .field textarea, .url-box input {
  width: 100%; min-width: 0; padding: 10px 12px; border-radius: 7px;
  border: 1px solid var(--line); background: var(--input); color: var(--ink);
}
.field select {
  appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.field textarea { resize: vertical; }
::placeholder { color: #92918e; opacity: 1; }
button, .secondary, .primary, .quiet, .danger {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 8px 13px; border-radius: 7px; border: 1px solid transparent;
  color: var(--ink); background: transparent; cursor: pointer; font-weight: 750; text-align: center;
}
button:disabled { opacity: .47; cursor: default; }
.primary { background: var(--accent); color: #1b100c; }
.primary:hover:not(:disabled) { background: #ff855f; }
.secondary { background: #25262a; border-color: #404146; }
.secondary:hover:not(:disabled), .quiet:hover:not(:disabled) { background: #35363a; }
.quiet { color: #ddd5cf; }
.danger { color: #ffad9e; border-color: #69413c; }
.danger:hover:not(:disabled) { background: #432727; }
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 15px 17px; }
.preview-head h2 { font-size: 1rem; }
#photo-count { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .875rem; }
.mini { position: relative; aspect-ratio: 16/10; background: #131417; overflow: hidden; }
.mini img, .hero > img, .adjust-image img { width: 100%; height: 100%; }
.photo-empty {
  display: grid; place-items: center; width: 100%; height: 100%;
  background: linear-gradient(138deg, #333439, #202125 70%);
  color: #c4c1bd; font: 700 .75rem/1.4 system-ui, sans-serif; letter-spacing: .19em;
}
.photo-empty::before {
  content: ""; position: absolute; inset: 10px; border: 1px solid #ffffff25;
  background: linear-gradient(transparent 49.8%, #fff1 50%, transparent 50.2%),
              linear-gradient(90deg, transparent 49.8%, #fff1 50%, transparent 50.2%);
}
.mini-caption, .hero-copy {
  position: absolute; inset: auto 0 0; display: grid; gap: 2px; padding: 24px 17px 15px;
  background: linear-gradient(transparent, #090a0bea);
  overflow-wrap: anywhere; pointer-events: none;
}
.mini-caption span { color: #ff977c; font-size: .875rem; }
.mini-caption strong { font-size: 1.55rem; line-height: 1.2; }
.mini-caption span:empty { display: none; }
.preview-actions { padding: 17px; text-align: center; }
.preview-actions button { width: 100%; min-height: 48px; }
.preview-actions p { color: var(--muted); font-size: .875rem; margin-top: 8px; }
#notice { white-space: pre-wrap; color: #f3d3c9; overflow-wrap: anywhere; }
#notice:empty { display: none; }
#preview-error:empty { display: none; }
#preview-error:not(:empty) { color: #ffc6b5; text-align: left; }
#notice.error { padding: 10px 12px; border: 1px solid #8d564b; border-radius: 8px; color: #ffc6b5; background: #35201d; }
#management:empty { display: none; }
.tray { display: flex; flex-wrap: wrap; gap: 8px; }
.tray:not(:empty) { margin: 13px 0; }
.tile { position: relative; width: 73px; height: 52px; padding: 0; overflow: hidden; border: 1px solid var(--line); background: var(--input); }
.tile[aria-pressed=true] { outline: 2px solid var(--accent); outline-offset: 1px; }
.tile img { width: 100%; height: 100%; }
.tile span { position: absolute; bottom: 2px; right: 4px; padding: 0 4px; background: #111d; font-size: .75rem; }
.adjust-image { aspect-ratio: 16/10; max-height: 320px; overflow: hidden; border-radius: 8px; background: var(--input); }
.blur-editor { padding-top: 8px; border-top: 1px solid var(--line); }
.blur-frame { position: relative; width: 100%; margin-top: 8px; touch-action: none; cursor: crosshair; user-select: none; }
.blur-frame img { width: 100%; height: auto; pointer-events: none; }
.blur-selection, .blur-outline { position: absolute; border: 2px solid var(--accent); pointer-events: none; }
.blur-selection { background: #ff694035; }
.blur-outline { border-color: #ffd5c8; box-shadow: 0 0 0 1px #151618; }
.blur-list { display: grid; gap: 6px; margin-top: 6px; }
.blur-range-row { display: flex; flex-wrap: wrap; gap: 8px; }
.blur-range-row .danger { min-width: 70px; }
.blur-list button[aria-pressed=true] { color: var(--focus); border-color: var(--accent); }
.blur-editor > button { margin-top: 8px; }
.blur-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; margin: 8px 0; }
.blur-button-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0; }
.blur-button-group button { min-width: 0; padding-inline: 5px; font-size: .875rem; }
.adjust-bar, .management-buttons, .external-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.range span { display: flex; justify-content: space-between; gap: 6px; }
.range input { accent-color: var(--accent); width: 100%; min-height: 29px; margin: 0; }
.check { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 8px 0; cursor: pointer; }
.check input { flex: 0 0 auto; width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--accent); }
.link-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr) auto; align-items: end; gap: 8px; }
#add-link { margin-top: 13px; }
.callout { margin-top: 12px; padding: 9px 12px; border-left: 3px solid var(--accent); background: #29201f; }
.url-box { display: grid; gap: 4px; margin-top: 13px; }
.url-box button { justify-self: start; }
#management .card > a { margin-top: 8px; }
details { margin-top: 12px; }
summary { cursor: pointer; min-height: 40px; align-content: center; color: #ffb09b; }
.restore { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.restore img { width: 75px; height: 52px; background: var(--input); border-radius: 6px; }
.site-footer { padding: 26px 0; color: var(--muted); font-size: .875rem; }
.profile { max-width: 1256px; padding: 0 28px; margin: 20px auto 36px; }
.hero {
  position: relative; aspect-ratio: 16/9; min-height: 290px; max-height: 72dvh;
  background: var(--input); overflow: hidden; border-radius: 13px; touch-action: pan-y pinch-zoom;
}
.hero-copy { padding: 65px 24px 20px; }
.hero:has(.slide-controls) .hero-copy { padding-bottom: 73px; }
.hero-copy h1 { font-size: clamp(1.9rem, 6vw, 4rem); line-height: 1.13; }
.slide-controls { position: absolute; bottom: 10px; left: 13px; display: flex; align-items: center; gap: 6px; }
.slide-controls .secondary { background: #1b1b1eee; }
.slide-controls span { font-variant-numeric: tabular-nums; padding: 3px 6px; color: white; background: #1b1b1eee; border-radius: 5px; font-size: .875rem; }
.profile-body { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.profile-body > :is(.gallery-section, .ad-slot, .report) { grid-column: 1 / -1; }
.specs { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 5px 14px; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; overflow-wrap: anywhere; }
.prose, figcaption { white-space: pre-wrap; overflow-wrap: anywhere; }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.gallery figure { min-width: 0; margin: 0; }
.gallery img { width: 100%; aspect-ratio: 16/10; background: var(--input); border-radius: 7px; }
figcaption { padding-top: 7px; color: var(--muted); }
.ad-slot { display: grid; place-items: center; min-height: 88px; border: 1px dashed #4c4c51; border-radius: 8px; color: var(--muted); font-size: .875rem; }
.report { max-width: 500px; }
.report button, .consent-form > button { margin-top: 10px; }
.preview-banner {
  position: sticky; z-index: 1; top: 0; display: flex; justify-content: space-between; align-items: center;
  gap: 10px; background: #201a18; border-bottom: 1px solid #684636; padding: 8px max(14px, calc((100% - 1200px)/2));
}
.consent-form { width: min(840px, calc(100% - 28px)); margin: 0 auto 36px; }
.share-settings { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.share-settings h3 { font-size: 1rem; margin: 0; }
.share-card { overflow: hidden; width: min(100%, 430px); margin-top: 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--input); }
.share-card img { width: 100%; aspect-ratio: 1200 / 630; object-fit: contain; }
.share-card-text { padding: 9px 12px; overflow-wrap: anywhere; }
fieldset { min-width: 0; margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
fieldset img { width: min(100%, 230px); aspect-ratio: 16/10; border-radius: 7px; background: var(--input); }
.empty-state { padding-top: 40px; }
.empty-state p { margin: 12px 0; }
@media (max-width: 760px) {
  .workspace, .profile-body { grid-template-columns: minmax(0, 1fr); }
  #side { position: static; max-height: none; overflow: visible; }
  .nav, .shell, .profile { padding-inline: 15px; }
  .nav { min-height: 56px; }
  .brand { gap: .5rem; font-size: .95rem; }
  #page-mode { font-size: .81rem; }
  .intro { padding: 29px 0 22px; }
  .card { padding: 16px; }
  .workspace, .editor-column { gap: 13px; }
  .profile { margin-top: 12px; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-copy { padding-inline: 13px; }
  .color-editor .adjust-image { position: sticky; top: 0; z-index: 1; max-height: 25dvh; }
}
@media (max-width: 380px) {
  .fields { grid-template-columns: minmax(0, 1fr); }
  .link-row { grid-template-columns: minmax(0, 1fr); }
  .link-row button { justify-self: end; }
}
@media (max-width: 540px) {
  .blur-tools { grid-template-columns: minmax(0, 1fr); }
}

.profile-body > .profile-actions { grid-column: 1 / -1; display: flex; justify-content: center; }
